UNPKG

827 kBJavaScriptView Raw
1/******/ (function(modules) { // webpackBootstrap
2/******/ // The module cache
3/******/ var installedModules = {};
4/******/
5/******/ // The require function
6/******/ function __webpack_require__(moduleId) {
7/******/
8/******/ // Check if module is in cache
9/******/ if(installedModules[moduleId])
10/******/ return installedModules[moduleId].exports;
11/******/
12/******/ // Create a new module (and put it into the cache)
13/******/ var module = installedModules[moduleId] = {
14/******/ exports: {},
15/******/ id: moduleId,
16/******/ loaded: false
17/******/ };
18/******/
19/******/ // Execute the module function
20/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
21/******/
22/******/ // Flag the module as loaded
23/******/ module.loaded = true;
24/******/
25/******/ // Return the exports of the module
26/******/ return module.exports;
27/******/ }
28/******/
29/******/
30/******/ // expose the modules object (__webpack_modules__)
31/******/ __webpack_require__.m = modules;
32/******/
33/******/ // expose the module cache
34/******/ __webpack_require__.c = installedModules;
35/******/
36/******/ // __webpack_public_path__
37/******/ __webpack_require__.p = "";
38/******/
39/******/ // Load entry module and return exports
40/******/ return __webpack_require__(0);
41/******/ })
42/************************************************************************/
43/******/ ([
44/* 0 */
45/***/ (function(module, exports, __webpack_require__) {
46
47 'use strict';
48
49 var _beeLayout = __webpack_require__(1);
50
51 var _beePanel = __webpack_require__(8);
52
53 var _beeButton = __webpack_require__(82);
54
55 var _beeButton2 = _interopRequireDefault(_beeButton);
56
57 var _react = __webpack_require__(4);
58
59 var _react2 = _interopRequireDefault(_react);
60
61 var _reactDom = __webpack_require__(12);
62
63 var _reactDom2 = _interopRequireDefault(_reactDom);
64
65 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
66
67 function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
68
69 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
70
71 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
72
73 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
74
75 var CARET = _react2['default'].createElement('i', { className: 'uf uf-arrow-down' });
76
77 var CARETUP = _react2['default'].createElement('i', { className: 'uf uf-arrow-up' });
78
79 var Demo1 = __webpack_require__(84);var Demo2 = __webpack_require__(191);var Demo3 = __webpack_require__(192);var Demo4 = __webpack_require__(193);var Demo5 = __webpack_require__(196);var Demo6 = __webpack_require__(197);var Demo7 = __webpack_require__(198);var Demo8 = __webpack_require__(199);var Demo9 = __webpack_require__(200);var Demo90 = __webpack_require__(201);var Demo91 = __webpack_require__(202);var Demo92 = __webpack_require__(203);var DemoArray = [{ "example": _react2['default'].createElement(Demo1, null), "title": " 基础拖拽", "code": "\r\n/**\r\n *\r\n * @title 基础拖拽\r\n * @description 将某个元素设置为可拖拽\r\n *\r\n */\r\n\r\nimport React, { Component } from 'react';\r\n\nimport Dnd from \"tinper-bee/lib/Dnd\";\nimport { Button } from 'tinper-bee';\r\n\r\nclass Demo1 extends Component {\r\n\r\n onStart=()=>{\r\n console.log('start');\r\n }\r\n onStop=()=>{\r\n console.log('stop');\r\n }\r\n render() {\r\n return (\r\n <div>\r\n <Dnd onStart={this.onStart} onStop={this.onStop}>\r\n <div className=\"demo\">我可随意拖拽</div>\r\n </Dnd>\r\n </div>\r\n\r\n );\r\n }\r\n}\r\n\r\n", "desc": " 将某个元素设置为可拖拽", "scss_code": ".demo {\r\n width:167px;\r\n height:32px;\r\n background:rgba(247,249,251,1);\r\n border-radius:3px;\r\n border:1px solid rgba(165,173,186,1);\r\n line-height: 32px;\r\n font-size: 12px;\r\n color: #212121;\r\n text-align: center;\r\n cursor: grab;\r\n &:hover{\r\n background:rgba(235,236,240,1);\r\n border-radius:3px;\r\n }\r\n}\r\n/*拖动状态*/\r\n.react-draggable-transparent-selection{\r\n .demo{\r\n box-shadow:0px 2px 4px 0px rgba(31,37,52,0.3);\r\n opacity:0.8;\r\n cursor: grabbing;\r\n }\r\n}" }, { "example": _react2['default'].createElement(Demo2, null), "title": " 单个元素沿x轴y轴拖拽", "code": "\r\n/**\r\n *\r\n * @title 单个元素沿x轴y轴拖拽\r\n * @description 设置axis=\"x\"只可以沿着x轴拖拽,同理axis=\"y\"只可以沿着y轴拖拽\r\n *\r\n */\r\n\r\nimport React, { Component } from 'react';\r\n\nimport Dnd from \"tinper-bee/lib/Dnd\";\nimport { Button } from 'tinper-bee';\r\n\r\nclass Demo2 extends Component {\r\n\r\n onStart=()=>{\r\n console.log('start');\r\n }\r\n onStop=()=>{\r\n console.log('stop');\r\n }\r\n render() {\r\n return (\r\n <div>\r\n <Dnd axis=\"x\" onStart={this.onStart} onStop={this.onStop}>\r\n <div className=\"demo\">我只可延X轴拖拽</div>\r\n </Dnd>\r\n </div>\r\n\r\n );\r\n }\r\n}\r\n\r\n", "desc": " 设置axis=\"x\"只可以沿着x轴拖拽,同理axis=\"y\"只可以沿着y轴拖拽", "scss_code": ".demo {\r\n width:167px;\r\n height:32px;\r\n background:rgba(247,249,251,1);\r\n border-radius:3px;\r\n border:1px solid rgba(165,173,186,1);\r\n line-height: 32px;\r\n font-size: 12px;\r\n color: #212121;\r\n text-align: center;\r\n cursor: grab;\r\n &:hover{\r\n background:rgba(235,236,240,1);\r\n border-radius:3px;\r\n }\r\n}\r\n/*拖动状态*/\r\n.react-draggable-transparent-selection{\r\n .demo{\r\n box-shadow:0px 2px 4px 0px rgba(31,37,52,0.3);\r\n opacity:0.8;\r\n cursor: grabbing;\r\n }\r\n}" }, { "example": _react2['default'].createElement(Demo3, null), "title": " 设置元素不可拖拽", "code": "\r\n/**\r\n *\r\n * @title 设置元素不可拖拽\r\n * @description 设置 onStart 的返回值为false,则不可以拖拽\r\n *\r\n */\r\n\r\nimport React, { Component } from 'react';\r\n\nimport Dnd from \"tinper-bee/lib/Dnd\";\nimport { Button } from 'tinper-bee';\r\n\r\nclass Demo3 extends Component {\r\n\r\n onStart=()=>{\r\n console.log('start');\r\n return false;\r\n }\r\n onStop=()=>{\r\n console.log('stop');\r\n }\r\n render() {\r\n return (\r\n <div className=\"demo-3\">\r\n <Dnd onStart={this.onStart} onStop={this.onStop}>\r\n <div className=\"demo3 demo\">我不可以拖拽</div>\r\n </Dnd>\r\n </div>\r\n\r\n );\r\n }\r\n}\r\n", "desc": " 设置 onStart 的返回值为false,则不可以拖拽", "scss_code": ".demo-3{\r\n .demo3:hover{\r\n background:rgba(247,249,251,1);\r\n cursor: not-allowed;\r\n }\r\n}" }, { "example": _react2['default'].createElement(Demo4, null), "title": " 单个元素拖拽把手", "code": "/**\r\n *\r\n * @title 单个元素拖拽把手\r\n * @description 设置 handle,值为选择器,例如 '.handle'\r\n * 设置不可拖拽区域 cancel,值为选择器,例如 '.handle'\r\n */\r\n\r\nimport React, { Component } from 'react';\r\n\nimport Dnd from \"tinper-bee/lib/Dnd\";\nimport { Icon } from 'tinper-bee';\r\n\r\nclass Demo4 extends Component {\r\n\r\n onStart=()=>{\r\n console.log('start');\r\n }\r\n onStop=()=>{\r\n console.log('stop');\r\n }\r\n\r\n render() {\r\n return (\r\n <div className=\"demo-4\">\r\n <div>\r\n <Dnd handle=\".handle\" onStart={this.onStart} onStop={this.onStop}>\r\n <div className=\"demo4 demo\">\r\n 需要拖拽把手\r\n <div className=\"handle\"><Icon type=\"uf-move\"></Icon></div>\r\n </div>\r\n </Dnd>\r\n </div>\r\n </div>\r\n\r\n\r\n );\r\n }\r\n}\r\n\r\n", "desc": " 设置 handle,值为选择器,例如 '.handle'", "scss_code": "\r\n.demo-4 .demo4 {\r\n position: relative;\r\n cursor: default;\r\n &:hover{\r\n background:rgba(247,249,251,1);\r\n cursor: default;\r\n }\r\n}\r\n\r\n.demo4 .handle {\r\n position: absolute;\r\n right: -1px;\r\n top: -1px;\r\n height: 32px;\r\n line-height: 30px;\r\n background:rgba(223,225,230,1);\r\n border-radius:0px 3px 3px 0px;\r\n border:1px solid rgba(165,173,186,1);\r\n cursor: grab;\r\n &:hover{\r\n background:rgba(179,186,197,1);\r\n }\r\n}\r\n/*拖动状态*/\r\n.react-draggable-transparent-selection{\r\n .demo4 .handle{\r\n background:rgba(179,186,197,1);\r\n cursor: grabbing;\r\n }\r\n}" }, { "example": _react2['default'].createElement(Demo5, null), "title": " 每次拖拽移动距离", "code": "\r\n/**\r\n *\r\n * @title 每次拖拽移动距离\r\n * @description 设置 grid={[x,y]}\r\n *\r\n */\r\n\r\nimport React, { Component } from 'react';\r\n\nimport Dnd from \"tinper-bee/lib/Dnd\";\nimport { Button } from 'tinper-bee';\r\n\r\nclass Demo5 extends Component {\r\n\r\n onStart=()=>{\r\n console.log('start');\r\n }\r\n onStop=()=>{\r\n console.log('stop');\r\n }\r\n render() {\r\n return (\r\n <div>\r\n <Dnd grid={[25, 25]} onStart={this.onStart} onStop={this.onStop}>\r\n <div className=\"demo\">我每次拖拽可移动25px</div>\r\n </Dnd>\r\n </div>\r\n\r\n );\r\n }\r\n}\r\n\r\n", "desc": " 设置 grid={[x,y]}", "scss_code": ".demo {\r\n width:167px;\r\n height:32px;\r\n background:rgba(247,249,251,1);\r\n border-radius:3px;\r\n border:1px solid rgba(165,173,186,1);\r\n line-height: 32px;\r\n font-size: 12px;\r\n color: #212121;\r\n text-align: center;\r\n cursor: grab;\r\n &:hover{\r\n background:rgba(235,236,240,1);\r\n border-radius:3px;\r\n }\r\n}\r\n/*拖动状态*/\r\n.react-draggable-transparent-selection{\r\n .demo{\r\n box-shadow:0px 2px 4px 0px rgba(31,37,52,0.3);\r\n opacity:0.8;\r\n cursor: grabbing;\r\n }\r\n}" }, { "example": _react2['default'].createElement(Demo6, null), "title": " 元素拖拽范围", "code": "\r\n/**\r\n *\r\n * @title 元素拖拽范围\r\n * @description 设置上下左右可拖拽范围 bounds={{top: -xxx, left: -xxx, right: xxx, bottom: xx}}\r\n *\r\n */\r\n\r\nimport React, { Component } from 'react';\r\nimport Dnd from \"tinper-bee/lib/Dnd\";\r\n\r\nclass Demo6 extends Component {\r\n\r\n onStart=()=>{\r\n console.log('start');\r\n }\r\n onStop=()=>{\r\n console.log('stop');\r\n }\r\n render() {\r\n return (\r\n <div className=\"demo6\">\r\n <Dnd bounds={{top: -50, left: -50, right: 50, bottom: 50}} onStart={this.onStart} onStop={this.onStop}>\r\n <div className=\"demo\">我只能再上下左右50px内移动</div>\r\n </Dnd>\r\n </div>\r\n\r\n );\r\n }\r\n}\r\n\r\n", "desc": " 设置上下左右可拖拽范围 bounds={{top: -xxx, left: -xxx, right: xxx, bottom: xx}}", "scss_code": ".demo {\r\n width:167px;\r\n height:32px;\r\n background:rgba(247,249,251,1);\r\n border-radius:3px;\r\n border:1px solid rgba(165,173,186,1);\r\n line-height: 32px;\r\n font-size: 12px;\r\n color: #212121;\r\n text-align: center;\r\n cursor: grab;\r\n &:hover{\r\n background:rgba(235,236,240,1);\r\n border-radius:3px;\r\n }\r\n}\r\n/*拖动状态*/\r\n.react-draggable-transparent-selection{\r\n .demo{\r\n box-shadow:0px 2px 4px 0px rgba(31,37,52,0.3);\r\n opacity:0.8;\r\n cursor: grabbing;\r\n }\r\n}\r\n.demo6{\r\n height: 100px;\r\n}" }, { "example": _react2['default'].createElement(Demo7, null), "title": " 在指定容器中拖拽", "code": "\r\n/**\r\n *\r\n * @title 在指定容器中拖拽\r\n * @description 设置只可以在指定容器中移动\r\n * bounds的也可以设置为选择器,bounds=\".demo8-parent\"意为在class=demo8-parent的容器中移动\r\n */\r\n\r\nimport React, { Component } from 'react';\r\n\nimport Dnd from \"tinper-bee/lib/Dnd\";\nimport { Button } from 'tinper-bee';\r\n\r\nclass Demo7 extends Component {\r\n\r\n onStart=()=>{\r\n console.log('start');\r\n }\r\n onStop=()=>{\r\n console.log('stop');\r\n }\r\n render() {\r\n return (\r\n <div>\r\n <div className=\"demo7-parent\">\r\n <Dnd bounds=\".demo7-parent\" onStart={this.onStart} onStop={this.onStop}>\r\n <div className=\"demo\">我只能在父级元素中移动</div>\r\n </Dnd>\r\n </div>\r\n </div>\r\n\r\n\r\n );\r\n }\r\n}\r\n\r\n", "desc": " 设置只可以在指定容器中移动", "scss_code": ".demo {\r\n width:167px;\r\n height:32px;\r\n background:rgba(247,249,251,1);\r\n border-radius:3px;\r\n border:1px solid rgba(165,173,186,1);\r\n line-height: 32px;\r\n font-size: 12px;\r\n color: #212121;\r\n text-align: center;\r\n cursor: grab;\r\n &:hover{\r\n background:rgba(235,236,240,1);\r\n border-radius:3px;\r\n }\r\n}\r\n/*拖动状态*/\r\n.react-draggable-transparent-selection{\r\n .demo{\r\n box-shadow:0px 2px 4px 0px rgba(31,37,52,0.3);\r\n opacity:0.8;\r\n cursor: grabbing;\r\n }\r\n}\r\n\r\n.demo7-parent {\r\n width: 300px;\r\n height: 200px;\r\n background: rgba(247,249,251,1);\r\n border: 1px solid rgba(235,236,240,1);\r\n position: relative;\r\n}" }, { "example": _react2['default'].createElement(Demo8, null), "title": " 数据集合拖拽列表排序", "code": "/**\r\n *\r\n * @title 数据集合拖拽列表排序\r\n * @description 增加list 可以为 [1,2,3]数组,\r\n * 也可以为 [{},{}...],需要配置 showKey 。\r\n * 也可以为 dom集合,见后边示例\r\n *\r\n */\r\n\r\nimport React, { Component } from 'react';\r\nimport Dnd from \"tinper-bee/lib/Dnd\";\r\n\r\nclass Demo8 extends Component {\r\n \r\n onDragStart=(result,list)=>{\r\n console.log('开始');\r\n }\r\n onDragEnd=(result,list)=>{ \r\n console.log('结束');\r\n }\r\n onDragUpdate=(result)=>{\r\n console.log('update')\r\n }\r\n render() {\r\n let list=[\r\n {\r\n name:'第一',\r\n code:'a'\r\n },\r\n {\r\n name:'第二',\r\n code:'b'\r\n },\r\n {\r\n name:'第三',\r\n code:'c'\r\n },\r\n {\r\n name:'第四',\r\n code:'d'\r\n },\r\n {\r\n name:'第五',\r\n code:'e'\r\n },\r\n ];\r\n return (\r\n <Dnd showKey='name' list={list} onDragUpdate={this.onDragUpdate} onStart={this.onDragStart} onStop={this.onDragEnd}/>\r\n );\r\n }\r\n}\r\n\r\n", "desc": " 增加list 可以为 [1,2,3]数组,", "scss_code": "" }, { "example": _react2['default'].createElement(Demo9, null), "title": " DOM集合拖拽列表排序", "code": "\r\n/**\r\n *\r\n * @title DOM集合拖拽列表排序\r\n * @description list传dom集合\r\n *\r\n */\r\n\r\nimport React, { Component } from 'react';\r\nimport Dnd from \"tinper-bee/lib/Dnd\";\r\n\r\nclass Demo9 extends Component {\r\n\r\n onDragStart=(result,list)=>{\r\n console.log('开始');\r\n }\r\n onDragEnd=(result,list)=>{\r\n console.log('结束');\r\n }\r\n render() {\r\n let list=[<div>DOM第一</div>,<div>DOM第二</div>,<div>DOM第三</div>,<div>DOM第四</div>,<div>DOM第五</div>];\r\n return (\r\n <Dnd list={list} onStart={this.onDragStart} onStop={this.onDragEnd} />\r\n );\r\n }\r\n}\r\n\r\n", "desc": " list传dom集合" }, { "example": _react2['default'].createElement(Demo90, null), "title": " 横向拖拽列表排序", "code": "\r\n/**\r\n *\r\n * @title 横向拖拽列表排序\r\n * @description type='horizontal'\r\n *\r\n */\r\n\r\nimport React, { Component } from 'react';\nimport { } from 'tinper-bee';\r\nimport Dnd from \"tinper-bee/lib/Dnd\";;\r\n\r\nclass Demo90 extends Component {\r\n\r\n render() {\r\n let list=['第一','第二','第三','第四','第五'];\r\n return (\r\n <Dnd list={list} type='horizontal' />\r\n );\r\n }\r\n}\r\n\r\n", "desc": " type='horizontal'" }, { "example": _react2['default'].createElement(Demo91, null), "title": " 两列纵向拖拽", "code": "\r\n/**\r\n *\r\n * @title 两列纵向拖拽\r\n * @description 设置 type='betweenVertical'。 如果不设置高度以及 overflow: scroll; 则高度会自动撑开\r\n *\r\n */\r\n\r\nimport React, { Component } from 'react';\nimport { } from 'tinper-bee';\r\nimport Dnd from \"tinper-bee/lib/Dnd\";;\r\n\r\nclass Demo90 extends Component {\r\n\r\n render() {\r\n let list1=['第一','第二','第三','第四','第五'];\r\n let list2=['1','2','3','4','5'];\r\n return (\r\n <Dnd className='demo91' list={list1} otherList={list2} type='betweenVertical' />\r\n );\r\n }\r\n}\r\n\r\n", "desc": " 设置 type='betweenVertical'。 如果不设置高度以及 overflow: scroll; 则高度会自动撑开", "scss_code": ".u-drop{\r\n overflow: scroll;\r\n}\r\n.u-drag-between{\r\n height: 300px;\r\n}" }, { "example": _react2['default'].createElement(Demo92, null), "title": " 两列横向拖拽", "code": "\r\n/**\r\n *\r\n * @title 两列横向拖拽\r\n * @description 设置 type='betweenVertical'\r\n *\r\n */\r\n\r\nimport React, { Component } from 'react';\nimport { } from 'tinper-bee';\r\nimport Dnd from \"tinper-bee/lib/Dnd\";;\r\n\r\nclass Demo90 extends Component {\r\n onDragStart=(result,list)=>{\r\n console.log('开始');\r\n }\r\n onDragEnd=(result,listObj)=>{\r\n console.log('结束');\r\n console.log(listObj)\r\n }\r\n render() {\r\n let list1=['第一','第二','第三','第四','第五'];\r\n let list2=['1','2','3','4','5'];\r\n return (\r\n <Dnd list={list1} otherList={list2} type='betweenHorizontal' onStart={this.onDragStart} onStop={this.onDragEnd} />\r\n );\r\n }\r\n}\r\n\r\n", "desc": " 设置 type='betweenVertical'", "scss_code": ".u-drop{\r\n overflow: scroll;\r\n}\r\n.u-drag-between-horizontal{\r\n height: 200px;\r\n}" }];
80
81 var Demo = function (_Component) {
82 _inherits(Demo, _Component);
83
84 function Demo(props) {
85 _classCallCheck(this, Demo);
86
87 var _this = _possibleConstructorReturn(this, _Component.call(this, props));
88
89 _this.state = {
90 open: false
91 };
92 _this.handleClick = _this.handleClick.bind(_this);
93 return _this;
94 }
95
96 Demo.prototype.handleClick = function handleClick() {
97 this.setState({ open: !this.state.open });
98 };
99
100 Demo.prototype.render = function render() {
101 var _props = this.props,
102 title = _props.title,
103 example = _props.example,
104 code = _props.code,
105 desc = _props.desc,
106 scss_code = _props.scss_code;
107
108 var caret = this.state.open ? CARETUP : CARET;
109 var text = this.state.open ? "隐藏代码" : "查看代码";
110
111 var header = _react2['default'].createElement(
112 'div',
113 null,
114 example,
115 _react2['default'].createElement(
116 _beeButton2['default'],
117 { style: { "marginTop": "10px" }, shape: 'block', onClick: this.handleClick },
118 caret,
119 text
120 )
121 );
122 return _react2['default'].createElement(
123 _beeLayout.Col,
124 { md: 12, id: title.trim() },
125 _react2['default'].createElement(
126 'h3',
127 null,
128 title
129 ),
130 _react2['default'].createElement(
131 'p',
132 null,
133 desc
134 ),
135 _react2['default'].createElement(
136 _beePanel.Panel,
137 { copyable: true, collapsible: true, headerContent: true, expanded: this.state.open, colors: 'bordered', header: header, footerStyle: { padding: 0 } },
138 _react2['default'].createElement(
139 'pre',
140 null,
141 _react2['default'].createElement(
142 'code',
143 { className: 'hljs javascript' },
144 code
145 )
146 ),
147 !!scss_code ? _react2['default'].createElement(
148 'pre',
149 null,
150 _react2['default'].createElement(
151 'code',
152 { className: 'hljs css' },
153 scss_code
154 )
155 ) : null
156 )
157 );
158 };
159
160 return Demo;
161 }(_react.Component);
162
163 var DemoGroup = function (_Component2) {
164 _inherits(DemoGroup, _Component2);
165
166 function DemoGroup(props) {
167 _classCallCheck(this, DemoGroup);
168
169 return _possibleConstructorReturn(this, _Component2.call(this, props));
170 }
171
172 DemoGroup.prototype.render = function render() {
173 return _react2['default'].createElement(
174 _beeLayout.Row,
175 null,
176 DemoArray.map(function (child, index) {
177
178 return _react2['default'].createElement(Demo, { example: child.example, title: child.title, code: child.code, scss_code: child.scss_code, desc: child.desc, key: index });
179 })
180 );
181 };
182
183 return DemoGroup;
184 }(_react.Component);
185
186 _reactDom2['default'].render(_react2['default'].createElement(DemoGroup, null), document.getElementById('tinperBeeDemo'));
187
188/***/ }),
189/* 1 */
190/***/ (function(module, exports, __webpack_require__) {
191
192 'use strict';
193
194 Object.defineProperty(exports, "__esModule", {
195 value: true
196 });
197 exports.Con = exports.Row = exports.Col = undefined;
198
199 var _Col2 = __webpack_require__(2);
200
201 var _Col3 = _interopRequireDefault(_Col2);
202
203 var _Row2 = __webpack_require__(6);
204
205 var _Row3 = _interopRequireDefault(_Row2);
206
207 var _Layout = __webpack_require__(7);
208
209 var _Layout2 = _interopRequireDefault(_Layout);
210
211 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
212
213 exports.Col = _Col3["default"];
214 exports.Row = _Row3["default"];
215 exports.Con = _Layout2["default"];
216
217/***/ }),
218/* 2 */
219/***/ (function(module, exports, __webpack_require__) {
220
221 'use strict';
222
223 Object.defineProperty(exports, "__esModule", {
224 value: true
225 });
226
227 var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
228
229 var _classnames = __webpack_require__(3);
230
231 var _classnames2 = _interopRequireDefault(_classnames);
232
233 var _react = __webpack_require__(4);
234
235 var _react2 = _interopRequireDefault(_react);
236
237 var _propTypes = __webpack_require__(5);
238
239 var _propTypes2 = _interopRequireDefault(_propTypes);
240
241 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
242
243 function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
244
245 function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
246
247 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
248
249 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
250
251 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
252
253 var propTypes = {
254 componentClass: _propTypes2["default"].oneOfType([_propTypes2["default"].element, _propTypes2["default"].string]),
255
256 /**
257 * xs显示列数
258 */
259 xs: _propTypes2["default"].number,
260 /**
261 * sm显示列数
262 */
263 sm: _propTypes2["default"].number,
264 /**
265 * md显示列数
266 */
267 md: _propTypes2["default"].number,
268 /**
269 * lg显示列数
270 */
271 lg: _propTypes2["default"].number,
272 /**
273 * xs偏移列数
274 */
275 xsOffset: _propTypes2["default"].number,
276 /**
277 * sm偏移列数
278 */
279 smOffset: _propTypes2["default"].number,
280 /**
281 * md偏移列数
282 */
283 mdOffset: _propTypes2["default"].number,
284 /**
285 * lg偏移列数
286 */
287 lgOffset: _propTypes2["default"].number,
288 /**
289 * xs右偏移列数
290 */
291 xsPush: _propTypes2["default"].number,
292 /**
293 * sm右偏移列数
294 */
295 smPush: _propTypes2["default"].number,
296 /**
297 * md右偏移列数
298 */
299 mdPush: _propTypes2["default"].number,
300 /**
301 * lg右偏移列数
302 */
303 lgPush: _propTypes2["default"].number,
304 /**
305 * xs左偏移列数
306 */
307 xsPull: _propTypes2["default"].number,
308 /**
309 * sm左偏移列数
310 */
311 smPull: _propTypes2["default"].number,
312 /**
313 * md左偏移列数
314 */
315 mdPull: _propTypes2["default"].number,
316 /**
317 * lg左偏移列数
318 */
319 lgPull: _propTypes2["default"].number
320 };
321
322 var defaultProps = {
323 componentClass: 'div',
324 clsPrefix: 'u-col'
325 };
326
327 var DEVICE_SIZES = ['lg', 'md', 'sm', 'xs'];
328
329 var Col = function (_Component) {
330 _inherits(Col, _Component);
331
332 function Col() {
333 _classCallCheck(this, Col);
334
335 return _possibleConstructorReturn(this, _Component.apply(this, arguments));
336 }
337
338 Col.prototype.render = function render() {
339 var _props = this.props,
340 Component = _props.componentClass,
341 className = _props.className,
342 clsPrefix = _props.clsPrefix,
343 others = _objectWithoutProperties(_props, ['componentClass', 'className', 'clsPrefix']);
344
345 var tbClass = [];
346 /**
347 * 对传入props做样式转化
348 * @type {[type]}
349 */
350 DEVICE_SIZES.forEach(function (size) {
351 function popProp(propSuffix, modifier) {
352 var propName = '' + size + propSuffix;
353 var propValue = others[propName];
354
355 if (propValue != undefined && propValue != null) {
356 tbClass.push(clsPrefix + '-' + size + modifier + '-' + propValue);
357 }
358
359 delete others[propName];
360 }
361
362 popProp('', '');
363 popProp('Offset', '-offset');
364 popProp('Push', '-push');
365 popProp('Pull', '-pull');
366 });
367
368 return _react2["default"].createElement(
369 Component,
370 _extends({
371 className: (0, _classnames2["default"])(tbClass, className)
372 }, others),
373 this.props.children
374 );
375 };
376
377 return Col;
378 }(_react.Component);
379
380 Col.defaultProps = defaultProps;
381 Col.propTypes = propTypes;
382
383 exports["default"] = Col;
384 module.exports = exports['default'];
385
386/***/ }),
387/* 3 */
388/***/ (function(module, exports, __webpack_require__) {
389
390 var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
391 Copyright (c) 2017 Jed Watson.
392 Licensed under the MIT License (MIT), see
393 http://jedwatson.github.io/classnames
394 */
395 /* global define */
396
397 (function () {
398 'use strict';
399
400 var hasOwn = {}.hasOwnProperty;
401
402 function classNames () {
403 var classes = [];
404
405 for (var i = 0; i < arguments.length; i++) {
406 var arg = arguments[i];
407 if (!arg) continue;
408
409 var argType = typeof arg;
410
411 if (argType === 'string' || argType === 'number') {
412 classes.push(arg);
413 } else if (Array.isArray(arg) && arg.length) {
414 var inner = classNames.apply(null, arg);
415 if (inner) {
416 classes.push(inner);
417 }
418 } else if (argType === 'object') {
419 for (var key in arg) {
420 if (hasOwn.call(arg, key) && arg[key]) {
421 classes.push(key);
422 }
423 }
424 }
425 }
426
427 return classes.join(' ');
428 }
429
430 if (typeof module !== 'undefined' && module.exports) {
431 classNames.default = classNames;
432 module.exports = classNames;
433 } else if (true) {
434 // register as 'classnames', consistent with npm package name
435 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () {
436 return classNames;
437 }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
438 } else {
439 window.classNames = classNames;
440 }
441 }());
442
443
444/***/ }),
445/* 4 */
446/***/ (function(module, exports) {
447
448 module.exports = React;
449
450/***/ }),
451/* 5 */
452/***/ (function(module, exports) {
453
454 module.exports = PropTypes;
455
456/***/ }),
457/* 6 */
458/***/ (function(module, exports, __webpack_require__) {
459
460 'use strict';
461
462 Object.defineProperty(exports, "__esModule", {
463 value: true
464 });
465
466 var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
467
468 var _classnames = __webpack_require__(3);
469
470 var _classnames2 = _interopRequireDefault(_classnames);
471
472 var _react = __webpack_require__(4);
473
474 var _react2 = _interopRequireDefault(_react);
475
476 var _propTypes = __webpack_require__(5);
477
478 var _propTypes2 = _interopRequireDefault(_propTypes);
479
480 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
481
482 function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
483
484 function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
485
486 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
487
488 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
489
490 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
491
492 var propTypes = {
493 componentClass: _propTypes2["default"].oneOfType([_propTypes2["default"].element, _propTypes2["default"].string])
494 };
495
496 var defaultProps = {
497 componentClass: 'div',
498 clsPrefix: 'u-row'
499 };
500
501 var Row = function (_Component) {
502 _inherits(Row, _Component);
503
504 function Row() {
505 _classCallCheck(this, Row);
506
507 return _possibleConstructorReturn(this, _Component.apply(this, arguments));
508 }
509
510 Row.prototype.render = function render() {
511 var _props = this.props,
512 Component = _props.componentClass,
513 clsPrefix = _props.clsPrefix,
514 className = _props.className,
515 others = _objectWithoutProperties(_props, ['componentClass', 'clsPrefix', 'className']);
516
517 var bsclass = '' + clsPrefix;
518
519 return _react2["default"].createElement(
520 Component,
521 _extends({}, others, {
522 className: (0, _classnames2["default"])(bsclass, className)
523 }),
524 this.props.children
525 );
526 };
527
528 return Row;
529 }(_react.Component);
530
531 Row.propTypes = propTypes;
532 Row.defaultProps = defaultProps;
533
534 exports["default"] = Row;
535 module.exports = exports['default'];
536
537/***/ }),
538/* 7 */
539/***/ (function(module, exports, __webpack_require__) {
540
541 'use strict';
542
543 Object.defineProperty(exports, "__esModule", {
544 value: true
545 });
546
547 var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
548
549 var _classnames = __webpack_require__(3);
550
551 var _classnames2 = _interopRequireDefault(_classnames);
552
553 var _react = __webpack_require__(4);
554
555 var _react2 = _interopRequireDefault(_react);
556
557 var _propTypes = __webpack_require__(5);
558
559 var _propTypes2 = _interopRequireDefault(_propTypes);
560
561 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
562
563 function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
564
565 function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
566
567 function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
568
569 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
570
571 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
572
573 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
574
575 var propTypes = {
576 /**
577 * Adds `container-fluid` class.
578 */
579 fluid: _propTypes2["default"].bool,
580 /**
581 * You can use a custom element for this component
582 */
583 componentClass: _propTypes2["default"].oneOfType([_propTypes2["default"].element, _propTypes2["default"].string])
584 };
585
586 var defaultProps = {
587 componentClass: 'div',
588 fluid: false,
589 clsPrefix: 'u-container'
590 };
591
592 var Con = function (_React$Component) {
593 _inherits(Con, _React$Component);
594
595 function Con() {
596 _classCallCheck(this, Con);
597
598 return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
599 }
600
601 Con.prototype.render = function render() {
602 var _tbclass;
603
604 var _props = this.props,
605 fluid = _props.fluid,
606 Component = _props.componentClass,
607 clsPrefix = _props.clsPrefix,
608 className = _props.className,
609 others = _objectWithoutProperties(_props, ['fluid', 'componentClass', 'clsPrefix', 'className']);
610
611 var tbclass = (_tbclass = {}, _defineProperty(_tbclass, '' + clsPrefix, !fluid), _defineProperty(_tbclass, clsPrefix + '-fluid', fluid), _tbclass);
612
613 return _react2["default"].createElement(
614 Component,
615 _extends({}, others, {
616 className: (0, _classnames2["default"])(tbclass, className)
617 }),
618 this.props.children
619 );
620 };
621
622 return Con;
623 }(_react2["default"].Component);
624
625 Con.propTypes = propTypes;
626 Con.defaultProps = defaultProps;
627
628 exports["default"] = Con;
629 module.exports = exports['default'];
630
631/***/ }),
632/* 8 */
633/***/ (function(module, exports, __webpack_require__) {
634
635 'use strict';
636
637 Object.defineProperty(exports, "__esModule", {
638 value: true
639 });
640 exports.PanelGroup = exports.Panel = undefined;
641
642 var _Panel2 = __webpack_require__(9);
643
644 var _Panel3 = _interopRequireDefault(_Panel2);
645
646 var _PanelGroup2 = __webpack_require__(81);
647
648 var _PanelGroup3 = _interopRequireDefault(_PanelGroup2);
649
650 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
651
652 exports.Panel = _Panel3["default"];
653 exports.PanelGroup = _PanelGroup3["default"];
654
655/***/ }),
656/* 9 */
657/***/ (function(module, exports, __webpack_require__) {
658
659 'use strict';
660
661 Object.defineProperty(exports, "__esModule", {
662 value: true
663 });
664
665 var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
666
667 var _classnames = __webpack_require__(3);
668
669 var _classnames2 = _interopRequireDefault(_classnames);
670
671 var _react = __webpack_require__(4);
672
673 var _react2 = _interopRequireDefault(_react);
674
675 var _beeTransition = __webpack_require__(10);
676
677 var _beeMessage = __webpack_require__(65);
678
679 var _beeMessage2 = _interopRequireDefault(_beeMessage);
680
681 var _propTypes = __webpack_require__(5);
682
683 var _propTypes2 = _interopRequireDefault(_propTypes);
684
685 var _copyToClipboard = __webpack_require__(79);
686
687 var _copyToClipboard2 = _interopRequireDefault(_copyToClipboard);
688
689 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
690
691 function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
692
693 function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
694
695 function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
696
697 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
698
699 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
700
701 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
702
703 var propTypes = {
704 //是否添加折叠
705 collapsible: _propTypes2["default"].bool,
706 onSelect: _propTypes2["default"].func,
707 //头部组件
708 header: _propTypes2["default"].node,
709 headerStyle: _propTypes2["default"].object,
710 id: _propTypes2["default"].oneOfType([_propTypes2["default"].string, _propTypes2["default"].number]),
711 headerContent: _propTypes2["default"].bool,
712 //footer组件
713 footer: _propTypes2["default"].node,
714 footerStyle: _propTypes2["default"].object,
715 //默认是否打开
716 defaultExpanded: _propTypes2["default"].bool,
717 //是否打开
718 expanded: _propTypes2["default"].bool,
719 //每个panel的标记
720 eventKey: _propTypes2["default"].any,
721 headerRole: _propTypes2["default"].string,
722 panelRole: _propTypes2["default"].string,
723 //颜色
724 colors: _propTypes2["default"].oneOf(['primary', 'accent', 'success', 'info', 'warning', 'danger', 'default', 'bordered']),
725
726 // From Collapse.的扩展动画
727 onEnter: _propTypes2["default"].func,
728 onEntering: _propTypes2["default"].func,
729 onEntered: _propTypes2["default"].func,
730 onExit: _propTypes2["default"].func,
731 onExiting: _propTypes2["default"].func,
732 onExited: _propTypes2["default"].func,
733 //是否可复制内容
734 copyable: _propTypes2["default"].bool
735 };
736
737 var defaultProps = {
738 defaultExpanded: false,
739 clsPrefix: "u-panel",
740 colors: "default"
741 };
742
743 var Panel = function (_React$Component) {
744 _inherits(Panel, _React$Component);
745
746 function Panel(props, context) {
747 _classCallCheck(this, Panel);
748
749 var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context));
750
751 _this.handleClickTitle = _this.handleClickTitle.bind(_this);
752
753 _this.state = {
754 expanded: _this.props.defaultExpanded
755 };
756 return _this;
757 }
758
759 //头部点击事件
760
761
762 Panel.prototype.handleClickTitle = function handleClickTitle(e) {
763 // 不让事件进入事件池
764 e.persist();
765 e.selected = true;
766
767 if (this.props.onSelect) {
768 this.props.onSelect(this.props.eventKey, e);
769 } else {
770 e.preventDefault();
771 }
772
773 if (e.selected) {
774 this.setState({ expanded: !this.state.expanded });
775 }
776 };
777
778 //渲染panelheader
779
780
781 Panel.prototype.renderHeader = function renderHeader(collapsible, header, id, role, expanded, clsPrefix) {
782 var titleClassName = clsPrefix + '-title';
783
784 if (!collapsible) {
785 if (!_react2["default"].isValidElement(header)) {
786 return header;
787 }
788
789 return (0, _react.cloneElement)(header, {
790 className: (0, _classnames2["default"])(header.props.className, titleClassName)
791 });
792 }
793
794 if (!_react2["default"].isValidElement(header)) {
795 return _react2["default"].createElement(
796 'h4',
797 { role: 'presentation', className: titleClassName },
798 this.renderAnchor(header, id, role, expanded)
799 );
800 }
801 if (this.props.headerContent) {
802 return (0, _react.cloneElement)(header, {
803 className: (0, _classnames2["default"])(header.props.className, titleClassName)
804 });
805 }
806
807 return (0, _react.cloneElement)(header, {
808 className: (0, _classnames2["default"])(header.props.className, titleClassName),
809 children: this.renderAnchor(header.props.children, id, role, expanded)
810 });
811 };
812
813 //如果使用链接,渲染为a标签
814
815
816 Panel.prototype.renderAnchor = function renderAnchor(header, id, role, expanded) {
817 return _react2["default"].createElement(
818 'a',
819 {
820 role: role,
821 href: id && '#' + id,
822 'aria-controls': id,
823 'aria-expanded': expanded,
824 'aria-selected': expanded,
825 className: expanded ? null : 'collapsed'
826 },
827 header
828 );
829 };
830
831 //复制代码,弹出提示信息
832
833
834 Panel.prototype.copyDemo = function copyDemo(e) {
835 var panelTarget = e.target.parentNode;
836 var clipBoardContent = panelTarget.firstChild.innerText;
837 (0, _copyToClipboard2["default"])(clipBoardContent);
838 _beeMessage2["default"].create({ content: '复制成功!', color: 'success', duration: 2 });
839 };
840
841 //如果有折叠动画,渲染折叠动画
842
843
844 Panel.prototype.renderCollapsibleBody = function renderCollapsibleBody(id, expanded, role, children, clsPrefix, copyable, animationHooks) {
845 return _react2["default"].createElement(
846 _beeTransition.Collapse,
847 _extends({ 'in': expanded }, animationHooks),
848 _react2["default"].createElement(
849 'div',
850 {
851 id: id,
852 role: role,
853 className: clsPrefix + '-collapse',
854 'aria-hidden': !expanded
855 },
856 this.renderBody(children, clsPrefix, copyable)
857 )
858 );
859 };
860
861 //渲染panelbody
862
863
864 Panel.prototype.renderBody = function renderBody(rawChildren, clsPrefix, copyable) {
865 var self = this;
866 var children = [];
867 var bodyChildren = [];
868
869 var bodyClassName = clsPrefix + '-body';
870 //添加到body的children中
871 function maybeAddBody(self) {
872 if (!bodyChildren.length) {
873 return;
874 }
875 // 给子组件添加key,为了之后触发事件时使用
876 children.push(_react2["default"].createElement(
877 'div',
878 { key: children.length, className: bodyClassName },
879 bodyChildren,
880 copyable && _react2["default"].createElement('i', { className: 'uf uf-files-o', onClick: self.copyDemo })
881 ));
882 bodyChildren = [];
883 }
884
885 //转换为数组,方便复用
886 _react2["default"].Children.toArray(rawChildren).forEach(function (child) {
887 if (_react2["default"].isValidElement(child) && child.props.fill) {
888 maybeAddBody(self);
889
890 //将标示fill设置为undefined
891 children.push((0, _react.cloneElement)(child, { fill: undefined }));
892
893 return;
894 }
895 bodyChildren.push(child);
896 });
897
898 maybeAddBody(self);
899
900 return children;
901 };
902
903 Panel.prototype.render = function render() {
904 var _props = this.props,
905 collapsible = _props.collapsible,
906 header = _props.header,
907 id = _props.id,
908 footer = _props.footer,
909 propsExpanded = _props.expanded,
910 footerStyle = _props.footerStyle,
911 headerStyle = _props.headerStyle,
912 headerRole = _props.headerRole,
913 panelRole = _props.panelRole,
914 className = _props.className,
915 colors = _props.colors,
916 children = _props.children,
917 onEnter = _props.onEnter,
918 onEntering = _props.onEntering,
919 onEntered = _props.onEntered,
920 clsPrefix = _props.clsPrefix,
921 onExit = _props.onExit,
922 headerContent = _props.headerContent,
923 onExiting = _props.onExiting,
924 onExited = _props.onExited,
925 defaultExpanded = _props.defaultExpanded,
926 eventKey = _props.eventKey,
927 onSelect = _props.onSelect,
928 copyable = _props.copyable,
929 props = _objectWithoutProperties(_props, ['collapsible', 'header', 'id', 'footer', 'expanded', 'footerStyle', 'headerStyle', 'headerRole', 'panelRole', 'className', 'colors', 'children', 'onEnter', 'onEntering', 'onEntered', 'clsPrefix', 'onExit', 'headerContent', 'onExiting', 'onExited', 'defaultExpanded', 'eventKey', 'onSelect', 'copyable']);
930
931 var expanded = propsExpanded != null ? propsExpanded : this.state.expanded;
932
933 var classes = {};
934 classes['' + clsPrefix] = true;
935 classes[clsPrefix + '-' + colors] = true;
936
937 var headerClass = _defineProperty({}, clsPrefix + '-heading', true);
938
939 copyable === false ? false : true;
940 return _react2["default"].createElement(
941 'div',
942 _extends({}, props, {
943 className: (0, _classnames2["default"])(className, classes),
944 id: collapsible ? null : id
945 }),
946 header && _react2["default"].createElement(
947 'div',
948 { className: (0, _classnames2["default"])(headerClass), style: headerStyle, onClick: this.handleClickTitle },
949 this.renderHeader(collapsible, header, id, headerRole, expanded, clsPrefix)
950 ),
951 collapsible ? this.renderCollapsibleBody(id, expanded, panelRole, children, clsPrefix, copyable, { onEnter: onEnter, onEntering: onEntering, onEntered: onEntered, onExit: onExit, onExiting: onExiting, onExited: onExited }) : this.renderBody(children, clsPrefix, copyable),
952 footer && _react2["default"].createElement(
953 'div',
954 { className: clsPrefix + '-footer', style: footerStyle },
955 footer
956 )
957 );
958 };
959
960 return Panel;
961 }(_react2["default"].Component);
962
963 Panel.propTypes = propTypes;
964 Panel.defaultProps = defaultProps;
965
966 exports["default"] = Panel;
967 module.exports = exports['default'];
968
969/***/ }),
970/* 10 */
971/***/ (function(module, exports, __webpack_require__) {
972
973 'use strict';
974
975 Object.defineProperty(exports, "__esModule", {
976 value: true
977 });
978 exports.Fade = exports.Collapse = exports.Transition = undefined;
979
980 var _Transition2 = __webpack_require__(11);
981
982 var _Transition3 = _interopRequireDefault(_Transition2);
983
984 var _Collapse2 = __webpack_require__(17);
985
986 var _Collapse3 = _interopRequireDefault(_Collapse2);
987
988 var _Fade2 = __webpack_require__(64);
989
990 var _Fade3 = _interopRequireDefault(_Fade2);
991
992 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
993
994 exports.Transition = _Transition3["default"];
995 exports.Collapse = _Collapse3["default"];
996 exports.Fade = _Fade3["default"];
997
998/***/ }),
999/* 11 */
1000/***/ (function(module, exports, __webpack_require__) {
1001
1002 'use strict';
1003
1004 Object.defineProperty(exports, "__esModule", {
1005 value: true
1006 });
1007 exports.EXITING = exports.ENTERED = exports.ENTERING = exports.EXITED = exports.UNMOUNTED = undefined;
1008
1009 var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
1010
1011 var _react = __webpack_require__(4);
1012
1013 var _react2 = _interopRequireDefault(_react);
1014
1015 var _reactDom = __webpack_require__(12);
1016
1017 var _reactDom2 = _interopRequireDefault(_reactDom);
1018
1019 var _properties = __webpack_require__(13);
1020
1021 var _properties2 = _interopRequireDefault(_properties);
1022
1023 var _on = __webpack_require__(16);
1024
1025 var _on2 = _interopRequireDefault(_on);
1026
1027 var _classnames = __webpack_require__(3);
1028
1029 var _classnames2 = _interopRequireDefault(_classnames);
1030
1031 var _propTypes = __webpack_require__(5);
1032
1033 var _propTypes2 = _interopRequireDefault(_propTypes);
1034
1035 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
1036
1037 function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
1038
1039 function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
1040
1041 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1042
1043 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
1044
1045 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
1046
1047 var transitionEndEvent = _properties2["default"].end;
1048
1049 //设置状态码
1050 var UNMOUNTED = exports.UNMOUNTED = 0;
1051 var EXITED = exports.EXITED = 1;
1052 var ENTERING = exports.ENTERING = 2;
1053 var ENTERED = exports.ENTERED = 3;
1054 var EXITING = exports.EXITING = 4;
1055
1056 var propTypes = {
1057 /**
1058 * 是否触发动画
1059 */
1060 "in": _propTypes2["default"].bool,
1061
1062 /**
1063 * 不显示的时候是否移除组件
1064 */
1065 unmountOnExit: _propTypes2["default"].bool,
1066
1067 /**
1068 * 如果设置为默认显示,挂载时显示动画
1069 */
1070 transitionAppear: _propTypes2["default"].bool,
1071
1072 /**
1073 * 设置超时时间,防止出现问题,可设置为>=动画时间
1074 */
1075 timeout: _propTypes2["default"].number,
1076
1077 /**
1078 * 退出组件时添加的class
1079 */
1080 exitedClassName: _propTypes2["default"].string,
1081 /**
1082 * 退出组件中添加的class
1083 */
1084 exitingClassName: _propTypes2["default"].string,
1085 /**
1086 * 进入动画后添加的class
1087 */
1088 enteredClassName: _propTypes2["default"].string,
1089 /**
1090 * 进入动画时添加的class
1091 */
1092 enteringClassName: _propTypes2["default"].string,
1093
1094 /**
1095 * 进入动画开始时的钩子函数
1096 */
1097 onEnter: _propTypes2["default"].func,
1098 /**
1099 * 进入动画中的钩子函数
1100 */
1101 onEntering: _propTypes2["default"].func,
1102 /**
1103 * 进入动画后的钩子函数
1104 */
1105 onEntered: _propTypes2["default"].func,
1106 /**
1107 * 退出动画开始时的钩子函数
1108 */
1109 onExit: _propTypes2["default"].func,
1110 /**
1111 * 退出动画中的钩子函数
1112 */
1113 onExiting: _propTypes2["default"].func,
1114 /**
1115 * 退出动画后的钩子函数
1116 */
1117 onExited: _propTypes2["default"].func
1118 };
1119
1120 function noop() {}
1121
1122 var defaultProps = {
1123 "in": false,
1124 unmountOnExit: false,
1125 transitionAppear: false,
1126 timeout: 5000,
1127 onEnter: noop,
1128 onEntering: noop,
1129 onEntered: noop,
1130 onExit: noop,
1131 onExiting: noop,
1132 onExited: noop
1133 };
1134
1135 /**
1136 * 动画组件
1137 */
1138
1139 var Transition = function (_Component) {
1140 _inherits(Transition, _Component);
1141
1142 function Transition(props, context) {
1143 _classCallCheck(this, Transition);
1144
1145 var _this = _possibleConstructorReturn(this, _Component.call(this, props, context));
1146
1147 var initialStatus = void 0;
1148 if (props["in"]) {
1149 // 在componentdidmount时开始执行动画
1150 initialStatus = props.transitionAppear ? EXITED : ENTERED;
1151 } else {
1152 initialStatus = props.unmountOnExit ? UNMOUNTED : EXITED;
1153 }
1154 _this.state = { status: initialStatus };
1155
1156 _this.nextCallback = null;
1157 return _this;
1158 }
1159
1160 Transition.prototype.componentDidMount = function componentDidMount() {
1161 if (this.props.transitionAppear && this.props["in"]) {
1162 this.performEnter(this.props);
1163 }
1164 };
1165
1166 Transition.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
1167 if (nextProps["in"] && this.props.unmountOnExit) {
1168 if (this.state.status === UNMOUNTED) {
1169 // 在componentDidUpdate执行动画.
1170 this.setState({ status: EXITED });
1171 }
1172 } else {
1173 this._needsUpdate = true;
1174 }
1175 };
1176
1177 Transition.prototype.componentDidUpdate = function componentDidUpdate() {
1178 var status = this.state.status;
1179
1180 if (this.props.unmountOnExit && status === EXITED) {
1181 // 当使用unmountOnExit时,exited为exiting和unmont的过渡状态
1182 if (this.props["in"]) {
1183 this.performEnter(this.props);
1184 } else {
1185 this.setState({ status: UNMOUNTED });
1186 }
1187
1188 return;
1189 }
1190
1191 // 确保只响应prop变化
1192 if (this._needsUpdate) {
1193 this._needsUpdate = false;
1194
1195 if (this.props["in"]) {
1196 if (status === EXITING) {
1197 this.performEnter(this.props);
1198 } else if (status === EXITED) {
1199 this.performEnter(this.props);
1200 }
1201 // 其他,当我们已经输入或输出
1202 } else {
1203 if (status === ENTERING || status === ENTERED) {
1204 this.performExit(this.props);
1205 }
1206 // 我们已经输入或输出完成
1207 }
1208 }
1209 };
1210
1211 Transition.prototype.componentWillUnmount = function componentWillUnmount() {
1212 this.cancelNextCallback();
1213 };
1214
1215 Transition.prototype.performEnter = function performEnter(props) {
1216 var _this2 = this;
1217
1218 this.cancelNextCallback();
1219 var node = _reactDom2["default"].findDOMNode(this);
1220
1221 // 这里接收新props
1222 props.onEnter(node);
1223
1224 this.safeSetState({ status: ENTERING }, function () {
1225 _this2.props.onEntering(node);
1226
1227 _this2.onTransitionEnd(node, function () {
1228 _this2.safeSetState({ status: ENTERED }, function () {
1229 _this2.props.onEntered(node);
1230 });
1231 });
1232 });
1233 };
1234
1235 Transition.prototype.performExit = function performExit(props) {
1236 var _this3 = this;
1237
1238 this.cancelNextCallback();
1239 var node = _reactDom2["default"].findDOMNode(this);
1240
1241 props.onExit(node);
1242
1243 this.safeSetState({ status: EXITING }, function () {
1244 _this3.props.onExiting(node);
1245
1246 _this3.onTransitionEnd(node, function () {
1247 _this3.safeSetState({ status: EXITED }, function () {
1248 _this3.props.onExited(node);
1249 });
1250 });
1251 });
1252 };
1253
1254 Transition.prototype.cancelNextCallback = function cancelNextCallback() {
1255 if (this.nextCallback !== null) {
1256 this.nextCallback.cancel();
1257 this.nextCallback = null;
1258 }
1259 };
1260
1261 Transition.prototype.safeSetState = function safeSetState(nextState, callback) {
1262 // 确保在组件销毁后挂起的setState被消除
1263 this.setState(nextState, this.setNextCallback(callback));
1264 };
1265
1266 Transition.prototype.setNextCallback = function setNextCallback(callback) {
1267 var _this4 = this;
1268
1269 var active = true;
1270
1271 this.nextCallback = function (event) {
1272 if (active) {
1273 active = false;
1274 _this4.nextCallback = null;
1275
1276 callback(event);
1277 }
1278 };
1279
1280 this.nextCallback.cancel = function () {
1281 active = false;
1282 };
1283
1284 return this.nextCallback;
1285 };
1286
1287 Transition.prototype.onTransitionEnd = function onTransitionEnd(node, handler) {
1288 this.setNextCallback(handler);
1289
1290 if (node) {
1291 if (transitionEndEvent == undefined) {
1292 this.nextCallback();
1293 } else {
1294 (0, _on2["default"])(node, transitionEndEvent, this.nextCallback);
1295 }
1296 setTimeout(this.nextCallback, this.props.timeout);
1297 } else {
1298 setTimeout(this.nextCallback, 0);
1299 }
1300 };
1301
1302 Transition.prototype.render = function render() {
1303 var status = this.state.status;
1304 if (status === UNMOUNTED) {
1305 return null;
1306 }
1307
1308 var _props = this.props,
1309 children = _props.children,
1310 className = _props.className,
1311 childProps = _objectWithoutProperties(_props, ['children', 'className']);
1312
1313 Object.keys(Transition.propTypes).forEach(function (key) {
1314 return delete childProps[key];
1315 });
1316
1317 var transitionClassName = void 0;
1318 if (status === EXITED) {
1319 transitionClassName = this.props.exitedClassName;
1320 } else if (status === ENTERING) {
1321 transitionClassName = this.props.enteringClassName;
1322 } else if (status === ENTERED) {
1323 transitionClassName = this.props.enteredClassName;
1324 } else if (status === EXITING) {
1325 transitionClassName = this.props.exitingClassName;
1326 }
1327
1328 var child = _react2["default"].Children.only(children);
1329 return _react2["default"].cloneElement(child, _extends({}, childProps, {
1330 className: (0, _classnames2["default"])(child.props.className, className, transitionClassName)
1331 }));
1332 };
1333
1334 return Transition;
1335 }(_react.Component);
1336
1337 Transition.propTypes = propTypes;
1338
1339 Transition.defaultProps = defaultProps;
1340
1341 exports["default"] = Transition;
1342
1343/***/ }),
1344/* 12 */
1345/***/ (function(module, exports) {
1346
1347 module.exports = ReactDOM;
1348
1349/***/ }),
1350/* 13 */
1351/***/ (function(module, exports, __webpack_require__) {
1352
1353 "use strict";
1354
1355 var _interopRequireDefault = __webpack_require__(14);
1356
1357 exports.__esModule = true;
1358 exports.default = exports.animationEnd = exports.animationDelay = exports.animationTiming = exports.animationDuration = exports.animationName = exports.transitionEnd = exports.transitionDuration = exports.transitionDelay = exports.transitionTiming = exports.transitionProperty = exports.transform = void 0;
1359
1360 var _inDOM = _interopRequireDefault(__webpack_require__(15));
1361
1362 var transform = 'transform';
1363 exports.transform = transform;
1364 var prefix, transitionEnd, animationEnd;
1365 exports.animationEnd = animationEnd;
1366 exports.transitionEnd = transitionEnd;
1367 var transitionProperty, transitionDuration, transitionTiming, transitionDelay;
1368 exports.transitionDelay = transitionDelay;
1369 exports.transitionTiming = transitionTiming;
1370 exports.transitionDuration = transitionDuration;
1371 exports.transitionProperty = transitionProperty;
1372 var animationName, animationDuration, animationTiming, animationDelay;
1373 exports.animationDelay = animationDelay;
1374 exports.animationTiming = animationTiming;
1375 exports.animationDuration = animationDuration;
1376 exports.animationName = animationName;
1377
1378 if (_inDOM.default) {
1379 var _getTransitionPropert = getTransitionProperties();
1380
1381 prefix = _getTransitionPropert.prefix;
1382 exports.transitionEnd = transitionEnd = _getTransitionPropert.transitionEnd;
1383 exports.animationEnd = animationEnd = _getTransitionPropert.animationEnd;
1384 exports.transform = transform = prefix + "-" + transform;
1385 exports.transitionProperty = transitionProperty = prefix + "-transition-property";
1386 exports.transitionDuration = transitionDuration = prefix + "-transition-duration";
1387 exports.transitionDelay = transitionDelay = prefix + "-transition-delay";
1388 exports.transitionTiming = transitionTiming = prefix + "-transition-timing-function";
1389 exports.animationName = animationName = prefix + "-animation-name";
1390 exports.animationDuration = animationDuration = prefix + "-animation-duration";
1391 exports.animationTiming = animationTiming = prefix + "-animation-delay";
1392 exports.animationDelay = animationDelay = prefix + "-animation-timing-function";
1393 }
1394
1395 var _default = {
1396 transform: transform,
1397 end: transitionEnd,
1398 property: transitionProperty,
1399 timing: transitionTiming,
1400 delay: transitionDelay,
1401 duration: transitionDuration
1402 };
1403 exports.default = _default;
1404
1405 function getTransitionProperties() {
1406 var style = document.createElement('div').style;
1407 var vendorMap = {
1408 O: function O(e) {
1409 return "o" + e.toLowerCase();
1410 },
1411 Moz: function Moz(e) {
1412 return e.toLowerCase();
1413 },
1414 Webkit: function Webkit(e) {
1415 return "webkit" + e;
1416 },
1417 ms: function ms(e) {
1418 return "MS" + e;
1419 }
1420 };
1421 var vendors = Object.keys(vendorMap);
1422 var transitionEnd, animationEnd;
1423 var prefix = '';
1424
1425 for (var i = 0; i < vendors.length; i++) {
1426 var vendor = vendors[i];
1427
1428 if (vendor + "TransitionProperty" in style) {
1429 prefix = "-" + vendor.toLowerCase();
1430 transitionEnd = vendorMap[vendor]('TransitionEnd');
1431 animationEnd = vendorMap[vendor]('AnimationEnd');
1432 break;
1433 }
1434 }
1435
1436 if (!transitionEnd && 'transitionProperty' in style) transitionEnd = 'transitionend';
1437 if (!animationEnd && 'animationName' in style) animationEnd = 'animationend';
1438 style = null;
1439 return {
1440 animationEnd: animationEnd,
1441 transitionEnd: transitionEnd,
1442 prefix: prefix
1443 };
1444 }
1445
1446/***/ }),
1447/* 14 */
1448/***/ (function(module, exports) {
1449
1450 function _interopRequireDefault(obj) {
1451 return obj && obj.__esModule ? obj : {
1452 default: obj
1453 };
1454 }
1455
1456 module.exports = _interopRequireDefault;
1457
1458/***/ }),
1459/* 15 */
1460/***/ (function(module, exports) {
1461
1462 "use strict";
1463
1464 exports.__esModule = true;
1465 exports.default = void 0;
1466
1467 var _default = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
1468
1469 exports.default = _default;
1470 module.exports = exports["default"];
1471
1472/***/ }),
1473/* 16 */
1474/***/ (function(module, exports, __webpack_require__) {
1475
1476 "use strict";
1477
1478 var _interopRequireDefault = __webpack_require__(14);
1479
1480 exports.__esModule = true;
1481 exports.default = void 0;
1482
1483 var _inDOM = _interopRequireDefault(__webpack_require__(15));
1484
1485 var on = function on() {};
1486
1487 if (_inDOM.default) {
1488 on = function () {
1489 if (document.addEventListener) return function (node, eventName, handler, capture) {
1490 return node.addEventListener(eventName, handler, capture || false);
1491 };else if (document.attachEvent) return function (node, eventName, handler) {
1492 return node.attachEvent('on' + eventName, function (e) {
1493 e = e || window.event;
1494 e.target = e.target || e.srcElement;
1495 e.currentTarget = node;
1496 handler.call(node, e);
1497 });
1498 };
1499 }();
1500 }
1501
1502 var _default = on;
1503 exports.default = _default;
1504 module.exports = exports["default"];
1505
1506/***/ }),
1507/* 17 */
1508/***/ (function(module, exports, __webpack_require__) {
1509
1510 'use strict';
1511
1512 Object.defineProperty(exports, "__esModule", {
1513 value: true
1514 });
1515
1516 var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
1517
1518 var _classnames = __webpack_require__(3);
1519
1520 var _classnames2 = _interopRequireDefault(_classnames);
1521
1522 var _style = __webpack_require__(18);
1523
1524 var _style2 = _interopRequireDefault(_style);
1525
1526 var _react = __webpack_require__(4);
1527
1528 var _react2 = _interopRequireDefault(_react);
1529
1530 var _propTypes = __webpack_require__(5);
1531
1532 var _propTypes2 = _interopRequireDefault(_propTypes);
1533
1534 var _Transition = __webpack_require__(11);
1535
1536 var _Transition2 = _interopRequireDefault(_Transition);
1537
1538 var _capitalize = __webpack_require__(26);
1539
1540 var _capitalize2 = _interopRequireDefault(_capitalize);
1541
1542 var _tinperBeeCore = __webpack_require__(27);
1543
1544 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
1545
1546 function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
1547
1548 function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
1549
1550 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1551
1552 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
1553
1554 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
1555
1556 var MARGINS = {
1557 height: ['marginTop', 'marginBottom'],
1558 width: ['marginLeft', 'marginRight']
1559 };
1560
1561 // reading a dimension prop will cause the browser to recalculate,
1562 // which will let our animations work
1563 function triggerBrowserReflow(node) {
1564 node.offsetHeight; // eslint-disable-line no-unused-expressions
1565 }
1566
1567 function getDimensionValue(dimension, elem) {
1568 var value = elem['offset' + (0, _capitalize2["default"])(dimension)];
1569 var margins = MARGINS[dimension];
1570
1571 return value + parseInt((0, _style2["default"])(elem, margins[0]), 10) + parseInt((0, _style2["default"])(elem, margins[1]), 10);
1572 }
1573
1574 var propTypes = {
1575 /**
1576 * Show the component; triggers the expand or collapse animation
1577 */
1578 "in": _propTypes2["default"].bool,
1579
1580 /**
1581 * Unmount the component (remove it from the DOM) when it is collapsed
1582 */
1583 unmountOnExit: _propTypes2["default"].bool,
1584
1585 /**
1586 * Run the expand animation when the component mounts, if it is initially
1587 * shown
1588 */
1589 transitionAppear: _propTypes2["default"].bool,
1590
1591 /**
1592 * Duration of the collapse animation in milliseconds, to ensure that
1593 * finishing callbacks are fired even if the original browser transition end
1594 * events are canceled
1595 */
1596 timeout: _propTypes2["default"].number,
1597
1598 /**
1599 * Callback fired before the component expands
1600 */
1601 onEnter: _propTypes2["default"].func,
1602 /**
1603 * Callback fired after the component starts to expand
1604 */
1605 onEntering: _propTypes2["default"].func,
1606 /**
1607 * Callback fired after the component has expanded
1608 */
1609 onEntered: _propTypes2["default"].func,
1610 /**
1611 * Callback fired before the component collapses
1612 */
1613 onExit: _propTypes2["default"].func,
1614 /**
1615 * Callback fired after the component starts to collapse
1616 */
1617 onExiting: _propTypes2["default"].func,
1618 /**
1619 * Callback fired after the component has collapsed
1620 */
1621 onExited: _propTypes2["default"].func,
1622
1623 /**
1624 * The dimension used when collapsing, or a function that returns the
1625 * dimension
1626 *
1627 * _Note: Bootstrap only partially supports 'width'!
1628 * You will need to supply your own CSS animation for the `.width` CSS class._
1629 */
1630 dimension: _propTypes2["default"].oneOfType([_propTypes2["default"].oneOf(['height', 'width']), _propTypes2["default"].func]),
1631
1632 /**
1633 * Function that returns the height or width of the animating DOM node
1634 *
1635 * Allows for providing some custom logic for how much the Collapse component
1636 * should animate in its specified dimension. Called with the current
1637 * dimension prop value and the DOM node.
1638 */
1639 getDimensionValue: _propTypes2["default"].func,
1640
1641 /**
1642 * ARIA role of collapsible element
1643 */
1644 role: _propTypes2["default"].string
1645 };
1646
1647 var defaultProps = {
1648 "in": false,
1649 timeout: 300,
1650 unmountOnExit: false,
1651 transitionAppear: false,
1652
1653 dimension: 'height',
1654 getDimensionValue: getDimensionValue
1655 };
1656
1657 var Collapse = function (_React$Component) {
1658 _inherits(Collapse, _React$Component);
1659
1660 function Collapse(props, context) {
1661 _classCallCheck(this, Collapse);
1662
1663 var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context));
1664
1665 _this.handleEnter = _this.handleEnter.bind(_this);
1666 _this.handleEntering = _this.handleEntering.bind(_this);
1667 _this.handleEntered = _this.handleEntered.bind(_this);
1668 _this.handleExit = _this.handleExit.bind(_this);
1669 _this.handleExiting = _this.handleExiting.bind(_this);
1670 return _this;
1671 }
1672
1673 /* -- Expanding -- */
1674
1675
1676 Collapse.prototype.handleEnter = function handleEnter(elem) {
1677 var dimension = this._dimension();
1678 elem.style[dimension] = '0';
1679 };
1680
1681 Collapse.prototype.handleEntering = function handleEntering(elem) {
1682 var dimension = this._dimension();
1683 elem.style[dimension] = this._getScrollDimensionValue(elem, dimension);
1684 };
1685
1686 Collapse.prototype.handleEntered = function handleEntered(elem) {
1687 var dimension = this._dimension();
1688 elem.style[dimension] = null;
1689 };
1690
1691 /* -- Collapsing -- */
1692
1693
1694 Collapse.prototype.handleExit = function handleExit(elem) {
1695 var dimension = this._dimension();
1696 elem.style[dimension] = this.props.getDimensionValue(dimension, elem) + 'px';
1697 triggerBrowserReflow(elem);
1698 };
1699
1700 Collapse.prototype.handleExiting = function handleExiting(elem) {
1701 var dimension = this._dimension();
1702 elem.style[dimension] = '0';
1703 };
1704
1705 Collapse.prototype._dimension = function _dimension() {
1706 return typeof this.props.dimension === 'function' ? this.props.dimension() : this.props.dimension;
1707 };
1708
1709 // for testing
1710
1711
1712 Collapse.prototype._getScrollDimensionValue = function _getScrollDimensionValue(elem, dimension) {
1713 return elem['scroll' + (0, _capitalize2["default"])(dimension)] + 'px';
1714 };
1715
1716 Collapse.prototype.render = function render() {
1717 var _props = this.props,
1718 onEnter = _props.onEnter,
1719 onEntering = _props.onEntering,
1720 onEntered = _props.onEntered,
1721 onExit = _props.onExit,
1722 onExiting = _props.onExiting,
1723 className = _props.className,
1724 props = _objectWithoutProperties(_props, ['onEnter', 'onEntering', 'onEntered', 'onExit', 'onExiting', 'className']);
1725
1726 delete props.dimension;
1727 delete props.getDimensionValue;
1728
1729 var handleEnter = (0, _tinperBeeCore.createChainedFunction)(this.handleEnter, onEnter);
1730 var handleEntering = (0, _tinperBeeCore.createChainedFunction)(this.handleEntering, onEntering);
1731 var handleEntered = (0, _tinperBeeCore.createChainedFunction)(this.handleEntered, onEntered);
1732 var handleExit = (0, _tinperBeeCore.createChainedFunction)(this.handleExit, onExit);
1733 var handleExiting = (0, _tinperBeeCore.createChainedFunction)(this.handleExiting, onExiting);
1734
1735 var classes = {
1736 width: this._dimension() === 'width'
1737 };
1738
1739 return _react2["default"].createElement(_Transition2["default"], _extends({}, props, {
1740 'aria-expanded': props.role ? props["in"] : null,
1741 className: (0, _classnames2["default"])(className, classes),
1742 exitedClassName: 'collapse',
1743 exitingClassName: 'collapsing',
1744 enteredClassName: 'collapse in',
1745 enteringClassName: 'collapsing',
1746 onEnter: handleEnter,
1747 onEntering: handleEntering,
1748 onEntered: handleEntered,
1749 onExit: handleExit,
1750 onExiting: handleExiting
1751 }));
1752 };
1753
1754 return Collapse;
1755 }(_react2["default"].Component);
1756
1757 Collapse.propTypes = propTypes;
1758 Collapse.defaultProps = defaultProps;
1759
1760 exports["default"] = Collapse;
1761 module.exports = exports['default'];
1762
1763/***/ }),
1764/* 18 */
1765/***/ (function(module, exports, __webpack_require__) {
1766
1767 "use strict";
1768
1769 var _interopRequireDefault = __webpack_require__(14);
1770
1771 exports.__esModule = true;
1772 exports.default = style;
1773
1774 var _camelizeStyle = _interopRequireDefault(__webpack_require__(19));
1775
1776 var _hyphenateStyle = _interopRequireDefault(__webpack_require__(21));
1777
1778 var _getComputedStyle2 = _interopRequireDefault(__webpack_require__(23));
1779
1780 var _removeStyle = _interopRequireDefault(__webpack_require__(24));
1781
1782 var _properties = __webpack_require__(13);
1783
1784 var _isTransform = _interopRequireDefault(__webpack_require__(25));
1785
1786 function style(node, property, value) {
1787 var css = '';
1788 var transforms = '';
1789 var props = property;
1790
1791 if (typeof property === 'string') {
1792 if (value === undefined) {
1793 return node.style[(0, _camelizeStyle.default)(property)] || (0, _getComputedStyle2.default)(node).getPropertyValue((0, _hyphenateStyle.default)(property));
1794 } else {
1795 (props = {})[property] = value;
1796 }
1797 }
1798
1799 Object.keys(props).forEach(function (key) {
1800 var value = props[key];
1801
1802 if (!value && value !== 0) {
1803 (0, _removeStyle.default)(node, (0, _hyphenateStyle.default)(key));
1804 } else if ((0, _isTransform.default)(key)) {
1805 transforms += key + "(" + value + ") ";
1806 } else {
1807 css += (0, _hyphenateStyle.default)(key) + ": " + value + ";";
1808 }
1809 });
1810
1811 if (transforms) {
1812 css += _properties.transform + ": " + transforms + ";";
1813 }
1814
1815 node.style.cssText += ';' + css;
1816 }
1817
1818 module.exports = exports["default"];
1819
1820/***/ }),
1821/* 19 */
1822/***/ (function(module, exports, __webpack_require__) {
1823
1824 "use strict";
1825
1826 var _interopRequireDefault = __webpack_require__(14);
1827
1828 exports.__esModule = true;
1829 exports.default = camelizeStyleName;
1830
1831 var _camelize = _interopRequireDefault(__webpack_require__(20));
1832
1833 /**
1834 * Copyright 2014-2015, Facebook, Inc.
1835 * All rights reserved.
1836 * https://github.com/facebook/react/blob/2aeb8a2a6beb00617a4217f7f8284924fa2ad819/src/vendor/core/camelizeStyleName.js
1837 */
1838 var msPattern = /^-ms-/;
1839
1840 function camelizeStyleName(string) {
1841 return (0, _camelize.default)(string.replace(msPattern, 'ms-'));
1842 }
1843
1844 module.exports = exports["default"];
1845
1846/***/ }),
1847/* 20 */
1848/***/ (function(module, exports) {
1849
1850 "use strict";
1851
1852 exports.__esModule = true;
1853 exports.default = camelize;
1854 var rHyphen = /-(.)/g;
1855
1856 function camelize(string) {
1857 return string.replace(rHyphen, function (_, chr) {
1858 return chr.toUpperCase();
1859 });
1860 }
1861
1862 module.exports = exports["default"];
1863
1864/***/ }),
1865/* 21 */
1866/***/ (function(module, exports, __webpack_require__) {
1867
1868 "use strict";
1869
1870 var _interopRequireDefault = __webpack_require__(14);
1871
1872 exports.__esModule = true;
1873 exports.default = hyphenateStyleName;
1874
1875 var _hyphenate = _interopRequireDefault(__webpack_require__(22));
1876
1877 /**
1878 * Copyright 2013-2014, Facebook, Inc.
1879 * All rights reserved.
1880 * https://github.com/facebook/react/blob/2aeb8a2a6beb00617a4217f7f8284924fa2ad819/src/vendor/core/hyphenateStyleName.js
1881 */
1882 var msPattern = /^ms-/;
1883
1884 function hyphenateStyleName(string) {
1885 return (0, _hyphenate.default)(string).replace(msPattern, '-ms-');
1886 }
1887
1888 module.exports = exports["default"];
1889
1890/***/ }),
1891/* 22 */
1892/***/ (function(module, exports) {
1893
1894 "use strict";
1895
1896 exports.__esModule = true;
1897 exports.default = hyphenate;
1898 var rUpper = /([A-Z])/g;
1899
1900 function hyphenate(string) {
1901 return string.replace(rUpper, '-$1').toLowerCase();
1902 }
1903
1904 module.exports = exports["default"];
1905
1906/***/ }),
1907/* 23 */
1908/***/ (function(module, exports, __webpack_require__) {
1909
1910 "use strict";
1911
1912 var _interopRequireDefault = __webpack_require__(14);
1913
1914 exports.__esModule = true;
1915 exports.default = _getComputedStyle;
1916
1917 var _camelizeStyle = _interopRequireDefault(__webpack_require__(19));
1918
1919 var rposition = /^(top|right|bottom|left)$/;
1920 var rnumnonpx = /^([+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|))(?!px)[a-z%]+$/i;
1921
1922 function _getComputedStyle(node) {
1923 if (!node) throw new TypeError('No Element passed to `getComputedStyle()`');
1924 var doc = node.ownerDocument;
1925 return 'defaultView' in doc ? doc.defaultView.opener ? node.ownerDocument.defaultView.getComputedStyle(node, null) : window.getComputedStyle(node, null) : {
1926 //ie 8 "magic" from: https://github.com/jquery/jquery/blob/1.11-stable/src/css/curCSS.js#L72
1927 getPropertyValue: function getPropertyValue(prop) {
1928 var style = node.style;
1929 prop = (0, _camelizeStyle.default)(prop);
1930 if (prop == 'float') prop = 'styleFloat';
1931 var current = node.currentStyle[prop] || null;
1932 if (current == null && style && style[prop]) current = style[prop];
1933
1934 if (rnumnonpx.test(current) && !rposition.test(prop)) {
1935 // Remember the original values
1936 var left = style.left;
1937 var runStyle = node.runtimeStyle;
1938 var rsLeft = runStyle && runStyle.left; // Put in the new values to get a computed value out
1939
1940 if (rsLeft) runStyle.left = node.currentStyle.left;
1941 style.left = prop === 'fontSize' ? '1em' : current;
1942 current = style.pixelLeft + 'px'; // Revert the changed values
1943
1944 style.left = left;
1945 if (rsLeft) runStyle.left = rsLeft;
1946 }
1947
1948 return current;
1949 }
1950 };
1951 }
1952
1953 module.exports = exports["default"];
1954
1955/***/ }),
1956/* 24 */
1957/***/ (function(module, exports) {
1958
1959 "use strict";
1960
1961 exports.__esModule = true;
1962 exports.default = removeStyle;
1963
1964 function removeStyle(node, key) {
1965 return 'removeProperty' in node.style ? node.style.removeProperty(key) : node.style.removeAttribute(key);
1966 }
1967
1968 module.exports = exports["default"];
1969
1970/***/ }),
1971/* 25 */
1972/***/ (function(module, exports) {
1973
1974 "use strict";
1975
1976 exports.__esModule = true;
1977 exports.default = isTransform;
1978 var supportedTransforms = /^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;
1979
1980 function isTransform(property) {
1981 return !!(property && supportedTransforms.test(property));
1982 }
1983
1984 module.exports = exports["default"];
1985
1986/***/ }),
1987/* 26 */
1988/***/ (function(module, exports) {
1989
1990 "use strict";
1991
1992 Object.defineProperty(exports, "__esModule", {
1993 value: true
1994 });
1995 exports["default"] = capitalize;
1996 function capitalize(string) {
1997 return "" + string.charAt(0).toUpperCase() + string.slice(1);
1998 }
1999 module.exports = exports["default"];
2000
2001/***/ }),
2002/* 27 */
2003/***/ (function(module, exports, __webpack_require__) {
2004
2005 'use strict';
2006
2007 exports.__esModule = true;
2008 exports.Align = exports.toArray = exports.cssAnimation = exports.addEventListener = exports.contains = exports.KeyCode = exports.createChainedFunction = exports.splitComponent = exports.isRequiredForA11y = exports.elementType = exports.deprecated = exports.componentOrElement = exports.all = undefined;
2009
2010 var _all2 = __webpack_require__(28);
2011
2012 var _all3 = _interopRequireDefault(_all2);
2013
2014 var _componentOrElement2 = __webpack_require__(30);
2015
2016 var _componentOrElement3 = _interopRequireDefault(_componentOrElement2);
2017
2018 var _deprecated2 = __webpack_require__(31);
2019
2020 var _deprecated3 = _interopRequireDefault(_deprecated2);
2021
2022 var _elementType2 = __webpack_require__(34);
2023
2024 var _elementType3 = _interopRequireDefault(_elementType2);
2025
2026 var _isRequiredForA11y2 = __webpack_require__(35);
2027
2028 var _isRequiredForA11y3 = _interopRequireDefault(_isRequiredForA11y2);
2029
2030 var _splitComponent2 = __webpack_require__(36);
2031
2032 var _splitComponent3 = _interopRequireDefault(_splitComponent2);
2033
2034 var _createChainedFunction2 = __webpack_require__(37);
2035
2036 var _createChainedFunction3 = _interopRequireDefault(_createChainedFunction2);
2037
2038 var _keyCode = __webpack_require__(38);
2039
2040 var _keyCode2 = _interopRequireDefault(_keyCode);
2041
2042 var _contains2 = __webpack_require__(39);
2043
2044 var _contains3 = _interopRequireDefault(_contains2);
2045
2046 var _addEventListener2 = __webpack_require__(40);
2047
2048 var _addEventListener3 = _interopRequireDefault(_addEventListener2);
2049
2050 var _cssAnimation2 = __webpack_require__(45);
2051
2052 var _cssAnimation3 = _interopRequireDefault(_cssAnimation2);
2053
2054 var _toArray2 = __webpack_require__(49);
2055
2056 var _toArray3 = _interopRequireDefault(_toArray2);
2057
2058 var _Align2 = __webpack_require__(50);
2059
2060 var _Align3 = _interopRequireDefault(_Align2);
2061
2062 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2063
2064 exports.all = _all3.default;
2065 exports.componentOrElement = _componentOrElement3.default;
2066 exports.deprecated = _deprecated3.default;
2067 exports.elementType = _elementType3.default;
2068 exports.isRequiredForA11y = _isRequiredForA11y3.default;
2069 exports.splitComponent = _splitComponent3.default;
2070 exports.createChainedFunction = _createChainedFunction3.default;
2071 exports.KeyCode = _keyCode2.default;
2072 exports.contains = _contains3.default;
2073 exports.addEventListener = _addEventListener3.default;
2074 exports.cssAnimation = _cssAnimation3.default;
2075 exports.toArray = _toArray3.default;
2076 //export getContainerRenderMixin from './getContainerRenderMixin';
2077
2078 exports.Align = _Align3.default;
2079
2080/***/ }),
2081/* 28 */
2082/***/ (function(module, exports, __webpack_require__) {
2083
2084 'use strict';
2085
2086 exports.__esModule = true;
2087 exports.default = all;
2088
2089 var _createChainableTypeChecker = __webpack_require__(29);
2090
2091 var _createChainableTypeChecker2 = _interopRequireDefault(_createChainableTypeChecker);
2092
2093 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2094
2095 function all() {
2096 for (var _len = arguments.length, validators = Array(_len), _key = 0; _key < _len; _key++) {
2097 validators[_key] = arguments[_key];
2098 }
2099
2100 function allPropTypes() {
2101 for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
2102 args[_key2] = arguments[_key2];
2103 }
2104
2105 var error = null;
2106
2107 validators.forEach(function (validator) {
2108 if (error != null) {
2109 return;
2110 }
2111
2112 var result = validator.apply(undefined, args);
2113 if (result != null) {
2114 error = result;
2115 }
2116 });
2117
2118 return error;
2119 }
2120
2121 return (0, _createChainableTypeChecker2.default)(allPropTypes);
2122 } /**
2123 * This source code is quoted from rc-util.
2124 * homepage: https://github.com/react-component/util
2125 */
2126
2127/***/ }),
2128/* 29 */
2129/***/ (function(module, exports) {
2130
2131 'use strict';
2132
2133 exports.__esModule = true;
2134 exports.default = createChainableTypeChecker;
2135 /**
2136 * Copyright 2013-present, Facebook, Inc.
2137 * All rights reserved.
2138 *
2139 * This source code is licensed under the BSD-style license found in the
2140 * LICENSE file in the root directory of this source tree. An additional grant
2141 * of patent rights can be found in the PATENTS file in the same directory.
2142 */
2143
2144 // Mostly taken from ReactPropTypes.
2145
2146 /* This source code is quoted from rc-util.
2147 * homepage: https://github.com/react-component/util
2148 */
2149
2150 function createChainableTypeChecker(validate) {
2151 function checkType(isRequired, props, propName, componentName, location, propFullName) {
2152 var componentNameSafe = componentName || '<<anonymous>>';
2153 var propFullNameSafe = propFullName || propName;
2154
2155 if (props[propName] == null) {
2156 if (isRequired) {
2157 return new Error('Required ' + location + ' `' + propFullNameSafe + '` was not specified ' + ('in `' + componentNameSafe + '`.'));
2158 }
2159
2160 return null;
2161 }
2162
2163 for (var _len = arguments.length, args = Array(_len > 6 ? _len - 6 : 0), _key = 6; _key < _len; _key++) {
2164 args[_key - 6] = arguments[_key];
2165 }
2166
2167 return validate.apply(undefined, [props, propName, componentNameSafe, location, propFullNameSafe].concat(args));
2168 }
2169
2170 var chainedCheckType = checkType.bind(null, false);
2171 chainedCheckType.isRequired = checkType.bind(null, true);
2172
2173 return chainedCheckType;
2174 }
2175
2176/***/ }),
2177/* 30 */
2178/***/ (function(module, exports, __webpack_require__) {
2179
2180 'use strict';
2181
2182 exports.__esModule = true;
2183
2184 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /**
2185 * This source code is quoted from rc-util.
2186 * homepage: https://github.com/react-component/util
2187 */
2188
2189
2190 var _react = __webpack_require__(4);
2191
2192 var _react2 = _interopRequireDefault(_react);
2193
2194 var _createChainableTypeChecker = __webpack_require__(29);
2195
2196 var _createChainableTypeChecker2 = _interopRequireDefault(_createChainableTypeChecker);
2197
2198 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2199
2200 function validate(props, propName, componentName, location, propFullName) {
2201 var propValue = props[propName];
2202 var propType = typeof propValue === 'undefined' ? 'undefined' : _typeof(propValue);
2203
2204 if (_react2.default.isValidElement(propValue)) {
2205 return new Error('Invalid ' + location + ' `' + propFullName + '` of type ReactElement ' + ('supplied to `' + componentName + '`, expected a ReactComponent or a ') + 'DOMElement. You can usually obtain a ReactComponent or DOMElement ' + 'from a ReactElement by attaching a ref to it.');
2206 }
2207
2208 if ((propType !== 'object' || typeof propValue.render !== 'function') && propValue.nodeType !== 1) {
2209 return new Error('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected a ReactComponent or a ') + 'DOMElement.');
2210 }
2211
2212 return null;
2213 }
2214
2215 exports.default = (0, _createChainableTypeChecker2.default)(validate);
2216
2217/***/ }),
2218/* 31 */
2219/***/ (function(module, exports, __webpack_require__) {
2220
2221 'use strict';
2222
2223 exports.__esModule = true;
2224 exports.default = deprecated;
2225
2226 var _warning = __webpack_require__(32);
2227
2228 var _warning2 = _interopRequireDefault(_warning);
2229
2230 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2231
2232 var warned = {}; /**
2233 * This source code is quoted from rc-util.
2234 * homepage: https://github.com/react-component/util
2235 */
2236 function deprecated(validator, reason) {
2237 return function validate(props, propName, componentName, location, propFullName) {
2238 var componentNameSafe = componentName || '<<anonymous>>';
2239 var propFullNameSafe = propFullName || propName;
2240
2241 if (props[propName] != null) {
2242 var messageKey = componentName + '.' + propName;
2243
2244 (0, _warning2.default)(warned[messageKey], 'The ' + location + ' `' + propFullNameSafe + '` of ' + ('`' + componentNameSafe + '` is deprecated. ' + reason + '.'));
2245
2246 warned[messageKey] = true;
2247 }
2248
2249 for (var _len = arguments.length, args = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) {
2250 args[_key - 5] = arguments[_key];
2251 }
2252
2253 return validator.apply(undefined, [props, propName, componentName, location, propFullName].concat(args));
2254 };
2255 }
2256
2257 /* eslint-disable no-underscore-dangle */
2258 function _resetWarned() {
2259 warned = {};
2260 }
2261
2262 deprecated._resetWarned = _resetWarned;
2263 /* eslint-enable no-underscore-dangle */
2264
2265/***/ }),
2266/* 32 */
2267/***/ (function(module, exports, __webpack_require__) {
2268
2269 /* WEBPACK VAR INJECTION */(function(process) {/**
2270 * Copyright 2014-2015, Facebook, Inc.
2271 * All rights reserved.
2272 *
2273 * This source code is licensed under the BSD-style license found in the
2274 * LICENSE file in the root directory of this source tree. An additional grant
2275 * of patent rights can be found in the PATENTS file in the same directory.
2276 */
2277
2278 'use strict';
2279
2280 /**
2281 * Similar to invariant but only logs a warning if the condition is not met.
2282 * This can be used to log issues in development environments in critical
2283 * paths. Removing the logging code for production environments will keep the
2284 * same logic and follow the same code paths.
2285 */
2286
2287 var warning = function() {};
2288
2289 if (process.env.NODE_ENV !== 'production') {
2290 warning = function(condition, format, args) {
2291 var len = arguments.length;
2292 args = new Array(len > 2 ? len - 2 : 0);
2293 for (var key = 2; key < len; key++) {
2294 args[key - 2] = arguments[key];
2295 }
2296 if (format === undefined) {
2297 throw new Error(
2298 '`warning(condition, format, ...args)` requires a warning ' +
2299 'message argument'
2300 );
2301 }
2302
2303 if (format.length < 10 || (/^[s\W]*$/).test(format)) {
2304 throw new Error(
2305 'The warning format should be able to uniquely identify this ' +
2306 'warning. Please, use a more descriptive format than: ' + format
2307 );
2308 }
2309
2310 if (!condition) {
2311 var argIndex = 0;
2312 var message = 'Warning: ' +
2313 format.replace(/%s/g, function() {
2314 return args[argIndex++];
2315 });
2316 if (typeof console !== 'undefined') {
2317 console.error(message);
2318 }
2319 try {
2320 // This error was thrown as a convenience so that you can use this stack
2321 // to find the callsite that caused this warning to fire.
2322 throw new Error(message);
2323 } catch(x) {}
2324 }
2325 };
2326 }
2327
2328 module.exports = warning;
2329
2330 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(33)))
2331
2332/***/ }),
2333/* 33 */
2334/***/ (function(module, exports) {
2335
2336 // shim for using process in browser
2337 var process = module.exports = {};
2338
2339 // cached from whatever global is present so that test runners that stub it
2340 // don't break things. But we need to wrap it in a try catch in case it is
2341 // wrapped in strict mode code which doesn't define any globals. It's inside a
2342 // function because try/catches deoptimize in certain engines.
2343
2344 var cachedSetTimeout;
2345 var cachedClearTimeout;
2346
2347 function defaultSetTimout() {
2348 throw new Error('setTimeout has not been defined');
2349 }
2350 function defaultClearTimeout () {
2351 throw new Error('clearTimeout has not been defined');
2352 }
2353 (function () {
2354 try {
2355 if (typeof setTimeout === 'function') {
2356 cachedSetTimeout = setTimeout;
2357 } else {
2358 cachedSetTimeout = defaultSetTimout;
2359 }
2360 } catch (e) {
2361 cachedSetTimeout = defaultSetTimout;
2362 }
2363 try {
2364 if (typeof clearTimeout === 'function') {
2365 cachedClearTimeout = clearTimeout;
2366 } else {
2367 cachedClearTimeout = defaultClearTimeout;
2368 }
2369 } catch (e) {
2370 cachedClearTimeout = defaultClearTimeout;
2371 }
2372 } ())
2373 function runTimeout(fun) {
2374 if (cachedSetTimeout === setTimeout) {
2375 //normal enviroments in sane situations
2376 return setTimeout(fun, 0);
2377 }
2378 // if setTimeout wasn't available but was latter defined
2379 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
2380 cachedSetTimeout = setTimeout;
2381 return setTimeout(fun, 0);
2382 }
2383 try {
2384 // when when somebody has screwed with setTimeout but no I.E. maddness
2385 return cachedSetTimeout(fun, 0);
2386 } catch(e){
2387 try {
2388 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
2389 return cachedSetTimeout.call(null, fun, 0);
2390 } catch(e){
2391 // 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
2392 return cachedSetTimeout.call(this, fun, 0);
2393 }
2394 }
2395
2396
2397 }
2398 function runClearTimeout(marker) {
2399 if (cachedClearTimeout === clearTimeout) {
2400 //normal enviroments in sane situations
2401 return clearTimeout(marker);
2402 }
2403 // if clearTimeout wasn't available but was latter defined
2404 if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
2405 cachedClearTimeout = clearTimeout;
2406 return clearTimeout(marker);
2407 }
2408 try {
2409 // when when somebody has screwed with setTimeout but no I.E. maddness
2410 return cachedClearTimeout(marker);
2411 } catch (e){
2412 try {
2413 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
2414 return cachedClearTimeout.call(null, marker);
2415 } catch (e){
2416 // 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.
2417 // Some versions of I.E. have different rules for clearTimeout vs setTimeout
2418 return cachedClearTimeout.call(this, marker);
2419 }
2420 }
2421
2422
2423
2424 }
2425 var queue = [];
2426 var draining = false;
2427 var currentQueue;
2428 var queueIndex = -1;
2429
2430 function cleanUpNextTick() {
2431 if (!draining || !currentQueue) {
2432 return;
2433 }
2434 draining = false;
2435 if (currentQueue.length) {
2436 queue = currentQueue.concat(queue);
2437 } else {
2438 queueIndex = -1;
2439 }
2440 if (queue.length) {
2441 drainQueue();
2442 }
2443 }
2444
2445 function drainQueue() {
2446 if (draining) {
2447 return;
2448 }
2449 var timeout = runTimeout(cleanUpNextTick);
2450 draining = true;
2451
2452 var len = queue.length;
2453 while(len) {
2454 currentQueue = queue;
2455 queue = [];
2456 while (++queueIndex < len) {
2457 if (currentQueue) {
2458 currentQueue[queueIndex].run();
2459 }
2460 }
2461 queueIndex = -1;
2462 len = queue.length;
2463 }
2464 currentQueue = null;
2465 draining = false;
2466 runClearTimeout(timeout);
2467 }
2468
2469 process.nextTick = function (fun) {
2470 var args = new Array(arguments.length - 1);
2471 if (arguments.length > 1) {
2472 for (var i = 1; i < arguments.length; i++) {
2473 args[i - 1] = arguments[i];
2474 }
2475 }
2476 queue.push(new Item(fun, args));
2477 if (queue.length === 1 && !draining) {
2478 runTimeout(drainQueue);
2479 }
2480 };
2481
2482 // v8 likes predictible objects
2483 function Item(fun, array) {
2484 this.fun = fun;
2485 this.array = array;
2486 }
2487 Item.prototype.run = function () {
2488 this.fun.apply(null, this.array);
2489 };
2490 process.title = 'browser';
2491 process.browser = true;
2492 process.env = {};
2493 process.argv = [];
2494 process.version = ''; // empty string to avoid regexp issues
2495 process.versions = {};
2496
2497 function noop() {}
2498
2499 process.on = noop;
2500 process.addListener = noop;
2501 process.once = noop;
2502 process.off = noop;
2503 process.removeListener = noop;
2504 process.removeAllListeners = noop;
2505 process.emit = noop;
2506 process.prependListener = noop;
2507 process.prependOnceListener = noop;
2508
2509 process.listeners = function (name) { return [] }
2510
2511 process.binding = function (name) {
2512 throw new Error('process.binding is not supported');
2513 };
2514
2515 process.cwd = function () { return '/' };
2516 process.chdir = function (dir) {
2517 throw new Error('process.chdir is not supported');
2518 };
2519 process.umask = function() { return 0; };
2520
2521
2522/***/ }),
2523/* 34 */
2524/***/ (function(module, exports, __webpack_require__) {
2525
2526 'use strict';
2527
2528 exports.__esModule = true;
2529
2530 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /**
2531 * This source code is quoted from rc-util.
2532 * homepage: https://github.com/react-component/util
2533 */
2534
2535
2536 var _react = __webpack_require__(4);
2537
2538 var _react2 = _interopRequireDefault(_react);
2539
2540 var _createChainableTypeChecker = __webpack_require__(29);
2541
2542 var _createChainableTypeChecker2 = _interopRequireDefault(_createChainableTypeChecker);
2543
2544 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2545
2546 function elementType(props, propName, componentName, location, propFullName) {
2547 var propValue = props[propName];
2548 var propType = typeof propValue === 'undefined' ? 'undefined' : _typeof(propValue);
2549
2550 if (_react2.default.isValidElement(propValue)) {
2551 return new Error('Invalid ' + location + ' `' + propFullName + '` of type ReactElement ' + ('supplied to `' + componentName + '`, expected an element type (a string ') + 'or a ReactClass).');
2552 }
2553
2554 if (propType !== 'function' && propType !== 'string') {
2555 return new Error('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected an element type (a string ') + 'or a ReactClass).');
2556 }
2557
2558 return null;
2559 }
2560
2561 exports.default = (0, _createChainableTypeChecker2.default)(elementType);
2562
2563/***/ }),
2564/* 35 */
2565/***/ (function(module, exports) {
2566
2567 'use strict';
2568
2569 exports.__esModule = true;
2570 exports.default = isRequiredForA11y;
2571 /**
2572 * This source code is quoted from rc-util.
2573 * homepage: https://github.com/react-component/util
2574 */
2575 function isRequiredForA11y(validator) {
2576 return function validate(props, propName, componentName, location, propFullName) {
2577 var componentNameSafe = componentName || '<<anonymous>>';
2578 var propFullNameSafe = propFullName || propName;
2579
2580 if (props[propName] == null) {
2581 return new Error('The ' + location + ' `' + propFullNameSafe + '` is required to make ' + ('`' + componentNameSafe + '` accessible for users of assistive ') + 'technologies such as screen readers.');
2582 }
2583
2584 for (var _len = arguments.length, args = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) {
2585 args[_key - 5] = arguments[_key];
2586 }
2587
2588 return validator.apply(undefined, [props, propName, componentName, location, propFullName].concat(args));
2589 };
2590 }
2591
2592/***/ }),
2593/* 36 */
2594/***/ (function(module, exports) {
2595
2596 "use strict";
2597
2598 exports.__esModule = true;
2599 exports.default = splitComponentProps;
2600 /**
2601 * This source code is quoted from rc-util.
2602 * homepage: https://github.com/react-component/util
2603 */
2604 function _objectEntries(obj) {
2605 var entries = [];
2606 var keys = Object.keys(obj);
2607
2608 for (var k = 0; k < keys.length; ++k) {
2609 entries.push([keys[k], obj[keys[k]]]);
2610 }return entries;
2611 }
2612
2613 /**
2614 * 分割要传入父元素和子元素的props
2615 * @param {[object]} props 传入的属性
2616 * @param {[reactElement]} Component 组件
2617 * @return {[array]} 返回数组,第一个元素为父元素props对象,第二个子元素props对象
2618 */
2619 function splitComponentProps(props, Component) {
2620 var componentPropTypes = Component.propTypes;
2621
2622 var parentProps = {};
2623 var childProps = {};
2624
2625 _objectEntries(props).forEach(function (_ref) {
2626 var propName = _ref[0],
2627 propValue = _ref[1];
2628
2629 if (componentPropTypes[propName]) {
2630 parentProps[propName] = propValue;
2631 } else {
2632 childProps[propName] = propValue;
2633 }
2634 });
2635
2636 return [parentProps, childProps];
2637 }
2638
2639/***/ }),
2640/* 37 */
2641/***/ (function(module, exports) {
2642
2643 'use strict';
2644
2645 exports.__esModule = true;
2646 /**
2647 * This source code is quoted from rc-util.
2648 * homepage: https://github.com/react-component/util
2649 */
2650 function createChainedFunction() {
2651 for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {
2652 funcs[_key] = arguments[_key];
2653 }
2654
2655 return funcs.filter(function (f) {
2656 return f != null;
2657 }).reduce(function (acc, f) {
2658 if (typeof f !== 'function') {
2659 throw new Error('Invalid Argument Type, must only provide functions, undefined, or null.');
2660 }
2661
2662 if (acc === null) {
2663 return f;
2664 }
2665
2666 return function chainedFunction() {
2667 for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
2668 args[_key2] = arguments[_key2];
2669 }
2670
2671 acc.apply(this, args);
2672 f.apply(this, args);
2673 };
2674 }, null);
2675 }
2676 exports.default = createChainedFunction;
2677
2678/***/ }),
2679/* 38 */
2680/***/ (function(module, exports) {
2681
2682 /**
2683 * This source code is quoted from rc-util.
2684 * homepage: https://github.com/react-component/util
2685 */
2686 'use strict';
2687
2688 /**
2689 * @ignore
2690 * some key-codes definition and utils from closure-library
2691 * @author yiminghe@gmail.com
2692 */
2693
2694 var KeyCode = {
2695 /**
2696 * MAC_ENTER
2697 */
2698 MAC_ENTER: 3,
2699 /**
2700 * BACKSPACE
2701 */
2702 BACKSPACE: 8,
2703 /**
2704 * TAB
2705 */
2706 TAB: 9,
2707 /**
2708 * NUMLOCK on FF/Safari Mac
2709 */
2710 NUM_CENTER: 12, // NUMLOCK on FF/Safari Mac
2711 /**
2712 * ENTER
2713 */
2714 ENTER: 13,
2715 /**
2716 * SHIFT
2717 */
2718 SHIFT: 16,
2719 /**
2720 * CTRL
2721 */
2722 CTRL: 17,
2723 /**
2724 * ALT
2725 */
2726 ALT: 18,
2727 /**
2728 * PAUSE
2729 */
2730 PAUSE: 19,
2731 /**
2732 * CAPS_LOCK
2733 */
2734 CAPS_LOCK: 20,
2735 /**
2736 * ESC
2737 */
2738 ESC: 27,
2739 /**
2740 * SPACE
2741 */
2742 SPACE: 32,
2743 /**
2744 * PAGE_UP
2745 */
2746 PAGE_UP: 33, // also NUM_NORTH_EAST
2747 /**
2748 * PAGE_DOWN
2749 */
2750 PAGE_DOWN: 34, // also NUM_SOUTH_EAST
2751 /**
2752 * END
2753 */
2754 END: 35, // also NUM_SOUTH_WEST
2755 /**
2756 * HOME
2757 */
2758 HOME: 36, // also NUM_NORTH_WEST
2759 /**
2760 * LEFT
2761 */
2762 LEFT: 37, // also NUM_WEST
2763 /**
2764 * UP
2765 */
2766 UP: 38, // also NUM_NORTH
2767 /**
2768 * RIGHT
2769 */
2770 RIGHT: 39, // also NUM_EAST
2771 /**
2772 * DOWN
2773 */
2774 DOWN: 40, // also NUM_SOUTH
2775 /**
2776 * PRINT_SCREEN
2777 */
2778 PRINT_SCREEN: 44,
2779 /**
2780 * INSERT
2781 */
2782 INSERT: 45, // also NUM_INSERT
2783 /**
2784 * DELETE
2785 */
2786 DELETE: 46, // also NUM_DELETE
2787 /**
2788 * ZERO
2789 */
2790 ZERO: 48,
2791 /**
2792 * ONE
2793 */
2794 ONE: 49,
2795 /**
2796 * TWO
2797 */
2798 TWO: 50,
2799 /**
2800 * THREE
2801 */
2802 THREE: 51,
2803 /**
2804 * FOUR
2805 */
2806 FOUR: 52,
2807 /**
2808 * FIVE
2809 */
2810 FIVE: 53,
2811 /**
2812 * SIX
2813 */
2814 SIX: 54,
2815 /**
2816 * SEVEN
2817 */
2818 SEVEN: 55,
2819 /**
2820 * EIGHT
2821 */
2822 EIGHT: 56,
2823 /**
2824 * NINE
2825 */
2826 NINE: 57,
2827 /**
2828 * QUESTION_MARK
2829 */
2830 QUESTION_MARK: 63, // needs localization
2831 /**
2832 * A
2833 */
2834 A: 65,
2835 /**
2836 * B
2837 */
2838 B: 66,
2839 /**
2840 * C
2841 */
2842 C: 67,
2843 /**
2844 * D
2845 */
2846 D: 68,
2847 /**
2848 * E
2849 */
2850 E: 69,
2851 /**
2852 * F
2853 */
2854 F: 70,
2855 /**
2856 * G
2857 */
2858 G: 71,
2859 /**
2860 * H
2861 */
2862 H: 72,
2863 /**
2864 * I
2865 */
2866 I: 73,
2867 /**
2868 * J
2869 */
2870 J: 74,
2871 /**
2872 * K
2873 */
2874 K: 75,
2875 /**
2876 * L
2877 */
2878 L: 76,
2879 /**
2880 * M
2881 */
2882 M: 77,
2883 /**
2884 * N
2885 */
2886 N: 78,
2887 /**
2888 * O
2889 */
2890 O: 79,
2891 /**
2892 * P
2893 */
2894 P: 80,
2895 /**
2896 * Q
2897 */
2898 Q: 81,
2899 /**
2900 * R
2901 */
2902 R: 82,
2903 /**
2904 * S
2905 */
2906 S: 83,
2907 /**
2908 * T
2909 */
2910 T: 84,
2911 /**
2912 * U
2913 */
2914 U: 85,
2915 /**
2916 * V
2917 */
2918 V: 86,
2919 /**
2920 * W
2921 */
2922 W: 87,
2923 /**
2924 * X
2925 */
2926 X: 88,
2927 /**
2928 * Y
2929 */
2930 Y: 89,
2931 /**
2932 * Z
2933 */
2934 Z: 90,
2935 /**
2936 * META
2937 */
2938 META: 91, // WIN_KEY_LEFT
2939 /**
2940 * WIN_KEY_RIGHT
2941 */
2942 WIN_KEY_RIGHT: 92,
2943 /**
2944 * CONTEXT_MENU
2945 */
2946 CONTEXT_MENU: 93,
2947 /**
2948 * NUM_ZERO
2949 */
2950 NUM_ZERO: 96,
2951 /**
2952 * NUM_ONE
2953 */
2954 NUM_ONE: 97,
2955 /**
2956 * NUM_TWO
2957 */
2958 NUM_TWO: 98,
2959 /**
2960 * NUM_THREE
2961 */
2962 NUM_THREE: 99,
2963 /**
2964 * NUM_FOUR
2965 */
2966 NUM_FOUR: 100,
2967 /**
2968 * NUM_FIVE
2969 */
2970 NUM_FIVE: 101,
2971 /**
2972 * NUM_SIX
2973 */
2974 NUM_SIX: 102,
2975 /**
2976 * NUM_SEVEN
2977 */
2978 NUM_SEVEN: 103,
2979 /**
2980 * NUM_EIGHT
2981 */
2982 NUM_EIGHT: 104,
2983 /**
2984 * NUM_NINE
2985 */
2986 NUM_NINE: 105,
2987 /**
2988 * NUM_MULTIPLY
2989 */
2990 NUM_MULTIPLY: 106,
2991 /**
2992 * NUM_PLUS
2993 */
2994 NUM_PLUS: 107,
2995 /**
2996 * NUM_MINUS
2997 */
2998 NUM_MINUS: 109,
2999 /**
3000 * NUM_PERIOD
3001 */
3002 NUM_PERIOD: 110,
3003 /**
3004 * NUM_DIVISION
3005 */
3006 NUM_DIVISION: 111,
3007 /**
3008 * F1
3009 */
3010 F1: 112,
3011 /**
3012 * F2
3013 */
3014 F2: 113,
3015 /**
3016 * F3
3017 */
3018 F3: 114,
3019 /**
3020 * F4
3021 */
3022 F4: 115,
3023 /**
3024 * F5
3025 */
3026 F5: 116,
3027 /**
3028 * F6
3029 */
3030 F6: 117,
3031 /**
3032 * F7
3033 */
3034 F7: 118,
3035 /**
3036 * F8
3037 */
3038 F8: 119,
3039 /**
3040 * F9
3041 */
3042 F9: 120,
3043 /**
3044 * F10
3045 */
3046 F10: 121,
3047 /**
3048 * F11
3049 */
3050 F11: 122,
3051 /**
3052 * F12
3053 */
3054 F12: 123,
3055 /**
3056 * NUMLOCK
3057 */
3058 NUMLOCK: 144,
3059 /**
3060 * SEMICOLON
3061 */
3062 SEMICOLON: 186, // needs localization
3063 /**
3064 * DASH
3065 */
3066 DASH: 189, // needs localization
3067 /**
3068 * EQUALS
3069 */
3070 EQUALS: 187, // needs localization
3071 /**
3072 * COMMA
3073 */
3074 COMMA: 188, // needs localization
3075 /**
3076 * PERIOD
3077 */
3078 PERIOD: 190, // needs localization
3079 /**
3080 * SLASH
3081 */
3082 SLASH: 191, // needs localization
3083 /**
3084 * APOSTROPHE
3085 */
3086 APOSTROPHE: 192, // needs localization
3087 /**
3088 * SINGLE_QUOTE
3089 */
3090 SINGLE_QUOTE: 222, // needs localization
3091 /**
3092 * OPEN_SQUARE_BRACKET
3093 */
3094 OPEN_SQUARE_BRACKET: 219, // needs localization
3095 /**
3096 * BACKSLASH
3097 */
3098 BACKSLASH: 220, // needs localization
3099 /**
3100 * CLOSE_SQUARE_BRACKET
3101 */
3102 CLOSE_SQUARE_BRACKET: 221, // needs localization
3103 /**
3104 * WIN_KEY
3105 */
3106 WIN_KEY: 224,
3107 /**
3108 * MAC_FF_META
3109 */
3110 MAC_FF_META: 224, // Firefox (Gecko) fires this for the meta key instead of 91
3111 /**
3112 * WIN_IME
3113 */
3114 WIN_IME: 229
3115 };
3116
3117 /*
3118 whether text and modified key is entered at the same time.
3119 */
3120 KeyCode.isTextModifyingKeyEvent = function isTextModifyingKeyEvent(e) {
3121 var keyCode = e.keyCode;
3122 if (e.altKey && !e.ctrlKey || e.metaKey ||
3123 // Function keys don't generate text
3124 keyCode >= KeyCode.F1 && keyCode <= KeyCode.F12) {
3125 return false;
3126 }
3127
3128 // The following keys are quite harmless, even in combination with
3129 // CTRL, ALT or SHIFT.
3130 switch (keyCode) {
3131 case KeyCode.ALT:
3132 case KeyCode.CAPS_LOCK:
3133 case KeyCode.CONTEXT_MENU:
3134 case KeyCode.CTRL:
3135 case KeyCode.DOWN:
3136 case KeyCode.END:
3137 case KeyCode.ESC:
3138 case KeyCode.HOME:
3139 case KeyCode.INSERT:
3140 case KeyCode.LEFT:
3141 case KeyCode.MAC_FF_META:
3142 case KeyCode.META:
3143 case KeyCode.NUMLOCK:
3144 case KeyCode.NUM_CENTER:
3145 case KeyCode.PAGE_DOWN:
3146 case KeyCode.PAGE_UP:
3147 case KeyCode.PAUSE:
3148 case KeyCode.PRINT_SCREEN:
3149 case KeyCode.RIGHT:
3150 case KeyCode.SHIFT:
3151 case KeyCode.UP:
3152 case KeyCode.WIN_KEY:
3153 case KeyCode.WIN_KEY_RIGHT:
3154 return false;
3155 default:
3156 return true;
3157 }
3158 };
3159
3160 /*
3161 whether character is entered.
3162 */
3163 KeyCode.isCharacterKey = function isCharacterKey(keyCode) {
3164 if (keyCode >= KeyCode.ZERO && keyCode <= KeyCode.NINE) {
3165 return true;
3166 }
3167
3168 if (keyCode >= KeyCode.NUM_ZERO && keyCode <= KeyCode.NUM_MULTIPLY) {
3169 return true;
3170 }
3171
3172 if (keyCode >= KeyCode.A && keyCode <= KeyCode.Z) {
3173 return true;
3174 }
3175
3176 // Safari sends zero key code for non-latin characters.
3177 if (window.navigation.userAgent.indexOf('WebKit') !== -1 && keyCode === 0) {
3178 return true;
3179 }
3180
3181 switch (keyCode) {
3182 case KeyCode.SPACE:
3183 case KeyCode.QUESTION_MARK:
3184 case KeyCode.NUM_PLUS:
3185 case KeyCode.NUM_MINUS:
3186 case KeyCode.NUM_PERIOD:
3187 case KeyCode.NUM_DIVISION:
3188 case KeyCode.SEMICOLON:
3189 case KeyCode.DASH:
3190 case KeyCode.EQUALS:
3191 case KeyCode.COMMA:
3192 case KeyCode.PERIOD:
3193 case KeyCode.SLASH:
3194 case KeyCode.APOSTROPHE:
3195 case KeyCode.SINGLE_QUOTE:
3196 case KeyCode.OPEN_SQUARE_BRACKET:
3197 case KeyCode.BACKSLASH:
3198 case KeyCode.CLOSE_SQUARE_BRACKET:
3199 return true;
3200 default:
3201 return false;
3202 }
3203 };
3204
3205 module.exports = KeyCode;
3206
3207/***/ }),
3208/* 39 */
3209/***/ (function(module, exports) {
3210
3211 "use strict";
3212
3213 exports.__esModule = true;
3214 exports.default = contains;
3215 /**
3216 * This source code is quoted from rc-util.
3217 * homepage: https://github.com/react-component/util
3218 */
3219 function contains(root, n) {
3220 var node = n;
3221 while (node) {
3222 if (node === root) {
3223 return true;
3224 }
3225 node = node.parentNode;
3226 }
3227
3228 return false;
3229 }
3230
3231/***/ }),
3232/* 40 */
3233/***/ (function(module, exports, __webpack_require__) {
3234
3235 'use strict';
3236
3237 exports.__esModule = true;
3238 exports.default = addEventListenerWrap;
3239
3240 var _addDomEventListener = __webpack_require__(41);
3241
3242 var _addDomEventListener2 = _interopRequireDefault(_addDomEventListener);
3243
3244 var _reactDom = __webpack_require__(12);
3245
3246 var _reactDom2 = _interopRequireDefault(_reactDom);
3247
3248 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3249
3250 /**
3251 * This source code is quoted from rc-util.
3252 * homepage: https://github.com/react-component/util
3253 */
3254 function addEventListenerWrap(target, eventType, cb) {
3255 /* eslint camelcase: 2 */
3256 var callback = _reactDom2.default.unstable_batchedUpdates ? function run(e) {
3257 _reactDom2.default.unstable_batchedUpdates(cb, e);
3258 } : cb;
3259 return (0, _addDomEventListener2.default)(target, eventType, callback);
3260 }
3261
3262/***/ }),
3263/* 41 */
3264/***/ (function(module, exports, __webpack_require__) {
3265
3266 'use strict';
3267
3268 Object.defineProperty(exports, '__esModule', {
3269 value: true
3270 });
3271 exports['default'] = addEventListener;
3272
3273 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
3274
3275 var _EventObject = __webpack_require__(42);
3276
3277 var _EventObject2 = _interopRequireDefault(_EventObject);
3278
3279 function addEventListener(target, eventType, callback, option) {
3280 function wrapCallback(e) {
3281 var ne = new _EventObject2['default'](e);
3282 callback.call(target, ne);
3283 }
3284
3285 if (target.addEventListener) {
3286 var _ret = (function () {
3287 var useCapture = false;
3288 if (typeof option === 'object') {
3289 useCapture = option.capture || false;
3290 } else if (typeof option === 'boolean') {
3291 useCapture = option;
3292 }
3293
3294 target.addEventListener(eventType, wrapCallback, option || false);
3295
3296 return {
3297 v: {
3298 remove: function remove() {
3299 target.removeEventListener(eventType, wrapCallback, useCapture);
3300 }
3301 }
3302 };
3303 })();
3304
3305 if (typeof _ret === 'object') return _ret.v;
3306 } else if (target.attachEvent) {
3307 target.attachEvent('on' + eventType, wrapCallback);
3308 return {
3309 remove: function remove() {
3310 target.detachEvent('on' + eventType, wrapCallback);
3311 }
3312 };
3313 }
3314 }
3315
3316 module.exports = exports['default'];
3317
3318/***/ }),
3319/* 42 */
3320/***/ (function(module, exports, __webpack_require__) {
3321
3322 /**
3323 * @ignore
3324 * event object for dom
3325 * @author yiminghe@gmail.com
3326 */
3327
3328 'use strict';
3329
3330 Object.defineProperty(exports, '__esModule', {
3331 value: true
3332 });
3333
3334 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
3335
3336 var _EventBaseObject = __webpack_require__(43);
3337
3338 var _EventBaseObject2 = _interopRequireDefault(_EventBaseObject);
3339
3340 var _objectAssign = __webpack_require__(44);
3341
3342 var _objectAssign2 = _interopRequireDefault(_objectAssign);
3343
3344 var TRUE = true;
3345 var FALSE = false;
3346 var commonProps = ['altKey', 'bubbles', 'cancelable', 'ctrlKey', 'currentTarget', 'eventPhase', 'metaKey', 'shiftKey', 'target', 'timeStamp', 'view', 'type'];
3347
3348 function isNullOrUndefined(w) {
3349 return w === null || w === undefined;
3350 }
3351
3352 var eventNormalizers = [{
3353 reg: /^key/,
3354 props: ['char', 'charCode', 'key', 'keyCode', 'which'],
3355 fix: function fix(event, nativeEvent) {
3356 if (isNullOrUndefined(event.which)) {
3357 event.which = !isNullOrUndefined(nativeEvent.charCode) ? nativeEvent.charCode : nativeEvent.keyCode;
3358 }
3359
3360 // add metaKey to non-Mac browsers (use ctrl for PC 's and Meta for Macs)
3361 if (event.metaKey === undefined) {
3362 event.metaKey = event.ctrlKey;
3363 }
3364 }
3365 }, {
3366 reg: /^touch/,
3367 props: ['touches', 'changedTouches', 'targetTouches']
3368 }, {
3369 reg: /^hashchange$/,
3370 props: ['newURL', 'oldURL']
3371 }, {
3372 reg: /^gesturechange$/i,
3373 props: ['rotation', 'scale']
3374 }, {
3375 reg: /^(mousewheel|DOMMouseScroll)$/,
3376 props: [],
3377 fix: function fix(event, nativeEvent) {
3378 var deltaX = undefined;
3379 var deltaY = undefined;
3380 var delta = undefined;
3381 var wheelDelta = nativeEvent.wheelDelta;
3382 var axis = nativeEvent.axis;
3383 var wheelDeltaY = nativeEvent.wheelDeltaY;
3384 var wheelDeltaX = nativeEvent.wheelDeltaX;
3385 var detail = nativeEvent.detail;
3386
3387 // ie/webkit
3388 if (wheelDelta) {
3389 delta = wheelDelta / 120;
3390 }
3391
3392 // gecko
3393 if (detail) {
3394 // press control e.detail == 1 else e.detail == 3
3395 delta = 0 - (detail % 3 === 0 ? detail / 3 : detail);
3396 }
3397
3398 // Gecko
3399 if (axis !== undefined) {
3400 if (axis === event.HORIZONTAL_AXIS) {
3401 deltaY = 0;
3402 deltaX = 0 - delta;
3403 } else if (axis === event.VERTICAL_AXIS) {
3404 deltaX = 0;
3405 deltaY = delta;
3406 }
3407 }
3408
3409 // Webkit
3410 if (wheelDeltaY !== undefined) {
3411 deltaY = wheelDeltaY / 120;
3412 }
3413 if (wheelDeltaX !== undefined) {
3414 deltaX = -1 * wheelDeltaX / 120;
3415 }
3416
3417 // 默认 deltaY (ie)
3418 if (!deltaX && !deltaY) {
3419 deltaY = delta;
3420 }
3421
3422 if (deltaX !== undefined) {
3423 /**
3424 * deltaX of mousewheel event
3425 * @property deltaX
3426 * @member Event.DomEvent.Object
3427 */
3428 event.deltaX = deltaX;
3429 }
3430
3431 if (deltaY !== undefined) {
3432 /**
3433 * deltaY of mousewheel event
3434 * @property deltaY
3435 * @member Event.DomEvent.Object
3436 */
3437 event.deltaY = deltaY;
3438 }
3439
3440 if (delta !== undefined) {
3441 /**
3442 * delta of mousewheel event
3443 * @property delta
3444 * @member Event.DomEvent.Object
3445 */
3446 event.delta = delta;
3447 }
3448 }
3449 }, {
3450 reg: /^mouse|contextmenu|click|mspointer|(^DOMMouseScroll$)/i,
3451 props: ['buttons', 'clientX', 'clientY', 'button', 'offsetX', 'relatedTarget', 'which', 'fromElement', 'toElement', 'offsetY', 'pageX', 'pageY', 'screenX', 'screenY'],
3452 fix: function fix(event, nativeEvent) {
3453 var eventDoc = undefined;
3454 var doc = undefined;
3455 var body = undefined;
3456 var target = event.target;
3457 var button = nativeEvent.button;
3458
3459 // Calculate pageX/Y if missing and clientX/Y available
3460 if (target && isNullOrUndefined(event.pageX) && !isNullOrUndefined(nativeEvent.clientX)) {
3461 eventDoc = target.ownerDocument || document;
3462 doc = eventDoc.documentElement;
3463 body = eventDoc.body;
3464 event.pageX = nativeEvent.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
3465 event.pageY = nativeEvent.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
3466 }
3467
3468 // which for click: 1 === left; 2 === middle; 3 === right
3469 // do not use button
3470 if (!event.which && button !== undefined) {
3471 if (button & 1) {
3472 event.which = 1;
3473 } else if (button & 2) {
3474 event.which = 3;
3475 } else if (button & 4) {
3476 event.which = 2;
3477 } else {
3478 event.which = 0;
3479 }
3480 }
3481
3482 // add relatedTarget, if necessary
3483 if (!event.relatedTarget && event.fromElement) {
3484 event.relatedTarget = event.fromElement === target ? event.toElement : event.fromElement;
3485 }
3486
3487 return event;
3488 }
3489 }];
3490
3491 function retTrue() {
3492 return TRUE;
3493 }
3494
3495 function retFalse() {
3496 return FALSE;
3497 }
3498
3499 function DomEventObject(nativeEvent) {
3500 var type = nativeEvent.type;
3501
3502 var isNative = typeof nativeEvent.stopPropagation === 'function' || typeof nativeEvent.cancelBubble === 'boolean';
3503
3504 _EventBaseObject2['default'].call(this);
3505
3506 this.nativeEvent = nativeEvent;
3507
3508 // in case dom event has been mark as default prevented by lower dom node
3509 var isDefaultPrevented = retFalse;
3510 if ('defaultPrevented' in nativeEvent) {
3511 isDefaultPrevented = nativeEvent.defaultPrevented ? retTrue : retFalse;
3512 } else if ('getPreventDefault' in nativeEvent) {
3513 // https://bugzilla.mozilla.org/show_bug.cgi?id=691151
3514 isDefaultPrevented = nativeEvent.getPreventDefault() ? retTrue : retFalse;
3515 } else if ('returnValue' in nativeEvent) {
3516 isDefaultPrevented = nativeEvent.returnValue === FALSE ? retTrue : retFalse;
3517 }
3518
3519 this.isDefaultPrevented = isDefaultPrevented;
3520
3521 var fixFns = [];
3522 var fixFn = undefined;
3523 var l = undefined;
3524 var prop = undefined;
3525 var props = commonProps.concat();
3526
3527 eventNormalizers.forEach(function (normalizer) {
3528 if (type.match(normalizer.reg)) {
3529 props = props.concat(normalizer.props);
3530 if (normalizer.fix) {
3531 fixFns.push(normalizer.fix);
3532 }
3533 }
3534 });
3535
3536 l = props.length;
3537
3538 // clone properties of the original event object
3539 while (l) {
3540 prop = props[--l];
3541 this[prop] = nativeEvent[prop];
3542 }
3543
3544 // fix target property, if necessary
3545 if (!this.target && isNative) {
3546 this.target = nativeEvent.srcElement || document; // srcElement might not be defined either
3547 }
3548
3549 // check if target is a text node (safari)
3550 if (this.target && this.target.nodeType === 3) {
3551 this.target = this.target.parentNode;
3552 }
3553
3554 l = fixFns.length;
3555
3556 while (l) {
3557 fixFn = fixFns[--l];
3558 fixFn(this, nativeEvent);
3559 }
3560
3561 this.timeStamp = nativeEvent.timeStamp || Date.now();
3562 }
3563
3564 var EventBaseObjectProto = _EventBaseObject2['default'].prototype;
3565
3566 (0, _objectAssign2['default'])(DomEventObject.prototype, EventBaseObjectProto, {
3567 constructor: DomEventObject,
3568
3569 preventDefault: function preventDefault() {
3570 var e = this.nativeEvent;
3571
3572 // if preventDefault exists run it on the original event
3573 if (e.preventDefault) {
3574 e.preventDefault();
3575 } else {
3576 // otherwise set the returnValue property of the original event to FALSE (IE)
3577 e.returnValue = FALSE;
3578 }
3579
3580 EventBaseObjectProto.preventDefault.call(this);
3581 },
3582
3583 stopPropagation: function stopPropagation() {
3584 var e = this.nativeEvent;
3585
3586 // if stopPropagation exists run it on the original event
3587 if (e.stopPropagation) {
3588 e.stopPropagation();
3589 } else {
3590 // otherwise set the cancelBubble property of the original event to TRUE (IE)
3591 e.cancelBubble = TRUE;
3592 }
3593
3594 EventBaseObjectProto.stopPropagation.call(this);
3595 }
3596 });
3597
3598 exports['default'] = DomEventObject;
3599 module.exports = exports['default'];
3600
3601/***/ }),
3602/* 43 */
3603/***/ (function(module, exports) {
3604
3605 /**
3606 * @ignore
3607 * base event object for custom and dom event.
3608 * @author yiminghe@gmail.com
3609 */
3610
3611 "use strict";
3612
3613 Object.defineProperty(exports, "__esModule", {
3614 value: true
3615 });
3616 function returnFalse() {
3617 return false;
3618 }
3619
3620 function returnTrue() {
3621 return true;
3622 }
3623
3624 function EventBaseObject() {
3625 this.timeStamp = Date.now();
3626 this.target = undefined;
3627 this.currentTarget = undefined;
3628 }
3629
3630 EventBaseObject.prototype = {
3631 isEventObject: 1,
3632
3633 constructor: EventBaseObject,
3634
3635 isDefaultPrevented: returnFalse,
3636
3637 isPropagationStopped: returnFalse,
3638
3639 isImmediatePropagationStopped: returnFalse,
3640
3641 preventDefault: function preventDefault() {
3642 this.isDefaultPrevented = returnTrue;
3643 },
3644
3645 stopPropagation: function stopPropagation() {
3646 this.isPropagationStopped = returnTrue;
3647 },
3648
3649 stopImmediatePropagation: function stopImmediatePropagation() {
3650 this.isImmediatePropagationStopped = returnTrue;
3651 // fixed 1.2
3652 // call stopPropagation implicitly
3653 this.stopPropagation();
3654 },
3655
3656 halt: function halt(immediate) {
3657 if (immediate) {
3658 this.stopImmediatePropagation();
3659 } else {
3660 this.stopPropagation();
3661 }
3662 this.preventDefault();
3663 }
3664 };
3665
3666 exports["default"] = EventBaseObject;
3667 module.exports = exports["default"];
3668
3669/***/ }),
3670/* 44 */
3671/***/ (function(module, exports) {
3672
3673 /*
3674 object-assign
3675 (c) Sindre Sorhus
3676 @license MIT
3677 */
3678
3679 'use strict';
3680 /* eslint-disable no-unused-vars */
3681 var getOwnPropertySymbols = Object.getOwnPropertySymbols;
3682 var hasOwnProperty = Object.prototype.hasOwnProperty;
3683 var propIsEnumerable = Object.prototype.propertyIsEnumerable;
3684
3685 function toObject(val) {
3686 if (val === null || val === undefined) {
3687 throw new TypeError('Object.assign cannot be called with null or undefined');
3688 }
3689
3690 return Object(val);
3691 }
3692
3693 function shouldUseNative() {
3694 try {
3695 if (!Object.assign) {
3696 return false;
3697 }
3698
3699 // Detect buggy property enumeration order in older V8 versions.
3700
3701 // https://bugs.chromium.org/p/v8/issues/detail?id=4118
3702 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
3703 test1[5] = 'de';
3704 if (Object.getOwnPropertyNames(test1)[0] === '5') {
3705 return false;
3706 }
3707
3708 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
3709 var test2 = {};
3710 for (var i = 0; i < 10; i++) {
3711 test2['_' + String.fromCharCode(i)] = i;
3712 }
3713 var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
3714 return test2[n];
3715 });
3716 if (order2.join('') !== '0123456789') {
3717 return false;
3718 }
3719
3720 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
3721 var test3 = {};
3722 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
3723 test3[letter] = letter;
3724 });
3725 if (Object.keys(Object.assign({}, test3)).join('') !==
3726 'abcdefghijklmnopqrst') {
3727 return false;
3728 }
3729
3730 return true;
3731 } catch (err) {
3732 // We don't expect any of the above to throw, but better to be safe.
3733 return false;
3734 }
3735 }
3736
3737 module.exports = shouldUseNative() ? Object.assign : function (target, source) {
3738 var from;
3739 var to = toObject(target);
3740 var symbols;
3741
3742 for (var s = 1; s < arguments.length; s++) {
3743 from = Object(arguments[s]);
3744
3745 for (var key in from) {
3746 if (hasOwnProperty.call(from, key)) {
3747 to[key] = from[key];
3748 }
3749 }
3750
3751 if (getOwnPropertySymbols) {
3752 symbols = getOwnPropertySymbols(from);
3753 for (var i = 0; i < symbols.length; i++) {
3754 if (propIsEnumerable.call(from, symbols[i])) {
3755 to[symbols[i]] = from[symbols[i]];
3756 }
3757 }
3758 }
3759 }
3760
3761 return to;
3762 };
3763
3764
3765/***/ }),
3766/* 45 */
3767/***/ (function(module, exports, __webpack_require__) {
3768
3769 'use strict';
3770
3771 exports.__esModule = true;
3772
3773 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /**
3774 * This source code is quoted from rc-util.
3775 * homepage: https://github.com/react-component/util
3776 */
3777
3778
3779 var _Event = __webpack_require__(46);
3780
3781 var _Event2 = _interopRequireDefault(_Event);
3782
3783 var _componentClasses = __webpack_require__(47);
3784
3785 var _componentClasses2 = _interopRequireDefault(_componentClasses);
3786
3787 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3788
3789 var isCssAnimationSupported = _Event2.default.endEvents.length !== 0;
3790
3791
3792 var capitalPrefixes = ['Webkit', 'Moz', 'O',
3793 // ms is special .... !
3794 'ms'];
3795 var prefixes = ['-webkit-', '-moz-', '-o-', 'ms-', ''];
3796
3797 function getStyleProperty(node, name) {
3798 var style = window.getComputedStyle(node);
3799
3800 var ret = '';
3801 for (var i = 0; i < prefixes.length; i++) {
3802 ret = style.getPropertyValue(prefixes[i] + name);
3803 if (ret) {
3804 break;
3805 }
3806 }
3807 return ret;
3808 }
3809
3810 function fixBrowserByTimeout(node) {
3811 if (isCssAnimationSupported) {
3812 var transitionDelay = parseFloat(getStyleProperty(node, 'transition-delay')) || 0;
3813 var transitionDuration = parseFloat(getStyleProperty(node, 'transition-duration')) || 0;
3814 var animationDelay = parseFloat(getStyleProperty(node, 'animation-delay')) || 0;
3815 var animationDuration = parseFloat(getStyleProperty(node, 'animation-duration')) || 0;
3816 var time = Math.max(transitionDuration + transitionDelay, animationDuration + animationDelay);
3817 // sometimes, browser bug
3818 node.rcEndAnimTimeout = setTimeout(function () {
3819 node.rcEndAnimTimeout = null;
3820 if (node.rcEndListener) {
3821 node.rcEndListener();
3822 }
3823 }, time * 1000 + 200);
3824 }
3825 }
3826
3827 function clearBrowserBugTimeout(node) {
3828 if (node.rcEndAnimTimeout) {
3829 clearTimeout(node.rcEndAnimTimeout);
3830 node.rcEndAnimTimeout = null;
3831 }
3832 }
3833
3834 var cssAnimation = function cssAnimation(node, transitionName, endCallback) {
3835 var nameIsObj = (typeof transitionName === 'undefined' ? 'undefined' : _typeof(transitionName)) === 'object';
3836 var className = nameIsObj ? transitionName.name : transitionName;
3837 var activeClassName = nameIsObj ? transitionName.active : transitionName + '-active';
3838 var end = endCallback;
3839 var start = void 0;
3840 var active = void 0;
3841 var nodeClasses = (0, _componentClasses2.default)(node);
3842
3843 if (endCallback && Object.prototype.toString.call(endCallback) === '[object Object]') {
3844 end = endCallback.end;
3845 start = endCallback.start;
3846 active = endCallback.active;
3847 }
3848
3849 if (node.rcEndListener) {
3850 node.rcEndListener();
3851 }
3852
3853 node.rcEndListener = function (e) {
3854 if (e && e.target !== node) {
3855 return;
3856 }
3857
3858 if (node.rcAnimTimeout) {
3859 clearTimeout(node.rcAnimTimeout);
3860 node.rcAnimTimeout = null;
3861 }
3862
3863 clearBrowserBugTimeout(node);
3864
3865 nodeClasses.remove(className);
3866 nodeClasses.remove(activeClassName);
3867
3868 _Event2.default.removeEndEventListener(node, node.rcEndListener);
3869 node.rcEndListener = null;
3870
3871 // Usually this optional end is used for informing an owner of
3872 // a leave animation and telling it to remove the child.
3873 if (end) {
3874 end();
3875 }
3876 };
3877
3878 _Event2.default.addEndEventListener(node, node.rcEndListener);
3879
3880 if (start) {
3881 start();
3882 }
3883 nodeClasses.add(className);
3884
3885 node.rcAnimTimeout = setTimeout(function () {
3886 node.rcAnimTimeout = null;
3887 nodeClasses.add(activeClassName);
3888 if (active) {
3889 setTimeout(active, 0);
3890 }
3891 fixBrowserByTimeout(node);
3892 // 30ms for firefox
3893 }, 30);
3894
3895 return {
3896 stop: function stop() {
3897 if (node.rcEndListener) {
3898 node.rcEndListener();
3899 }
3900 }
3901 };
3902 };
3903
3904 cssAnimation.style = function (node, style, callback) {
3905 if (node.rcEndListener) {
3906 node.rcEndListener();
3907 }
3908
3909 node.rcEndListener = function (e) {
3910 if (e && e.target !== node) {
3911 return;
3912 }
3913
3914 if (node.rcAnimTimeout) {
3915 clearTimeout(node.rcAnimTimeout);
3916 node.rcAnimTimeout = null;
3917 }
3918
3919 clearBrowserBugTimeout(node);
3920
3921 _Event2.default.removeEndEventListener(node, node.rcEndListener);
3922 node.rcEndListener = null;
3923
3924 // Usually this optional callback is used for informing an owner of
3925 // a leave animation and telling it to remove the child.
3926 if (callback) {
3927 callback();
3928 }
3929 };
3930
3931 _Event2.default.addEndEventListener(node, node.rcEndListener);
3932
3933 node.rcAnimTimeout = setTimeout(function () {
3934 for (var s in style) {
3935 if (style.hasOwnProperty(s)) {
3936 node.style[s] = style[s];
3937 }
3938 }
3939 node.rcAnimTimeout = null;
3940 fixBrowserByTimeout(node);
3941 }, 0);
3942 };
3943
3944 cssAnimation.setTransition = function (node, p, value) {
3945 var property = p;
3946 var v = value;
3947 if (value === undefined) {
3948 v = property;
3949 property = '';
3950 }
3951 property = property || '';
3952 capitalPrefixes.forEach(function (prefix) {
3953 node.style[prefix + 'Transition' + property] = v;
3954 });
3955 };
3956
3957 cssAnimation.isCssAnimationSupported = isCssAnimationSupported;
3958
3959 exports.default = cssAnimation;
3960
3961/***/ }),
3962/* 46 */
3963/***/ (function(module, exports) {
3964
3965 'use strict';
3966
3967 exports.__esModule = true;
3968 /**
3969 * This source code is quoted from rc-util.
3970 * homepage: https://github.com/react-component/util
3971 */
3972 var EVENT_NAME_MAP = {
3973 transitionend: {
3974 transition: 'transitionend',
3975 WebkitTransition: 'webkitTransitionEnd',
3976 MozTransition: 'mozTransitionEnd',
3977 OTransition: 'oTransitionEnd',
3978 msTransition: 'MSTransitionEnd'
3979 },
3980
3981 animationend: {
3982 animation: 'animationend',
3983 WebkitAnimation: 'webkitAnimationEnd',
3984 MozAnimation: 'mozAnimationEnd',
3985 OAnimation: 'oAnimationEnd',
3986 msAnimation: 'MSAnimationEnd'
3987 }
3988 };
3989
3990 var endEvents = [];
3991
3992 function detectEvents() {
3993 var testEl = document.createElement('div');
3994 var style = testEl.style;
3995
3996 if (!('AnimationEvent' in window)) {
3997 delete EVENT_NAME_MAP.animationend.animation;
3998 }
3999
4000 if (!('TransitionEvent' in window)) {
4001 delete EVENT_NAME_MAP.transitionend.transition;
4002 }
4003
4004 for (var baseEventName in EVENT_NAME_MAP) {
4005 if (EVENT_NAME_MAP.hasOwnProperty(baseEventName)) {
4006 var baseEvents = EVENT_NAME_MAP[baseEventName];
4007 for (var styleName in baseEvents) {
4008 if (styleName in style) {
4009 endEvents.push(baseEvents[styleName]);
4010 break;
4011 }
4012 }
4013 }
4014 }
4015 }
4016
4017 if (typeof window !== 'undefined' && typeof document !== 'undefined') {
4018 detectEvents();
4019 }
4020
4021 function addEventListener(node, eventName, eventListener) {
4022 node.addEventListener(eventName, eventListener, false);
4023 }
4024
4025 function removeEventListener(node, eventName, eventListener) {
4026 node.removeEventListener(eventName, eventListener, false);
4027 }
4028
4029 var TransitionEvents = {
4030 addEndEventListener: function addEndEventListener(node, eventListener) {
4031 if (endEvents.length === 0) {
4032 window.setTimeout(eventListener, 0);
4033 return;
4034 }
4035 endEvents.forEach(function (endEvent) {
4036 addEventListener(node, endEvent, eventListener);
4037 });
4038 },
4039
4040
4041 endEvents: endEvents,
4042
4043 removeEndEventListener: function removeEndEventListener(node, eventListener) {
4044 if (endEvents.length === 0) {
4045 return;
4046 }
4047 endEvents.forEach(function (endEvent) {
4048 removeEventListener(node, endEvent, eventListener);
4049 });
4050 }
4051 };
4052
4053 exports.default = TransitionEvents;
4054
4055/***/ }),
4056/* 47 */
4057/***/ (function(module, exports, __webpack_require__) {
4058
4059 /**
4060 * Module dependencies.
4061 */
4062
4063 try {
4064 var index = __webpack_require__(48);
4065 } catch (err) {
4066 var index = __webpack_require__(48);
4067 }
4068
4069 /**
4070 * Whitespace regexp.
4071 */
4072
4073 var re = /\s+/;
4074
4075 /**
4076 * toString reference.
4077 */
4078
4079 var toString = Object.prototype.toString;
4080
4081 /**
4082 * Wrap `el` in a `ClassList`.
4083 *
4084 * @param {Element} el
4085 * @return {ClassList}
4086 * @api public
4087 */
4088
4089 module.exports = function(el){
4090 return new ClassList(el);
4091 };
4092
4093 /**
4094 * Initialize a new ClassList for `el`.
4095 *
4096 * @param {Element} el
4097 * @api private
4098 */
4099
4100 function ClassList(el) {
4101 if (!el || !el.nodeType) {
4102 throw new Error('A DOM element reference is required');
4103 }
4104 this.el = el;
4105 this.list = el.classList;
4106 }
4107
4108 /**
4109 * Add class `name` if not already present.
4110 *
4111 * @param {String} name
4112 * @return {ClassList}
4113 * @api public
4114 */
4115
4116 ClassList.prototype.add = function(name){
4117 // classList
4118 if (this.list) {
4119 this.list.add(name);
4120 return this;
4121 }
4122
4123 // fallback
4124 var arr = this.array();
4125 var i = index(arr, name);
4126 if (!~i) arr.push(name);
4127 this.el.className = arr.join(' ');
4128 return this;
4129 };
4130
4131 /**
4132 * Remove class `name` when present, or
4133 * pass a regular expression to remove
4134 * any which match.
4135 *
4136 * @param {String|RegExp} name
4137 * @return {ClassList}
4138 * @api public
4139 */
4140
4141 ClassList.prototype.remove = function(name){
4142 if ('[object RegExp]' == toString.call(name)) {
4143 return this.removeMatching(name);
4144 }
4145
4146 // classList
4147 if (this.list) {
4148 this.list.remove(name);
4149 return this;
4150 }
4151
4152 // fallback
4153 var arr = this.array();
4154 var i = index(arr, name);
4155 if (~i) arr.splice(i, 1);
4156 this.el.className = arr.join(' ');
4157 return this;
4158 };
4159
4160 /**
4161 * Remove all classes matching `re`.
4162 *
4163 * @param {RegExp} re
4164 * @return {ClassList}
4165 * @api private
4166 */
4167
4168 ClassList.prototype.removeMatching = function(re){
4169 var arr = this.array();
4170 for (var i = 0; i < arr.length; i++) {
4171 if (re.test(arr[i])) {
4172 this.remove(arr[i]);
4173 }
4174 }
4175 return this;
4176 };
4177
4178 /**
4179 * Toggle class `name`, can force state via `force`.
4180 *
4181 * For browsers that support classList, but do not support `force` yet,
4182 * the mistake will be detected and corrected.
4183 *
4184 * @param {String} name
4185 * @param {Boolean} force
4186 * @return {ClassList}
4187 * @api public
4188 */
4189
4190 ClassList.prototype.toggle = function(name, force){
4191 // classList
4192 if (this.list) {
4193 if ("undefined" !== typeof force) {
4194 if (force !== this.list.toggle(name, force)) {
4195 this.list.toggle(name); // toggle again to correct
4196 }
4197 } else {
4198 this.list.toggle(name);
4199 }
4200 return this;
4201 }
4202
4203 // fallback
4204 if ("undefined" !== typeof force) {
4205 if (!force) {
4206 this.remove(name);
4207 } else {
4208 this.add(name);
4209 }
4210 } else {
4211 if (this.has(name)) {
4212 this.remove(name);
4213 } else {
4214 this.add(name);
4215 }
4216 }
4217
4218 return this;
4219 };
4220
4221 /**
4222 * Return an array of classes.
4223 *
4224 * @return {Array}
4225 * @api public
4226 */
4227
4228 ClassList.prototype.array = function(){
4229 var className = this.el.getAttribute('class') || '';
4230 var str = className.replace(/^\s+|\s+$/g, '');
4231 var arr = str.split(re);
4232 if ('' === arr[0]) arr.shift();
4233 return arr;
4234 };
4235
4236 /**
4237 * Check if class `name` is present.
4238 *
4239 * @param {String} name
4240 * @return {ClassList}
4241 * @api public
4242 */
4243
4244 ClassList.prototype.has =
4245 ClassList.prototype.contains = function(name){
4246 return this.list
4247 ? this.list.contains(name)
4248 : !! ~index(this.array(), name);
4249 };
4250
4251
4252/***/ }),
4253/* 48 */
4254/***/ (function(module, exports) {
4255
4256 module.exports = function(arr, obj){
4257 if (arr.indexOf) return arr.indexOf(obj);
4258 for (var i = 0; i < arr.length; ++i) {
4259 if (arr[i] === obj) return i;
4260 }
4261 return -1;
4262 };
4263
4264/***/ }),
4265/* 49 */
4266/***/ (function(module, exports, __webpack_require__) {
4267
4268 'use strict';
4269
4270 exports.__esModule = true;
4271 exports.default = toArray;
4272
4273 var _react = __webpack_require__(4);
4274
4275 var _react2 = _interopRequireDefault(_react);
4276
4277 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4278
4279 function toArray(children) {
4280 var ret = [];
4281 _react2.default.Children.forEach(children, function (c) {
4282 ret.push(c);
4283 });
4284 return ret;
4285 } /**
4286 * This source code is quoted from rc-util.
4287 * homepage: https://github.com/react-component/util
4288 */
4289
4290/***/ }),
4291/* 50 */
4292/***/ (function(module, exports, __webpack_require__) {
4293
4294 'use strict';
4295
4296 exports.__esModule = true;
4297
4298 var _react = __webpack_require__(4);
4299
4300 var _react2 = _interopRequireDefault(_react);
4301
4302 var _propTypes = __webpack_require__(5);
4303
4304 var _propTypes2 = _interopRequireDefault(_propTypes);
4305
4306 var _reactDom = __webpack_require__(12);
4307
4308 var _reactDom2 = _interopRequireDefault(_reactDom);
4309
4310 var _domAlign = __webpack_require__(51);
4311
4312 var _domAlign2 = _interopRequireDefault(_domAlign);
4313
4314 var _addEventListener = __webpack_require__(40);
4315
4316 var _addEventListener2 = _interopRequireDefault(_addEventListener);
4317
4318 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4319
4320 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4321
4322 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
4323
4324 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**
4325 * This source code is quoted from rc-util.
4326 * homepage: https://github.com/react-component/util
4327 */
4328
4329
4330 //import isWindow from './isWindow';
4331
4332 function isWindow(obj) {
4333 /* eslint no-eq-null: 0 */
4334 /* eslint eqeqeq: 0 */
4335 return obj != null && obj == obj.window;
4336 }
4337
4338 function buffer(fn, ms) {
4339 var timer = void 0;
4340
4341 function clear() {
4342 if (timer) {
4343 clearTimeout(timer);
4344 timer = null;
4345 }
4346 }
4347
4348 function bufferFn() {
4349 clear();
4350 timer = setTimeout(fn, ms);
4351 }
4352
4353 bufferFn.clear = clear;
4354
4355 return bufferFn;
4356 }
4357
4358 var propTypes = {
4359 childrenProps: _propTypes2.default.object,
4360 align: _propTypes2.default.object.isRequired,
4361 target: _propTypes2.default.func,
4362 onAlign: _propTypes2.default.func,
4363 monitorBufferTime: _propTypes2.default.number,
4364 monitorWindowResize: _propTypes2.default.bool,
4365 disabled: _propTypes2.default.bool,
4366 children: _propTypes2.default.any
4367 };
4368
4369 var defaultProps = {
4370 target: function target() {
4371 return window;
4372 },
4373 onAlign: function onAlign() {},
4374
4375 monitorBufferTime: 50,
4376 monitorWindowResize: false,
4377 disabled: false
4378 };
4379
4380 var Align = function (_React$Component) {
4381 _inherits(Align, _React$Component);
4382
4383 function Align(props) {
4384 _classCallCheck(this, Align);
4385
4386 var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
4387
4388 _initialiseProps.call(_this);
4389
4390 return _this;
4391 }
4392
4393 Align.prototype.componentDidMount = function componentDidMount() {
4394 var props = this.props;
4395 // if parent ref not attached .... use document.getElementById
4396 this.forceAlign();
4397 if (!props.disabled && props.monitorWindowResize) {
4398 this.startMonitorWindowResize();
4399 }
4400 };
4401
4402 Align.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {
4403 var reAlign = false;
4404 var props = this.props;
4405
4406 if (!props.disabled) {
4407 if (prevProps.disabled || prevProps.align !== props.align) {
4408 reAlign = true;
4409 } else {
4410 var lastTarget = prevProps.target();
4411 var currentTarget = props.target();
4412 if (isWindow(lastTarget) && isWindow(currentTarget)) {
4413 reAlign = false;
4414 } else if (lastTarget !== currentTarget) {
4415 reAlign = true;
4416 }
4417 }
4418 }
4419
4420 if (reAlign) {
4421 this.forceAlign();
4422 }
4423
4424 if (props.monitorWindowResize && !props.disabled) {
4425 this.startMonitorWindowResize();
4426 } else {
4427 this.stopMonitorWindowResize();
4428 }
4429 };
4430
4431 Align.prototype.componentWillUnmount = function componentWillUnmount() {
4432 this.stopMonitorWindowResize();
4433 };
4434
4435 Align.prototype.render = function render() {
4436 var _props = this.props,
4437 childrenProps = _props.childrenProps,
4438 children = _props.children;
4439
4440 var child = _react2.default.Children.only(children);
4441 if (childrenProps) {
4442 var newProps = {};
4443 for (var prop in childrenProps) {
4444 if (childrenProps.hasOwnProperty(prop)) {
4445 newProps[prop] = this.props[childrenProps[prop]];
4446 }
4447 }
4448 return _react2.default.cloneElement(child, newProps);
4449 }
4450 return child;
4451 };
4452
4453 return Align;
4454 }(_react2.default.Component);
4455
4456 var _initialiseProps = function _initialiseProps() {
4457 var _this2 = this;
4458
4459 this.startMonitorWindowResize = function () {
4460 if (!_this2.resizeHandler) {
4461 _this2.bufferMonitor = buffer(_this2.forceAlign, _this2.props.monitorBufferTime);
4462 _this2.resizeHandler = (0, _addEventListener2.default)(window, 'resize', _this2.bufferMonitor);
4463 }
4464 };
4465
4466 this.stopMonitorWindowResize = function () {
4467 if (_this2.resizeHandler) {
4468 _this2.bufferMonitor.clear();
4469 _this2.resizeHandler.remove();
4470 _this2.resizeHandler = null;
4471 }
4472 };
4473
4474 this.forceAlign = function () {
4475 var props = _this2.props;
4476 if (!props.disabled) {
4477 var source = _reactDom2.default.findDOMNode(_this2);
4478 props.onAlign(source, (0, _domAlign2.default)(source, props.target(), props.align));
4479 }
4480 };
4481 };
4482
4483 ;
4484
4485 Align.defaultProps = defaultProps;
4486 Align.propTypes = propTypes;
4487
4488 exports.default = Align;
4489
4490/***/ }),
4491/* 51 */
4492/***/ (function(module, exports, __webpack_require__) {
4493
4494 'use strict';
4495
4496 Object.defineProperty(exports, "__esModule", {
4497 value: true
4498 });
4499 exports.alignPoint = exports.alignElement = undefined;
4500
4501 var _alignElement = __webpack_require__(52);
4502
4503 var _alignElement2 = _interopRequireDefault(_alignElement);
4504
4505 var _alignPoint = __webpack_require__(63);
4506
4507 var _alignPoint2 = _interopRequireDefault(_alignPoint);
4508
4509 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
4510
4511 exports.alignElement = _alignElement2['default'];
4512 exports.alignPoint = _alignPoint2['default'];
4513 exports['default'] = _alignElement2['default'];
4514
4515/***/ }),
4516/* 52 */
4517/***/ (function(module, exports, __webpack_require__) {
4518
4519 'use strict';
4520
4521 Object.defineProperty(exports, "__esModule", {
4522 value: true
4523 });
4524
4525 var _align = __webpack_require__(53);
4526
4527 var _align2 = _interopRequireDefault(_align);
4528
4529 var _getOffsetParent = __webpack_require__(57);
4530
4531 var _getOffsetParent2 = _interopRequireDefault(_getOffsetParent);
4532
4533 var _getVisibleRectForElement = __webpack_require__(56);
4534
4535 var _getVisibleRectForElement2 = _interopRequireDefault(_getVisibleRectForElement);
4536
4537 var _getRegion = __webpack_require__(60);
4538
4539 var _getRegion2 = _interopRequireDefault(_getRegion);
4540
4541 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
4542
4543 function isOutOfVisibleRect(target) {
4544 var visibleRect = (0, _getVisibleRectForElement2['default'])(target);
4545 var targetRegion = (0, _getRegion2['default'])(target);
4546
4547 return !visibleRect || targetRegion.left + targetRegion.width <= visibleRect.left || targetRegion.top + targetRegion.height <= visibleRect.top || targetRegion.left >= visibleRect.right || targetRegion.top >= visibleRect.bottom;
4548 }
4549
4550 function alignElement(el, refNode, align) {
4551 var target = align.target || refNode;
4552 var refNodeRegion = (0, _getRegion2['default'])(target);
4553
4554 var isTargetNotOutOfVisible = !isOutOfVisibleRect(target);
4555
4556 return (0, _align2['default'])(el, refNodeRegion, align, isTargetNotOutOfVisible);
4557 }
4558
4559 alignElement.__getOffsetParent = _getOffsetParent2['default'];
4560
4561 alignElement.__getVisibleRectForElement = _getVisibleRectForElement2['default'];
4562
4563 exports['default'] = alignElement;
4564 module.exports = exports['default'];
4565
4566/***/ }),
4567/* 53 */
4568/***/ (function(module, exports, __webpack_require__) {
4569
4570 'use strict';
4571
4572 Object.defineProperty(exports, "__esModule", {
4573 value: true
4574 });
4575
4576 var _utils = __webpack_require__(54);
4577
4578 var _utils2 = _interopRequireDefault(_utils);
4579
4580 var _getVisibleRectForElement = __webpack_require__(56);
4581
4582 var _getVisibleRectForElement2 = _interopRequireDefault(_getVisibleRectForElement);
4583
4584 var _adjustForViewport = __webpack_require__(59);
4585
4586 var _adjustForViewport2 = _interopRequireDefault(_adjustForViewport);
4587
4588 var _getRegion = __webpack_require__(60);
4589
4590 var _getRegion2 = _interopRequireDefault(_getRegion);
4591
4592 var _getElFuturePos = __webpack_require__(61);
4593
4594 var _getElFuturePos2 = _interopRequireDefault(_getElFuturePos);
4595
4596 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
4597
4598 // http://yiminghe.iteye.com/blog/1124720
4599
4600 function isFailX(elFuturePos, elRegion, visibleRect) {
4601 return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;
4602 } /**
4603 * align dom node flexibly
4604 * @author yiminghe@gmail.com
4605 */
4606
4607 function isFailY(elFuturePos, elRegion, visibleRect) {
4608 return elFuturePos.top < visibleRect.top || elFuturePos.top + elRegion.height > visibleRect.bottom;
4609 }
4610
4611 function isCompleteFailX(elFuturePos, elRegion, visibleRect) {
4612 return elFuturePos.left > visibleRect.right || elFuturePos.left + elRegion.width < visibleRect.left;
4613 }
4614
4615 function isCompleteFailY(elFuturePos, elRegion, visibleRect) {
4616 return elFuturePos.top > visibleRect.bottom || elFuturePos.top + elRegion.height < visibleRect.top;
4617 }
4618
4619 function flip(points, reg, map) {
4620 var ret = [];
4621 _utils2['default'].each(points, function (p) {
4622 ret.push(p.replace(reg, function (m) {
4623 return map[m];
4624 }));
4625 });
4626 return ret;
4627 }
4628
4629 function flipOffset(offset, index) {
4630 offset[index] = -offset[index];
4631 return offset;
4632 }
4633
4634 function convertOffset(str, offsetLen) {
4635 var n = void 0;
4636 if (/%$/.test(str)) {
4637 n = parseInt(str.substring(0, str.length - 1), 10) / 100 * offsetLen;
4638 } else {
4639 n = parseInt(str, 10);
4640 }
4641 return n || 0;
4642 }
4643
4644 function normalizeOffset(offset, el) {
4645 offset[0] = convertOffset(offset[0], el.width);
4646 offset[1] = convertOffset(offset[1], el.height);
4647 }
4648
4649 /**
4650 * @param el
4651 * @param tgtRegion 参照节点所占的区域: { left, top, width, height }
4652 * @param align
4653 */
4654 function doAlign(el, tgtRegion, align, isTgtRegionVisible) {
4655 var points = align.points;
4656 var offset = align.offset || [0, 0];
4657 var targetOffset = align.targetOffset || [0, 0];
4658 var overflow = align.overflow;
4659 var source = align.source || el;
4660 offset = [].concat(offset);
4661 targetOffset = [].concat(targetOffset);
4662 overflow = overflow || {};
4663 var newOverflowCfg = {};
4664 var fail = 0;
4665 // 当前节点可以被放置的显示区域
4666 var visibleRect = (0, _getVisibleRectForElement2['default'])(source);
4667 // 当前节点所占的区域, left/top/width/height
4668 var elRegion = (0, _getRegion2['default'])(source);
4669 // 将 offset 转换成数值,支持百分比
4670 normalizeOffset(offset, elRegion);
4671 normalizeOffset(targetOffset, tgtRegion);
4672 // 当前节点将要被放置的位置
4673 var elFuturePos = (0, _getElFuturePos2['default'])(elRegion, tgtRegion, points, offset, targetOffset);
4674 // 当前节点将要所处的区域
4675 var newElRegion = _utils2['default'].merge(elRegion, elFuturePos);
4676
4677 // 如果可视区域不能完全放置当前节点时允许调整
4678 if (visibleRect && (overflow.adjustX || overflow.adjustY) && isTgtRegionVisible) {
4679 if (overflow.adjustX) {
4680 // 如果横向不能放下
4681 if (isFailX(elFuturePos, elRegion, visibleRect)) {
4682 // 对齐位置反下
4683 var newPoints = flip(points, /[lr]/ig, {
4684 l: 'r',
4685 r: 'l'
4686 });
4687 // 偏移量也反下
4688 var newOffset = flipOffset(offset, 0);
4689 var newTargetOffset = flipOffset(targetOffset, 0);
4690 var newElFuturePos = (0, _getElFuturePos2['default'])(elRegion, tgtRegion, newPoints, newOffset, newTargetOffset);
4691
4692 if (!isCompleteFailX(newElFuturePos, elRegion, visibleRect)) {
4693 fail = 1;
4694 points = newPoints;
4695 offset = newOffset;
4696 targetOffset = newTargetOffset;
4697 }
4698 }
4699 }
4700
4701 if (overflow.adjustY) {
4702 // 如果纵向不能放下
4703 if (isFailY(elFuturePos, elRegion, visibleRect)) {
4704 // 对齐位置反下
4705 var _newPoints = flip(points, /[tb]/ig, {
4706 t: 'b',
4707 b: 't'
4708 });
4709 // 偏移量也反下
4710 var _newOffset = flipOffset(offset, 1);
4711 var _newTargetOffset = flipOffset(targetOffset, 1);
4712 var _newElFuturePos = (0, _getElFuturePos2['default'])(elRegion, tgtRegion, _newPoints, _newOffset, _newTargetOffset);
4713
4714 if (!isCompleteFailY(_newElFuturePos, elRegion, visibleRect)) {
4715 fail = 1;
4716 points = _newPoints;
4717 offset = _newOffset;
4718 targetOffset = _newTargetOffset;
4719 }
4720 }
4721 }
4722
4723 // 如果失败,重新计算当前节点将要被放置的位置
4724 if (fail) {
4725 elFuturePos = (0, _getElFuturePos2['default'])(elRegion, tgtRegion, points, offset, targetOffset);
4726 _utils2['default'].mix(newElRegion, elFuturePos);
4727 }
4728 var isStillFailX = isFailX(elFuturePos, elRegion, visibleRect);
4729 var isStillFailY = isFailY(elFuturePos, elRegion, visibleRect);
4730 // 检查反下后的位置是否可以放下了,如果仍然放不下:
4731 // 1. 复原修改过的定位参数
4732 if (isStillFailX || isStillFailY) {
4733 points = align.points;
4734 offset = align.offset || [0, 0];
4735 targetOffset = align.targetOffset || [0, 0];
4736 }
4737 // 2. 只有指定了可以调整当前方向才调整
4738 newOverflowCfg.adjustX = overflow.adjustX && isStillFailX;
4739 newOverflowCfg.adjustY = overflow.adjustY && isStillFailY;
4740
4741 // 确实要调整,甚至可能会调整高度宽度
4742 if (newOverflowCfg.adjustX || newOverflowCfg.adjustY) {
4743 newElRegion = (0, _adjustForViewport2['default'])(elFuturePos, elRegion, visibleRect, newOverflowCfg);
4744 }
4745 }
4746
4747 // need judge to in case set fixed with in css on height auto element
4748 if (newElRegion.width !== elRegion.width) {
4749 _utils2['default'].css(source, 'width', _utils2['default'].width(source) + newElRegion.width - elRegion.width);
4750 }
4751
4752 if (newElRegion.height !== elRegion.height) {
4753 _utils2['default'].css(source, 'height', _utils2['default'].height(source) + newElRegion.height - elRegion.height);
4754 }
4755
4756 // https://github.com/kissyteam/kissy/issues/190
4757 // 相对于屏幕位置没变,而 left/top 变了
4758 // 例如 <div 'relative'><el absolute></div>
4759 _utils2['default'].offset(source, {
4760 left: newElRegion.left,
4761 top: newElRegion.top
4762 }, {
4763 useCssRight: align.useCssRight,
4764 useCssBottom: align.useCssBottom,
4765 useCssTransform: align.useCssTransform,
4766 ignoreShake: align.ignoreShake
4767 });
4768
4769 return {
4770 points: points,
4771 offset: offset,
4772 targetOffset: targetOffset,
4773 overflow: newOverflowCfg
4774 };
4775 }
4776
4777 exports['default'] = doAlign;
4778 /**
4779 * 2012-04-26 yiminghe@gmail.com
4780 * - 优化智能对齐算法
4781 * - 慎用 resizeXX
4782 *
4783 * 2011-07-13 yiminghe@gmail.com note:
4784 * - 增加智能对齐,以及大小调整选项
4785 **/
4786
4787 module.exports = exports['default'];
4788
4789/***/ }),
4790/* 54 */
4791/***/ (function(module, exports, __webpack_require__) {
4792
4793 'use strict';
4794
4795 Object.defineProperty(exports, "__esModule", {
4796 value: true
4797 });
4798
4799 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
4800
4801 var _propertyUtils = __webpack_require__(55);
4802
4803 var RE_NUM = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source;
4804
4805 var getComputedStyleX = void 0;
4806
4807 // https://stackoverflow.com/a/3485654/3040605
4808 function forceRelayout(elem) {
4809 var originalStyle = elem.style.display;
4810 elem.style.display = 'none';
4811 elem.offsetHeight; // eslint-disable-line
4812 elem.style.display = originalStyle;
4813 }
4814
4815 function css(el, name, v) {
4816 var value = v;
4817 if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {
4818 for (var i in name) {
4819 if (name.hasOwnProperty(i)) {
4820 css(el, i, name[i]);
4821 }
4822 }
4823 return undefined;
4824 }
4825 if (typeof value !== 'undefined') {
4826 if (typeof value === 'number') {
4827 value = value + 'px';
4828 }
4829 el.style[name] = value;
4830 return undefined;
4831 }
4832 return getComputedStyleX(el, name);
4833 }
4834
4835 function getClientPosition(elem) {
4836 var box = void 0;
4837 var x = void 0;
4838 var y = void 0;
4839 var doc = elem.ownerDocument;
4840 var body = doc.body;
4841 var docElem = doc && doc.documentElement;
4842 // 根据 GBS 最新数据,A-Grade Browsers 都已支持 getBoundingClientRect 方法,不用再考虑传统的实现方式
4843 box = elem.getBoundingClientRect();
4844
4845 // 注:jQuery 还考虑减去 docElem.clientLeft/clientTop
4846 // 但测试发现,这样反而会导致当 html 和 body 有边距/边框样式时,获取的值不正确
4847 // 此外,ie6 会忽略 html 的 margin 值,幸运地是没有谁会去设置 html 的 margin
4848
4849 x = box.left;
4850 y = box.top;
4851
4852 // In IE, most of the time, 2 extra pixels are added to the top and left
4853 // due to the implicit 2-pixel inset border. In IE6/7 quirks mode and
4854 // IE6 standards mode, this border can be overridden by setting the
4855 // document element's border to zero -- thus, we cannot rely on the
4856 // offset always being 2 pixels.
4857
4858 // In quirks mode, the offset can be determined by querying the body's
4859 // clientLeft/clientTop, but in standards mode, it is found by querying
4860 // the document element's clientLeft/clientTop. Since we already called
4861 // getClientBoundingRect we have already forced a reflow, so it is not
4862 // too expensive just to query them all.
4863
4864 // ie 下应该减去窗口的边框吧,毕竟默认 absolute 都是相对窗口定位的
4865 // 窗口边框标准是设 documentElement ,quirks 时设置 body
4866 // 最好禁止在 body 和 html 上边框 ,但 ie < 9 html 默认有 2px ,减去
4867 // 但是非 ie 不可能设置窗口边框,body html 也不是窗口 ,ie 可以通过 html,body 设置
4868 // 标准 ie 下 docElem.clientTop 就是 border-top
4869 // ie7 html 即窗口边框改变不了。永远为 2
4870 // 但标准 firefox/chrome/ie9 下 docElem.clientTop 是窗口边框,即使设了 border-top 也为 0
4871
4872 x -= docElem.clientLeft || body.clientLeft || 0;
4873 y -= docElem.clientTop || body.clientTop || 0;
4874
4875 return {
4876 left: x,
4877 top: y
4878 };
4879 }
4880
4881 function getScroll(w, top) {
4882 var ret = w['page' + (top ? 'Y' : 'X') + 'Offset'];
4883 var method = 'scroll' + (top ? 'Top' : 'Left');
4884 if (typeof ret !== 'number') {
4885 var d = w.document;
4886 // ie6,7,8 standard mode
4887 ret = d.documentElement[method];
4888 if (typeof ret !== 'number') {
4889 // quirks mode
4890 ret = d.body[method];
4891 }
4892 }
4893 return ret;
4894 }
4895
4896 function getScrollLeft(w) {
4897 return getScroll(w);
4898 }
4899
4900 function getScrollTop(w) {
4901 return getScroll(w, true);
4902 }
4903
4904 function getOffset(el) {
4905 var pos = getClientPosition(el);
4906 var doc = el.ownerDocument;
4907 var w = doc.defaultView || doc.parentWindow;
4908 pos.left += getScrollLeft(w);
4909 pos.top += getScrollTop(w);
4910 return pos;
4911 }
4912
4913 /**
4914 * A crude way of determining if an object is a window
4915 * @member util
4916 */
4917 function isWindow(obj) {
4918 // must use == for ie8
4919 /* eslint eqeqeq:0 */
4920 return obj !== null && obj !== undefined && obj == obj.window;
4921 }
4922
4923 function getDocument(node) {
4924 if (isWindow(node)) {
4925 return node.document;
4926 }
4927 if (node.nodeType === 9) {
4928 return node;
4929 }
4930 return node.ownerDocument;
4931 }
4932
4933 function _getComputedStyle(elem, name, cs) {
4934 var computedStyle = cs;
4935 var val = '';
4936 var d = getDocument(elem);
4937 computedStyle = computedStyle || d.defaultView.getComputedStyle(elem, null);
4938
4939 // https://github.com/kissyteam/kissy/issues/61
4940 if (computedStyle) {
4941 val = computedStyle.getPropertyValue(name) || computedStyle[name];
4942 }
4943
4944 return val;
4945 }
4946
4947 var _RE_NUM_NO_PX = new RegExp('^(' + RE_NUM + ')(?!px)[a-z%]+$', 'i');
4948 var RE_POS = /^(top|right|bottom|left)$/;
4949 var CURRENT_STYLE = 'currentStyle';
4950 var RUNTIME_STYLE = 'runtimeStyle';
4951 var LEFT = 'left';
4952 var PX = 'px';
4953
4954 function _getComputedStyleIE(elem, name) {
4955 // currentStyle maybe null
4956 // http://msdn.microsoft.com/en-us/library/ms535231.aspx
4957 var ret = elem[CURRENT_STYLE] && elem[CURRENT_STYLE][name];
4958
4959 // 当 width/height 设置为百分比时,通过 pixelLeft 方式转换的 width/height 值
4960 // 一开始就处理了! CUSTOM_STYLE.height,CUSTOM_STYLE.width ,cssHook 解决@2011-08-19
4961 // 在 ie 下不对,需要直接用 offset 方式
4962 // borderWidth 等值也有问题,但考虑到 borderWidth 设为百分比的概率很小,这里就不考虑了
4963
4964 // From the awesome hack by Dean Edwards
4965 // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
4966 // If we're not dealing with a regular pixel number
4967 // but a number that has a weird ending, we need to convert it to pixels
4968 // exclude left right for relativity
4969 if (_RE_NUM_NO_PX.test(ret) && !RE_POS.test(name)) {
4970 // Remember the original values
4971 var style = elem.style;
4972 var left = style[LEFT];
4973 var rsLeft = elem[RUNTIME_STYLE][LEFT];
4974
4975 // prevent flashing of content
4976 elem[RUNTIME_STYLE][LEFT] = elem[CURRENT_STYLE][LEFT];
4977
4978 // Put in the new values to get a computed value out
4979 style[LEFT] = name === 'fontSize' ? '1em' : ret || 0;
4980 ret = style.pixelLeft + PX;
4981
4982 // Revert the changed values
4983 style[LEFT] = left;
4984
4985 elem[RUNTIME_STYLE][LEFT] = rsLeft;
4986 }
4987 return ret === '' ? 'auto' : ret;
4988 }
4989
4990 if (typeof window !== 'undefined') {
4991 getComputedStyleX = window.getComputedStyle ? _getComputedStyle : _getComputedStyleIE;
4992 }
4993
4994 function getOffsetDirection(dir, option) {
4995 if (dir === 'left') {
4996 return option.useCssRight ? 'right' : dir;
4997 }
4998 return option.useCssBottom ? 'bottom' : dir;
4999 }
5000
5001 function oppositeOffsetDirection(dir) {
5002 if (dir === 'left') {
5003 return 'right';
5004 } else if (dir === 'right') {
5005 return 'left';
5006 } else if (dir === 'top') {
5007 return 'bottom';
5008 } else if (dir === 'bottom') {
5009 return 'top';
5010 }
5011 }
5012
5013 // 设置 elem 相对 elem.ownerDocument 的坐标
5014 function setLeftTop(elem, offset, option) {
5015 // set position first, in-case top/left are set even on static elem
5016 if (css(elem, 'position') === 'static') {
5017 elem.style.position = 'relative';
5018 }
5019 var presetH = -999;
5020 var presetV = -999;
5021 var horizontalProperty = getOffsetDirection('left', option);
5022 var verticalProperty = getOffsetDirection('top', option);
5023 var oppositeHorizontalProperty = oppositeOffsetDirection(horizontalProperty);
5024 var oppositeVerticalProperty = oppositeOffsetDirection(verticalProperty);
5025
5026 if (horizontalProperty !== 'left') {
5027 presetH = 999;
5028 }
5029
5030 if (verticalProperty !== 'top') {
5031 presetV = 999;
5032 }
5033 var originalTransition = '';
5034 var originalOffset = getOffset(elem);
5035 if ('left' in offset || 'top' in offset) {
5036 originalTransition = (0, _propertyUtils.getTransitionProperty)(elem) || '';
5037 (0, _propertyUtils.setTransitionProperty)(elem, 'none');
5038 }
5039 if ('left' in offset) {
5040 elem.style[oppositeHorizontalProperty] = '';
5041 elem.style[horizontalProperty] = presetH + 'px';
5042 }
5043 if ('top' in offset) {
5044 elem.style[oppositeVerticalProperty] = '';
5045 elem.style[verticalProperty] = presetV + 'px';
5046 }
5047 // force relayout
5048 forceRelayout(elem);
5049 var old = getOffset(elem);
5050 var originalStyle = {};
5051 for (var key in offset) {
5052 if (offset.hasOwnProperty(key)) {
5053 var dir = getOffsetDirection(key, option);
5054 var preset = key === 'left' ? presetH : presetV;
5055 var off = originalOffset[key] - old[key];
5056 if (dir === key) {
5057 originalStyle[dir] = preset + off;
5058 } else {
5059 originalStyle[dir] = preset - off;
5060 }
5061 }
5062 }
5063 css(elem, originalStyle);
5064 // force relayout
5065 forceRelayout(elem);
5066 if ('left' in offset || 'top' in offset) {
5067 (0, _propertyUtils.setTransitionProperty)(elem, originalTransition);
5068 }
5069 var ret = {};
5070 for (var _key in offset) {
5071 if (offset.hasOwnProperty(_key)) {
5072 var _dir = getOffsetDirection(_key, option);
5073 var _off = offset[_key] - originalOffset[_key];
5074 if (_key === _dir) {
5075 ret[_dir] = originalStyle[_dir] + _off;
5076 } else {
5077 ret[_dir] = originalStyle[_dir] - _off;
5078 }
5079 }
5080 }
5081 css(elem, ret);
5082 }
5083
5084 function setTransform(elem, offset) {
5085 var originalOffset = getOffset(elem);
5086 var originalXY = (0, _propertyUtils.getTransformXY)(elem);
5087 var resultXY = { x: originalXY.x, y: originalXY.y };
5088 if ('left' in offset) {
5089 resultXY.x = originalXY.x + offset.left - originalOffset.left;
5090 }
5091 if ('top' in offset) {
5092 resultXY.y = originalXY.y + offset.top - originalOffset.top;
5093 }
5094 (0, _propertyUtils.setTransformXY)(elem, resultXY);
5095 }
5096
5097 function setOffset(elem, offset, option) {
5098 if (option.ignoreShake) {
5099 var oriOffset = getOffset(elem);
5100
5101 var oLeft = oriOffset.left.toFixed(0);
5102 var oTop = oriOffset.top.toFixed(0);
5103 var tLeft = offset.left.toFixed(0);
5104 var tTop = offset.top.toFixed(0);
5105
5106 if (oLeft === tLeft && oTop === tTop) {
5107 return;
5108 }
5109 }
5110
5111 if (option.useCssRight || option.useCssBottom) {
5112 setLeftTop(elem, offset, option);
5113 } else if (option.useCssTransform && (0, _propertyUtils.getTransformName)() in document.body.style) {
5114 setTransform(elem, offset, option);
5115 } else {
5116 setLeftTop(elem, offset, option);
5117 }
5118 }
5119
5120 function each(arr, fn) {
5121 for (var i = 0; i < arr.length; i++) {
5122 fn(arr[i]);
5123 }
5124 }
5125
5126 function isBorderBoxFn(elem) {
5127 return getComputedStyleX(elem, 'boxSizing') === 'border-box';
5128 }
5129
5130 var BOX_MODELS = ['margin', 'border', 'padding'];
5131 var CONTENT_INDEX = -1;
5132 var PADDING_INDEX = 2;
5133 var BORDER_INDEX = 1;
5134 var MARGIN_INDEX = 0;
5135
5136 function swap(elem, options, callback) {
5137 var old = {};
5138 var style = elem.style;
5139 var name = void 0;
5140
5141 // Remember the old values, and insert the new ones
5142 for (name in options) {
5143 if (options.hasOwnProperty(name)) {
5144 old[name] = style[name];
5145 style[name] = options[name];
5146 }
5147 }
5148
5149 callback.call(elem);
5150
5151 // Revert the old values
5152 for (name in options) {
5153 if (options.hasOwnProperty(name)) {
5154 style[name] = old[name];
5155 }
5156 }
5157 }
5158
5159 function getPBMWidth(elem, props, which) {
5160 var value = 0;
5161 var prop = void 0;
5162 var j = void 0;
5163 var i = void 0;
5164 for (j = 0; j < props.length; j++) {
5165 prop = props[j];
5166 if (prop) {
5167 for (i = 0; i < which.length; i++) {
5168 var cssProp = void 0;
5169 if (prop === 'border') {
5170 cssProp = '' + prop + which[i] + 'Width';
5171 } else {
5172 cssProp = prop + which[i];
5173 }
5174 value += parseFloat(getComputedStyleX(elem, cssProp)) || 0;
5175 }
5176 }
5177 }
5178 return value;
5179 }
5180
5181 var domUtils = {};
5182
5183 each(['Width', 'Height'], function (name) {
5184 domUtils['doc' + name] = function (refWin) {
5185 var d = refWin.document;
5186 return Math.max(
5187 // firefox chrome documentElement.scrollHeight< body.scrollHeight
5188 // ie standard mode : documentElement.scrollHeight> body.scrollHeight
5189 d.documentElement['scroll' + name],
5190 // quirks : documentElement.scrollHeight 最大等于可视窗口多一点?
5191 d.body['scroll' + name], domUtils['viewport' + name](d));
5192 };
5193
5194 domUtils['viewport' + name] = function (win) {
5195 // pc browser includes scrollbar in window.innerWidth
5196 var prop = 'client' + name;
5197 var doc = win.document;
5198 var body = doc.body;
5199 var documentElement = doc.documentElement;
5200 var documentElementProp = documentElement[prop];
5201 // 标准模式取 documentElement
5202 // backcompat 取 body
5203 return doc.compatMode === 'CSS1Compat' && documentElementProp || body && body[prop] || documentElementProp;
5204 };
5205 });
5206
5207 /*
5208 得到元素的大小信息
5209 @param elem
5210 @param name
5211 @param {String} [extra] 'padding' : (css width) + padding
5212 'border' : (css width) + padding + border
5213 'margin' : (css width) + padding + border + margin
5214 */
5215 function getWH(elem, name, ex) {
5216 var extra = ex;
5217 if (isWindow(elem)) {
5218 return name === 'width' ? domUtils.viewportWidth(elem) : domUtils.viewportHeight(elem);
5219 } else if (elem.nodeType === 9) {
5220 return name === 'width' ? domUtils.docWidth(elem) : domUtils.docHeight(elem);
5221 }
5222 var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];
5223 var borderBoxValue = name === 'width' ? elem.getBoundingClientRect().width : elem.getBoundingClientRect().height;
5224 var computedStyle = getComputedStyleX(elem);
5225 var isBorderBox = isBorderBoxFn(elem, computedStyle);
5226 var cssBoxValue = 0;
5227 if (borderBoxValue === null || borderBoxValue === undefined || borderBoxValue <= 0) {
5228 borderBoxValue = undefined;
5229 // Fall back to computed then un computed css if necessary
5230 cssBoxValue = getComputedStyleX(elem, name);
5231 if (cssBoxValue === null || cssBoxValue === undefined || Number(cssBoxValue) < 0) {
5232 cssBoxValue = elem.style[name] || 0;
5233 }
5234 // Normalize '', auto, and prepare for extra
5235 cssBoxValue = parseFloat(cssBoxValue) || 0;
5236 }
5237 if (extra === undefined) {
5238 extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX;
5239 }
5240 var borderBoxValueOrIsBorderBox = borderBoxValue !== undefined || isBorderBox;
5241 var val = borderBoxValue || cssBoxValue;
5242 if (extra === CONTENT_INDEX) {
5243 if (borderBoxValueOrIsBorderBox) {
5244 return val - getPBMWidth(elem, ['border', 'padding'], which, computedStyle);
5245 }
5246 return cssBoxValue;
5247 } else if (borderBoxValueOrIsBorderBox) {
5248 if (extra === BORDER_INDEX) {
5249 return val;
5250 }
5251 return val + (extra === PADDING_INDEX ? -getPBMWidth(elem, ['border'], which, computedStyle) : getPBMWidth(elem, ['margin'], which, computedStyle));
5252 }
5253 return cssBoxValue + getPBMWidth(elem, BOX_MODELS.slice(extra), which, computedStyle);
5254 }
5255
5256 var cssShow = {
5257 position: 'absolute',
5258 visibility: 'hidden',
5259 display: 'block'
5260 };
5261
5262 // fix #119 : https://github.com/kissyteam/kissy/issues/119
5263 function getWHIgnoreDisplay() {
5264 for (var _len = arguments.length, args = Array(_len), _key2 = 0; _key2 < _len; _key2++) {
5265 args[_key2] = arguments[_key2];
5266 }
5267
5268 var val = void 0;
5269 var elem = args[0];
5270 // in case elem is window
5271 // elem.offsetWidth === undefined
5272 if (elem.offsetWidth !== 0) {
5273 val = getWH.apply(undefined, args);
5274 } else {
5275 swap(elem, cssShow, function () {
5276 val = getWH.apply(undefined, args);
5277 });
5278 }
5279 return val;
5280 }
5281
5282 each(['width', 'height'], function (name) {
5283 var first = name.charAt(0).toUpperCase() + name.slice(1);
5284 domUtils['outer' + first] = function (el, includeMargin) {
5285 return el && getWHIgnoreDisplay(el, name, includeMargin ? MARGIN_INDEX : BORDER_INDEX);
5286 };
5287 var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];
5288
5289 domUtils[name] = function (elem, v) {
5290 var val = v;
5291 if (val !== undefined) {
5292 if (elem) {
5293 var computedStyle = getComputedStyleX(elem);
5294 var isBorderBox = isBorderBoxFn(elem);
5295 if (isBorderBox) {
5296 val += getPBMWidth(elem, ['padding', 'border'], which, computedStyle);
5297 }
5298 return css(elem, name, val);
5299 }
5300 return undefined;
5301 }
5302 return elem && getWHIgnoreDisplay(elem, name, CONTENT_INDEX);
5303 };
5304 });
5305
5306 function mix(to, from) {
5307 for (var i in from) {
5308 if (from.hasOwnProperty(i)) {
5309 to[i] = from[i];
5310 }
5311 }
5312 return to;
5313 }
5314
5315 var utils = {
5316 getWindow: function getWindow(node) {
5317 if (node && node.document && node.setTimeout) {
5318 return node;
5319 }
5320 var doc = node.ownerDocument || node;
5321 return doc.defaultView || doc.parentWindow;
5322 },
5323
5324 getDocument: getDocument,
5325 offset: function offset(el, value, option) {
5326 if (typeof value !== 'undefined') {
5327 setOffset(el, value, option || {});
5328 } else {
5329 return getOffset(el);
5330 }
5331 },
5332
5333 isWindow: isWindow,
5334 each: each,
5335 css: css,
5336 clone: function clone(obj) {
5337 var i = void 0;
5338 var ret = {};
5339 for (i in obj) {
5340 if (obj.hasOwnProperty(i)) {
5341 ret[i] = obj[i];
5342 }
5343 }
5344 var overflow = obj.overflow;
5345 if (overflow) {
5346 for (i in obj) {
5347 if (obj.hasOwnProperty(i)) {
5348 ret.overflow[i] = obj.overflow[i];
5349 }
5350 }
5351 }
5352 return ret;
5353 },
5354
5355 mix: mix,
5356 getWindowScrollLeft: function getWindowScrollLeft(w) {
5357 return getScrollLeft(w);
5358 },
5359 getWindowScrollTop: function getWindowScrollTop(w) {
5360 return getScrollTop(w);
5361 },
5362 merge: function merge() {
5363 var ret = {};
5364
5365 for (var _len2 = arguments.length, args = Array(_len2), _key3 = 0; _key3 < _len2; _key3++) {
5366 args[_key3] = arguments[_key3];
5367 }
5368
5369 for (var i = 0; i < args.length; i++) {
5370 utils.mix(ret, args[i]);
5371 }
5372 return ret;
5373 },
5374
5375 viewportWidth: 0,
5376 viewportHeight: 0
5377 };
5378
5379 mix(utils, domUtils);
5380
5381 exports['default'] = utils;
5382 module.exports = exports['default'];
5383
5384/***/ }),
5385/* 55 */
5386/***/ (function(module, exports) {
5387
5388 'use strict';
5389
5390 Object.defineProperty(exports, "__esModule", {
5391 value: true
5392 });
5393 exports.getTransformName = getTransformName;
5394 exports.setTransitionProperty = setTransitionProperty;
5395 exports.getTransitionProperty = getTransitionProperty;
5396 exports.getTransformXY = getTransformXY;
5397 exports.setTransformXY = setTransformXY;
5398 var vendorPrefix = void 0;
5399
5400 var jsCssMap = {
5401 Webkit: '-webkit-',
5402 Moz: '-moz-',
5403 // IE did it wrong again ...
5404 ms: '-ms-',
5405 O: '-o-'
5406 };
5407
5408 function getVendorPrefix() {
5409 if (vendorPrefix !== undefined) {
5410 return vendorPrefix;
5411 }
5412 vendorPrefix = '';
5413 var style = document.createElement('p').style;
5414 var testProp = 'Transform';
5415 for (var key in jsCssMap) {
5416 if (key + testProp in style) {
5417 vendorPrefix = key;
5418 }
5419 }
5420 return vendorPrefix;
5421 }
5422
5423 function getTransitionName() {
5424 return getVendorPrefix() ? getVendorPrefix() + 'TransitionProperty' : 'transitionProperty';
5425 }
5426
5427 function getTransformName() {
5428 return getVendorPrefix() ? getVendorPrefix() + 'Transform' : 'transform';
5429 }
5430
5431 function setTransitionProperty(node, value) {
5432 var name = getTransitionName();
5433 if (name) {
5434 node.style[name] = value;
5435 if (name !== 'transitionProperty') {
5436 node.style.transitionProperty = value;
5437 }
5438 }
5439 }
5440
5441 function setTransform(node, value) {
5442 var name = getTransformName();
5443 if (name) {
5444 node.style[name] = value;
5445 if (name !== 'transform') {
5446 node.style.transform = value;
5447 }
5448 }
5449 }
5450
5451 function getTransitionProperty(node) {
5452 return node.style.transitionProperty || node.style[getTransitionName()];
5453 }
5454
5455 function getTransformXY(node) {
5456 var style = window.getComputedStyle(node, null);
5457 var transform = style.getPropertyValue('transform') || style.getPropertyValue(getTransformName());
5458 if (transform && transform !== 'none') {
5459 var matrix = transform.replace(/[^0-9\-.,]/g, '').split(',');
5460 return { x: parseFloat(matrix[12] || matrix[4], 0), y: parseFloat(matrix[13] || matrix[5], 0) };
5461 }
5462 return {
5463 x: 0,
5464 y: 0
5465 };
5466 }
5467
5468 var matrix2d = /matrix\((.*)\)/;
5469 var matrix3d = /matrix3d\((.*)\)/;
5470
5471 function setTransformXY(node, xy) {
5472 var style = window.getComputedStyle(node, null);
5473 var transform = style.getPropertyValue('transform') || style.getPropertyValue(getTransformName());
5474 if (transform && transform !== 'none') {
5475 var arr = void 0;
5476 var match2d = transform.match(matrix2d);
5477 if (match2d) {
5478 match2d = match2d[1];
5479 arr = match2d.split(',').map(function (item) {
5480 return parseFloat(item, 10);
5481 });
5482 arr[4] = xy.x;
5483 arr[5] = xy.y;
5484 setTransform(node, 'matrix(' + arr.join(',') + ')');
5485 } else {
5486 var match3d = transform.match(matrix3d)[1];
5487 arr = match3d.split(',').map(function (item) {
5488 return parseFloat(item, 10);
5489 });
5490 arr[12] = xy.x;
5491 arr[13] = xy.y;
5492 setTransform(node, 'matrix3d(' + arr.join(',') + ')');
5493 }
5494 } else {
5495 setTransform(node, 'translateX(' + xy.x + 'px) translateY(' + xy.y + 'px) translateZ(0)');
5496 }
5497 }
5498
5499/***/ }),
5500/* 56 */
5501/***/ (function(module, exports, __webpack_require__) {
5502
5503 'use strict';
5504
5505 Object.defineProperty(exports, "__esModule", {
5506 value: true
5507 });
5508
5509 var _utils = __webpack_require__(54);
5510
5511 var _utils2 = _interopRequireDefault(_utils);
5512
5513 var _getOffsetParent = __webpack_require__(57);
5514
5515 var _getOffsetParent2 = _interopRequireDefault(_getOffsetParent);
5516
5517 var _isAncestorFixed = __webpack_require__(58);
5518
5519 var _isAncestorFixed2 = _interopRequireDefault(_isAncestorFixed);
5520
5521 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
5522
5523 /**
5524 * 获得元素的显示部分的区域
5525 */
5526 function getVisibleRectForElement(element) {
5527 var visibleRect = {
5528 left: 0,
5529 right: Infinity,
5530 top: 0,
5531 bottom: Infinity
5532 };
5533 var el = (0, _getOffsetParent2['default'])(element);
5534 var doc = _utils2['default'].getDocument(element);
5535 var win = doc.defaultView || doc.parentWindow;
5536 var body = doc.body;
5537 var documentElement = doc.documentElement;
5538
5539 // Determine the size of the visible rect by climbing the dom accounting for
5540 // all scrollable containers.
5541 while (el) {
5542 // clientWidth is zero for inline block elements in ie.
5543 if ((navigator.userAgent.indexOf('MSIE') === -1 || el.clientWidth !== 0) &&
5544 // body may have overflow set on it, yet we still get the entire
5545 // viewport. In some browsers, el.offsetParent may be
5546 // document.documentElement, so check for that too.
5547 el !== body && el !== documentElement && _utils2['default'].css(el, 'overflow') !== 'visible') {
5548 var pos = _utils2['default'].offset(el);
5549 // add border
5550 pos.left += el.clientLeft;
5551 pos.top += el.clientTop;
5552 visibleRect.top = Math.max(visibleRect.top, pos.top);
5553 visibleRect.right = Math.min(visibleRect.right,
5554 // consider area without scrollBar
5555 pos.left + el.clientWidth);
5556 visibleRect.bottom = Math.min(visibleRect.bottom, pos.top + el.clientHeight);
5557 visibleRect.left = Math.max(visibleRect.left, pos.left);
5558 } else if (el === body || el === documentElement) {
5559 break;
5560 }
5561 el = (0, _getOffsetParent2['default'])(el);
5562 }
5563
5564 // Set element position to fixed
5565 // make sure absolute element itself don't affect it's visible area
5566 // https://github.com/ant-design/ant-design/issues/7601
5567 var originalPosition = null;
5568 if (!_utils2['default'].isWindow(element) && element.nodeType !== 9) {
5569 originalPosition = element.style.position;
5570 var position = _utils2['default'].css(element, 'position');
5571 if (position === 'absolute') {
5572 element.style.position = 'fixed';
5573 }
5574 }
5575
5576 var scrollX = _utils2['default'].getWindowScrollLeft(win);
5577 var scrollY = _utils2['default'].getWindowScrollTop(win);
5578 var viewportWidth = _utils2['default'].viewportWidth(win);
5579 var viewportHeight = _utils2['default'].viewportHeight(win);
5580 var documentWidth = documentElement.scrollWidth;
5581 var documentHeight = documentElement.scrollHeight;
5582
5583 // scrollXXX on html is sync with body which means overflow: hidden on body gets wrong scrollXXX.
5584 // We should cut this ourself.
5585 var bodyStyle = window.getComputedStyle(body);
5586 if (bodyStyle.overflowX === 'hidden') {
5587 documentWidth = win.innerWidth;
5588 }
5589 if (bodyStyle.overflowY === 'hidden') {
5590 documentHeight = win.innerHeight;
5591 }
5592
5593 // Reset element position after calculate the visible area
5594 if (element.style) {
5595 element.style.position = originalPosition;
5596 }
5597
5598 if ((0, _isAncestorFixed2['default'])(element)) {
5599 // Clip by viewport's size.
5600 visibleRect.left = Math.max(visibleRect.left, scrollX);
5601 visibleRect.top = Math.max(visibleRect.top, scrollY);
5602 visibleRect.right = Math.min(visibleRect.right, scrollX + viewportWidth);
5603 visibleRect.bottom = Math.min(visibleRect.bottom, scrollY + viewportHeight);
5604 } else {
5605 // Clip by document's size.
5606 var maxVisibleWidth = Math.max(documentWidth, scrollX + viewportWidth);
5607 visibleRect.right = Math.min(visibleRect.right, maxVisibleWidth);
5608
5609 var maxVisibleHeight = Math.max(documentHeight, scrollY + viewportHeight);
5610 visibleRect.bottom = Math.min(visibleRect.bottom, maxVisibleHeight);
5611 }
5612
5613 return visibleRect.top >= 0 && visibleRect.left >= 0 && visibleRect.bottom > visibleRect.top && visibleRect.right > visibleRect.left ? visibleRect : null;
5614 }
5615
5616 exports['default'] = getVisibleRectForElement;
5617 module.exports = exports['default'];
5618
5619/***/ }),
5620/* 57 */
5621/***/ (function(module, exports, __webpack_require__) {
5622
5623 'use strict';
5624
5625 Object.defineProperty(exports, "__esModule", {
5626 value: true
5627 });
5628
5629 var _utils = __webpack_require__(54);
5630
5631 var _utils2 = _interopRequireDefault(_utils);
5632
5633 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
5634
5635 /**
5636 * 得到会导致元素显示不全的祖先元素
5637 */
5638
5639 function getOffsetParent(element) {
5640 if (_utils2['default'].isWindow(element) || element.nodeType === 9) {
5641 return null;
5642 }
5643 // ie 这个也不是完全可行
5644 /*
5645 <div style="width: 50px;height: 100px;overflow: hidden">
5646 <div style="width: 50px;height: 100px;position: relative;" id="d6">
5647 元素 6 高 100px 宽 50px<br/>
5648 </div>
5649 </div>
5650 */
5651 // element.offsetParent does the right thing in ie7 and below. Return parent with layout!
5652 // In other browsers it only includes elements with position absolute, relative or
5653 // fixed, not elements with overflow set to auto or scroll.
5654 // if (UA.ie && ieMode < 8) {
5655 // return element.offsetParent;
5656 // }
5657 // 统一的 offsetParent 方法
5658 var doc = _utils2['default'].getDocument(element);
5659 var body = doc.body;
5660 var parent = void 0;
5661 var positionStyle = _utils2['default'].css(element, 'position');
5662 var skipStatic = positionStyle === 'fixed' || positionStyle === 'absolute';
5663
5664 if (!skipStatic) {
5665 return element.nodeName.toLowerCase() === 'html' ? null : element.parentNode;
5666 }
5667
5668 for (parent = element.parentNode; parent && parent !== body; parent = parent.parentNode) {
5669 positionStyle = _utils2['default'].css(parent, 'position');
5670 if (positionStyle !== 'static') {
5671 return parent;
5672 }
5673 }
5674 return null;
5675 }
5676
5677 exports['default'] = getOffsetParent;
5678 module.exports = exports['default'];
5679
5680/***/ }),
5681/* 58 */
5682/***/ (function(module, exports, __webpack_require__) {
5683
5684 'use strict';
5685
5686 Object.defineProperty(exports, "__esModule", {
5687 value: true
5688 });
5689 exports['default'] = isAncestorFixed;
5690
5691 var _utils = __webpack_require__(54);
5692
5693 var _utils2 = _interopRequireDefault(_utils);
5694
5695 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
5696
5697 function isAncestorFixed(element) {
5698 if (_utils2['default'].isWindow(element) || element.nodeType === 9) {
5699 return false;
5700 }
5701
5702 var doc = _utils2['default'].getDocument(element);
5703 var body = doc.body;
5704 var parent = null;
5705 for (parent = element.parentNode; parent && parent !== body; parent = parent.parentNode) {
5706 var positionStyle = _utils2['default'].css(parent, 'position');
5707 if (positionStyle === 'fixed') {
5708 return true;
5709 }
5710 }
5711 return false;
5712 }
5713 module.exports = exports['default'];
5714
5715/***/ }),
5716/* 59 */
5717/***/ (function(module, exports, __webpack_require__) {
5718
5719 'use strict';
5720
5721 Object.defineProperty(exports, "__esModule", {
5722 value: true
5723 });
5724
5725 var _utils = __webpack_require__(54);
5726
5727 var _utils2 = _interopRequireDefault(_utils);
5728
5729 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
5730
5731 function adjustForViewport(elFuturePos, elRegion, visibleRect, overflow) {
5732 var pos = _utils2['default'].clone(elFuturePos);
5733 var size = {
5734 width: elRegion.width,
5735 height: elRegion.height
5736 };
5737
5738 if (overflow.adjustX && pos.left < visibleRect.left) {
5739 pos.left = visibleRect.left;
5740 }
5741
5742 // Left edge inside and right edge outside viewport, try to resize it.
5743 if (overflow.resizeWidth && pos.left >= visibleRect.left && pos.left + size.width > visibleRect.right) {
5744 size.width -= pos.left + size.width - visibleRect.right;
5745 }
5746
5747 // Right edge outside viewport, try to move it.
5748 if (overflow.adjustX && pos.left + size.width > visibleRect.right) {
5749 // 保证左边界和可视区域左边界对齐
5750 pos.left = Math.max(visibleRect.right - size.width, visibleRect.left);
5751 }
5752
5753 // Top edge outside viewport, try to move it.
5754 if (overflow.adjustY && pos.top < visibleRect.top) {
5755 pos.top = visibleRect.top;
5756 }
5757
5758 // Top edge inside and bottom edge outside viewport, try to resize it.
5759 if (overflow.resizeHeight && pos.top >= visibleRect.top && pos.top + size.height > visibleRect.bottom) {
5760 size.height -= pos.top + size.height - visibleRect.bottom;
5761 }
5762
5763 // Bottom edge outside viewport, try to move it.
5764 if (overflow.adjustY && pos.top + size.height > visibleRect.bottom) {
5765 // 保证上边界和可视区域上边界对齐
5766 pos.top = Math.max(visibleRect.bottom - size.height, visibleRect.top);
5767 }
5768
5769 return _utils2['default'].mix(pos, size);
5770 }
5771
5772 exports['default'] = adjustForViewport;
5773 module.exports = exports['default'];
5774
5775/***/ }),
5776/* 60 */
5777/***/ (function(module, exports, __webpack_require__) {
5778
5779 'use strict';
5780
5781 Object.defineProperty(exports, "__esModule", {
5782 value: true
5783 });
5784
5785 var _utils = __webpack_require__(54);
5786
5787 var _utils2 = _interopRequireDefault(_utils);
5788
5789 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
5790
5791 function getRegion(node) {
5792 var offset = void 0;
5793 var w = void 0;
5794 var h = void 0;
5795 if (!_utils2['default'].isWindow(node) && node.nodeType !== 9) {
5796 offset = _utils2['default'].offset(node);
5797 w = _utils2['default'].outerWidth(node);
5798 h = _utils2['default'].outerHeight(node);
5799 } else {
5800 var win = _utils2['default'].getWindow(node);
5801 offset = {
5802 left: _utils2['default'].getWindowScrollLeft(win),
5803 top: _utils2['default'].getWindowScrollTop(win)
5804 };
5805 w = _utils2['default'].viewportWidth(win);
5806 h = _utils2['default'].viewportHeight(win);
5807 }
5808 offset.width = w;
5809 offset.height = h;
5810 return offset;
5811 }
5812
5813 exports['default'] = getRegion;
5814 module.exports = exports['default'];
5815
5816/***/ }),
5817/* 61 */
5818/***/ (function(module, exports, __webpack_require__) {
5819
5820 'use strict';
5821
5822 Object.defineProperty(exports, "__esModule", {
5823 value: true
5824 });
5825
5826 var _getAlignOffset = __webpack_require__(62);
5827
5828 var _getAlignOffset2 = _interopRequireDefault(_getAlignOffset);
5829
5830 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
5831
5832 function getElFuturePos(elRegion, refNodeRegion, points, offset, targetOffset) {
5833 var p1 = (0, _getAlignOffset2['default'])(refNodeRegion, points[1]);
5834 var p2 = (0, _getAlignOffset2['default'])(elRegion, points[0]);
5835 var diff = [p2.left - p1.left, p2.top - p1.top];
5836
5837 return {
5838 left: elRegion.left - diff[0] + offset[0] - targetOffset[0],
5839 top: elRegion.top - diff[1] + offset[1] - targetOffset[1]
5840 };
5841 }
5842
5843 exports['default'] = getElFuturePos;
5844 module.exports = exports['default'];
5845
5846/***/ }),
5847/* 62 */
5848/***/ (function(module, exports) {
5849
5850 'use strict';
5851
5852 Object.defineProperty(exports, "__esModule", {
5853 value: true
5854 });
5855 /**
5856 * 获取 node 上的 align 对齐点 相对于页面的坐标
5857 */
5858
5859 function getAlignOffset(region, align) {
5860 var V = align.charAt(0);
5861 var H = align.charAt(1);
5862 var w = region.width;
5863 var h = region.height;
5864
5865 var x = region.left;
5866 var y = region.top;
5867
5868 if (V === 'c') {
5869 y += h / 2;
5870 } else if (V === 'b') {
5871 y += h;
5872 }
5873
5874 if (H === 'c') {
5875 x += w / 2;
5876 } else if (H === 'r') {
5877 x += w;
5878 }
5879
5880 return {
5881 left: x,
5882 top: y
5883 };
5884 }
5885
5886 exports['default'] = getAlignOffset;
5887 module.exports = exports['default'];
5888
5889/***/ }),
5890/* 63 */
5891/***/ (function(module, exports, __webpack_require__) {
5892
5893 'use strict';
5894
5895 Object.defineProperty(exports, "__esModule", {
5896 value: true
5897 });
5898
5899 var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
5900
5901 var _utils = __webpack_require__(54);
5902
5903 var _utils2 = _interopRequireDefault(_utils);
5904
5905 var _align = __webpack_require__(53);
5906
5907 var _align2 = _interopRequireDefault(_align);
5908
5909 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
5910
5911 /**
5912 * `tgtPoint`: { pageX, pageY } or { clientX, clientY }.
5913 * If client position provided, will internal convert to page position.
5914 */
5915
5916 function alignPoint(el, tgtPoint, align) {
5917 var pageX = void 0;
5918 var pageY = void 0;
5919
5920 var doc = _utils2['default'].getDocument(el);
5921 var win = doc.defaultView || doc.parentWindow;
5922
5923 var scrollX = _utils2['default'].getWindowScrollLeft(win);
5924 var scrollY = _utils2['default'].getWindowScrollTop(win);
5925 var viewportWidth = _utils2['default'].viewportWidth(win);
5926 var viewportHeight = _utils2['default'].viewportHeight(win);
5927
5928 if ('pageX' in tgtPoint) {
5929 pageX = tgtPoint.pageX;
5930 } else {
5931 pageX = scrollX + tgtPoint.clientX;
5932 }
5933
5934 if ('pageY' in tgtPoint) {
5935 pageY = tgtPoint.pageY;
5936 } else {
5937 pageY = scrollY + tgtPoint.clientY;
5938 }
5939
5940 var tgtRegion = {
5941 left: pageX,
5942 top: pageY,
5943 width: 0,
5944 height: 0
5945 };
5946
5947 var pointInView = pageX >= 0 && pageX <= scrollX + viewportWidth && pageY >= 0 && pageY <= scrollY + viewportHeight;
5948
5949 // Provide default target point
5950 var points = [align.points[0], 'cc'];
5951
5952 return (0, _align2['default'])(el, tgtRegion, _extends({}, align, { points: points }), pointInView);
5953 }
5954
5955 exports['default'] = alignPoint;
5956 module.exports = exports['default'];
5957
5958/***/ }),
5959/* 64 */
5960/***/ (function(module, exports, __webpack_require__) {
5961
5962 'use strict';
5963
5964 Object.defineProperty(exports, "__esModule", {
5965 value: true
5966 });
5967
5968 var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
5969
5970 var _classnames = __webpack_require__(3);
5971
5972 var _classnames2 = _interopRequireDefault(_classnames);
5973
5974 var _react = __webpack_require__(4);
5975
5976 var _react2 = _interopRequireDefault(_react);
5977
5978 var _propTypes = __webpack_require__(5);
5979
5980 var _propTypes2 = _interopRequireDefault(_propTypes);
5981
5982 var _Transition = __webpack_require__(11);
5983
5984 var _Transition2 = _interopRequireDefault(_Transition);
5985
5986 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
5987
5988 function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
5989
5990 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
5991
5992 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
5993
5994 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
5995
5996 var propTypes = {
5997 /**
5998 * Show the component; triggers the fade in or fade out animation
5999 */
6000 "in": _propTypes2["default"].bool,
6001
6002 /**
6003 * Unmount the component (remove it from the DOM) when it is faded out
6004 */
6005 unmountOnExit: _propTypes2["default"].bool,
6006
6007 /**
6008 * Run the fade in animation when the component mounts, if it is initially
6009 * shown
6010 */
6011 transitionAppear: _propTypes2["default"].bool,
6012
6013 /**
6014 * Duration of the fade animation in milliseconds, to ensure that finishing
6015 * callbacks are fired even if the original browser transition end events are
6016 * canceled
6017 */
6018 timeout: _propTypes2["default"].number,
6019
6020 /**
6021 * Callback fired before the component fades in
6022 */
6023 onEnter: _propTypes2["default"].func,
6024 /**
6025 * Callback fired after the component starts to fade in
6026 */
6027 onEntering: _propTypes2["default"].func,
6028 /**
6029 * Callback fired after the has component faded in
6030 */
6031 onEntered: _propTypes2["default"].func,
6032 /**
6033 * Callback fired before the component fades out
6034 */
6035 onExit: _propTypes2["default"].func,
6036 /**
6037 * Callback fired after the component starts to fade out
6038 */
6039 onExiting: _propTypes2["default"].func,
6040 /**
6041 * Callback fired after the component has faded out
6042 */
6043 onExited: _propTypes2["default"].func
6044 };
6045
6046 var defaultProps = {
6047 "in": false,
6048 timeout: 300,
6049 unmountOnExit: false,
6050 transitionAppear: false
6051 };
6052
6053 var Fade = function (_React$Component) {
6054 _inherits(Fade, _React$Component);
6055
6056 function Fade() {
6057 _classCallCheck(this, Fade);
6058
6059 return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
6060 }
6061
6062 Fade.prototype.render = function render() {
6063 return _react2["default"].createElement(_Transition2["default"], _extends({}, this.props, {
6064 className: (0, _classnames2["default"])(this.props.className, 'fade'),
6065 enteredClassName: 'in',
6066 enteringClassName: 'in'
6067 }));
6068 };
6069
6070 return Fade;
6071 }(_react2["default"].Component);
6072
6073 Fade.propTypes = propTypes;
6074 Fade.defaultProps = defaultProps;
6075
6076 exports["default"] = Fade;
6077 module.exports = exports['default'];
6078
6079/***/ }),
6080/* 65 */
6081/***/ (function(module, exports, __webpack_require__) {
6082
6083 'use strict';
6084
6085 Object.defineProperty(exports, "__esModule", {
6086 value: true
6087 });
6088
6089 var _Message = __webpack_require__(66);
6090
6091 var _Message2 = _interopRequireDefault(_Message);
6092
6093 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
6094
6095 exports["default"] = _Message2["default"];
6096 module.exports = exports['default'];
6097
6098/***/ }),
6099/* 66 */
6100/***/ (function(module, exports, __webpack_require__) {
6101
6102 'use strict';
6103
6104 Object.defineProperty(exports, "__esModule", {
6105 value: true
6106 });
6107
6108 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
6109
6110 var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
6111
6112 var _react = __webpack_require__(4);
6113
6114 var _react2 = _interopRequireDefault(_react);
6115
6116 var _beeNotification = __webpack_require__(67);
6117
6118 var _beeNotification2 = _interopRequireDefault(_beeNotification);
6119
6120 var _classnames = __webpack_require__(3);
6121
6122 var _classnames2 = _interopRequireDefault(_classnames);
6123
6124 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
6125
6126 var defaultDuration = 1.5;
6127 var defaultTop = 0;
6128 var defaultBottom = 48;
6129 var bottom = 90;
6130 var padding = 30;
6131 var width = 200;
6132 var messageInstance = void 0;
6133 var key = 1;
6134 var clsPrefix = 'u-message';
6135 var noop = function noop() {};
6136
6137 var positionObj = {
6138 "top": {
6139 messageStyle: {
6140 width: "100%"
6141 },
6142 notificationStyle: {
6143 top: defaultTop,
6144 width: "100%"
6145 },
6146 transitionName: 'top'
6147 },
6148 "bottom": {
6149 messageStyle: {
6150 width: "100%"
6151 },
6152 notificationStyle: {
6153 bottom: defaultBottom,
6154 width: "100%"
6155 },
6156 transitionName: 'bottom'
6157 },
6158 "topRight": {
6159 messageStyle: {
6160 width: width
6161 },
6162 notificationStyle: {
6163 top: padding,
6164 right: padding,
6165 width: width
6166 },
6167 transitionName: 'right'
6168 },
6169 "bottomRight": {
6170 messageStyle: {
6171 width: width
6172 },
6173 notificationStyle: {
6174 bottom: bottom,
6175 right: padding,
6176 width: width
6177 },
6178 transitionName: 'right'
6179 },
6180 "topLeft": {
6181 messageStyle: {
6182 width: width
6183 },
6184 notificationStyle: {
6185 top: padding,
6186 left: padding,
6187 width: width
6188 },
6189 transitionName: 'left'
6190 },
6191 "bottomLeft": {
6192 messageStyle: {
6193 width: width
6194 },
6195 notificationStyle: {
6196 bottom: bottom,
6197 left: padding,
6198 width: width
6199 },
6200 transitionName: 'left'
6201 }
6202 };
6203
6204 function getMessageInstance() {
6205 var position = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'top';
6206 var callback = arguments[1];
6207 var keyboard = arguments[2];
6208 var onEscapeKeyUp = arguments[3];
6209
6210 if (messageInstance) {
6211 callback(messageInstance);
6212 return;
6213 }
6214 var style = positionObj[position].notificationStyle;
6215 var instanceObj = {
6216 clsPrefix: clsPrefix,
6217 transitionName: clsPrefix + '-' + positionObj[position].transitionName,
6218 style: style, // 覆盖原来的样式
6219 position: ''
6220 };
6221 if (typeof keyboard === 'boolean') {
6222 instanceObj.keyboard = keyboard;
6223 }
6224 if (typeof onEscapeKeyUp === 'function') {
6225 instanceObj.onEscapeKeyUp = onEscapeKeyUp;
6226 }
6227 _beeNotification2["default"].newInstance(instanceObj, function (instance) {
6228 messageInstance = instance;
6229 callback(instance);
6230 });
6231 }
6232
6233 function notice(content, duration, type, onClose, position, style, keyboard, onEscapeKeyUp, showIcon) {
6234 var iconType = {
6235 info: 'uf uf-i-c-2',
6236 success: 'uf uf-correct',
6237 danger: 'uf uf-close-c',
6238 warning: 'uf uf-exc-t',
6239 light: 'uf uf-notification',
6240 dark: 'uf uf-bubble',
6241 news: 'uf uf-bell',
6242 infolight: 'uf uf-i-c-2',
6243 successlight: 'uf uf-correct',
6244 dangerlight: 'uf uf-close-c',
6245 warninglight: 'uf uf-exc-t'
6246 }[type];
6247
6248 var positionStyle = positionObj[position].messageStyle;
6249
6250 getMessageInstance(position, function (instance) {
6251 instance.notice({
6252 key: key,
6253 duration: duration,
6254 color: type,
6255 style: _extends({}, positionStyle, style),
6256 content: _react2["default"].createElement(
6257 'div',
6258 null,
6259 showIcon ? _react2["default"].createElement(
6260 'div',
6261 { className: clsPrefix + '-notice-description-icon' },
6262 _react2["default"].createElement('i', { className: (0, _classnames2["default"])(iconType) })
6263 ) : null,
6264 _react2["default"].createElement(
6265 'div',
6266 { className: clsPrefix + '-notice-description-content' },
6267 content
6268 )
6269 ),
6270 onClose: onClose
6271 });
6272 }, keyboard, onEscapeKeyUp);
6273 return function () {
6274 var target = key++;
6275 return function () {
6276 if (messageInstance) {
6277 messageInstance.removeNotice(target);
6278 }
6279 };
6280 }();
6281 }
6282
6283 exports["default"] = {
6284 create: function create(obj) {
6285 var content = obj.content || '';
6286 var duration = _typeof(obj.duration) == undefined ? defaultDuration : obj.duration;
6287 var color = obj.color || 'dark';
6288 var onClose = obj.onClose || noop;
6289 var position = obj.position || "top";
6290 var style = obj.style || {};
6291 var showIcon = obj.showIcon || false;
6292 return notice(content, duration, color, onClose, position, style, obj.keyboard, obj.onEscapeKeyUp, showIcon);
6293 },
6294 config: function config(options) {
6295 if (options.top !== undefined) {
6296 defaultTop = options.top;
6297 }
6298 if (options.duration !== undefined) {
6299 defaultDuration = options.duration;
6300 }
6301 if (options.clsPrefix !== undefined) {
6302 clsPrefix = options.clsPrefix;
6303 }
6304 if (options.defaultBottom !== undefined) {
6305 defaultBottom = options.defaultBottom;
6306 }
6307 if (options.bottom !== undefined) {
6308 bottom = options.bottom;
6309 }
6310 if (options.width !== undefined) {
6311 bottom = options.width;
6312 }
6313 },
6314 destroy: function destroy() {
6315 if (messageInstance) {
6316 messageInstance.destroy();
6317 messageInstance = null;
6318 }
6319 }
6320 };
6321 module.exports = exports['default'];
6322
6323/***/ }),
6324/* 67 */
6325/***/ (function(module, exports, __webpack_require__) {
6326
6327 'use strict';
6328
6329 Object.defineProperty(exports, "__esModule", {
6330 value: true
6331 });
6332
6333 var _Notification = __webpack_require__(68);
6334
6335 var _Notification2 = _interopRequireDefault(_Notification);
6336
6337 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
6338
6339 exports["default"] = _Notification2["default"];
6340 module.exports = exports['default'];
6341
6342/***/ }),
6343/* 68 */
6344/***/ (function(module, exports, __webpack_require__) {
6345
6346 'use strict';
6347
6348 Object.defineProperty(exports, "__esModule", {
6349 value: true
6350 });
6351
6352 var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
6353
6354 var _react = __webpack_require__(4);
6355
6356 var _react2 = _interopRequireDefault(_react);
6357
6358 var _propTypes = __webpack_require__(5);
6359
6360 var _propTypes2 = _interopRequireDefault(_propTypes);
6361
6362 var _reactDom = __webpack_require__(12);
6363
6364 var _reactDom2 = _interopRequireDefault(_reactDom);
6365
6366 var _beeAnimate = __webpack_require__(69);
6367
6368 var _beeAnimate2 = _interopRequireDefault(_beeAnimate);
6369
6370 var _createChainedFunction = __webpack_require__(37);
6371
6372 var _createChainedFunction2 = _interopRequireDefault(_createChainedFunction);
6373
6374 var _ownerDocument = __webpack_require__(74);
6375
6376 var _ownerDocument2 = _interopRequireDefault(_ownerDocument);
6377
6378 var _addEventListener = __webpack_require__(76);
6379
6380 var _addEventListener2 = _interopRequireDefault(_addEventListener);
6381
6382 var _classnames = __webpack_require__(3);
6383
6384 var _classnames2 = _interopRequireDefault(_classnames);
6385
6386 var _Notice = __webpack_require__(78);
6387
6388 var _Notice2 = _interopRequireDefault(_Notice);
6389
6390 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
6391
6392 function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
6393
6394 function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6395
6396 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
6397
6398 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
6399
6400 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
6401
6402 var seed = 0;
6403 var now = Date.now();
6404
6405 function getUuid() {
6406 return 'uNotification_' + now + '_' + seed++;
6407 }
6408
6409 var propTypes = {
6410 show: _propTypes2["default"].bool,
6411 clsPrefix: _propTypes2["default"].string,
6412 style: _propTypes2["default"].object,
6413 position: _propTypes2["default"].oneOf(['topRight', 'bottomRight', '']),
6414 transitionName: _propTypes2["default"].string,
6415 keyboard: _propTypes2["default"].bool, // 按esc键是否关闭notice
6416 onEscapeKeyUp: _propTypes2["default"].func, // 设置esc键特殊钩子函数
6417 animation: _propTypes2["default"].oneOfType([_propTypes2["default"].string, _propTypes2["default"].object])
6418 };
6419
6420 var defaultProps = {
6421 clsPrefix: 'u-notification',
6422 animation: 'fade',
6423 keyboard: true,
6424 position: 'topRight'
6425 };
6426
6427 var Notification = function (_Component) {
6428 _inherits(Notification, _Component);
6429
6430 function Notification(props) {
6431 _classCallCheck(this, Notification);
6432
6433 var _this = _possibleConstructorReturn(this, _Component.call(this, props));
6434
6435 _this.handleDocumentKeyUp = function (e) {
6436 if (_this.props.keyboard && e.keyCode === 27 && _this.state.notices.length) {
6437 _this.setState(function (previousState) {
6438 previousState.notices.shift();
6439 return {
6440 notices: previousState.notices
6441 };
6442 });
6443 if (_this.props.onEscapeKeyUp) {
6444 _this.props.onEscapeKeyUp(e);
6445 }
6446 }
6447 };
6448
6449 _this.state = {
6450 notices: []
6451 };
6452 _this.add = _this.add.bind(_this);
6453 _this.remove = _this.remove.bind(_this);
6454
6455 return _this;
6456 }
6457
6458 Notification.prototype.componentDidMount = function componentDidMount() {
6459 // 给document绑定keyup事件
6460 var doc = (0, _ownerDocument2["default"])(this);
6461 this._onDocumentKeyupListener = (0, _addEventListener2["default"])(doc, 'keyup', this.handleDocumentKeyUp);
6462 };
6463
6464 Notification.prototype.componentWillUnmount = function componentWillUnmount() {
6465 this._onDocumentKeyupListener.remove();
6466 };
6467
6468 Notification.prototype.getTransitionName = function getTransitionName() {
6469 var props = this.props;
6470 var transitionName = props.transitionName;
6471 if (!transitionName && props.animation) {
6472 transitionName = props.clsPrefix + '-' + props.animation;
6473 }
6474 return transitionName;
6475 };
6476
6477 Notification.prototype.add = function add(notice) {
6478 var key = notice.key = notice.key || getUuid();
6479 this.setState(function (previousState) {
6480 var notices = previousState.notices;
6481 if (!notices.filter(function (v) {
6482 return v.key === key;
6483 }).length) {
6484 return {
6485 notices: notices.concat(notice)
6486 };
6487 }
6488 });
6489 };
6490
6491 Notification.prototype.remove = function remove(key) {
6492 this.setState(function (previousState) {
6493 return {
6494 notices: previousState.notices.filter(function (notice) {
6495 return notice.key !== key;
6496 })
6497 };
6498 });
6499 };
6500
6501 /**
6502 * 处理绑定在document上的keyup事件
6503 */
6504
6505
6506 Notification.prototype.render = function render() {
6507 var _this2 = this,
6508 _classes;
6509
6510 var _props = this.props,
6511 clsPrefix = _props.clsPrefix,
6512 className = _props.className,
6513 position = _props.position,
6514 style = _props.style;
6515
6516 var noticeNodes = this.state.notices.map(function (notice) {
6517 var onClose = (0, _createChainedFunction2["default"])(_this2.remove.bind(_this2, notice.key), notice.onClose);
6518 return _react2["default"].createElement(
6519 _Notice2["default"],
6520 _extends({
6521 clsPrefix: clsPrefix
6522 }, notice, {
6523 onClose: onClose
6524 }),
6525 notice.content
6526 );
6527 });
6528 var classes = (_classes = {}, _defineProperty(_classes, clsPrefix, 1), _defineProperty(_classes, className, !!className), _classes);
6529 if (position) {
6530 classes[clsPrefix + '-' + position] = !!position;
6531 }
6532
6533 return _react2["default"].createElement(
6534 'div',
6535 { className: (0, _classnames2["default"])(className, classes), style: style },
6536 _react2["default"].createElement(
6537 _beeAnimate2["default"],
6538 { transitionName: this.getTransitionName() },
6539 noticeNodes
6540 )
6541 );
6542 };
6543
6544 return Notification;
6545 }(_react.Component);
6546
6547 ;
6548
6549 Notification.propTypes = propTypes;
6550 Notification.defaultProps = defaultProps;
6551
6552 Notification.newInstance = function newNotificationInstance(properties, callback) {
6553 if (typeof callback !== 'function') {
6554 console.error('You must introduce callback as the second parameter of Notification.newInstance().');
6555 return;
6556 }
6557 var props = properties || {};
6558 var div = document.createElement('div');
6559 document.body.appendChild(div);
6560
6561 var called = false;
6562 function ref(notification) {
6563 if (called) {
6564 return;
6565 }
6566 called = true;
6567 callback({
6568 notice: function notice(noticeProps) {
6569 notification.add(noticeProps);
6570 },
6571 removeNotice: function removeNotice(key) {
6572 notification.remove(key);
6573 },
6574
6575 component: notification,
6576 destroy: function destroy() {
6577 _reactDom2["default"].unmountComponentAtNode(div);
6578 document.body.removeChild(div);
6579 }
6580 });
6581 }
6582 _reactDom2["default"].render(_react2["default"].createElement(Notification, _extends({}, props, { ref: ref })), div);
6583 };
6584
6585 exports["default"] = Notification;
6586 module.exports = exports['default'];
6587
6588/***/ }),
6589/* 69 */
6590/***/ (function(module, exports, __webpack_require__) {
6591
6592 'use strict';
6593
6594 Object.defineProperty(exports, "__esModule", {
6595 value: true
6596 });
6597
6598 var _Animate = __webpack_require__(70);
6599
6600 var _Animate2 = _interopRequireDefault(_Animate);
6601
6602 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
6603
6604 exports["default"] = _Animate2["default"];
6605 module.exports = exports['default'];
6606
6607/***/ }),
6608/* 70 */
6609/***/ (function(module, exports, __webpack_require__) {
6610
6611 'use strict';
6612
6613 Object.defineProperty(exports, "__esModule", {
6614 value: true
6615 });
6616
6617 var _react = __webpack_require__(4);
6618
6619 var _react2 = _interopRequireDefault(_react);
6620
6621 var _propTypes = __webpack_require__(5);
6622
6623 var _propTypes2 = _interopRequireDefault(_propTypes);
6624
6625 var _ChildrenUtils = __webpack_require__(71);
6626
6627 var _AnimateChild = __webpack_require__(72);
6628
6629 var _AnimateChild2 = _interopRequireDefault(_AnimateChild);
6630
6631 var _util = __webpack_require__(73);
6632
6633 var _util2 = _interopRequireDefault(_util);
6634
6635 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
6636
6637 function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
6638
6639 function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6640
6641 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
6642
6643 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
6644
6645 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
6646
6647 var defaultKey = 'u_animate_' + Date.now();
6648
6649
6650 function getChildrenFromProps(props) {
6651 var children = props.children;
6652 if (_react2["default"].isValidElement(children)) {
6653 if (!children.key) {
6654 return _react2["default"].cloneElement(children, {
6655 key: defaultKey
6656 });
6657 }
6658 }
6659 return children;
6660 }
6661
6662 function noop() {}
6663
6664 var propTypes = {
6665 component: _propTypes2["default"].any,
6666 animation: _propTypes2["default"].object,
6667 transitionName: _propTypes2["default"].oneOfType([_propTypes2["default"].string, _propTypes2["default"].object]),
6668 transitionEnter: _propTypes2["default"].bool,
6669 transitionAppear: _propTypes2["default"].bool,
6670 exclusive: _propTypes2["default"].bool,
6671 transitionLeave: _propTypes2["default"].bool,
6672 onEnd: _propTypes2["default"].func,
6673 onEnter: _propTypes2["default"].func,
6674 onLeave: _propTypes2["default"].func,
6675 onAppear: _propTypes2["default"].func,
6676 showProp: _propTypes2["default"].string
6677 };
6678
6679 var defaultProps = {
6680 animation: {},
6681 component: 'span',
6682 transitionEnter: true,
6683 transitionLeave: true,
6684 transitionAppear: false,
6685 onEnd: noop,
6686 onEnter: noop,
6687 onLeave: noop,
6688 onAppear: noop
6689 };
6690
6691 var Animate = function (_Component) {
6692 _inherits(Animate, _Component);
6693
6694 function Animate(props) {
6695 _classCallCheck(this, Animate);
6696
6697 var _this = _possibleConstructorReturn(this, _Component.call(this, props));
6698
6699 _this.currentlyAnimatingKeys = {};
6700 _this.keysToEnter = [];
6701 _this.keysToLeave = [];
6702 _this.state = {
6703 children: (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(_this.props))
6704 };
6705
6706 _this.performEnter = _this.performEnter.bind(_this);
6707 _this.performAppear = _this.performAppear.bind(_this);
6708 _this.handleDoneAdding = _this.handleDoneAdding.bind(_this);
6709 _this.performLeave = _this.performLeave.bind(_this);
6710
6711 _this.performLeave = _this.performLeave.bind(_this);
6712 _this.handleDoneLeaving = _this.handleDoneLeaving.bind(_this);
6713 _this.isValidChildByKey = _this.isValidChildByKey.bind(_this);
6714 _this.stop = _this.stop.bind(_this);
6715 return _this;
6716 }
6717
6718 Animate.prototype.componentDidMount = function componentDidMount() {
6719 var _this2 = this;
6720
6721 this.mounted = true;
6722 var showProp = this.props.showProp;
6723 var children = this.state.children;
6724 if (showProp) {
6725 children = children.filter(function (child) {
6726 return !!child.props[showProp];
6727 });
6728 }
6729 children.forEach(function (child) {
6730 if (child) {
6731 _this2.performAppear(child.key);
6732 }
6733 });
6734 };
6735
6736 Animate.prototype.componentWillUnmount = function componentWillUnmount() {
6737 this.mounted = false;
6738 };
6739
6740 Animate.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
6741 var _this3 = this;
6742
6743 this.nextProps = nextProps;
6744 var nextChildren = (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(nextProps));
6745 var props = this.props;
6746 // exclusive needs immediate response
6747 if (props.exclusive) {
6748 Object.keys(this.currentlyAnimatingKeys).forEach(function (key) {
6749 _this3.stop(key);
6750 });
6751 }
6752 var showProp = props.showProp;
6753 var currentlyAnimatingKeys = this.currentlyAnimatingKeys;
6754 // last props children if exclusive
6755 var currentChildren = props.exclusive ? (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(props)) : this.state.children;
6756 // in case destroy in showProp mode
6757 var newChildren = [];
6758 if (showProp) {
6759 currentChildren.forEach(function (currentChild) {
6760 var nextChild = currentChild && (0, _ChildrenUtils.findChildInChildrenByKey)(nextChildren, currentChild.key);
6761 var newChild = void 0;
6762 if ((!nextChild || !nextChild.props[showProp]) && currentChild.props[showProp]) {
6763 newChild = _react2["default"].cloneElement(nextChild || currentChild, _defineProperty({}, showProp, true));
6764 } else {
6765 newChild = nextChild;
6766 }
6767 if (newChild) {
6768 newChildren.push(newChild);
6769 }
6770 });
6771 nextChildren.forEach(function (nextChild) {
6772 if (!nextChild || !(0, _ChildrenUtils.findChildInChildrenByKey)(currentChildren, nextChild.key)) {
6773 newChildren.push(nextChild);
6774 }
6775 });
6776 } else {
6777 newChildren = (0, _ChildrenUtils.mergeChildren)(currentChildren, nextChildren);
6778 }
6779
6780 // need render to avoid update
6781 this.setState({
6782 children: newChildren
6783 });
6784
6785 nextChildren.forEach(function (child) {
6786 var key = child && child.key;
6787 if (child && currentlyAnimatingKeys[key]) {
6788 return;
6789 }
6790 var hasPrev = child && (0, _ChildrenUtils.findChildInChildrenByKey)(currentChildren, key);
6791 if (showProp) {
6792 var showInNext = child.props[showProp];
6793 if (hasPrev) {
6794 var showInNow = (0, _ChildrenUtils.findShownChildInChildrenByKey)(currentChildren, key, showProp);
6795 if (!showInNow && showInNext) {
6796 _this3.keysToEnter.push(key);
6797 }
6798 } else if (showInNext) {
6799 _this3.keysToEnter.push(key);
6800 }
6801 } else if (!hasPrev) {
6802 _this3.keysToEnter.push(key);
6803 }
6804 });
6805
6806 currentChildren.forEach(function (child) {
6807 var key = child && child.key;
6808 if (child && currentlyAnimatingKeys[key]) {
6809 return;
6810 }
6811 var hasNext = child && (0, _ChildrenUtils.findChildInChildrenByKey)(nextChildren, key);
6812 if (showProp) {
6813 var showInNow = child.props[showProp];
6814 if (hasNext) {
6815 var showInNext = (0, _ChildrenUtils.findShownChildInChildrenByKey)(nextChildren, key, showProp);
6816 if (!showInNext && showInNow) {
6817 _this3.keysToLeave.push(key);
6818 }
6819 } else if (showInNow) {
6820 _this3.keysToLeave.push(key);
6821 }
6822 } else if (!hasNext) {
6823 _this3.keysToLeave.push(key);
6824 }
6825 });
6826 };
6827
6828 Animate.prototype.componentDidUpdate = function componentDidUpdate() {
6829 var keysToEnter = this.keysToEnter;
6830 this.keysToEnter = [];
6831 keysToEnter.forEach(this.performEnter);
6832 var keysToLeave = this.keysToLeave;
6833 this.keysToLeave = [];
6834 keysToLeave.forEach(this.performLeave);
6835 };
6836
6837 Animate.prototype.performEnter = function performEnter(key) {
6838 // may already remove by exclusive
6839 if (this.refs[key]) {
6840 this.currentlyAnimatingKeys[key] = true;
6841 this.refs[key].componentWillEnter(this.handleDoneAdding.bind(this, key, 'enter'));
6842 }
6843 };
6844
6845 Animate.prototype.performAppear = function performAppear(key) {
6846 if (this.refs[key]) {
6847 this.currentlyAnimatingKeys[key] = true;
6848 this.refs[key].componentWillAppear(this.handleDoneAdding.bind(this, key, 'appear'));
6849 }
6850 };
6851
6852 Animate.prototype.handleDoneAdding = function handleDoneAdding(key, type) {
6853 var props = this.props;
6854 delete this.currentlyAnimatingKeys[key];
6855 // if update on exclusive mode, skip check
6856 if (props.exclusive && props !== this.nextProps) {
6857 return;
6858 }
6859 var currentChildren = (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(props));
6860 if (!this.isValidChildByKey(currentChildren, key)) {
6861 // exclusive will not need this
6862 this.performLeave(key);
6863 } else {
6864 if (type === 'appear') {
6865 if (_util2["default"].allowAppearCallback(props)) {
6866 props.onAppear(key);
6867 props.onEnd(key, true);
6868 }
6869 } else {
6870 if (_util2["default"].allowEnterCallback(props)) {
6871 props.onEnter(key);
6872 props.onEnd(key, true);
6873 }
6874 }
6875 }
6876 };
6877
6878 Animate.prototype.performLeave = function performLeave(key) {
6879 // may already remove by exclusive
6880 if (this.refs[key]) {
6881 this.currentlyAnimatingKeys[key] = true;
6882 this.refs[key].componentWillLeave(this.handleDoneLeaving.bind(this, key));
6883 }
6884 };
6885
6886 Animate.prototype.handleDoneLeaving = function handleDoneLeaving(key) {
6887 var props = this.props;
6888 delete this.currentlyAnimatingKeys[key];
6889 // if update on exclusive mode, skip check
6890 if (props.exclusive && props !== this.nextProps) {
6891 return;
6892 }
6893 var currentChildren = (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(props));
6894 // in case state change is too fast
6895 if (this.isValidChildByKey(currentChildren, key)) {
6896 this.performEnter(key);
6897 } else {
6898 var end = function end() {
6899 if (_util2["default"].allowLeaveCallback(props)) {
6900 props.onLeave(key);
6901 props.onEnd(key, false);
6902 }
6903 };
6904 /* eslint react/no-is-mounted:0 */
6905 if (this.mounted && !(0, _ChildrenUtils.isSameChildren)(this.state.children, currentChildren, props.showProp)) {
6906 this.setState({
6907 children: currentChildren
6908 }, end);
6909 } else {
6910 end();
6911 }
6912 }
6913 };
6914
6915 Animate.prototype.isValidChildByKey = function isValidChildByKey(currentChildren, key) {
6916 var showProp = this.props.showProp;
6917 if (showProp) {
6918 return (0, _ChildrenUtils.findShownChildInChildrenByKey)(currentChildren, key, showProp);
6919 }
6920 return (0, _ChildrenUtils.findChildInChildrenByKey)(currentChildren, key);
6921 };
6922
6923 Animate.prototype.stop = function stop(key) {
6924 delete this.currentlyAnimatingKeys[key];
6925 var component = this.refs[key];
6926 if (component) {
6927 component.stop();
6928 }
6929 };
6930
6931 Animate.prototype.render = function render() {
6932 var props = this.props;
6933 this.nextProps = props;
6934 var stateChildren = this.state.children;
6935 var children = null;
6936 if (stateChildren) {
6937 children = stateChildren.map(function (child) {
6938 if (child === null || child === undefined) {
6939 return child;
6940 }
6941 if (!child.key) {
6942 throw new Error('must set key for <rc-animate> children');
6943 }
6944 return _react2["default"].createElement(
6945 _AnimateChild2["default"],
6946 {
6947 key: child.key,
6948 ref: child.key,
6949 animation: props.animation,
6950 transitionName: props.transitionName,
6951 transitionEnter: props.transitionEnter,
6952 transitionAppear: props.transitionAppear,
6953 transitionLeave: props.transitionLeave
6954 },
6955 child
6956 );
6957 });
6958 }
6959 var Component = props.component;
6960 if (Component) {
6961 var passedProps = props;
6962 if (typeof Component === 'string') {
6963 passedProps = {
6964 className: props.className,
6965 style: props.style
6966 };
6967 }
6968 return _react2["default"].createElement(
6969 Component,
6970 passedProps,
6971 children
6972 );
6973 }
6974 return children[0] || null;
6975 };
6976
6977 return Animate;
6978 }(_react.Component);
6979
6980 ;
6981 Animate.defaultProps = defaultProps;
6982 Animate.propTypes = Animate.propTypes;
6983
6984 exports["default"] = Animate;
6985 module.exports = exports['default'];
6986
6987/***/ }),
6988/* 71 */
6989/***/ (function(module, exports, __webpack_require__) {
6990
6991 'use strict';
6992
6993 Object.defineProperty(exports, "__esModule", {
6994 value: true
6995 });
6996 exports.toArrayChildren = toArrayChildren;
6997 exports.findChildInChildrenByKey = findChildInChildrenByKey;
6998 exports.findShownChildInChildrenByKey = findShownChildInChildrenByKey;
6999 exports.findHiddenChildInChildrenByKey = findHiddenChildInChildrenByKey;
7000 exports.isSameChildren = isSameChildren;
7001 exports.mergeChildren = mergeChildren;
7002
7003 var _react = __webpack_require__(4);
7004
7005 var _react2 = _interopRequireDefault(_react);
7006
7007 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
7008
7009 function toArrayChildren(children) {
7010 var ret = [];
7011 _react2["default"].Children.forEach(children, function (child) {
7012 ret.push(child);
7013 });
7014 return ret;
7015 }
7016
7017 function findChildInChildrenByKey(children, key) {
7018 var ret = null;
7019 if (children) {
7020 children.forEach(function (child) {
7021 if (ret) {
7022 return;
7023 }
7024 if (child && child.key === key) {
7025 ret = child;
7026 }
7027 });
7028 }
7029 return ret;
7030 }
7031
7032 function findShownChildInChildrenByKey(children, key, showProp) {
7033 var ret = null;
7034 if (children) {
7035 children.forEach(function (child) {
7036 if (child && child.key === key && child.props[showProp]) {
7037 if (ret) {
7038 throw new Error('two child with same key for <rc-animate> children');
7039 }
7040 ret = child;
7041 }
7042 });
7043 }
7044 return ret;
7045 }
7046
7047 function findHiddenChildInChildrenByKey(children, key, showProp) {
7048 var found = 0;
7049 if (children) {
7050 children.forEach(function (child) {
7051 if (found) {
7052 return;
7053 }
7054 found = child && child.key === key && !child.props[showProp];
7055 });
7056 }
7057 return found;
7058 }
7059
7060 function isSameChildren(c1, c2, showProp) {
7061 var same = c1.length === c2.length;
7062 if (same) {
7063 c1.forEach(function (child, index) {
7064 var child2 = c2[index];
7065 if (child && child2) {
7066 if (child && !child2 || !child && child2) {
7067 same = false;
7068 } else if (child.key !== child2.key) {
7069 same = false;
7070 } else if (showProp && child.props[showProp] !== child2.props[showProp]) {
7071 same = false;
7072 }
7073 }
7074 });
7075 }
7076 return same;
7077 }
7078
7079 function mergeChildren(prev, next) {
7080 var ret = [];
7081
7082 // For each key of `next`, the list of keys to insert before that key in
7083 // the combined list
7084 var nextChildrenPending = {};
7085 var pendingChildren = [];
7086 prev.forEach(function (child) {
7087 if (child && findChildInChildrenByKey(next, child.key)) {
7088 if (pendingChildren.length) {
7089 nextChildrenPending[child.key] = pendingChildren;
7090 pendingChildren = [];
7091 }
7092 } else {
7093 pendingChildren.push(child);
7094 }
7095 });
7096
7097 next.forEach(function (child) {
7098 if (child && nextChildrenPending.hasOwnProperty(child.key)) {
7099 ret = ret.concat(nextChildrenPending[child.key]);
7100 }
7101 ret.push(child);
7102 });
7103
7104 ret = ret.concat(pendingChildren);
7105
7106 return ret;
7107 }
7108
7109/***/ }),
7110/* 72 */
7111/***/ (function(module, exports, __webpack_require__) {
7112
7113 'use strict';
7114
7115 Object.defineProperty(exports, "__esModule", {
7116 value: true
7117 });
7118
7119 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
7120
7121 var _react = __webpack_require__(4);
7122
7123 var _react2 = _interopRequireDefault(_react);
7124
7125 var _propTypes = __webpack_require__(5);
7126
7127 var _propTypes2 = _interopRequireDefault(_propTypes);
7128
7129 var _reactDom = __webpack_require__(12);
7130
7131 var _reactDom2 = _interopRequireDefault(_reactDom);
7132
7133 var _tinperBeeCore = __webpack_require__(27);
7134
7135 var _util = __webpack_require__(73);
7136
7137 var _util2 = _interopRequireDefault(_util);
7138
7139 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
7140
7141 function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
7142
7143 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7144
7145 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
7146
7147 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
7148
7149 var transitionMap = {
7150 enter: 'transitionEnter',
7151 appear: 'transitionAppear',
7152 leave: 'transitionLeave'
7153 };
7154
7155 var propTypes = {
7156 children: _propTypes2["default"].any
7157 };
7158
7159 var AnimateChild = function (_Component) {
7160 _inherits(AnimateChild, _Component);
7161
7162 function AnimateChild(props) {
7163 _classCallCheck(this, AnimateChild);
7164
7165 var _this = _possibleConstructorReturn(this, _Component.call(this, props));
7166
7167 _this.transition = _this.transition.bind(_this);
7168 _this.stop = _this.stop.bind(_this);
7169 return _this;
7170 }
7171
7172 AnimateChild.prototype.componentWillUnmount = function componentWillUnmount() {
7173 this.stop();
7174 };
7175
7176 AnimateChild.prototype.componentWillEnter = function componentWillEnter(done) {
7177 if (_util2["default"].isEnterSupported(this.props)) {
7178 this.transition('enter', done);
7179 } else {
7180 done();
7181 }
7182 };
7183
7184 AnimateChild.prototype.componentWillAppear = function componentWillAppear(done) {
7185 if (_util2["default"].isAppearSupported(this.props)) {
7186 this.transition('appear', done);
7187 } else {
7188 done();
7189 }
7190 };
7191
7192 AnimateChild.prototype.componentWillLeave = function componentWillLeave(done) {
7193 if (_util2["default"].isLeaveSupported(this.props)) {
7194 this.transition('leave', done);
7195 } else {
7196 // always sync, do not interupt with react component life cycle
7197 // update hidden -> animate hidden ->
7198 // didUpdate -> animate leave -> unmount (if animate is none)
7199 done();
7200 }
7201 };
7202
7203 AnimateChild.prototype.transition = function transition(animationType, finishCallback) {
7204 var _this2 = this;
7205
7206 var node = _reactDom2["default"].findDOMNode(this);
7207 var props = this.props;
7208 var transitionName = props.transitionName;
7209 var nameIsObj = (typeof transitionName === 'undefined' ? 'undefined' : _typeof(transitionName)) === 'object';
7210 this.stop();
7211 var end = function end() {
7212 _this2.stopper = null;
7213 finishCallback();
7214 };
7215 if ((_tinperBeeCore.cssAnimation.isCssAnimationSupported || !props.animation[animationType]) && transitionName && props[transitionMap[animationType]]) {
7216 var name = nameIsObj ? transitionName[animationType] : transitionName + '-' + animationType;
7217 var activeName = name + '-active';
7218 if (nameIsObj && transitionName[animationType + 'Active']) {
7219 activeName = transitionName[animationType + 'Active'];
7220 }
7221 this.stopper = (0, _tinperBeeCore.cssAnimation)(node, {
7222 name: name,
7223 active: activeName
7224 }, end);
7225 } else {
7226 this.stopper = props.animation[animationType](node, end);
7227 }
7228 };
7229
7230 AnimateChild.prototype.stop = function stop() {
7231 var stopper = this.stopper;
7232 if (stopper) {
7233 this.stopper = null;
7234 stopper.stop();
7235 }
7236 };
7237
7238 AnimateChild.prototype.render = function render() {
7239 return this.props.children;
7240 };
7241
7242 return AnimateChild;
7243 }(_react.Component);
7244
7245 ;
7246
7247 AnimateChild.propTypes = propTypes;
7248
7249 exports["default"] = AnimateChild;
7250 module.exports = exports['default'];
7251
7252/***/ }),
7253/* 73 */
7254/***/ (function(module, exports) {
7255
7256 "use strict";
7257
7258 Object.defineProperty(exports, "__esModule", {
7259 value: true
7260 });
7261 var util = {
7262 isAppearSupported: function isAppearSupported(props) {
7263 return props.transitionName && props.transitionAppear || props.animation.appear;
7264 },
7265 isEnterSupported: function isEnterSupported(props) {
7266 return props.transitionName && props.transitionEnter || props.animation.enter;
7267 },
7268 isLeaveSupported: function isLeaveSupported(props) {
7269 return props.transitionName && props.transitionLeave || props.animation.leave;
7270 },
7271 allowAppearCallback: function allowAppearCallback(props) {
7272 return props.transitionAppear || props.animation.appear;
7273 },
7274 allowEnterCallback: function allowEnterCallback(props) {
7275 return props.transitionEnter || props.animation.enter;
7276 },
7277 allowLeaveCallback: function allowLeaveCallback(props) {
7278 return props.transitionLeave || props.animation.leave;
7279 }
7280 };
7281 exports["default"] = util;
7282 module.exports = exports["default"];
7283
7284/***/ }),
7285/* 74 */
7286/***/ (function(module, exports, __webpack_require__) {
7287
7288 'use strict';
7289
7290 Object.defineProperty(exports, "__esModule", {
7291 value: true
7292 });
7293
7294 exports["default"] = function (componentOrElement) {
7295 return (0, _ownerDocument2["default"])(_reactDom2["default"].findDOMNode(componentOrElement));
7296 };
7297
7298 var _reactDom = __webpack_require__(12);
7299
7300 var _reactDom2 = _interopRequireDefault(_reactDom);
7301
7302 var _ownerDocument = __webpack_require__(75);
7303
7304 var _ownerDocument2 = _interopRequireDefault(_ownerDocument);
7305
7306 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
7307
7308 module.exports = exports['default'];
7309
7310/***/ }),
7311/* 75 */
7312/***/ (function(module, exports) {
7313
7314 "use strict";
7315
7316 exports.__esModule = true;
7317 exports.default = ownerDocument;
7318
7319 function ownerDocument(node) {
7320 return node && node.ownerDocument || document;
7321 }
7322
7323 module.exports = exports["default"];
7324
7325/***/ }),
7326/* 76 */
7327/***/ (function(module, exports, __webpack_require__) {
7328
7329 'use strict';
7330
7331 Object.defineProperty(exports, "__esModule", {
7332 value: true
7333 });
7334
7335 exports["default"] = function (node, event, handler, capture) {
7336 (0, _on2["default"])(node, event, handler, capture);
7337
7338 return {
7339 remove: function remove() {
7340 (0, _off2["default"])(node, event, handler, capture);
7341 }
7342 };
7343 };
7344
7345 var _on = __webpack_require__(16);
7346
7347 var _on2 = _interopRequireDefault(_on);
7348
7349 var _off = __webpack_require__(77);
7350
7351 var _off2 = _interopRequireDefault(_off);
7352
7353 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
7354
7355 module.exports = exports['default'];
7356
7357/***/ }),
7358/* 77 */
7359/***/ (function(module, exports, __webpack_require__) {
7360
7361 "use strict";
7362
7363 var _interopRequireDefault = __webpack_require__(14);
7364
7365 exports.__esModule = true;
7366 exports.default = void 0;
7367
7368 var _inDOM = _interopRequireDefault(__webpack_require__(15));
7369
7370 var off = function off() {};
7371
7372 if (_inDOM.default) {
7373 off = function () {
7374 if (document.addEventListener) return function (node, eventName, handler, capture) {
7375 return node.removeEventListener(eventName, handler, capture || false);
7376 };else if (document.attachEvent) return function (node, eventName, handler) {
7377 return node.detachEvent('on' + eventName, handler);
7378 };
7379 }();
7380 }
7381
7382 var _default = off;
7383 exports.default = _default;
7384 module.exports = exports["default"];
7385
7386/***/ }),
7387/* 78 */
7388/***/ (function(module, exports, __webpack_require__) {
7389
7390 'use strict';
7391
7392 Object.defineProperty(exports, "__esModule", {
7393 value: true
7394 });
7395
7396 var _react = __webpack_require__(4);
7397
7398 var _react2 = _interopRequireDefault(_react);
7399
7400 var _classnames = __webpack_require__(3);
7401
7402 var _classnames2 = _interopRequireDefault(_classnames);
7403
7404 var _propTypes = __webpack_require__(5);
7405
7406 var _propTypes2 = _interopRequireDefault(_propTypes);
7407
7408 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
7409
7410 function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
7411
7412 function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
7413
7414 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7415
7416 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
7417
7418 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
7419
7420 var propTypes = {
7421 duration: _propTypes2["default"].number,
7422 onClose: _propTypes2["default"].func,
7423 children: _propTypes2["default"].any,
7424 color: _propTypes2["default"].oneOf(['info', 'success', 'danger', 'warning', 'light', 'dark', 'news', 'infolight', 'successlight', 'dangerlight', 'warninglight']),
7425 title: _propTypes2["default"].any
7426 };
7427
7428 function noop() {}
7429
7430 var defaultProps = {
7431 onEnd: noop,
7432 onClose: noop,
7433 duration: 4.5,
7434 closable: true
7435 };
7436
7437 var Notice = function (_React$Component) {
7438 _inherits(Notice, _React$Component);
7439
7440 function Notice(props) {
7441 _classCallCheck(this, Notice);
7442
7443 var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
7444
7445 _this.clearCloseTimer = _this.clearCloseTimer.bind(_this);
7446 _this.close = _this.close.bind(_this);
7447 return _this;
7448 }
7449
7450 Notice.prototype.componentDidMount = function componentDidMount() {
7451 var _this2 = this;
7452
7453 if (this.props.duration) {
7454 this.closeTimer = setTimeout(function () {
7455 _this2.close();
7456 }, this.props.duration * 1000);
7457 }
7458 };
7459
7460 Notice.prototype.componentWillUnmount = function componentWillUnmount() {
7461 this.clearCloseTimer();
7462 };
7463
7464 Notice.prototype.clearCloseTimer = function clearCloseTimer() {
7465 if (this.closeTimer) {
7466 clearTimeout(this.closeTimer);
7467 this.closeTimer = null;
7468 }
7469 };
7470
7471 Notice.prototype.close = function close() {
7472 this.clearCloseTimer();
7473 this.props.onClose();
7474 };
7475
7476 Notice.prototype.render = function render() {
7477 var _classes;
7478
7479 var _props = this.props,
7480 closable = _props.closable,
7481 clsPrefix = _props.clsPrefix,
7482 className = _props.className,
7483 style = _props.style,
7484 children = _props.children,
7485 color = _props.color,
7486 title = _props.title;
7487
7488 var componentClass = clsPrefix + '-notice';
7489 var classes = (_classes = {}, _defineProperty(_classes, '' + componentClass, 1), _defineProperty(_classes, componentClass + '-closable', closable), _defineProperty(_classes, className, !!className), _classes);
7490 if (color) {
7491 classes[componentClass + '-' + color] = true;
7492 }
7493 return _react2["default"].createElement(
7494 'div',
7495 { className: (0, _classnames2["default"])(classes), style: style, onClick: this.close },
7496 _react2["default"].createElement(
7497 'div',
7498 { className: componentClass + '-content' },
7499 title && _react2["default"].createElement(
7500 'div',
7501 { className: componentClass + '-title' },
7502 title
7503 ),
7504 _react2["default"].createElement(
7505 'div',
7506 { className: componentClass + '-description' },
7507 children
7508 )
7509 ),
7510 closable ? _react2["default"].createElement(
7511 'a',
7512 { tabIndex: '0', onClick: this.close, className: componentClass + '-close' },
7513 _react2["default"].createElement('span', { className: componentClass + '-close-x' })
7514 ) : null
7515 );
7516 };
7517
7518 return Notice;
7519 }(_react2["default"].Component);
7520
7521 ;
7522
7523 Notice.propTypes = propTypes;
7524 Notice.defaultProps = defaultProps;
7525
7526 exports["default"] = Notice;
7527 module.exports = exports['default'];
7528
7529/***/ }),
7530/* 79 */
7531/***/ (function(module, exports, __webpack_require__) {
7532
7533 'use strict';
7534
7535 var deselectCurrent = __webpack_require__(80);
7536
7537 var defaultMessage = 'Copy to clipboard: #{key}, Enter';
7538
7539 function format(message) {
7540 var copyKey = (/mac os x/i.test(navigator.userAgent) ? '⌘' : 'Ctrl') + '+C';
7541 return message.replace(/#{\s*key\s*}/g, copyKey);
7542 }
7543
7544 function copy(text, options) {
7545 var debug, message, reselectPrevious, range, selection, mark, success = false;
7546 if (!options) { options = {}; }
7547 debug = options.debug || false;
7548 try {
7549 reselectPrevious = deselectCurrent();
7550
7551 range = document.createRange();
7552 selection = document.getSelection();
7553
7554 mark = document.createElement('span');
7555 mark.textContent = text;
7556 // reset user styles for span element
7557 mark.style.all = 'unset';
7558 // prevents scrolling to the end of the page
7559 mark.style.position = 'fixed';
7560 mark.style.top = 0;
7561 mark.style.clip = 'rect(0, 0, 0, 0)';
7562 // used to preserve spaces and line breaks
7563 mark.style.whiteSpace = 'pre';
7564 // do not inherit user-select (it may be `none`)
7565 mark.style.webkitUserSelect = 'text';
7566 mark.style.MozUserSelect = 'text';
7567 mark.style.msUserSelect = 'text';
7568 mark.style.userSelect = 'text';
7569
7570 document.body.appendChild(mark);
7571
7572 range.selectNode(mark);
7573 selection.addRange(range);
7574
7575 var successful = document.execCommand('copy');
7576 if (!successful) {
7577 throw new Error('copy command was unsuccessful');
7578 }
7579 success = true;
7580 } catch (err) {
7581 debug && console.error('unable to copy using execCommand: ', err);
7582 debug && console.warn('trying IE specific stuff');
7583 try {
7584 window.clipboardData.setData('text', text);
7585 success = true;
7586 } catch (err) {
7587 debug && console.error('unable to copy using clipboardData: ', err);
7588 debug && console.error('falling back to prompt');
7589 message = format('message' in options ? options.message : defaultMessage);
7590 window.prompt(message, text);
7591 }
7592 } finally {
7593 if (selection) {
7594 if (typeof selection.removeRange == 'function') {
7595 selection.removeRange(range);
7596 } else {
7597 selection.removeAllRanges();
7598 }
7599 }
7600
7601 if (mark) {
7602 document.body.removeChild(mark);
7603 }
7604 reselectPrevious();
7605 }
7606
7607 return success;
7608 }
7609
7610 module.exports = copy;
7611
7612
7613/***/ }),
7614/* 80 */
7615/***/ (function(module, exports) {
7616
7617
7618 module.exports = function () {
7619 var selection = document.getSelection();
7620 if (!selection.rangeCount) {
7621 return function () {};
7622 }
7623 var active = document.activeElement;
7624
7625 var ranges = [];
7626 for (var i = 0; i < selection.rangeCount; i++) {
7627 ranges.push(selection.getRangeAt(i));
7628 }
7629
7630 switch (active.tagName.toUpperCase()) { // .toUpperCase handles XHTML
7631 case 'INPUT':
7632 case 'TEXTAREA':
7633 active.blur();
7634 break;
7635
7636 default:
7637 active = null;
7638 break;
7639 }
7640
7641 selection.removeAllRanges();
7642 return function () {
7643 selection.type === 'Caret' &&
7644 selection.removeAllRanges();
7645
7646 if (!selection.rangeCount) {
7647 ranges.forEach(function(range) {
7648 selection.addRange(range);
7649 });
7650 }
7651
7652 active &&
7653 active.focus();
7654 };
7655 };
7656
7657
7658/***/ }),
7659/* 81 */
7660/***/ (function(module, exports, __webpack_require__) {
7661
7662 'use strict';
7663
7664 Object.defineProperty(exports, "__esModule", {
7665 value: true
7666 });
7667
7668 var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
7669
7670 var _classnames = __webpack_require__(3);
7671
7672 var _classnames2 = _interopRequireDefault(_classnames);
7673
7674 var _react = __webpack_require__(4);
7675
7676 var _react2 = _interopRequireDefault(_react);
7677
7678 var _propTypes = __webpack_require__(5);
7679
7680 var _propTypes2 = _interopRequireDefault(_propTypes);
7681
7682 var _tinperBeeCore = __webpack_require__(27);
7683
7684 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
7685
7686 function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
7687
7688 function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
7689
7690 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7691
7692 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
7693
7694 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
7695
7696 var propTypes = {
7697 //是否是手风琴效果
7698 accordion: _propTypes2["default"].bool,
7699 //激活的项
7700 activeKey: _propTypes2["default"].any,
7701 //默认的激活的项
7702 defaultActiveKey: _propTypes2["default"].any,
7703 //选中函数
7704 onSelect: _propTypes2["default"].func,
7705 role: _propTypes2["default"].string
7706 };
7707
7708 var defaultProps = {
7709 accordion: false,
7710 clsPrefix: 'u-panel-group'
7711 };
7712
7713 // TODO: Use uncontrollable.
7714
7715 var PanelGroup = function (_React$Component) {
7716 _inherits(PanelGroup, _React$Component);
7717
7718 function PanelGroup(props, context) {
7719 _classCallCheck(this, PanelGroup);
7720
7721 var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context));
7722
7723 _this.handleSelect = _this.handleSelect.bind(_this);
7724
7725 _this.state = {
7726 activeKey: props.defaultActiveKey
7727 };
7728 return _this;
7729 }
7730
7731 PanelGroup.prototype.handleSelect = function handleSelect(key, e) {
7732 e.preventDefault();
7733
7734 if (this.props.onSelect) {
7735 this.props.onSelect(key, e);
7736 }
7737
7738 if (this.state.activeKey === key) {
7739 key = null;
7740 }
7741
7742 this.setState({ activeKey: key });
7743 };
7744
7745 PanelGroup.prototype.render = function render() {
7746 var _this2 = this;
7747
7748 var _props = this.props,
7749 accordion = _props.accordion,
7750 propsActiveKey = _props.activeKey,
7751 className = _props.className,
7752 children = _props.children,
7753 defaultActiveKey = _props.defaultActiveKey,
7754 onSelect = _props.onSelect,
7755 style = _props.style,
7756 clsPrefix = _props.clsPrefix,
7757 others = _objectWithoutProperties(_props, ['accordion', 'activeKey', 'className', 'children', 'defaultActiveKey', 'onSelect', 'style', 'clsPrefix']);
7758
7759 var activeKey = void 0;
7760 if (accordion) {
7761 activeKey = propsActiveKey != null ? propsActiveKey : this.state.activeKey;
7762 others.role = others.role || 'tablist';
7763 }
7764
7765 var classes = {};
7766 classes['' + clsPrefix] = true;
7767
7768 return _react2["default"].createElement(
7769 'div',
7770 _extends({}, others, {
7771 className: (0, _classnames2["default"])(className, classes)
7772 }),
7773 _react2["default"].Children.map(children, function (child) {
7774 if (!_react2["default"].isValidElement(child)) {
7775 return child;
7776 }
7777 var childProps = {
7778 style: child.props.style
7779 };
7780
7781 if (accordion) {
7782 _extends(childProps, {
7783 headerRole: 'tab',
7784 panelRole: 'tabpanel',
7785 collapsible: true,
7786 expanded: child.props.eventKey === activeKey,
7787 onSelect: (0, _tinperBeeCore.createChainedFunction)(_this2.handleSelect, child.props.onSelect)
7788 });
7789 }
7790
7791 return (0, _react.cloneElement)(child, childProps);
7792 })
7793 );
7794 };
7795
7796 return PanelGroup;
7797 }(_react2["default"].Component);
7798
7799 PanelGroup.propTypes = propTypes;
7800 PanelGroup.defaultProps = defaultProps;
7801
7802 exports["default"] = PanelGroup;
7803 module.exports = exports['default'];
7804
7805/***/ }),
7806/* 82 */
7807/***/ (function(module, exports, __webpack_require__) {
7808
7809 'use strict';
7810
7811 Object.defineProperty(exports, "__esModule", {
7812 value: true
7813 });
7814
7815 var _Button = __webpack_require__(83);
7816
7817 var _Button2 = _interopRequireDefault(_Button);
7818
7819 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
7820
7821 exports["default"] = _Button2["default"];
7822 module.exports = exports['default'];
7823
7824/***/ }),
7825/* 83 */
7826/***/ (function(module, exports, __webpack_require__) {
7827
7828 'use strict';
7829
7830 Object.defineProperty(exports, "__esModule", {
7831 value: true
7832 });
7833
7834 var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
7835
7836 var _react = __webpack_require__(4);
7837
7838 var _react2 = _interopRequireDefault(_react);
7839
7840 var _reactDom = __webpack_require__(12);
7841
7842 var _reactDom2 = _interopRequireDefault(_reactDom);
7843
7844 var _propTypes = __webpack_require__(5);
7845
7846 var _propTypes2 = _interopRequireDefault(_propTypes);
7847
7848 var _classnames = __webpack_require__(3);
7849
7850 var _classnames2 = _interopRequireDefault(_classnames);
7851
7852 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
7853
7854 function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
7855
7856 function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
7857
7858 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7859
7860 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
7861
7862 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
7863
7864 var propTypes = {
7865 /**
7866 * @title 尺寸
7867 */
7868 size: _propTypes2["default"].oneOf(['sm', 'md', 'xg', 'lg']),
7869 /**
7870 * @title 样式
7871 */
7872 style: _propTypes2["default"].object,
7873 /**
7874 * @title 形状
7875 */
7876 shape: _propTypes2["default"].oneOf(['block', 'round', 'border', 'squared', 'floating', 'pillRight', 'pillLeft', 'icon']),
7877
7878 bordered: _propTypes2["default"].bool,
7879 /**
7880 * @title 类型
7881 */
7882 colors: _propTypes2["default"].oneOf(['primary', 'secondary', 'accent', 'success', 'info', 'warning', 'danger', 'dark', 'light', 'default']),
7883 /**
7884 * @title 是否禁用
7885 * @veIgnore
7886 */
7887 disabled: _propTypes2["default"].bool,
7888 /**
7889 * @title 类名
7890 * @veIgnore
7891 */
7892 className: _propTypes2["default"].string,
7893
7894 /**
7895 * @title <button> 的 type
7896 * @veIgnore
7897 */
7898 htmlType: _propTypes2["default"].oneOf(['submit', 'button', 'reset']),
7899 isSubmit: _propTypes2["default"].bool //是否作为form的提交按钮
7900 };
7901
7902 var defaultProps = {
7903 disabled: false,
7904 htmlType: 'button',
7905 clsPrefix: 'u-button',
7906 bordered: false,
7907 isSubmit: false
7908 };
7909
7910 var sizeMap = {
7911 sm: 'sm',
7912 md: 'md',
7913 xg: 'xg',
7914 lg: 'lg'
7915 },
7916 colorsMap = {
7917 primary: 'primary',
7918 secondary: 'secondary',
7919 accent: 'accent',
7920 success: 'success',
7921 info: 'info',
7922 warning: 'warning',
7923 danger: 'danger',
7924 dark: 'dark',
7925 light: 'light'
7926 },
7927 shapeMap = {
7928 block: 'block',
7929 round: 'round',
7930 border: 'border',
7931 squared: 'squared',
7932 floating: 'floating',
7933 pillRight: 'pill-right',
7934 pillLeft: 'pill-left',
7935 icon: 'icon'
7936 };
7937
7938 var Button = function (_Component) {
7939 _inherits(Button, _Component);
7940
7941 function Button(props) {
7942 _classCallCheck(this, Button);
7943
7944 return _possibleConstructorReturn(this, _Component.call(this, props));
7945 }
7946
7947 Button.prototype.render = function render() {
7948 var _props = this.props,
7949 colors = _props.colors,
7950 shape = _props.shape,
7951 disabled = _props.disabled,
7952 className = _props.className,
7953 size = _props.size,
7954 bordered = _props.bordered,
7955 children = _props.children,
7956 htmlType = _props.htmlType,
7957 clsPrefix = _props.clsPrefix,
7958 isSubmit = _props.isSubmit,
7959 others = _objectWithoutProperties(_props, ['colors', 'shape', 'disabled', 'className', 'size', 'bordered', 'children', 'htmlType', 'clsPrefix', 'isSubmit']);
7960
7961 var clsObj = {};
7962 if (className) {
7963 clsObj[className] = true;
7964 }
7965 if (sizeMap[size]) {
7966 clsObj[clsPrefix + '-' + sizeMap[size]] = true;
7967 }
7968
7969 if (shapeMap[shape]) {
7970 clsObj[clsPrefix + '-' + shapeMap[shape]] = true;
7971 }
7972 if (colorsMap[colors]) {
7973 clsObj[clsPrefix + '-' + colorsMap[colors]] = true;
7974 }
7975 if (bordered) {
7976 clsObj[clsPrefix + '-border'] = bordered;
7977 }
7978 var classes = (0, _classnames2["default"])(clsPrefix, clsObj);
7979 return _react2["default"].createElement(
7980 'button',
7981 _extends({
7982 type: htmlType,
7983 className: classes,
7984 disabled: disabled
7985 }, others),
7986 this.props.children
7987 );
7988 };
7989
7990 return Button;
7991 }(_react.Component);
7992
7993 Button.propTypes = propTypes;
7994 Button.defaultProps = defaultProps;
7995
7996 exports["default"] = Button;
7997 module.exports = exports['default'];
7998
7999/***/ }),
8000/* 84 */
8001/***/ (function(module, exports, __webpack_require__) {
8002
8003 'use strict';
8004
8005 Object.defineProperty(exports, "__esModule", {
8006 value: true
8007 });
8008
8009 var _react = __webpack_require__(4);
8010
8011 var _react2 = _interopRequireDefault(_react);
8012
8013 var _beeButton = __webpack_require__(82);
8014
8015 var _beeButton2 = _interopRequireDefault(_beeButton);
8016
8017 var _index = __webpack_require__(85);
8018
8019 var _index2 = _interopRequireDefault(_index);
8020
8021 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
8022
8023 function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
8024
8025 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8026
8027 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
8028
8029 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
8030 /**
8031 *
8032 * @title 基础拖拽
8033 * @description 将某个元素设置为可拖拽
8034 *
8035 */
8036
8037 var Demo1 = function (_Component) {
8038 _inherits(Demo1, _Component);
8039
8040 function Demo1() {
8041 var _temp, _this, _ret;
8042
8043 _classCallCheck(this, Demo1);
8044
8045 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
8046 args[_key] = arguments[_key];
8047 }
8048
8049 return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.onStart = function () {
8050 console.log('start');
8051 }, _this.onStop = function () {
8052 console.log('stop');
8053 }, _temp), _possibleConstructorReturn(_this, _ret);
8054 }
8055
8056 Demo1.prototype.render = function render() {
8057 return _react2['default'].createElement(
8058 'div',
8059 null,
8060 _react2['default'].createElement(
8061 _index2['default'],
8062 { onStart: this.onStart, onStop: this.onStop },
8063 _react2['default'].createElement(
8064 'div',
8065 { className: 'demo' },
8066 '\u6211\u53EF\u968F\u610F\u62D6\u62FD'
8067 )
8068 )
8069 );
8070 };
8071
8072 return Demo1;
8073 }(_react.Component);
8074
8075 exports['default'] = Demo1;
8076 module.exports = exports['default'];
8077
8078/***/ }),
8079/* 85 */
8080/***/ (function(module, exports, __webpack_require__) {
8081
8082 'use strict';
8083
8084 Object.defineProperty(exports, "__esModule", {
8085 value: true
8086 });
8087
8088 var _Dnd = __webpack_require__(86);
8089
8090 var _Dnd2 = _interopRequireDefault(_Dnd);
8091
8092 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
8093
8094 exports['default'] = _Dnd2['default'];
8095 module.exports = exports['default'];
8096
8097/***/ }),
8098/* 86 */
8099/***/ (function(module, exports, __webpack_require__) {
8100
8101 'use strict';
8102
8103 Object.defineProperty(exports, "__esModule", {
8104 value: true
8105 });
8106
8107 var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
8108
8109 var _react = __webpack_require__(4);
8110
8111 var _react2 = _interopRequireDefault(_react);
8112
8113 var _reactBeautifulDnd = __webpack_require__(87);
8114
8115 var _reactDraggable = __webpack_require__(186);
8116
8117 var _reactDraggable2 = _interopRequireDefault(_reactDraggable);
8118
8119 var _propTypes = __webpack_require__(5);
8120
8121 var _propTypes2 = _interopRequireDefault(_propTypes);
8122
8123 var _lodash = __webpack_require__(187);
8124
8125 var _lodash2 = _interopRequireDefault(_lodash);
8126
8127 var _SortList = __webpack_require__(188);
8128
8129 var _SortList2 = _interopRequireDefault(_SortList);
8130
8131 var _Between = __webpack_require__(190);
8132
8133 var _Between2 = _interopRequireDefault(_Between);
8134
8135 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
8136
8137 function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
8138
8139 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8140
8141 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
8142
8143 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
8144
8145 var propTypes = {
8146 onStart: _propTypes2['default'].func,
8147 onDrag: _propTypes2['default'].func,
8148 onStop: _propTypes2['default'].func,
8149 onDragUpdate: _propTypes2['default'].func,
8150 dropClass: _propTypes2['default'].string,
8151 dropOverClass: _propTypes2['default'].string,
8152 dragClass: _propTypes2['default'].string,
8153 dragingClass: _propTypes2['default'].string,
8154 draggedClass: _propTypes2['default'].string,
8155 className: _propTypes2['default'].string,
8156 style: _propTypes2['default'].object,
8157 list: _propTypes2['default'].array,
8158 otherList: _propTypes2['default'].array,
8159 type: _propTypes2['default'].oneOf(['vertical', 'horizontal', 'betweenVertical', 'betweenHorizontal']),
8160 showKey: _propTypes2['default'].string
8161
8162 };
8163 var defaultProps = {
8164 onStart: function onStart() {},
8165 onDrag: function onDrag() {},
8166 onStop: function onStop() {},
8167 onDragUpdate: function onDragUpdate() {},
8168 list: false,
8169 otherList: [],
8170 dropClass: '',
8171 dropOverClass: '',
8172 dragClass: '',
8173 dragingClass: '',
8174 draggedClass: '',
8175 type: 'vertical'
8176 };
8177
8178 var Dnd = function (_Component) {
8179 _inherits(Dnd, _Component);
8180
8181 function Dnd(props) {
8182 _classCallCheck(this, Dnd);
8183
8184 var _this = _possibleConstructorReturn(this, _Component.call(this, props));
8185
8186 _this.state = {
8187 items: _this.props.list || []
8188 };
8189 return _this;
8190 }
8191
8192 Dnd.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
8193 if (!(0, _lodash2['default'])(this.state.items, nextProps.list)) {
8194 this.setState({
8195 items: nextProps.list
8196 });
8197 }
8198 };
8199
8200 Dnd.prototype.render = function render() {
8201 var _this2 = this;
8202
8203 var self = this;
8204 var DndType = function DndType() {
8205 switch (_this2.props.type) {
8206 case 'vertical':
8207 return _react2['default'].createElement(_SortList2['default'], _this2.props);
8208 break;
8209 case 'horizontal':
8210 return _react2['default'].createElement(_SortList2['default'], _this2.props);
8211 break;
8212 case 'betweenVertical':
8213 return _react2['default'].createElement(_Between2['default'], _this2.props);
8214 break;
8215 case 'betweenHorizontal':
8216 return _react2['default'].createElement(_Between2['default'], _this2.props);
8217 break;
8218 default:
8219 return _react2['default'].createElement(_SortList2['default'], _this2.props);
8220 break;
8221 }
8222 };
8223 return _react2['default'].createElement(
8224 'div',
8225 null,
8226 self.state.items.length ? DndType() : _react2['default'].createElement(
8227 _reactDraggable2['default'],
8228 _extends({ defaultClassName: this.props.dragClass,
8229 defaultClassNameDragging: this.props.dragingClass,
8230 defaultClassNameDragged: this.props.draggedClass
8231 }, this.props),
8232 self.props.children
8233 )
8234 );
8235 };
8236
8237 return Dnd;
8238 }(_react.Component);
8239
8240 Dnd.propTypes = propTypes;
8241 Dnd.defaultProps = defaultProps;
8242 Dnd.Drag = _reactDraggable2['default'];
8243 Dnd.DragDropContext = _reactBeautifulDnd.DragDropContext;
8244 Dnd.Droppable = _reactBeautifulDnd.Droppable;
8245 Dnd.Draggable = _reactBeautifulDnd.Draggable;
8246 exports['default'] = Dnd;
8247 module.exports = exports['default'];
8248
8249/***/ }),
8250/* 87 */
8251/***/ (function(module, exports, __webpack_require__) {
8252
8253 /* WEBPACK VAR INJECTION */(function(process) {'use strict';
8254
8255 Object.defineProperty(exports, '__esModule', { value: true });
8256
8257 function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
8258
8259 var _extends = _interopDefault(__webpack_require__(88));
8260 var invariant = _interopDefault(__webpack_require__(127));
8261 var cssBoxModel = __webpack_require__(128);
8262 var _Object$keys = _interopDefault(__webpack_require__(129));
8263 var memoizeOne = _interopDefault(__webpack_require__(133));
8264 var redux = __webpack_require__(134);
8265 var _Object$assign = _interopDefault(__webpack_require__(89));
8266 var rafSchd = _interopDefault(__webpack_require__(138));
8267 var _inheritsLoose = _interopDefault(__webpack_require__(139));
8268 var React = __webpack_require__(4);
8269 var React__default = _interopDefault(React);
8270 var PropTypes = _interopDefault(__webpack_require__(5));
8271 var reactRedux = __webpack_require__(146);
8272 var reactMotion = __webpack_require__(172);
8273
8274 var vertical = {
8275 direction: 'vertical',
8276 line: 'y',
8277 crossAxisLine: 'x',
8278 start: 'top',
8279 end: 'bottom',
8280 size: 'height',
8281 crossAxisStart: 'left',
8282 crossAxisEnd: 'right',
8283 crossAxisSize: 'width'
8284 };
8285 var horizontal = {
8286 direction: 'horizontal',
8287 line: 'x',
8288 crossAxisLine: 'y',
8289 start: 'left',
8290 end: 'right',
8291 size: 'width',
8292 crossAxisStart: 'top',
8293 crossAxisEnd: 'bottom',
8294 crossAxisSize: 'height'
8295 };
8296
8297 var origin = {
8298 x: 0,
8299 y: 0
8300 };
8301 var add = function add(point1, point2) {
8302 return {
8303 x: point1.x + point2.x,
8304 y: point1.y + point2.y
8305 };
8306 };
8307 var subtract = function subtract(point1, point2) {
8308 return {
8309 x: point1.x - point2.x,
8310 y: point1.y - point2.y
8311 };
8312 };
8313 var isEqual = function isEqual(point1, point2) {
8314 return point1.x === point2.x && point1.y === point2.y;
8315 };
8316 var negate = function negate(point) {
8317 return {
8318 x: point.x !== 0 ? -point.x : 0,
8319 y: point.y !== 0 ? -point.y : 0
8320 };
8321 };
8322 var absolute = function absolute(point) {
8323 return {
8324 x: Math.abs(point.x),
8325 y: Math.abs(point.y)
8326 };
8327 };
8328 var patch = function patch(line, value, otherValue) {
8329 var _ref;
8330
8331 if (otherValue === void 0) {
8332 otherValue = 0;
8333 }
8334
8335 return _ref = {}, _ref[line] = value, _ref[line === 'x' ? 'y' : 'x'] = otherValue, _ref;
8336 };
8337 var distance = function distance(point1, point2) {
8338 return Math.sqrt(Math.pow(point2.x - point1.x, 2) + Math.pow(point2.y - point1.y, 2));
8339 };
8340 var closest = function closest(target, points) {
8341 return Math.min.apply(Math, points.map(function (point) {
8342 return distance(target, point);
8343 }));
8344 };
8345 var apply = function apply(fn) {
8346 return function (point) {
8347 return {
8348 x: fn(point.x),
8349 y: fn(point.y)
8350 };
8351 };
8352 };
8353
8354 var offsetByPosition = function offsetByPosition(spacing, point) {
8355 return {
8356 top: spacing.top + point.y,
8357 left: spacing.left + point.x,
8358 bottom: spacing.bottom + point.y,
8359 right: spacing.right + point.x
8360 };
8361 };
8362 var expandByPosition = function expandByPosition(spacing, position) {
8363 return {
8364 top: spacing.top - position.y,
8365 left: spacing.left - position.x,
8366 right: spacing.right + position.x,
8367 bottom: spacing.bottom + position.y
8368 };
8369 };
8370 var getCorners = function getCorners(spacing) {
8371 return [{
8372 x: spacing.left,
8373 y: spacing.top
8374 }, {
8375 x: spacing.right,
8376 y: spacing.top
8377 }, {
8378 x: spacing.left,
8379 y: spacing.bottom
8380 }, {
8381 x: spacing.right,
8382 y: spacing.bottom
8383 }];
8384 };
8385
8386 var getMaxScroll = (function (_ref) {
8387 var scrollHeight = _ref.scrollHeight,
8388 scrollWidth = _ref.scrollWidth,
8389 height = _ref.height,
8390 width = _ref.width;
8391 var maxScroll = subtract({
8392 x: scrollWidth,
8393 y: scrollHeight
8394 }, {
8395 x: width,
8396 y: height
8397 });
8398 var adjustedMaxScroll = {
8399 x: Math.max(0, maxScroll.x),
8400 y: Math.max(0, maxScroll.y)
8401 };
8402 return adjustedMaxScroll;
8403 });
8404
8405 var clip = function clip(frame, subject) {
8406 var result = cssBoxModel.getRect({
8407 top: Math.max(subject.top, frame.top),
8408 right: Math.min(subject.right, frame.right),
8409 bottom: Math.min(subject.bottom, frame.bottom),
8410 left: Math.max(subject.left, frame.left)
8411 });
8412
8413 if (result.width <= 0 || result.height <= 0) {
8414 return null;
8415 }
8416
8417 return result;
8418 };
8419 var getDroppableDimension = function getDroppableDimension(_ref) {
8420 var descriptor = _ref.descriptor,
8421 isEnabled = _ref.isEnabled,
8422 direction = _ref.direction,
8423 client = _ref.client,
8424 page = _ref.page,
8425 closest$$1 = _ref.closest;
8426
8427 var scrollable = function () {
8428 if (!closest$$1) {
8429 return null;
8430 }
8431
8432 var maxScroll = getMaxScroll({
8433 scrollHeight: closest$$1.scrollHeight,
8434 scrollWidth: closest$$1.scrollWidth,
8435 height: closest$$1.client.paddingBox.height,
8436 width: closest$$1.client.paddingBox.width
8437 });
8438 return {
8439 framePageMarginBox: closest$$1.page.marginBox,
8440 shouldClipSubject: closest$$1.shouldClipSubject,
8441 scroll: {
8442 initial: closest$$1.scroll,
8443 current: closest$$1.scroll,
8444 max: maxScroll,
8445 diff: {
8446 value: origin,
8447 displacement: origin
8448 }
8449 }
8450 };
8451 }();
8452
8453 var subjectPageMarginBox = page.marginBox;
8454 var clippedPageMarginBox = scrollable && scrollable.shouldClipSubject ? clip(scrollable.framePageMarginBox, subjectPageMarginBox) : subjectPageMarginBox;
8455 var viewport = {
8456 closestScrollable: scrollable,
8457 subjectPageMarginBox: subjectPageMarginBox,
8458 clippedPageMarginBox: clippedPageMarginBox
8459 };
8460 var dimension = {
8461 descriptor: descriptor,
8462 axis: direction === 'vertical' ? vertical : horizontal,
8463 isEnabled: isEnabled,
8464 client: client,
8465 page: page,
8466 viewport: viewport
8467 };
8468 return dimension;
8469 };
8470 var scrollDroppable = function scrollDroppable(droppable, newScroll) {
8471 !droppable.viewport.closestScrollable ? process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0;
8472 var scrollable = droppable.viewport.closestScrollable;
8473 var framePageMarginBox = scrollable.framePageMarginBox;
8474 var scrollDiff = subtract(newScroll, scrollable.scroll.initial);
8475 var scrollDisplacement = negate(scrollDiff);
8476 var closestScrollable = {
8477 framePageMarginBox: scrollable.framePageMarginBox,
8478 shouldClipSubject: scrollable.shouldClipSubject,
8479 scroll: {
8480 initial: scrollable.scroll.initial,
8481 current: newScroll,
8482 diff: {
8483 value: scrollDiff,
8484 displacement: scrollDisplacement
8485 },
8486 max: scrollable.scroll.max
8487 }
8488 };
8489 var displacedSubject = offsetByPosition(droppable.viewport.subjectPageMarginBox, scrollDisplacement);
8490 var clippedPageMarginBox = closestScrollable.shouldClipSubject ? clip(framePageMarginBox, displacedSubject) : cssBoxModel.getRect(displacedSubject);
8491 var viewport = {
8492 closestScrollable: closestScrollable,
8493 subjectPageMarginBox: droppable.viewport.subjectPageMarginBox,
8494 clippedPageMarginBox: clippedPageMarginBox
8495 };
8496
8497 var result = _extends({}, droppable, {
8498 viewport: viewport
8499 });
8500
8501 return result;
8502 };
8503
8504 var toDroppableMap = memoizeOne(function (droppables) {
8505 return droppables.reduce(function (previous, current) {
8506 previous[current.descriptor.id] = current;
8507 return previous;
8508 }, {});
8509 });
8510 var toDraggableMap = memoizeOne(function (draggables) {
8511 return draggables.reduce(function (previous, current) {
8512 previous[current.descriptor.id] = current;
8513 return previous;
8514 }, {});
8515 });
8516 var toDroppableList = memoizeOne(function (droppables) {
8517 return _Object$keys(droppables).map(function (id) {
8518 return droppables[id];
8519 });
8520 });
8521 var toDraggableList = memoizeOne(function (draggables) {
8522 return _Object$keys(draggables).map(function (id) {
8523 return draggables[id];
8524 });
8525 });
8526
8527 var getDraggablesInsideDroppable = memoizeOne(function (droppable, draggables) {
8528 return toDraggableList(draggables).filter(function (draggable) {
8529 return droppable.descriptor.id === draggable.descriptor.droppableId;
8530 }).sort(function (a, b) {
8531 return a.descriptor.index - b.descriptor.index;
8532 });
8533 });
8534
8535 var isWithin = (function (lowerBound, upperBound) {
8536 return function (value) {
8537 return value <= upperBound && value >= lowerBound;
8538 };
8539 });
8540
8541 var isPositionInFrame = (function (frame) {
8542 var isWithinVertical = isWithin(frame.top, frame.bottom);
8543 var isWithinHorizontal = isWithin(frame.left, frame.right);
8544 return function (point) {
8545 return isWithinVertical(point.y) && isWithinVertical(point.y) && isWithinHorizontal(point.x) && isWithinHorizontal(point.x);
8546 };
8547 });
8548
8549 var getRequiredGrowth = memoizeOne(function (draggable, draggables, droppable) {
8550 var getResult = function getResult(existingSpace) {
8551 var requiredSpace = draggable.page.marginBox[droppable.axis.size];
8552
8553 if (requiredSpace <= existingSpace) {
8554 return null;
8555 }
8556
8557 var requiredGrowth = patch(droppable.axis.line, requiredSpace - existingSpace);
8558 return requiredGrowth;
8559 };
8560
8561 var dimensions = getDraggablesInsideDroppable(droppable, draggables);
8562
8563 if (!dimensions.length) {
8564 var _existingSpace = droppable.page.marginBox[droppable.axis.size];
8565 return getResult(_existingSpace);
8566 }
8567
8568 var endOfDraggables = dimensions[dimensions.length - 1].page.marginBox[droppable.axis.end];
8569 var endOfDroppable = droppable.page.marginBox[droppable.axis.end];
8570 var existingSpace = endOfDroppable - endOfDraggables;
8571 return getResult(existingSpace);
8572 });
8573 var getWithGrowth = memoizeOne(function (area, growth) {
8574 return cssBoxModel.getRect(expandByPosition(area, growth));
8575 });
8576
8577 var getClippedRectWithPlaceholder = function getClippedRectWithPlaceholder(_ref) {
8578 var draggable = _ref.draggable,
8579 draggables = _ref.draggables,
8580 droppable = _ref.droppable,
8581 previousDroppableOverId = _ref.previousDroppableOverId;
8582 var isHome = draggable.descriptor.droppableId === droppable.descriptor.id;
8583 var wasOver = Boolean(previousDroppableOverId && previousDroppableOverId === droppable.descriptor.id);
8584 var clippedPageMarginBox = droppable.viewport.clippedPageMarginBox;
8585
8586 if (!clippedPageMarginBox) {
8587 return clippedPageMarginBox;
8588 }
8589
8590 if (isHome || !wasOver) {
8591 return clippedPageMarginBox;
8592 }
8593
8594 var requiredGrowth = getRequiredGrowth(draggable, draggables, droppable);
8595
8596 if (!requiredGrowth) {
8597 return clippedPageMarginBox;
8598 }
8599
8600 var subjectWithGrowth = getWithGrowth(clippedPageMarginBox, requiredGrowth);
8601 var closestScrollable = droppable.viewport.closestScrollable;
8602
8603 if (!closestScrollable) {
8604 return subjectWithGrowth;
8605 }
8606
8607 if (!closestScrollable.shouldClipSubject) {
8608 return subjectWithGrowth;
8609 }
8610
8611 return clip(closestScrollable.framePageMarginBox, subjectWithGrowth);
8612 };
8613
8614 var getDroppableOver = (function (_ref2) {
8615 var target = _ref2.target,
8616 draggable = _ref2.draggable,
8617 draggables = _ref2.draggables,
8618 droppables = _ref2.droppables,
8619 previousDroppableOverId = _ref2.previousDroppableOverId;
8620 var maybe = toDroppableList(droppables).filter(function (droppable) {
8621 return droppable.isEnabled;
8622 }).find(function (droppable) {
8623 var withPlaceholder = getClippedRectWithPlaceholder({
8624 draggable: draggable,
8625 draggables: draggables,
8626 droppable: droppable,
8627 previousDroppableOverId: previousDroppableOverId
8628 });
8629
8630 if (!withPlaceholder) {
8631 return false;
8632 }
8633
8634 return isPositionInFrame(withPlaceholder)(target);
8635 });
8636 return maybe ? maybe.descriptor.id : null;
8637 });
8638
8639 var noMovement = {
8640 displaced: [],
8641 amount: origin,
8642 isBeyondStartPosition: false
8643 };
8644 var noImpact = {
8645 movement: noMovement,
8646 direction: null,
8647 destination: null
8648 };
8649
8650 var getDisplacementMap = memoizeOne(function (displaced) {
8651 return displaced.reduce(function (map, displacement) {
8652 map[displacement.draggableId] = displacement;
8653 return map;
8654 }, {});
8655 });
8656
8657 var isPartiallyVisibleThroughFrame = (function (frame) {
8658 var isWithinVertical = isWithin(frame.top, frame.bottom);
8659 var isWithinHorizontal = isWithin(frame.left, frame.right);
8660 return function (subject) {
8661 var isContained = isWithinVertical(subject.top) && isWithinVertical(subject.bottom) && isWithinHorizontal(subject.left) && isWithinHorizontal(subject.right);
8662
8663 if (isContained) {
8664 return true;
8665 }
8666
8667 var isPartiallyVisibleVertically = isWithinVertical(subject.top) || isWithinVertical(subject.bottom);
8668 var isPartiallyVisibleHorizontally = isWithinHorizontal(subject.left) || isWithinHorizontal(subject.right);
8669 var isPartiallyContained = isPartiallyVisibleVertically && isPartiallyVisibleHorizontally;
8670
8671 if (isPartiallyContained) {
8672 return true;
8673 }
8674
8675 var isBiggerVertically = subject.top < frame.top && subject.bottom > frame.bottom;
8676 var isBiggerHorizontally = subject.left < frame.left && subject.right > frame.right;
8677 var isTargetBiggerThanFrame = isBiggerVertically && isBiggerHorizontally;
8678
8679 if (isTargetBiggerThanFrame) {
8680 return true;
8681 }
8682
8683 var isTargetBiggerOnOneAxis = isBiggerVertically && isPartiallyVisibleHorizontally || isBiggerHorizontally && isPartiallyVisibleVertically;
8684 return isTargetBiggerOnOneAxis;
8685 };
8686 });
8687
8688 var isTotallyVisibleThroughFrame = (function (frame) {
8689 var isWithinVertical = isWithin(frame.top, frame.bottom);
8690 var isWithinHorizontal = isWithin(frame.left, frame.right);
8691 return function (subject) {
8692 var isContained = isWithinVertical(subject.top) && isWithinVertical(subject.bottom) && isWithinHorizontal(subject.left) && isWithinHorizontal(subject.right);
8693 return isContained;
8694 };
8695 });
8696
8697 var isVisible = function isVisible(_ref) {
8698 var target = _ref.target,
8699 destination = _ref.destination,
8700 viewport = _ref.viewport,
8701 isVisibleThroughFrameFn = _ref.isVisibleThroughFrameFn;
8702 var displacement = destination.viewport.closestScrollable ? destination.viewport.closestScrollable.scroll.diff.displacement : origin;
8703 var withDisplacement = offsetByPosition(target, displacement);
8704
8705 if (!destination.viewport.clippedPageMarginBox) {
8706 return false;
8707 }
8708
8709 var isVisibleInDroppable = isVisibleThroughFrameFn(destination.viewport.clippedPageMarginBox)(withDisplacement);
8710 var isVisibleInViewport = isVisibleThroughFrameFn(viewport)(withDisplacement);
8711 return isVisibleInDroppable && isVisibleInViewport;
8712 };
8713
8714 var isPartiallyVisible = function isPartiallyVisible(_ref2) {
8715 var target = _ref2.target,
8716 destination = _ref2.destination,
8717 viewport = _ref2.viewport;
8718 return isVisible({
8719 target: target,
8720 destination: destination,
8721 viewport: viewport,
8722 isVisibleThroughFrameFn: isPartiallyVisibleThroughFrame
8723 });
8724 };
8725 var isTotallyVisible = function isTotallyVisible(_ref3) {
8726 var target = _ref3.target,
8727 destination = _ref3.destination,
8728 viewport = _ref3.viewport;
8729 return isVisible({
8730 target: target,
8731 destination: destination,
8732 viewport: viewport,
8733 isVisibleThroughFrameFn: isTotallyVisibleThroughFrame
8734 });
8735 };
8736
8737 var getDisplacement = (function (_ref) {
8738 var draggable = _ref.draggable,
8739 destination = _ref.destination,
8740 previousImpact = _ref.previousImpact,
8741 viewport = _ref.viewport;
8742 var id = draggable.descriptor.id;
8743 var map = getDisplacementMap(previousImpact.movement.displaced);
8744 var isVisible = isPartiallyVisible({
8745 target: draggable.page.marginBox,
8746 destination: destination,
8747 viewport: viewport
8748 });
8749
8750 var shouldAnimate = function () {
8751 if (!isVisible) {
8752 return false;
8753 }
8754
8755 var previous = map[id];
8756
8757 if (!previous) {
8758 return true;
8759 }
8760
8761 return previous.shouldAnimate;
8762 }();
8763
8764 var displacement = {
8765 draggableId: id,
8766 isVisible: isVisible,
8767 shouldAnimate: shouldAnimate
8768 };
8769 return displacement;
8770 });
8771
8772 var withDroppableScroll = (function (droppable, point) {
8773 var closestScrollable = droppable.viewport.closestScrollable;
8774
8775 if (!closestScrollable) {
8776 return point;
8777 }
8778
8779 return add(point, closestScrollable.scroll.diff.value);
8780 });
8781
8782 var inHomeList = (function (_ref) {
8783 var pageBorderBoxCenter = _ref.pageBorderBoxCenter,
8784 draggable = _ref.draggable,
8785 home = _ref.home,
8786 insideHome = _ref.insideHome,
8787 previousImpact = _ref.previousImpact,
8788 viewport = _ref.viewport;
8789 var axis = home.axis;
8790 var originalCenter = draggable.page.borderBox.center;
8791 var currentCenter = withDroppableScroll(home, pageBorderBoxCenter);
8792 var isBeyondStartPosition = currentCenter[axis.line] - originalCenter[axis.line] > 0;
8793 var amount = patch(axis.line, draggable.client.marginBox[axis.size]);
8794 var displaced = insideHome.filter(function (child) {
8795 if (child === draggable) {
8796 return false;
8797 }
8798
8799 var borderBox = child.page.borderBox;
8800
8801 if (isBeyondStartPosition) {
8802 if (borderBox.center[axis.line] < originalCenter[axis.line]) {
8803 return false;
8804 }
8805
8806 return currentCenter[axis.line] > borderBox[axis.start];
8807 }
8808
8809 if (originalCenter[axis.line] < borderBox.center[axis.line]) {
8810 return false;
8811 }
8812
8813 return currentCenter[axis.line] < borderBox[axis.end];
8814 }).map(function (dimension) {
8815 return getDisplacement({
8816 draggable: dimension,
8817 destination: home,
8818 previousImpact: previousImpact,
8819 viewport: viewport.frame
8820 });
8821 });
8822 var ordered = isBeyondStartPosition ? displaced.reverse() : displaced;
8823
8824 var index = function () {
8825 var startIndex = draggable.descriptor.index;
8826 var length = ordered.length;
8827
8828 if (!length) {
8829 return startIndex;
8830 }
8831
8832 if (isBeyondStartPosition) {
8833 return startIndex + length;
8834 }
8835
8836 return startIndex - length;
8837 }();
8838
8839 var movement = {
8840 amount: amount,
8841 displaced: ordered,
8842 isBeyondStartPosition: isBeyondStartPosition
8843 };
8844 var impact = {
8845 movement: movement,
8846 direction: axis.direction,
8847 destination: {
8848 droppableId: home.descriptor.id,
8849 index: index
8850 }
8851 };
8852 return impact;
8853 });
8854
8855 var inForeignList = (function (_ref) {
8856 var pageBorderBoxCenter = _ref.pageBorderBoxCenter,
8857 draggable = _ref.draggable,
8858 destination = _ref.destination,
8859 insideDestination = _ref.insideDestination,
8860 previousImpact = _ref.previousImpact,
8861 viewport = _ref.viewport;
8862 var axis = destination.axis;
8863 var currentCenter = withDroppableScroll(destination, pageBorderBoxCenter);
8864 var displaced = insideDestination.filter(function (child) {
8865 var threshold = child.page.borderBox[axis.end];
8866 return threshold > currentCenter[axis.line];
8867 }).map(function (dimension) {
8868 return getDisplacement({
8869 draggable: dimension,
8870 destination: destination,
8871 previousImpact: previousImpact,
8872 viewport: viewport.frame
8873 });
8874 });
8875 var newIndex = insideDestination.length - displaced.length;
8876 var movement = {
8877 amount: patch(axis.line, draggable.page.marginBox[axis.size]),
8878 displaced: displaced,
8879 isBeyondStartPosition: false
8880 };
8881 var impact = {
8882 movement: movement,
8883 direction: axis.direction,
8884 destination: {
8885 droppableId: destination.descriptor.id,
8886 index: newIndex
8887 }
8888 };
8889 return impact;
8890 });
8891
8892 var getDragImpact = (function (_ref) {
8893 var pageBorderBoxCenter = _ref.pageBorderBoxCenter,
8894 draggable = _ref.draggable,
8895 draggables = _ref.draggables,
8896 droppables = _ref.droppables,
8897 previousImpact = _ref.previousImpact,
8898 viewport = _ref.viewport;
8899 var previousDroppableOverId = previousImpact.destination && previousImpact.destination.droppableId;
8900 var destinationId = getDroppableOver({
8901 target: pageBorderBoxCenter,
8902 draggable: draggable,
8903 draggables: draggables,
8904 droppables: droppables,
8905 previousDroppableOverId: previousDroppableOverId
8906 });
8907
8908 if (!destinationId) {
8909 return noImpact;
8910 }
8911
8912 var destination = droppables[destinationId];
8913
8914 if (!destination.isEnabled) {
8915 return noImpact;
8916 }
8917
8918 var home = droppables[draggable.descriptor.droppableId];
8919 var isWithinHomeDroppable = home.descriptor.id === destinationId;
8920 var insideDestination = getDraggablesInsideDroppable(destination, draggables);
8921
8922 if (isWithinHomeDroppable) {
8923 return inHomeList({
8924 pageBorderBoxCenter: pageBorderBoxCenter,
8925 draggable: draggable,
8926 home: home,
8927 insideHome: insideDestination,
8928 previousImpact: previousImpact || noImpact,
8929 viewport: viewport
8930 });
8931 }
8932
8933 return inForeignList({
8934 pageBorderBoxCenter: pageBorderBoxCenter,
8935 draggable: draggable,
8936 destination: destination,
8937 insideDestination: insideDestination,
8938 previousImpact: previousImpact || noImpact,
8939 viewport: viewport
8940 });
8941 });
8942
8943 var getHomeLocation = (function (critical) {
8944 return {
8945 index: critical.draggable.index,
8946 droppableId: critical.droppable.id
8947 };
8948 });
8949
8950 var getSafeClipped = function getSafeClipped(droppable) {
8951 var rect = droppable.viewport.clippedPageMarginBox;
8952 !rect ? process.env.NODE_ENV !== "production" ? invariant(false, 'Cannot get clipped area from droppable') : invariant(false) : void 0;
8953 return rect;
8954 };
8955
8956 var getBestCrossAxisDroppable = (function (_ref) {
8957 var isMovingForward = _ref.isMovingForward,
8958 pageBorderBoxCenter = _ref.pageBorderBoxCenter,
8959 source = _ref.source,
8960 droppables = _ref.droppables,
8961 viewport = _ref.viewport;
8962 var sourceClipped = source.viewport.clippedPageMarginBox;
8963
8964 if (!sourceClipped) {
8965 return null;
8966 }
8967
8968 var axis = source.axis;
8969 var isBetweenSourceClipped = isWithin(sourceClipped[axis.start], sourceClipped[axis.end]);
8970 var candidates = toDroppableList(droppables).filter(function (droppable) {
8971 return droppable !== source;
8972 }).filter(function (droppable) {
8973 return droppable.isEnabled;
8974 }).filter(function (droppable) {
8975 var clippedPageMarginBox = droppable.viewport.clippedPageMarginBox;
8976
8977 if (!clippedPageMarginBox) {
8978 return false;
8979 }
8980
8981 return isPartiallyVisibleThroughFrame(viewport.frame)(clippedPageMarginBox);
8982 }).filter(function (droppable) {
8983 var targetClipped = getSafeClipped(droppable);
8984
8985 if (isMovingForward) {
8986 return sourceClipped[axis.crossAxisEnd] < targetClipped[axis.crossAxisEnd];
8987 }
8988
8989 return targetClipped[axis.crossAxisStart] < sourceClipped[axis.crossAxisStart];
8990 }).filter(function (droppable) {
8991 var targetClipped = getSafeClipped(droppable);
8992 var isBetweenDestinationClipped = isWithin(targetClipped[axis.start], targetClipped[axis.end]);
8993 return isBetweenSourceClipped(targetClipped[axis.start]) || isBetweenSourceClipped(targetClipped[axis.end]) || isBetweenDestinationClipped(sourceClipped[axis.start]) || isBetweenDestinationClipped(sourceClipped[axis.end]);
8994 }).sort(function (a, b) {
8995 var first = getSafeClipped(a)[axis.crossAxisStart];
8996 var second = getSafeClipped(b)[axis.crossAxisStart];
8997
8998 if (isMovingForward) {
8999 return first - second;
9000 }
9001
9002 return second - first;
9003 }).filter(function (droppable, index, array) {
9004 return getSafeClipped(droppable)[axis.crossAxisStart] === getSafeClipped(array[0])[axis.crossAxisStart];
9005 });
9006
9007 if (!candidates.length) {
9008 return null;
9009 }
9010
9011 if (candidates.length === 1) {
9012 return candidates[0];
9013 }
9014
9015 var contains = candidates.filter(function (droppable) {
9016 var isWithinDroppable = isWithin(getSafeClipped(droppable)[axis.start], getSafeClipped(droppable)[axis.end]);
9017 return isWithinDroppable(pageBorderBoxCenter[axis.line]);
9018 });
9019
9020 if (contains.length === 1) {
9021 return contains[0];
9022 }
9023
9024 if (contains.length > 1) {
9025 return contains.sort(function (a, b) {
9026 return getSafeClipped(a)[axis.start] - getSafeClipped(b)[axis.start];
9027 })[0];
9028 }
9029
9030 return candidates.sort(function (a, b) {
9031 var first = closest(pageBorderBoxCenter, getCorners(getSafeClipped(a)));
9032 var second = closest(pageBorderBoxCenter, getCorners(getSafeClipped(b)));
9033
9034 if (first !== second) {
9035 return first - second;
9036 }
9037
9038 return getSafeClipped(a)[axis.start] - getSafeClipped(b)[axis.start];
9039 })[0];
9040 });
9041
9042 var withDroppableDisplacement = (function (droppable, point) {
9043 var closestScrollable = droppable.viewport.closestScrollable;
9044
9045 if (!closestScrollable) {
9046 return point;
9047 }
9048
9049 return add(point, closestScrollable.scroll.diff.displacement);
9050 });
9051
9052 var getClosestDraggable = (function (_ref) {
9053 var axis = _ref.axis,
9054 viewport = _ref.viewport,
9055 pageBorderBoxCenter = _ref.pageBorderBoxCenter,
9056 destination = _ref.destination,
9057 insideDestination = _ref.insideDestination;
9058
9059 if (!insideDestination.length) {
9060 return null;
9061 }
9062
9063 var result = insideDestination.filter(function (draggable) {
9064 return isTotallyVisible({
9065 target: draggable.page.borderBox,
9066 destination: destination,
9067 viewport: viewport.frame
9068 });
9069 }).sort(function (a, b) {
9070 var distanceToA = distance(pageBorderBoxCenter, withDroppableDisplacement(destination, a.page.borderBox.center));
9071 var distanceToB = distance(pageBorderBoxCenter, withDroppableDisplacement(destination, b.page.borderBox.center));
9072
9073 if (distanceToA < distanceToB) {
9074 return -1;
9075 }
9076
9077 if (distanceToB < distanceToA) {
9078 return 1;
9079 }
9080
9081 return a.page.borderBox[axis.start] - b.page.borderBox[axis.start];
9082 });
9083 return result.length ? result[0] : null;
9084 });
9085
9086 var moveToEdge = (function (_ref) {
9087 var source = _ref.source,
9088 sourceEdge = _ref.sourceEdge,
9089 destination = _ref.destination,
9090 destinationEdge = _ref.destinationEdge,
9091 destinationAxis = _ref.destinationAxis;
9092
9093 var getCorner = function getCorner(area) {
9094 return patch(destinationAxis.line, area[destinationAxis[destinationEdge]], area[destinationAxis.crossAxisStart]);
9095 };
9096
9097 var corner = getCorner(destination);
9098 var centerDiff = absolute(subtract(source.center, getCorner(source)));
9099 var signed = patch(destinationAxis.line, (sourceEdge === 'end' ? -1 : 1) * centerDiff[destinationAxis.line], centerDiff[destinationAxis.crossAxisLine]);
9100 return add(corner, signed);
9101 });
9102
9103 var toHomeList = (function (_ref) {
9104 var amount = _ref.amount,
9105 homeIndex = _ref.homeIndex,
9106 movingRelativeTo = _ref.movingRelativeTo,
9107 insideDestination = _ref.insideDestination,
9108 draggable = _ref.draggable,
9109 destination = _ref.destination,
9110 previousImpact = _ref.previousImpact,
9111 viewport = _ref.viewport;
9112 var axis = destination.axis;
9113 var targetIndex = insideDestination.indexOf(movingRelativeTo);
9114 !(targetIndex !== -1) ? process.env.NODE_ENV !== "production" ? invariant(false, 'Unable to find target in destination droppable') : invariant(false) : void 0;
9115
9116 if (targetIndex === homeIndex) {
9117 var _newCenter = draggable.page.borderBox.center;
9118 var _newImpact = {
9119 movement: {
9120 displaced: [],
9121 amount: amount,
9122 isBeyondStartPosition: false
9123 },
9124 direction: destination.axis.direction,
9125 destination: {
9126 droppableId: destination.descriptor.id,
9127 index: homeIndex
9128 }
9129 };
9130 return {
9131 pageBorderBoxCenter: withDroppableDisplacement(destination, _newCenter),
9132 impact: _newImpact
9133 };
9134 }
9135
9136 var isMovingPastOriginalIndex = targetIndex > homeIndex;
9137 var edge = isMovingPastOriginalIndex ? 'end' : 'start';
9138 var newCenter = moveToEdge({
9139 source: draggable.page.borderBox,
9140 sourceEdge: edge,
9141 destination: isMovingPastOriginalIndex ? movingRelativeTo.page.borderBox : movingRelativeTo.page.marginBox,
9142 destinationEdge: edge,
9143 destinationAxis: axis
9144 });
9145
9146 var modified = function () {
9147 if (!isMovingPastOriginalIndex) {
9148 return insideDestination.slice(targetIndex, homeIndex);
9149 }
9150
9151 var from = homeIndex + 1;
9152 var to = targetIndex + 1;
9153 return insideDestination.slice(from, to).reverse();
9154 }();
9155
9156 var displaced = modified.map(function (dimension) {
9157 return getDisplacement({
9158 draggable: dimension,
9159 destination: destination,
9160 previousImpact: previousImpact,
9161 viewport: viewport.frame
9162 });
9163 });
9164 var newImpact = {
9165 movement: {
9166 displaced: displaced,
9167 amount: amount,
9168 isBeyondStartPosition: isMovingPastOriginalIndex
9169 },
9170 direction: axis.direction,
9171 destination: {
9172 droppableId: destination.descriptor.id,
9173 index: targetIndex
9174 }
9175 };
9176 return {
9177 pageBorderBoxCenter: withDroppableDisplacement(destination, newCenter),
9178 impact: newImpact
9179 };
9180 });
9181
9182 var toForeignList = (function (_ref) {
9183 var amount = _ref.amount,
9184 pageBorderBoxCenter = _ref.pageBorderBoxCenter,
9185 movingRelativeTo = _ref.movingRelativeTo,
9186 insideDestination = _ref.insideDestination,
9187 draggable = _ref.draggable,
9188 destination = _ref.destination,
9189 previousImpact = _ref.previousImpact,
9190 viewport = _ref.viewport;
9191 var axis = destination.axis;
9192 var isGoingBeforeTarget = Boolean(movingRelativeTo && pageBorderBoxCenter[destination.axis.line] < movingRelativeTo.page.borderBox.center[destination.axis.line]);
9193
9194 if (!movingRelativeTo) {
9195 var _newCenter = moveToEdge({
9196 source: draggable.page.borderBox,
9197 sourceEdge: 'start',
9198 destination: destination.page.contentBox,
9199 destinationEdge: 'start',
9200 destinationAxis: axis
9201 });
9202
9203 var _newImpact = {
9204 movement: {
9205 displaced: [],
9206 amount: amount,
9207 isBeyondStartPosition: false
9208 },
9209 direction: axis.direction,
9210 destination: {
9211 droppableId: destination.descriptor.id,
9212 index: 0
9213 }
9214 };
9215 return {
9216 pageBorderBoxCenter: withDroppableDisplacement(destination, _newCenter),
9217 impact: _newImpact
9218 };
9219 }
9220
9221 var targetIndex = insideDestination.indexOf(movingRelativeTo);
9222 !(targetIndex !== -1) ? process.env.NODE_ENV !== "production" ? invariant(false, 'The target was not found within its droppable') : invariant(false) : void 0;
9223 var proposedIndex = isGoingBeforeTarget ? targetIndex : targetIndex + 1;
9224 var newCenter = moveToEdge({
9225 source: draggable.page.borderBox,
9226 sourceEdge: 'start',
9227 destination: movingRelativeTo.page.marginBox,
9228 destinationEdge: isGoingBeforeTarget ? 'start' : 'end',
9229 destinationAxis: axis
9230 });
9231 var displaced = insideDestination.slice(proposedIndex, insideDestination.length).map(function (dimension) {
9232 return getDisplacement({
9233 draggable: dimension,
9234 destination: destination,
9235 viewport: viewport.frame,
9236 previousImpact: previousImpact
9237 });
9238 });
9239 var newImpact = {
9240 movement: {
9241 displaced: displaced,
9242 amount: amount,
9243 isBeyondStartPosition: false
9244 },
9245 direction: axis.direction,
9246 destination: {
9247 droppableId: destination.descriptor.id,
9248 index: proposedIndex
9249 }
9250 };
9251 return {
9252 pageBorderBoxCenter: withDroppableDisplacement(destination, newCenter),
9253 impact: newImpact
9254 };
9255 });
9256
9257 var moveToNewDroppable = (function (_ref) {
9258 var pageBorderBoxCenter = _ref.pageBorderBoxCenter,
9259 destination = _ref.destination,
9260 insideDestination = _ref.insideDestination,
9261 draggable = _ref.draggable,
9262 movingRelativeTo = _ref.movingRelativeTo,
9263 home = _ref.home,
9264 previousImpact = _ref.previousImpact,
9265 viewport = _ref.viewport;
9266 var amount = patch(destination.axis.line, draggable.client.marginBox[destination.axis.size]);
9267
9268 if (destination.descriptor.id === draggable.descriptor.droppableId) {
9269 !movingRelativeTo ? process.env.NODE_ENV !== "production" ? invariant(false, 'There will always be a target in the original list') : invariant(false) : void 0;
9270 return toHomeList({
9271 amount: amount,
9272 homeIndex: home.index,
9273 movingRelativeTo: movingRelativeTo,
9274 insideDestination: insideDestination,
9275 draggable: draggable,
9276 destination: destination,
9277 previousImpact: previousImpact,
9278 viewport: viewport
9279 });
9280 }
9281
9282 return toForeignList({
9283 amount: amount,
9284 pageBorderBoxCenter: pageBorderBoxCenter,
9285 movingRelativeTo: movingRelativeTo,
9286 insideDestination: insideDestination,
9287 draggable: draggable,
9288 destination: destination,
9289 previousImpact: previousImpact,
9290 viewport: viewport
9291 });
9292 });
9293
9294 var moveCrossAxis = (function (_ref) {
9295 var isMovingForward = _ref.isMovingForward,
9296 pageBorderBoxCenter = _ref.pageBorderBoxCenter,
9297 draggableId = _ref.draggableId,
9298 droppableId = _ref.droppableId,
9299 home = _ref.home,
9300 draggables = _ref.draggables,
9301 droppables = _ref.droppables,
9302 previousImpact = _ref.previousImpact,
9303 viewport = _ref.viewport;
9304 var draggable = draggables[draggableId];
9305 var source = droppables[droppableId];
9306 var destination = getBestCrossAxisDroppable({
9307 isMovingForward: isMovingForward,
9308 pageBorderBoxCenter: pageBorderBoxCenter,
9309 source: source,
9310 droppables: droppables,
9311 viewport: viewport
9312 });
9313
9314 if (!destination) {
9315 return null;
9316 }
9317
9318 var insideDestination = getDraggablesInsideDroppable(destination, draggables);
9319 var movingRelativeTo = getClosestDraggable({
9320 axis: destination.axis,
9321 pageBorderBoxCenter: pageBorderBoxCenter,
9322 destination: destination,
9323 insideDestination: insideDestination,
9324 viewport: viewport
9325 });
9326
9327 if (insideDestination.length && !movingRelativeTo) {
9328 return null;
9329 }
9330
9331 return moveToNewDroppable({
9332 pageBorderBoxCenter: pageBorderBoxCenter,
9333 destination: destination,
9334 draggable: draggable,
9335 movingRelativeTo: movingRelativeTo,
9336 insideDestination: insideDestination,
9337 home: home,
9338 previousImpact: previousImpact || noImpact,
9339 viewport: viewport
9340 });
9341 });
9342
9343 var isTotallyVisibleInNewLocation = (function (_ref) {
9344 var draggable = _ref.draggable,
9345 destination = _ref.destination,
9346 newPageBorderBoxCenter = _ref.newPageBorderBoxCenter,
9347 viewport = _ref.viewport;
9348 var diff = subtract(newPageBorderBoxCenter, draggable.page.borderBox.center);
9349 var shifted = offsetByPosition(draggable.page.borderBox, diff);
9350 return isTotallyVisible({
9351 target: shifted,
9352 destination: destination,
9353 viewport: viewport
9354 });
9355 });
9356
9357 var withFirstAdded = function withFirstAdded(_ref) {
9358 var add = _ref.add,
9359 previousImpact = _ref.previousImpact,
9360 droppable = _ref.droppable,
9361 draggables = _ref.draggables,
9362 viewport = _ref.viewport;
9363 var newDisplacement = {
9364 draggableId: add,
9365 isVisible: true,
9366 shouldAnimate: true
9367 };
9368 var added = [newDisplacement].concat(previousImpact.movement.displaced);
9369 var withUpdatedVisibility = added.map(function (current) {
9370 if (current === newDisplacement) {
9371 return current;
9372 }
9373
9374 var updated = getDisplacement({
9375 draggable: draggables[current.draggableId],
9376 destination: droppable,
9377 previousImpact: previousImpact,
9378 viewport: viewport.frame
9379 });
9380 return updated;
9381 });
9382 return withUpdatedVisibility;
9383 };
9384
9385 var forceVisibleDisplacement = function forceVisibleDisplacement(current) {
9386 if (current.isVisible) {
9387 return current;
9388 }
9389
9390 return {
9391 draggableId: current.draggableId,
9392 isVisible: true,
9393 shouldAnimate: false
9394 };
9395 };
9396
9397 var withFirstRemoved = function withFirstRemoved(_ref2) {
9398 var dragging = _ref2.dragging,
9399 isVisibleInNewLocation = _ref2.isVisibleInNewLocation,
9400 previousImpact = _ref2.previousImpact,
9401 droppable = _ref2.droppable,
9402 draggables = _ref2.draggables;
9403 var last = previousImpact.movement.displaced;
9404 !last.length ? process.env.NODE_ENV !== "production" ? invariant(false, 'Cannot remove displacement from empty list') : invariant(false) : void 0;
9405 var withFirstRestored = last.slice(1, last.length);
9406
9407 if (!withFirstRestored.length) {
9408 return withFirstRestored;
9409 }
9410
9411 if (isVisibleInNewLocation) {
9412 return withFirstRestored;
9413 }
9414
9415 var axis = droppable.axis;
9416 var sizeOfRestored = draggables[last[0].draggableId].page.marginBox[axis.size];
9417 var sizeOfDragging = draggables[dragging].page.marginBox[axis.size];
9418 var buffer = sizeOfRestored + sizeOfDragging;
9419 var withUpdatedVisibility = withFirstRestored.map(function (displacement, index) {
9420 if (index === 0) {
9421 return forceVisibleDisplacement(displacement);
9422 }
9423
9424 if (buffer > 0) {
9425 var current = draggables[displacement.draggableId];
9426 var size = current.page.marginBox[axis.size];
9427 buffer -= size;
9428 return forceVisibleDisplacement(displacement);
9429 }
9430
9431 return {
9432 draggableId: displacement.draggableId,
9433 isVisible: false,
9434 shouldAnimate: false
9435 };
9436 });
9437 return withUpdatedVisibility;
9438 };
9439
9440 var inHomeList$1 = (function (_ref) {
9441 var isMovingForward = _ref.isMovingForward,
9442 draggableId = _ref.draggableId,
9443 previousPageBorderBoxCenter = _ref.previousPageBorderBoxCenter,
9444 previousImpact = _ref.previousImpact,
9445 droppable = _ref.droppable,
9446 draggables = _ref.draggables,
9447 viewport = _ref.viewport;
9448 var location = previousImpact.destination;
9449 !location ? process.env.NODE_ENV !== "production" ? invariant(false, 'Cannot move to next index in home list when there is no previous destination') : invariant(false) : void 0;
9450 var draggable = draggables[draggableId];
9451 var axis = droppable.axis;
9452 var insideDroppable = getDraggablesInsideDroppable(droppable, draggables);
9453 var startIndex = draggable.descriptor.index;
9454 var currentIndex = location.index;
9455 var proposedIndex = isMovingForward ? currentIndex + 1 : currentIndex - 1;
9456
9457 if (proposedIndex > insideDroppable.length - 1) {
9458 return null;
9459 }
9460
9461 if (proposedIndex < 0) {
9462 return null;
9463 }
9464
9465 var destination = insideDroppable[proposedIndex];
9466 var isMovingTowardStart = isMovingForward && proposedIndex <= startIndex || !isMovingForward && proposedIndex >= startIndex;
9467
9468 var edge = function () {
9469 if (!isMovingTowardStart) {
9470 return isMovingForward ? 'end' : 'start';
9471 }
9472
9473 return isMovingForward ? 'start' : 'end';
9474 }();
9475
9476 var newPageBorderBoxCenter = moveToEdge({
9477 source: draggable.page.borderBox,
9478 sourceEdge: edge,
9479 destination: destination.page.borderBox,
9480 destinationEdge: edge,
9481 destinationAxis: droppable.axis
9482 });
9483 var isVisibleInNewLocation = isTotallyVisibleInNewLocation({
9484 draggable: draggable,
9485 destination: droppable,
9486 newPageBorderBoxCenter: newPageBorderBoxCenter,
9487 viewport: viewport.frame
9488 });
9489 var displaced = isMovingTowardStart ? withFirstRemoved({
9490 dragging: draggableId,
9491 isVisibleInNewLocation: isVisibleInNewLocation,
9492 previousImpact: previousImpact,
9493 droppable: droppable,
9494 draggables: draggables
9495 }) : withFirstAdded({
9496 add: destination.descriptor.id,
9497 previousImpact: previousImpact,
9498 droppable: droppable,
9499 draggables: draggables,
9500 viewport: viewport
9501 });
9502 var newImpact = {
9503 movement: {
9504 displaced: displaced,
9505 amount: patch(axis.line, draggable.page.marginBox[axis.size]),
9506 isBeyondStartPosition: proposedIndex > startIndex
9507 },
9508 destination: {
9509 droppableId: droppable.descriptor.id,
9510 index: proposedIndex
9511 },
9512 direction: droppable.axis.direction
9513 };
9514
9515 if (isVisibleInNewLocation) {
9516 return {
9517 pageBorderBoxCenter: withDroppableDisplacement(droppable, newPageBorderBoxCenter),
9518 impact: newImpact,
9519 scrollJumpRequest: null
9520 };
9521 }
9522
9523 var distance$$1 = subtract(newPageBorderBoxCenter, previousPageBorderBoxCenter);
9524 var distanceWithScroll = withDroppableDisplacement(droppable, distance$$1);
9525 return {
9526 pageBorderBoxCenter: previousPageBorderBoxCenter,
9527 impact: newImpact,
9528 scrollJumpRequest: distanceWithScroll
9529 };
9530 });
9531
9532 var inForeignList$1 = (function (_ref) {
9533 var isMovingForward = _ref.isMovingForward,
9534 draggableId = _ref.draggableId,
9535 previousImpact = _ref.previousImpact,
9536 previousPageBorderBoxCenter = _ref.previousPageBorderBoxCenter,
9537 droppable = _ref.droppable,
9538 draggables = _ref.draggables,
9539 viewport = _ref.viewport;
9540 !previousImpact.destination ? process.env.NODE_ENV !== "production" ? invariant(false, 'Cannot move to next index where there is no previous destination') : invariant(false) : void 0;
9541 var location = previousImpact.destination;
9542 var draggable = draggables[draggableId];
9543 var axis = droppable.axis;
9544 var insideForeignDroppable = getDraggablesInsideDroppable(droppable, draggables);
9545 var currentIndex = location.index;
9546 var proposedIndex = isMovingForward ? currentIndex + 1 : currentIndex - 1;
9547 var lastIndex = insideForeignDroppable.length - 1;
9548
9549 if (proposedIndex > insideForeignDroppable.length) {
9550 return null;
9551 }
9552
9553 if (proposedIndex < 0) {
9554 return null;
9555 }
9556
9557 var movingRelativeTo = insideForeignDroppable[Math.min(proposedIndex, lastIndex)];
9558 var isMovingPastLastIndex = proposedIndex > lastIndex;
9559 var sourceEdge = 'start';
9560
9561 var destinationEdge = function () {
9562 if (isMovingPastLastIndex) {
9563 return 'end';
9564 }
9565
9566 return 'start';
9567 }();
9568
9569 var newPageBorderBoxCenter = moveToEdge({
9570 source: draggable.page.borderBox,
9571 sourceEdge: sourceEdge,
9572 destination: movingRelativeTo.page.marginBox,
9573 destinationEdge: destinationEdge,
9574 destinationAxis: droppable.axis
9575 });
9576 var isVisibleInNewLocation = isTotallyVisibleInNewLocation({
9577 draggable: draggable,
9578 destination: droppable,
9579 newPageBorderBoxCenter: newPageBorderBoxCenter,
9580 viewport: viewport.frame
9581 });
9582
9583 var displaced = function () {
9584 if (isMovingForward) {
9585 return withFirstRemoved({
9586 dragging: draggableId,
9587 isVisibleInNewLocation: isVisibleInNewLocation,
9588 previousImpact: previousImpact,
9589 droppable: droppable,
9590 draggables: draggables
9591 });
9592 }
9593
9594 return withFirstAdded({
9595 add: movingRelativeTo.descriptor.id,
9596 previousImpact: previousImpact,
9597 droppable: droppable,
9598 draggables: draggables,
9599 viewport: viewport
9600 });
9601 }();
9602
9603 var newImpact = {
9604 movement: {
9605 displaced: displaced,
9606 amount: patch(axis.line, draggable.page.marginBox[axis.size]),
9607 isBeyondStartPosition: false
9608 },
9609 destination: {
9610 droppableId: droppable.descriptor.id,
9611 index: proposedIndex
9612 },
9613 direction: droppable.axis.direction
9614 };
9615
9616 if (isVisibleInNewLocation) {
9617 return {
9618 pageBorderBoxCenter: withDroppableDisplacement(droppable, newPageBorderBoxCenter),
9619 impact: newImpact,
9620 scrollJumpRequest: null
9621 };
9622 }
9623
9624 var distanceMoving = subtract(newPageBorderBoxCenter, previousPageBorderBoxCenter);
9625 var distanceWithScroll = withDroppableDisplacement(droppable, distanceMoving);
9626 return {
9627 pageBorderBoxCenter: previousPageBorderBoxCenter,
9628 impact: newImpact,
9629 scrollJumpRequest: distanceWithScroll
9630 };
9631 });
9632
9633 var moveToNextIndex = (function (args) {
9634 var draggableId = args.draggableId,
9635 draggables = args.draggables,
9636 droppable = args.droppable;
9637 var draggable = draggables[draggableId];
9638 var isInHomeList = draggable.descriptor.droppableId === droppable.descriptor.id;
9639
9640 if (!droppable.isEnabled) {
9641 return null;
9642 }
9643
9644 if (isInHomeList) {
9645 return inHomeList$1(args);
9646 }
9647
9648 return inForeignList$1(args);
9649 });
9650
9651 var getClientSelection = function getClientSelection(pageBorderBoxCenter, currentScroll) {
9652 return subtract(pageBorderBoxCenter, currentScroll);
9653 };
9654
9655 var moveInDirection = (function (_ref) {
9656 var state = _ref.state,
9657 type = _ref.type;
9658
9659 var _ref2 = function () {
9660 if (state.impact.destination) {
9661 return {
9662 droppable: state.dimensions.droppables[state.impact.destination.droppableId],
9663 isMainAxisMovementAllowed: true
9664 };
9665 }
9666
9667 return {
9668 droppable: state.dimensions.droppables[state.critical.droppable.id],
9669 isMainAxisMovementAllowed: false
9670 };
9671 }(),
9672 droppable = _ref2.droppable,
9673 isMainAxisMovementAllowed = _ref2.isMainAxisMovementAllowed;
9674
9675 var direction = droppable.axis.direction;
9676 var isMovingOnMainAxis = direction === 'vertical' && (type === 'MOVE_UP' || type === 'MOVE_DOWN') || direction === 'horizontal' && (type === 'MOVE_LEFT' || type === 'MOVE_RIGHT');
9677
9678 if (isMovingOnMainAxis && !isMainAxisMovementAllowed) {
9679 return null;
9680 }
9681
9682 var isMovingForward = type === 'MOVE_DOWN' || type === 'MOVE_RIGHT';
9683
9684 if (isMovingOnMainAxis) {
9685 var _result = moveToNextIndex({
9686 isMovingForward: isMovingForward,
9687 draggableId: state.critical.draggable.id,
9688 droppable: droppable,
9689 draggables: state.dimensions.draggables,
9690 previousPageBorderBoxCenter: state.current.page.borderBoxCenter,
9691 previousImpact: state.impact,
9692 viewport: state.viewport
9693 });
9694
9695 if (!_result) {
9696 return null;
9697 }
9698
9699 return {
9700 impact: _result.impact,
9701 clientSelection: getClientSelection(_result.pageBorderBoxCenter, state.viewport.scroll.current),
9702 scrollJumpRequest: _result.scrollJumpRequest
9703 };
9704 }
9705
9706 var home = getHomeLocation(state.critical);
9707 var result = moveCrossAxis({
9708 isMovingForward: isMovingForward,
9709 pageBorderBoxCenter: state.current.page.borderBoxCenter,
9710 draggableId: state.critical.draggable.id,
9711 droppableId: droppable.descriptor.id,
9712 home: home,
9713 draggables: state.dimensions.draggables,
9714 droppables: state.dimensions.droppables,
9715 previousImpact: state.impact,
9716 viewport: state.viewport
9717 });
9718
9719 if (!result) {
9720 return null;
9721 }
9722
9723 return {
9724 clientSelection: getClientSelection(result.pageBorderBoxCenter, state.viewport.scroll.current),
9725 impact: result.impact,
9726 scrollJumpRequest: null
9727 };
9728 });
9729
9730 var scrollViewport = (function (viewport, newScroll) {
9731 var diff = subtract(newScroll, viewport.scroll.initial);
9732 var displacement = negate(diff);
9733 var frame = cssBoxModel.getRect({
9734 top: newScroll.y,
9735 bottom: newScroll.y + viewport.frame.height,
9736 left: newScroll.x,
9737 right: newScroll.x + viewport.frame.width
9738 });
9739 var updated = {
9740 frame: frame,
9741 scroll: {
9742 initial: viewport.scroll.initial,
9743 max: viewport.scroll.max,
9744 current: newScroll,
9745 diff: {
9746 value: diff,
9747 displacement: displacement
9748 }
9749 }
9750 };
9751 return updated;
9752 });
9753
9754 var getHomeImpact = (function (critical, dimensions) {
9755 var home = dimensions.droppables[critical.droppable.id];
9756 var axis = home.axis;
9757 var draggable = dimensions.draggables[critical.draggable.id];
9758 return {
9759 movement: {
9760 displaced: [],
9761 isBeyondStartPosition: false,
9762 amount: patch(axis.line, draggable.client.marginBox[axis.size])
9763 },
9764 direction: axis.direction,
9765 destination: getHomeLocation(critical)
9766 };
9767 });
9768
9769 var getPageItemPositions = (function (client, windowScroll) {
9770 return {
9771 selection: add(client.selection, windowScroll),
9772 borderBoxCenter: add(client.borderBoxCenter, windowScroll),
9773 offset: add(client.offset, windowScroll)
9774 };
9775 });
9776
9777 function isMovementAllowed(state) {
9778 return state.phase === 'DRAGGING' || state.phase === 'COLLECTING';
9779 }
9780
9781 var idle = {
9782 phase: 'IDLE'
9783 };
9784 var preparing = {
9785 phase: 'PREPARING'
9786 };
9787
9788 var moveWithPositionUpdates = function moveWithPositionUpdates(_ref) {
9789 var state = _ref.state,
9790 clientSelection = _ref.clientSelection,
9791 shouldAnimate = _ref.shouldAnimate,
9792 viewport = _ref.viewport,
9793 impact = _ref.impact,
9794 scrollJumpRequest = _ref.scrollJumpRequest;
9795 var newViewport = viewport || state.viewport;
9796 var currentWindowScroll = newViewport.scroll.current;
9797
9798 var client = function () {
9799 var offset = subtract(clientSelection, state.initial.client.selection);
9800 return {
9801 offset: offset,
9802 selection: clientSelection,
9803 borderBoxCenter: add(state.initial.client.borderBoxCenter, offset)
9804 };
9805 }();
9806
9807 var page = getPageItemPositions(client, currentWindowScroll);
9808 var current = {
9809 client: client,
9810 page: page
9811 };
9812
9813 if (state.phase === 'COLLECTING') {
9814 return _extends({
9815 phase: 'COLLECTING'
9816 }, state, {
9817 current: current
9818 });
9819 }
9820
9821 var newImpact = impact || getDragImpact({
9822 pageBorderBoxCenter: page.borderBoxCenter,
9823 draggable: state.dimensions.draggables[state.critical.draggable.id],
9824 draggables: state.dimensions.draggables,
9825 droppables: state.dimensions.droppables,
9826 previousImpact: state.impact,
9827 viewport: newViewport
9828 });
9829
9830 var result = _extends({}, state, {
9831 current: current,
9832 shouldAnimate: shouldAnimate,
9833 impact: newImpact,
9834 scrollJumpRequest: scrollJumpRequest || null,
9835 viewport: newViewport
9836 });
9837
9838 return result;
9839 };
9840
9841 var reducer = (function (state, action) {
9842 if (state === void 0) {
9843 state = idle;
9844 }
9845
9846 if (action.type === 'CLEAN') {
9847 return idle;
9848 }
9849
9850 if (action.type === 'PREPARE') {
9851 return preparing;
9852 }
9853
9854 if (action.type === 'INITIAL_PUBLISH') {
9855 !(state.phase === 'PREPARING') ? process.env.NODE_ENV !== "production" ? invariant(false, 'INITIAL_PUBLISH must come after a PREPARING phase') : invariant(false) : void 0;
9856 var _action$payload = action.payload,
9857 critical = _action$payload.critical,
9858 client = _action$payload.client,
9859 viewport = _action$payload.viewport,
9860 dimensions = _action$payload.dimensions,
9861 autoScrollMode = _action$payload.autoScrollMode;
9862 var initial = {
9863 client: client,
9864 page: {
9865 selection: add(client.selection, viewport.scroll.initial),
9866 borderBoxCenter: add(client.selection, viewport.scroll.initial),
9867 offset: origin
9868 }
9869 };
9870 var result = {
9871 phase: 'DRAGGING',
9872 isDragging: true,
9873 critical: critical,
9874 autoScrollMode: autoScrollMode,
9875 dimensions: dimensions,
9876 initial: initial,
9877 current: initial,
9878 impact: getHomeImpact(critical, dimensions),
9879 viewport: viewport,
9880 scrollJumpRequest: null,
9881 shouldAnimate: false
9882 };
9883 return result;
9884 }
9885
9886 if (action.type === 'COLLECTION_STARTING') {
9887 var _extends2;
9888
9889 if (state.phase === 'COLLECTING' || state.phase === 'DROP_PENDING') {
9890 return state;
9891 }
9892
9893 !(state.phase === 'DRAGGING') ? process.env.NODE_ENV !== "production" ? invariant(false, "Collection cannot start from phase " + state.phase) : invariant(false) : void 0;
9894
9895 var _result = _extends({
9896 phase: 'COLLECTING'
9897 }, state, (_extends2 = {}, _extends2["phase"] = 'COLLECTING', _extends2));
9898
9899 return _result;
9900 }
9901
9902 if (action.type === 'PUBLISH') {
9903 !(state.phase === 'COLLECTING' || state.phase === 'DROP_PENDING') ? process.env.NODE_ENV !== "production" ? invariant(false, "Unexpected " + action.type + " received in phase " + state.phase) : invariant(false) : void 0;
9904 process.env.NODE_ENV !== "production" ? invariant(false, "Dynamic additions and removals of Draggable and Droppable components\n is currently not supported. But will be soon!") : invariant(false);
9905 }
9906
9907 if (action.type === 'MOVE') {
9908 if (state.phase === 'PREPARING') {
9909 return state;
9910 }
9911
9912 if (state.phase === 'DROP_PENDING') {
9913 return state;
9914 }
9915
9916 !isMovementAllowed(state) ? process.env.NODE_ENV !== "production" ? invariant(false, action.type + " not permitted in phase " + state.phase) : invariant(false) : void 0;
9917 var _action$payload2 = action.payload,
9918 _client = _action$payload2.client,
9919 shouldAnimate = _action$payload2.shouldAnimate;
9920
9921 if (state.shouldAnimate === shouldAnimate && isEqual(_client, state.current.client.selection)) {
9922 return state;
9923 }
9924
9925 var impact = state.autoScrollMode === 'JUMP' ? state.impact : null;
9926 return moveWithPositionUpdates({
9927 state: state,
9928 clientSelection: _client,
9929 impact: impact,
9930 shouldAnimate: shouldAnimate
9931 });
9932 }
9933
9934 if (action.type === 'UPDATE_DROPPABLE_SCROLL') {
9935 var _extends3, _extends4;
9936
9937 if (state.phase === 'PREPARING') {
9938 return state;
9939 }
9940
9941 if (state.phase === 'DROP_PENDING') {
9942 return state;
9943 }
9944
9945 !isMovementAllowed(state) ? process.env.NODE_ENV !== "production" ? invariant(false, action.type + " not permitted in phase " + state.phase) : invariant(false) : void 0;
9946 var _action$payload3 = action.payload,
9947 id = _action$payload3.id,
9948 offset = _action$payload3.offset;
9949 var target = state.dimensions.droppables[id];
9950
9951 if (!target) {
9952 return state;
9953 }
9954
9955 var updated = scrollDroppable(target, offset);
9956
9957 var _dimensions = _extends({}, state.dimensions, {
9958 droppables: _extends({}, state.dimensions.droppables, (_extends3 = {}, _extends3[id] = updated, _extends3))
9959 });
9960
9961 var _impact = function () {
9962 !isMovementAllowed(state) ? process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0;
9963
9964 if (state.autoScrollMode === 'JUMP') {
9965 return state.impact;
9966 }
9967
9968 return getDragImpact({
9969 pageBorderBoxCenter: state.current.page.borderBoxCenter,
9970 draggable: _dimensions.draggables[state.critical.draggable.id],
9971 draggables: _dimensions.draggables,
9972 droppables: _dimensions.droppables,
9973 previousImpact: state.impact,
9974 viewport: state.viewport
9975 });
9976 }();
9977
9978 return _extends({
9979 phase: 'DRAGGING'
9980 }, state, (_extends4 = {}, _extends4["phase"] = state.phase, _extends4.impact = _impact, _extends4.dimensions = _dimensions, _extends4.scrollJumpRequest = null, _extends4));
9981 }
9982
9983 if (action.type === 'UPDATE_DROPPABLE_IS_ENABLED') {
9984 var _extends5, _extends6;
9985
9986 if (state.phase === 'DROP_PENDING') {
9987 return state;
9988 }
9989
9990 !isMovementAllowed(state) ? process.env.NODE_ENV !== "production" ? invariant(false, "Attempting to move in an unsupported phase " + state.phase) : invariant(false) : void 0;
9991 var _action$payload4 = action.payload,
9992 _id = _action$payload4.id,
9993 isEnabled = _action$payload4.isEnabled;
9994 var _target = state.dimensions.droppables[_id];
9995 !_target ? process.env.NODE_ENV !== "production" ? invariant(false, "Cannot find Droppable[id: " + _id + "] to toggle its enabled state") : invariant(false) : void 0;
9996 !(_target.isEnabled !== isEnabled) ? process.env.NODE_ENV !== "production" ? invariant(false, "Trying to set droppable isEnabled to " + String(isEnabled) + "\n but it is already " + String(_target.isEnabled)) : invariant(false) : void 0;
9997
9998 var _updated = _extends({}, _target, {
9999 isEnabled: isEnabled
10000 });
10001
10002 var _dimensions2 = _extends({}, state.dimensions, {
10003 droppables: _extends({}, state.dimensions.droppables, (_extends5 = {}, _extends5[_id] = _updated, _extends5))
10004 });
10005
10006 var _impact2 = getDragImpact({
10007 pageBorderBoxCenter: state.current.page.borderBoxCenter,
10008 draggable: _dimensions2.draggables[state.critical.draggable.id],
10009 draggables: _dimensions2.draggables,
10010 droppables: _dimensions2.droppables,
10011 previousImpact: state.impact,
10012 viewport: state.viewport
10013 });
10014
10015 return _extends({
10016 phase: 'DRAGGING'
10017 }, state, (_extends6 = {}, _extends6["phase"] = state.phase, _extends6.impact = _impact2, _extends6.dimensions = _dimensions2, _extends6));
10018 }
10019
10020 if (action.type === 'MOVE_BY_WINDOW_SCROLL') {
10021 if (state.phase === 'PREPARING') {
10022 return state;
10023 }
10024
10025 if (state.phase === 'DROP_PENDING' || state.phase === 'DROP_ANIMATING') {
10026 return state;
10027 }
10028
10029 !isMovementAllowed(state) ? process.env.NODE_ENV !== "production" ? invariant(false, "Cannot move by window in phase " + state.phase) : invariant(false) : void 0;
10030 var newScroll = action.payload.scroll;
10031
10032 if (isEqual(state.viewport.scroll.current, newScroll)) {
10033 return state;
10034 }
10035
10036 var isJumpScrolling = state.autoScrollMode === 'JUMP';
10037
10038 var _impact3 = isJumpScrolling ? state.impact : null;
10039
10040 var _viewport = scrollViewport(state.viewport, newScroll);
10041
10042 return moveWithPositionUpdates({
10043 state: state,
10044 clientSelection: state.current.client.selection,
10045 viewport: _viewport,
10046 shouldAnimate: false,
10047 impact: _impact3
10048 });
10049 }
10050
10051 if (action.type === 'UPDATE_VIEWPORT_MAX_SCROLL') {
10052 var _extends7;
10053
10054 !state.isDragging ? process.env.NODE_ENV !== "production" ? invariant(false, 'Cannot update the max viewport scroll if not dragging') : invariant(false) : void 0;
10055 var existing = state.viewport;
10056
10057 var _viewport2 = _extends({}, existing, {
10058 scroll: _extends({}, existing.scroll, {
10059 max: action.payload
10060 })
10061 });
10062
10063 return _extends({
10064 phase: 'DRAGGING'
10065 }, state, (_extends7 = {}, _extends7["phase"] = state.phase, _extends7.viewport = _viewport2, _extends7));
10066 }
10067
10068 if (action.type === 'MOVE_UP' || action.type === 'MOVE_DOWN' || action.type === 'MOVE_LEFT' || action.type === 'MOVE_RIGHT') {
10069 if (state.phase === 'PREPARING') {
10070 return state;
10071 }
10072
10073 if (state.phase === 'COLLECTING' || state.phase === 'DROP_PENDING') {
10074 return state;
10075 }
10076
10077 !(state.phase === 'DRAGGING') ? process.env.NODE_ENV !== "production" ? invariant(false, action.type + " received while not in DRAGGING phase") : invariant(false) : void 0;
10078
10079 var _result2 = moveInDirection({
10080 state: state,
10081 type: action.type
10082 });
10083
10084 if (!_result2) {
10085 return state;
10086 }
10087
10088 return moveWithPositionUpdates({
10089 state: state,
10090 impact: _result2.impact,
10091 clientSelection: _result2.clientSelection,
10092 shouldAnimate: true,
10093 scrollJumpRequest: _result2.scrollJumpRequest
10094 });
10095 }
10096
10097 if (action.type === 'DROP_PENDING') {
10098 var _extends8;
10099
10100 var reason = action.payload.reason;
10101 !(state.phase === 'COLLECTING') ? process.env.NODE_ENV !== "production" ? invariant(false, 'Can only move into the DROP_PENDING phase from the COLLECTING phase') : invariant(false) : void 0;
10102
10103 var newState = _extends({
10104 phase: 'DROP_PENDING'
10105 }, state, (_extends8 = {}, _extends8["phase"] = 'DROP_PENDING', _extends8.isWaiting = true, _extends8.reason = reason, _extends8));
10106
10107 return newState;
10108 }
10109
10110 if (action.type === 'DROP_ANIMATE') {
10111 var pending = action.payload;
10112 !(state.phase === 'DRAGGING' || state.phase === 'DROP_PENDING') ? process.env.NODE_ENV !== "production" ? invariant(false, "Cannot animate drop from phase " + state.phase) : invariant(false) : void 0;
10113 var _result3 = {
10114 phase: 'DROP_ANIMATING',
10115 pending: pending,
10116 dimensions: state.dimensions
10117 };
10118 return _result3;
10119 }
10120
10121 if (action.type === 'DROP_COMPLETE') {
10122 return idle;
10123 }
10124
10125 return state;
10126 });
10127
10128 var lift = function lift(args) {
10129 return {
10130 type: 'LIFT',
10131 payload: args
10132 };
10133 };
10134 var initialPublish = function initialPublish(args) {
10135 return {
10136 type: 'INITIAL_PUBLISH',
10137 payload: args
10138 };
10139 };
10140 var publish = function publish(args) {
10141 return {
10142 type: 'PUBLISH',
10143 payload: args
10144 };
10145 };
10146 var collectionStarting = function collectionStarting() {
10147 return {
10148 type: 'COLLECTION_STARTING',
10149 payload: null
10150 };
10151 };
10152 var updateDroppableScroll = function updateDroppableScroll(args) {
10153 return {
10154 type: 'UPDATE_DROPPABLE_SCROLL',
10155 payload: args
10156 };
10157 };
10158 var updateDroppableIsEnabled = function updateDroppableIsEnabled(args) {
10159 return {
10160 type: 'UPDATE_DROPPABLE_IS_ENABLED',
10161 payload: args
10162 };
10163 };
10164 var move = function move(args) {
10165 return {
10166 type: 'MOVE',
10167 payload: args
10168 };
10169 };
10170 var moveByWindowScroll = function moveByWindowScroll(args) {
10171 return {
10172 type: 'MOVE_BY_WINDOW_SCROLL',
10173 payload: args
10174 };
10175 };
10176 var updateViewportMaxScroll = function updateViewportMaxScroll(max) {
10177 return {
10178 type: 'UPDATE_VIEWPORT_MAX_SCROLL',
10179 payload: max
10180 };
10181 };
10182 var moveUp = function moveUp() {
10183 return {
10184 type: 'MOVE_UP',
10185 payload: null
10186 };
10187 };
10188 var moveDown = function moveDown() {
10189 return {
10190 type: 'MOVE_DOWN',
10191 payload: null
10192 };
10193 };
10194 var moveRight = function moveRight() {
10195 return {
10196 type: 'MOVE_RIGHT',
10197 payload: null
10198 };
10199 };
10200 var moveLeft = function moveLeft() {
10201 return {
10202 type: 'MOVE_LEFT',
10203 payload: null
10204 };
10205 };
10206 var clean = function clean() {
10207 return {
10208 type: 'CLEAN',
10209 payload: null
10210 };
10211 };
10212 var prepare = function prepare() {
10213 return {
10214 type: 'PREPARE',
10215 payload: null
10216 };
10217 };
10218 var animateDrop = function animateDrop(pending) {
10219 return {
10220 type: 'DROP_ANIMATE',
10221 payload: pending
10222 };
10223 };
10224 var completeDrop = function completeDrop(result) {
10225 return {
10226 type: 'DROP_COMPLETE',
10227 payload: result
10228 };
10229 };
10230 var drop = function drop(args) {
10231 return {
10232 type: 'DROP',
10233 payload: args
10234 };
10235 };
10236 var dropPending = function dropPending(args) {
10237 return {
10238 type: 'DROP_PENDING',
10239 payload: args
10240 };
10241 };
10242 var dropAnimationFinished = function dropAnimationFinished() {
10243 return {
10244 type: 'DROP_ANIMATION_FINISHED',
10245 payload: null
10246 };
10247 };
10248
10249 var lift$1 = (function (getMarshal) {
10250 var timeoutId = null;
10251
10252 var tryAbortCriticalCollection = function tryAbortCriticalCollection() {
10253 if (timeoutId == null) {
10254 return;
10255 }
10256
10257 clearTimeout(timeoutId);
10258 timeoutId = null;
10259 };
10260
10261 return function (_ref) {
10262 var getState = _ref.getState,
10263 dispatch = _ref.dispatch;
10264 return function (next) {
10265 return function (action) {
10266 if (action.type === 'CLEAN') {
10267 tryAbortCriticalCollection();
10268 next(action);
10269 return;
10270 }
10271
10272 if (action.type !== 'LIFT') {
10273 next(action);
10274 return;
10275 }
10276
10277 !!timeoutId ? process.env.NODE_ENV !== "production" ? invariant(false, 'There should not be a pending complete lift phase when a lift action is fired') : invariant(false) : void 0;
10278 var marshal = getMarshal();
10279 var _action$payload = action.payload,
10280 id = _action$payload.id,
10281 client = _action$payload.client,
10282 autoScrollMode = _action$payload.autoScrollMode,
10283 viewport = _action$payload.viewport;
10284 var initial = getState();
10285
10286 if (initial.phase === 'DROP_ANIMATING') {
10287 dispatch(completeDrop(initial.pending.result));
10288 }
10289
10290 var postFlushState = getState();
10291 !(postFlushState.phase === 'IDLE') ? process.env.NODE_ENV !== "production" ? invariant(false, 'Incorrect phase to start a drag') : invariant(false) : void 0;
10292 dispatch(prepare());
10293 timeoutId = setTimeout(function () {
10294 timeoutId = null;
10295 var state = getState();
10296 !(state.phase === 'PREPARING') ? process.env.NODE_ENV !== "production" ? invariant(false, 'Invalid phase for completing lift') : invariant(false) : void 0;
10297 var scrollOptions = {
10298 shouldPublishImmediately: autoScrollMode === 'JUMP'
10299 };
10300 var request = {
10301 draggableId: id,
10302 scrollOptions: scrollOptions
10303 };
10304
10305 var _marshal$startPublish = marshal.startPublishing(request, viewport.scroll.current),
10306 critical = _marshal$startPublish.critical,
10307 dimensions = _marshal$startPublish.dimensions;
10308
10309 dispatch(initialPublish({
10310 critical: critical,
10311 dimensions: dimensions,
10312 client: client,
10313 autoScrollMode: autoScrollMode,
10314 viewport: viewport
10315 }));
10316 });
10317 };
10318 };
10319 };
10320 });
10321
10322 var style = (function (marshal) {
10323 return function () {
10324 return function (next) {
10325 return function (action) {
10326 if (action.type === 'INITIAL_PUBLISH') {
10327 marshal.dragging();
10328 }
10329
10330 if (action.type === 'COLLECTION_STARTING') {
10331 marshal.collecting();
10332 }
10333
10334 if (action.type === 'PUBLISH') {
10335 marshal.dragging();
10336 }
10337
10338 if (action.type === 'DROP_ANIMATE') {
10339 marshal.dropping(action.payload.result.reason);
10340 }
10341
10342 if (action.type === 'CLEAN' || action.type === 'DROP_COMPLETE') {
10343 marshal.resting();
10344 }
10345
10346 next(action);
10347 };
10348 };
10349 };
10350 });
10351
10352 var getNewHomeClientBorderBoxCenter = (function (_ref) {
10353 var movement = _ref.movement,
10354 draggable = _ref.draggable,
10355 draggables = _ref.draggables,
10356 destination = _ref.destination;
10357 var originalCenter = draggable.client.borderBox.center;
10358
10359 if (destination == null) {
10360 return originalCenter;
10361 }
10362
10363 var displaced = movement.displaced,
10364 isBeyondStartPosition = movement.isBeyondStartPosition;
10365 var axis = destination.axis;
10366 var isWithinHomeDroppable = destination.descriptor.id === draggable.descriptor.droppableId;
10367
10368 if (isWithinHomeDroppable && !displaced.length) {
10369 return originalCenter;
10370 }
10371
10372 var draggablesInDestination = getDraggablesInsideDroppable(destination, draggables);
10373
10374 var movingRelativeTo = function () {
10375 if (isWithinHomeDroppable) {
10376 return draggables[displaced[0].draggableId].client.borderBox;
10377 }
10378
10379 if (displaced.length) {
10380 return draggables[displaced[0].draggableId].client.borderBox;
10381 }
10382
10383 if (draggablesInDestination.length) {
10384 return draggablesInDestination[draggablesInDestination.length - 1].client.marginBox;
10385 }
10386
10387 return destination.client.contentBox;
10388 }();
10389
10390 var _ref2 = function () {
10391 if (isWithinHomeDroppable) {
10392 if (isBeyondStartPosition) {
10393 return {
10394 sourceEdge: 'end',
10395 destinationEdge: 'end'
10396 };
10397 }
10398
10399 return {
10400 sourceEdge: 'start',
10401 destinationEdge: 'start'
10402 };
10403 }
10404
10405 if (!displaced.length && draggablesInDestination.length) {
10406 return {
10407 sourceEdge: 'start',
10408 destinationEdge: 'end'
10409 };
10410 }
10411
10412 return {
10413 sourceEdge: 'start',
10414 destinationEdge: 'start'
10415 };
10416 }(),
10417 sourceEdge = _ref2.sourceEdge,
10418 destinationEdge = _ref2.destinationEdge;
10419
10420 var source = draggable.client.borderBox;
10421 var targetCenter = moveToEdge({
10422 source: source,
10423 sourceEdge: sourceEdge,
10424 destination: movingRelativeTo,
10425 destinationEdge: destinationEdge,
10426 destinationAxis: axis
10427 });
10428 return targetCenter;
10429 });
10430
10431 var getScrollDisplacement = function getScrollDisplacement(droppable, viewport) {
10432 return withDroppableDisplacement(droppable, viewport.scroll.diff.displacement);
10433 };
10434
10435 var drop$1 = (function (_ref) {
10436 var getState = _ref.getState,
10437 dispatch = _ref.dispatch;
10438 return function (next) {
10439 return function (action) {
10440 if (action.type !== 'DROP') {
10441 next(action);
10442 return;
10443 }
10444
10445 var state = getState();
10446 var reason = action.payload.reason;
10447
10448 if (state.phase === 'COLLECTING') {
10449 dispatch(dropPending({
10450 reason: reason
10451 }));
10452 return;
10453 }
10454
10455 if (state.phase === 'PREPARING') {
10456 dispatch(clean());
10457 return;
10458 }
10459
10460 if (state.phase === 'IDLE') {
10461 return;
10462 }
10463
10464 var isWaitingForDrop = state.phase === 'DROP_PENDING' && state.isWaiting;
10465 !!isWaitingForDrop ? process.env.NODE_ENV !== "production" ? invariant(false, 'A DROP action occurred while DROP_PENDING and still waiting') : invariant(false) : void 0;
10466 !(state.phase === 'DRAGGING' || state.phase === 'DROP_PENDING') ? process.env.NODE_ENV !== "production" ? invariant(false, "Cannot drop in phase: " + state.phase) : invariant(false) : void 0;
10467 var critical = state.critical;
10468 var dimensions = state.dimensions;
10469 var impact = reason === 'DROP' ? state.impact : noImpact;
10470 var home = dimensions.droppables[state.critical.droppable.id];
10471 var draggable = dimensions.draggables[state.critical.draggable.id];
10472 var droppable = impact && impact.destination ? dimensions.droppables[impact.destination.droppableId] : null;
10473 var source = {
10474 index: critical.draggable.index,
10475 droppableId: critical.droppable.id
10476 };
10477 var destination = reason === 'DROP' ? impact.destination : null;
10478 var result = {
10479 draggableId: draggable.descriptor.id,
10480 type: home.descriptor.type,
10481 source: source,
10482 destination: destination,
10483 reason: reason
10484 };
10485
10486 var clientOffset = function () {
10487 if (reason === 'CANCEL') {
10488 return origin;
10489 }
10490
10491 var newBorderBoxClientCenter = getNewHomeClientBorderBoxCenter({
10492 movement: impact.movement,
10493 draggable: draggable,
10494 draggables: dimensions.draggables,
10495 destination: droppable
10496 });
10497 return subtract(newBorderBoxClientCenter, draggable.client.borderBox.center);
10498 }();
10499
10500 var newHomeOffset = add(clientOffset, getScrollDisplacement(droppable || home, state.viewport));
10501 var isAnimationRequired = !isEqual(state.current.client.offset, newHomeOffset);
10502 var pending = {
10503 newHomeOffset: newHomeOffset,
10504 result: result,
10505 impact: impact
10506 };
10507
10508 if (isAnimationRequired) {
10509 dispatch(animateDrop(pending));
10510 return;
10511 }
10512
10513 dispatch(completeDrop(result));
10514 };
10515 };
10516 });
10517
10518 var onDragStart = function onDragStart(start) {
10519 return "\n You have lifted an item in position " + (start.source.index + 1) + ".\n Use the arrow keys to move, space bar to drop, and escape to cancel.\n";
10520 };
10521
10522 var onDragUpdate = function onDragUpdate(update) {
10523 if (!update.destination) {
10524 return 'You are currently not dragging over a droppable area';
10525 }
10526
10527 if (update.source.droppableId === update.destination.droppableId) {
10528 return "You have moved the item to position " + (update.destination.index + 1);
10529 }
10530
10531 return "\n You have moved the item from list " + update.source.droppableId + " in position " + (update.source.index + 1) + "\n to list " + update.destination.droppableId + " in position " + (update.destination.index + 1) + "\n ";
10532 };
10533
10534 var onDragEnd = function onDragEnd(result) {
10535 if (result.reason === 'CANCEL') {
10536 return "\n Movement cancelled.\n The item has returned to its starting position of " + (result.source.index + 1) + "\n ";
10537 }
10538
10539 if (!result.destination) {
10540 return "\n The item has been dropped while not over a droppable location.\n The item has returned to its starting position of " + (result.source.index + 1) + "\n ";
10541 }
10542
10543 if (result.source.droppableId === result.destination.droppableId) {
10544 if (result.source.index === result.destination.index) {
10545 return "\n You have dropped the item.\n It has been dropped on its starting position of " + (result.source.index + 1) + "\n ";
10546 }
10547
10548 return "\n You have dropped the item.\n It has moved from position " + (result.source.index + 1) + " to " + (result.destination.index + 1) + "\n ";
10549 }
10550
10551 return "\n You have dropped the item.\n It has moved from position " + (result.source.index + 1) + " in list " + result.source.droppableId + "\n to position " + (result.destination.index + 1) + " in list " + result.destination.droppableId + "\n ";
10552 };
10553
10554 var preset = {
10555 onDragStart: onDragStart,
10556 onDragUpdate: onDragUpdate,
10557 onDragEnd: onDragEnd
10558 };
10559
10560 var records = {};
10561 var flag = '__react-beautiful-dnd-debug-timings-hook__';
10562
10563 var isTimingsEnabled = function isTimingsEnabled() {
10564 return Boolean(window[flag]);
10565 };
10566
10567 var start = function start(key) {
10568 if (process.env.NODE_ENV !== 'production') {
10569 if (!isTimingsEnabled()) {
10570 return;
10571 }
10572
10573 var now = performance.now();
10574 records[key] = now;
10575 }
10576 };
10577 var finish = function finish(key) {
10578 if (process.env.NODE_ENV !== 'production') {
10579 if (!isTimingsEnabled()) {
10580 return;
10581 }
10582
10583 var now = performance.now();
10584 var previous = records[key];
10585 !previous ? process.env.NODE_ENV !== "production" ? invariant(false, 'cannot finish timing as no previous time found') : invariant(false) : void 0;
10586 var result = now - previous;
10587 var rounded = result.toFixed(2);
10588
10589 var style = function () {
10590 if (result < 12) {
10591 return {
10592 textColor: 'green',
10593 symbol: '✅'
10594 };
10595 }
10596
10597 if (result < 40) {
10598 return {
10599 textColor: 'orange',
10600 symbol: '⚠️'
10601 };
10602 }
10603
10604 return {
10605 textColor: 'red',
10606 symbol: '❌'
10607 };
10608 }();
10609
10610 console.log(style.symbol + " %cTiming %c" + rounded + " %cms %c" + key, 'color: blue; font-weight: bold; ', "color: " + style.textColor + "; font-size: 1.1em;", 'color: grey;', 'color: purple; font-weight: bold;');
10611 }
10612 };
10613
10614 var withTimings = function withTimings(key, fn) {
10615 start(key);
10616 fn();
10617 finish(key);
10618 };
10619
10620 var areLocationsEqual = function areLocationsEqual(first, second) {
10621 if (first == null && second == null) {
10622 return true;
10623 }
10624
10625 if (first == null || second == null) {
10626 return false;
10627 }
10628
10629 return first.droppableId === second.droppableId && first.index === second.index;
10630 };
10631
10632 var isCriticalEqual = function isCriticalEqual(first, second) {
10633 if (first === second) {
10634 return true;
10635 }
10636
10637 var isDraggableEqual = first.draggable.id === second.draggable.id && first.draggable.droppableId === second.draggable.droppableId && first.draggable.type === second.draggable.type && first.draggable.index === second.draggable.index;
10638 var isDroppableEqual = first.droppable.id === second.droppable.id && first.droppable.type === second.droppable.type;
10639 return isDraggableEqual && isDroppableEqual;
10640 };
10641
10642 var getExpiringAnnounce = function getExpiringAnnounce(announce) {
10643 var wasCalled = false;
10644 var isExpired = false;
10645 setTimeout(function () {
10646 isExpired = true;
10647 });
10648
10649 var result = function result(message) {
10650 if (wasCalled) {
10651 if (process.env.NODE_ENV !== 'production') {
10652 console.warn('Announcement already made. Not making a second announcement');
10653 }
10654
10655 return;
10656 }
10657
10658 if (isExpired) {
10659 if (process.env.NODE_ENV !== 'production') {
10660 console.warn("\n Announcements cannot be made asynchronously.\n Default message has already been announced.\n ");
10661 }
10662
10663 return;
10664 }
10665
10666 wasCalled = true;
10667 announce(message);
10668 };
10669
10670 result.wasCalled = function () {
10671 return wasCalled;
10672 };
10673
10674 return result;
10675 };
10676
10677 var getDragStart = function getDragStart(critical) {
10678 return {
10679 draggableId: critical.draggable.id,
10680 type: critical.droppable.type,
10681 source: {
10682 droppableId: critical.droppable.id,
10683 index: critical.draggable.index
10684 }
10685 };
10686 };
10687
10688 var hooks = (function (getHooks, announce) {
10689 var execute = function execute(hook, data, getDefaultMessage) {
10690 if (!hook) {
10691 announce(getDefaultMessage(data));
10692 return;
10693 }
10694
10695 var willExpire = getExpiringAnnounce(announce);
10696 var provided = {
10697 announce: willExpire
10698 };
10699 hook(data, provided);
10700
10701 if (!willExpire.wasCalled()) {
10702 announce(getDefaultMessage(data));
10703 }
10704 };
10705
10706 var publisher = function () {
10707 var lastLocation = null;
10708 var lastCritical = null;
10709 var _isDragStartPublished = false;
10710
10711 var beforeStart = function beforeStart(critical) {
10712 !!_isDragStartPublished ? process.env.NODE_ENV !== "production" ? invariant(false, 'Cannot fire onBeforeDragStart as a drag start has already been published') : invariant(false) : void 0;
10713 withTimings('onBeforeDragStart', function () {
10714 var fn = getHooks().onBeforeDragStart;
10715
10716 if (fn) {
10717 fn(getDragStart(critical));
10718 }
10719 });
10720 };
10721
10722 var start$$1 = function start$$1(critical) {
10723 !!_isDragStartPublished ? process.env.NODE_ENV !== "production" ? invariant(false, 'Cannot fire onBeforeDragStart as a drag start has already been published') : invariant(false) : void 0;
10724 var data = getDragStart(critical);
10725 lastCritical = critical;
10726 lastLocation = data.source;
10727 _isDragStartPublished = true;
10728 withTimings('onDragStart', function () {
10729 return execute(getHooks().onDragStart, data, preset.onDragStart);
10730 });
10731 };
10732
10733 var move = function move(critical, location) {
10734 !(_isDragStartPublished && lastCritical) ? process.env.NODE_ENV !== "production" ? invariant(false, 'Cannot fire onDragMove when onDragStart has not been called') : invariant(false) : void 0;
10735 var hasCriticalChanged = !isCriticalEqual(critical, lastCritical);
10736
10737 if (hasCriticalChanged) {
10738 lastCritical = critical;
10739 }
10740
10741 var hasLocationChanged = !areLocationsEqual(lastLocation, location);
10742
10743 if (hasLocationChanged) {
10744 lastLocation = location;
10745 }
10746
10747 if (!hasCriticalChanged && !hasLocationChanged) {
10748 return;
10749 }
10750
10751 var data = _extends({}, getDragStart(critical), {
10752 destination: location
10753 });
10754
10755 withTimings('onDragUpdate', function () {
10756 return execute(getHooks().onDragUpdate, data, preset.onDragUpdate);
10757 });
10758 };
10759
10760 var drop = function drop(result) {
10761 !_isDragStartPublished ? process.env.NODE_ENV !== "production" ? invariant(false, 'Cannot fire onDragEnd when there is no matching onDragStart') : invariant(false) : void 0;
10762 _isDragStartPublished = false;
10763 lastLocation = null;
10764 lastCritical = null;
10765 withTimings('onDragEnd', function () {
10766 return execute(getHooks().onDragEnd, result, preset.onDragEnd);
10767 });
10768 };
10769
10770 var abort = function abort() {
10771 !(_isDragStartPublished && lastCritical) ? process.env.NODE_ENV !== "production" ? invariant(false, 'Cannot cancel when onDragStart not fired') : invariant(false) : void 0;
10772
10773 var result = _extends({}, getDragStart(lastCritical), {
10774 destination: null,
10775 reason: 'CANCEL'
10776 });
10777
10778 drop(result);
10779 };
10780
10781 return {
10782 beforeStart: beforeStart,
10783 start: start$$1,
10784 move: move,
10785 drop: drop,
10786 abort: abort,
10787 isDragStartPublished: function isDragStartPublished() {
10788 return _isDragStartPublished;
10789 }
10790 };
10791 }();
10792
10793 return function (store) {
10794 return function (next) {
10795 return function (action) {
10796 if (action.type === 'INITIAL_PUBLISH') {
10797 var critical = action.payload.critical;
10798 publisher.beforeStart(critical);
10799 next(action);
10800 publisher.start(critical);
10801 return;
10802 }
10803
10804 next(action);
10805
10806 if (action.type === 'DROP_COMPLETE') {
10807 var result = action.payload;
10808 publisher.drop(result);
10809 return;
10810 }
10811
10812 if (action.type === 'CLEAN') {
10813 if (publisher.isDragStartPublished()) {
10814 publisher.abort();
10815 }
10816
10817 return;
10818 }
10819
10820 if (!publisher.isDragStartPublished()) {
10821 return;
10822 }
10823
10824 var state = store.getState();
10825
10826 if (state.phase === 'DRAGGING') {
10827 publisher.move(state.critical, state.impact.destination);
10828 }
10829 };
10830 };
10831 };
10832 });
10833
10834 var dropAnimationFinish = (function (store) {
10835 return function (next) {
10836 return function (action) {
10837 if (action.type !== 'DROP_ANIMATION_FINISHED') {
10838 next(action);
10839 return;
10840 }
10841
10842 var state = store.getState();
10843 !(state.phase === 'DROP_ANIMATING') ? process.env.NODE_ENV !== "production" ? invariant(false, 'Cannot finish a drop animating when no drop is occurring') : invariant(false) : void 0;
10844 store.dispatch(completeDrop(state.pending.result));
10845 };
10846 };
10847 });
10848
10849 var dimensionMarshalStopper = (function (getMarshal) {
10850 return function () {
10851 return function (next) {
10852 return function (action) {
10853 if (action.type === 'DROP_COMPLETE' || action.type === 'CLEAN' || action.type === 'DROP_ANIMATE') {
10854 var marshal = getMarshal();
10855 marshal.stopPublishing();
10856 }
10857
10858 next(action);
10859 };
10860 };
10861 };
10862 });
10863
10864 var shouldCancel = function shouldCancel(action) {
10865 return action.type === 'CANCEL' || action.type === 'DROP_ANIMATE' || action.type === 'DROP' || action.type === 'DROP_COMPLETE' || action.type === 'COLLECTION_STARTING';
10866 };
10867
10868 var autoScroll = (function (getScroller) {
10869 return function (store) {
10870 return function (next) {
10871 return function (action) {
10872 if (shouldCancel(action)) {
10873 getScroller().cancel();
10874 next(action);
10875 return;
10876 }
10877
10878 next(action);
10879 var state = store.getState();
10880
10881 if (state.phase !== 'DRAGGING') {
10882 return;
10883 }
10884
10885 if (state.autoScrollMode === 'FLUID') {
10886 getScroller().fluidScroll(state);
10887 return;
10888 }
10889
10890 if (!state.scrollJumpRequest) {
10891 return;
10892 }
10893
10894 getScroller().jumpScroll(state);
10895 };
10896 };
10897 };
10898 });
10899
10900 var shouldCheckOnAction = function shouldCheckOnAction(action) {
10901 return action.type === 'MOVE' || action.type === 'MOVE_UP' || action.type === 'MOVE_RIGHT' || action.type === 'MOVE_DOWN' || action.type === 'MOVE_LEFT' || action.type === 'MOVE_BY_WINDOW_SCROLL';
10902 };
10903
10904 var hasDroppableOverChanged = function hasDroppableOverChanged(previous, current) {
10905 if (!previous) {
10906 return Boolean(current);
10907 }
10908
10909 if (!current) {
10910 return Boolean(previous);
10911 }
10912
10913 return previous.droppableId !== current.droppableId;
10914 };
10915
10916 var getNewMaxScroll = function getNewMaxScroll(previous, current, action) {
10917 if (!shouldCheckOnAction(action)) {
10918 return null;
10919 }
10920
10921 if (!isMovementAllowed(previous) || !isMovementAllowed(current)) {
10922 return null;
10923 }
10924
10925 if (!hasDroppableOverChanged(previous.impact.destination, current.impact.destination)) {
10926 return null;
10927 }
10928
10929 var viewport = current.viewport;
10930 var doc = document.documentElement;
10931 !doc ? process.env.NODE_ENV !== "production" ? invariant(false, 'Could not find document.documentElement') : invariant(false) : void 0;
10932 var maxScroll = getMaxScroll({
10933 scrollHeight: doc.scrollHeight,
10934 scrollWidth: doc.scrollWidth,
10935 width: viewport.frame.width,
10936 height: viewport.frame.height
10937 });
10938
10939 if (isEqual(maxScroll, viewport.scroll.max)) {
10940 return null;
10941 }
10942
10943 return maxScroll;
10944 };
10945
10946 var maxScrollUpdater = (function (store) {
10947 return function (next) {
10948 return function (action) {
10949 var previous = store.getState();
10950 next(action);
10951 var current = store.getState();
10952 var maxScroll = getNewMaxScroll(previous, current, action);
10953
10954 if (maxScroll) {
10955 next(updateViewportMaxScroll(maxScroll));
10956 }
10957 };
10958 };
10959 });
10960
10961 var composeEnhancers = typeof window === 'object' && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : redux.compose;
10962 var createStore = (function (_ref) {
10963 var getDimensionMarshal = _ref.getDimensionMarshal,
10964 styleMarshal = _ref.styleMarshal,
10965 getHooks = _ref.getHooks,
10966 announce = _ref.announce,
10967 getScroller = _ref.getScroller;
10968 return redux.createStore(reducer, composeEnhancers(redux.applyMiddleware(style(styleMarshal), dimensionMarshalStopper(getDimensionMarshal), lift$1(getDimensionMarshal), drop$1, dropAnimationFinish, maxScrollUpdater, autoScroll(getScroller), hooks(getHooks, announce))));
10969 });
10970
10971 var getEmptyMap = function getEmptyMap() {
10972 return {
10973 draggables: {},
10974 droppables: {}
10975 };
10976 };
10977
10978 var timingKey = 'Publish collection from DOM';
10979 var createPublisher = (function (_ref) {
10980 var getProvided = _ref.getProvided,
10981 callbacks = _ref.callbacks;
10982
10983 var advancedUsageWarning = function () {
10984 if (process.env.NODE_ENV === 'production') {
10985 return function () {};
10986 }
10987
10988 var hasAnnounced = false;
10989 return function () {
10990 if (hasAnnounced) {
10991 return;
10992 }
10993
10994 hasAnnounced = true;
10995
10996 if (process.env.NODE_ENV === 'production') {
10997 return;
10998 }
10999
11000 console.warn("\n Advanced usage warning: you are adding or removing a dimension during a drag\n This an advanced feature used to support dynamic interactions such as lazy loading lists.\n\n Keep in mind the following restrictions:\n\n - Draggable's can only be added to Droppable's that are scroll containers\n - Adding a Droppable cannot impact the placement of other Droppables\n (it cannot push a Droppable on the page)\n\n (This warning will be stripped in production builds)\n ".trim());
11001 };
11002 }();
11003
11004 var additions = getEmptyMap();
11005 var removals = getEmptyMap();
11006 var frameId = null;
11007
11008 var reset = function reset() {
11009 additions = getEmptyMap();
11010 removals = getEmptyMap();
11011 };
11012
11013 var collect = function collect() {
11014 advancedUsageWarning();
11015
11016 if (frameId) {
11017 return;
11018 }
11019
11020 frameId = requestAnimationFrame(function () {
11021 frameId = null;
11022 callbacks.collectionStarting();
11023 start(timingKey);
11024
11025 var _getProvided = getProvided(),
11026 entries = _getProvided.entries,
11027 collection = _getProvided.collection;
11028
11029 var windowScroll = collection.initialWindowScroll;
11030
11031 var draggables = _Object$keys(additions.draggables).map(function (id) {
11032 return entries.draggables[id].getDimension(windowScroll);
11033 });
11034
11035 var droppables = _Object$keys(additions.droppables).map(function (id) {
11036 return entries.droppables[id].callbacks.getDimensionAndWatchScroll(windowScroll, collection.scrollOptions);
11037 });
11038
11039 var result = {
11040 additions: {
11041 draggables: draggables,
11042 droppables: droppables
11043 },
11044 removals: {
11045 draggables: _Object$keys(removals.draggables),
11046 droppables: _Object$keys(removals.droppables)
11047 }
11048 };
11049 reset();
11050 finish(timingKey);
11051 callbacks.publish(result);
11052 });
11053 };
11054
11055 var addDraggable = function addDraggable(id) {
11056 additions.draggables[id] = true;
11057
11058 if (removals.draggables[id]) {
11059 delete removals.draggables[id];
11060 }
11061
11062 collect();
11063 };
11064
11065 var removeDraggable = function removeDraggable(id) {
11066 removals.draggables[id] = true;
11067
11068 if (additions.draggables[id]) {
11069 delete additions.draggables[id];
11070 }
11071
11072 collect();
11073 };
11074
11075 var addDroppable = function addDroppable(id) {
11076 additions.droppables[id] = true;
11077
11078 if (removals.droppables[id]) {
11079 delete removals.droppables[id];
11080 }
11081
11082 collect();
11083 };
11084
11085 var removeDroppable = function removeDroppable(id) {
11086 removals.droppables[id] = true;
11087
11088 if (additions.droppables[id]) {
11089 delete additions.droppables[id];
11090 }
11091
11092 collect();
11093 };
11094
11095 var stop = function stop() {
11096 if (!frameId) {
11097 return;
11098 }
11099
11100 cancelAnimationFrame(frameId);
11101 frameId = null;
11102 reset();
11103 };
11104
11105 return {
11106 addDraggable: addDraggable,
11107 removeDraggable: removeDraggable,
11108 addDroppable: addDroppable,
11109 removeDroppable: removeDroppable,
11110 stop: stop
11111 };
11112 });
11113
11114 var createDimensionMarshal = (function (callbacks) {
11115 var entries = {
11116 droppables: {},
11117 draggables: {}
11118 };
11119 var collection = null;
11120 var publisher = createPublisher({
11121 callbacks: {
11122 publish: callbacks.publish,
11123 collectionStarting: callbacks.collectionStarting
11124 },
11125 getProvided: function getProvided() {
11126 !collection ? process.env.NODE_ENV !== "production" ? invariant(false, 'Cannot get scroll options when there is no collection') : invariant(false) : void 0;
11127 return {
11128 entries: entries,
11129 collection: collection
11130 };
11131 }
11132 });
11133
11134 var registerDraggable = function registerDraggable(descriptor, getDimension) {
11135 var entry = {
11136 descriptor: descriptor,
11137 getDimension: getDimension
11138 };
11139 entries.draggables[descriptor.id] = entry;
11140
11141 if (!collection) {
11142 return;
11143 }
11144
11145 if (collection.critical.draggable.type !== descriptor.type) {
11146 return;
11147 }
11148
11149 publisher.addDraggable(descriptor.id);
11150 };
11151
11152 var updateDraggable = function updateDraggable(previous, descriptor, getDimension) {
11153 !entries.draggables[previous.id] ? process.env.NODE_ENV !== "production" ? invariant(false, 'Cannot update draggable registration as no previous registration was found') : invariant(false) : void 0;
11154 delete entries.draggables[previous.id];
11155 var entry = {
11156 descriptor: descriptor,
11157 getDimension: getDimension
11158 };
11159 entries.draggables[descriptor.id] = entry;
11160 };
11161
11162 var unregisterDraggable = function unregisterDraggable(descriptor) {
11163 var entry = entries.draggables[descriptor.id];
11164 !entry ? process.env.NODE_ENV !== "production" ? invariant(false, "Cannot unregister Draggable with id " + descriptor.id + " as it is not registered") : invariant(false) : void 0;
11165
11166 if (entry.descriptor !== descriptor) {
11167 return;
11168 }
11169
11170 delete entries.draggables[descriptor.id];
11171
11172 if (!collection) {
11173 return;
11174 }
11175
11176 !(collection.critical.draggable.id !== descriptor.id) ? process.env.NODE_ENV !== "production" ? invariant(false, 'Cannot remove the dragging item during a drag') : invariant(false) : void 0;
11177
11178 if (descriptor.type !== collection.critical.draggable.type) {
11179 return;
11180 }
11181
11182 publisher.removeDraggable(descriptor.id);
11183 };
11184
11185 var registerDroppable = function registerDroppable(descriptor, droppableCallbacks) {
11186 var id = descriptor.id;
11187 entries.droppables[id] = {
11188 descriptor: descriptor,
11189 callbacks: droppableCallbacks
11190 };
11191
11192 if (!collection) {
11193 return;
11194 }
11195
11196 if (descriptor.type !== collection.critical.droppable.type) {
11197 return;
11198 }
11199
11200 publisher.addDroppable(id);
11201 };
11202
11203 var updateDroppable = function updateDroppable(previous, descriptor, droppableCallbacks) {
11204 !entries.droppables[previous.id] ? process.env.NODE_ENV !== "production" ? invariant(false, 'Cannot update droppable registration as no previous registration was found') : invariant(false) : void 0;
11205 delete entries.droppables[previous.id];
11206 var entry = {
11207 descriptor: descriptor,
11208 callbacks: droppableCallbacks
11209 };
11210 entries.droppables[descriptor.id] = entry;
11211
11212 if (collection) {
11213 process.env.NODE_ENV !== "production" ? invariant(false, 'You are not able to update the id or type of a droppable during a drag') : invariant(false);
11214 }
11215 };
11216
11217 var unregisterDroppable = function unregisterDroppable(descriptor) {
11218 var entry = entries.droppables[descriptor.id];
11219 !entry ? process.env.NODE_ENV !== "production" ? invariant(false, "Cannot unregister Droppable with id " + descriptor.id + " as as it is not registered") : invariant(false) : void 0;
11220
11221 if (entry.descriptor !== descriptor) {
11222 return;
11223 }
11224
11225 delete entries.droppables[descriptor.id];
11226
11227 if (!collection) {
11228 return;
11229 }
11230
11231 !(collection.critical.droppable.id !== descriptor.id) ? process.env.NODE_ENV !== "production" ? invariant(false, 'Cannot remove the home Droppable during a drag') : invariant(false) : void 0;
11232
11233 if (collection.critical.droppable.type !== descriptor.type) {
11234 return;
11235 }
11236
11237 publisher.removeDroppable(descriptor.id);
11238 };
11239
11240 var updateDroppableIsEnabled = function updateDroppableIsEnabled(id, isEnabled) {
11241 !entries.droppables[id] ? process.env.NODE_ENV !== "production" ? invariant(false, "Cannot update the scroll on Droppable " + id + " as it is not registered") : invariant(false) : void 0;
11242
11243 if (!collection) {
11244 return;
11245 }
11246
11247 callbacks.updateDroppableIsEnabled({
11248 id: id,
11249 isEnabled: isEnabled
11250 });
11251 };
11252
11253 var updateDroppableScroll = function updateDroppableScroll(id, newScroll) {
11254 !entries.droppables[id] ? process.env.NODE_ENV !== "production" ? invariant(false, "Cannot update the scroll on Droppable " + id + " as it is not registered") : invariant(false) : void 0;
11255
11256 if (!collection) {
11257 return;
11258 }
11259
11260 callbacks.updateDroppableScroll({
11261 id: id,
11262 offset: newScroll
11263 });
11264 };
11265
11266 var scrollDroppable = function scrollDroppable(id, change) {
11267 var entry = entries.droppables[id];
11268 !entry ? process.env.NODE_ENV !== "production" ? invariant(false, "Cannot scroll Droppable " + id + " as it is not registered") : invariant(false) : void 0;
11269
11270 if (!collection) {
11271 return;
11272 }
11273
11274 entry.callbacks.scroll(change);
11275 };
11276
11277 var getInitialPublish = function getInitialPublish(args) {
11278 var critical = args.critical,
11279 scrollOptions = args.scrollOptions,
11280 windowScroll = args.initialWindowScroll;
11281 var timingKey = 'Initial collection from DOM';
11282 start(timingKey);
11283 var home = critical.droppable;
11284
11285 var droppables = _Object$keys(entries.droppables).map(function (id) {
11286 return entries.droppables[id];
11287 }).filter(function (entry) {
11288 return entry.descriptor.type === home.type;
11289 }).map(function (entry) {
11290 return entry.callbacks.getDimensionAndWatchScroll(windowScroll, scrollOptions);
11291 }).reduce(function (previous, dimension) {
11292 previous[dimension.descriptor.id] = dimension;
11293 return previous;
11294 }, {});
11295
11296 var draggables = _Object$keys(entries.draggables).map(function (id) {
11297 return entries.draggables[id];
11298 }).filter(function (entry) {
11299 return entry.descriptor.type === critical.draggable.type;
11300 }).map(function (entry) {
11301 return entry.getDimension(windowScroll);
11302 }).reduce(function (previous, dimension) {
11303 previous[dimension.descriptor.id] = dimension;
11304 return previous;
11305 }, {});
11306
11307 finish(timingKey);
11308 var dimensions = {
11309 draggables: draggables,
11310 droppables: droppables
11311 };
11312 var result = {
11313 dimensions: dimensions,
11314 critical: critical
11315 };
11316 return result;
11317 };
11318
11319 var stopPublishing = function stopPublishing() {
11320 if (!collection) {
11321 return;
11322 }
11323
11324 publisher.stop();
11325 var home = collection.critical.droppable;
11326
11327 _Object$keys(entries.droppables).filter(function (id) {
11328 return entries.droppables[id].descriptor.type === home.type;
11329 }).forEach(function (id) {
11330 return entries.droppables[id].callbacks.unwatchScroll();
11331 });
11332
11333 collection = null;
11334 };
11335
11336 var startPublishing = function startPublishing(request, windowScroll) {
11337 !!collection ? process.env.NODE_ENV !== "production" ? invariant(false, 'Cannot start capturing critical dimensions as there is already a collection') : invariant(false) : void 0;
11338 var entry = entries.draggables[request.draggableId];
11339 !entry ? process.env.NODE_ENV !== "production" ? invariant(false, 'Cannot find critical draggable entry') : invariant(false) : void 0;
11340 var home = entries.droppables[entry.descriptor.droppableId];
11341 !home ? process.env.NODE_ENV !== "production" ? invariant(false, 'Cannot find critical droppable entry') : invariant(false) : void 0;
11342 var critical = {
11343 draggable: entry.descriptor,
11344 droppable: home.descriptor
11345 };
11346 collection = {
11347 scrollOptions: request.scrollOptions,
11348 critical: critical,
11349 initialWindowScroll: windowScroll
11350 };
11351 return getInitialPublish(collection);
11352 };
11353
11354 var marshal = {
11355 registerDraggable: registerDraggable,
11356 updateDraggable: updateDraggable,
11357 unregisterDraggable: unregisterDraggable,
11358 registerDroppable: registerDroppable,
11359 updateDroppable: updateDroppable,
11360 unregisterDroppable: unregisterDroppable,
11361 updateDroppableIsEnabled: updateDroppableIsEnabled,
11362 scrollDroppable: scrollDroppable,
11363 updateDroppableScroll: updateDroppableScroll,
11364 startPublishing: startPublishing,
11365 stopPublishing: stopPublishing
11366 };
11367 return marshal;
11368 });
11369
11370 var physics = function () {
11371 var base = {
11372 stiffness: 1000,
11373 damping: 60,
11374 precision: 0.99
11375 };
11376
11377 var standard = _extends({}, base);
11378
11379 var fast = _extends({}, base, {
11380 stiffness: base.stiffness * 2
11381 });
11382
11383 return {
11384 standard: standard,
11385 fast: fast
11386 };
11387 }();
11388 var css = {
11389 outOfTheWay: 'transform 0.2s cubic-bezier(0.2, 0, 0, 1)'
11390 };
11391
11392 var prefix = 'data-react-beautiful-dnd';
11393 var dragHandle = prefix + "-drag-handle";
11394 var draggable = prefix + "-draggable";
11395 var droppable = prefix + "-droppable";
11396
11397 var getStyles = (function (styleContext) {
11398 var dragHandleSelector = "[" + dragHandle + "=\"" + styleContext + "\"]";
11399 var draggableSelector = "[" + draggable + "=\"" + styleContext + "\"]";
11400 var droppableSelector = "[" + droppable + "=\"" + styleContext + "\"]";
11401 var dragHandleStyles = {
11402 base: "\n " + dragHandleSelector + " {\n -webkit-touch-callout: none;\n -webkit-tap-highlight-color: rgba(0,0,0,0);\n touch-action: manipulation;\n }\n ",
11403 grabCursor: "\n " + dragHandleSelector + " {\n cursor: -webkit-grab;\n cursor: grab;\n }\n ",
11404 blockPointerEvents: "\n " + dragHandleSelector + " {\n pointer-events: none;\n }\n "
11405 };
11406 var draggableStyles = {
11407 animateMovement: "\n " + draggableSelector + " {\n transition: " + css.outOfTheWay + ";\n }\n "
11408 };
11409 var droppableStyles = {
11410 base: "\n " + droppableSelector + " {\n overflow-anchor: none;\n }\n "
11411 };
11412 var bodyStyles = {
11413 whileActiveDragging: "\n body {\n cursor: grabbing;\n cursor: -webkit-grabbing;\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n }\n "
11414 };
11415 var base = [dragHandleStyles.base, droppableStyles.base];
11416 var resting = base.concat([dragHandleStyles.grabCursor]);
11417 var collecting = base.concat([dragHandleStyles.blockPointerEvents, bodyStyles.whileActiveDragging]);
11418 var dragging = collecting.concat([draggableStyles.animateMovement]);
11419 var dropAnimating = base.concat([dragHandleStyles.grabCursor, draggableStyles.animateMovement]);
11420 var userCancel = base.concat([draggableStyles.animateMovement]);
11421 return {
11422 resting: resting.join(''),
11423 dragging: dragging.join(''),
11424 dropAnimating: dropAnimating.join(''),
11425 collecting: collecting.join(''),
11426 userCancel: userCancel.join('')
11427 };
11428 });
11429
11430 var count = 0;
11431 var resetStyleContext = function resetStyleContext() {
11432 count = 0;
11433 };
11434
11435 var getHead = function getHead() {
11436 var head = document.querySelector('head');
11437 !head ? process.env.NODE_ENV !== "production" ? invariant(false, 'Cannot find the head to append a style to') : invariant(false) : void 0;
11438 return head;
11439 };
11440
11441 var createStyleMarshal = (function () {
11442 var context = "" + count++;
11443 var styles = getStyles(context);
11444 var el = null;
11445 var setStyle = memoizeOne(function (proposed) {
11446 !el ? process.env.NODE_ENV !== "production" ? invariant(false, 'Cannot set style of style tag if not mounted') : invariant(false) : void 0;
11447 el.innerHTML = proposed;
11448 });
11449
11450 var mount = function mount() {
11451 !!el ? process.env.NODE_ENV !== "production" ? invariant(false, 'Style marshal already mounted') : invariant(false) : void 0;
11452 el = document.createElement('style');
11453 el.type = 'text/css';
11454 el.setAttribute(prefix, context);
11455 getHead().appendChild(el);
11456 setStyle(styles.resting);
11457 };
11458
11459 var collecting = function collecting() {
11460 return setStyle(styles.collecting);
11461 };
11462
11463 var dragging = function dragging() {
11464 return setStyle(styles.dragging);
11465 };
11466
11467 var dropping = function dropping(reason) {
11468 if (reason === 'DROP') {
11469 setStyle(styles.dropAnimating);
11470 return;
11471 }
11472
11473 setStyle(styles.userCancel);
11474 };
11475
11476 var resting = function resting() {
11477 return setStyle(styles.resting);
11478 };
11479
11480 var unmount = function unmount() {
11481 !el ? process.env.NODE_ENV !== "production" ? invariant(false, 'Cannot unmount style marshal as it is already unmounted') : invariant(false) : void 0;
11482 getHead().removeChild(el);
11483 el = null;
11484 };
11485
11486 var marshal = {
11487 collecting: collecting,
11488 dragging: dragging,
11489 dropping: dropping,
11490 resting: resting,
11491 styleContext: context,
11492 mount: mount,
11493 unmount: unmount
11494 };
11495 return marshal;
11496 });
11497
11498 var canStartDrag = (function (state, id) {
11499 if (state.phase === 'IDLE') {
11500 return true;
11501 }
11502
11503 if (state.phase !== 'DROP_ANIMATING') {
11504 return false;
11505 }
11506
11507 if (state.pending.result.draggableId === id) {
11508 return false;
11509 }
11510
11511 return state.pending.result.reason === 'DROP';
11512 });
11513
11514 var scrollWindow = (function (change) {
11515 window.scrollBy(change.x, change.y);
11516 });
11517
11518 var count$1 = 0;
11519 var visuallyHidden = {
11520 position: 'absolute',
11521 width: '1px',
11522 height: '1px',
11523 margin: '-1px',
11524 border: '0',
11525 padding: '0',
11526 overflow: 'hidden',
11527 clip: 'rect(0 0 0 0)',
11528 'clip-path': 'inset(100%)'
11529 };
11530
11531 var getBody = function getBody() {
11532 !document.body ? process.env.NODE_ENV !== "production" ? invariant(false, 'Announcer cannot find document.body') : invariant(false) : void 0;
11533 return document.body;
11534 };
11535
11536 var createAnnouncer = (function () {
11537 var id = "react-beautiful-dnd-announcement-" + count$1++;
11538 var el = null;
11539
11540 var announce = function announce(message) {
11541 !el ? process.env.NODE_ENV !== "production" ? invariant(false, 'Cannot announce to unmounted node') : invariant(false) : void 0;
11542 el.textContent = message;
11543 };
11544
11545 var mount = function mount() {
11546 !!el ? process.env.NODE_ENV !== "production" ? invariant(false, 'Announcer already mounted') : invariant(false) : void 0;
11547 el = document.createElement('div');
11548 el.id = id;
11549 el.setAttribute('aria-live', 'assertive');
11550 el.setAttribute('role', 'log');
11551 el.setAttribute('aria-atomic', 'true');
11552
11553 _Object$assign(el.style, visuallyHidden);
11554
11555 getBody().appendChild(el);
11556 };
11557
11558 var unmount = function unmount() {
11559 !el ? process.env.NODE_ENV !== "production" ? invariant(false, 'Will not unmount annoucer as it is already unmounted') : invariant(false) : void 0;
11560 getBody().removeChild(el);
11561 el = null;
11562 };
11563
11564 var announcer = {
11565 announce: announce,
11566 id: id,
11567 mount: mount,
11568 unmount: unmount
11569 };
11570 return announcer;
11571 });
11572
11573 var getScrollableDroppables = memoizeOne(function (droppables) {
11574 return toDroppableList(droppables).filter(function (droppable) {
11575 if (!droppable.isEnabled) {
11576 return false;
11577 }
11578
11579 if (!droppable.viewport.closestScrollable) {
11580 return false;
11581 }
11582
11583 return true;
11584 });
11585 });
11586
11587 var getScrollableDroppableOver = function getScrollableDroppableOver(target, droppables) {
11588 var maybe = getScrollableDroppables(droppables).find(function (droppable) {
11589 !droppable.viewport.closestScrollable ? process.env.NODE_ENV !== "production" ? invariant(false, 'Invalid result') : invariant(false) : void 0;
11590 return isPositionInFrame(droppable.viewport.closestScrollable.framePageMarginBox)(target);
11591 });
11592 return maybe;
11593 };
11594
11595 var getBestScrollableDroppable = (function (_ref) {
11596 var center = _ref.center,
11597 destination = _ref.destination,
11598 droppables = _ref.droppables;
11599
11600 if (destination) {
11601 var _dimension = droppables[destination.droppableId];
11602
11603 if (!_dimension.viewport.closestScrollable) {
11604 return null;
11605 }
11606
11607 return _dimension;
11608 }
11609
11610 var dimension = getScrollableDroppableOver(center, droppables);
11611 return dimension;
11612 });
11613
11614 var smallestSigned = apply(function (value) {
11615 if (value === 0) {
11616 return 0;
11617 }
11618
11619 return value > 0 ? 1 : -1;
11620 });
11621 var getOverlap = function () {
11622 var getRemainder = function getRemainder(target, max) {
11623 if (target < 0) {
11624 return target;
11625 }
11626
11627 if (target > max) {
11628 return target - max;
11629 }
11630
11631 return 0;
11632 };
11633
11634 return function (_ref) {
11635 var current = _ref.current,
11636 max = _ref.max,
11637 change = _ref.change;
11638 var targetScroll = add(current, change);
11639 var overlap = {
11640 x: getRemainder(targetScroll.x, max.x),
11641 y: getRemainder(targetScroll.y, max.y)
11642 };
11643
11644 if (isEqual(overlap, origin)) {
11645 return null;
11646 }
11647
11648 return overlap;
11649 };
11650 }();
11651 var canPartiallyScroll = function canPartiallyScroll(_ref2) {
11652 var rawMax = _ref2.max,
11653 current = _ref2.current,
11654 change = _ref2.change;
11655 var max = {
11656 x: Math.max(current.x, rawMax.x),
11657 y: Math.max(current.y, rawMax.y)
11658 };
11659 var smallestChange = smallestSigned(change);
11660 var overlap = getOverlap({
11661 max: max,
11662 current: current,
11663 change: smallestChange
11664 });
11665
11666 if (!overlap) {
11667 return true;
11668 }
11669
11670 if (smallestChange.x !== 0 && overlap.x === 0) {
11671 return true;
11672 }
11673
11674 if (smallestChange.y !== 0 && overlap.y === 0) {
11675 return true;
11676 }
11677
11678 return false;
11679 };
11680 var canScrollWindow = function canScrollWindow(viewport, change) {
11681 return canPartiallyScroll({
11682 current: viewport.scroll.current,
11683 max: viewport.scroll.max,
11684 change: change
11685 });
11686 };
11687 var getWindowOverlap = function getWindowOverlap(viewport, change) {
11688 if (!canScrollWindow(viewport, change)) {
11689 return null;
11690 }
11691
11692 var max = viewport.scroll.max;
11693 var current = viewport.scroll.current;
11694 return getOverlap({
11695 current: current,
11696 max: max,
11697 change: change
11698 });
11699 };
11700 var canScrollDroppable = function canScrollDroppable(droppable, change) {
11701 var closest$$1 = droppable.viewport.closestScrollable;
11702
11703 if (!closest$$1) {
11704 return false;
11705 }
11706
11707 return canPartiallyScroll({
11708 current: closest$$1.scroll.current,
11709 max: closest$$1.scroll.max,
11710 change: change
11711 });
11712 };
11713 var getDroppableOverlap = function getDroppableOverlap(droppable, change) {
11714 var closest$$1 = droppable.viewport.closestScrollable;
11715
11716 if (!closest$$1) {
11717 return null;
11718 }
11719
11720 if (!canScrollDroppable(droppable, change)) {
11721 return null;
11722 }
11723
11724 return getOverlap({
11725 current: closest$$1.scroll.current,
11726 max: closest$$1.scroll.max,
11727 change: change
11728 });
11729 };
11730
11731 var config = {
11732 startFrom: 0.25,
11733 maxSpeedAt: 0.05,
11734 maxScrollSpeed: 28,
11735 ease: function ease(percentage) {
11736 return Math.pow(percentage, 2);
11737 }
11738 };
11739 var clean$1 = apply(function (value) {
11740 return value === 0 ? 0 : value;
11741 });
11742 var getPixelThresholds = function getPixelThresholds(container, axis) {
11743 var startFrom = container[axis.size] * config.startFrom;
11744 var maxSpeedAt = container[axis.size] * config.maxSpeedAt;
11745 var accelerationPlane = startFrom - maxSpeedAt;
11746 var thresholds = {
11747 startFrom: startFrom,
11748 maxSpeedAt: maxSpeedAt,
11749 accelerationPlane: accelerationPlane
11750 };
11751 return thresholds;
11752 };
11753
11754 var getSpeed = function getSpeed(distance$$1, thresholds) {
11755 if (distance$$1 >= thresholds.startFrom) {
11756 return 0;
11757 }
11758
11759 if (distance$$1 <= thresholds.maxSpeedAt) {
11760 return config.maxScrollSpeed;
11761 }
11762
11763 var distancePastStart = thresholds.startFrom - distance$$1;
11764 var percentage = distancePastStart / thresholds.accelerationPlane;
11765 var transformed = config.ease(percentage);
11766 var speed = config.maxScrollSpeed * transformed;
11767 return speed;
11768 };
11769
11770 var adjustForSizeLimits = function adjustForSizeLimits(_ref) {
11771 var container = _ref.container,
11772 subject = _ref.subject,
11773 proposedScroll = _ref.proposedScroll;
11774 var isTooBigVertically = subject.height > container.height;
11775 var isTooBigHorizontally = subject.width > container.width;
11776
11777 if (!isTooBigHorizontally && !isTooBigVertically) {
11778 return proposedScroll;
11779 }
11780
11781 if (isTooBigHorizontally && isTooBigVertically) {
11782 return null;
11783 }
11784
11785 return {
11786 x: isTooBigHorizontally ? 0 : proposedScroll.x,
11787 y: isTooBigVertically ? 0 : proposedScroll.y
11788 };
11789 };
11790
11791 var getRequiredScroll = function getRequiredScroll(_ref2) {
11792 var container = _ref2.container,
11793 subject = _ref2.subject,
11794 center = _ref2.center;
11795 var distance$$1 = {
11796 top: center.y - container.top,
11797 right: container.right - center.x,
11798 bottom: container.bottom - center.y,
11799 left: center.x - container.left
11800 };
11801
11802 var y = function () {
11803 var thresholds = getPixelThresholds(container, vertical);
11804 var isCloserToBottom = distance$$1.bottom < distance$$1.top;
11805
11806 if (isCloserToBottom) {
11807 return getSpeed(distance$$1.bottom, thresholds);
11808 }
11809
11810 return -1 * getSpeed(distance$$1.top, thresholds);
11811 }();
11812
11813 var x = function () {
11814 var thresholds = getPixelThresholds(container, horizontal);
11815 var isCloserToRight = distance$$1.right < distance$$1.left;
11816
11817 if (isCloserToRight) {
11818 return getSpeed(distance$$1.right, thresholds);
11819 }
11820
11821 return -1 * getSpeed(distance$$1.left, thresholds);
11822 }();
11823
11824 var required = clean$1({
11825 x: x,
11826 y: y
11827 });
11828
11829 if (isEqual(required, origin)) {
11830 return null;
11831 }
11832
11833 var limited = adjustForSizeLimits({
11834 container: container,
11835 subject: subject,
11836 proposedScroll: required
11837 });
11838
11839 if (!limited) {
11840 return null;
11841 }
11842
11843 return isEqual(limited, origin) ? null : limited;
11844 };
11845
11846 var withPlaceholder = function withPlaceholder(droppable, draggable) {
11847 var closest$$1 = droppable.viewport.closestScrollable;
11848
11849 if (!closest$$1) {
11850 return null;
11851 }
11852
11853 var isOverHome = droppable.descriptor.id === draggable.descriptor.droppableId;
11854 var max = closest$$1.scroll.max;
11855 var current = closest$$1.scroll.current;
11856
11857 if (isOverHome) {
11858 return {
11859 max: max,
11860 current: current
11861 };
11862 }
11863
11864 var spaceForPlaceholder = patch(droppable.axis.line, draggable.placeholder.client.borderBox[droppable.axis.size]);
11865 var newMax = add(max, spaceForPlaceholder);
11866 var newCurrent = {
11867 x: Math.min(current.x, newMax.x),
11868 y: Math.min(current.y, newMax.y)
11869 };
11870 return {
11871 max: newMax,
11872 current: newCurrent
11873 };
11874 };
11875
11876 var createFluidScroller = (function (_ref3) {
11877 var scrollWindow = _ref3.scrollWindow,
11878 scrollDroppable = _ref3.scrollDroppable;
11879 var scheduleWindowScroll = rafSchd(scrollWindow);
11880 var scheduleDroppableScroll = rafSchd(scrollDroppable);
11881
11882 var scroller = function scroller(state) {
11883 var center = state.current.page.borderBoxCenter;
11884 var draggable = state.dimensions.draggables[state.critical.draggable.id];
11885 var subject = draggable.page.marginBox;
11886 var viewport = state.viewport;
11887 var requiredWindowScroll = getRequiredScroll({
11888 container: viewport.frame,
11889 subject: subject,
11890 center: center
11891 });
11892
11893 if (requiredWindowScroll && canScrollWindow(viewport, requiredWindowScroll)) {
11894 scheduleWindowScroll(requiredWindowScroll);
11895 return;
11896 }
11897
11898 var droppable = getBestScrollableDroppable({
11899 center: center,
11900 destination: state.impact.destination,
11901 droppables: state.dimensions.droppables
11902 });
11903
11904 if (!droppable) {
11905 return;
11906 }
11907
11908 var closestScrollable = droppable.viewport.closestScrollable;
11909
11910 if (!closestScrollable) {
11911 return;
11912 }
11913
11914 var requiredFrameScroll = getRequiredScroll({
11915 container: closestScrollable.framePageMarginBox,
11916 subject: subject,
11917 center: center
11918 });
11919
11920 if (!requiredFrameScroll) {
11921 return;
11922 }
11923
11924 var result = withPlaceholder(droppable, draggable);
11925
11926 if (!result) {
11927 return;
11928 }
11929
11930 var closest$$1 = droppable.viewport.closestScrollable;
11931
11932 if (!closest$$1) {
11933 return;
11934 }
11935
11936 var canScrollDroppable$$1 = canPartiallyScroll({
11937 current: result.current,
11938 max: result.max,
11939 change: requiredFrameScroll
11940 });
11941
11942 if (canScrollDroppable$$1) {
11943 scheduleDroppableScroll(droppable.descriptor.id, requiredFrameScroll);
11944 }
11945 };
11946
11947 scroller.cancel = function () {
11948 scheduleWindowScroll.cancel();
11949 scheduleDroppableScroll.cancel();
11950 };
11951
11952 return scroller;
11953 });
11954
11955 var createJumpScroller = (function (_ref) {
11956 var move = _ref.move,
11957 scrollDroppable = _ref.scrollDroppable,
11958 scrollWindow = _ref.scrollWindow;
11959
11960 var moveByOffset = function moveByOffset(state, offset) {
11961 var client = add(state.current.client.selection, offset);
11962 move({
11963 client: client,
11964 shouldAnimate: true
11965 });
11966 };
11967
11968 var scrollDroppableAsMuchAsItCan = function scrollDroppableAsMuchAsItCan(droppable, change) {
11969 if (!canScrollDroppable(droppable, change)) {
11970 return change;
11971 }
11972
11973 var overlap = getDroppableOverlap(droppable, change);
11974
11975 if (!overlap) {
11976 scrollDroppable(droppable.descriptor.id, change);
11977 return null;
11978 }
11979
11980 var whatTheDroppableCanScroll = subtract(change, overlap);
11981 scrollDroppable(droppable.descriptor.id, whatTheDroppableCanScroll);
11982 var remainder = subtract(change, whatTheDroppableCanScroll);
11983 return remainder;
11984 };
11985
11986 var scrollWindowAsMuchAsItCan = function scrollWindowAsMuchAsItCan(viewport, change) {
11987 if (!canScrollWindow(viewport, change)) {
11988 return change;
11989 }
11990
11991 var overlap = getWindowOverlap(viewport, change);
11992
11993 if (!overlap) {
11994 scrollWindow(change);
11995 return null;
11996 }
11997
11998 var whatTheWindowCanScroll = subtract(change, overlap);
11999 scrollWindow(whatTheWindowCanScroll);
12000 var remainder = subtract(change, whatTheWindowCanScroll);
12001 return remainder;
12002 };
12003
12004 var jumpScroller = function jumpScroller(state) {
12005 var request = state.scrollJumpRequest;
12006
12007 if (!request) {
12008 return;
12009 }
12010
12011 var destination = state.impact.destination;
12012 !destination ? process.env.NODE_ENV !== "production" ? invariant(false, 'Cannot perform a jump scroll when there is no destination') : invariant(false) : void 0;
12013 var droppableRemainder = scrollDroppableAsMuchAsItCan(state.dimensions.droppables[destination.droppableId], request);
12014
12015 if (!droppableRemainder) {
12016 return;
12017 }
12018
12019 var viewport = state.viewport;
12020 var windowRemainder = scrollWindowAsMuchAsItCan(viewport, droppableRemainder);
12021
12022 if (!windowRemainder) {
12023 return;
12024 }
12025
12026 moveByOffset(state, windowRemainder);
12027 };
12028
12029 return jumpScroller;
12030 });
12031
12032 var createAutoScroller = (function (_ref) {
12033 var scrollDroppable = _ref.scrollDroppable,
12034 scrollWindow = _ref.scrollWindow,
12035 move = _ref.move;
12036 var fluidScroll = createFluidScroller({
12037 scrollWindow: scrollWindow,
12038 scrollDroppable: scrollDroppable
12039 });
12040 var jumpScroll = createJumpScroller({
12041 move: move,
12042 scrollWindow: scrollWindow,
12043 scrollDroppable: scrollDroppable
12044 });
12045 var marshal = {
12046 cancel: fluidScroll.cancel,
12047 fluidScroll: fluidScroll,
12048 jumpScroll: jumpScroll
12049 };
12050 return marshal;
12051 });
12052
12053 var prefix$1 = function prefix(key) {
12054 return "private-react-beautiful-dnd-key-do-not-use-" + key;
12055 };
12056
12057 var storeKey = prefix$1('store');
12058 var droppableIdKey = prefix$1('droppable-id');
12059 var droppableTypeKey = prefix$1('droppable-type');
12060 var dimensionMarshalKey = prefix$1('dimension-marshal');
12061 var styleContextKey = prefix$1('style-context');
12062 var canLiftContextKey = prefix$1('can-lift');
12063
12064 var _DragDropContext$chil;
12065 var resetServerContext = function resetServerContext() {
12066 resetStyleContext();
12067 };
12068
12069 var printFatalDevError = function printFatalDevError(error) {
12070 if (process.env.NODE_ENV === 'production') {
12071 return;
12072 }
12073
12074 console.warn("\n An error has occurred while a drag is occurring.\n Any existing drag will be cancelled.\n\n Raw error:\n ");
12075 console.error(error);
12076 };
12077
12078 var DragDropContext = function (_React$Component) {
12079 _inheritsLoose(DragDropContext, _React$Component);
12080
12081 function DragDropContext(props, context) {
12082 var _this;
12083
12084 _this = _React$Component.call(this, props, context) || this;
12085 _this.store = void 0;
12086 _this.dimensionMarshal = void 0;
12087 _this.styleMarshal = void 0;
12088 _this.autoScroller = void 0;
12089 _this.announcer = void 0;
12090 _this.unsubscribe = void 0;
12091
12092 _this.canLift = function (id) {
12093 return canStartDrag(_this.store.getState(), id);
12094 };
12095
12096 _this.onFatalError = function (error) {
12097 printFatalDevError(error);
12098
12099 var state = _this.store.getState();
12100
12101 if (state.phase !== 'IDLE') {
12102 _this.store.dispatch(clean());
12103 }
12104 };
12105
12106 _this.onWindowError = function (error) {
12107 return _this.onFatalError(error);
12108 };
12109
12110 _this.announcer = createAnnouncer();
12111 _this.styleMarshal = createStyleMarshal();
12112 _this.store = createStore({
12113 getDimensionMarshal: function getDimensionMarshal() {
12114 return _this.dimensionMarshal;
12115 },
12116 styleMarshal: _this.styleMarshal,
12117 getHooks: function getHooks() {
12118 return {
12119 onBeforeDragStart: _this.props.onBeforeDragStart,
12120 onDragStart: _this.props.onDragStart,
12121 onDragEnd: _this.props.onDragEnd,
12122 onDragUpdate: _this.props.onDragUpdate
12123 };
12124 },
12125 announce: _this.announcer.announce,
12126 getScroller: function getScroller() {
12127 return _this.autoScroller;
12128 }
12129 });
12130 var callbacks = redux.bindActionCreators({
12131 collectionStarting: collectionStarting,
12132 publish: publish,
12133 updateDroppableScroll: updateDroppableScroll,
12134 updateDroppableIsEnabled: updateDroppableIsEnabled
12135 }, _this.store.dispatch);
12136 _this.dimensionMarshal = createDimensionMarshal(callbacks);
12137 _this.autoScroller = createAutoScroller(_extends({
12138 scrollWindow: scrollWindow,
12139 scrollDroppable: _this.dimensionMarshal.scrollDroppable
12140 }, redux.bindActionCreators({
12141 move: move
12142 }, _this.store.dispatch)));
12143 return _this;
12144 }
12145
12146 var _proto = DragDropContext.prototype;
12147
12148 _proto.getChildContext = function getChildContext() {
12149 var _ref;
12150
12151 return _ref = {}, _ref[storeKey] = this.store, _ref[dimensionMarshalKey] = this.dimensionMarshal, _ref[styleContextKey] = this.styleMarshal.styleContext, _ref[canLiftContextKey] = this.canLift, _ref;
12152 };
12153
12154 _proto.componentDidMount = function componentDidMount() {
12155 window.addEventListener('error', this.onWindowError);
12156 this.styleMarshal.mount();
12157 this.announcer.mount();
12158 };
12159
12160 _proto.componentDidCatch = function componentDidCatch(error) {
12161 this.onFatalError(error);
12162
12163 if (error.message.indexOf('Invariant failed') !== -1) {
12164 this.setState({});
12165 return;
12166 }
12167
12168 throw error;
12169 };
12170
12171 _proto.componentWillUnmount = function componentWillUnmount() {
12172 window.removeEventListener('error', this.onWindowError);
12173 var state = this.store.getState();
12174
12175 if (state.phase !== 'IDLE') {
12176 this.store.dispatch(clean());
12177 }
12178
12179 this.styleMarshal.unmount();
12180 this.announcer.unmount();
12181 };
12182
12183 _proto.render = function render() {
12184 return this.props.children;
12185 };
12186
12187 return DragDropContext;
12188 }(React__default.Component);
12189
12190 DragDropContext.childContextTypes = (_DragDropContext$chil = {}, _DragDropContext$chil[storeKey] = PropTypes.shape({
12191 dispatch: PropTypes.func.isRequired,
12192 subscribe: PropTypes.func.isRequired,
12193 getState: PropTypes.func.isRequired
12194 }).isRequired, _DragDropContext$chil[dimensionMarshalKey] = PropTypes.object.isRequired, _DragDropContext$chil[styleContextKey] = PropTypes.string.isRequired, _DragDropContext$chil[canLiftContextKey] = PropTypes.func.isRequired, _DragDropContext$chil);
12195
12196 var isScrollable = function isScrollable() {
12197 for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) {
12198 values[_key] = arguments[_key];
12199 }
12200
12201 return values.some(function (value) {
12202 return value === 'auto' || value === 'scroll';
12203 });
12204 };
12205
12206 var isElementScrollable = function isElementScrollable(el) {
12207 var style = window.getComputedStyle(el);
12208 return isScrollable(style.overflow, style.overflowY, style.overflowX);
12209 };
12210
12211 var getClosestScrollable = function getClosestScrollable(el) {
12212 if (el == null) {
12213 return null;
12214 }
12215
12216 if (!isElementScrollable(el)) {
12217 return getClosestScrollable(el.parentElement);
12218 }
12219
12220 return el;
12221 };
12222
12223 var _DroppableDimensionPu;
12224
12225 var getScroll = function getScroll(el) {
12226 return {
12227 x: el.scrollLeft,
12228 y: el.scrollTop
12229 };
12230 };
12231
12232 var checkForNestedScrollContainers = function checkForNestedScrollContainers(scrollable) {
12233 if (process.env.NODE_ENV === 'production') {
12234 return;
12235 }
12236
12237 if (!scrollable) {
12238 return;
12239 }
12240
12241 var anotherScrollParent = getClosestScrollable(scrollable.parentElement);
12242
12243 if (!anotherScrollParent) {
12244 return;
12245 }
12246
12247 console.warn("\n Droppable: unsupported nested scroll container detected.\n A Droppable can only have one scroll parent (which can be itself)\n Nested scroll containers are currently not supported.\n\n We hope to support nested scroll containers soon: https://github.com/atlassian/react-beautiful-dnd/issues/131\n ");
12248 };
12249
12250 var listenerOptions = {
12251 passive: true
12252 };
12253
12254 var DroppableDimensionPublisher = function (_React$Component) {
12255 _inheritsLoose(DroppableDimensionPublisher, _React$Component);
12256
12257 function DroppableDimensionPublisher(props, context) {
12258 var _this;
12259
12260 _this = _React$Component.call(this, props, context) || this;
12261 _this.watchingScroll = null;
12262 _this.callbacks = void 0;
12263 _this.publishedDescriptor = null;
12264
12265 _this.getClosestScroll = function () {
12266 if (!_this.watchingScroll) {
12267 return origin;
12268 }
12269
12270 return getScroll(_this.watchingScroll.closestScrollable);
12271 };
12272
12273 _this.memoizedUpdateScroll = memoizeOne(function (x, y) {
12274 !_this.publishedDescriptor ? process.env.NODE_ENV !== "production" ? invariant(false, 'Cannot update scroll on unpublished droppable') : invariant(false) : void 0;
12275 var newScroll = {
12276 x: x,
12277 y: y
12278 };
12279 var marshal = _this.context[dimensionMarshalKey];
12280 marshal.updateDroppableScroll(_this.publishedDescriptor.id, newScroll);
12281 });
12282
12283 _this.updateScroll = function () {
12284 var offset = _this.getClosestScroll();
12285
12286 _this.memoizedUpdateScroll(offset.x, offset.y);
12287 };
12288
12289 _this.scheduleScrollUpdate = rafSchd(_this.updateScroll);
12290
12291 _this.onClosestScroll = function () {
12292 !_this.watchingScroll ? process.env.NODE_ENV !== "production" ? invariant(false, 'Could not find scroll options while scrolling') : invariant(false) : void 0;
12293 var options = _this.watchingScroll.options;
12294
12295 if (options.shouldPublishImmediately) {
12296 _this.updateScroll();
12297
12298 return;
12299 }
12300
12301 _this.scheduleScrollUpdate();
12302 };
12303
12304 _this.scroll = function (change) {
12305 !_this.watchingScroll ? process.env.NODE_ENV !== "production" ? invariant(false, 'Cannot scroll a droppable with no closest scrollable') : invariant(false) : void 0;
12306 var closestScrollable = _this.watchingScroll.closestScrollable;
12307 closestScrollable.scrollTop += change.y;
12308 closestScrollable.scrollLeft += change.x;
12309 };
12310
12311 _this.watchScroll = function (closestScrollable, options) {
12312 !!_this.watchingScroll ? process.env.NODE_ENV !== "production" ? invariant(false, 'Droppable cannot watch scroll as it is already watching scroll') : invariant(false) : void 0;
12313
12314 if (!closestScrollable) {
12315 return;
12316 }
12317
12318 _this.watchingScroll = {
12319 options: options,
12320 closestScrollable: closestScrollable
12321 };
12322 closestScrollable.addEventListener('scroll', _this.onClosestScroll, listenerOptions);
12323 };
12324
12325 _this.unwatchScroll = function () {
12326 var watching = _this.watchingScroll;
12327
12328 if (!watching) {
12329 return;
12330 }
12331
12332 _this.scheduleScrollUpdate.cancel();
12333
12334 watching.closestScrollable.removeEventListener('scroll', _this.onClosestScroll, listenerOptions);
12335 _this.watchingScroll = null;
12336 };
12337
12338 _this.getMemoizedDescriptor = memoizeOne(function (id, type) {
12339 return {
12340 id: id,
12341 type: type
12342 };
12343 });
12344
12345 _this.publish = function () {
12346 var marshal = _this.context[dimensionMarshalKey];
12347
12348 var descriptor = _this.getMemoizedDescriptor(_this.props.droppableId, _this.props.type);
12349
12350 if (!_this.publishedDescriptor) {
12351 marshal.registerDroppable(descriptor, _this.callbacks);
12352 _this.publishedDescriptor = descriptor;
12353 return;
12354 }
12355
12356 if (_this.publishedDescriptor === descriptor) {
12357 return;
12358 }
12359
12360 marshal.updateDroppable(_this.publishedDescriptor, descriptor, _this.callbacks);
12361 _this.publishedDescriptor = descriptor;
12362 };
12363
12364 _this.unpublish = function () {
12365 !_this.publishedDescriptor ? process.env.NODE_ENV !== "production" ? invariant(false, 'Cannot unpublish descriptor when none is published') : invariant(false) : void 0;
12366 var marshal = _this.context[dimensionMarshalKey];
12367 marshal.unregisterDroppable(_this.publishedDescriptor);
12368 _this.publishedDescriptor = null;
12369 };
12370
12371 _this.getDimensionAndWatchScroll = function (windowScroll, options) {
12372 var _this$props = _this.props,
12373 direction = _this$props.direction,
12374 ignoreContainerClipping = _this$props.ignoreContainerClipping,
12375 isDropDisabled = _this$props.isDropDisabled,
12376 getDroppableRef = _this$props.getDroppableRef;
12377 var targetRef = getDroppableRef();
12378 var descriptor = _this.publishedDescriptor;
12379 !targetRef ? process.env.NODE_ENV !== "production" ? invariant(false, 'Cannot calculate a dimension when not attached to the DOM') : invariant(false) : void 0;
12380 !descriptor ? process.env.NODE_ENV !== "production" ? invariant(false, 'Cannot get dimension for unpublished droppable') : invariant(false) : void 0;
12381 var scrollableRef = getClosestScrollable(targetRef);
12382 checkForNestedScrollContainers(scrollableRef);
12383
12384 _this.watchScroll(scrollableRef, options);
12385
12386 var client = function () {
12387 var base = cssBoxModel.getBox(targetRef);
12388
12389 if (!scrollableRef) {
12390 return base;
12391 }
12392
12393 if (targetRef !== scrollableRef) {
12394 return base;
12395 }
12396
12397 var top = base.paddingBox.top - scrollableRef.scrollTop;
12398 var left = base.paddingBox.left - scrollableRef.scrollLeft;
12399 var bottom = top + scrollableRef.scrollHeight;
12400 var right = left + scrollableRef.scrollWidth;
12401 var paddingBox = {
12402 top: top,
12403 right: right,
12404 bottom: bottom,
12405 left: left
12406 };
12407 var borderBox = {
12408 top: paddingBox.top - base.border.top,
12409 right: paddingBox.right + base.border.right,
12410 bottom: paddingBox.bottom + base.border.bottom,
12411 left: paddingBox.left - base.border.left
12412 };
12413 return cssBoxModel.createBox({
12414 borderBox: borderBox,
12415 margin: base.margin,
12416 border: base.border,
12417 padding: base.padding
12418 });
12419 }();
12420
12421 var page = cssBoxModel.withScroll(client, windowScroll);
12422
12423 var closest$$1 = function () {
12424 if (!scrollableRef) {
12425 return null;
12426 }
12427
12428 var frameClient = cssBoxModel.getBox(scrollableRef);
12429 return {
12430 client: frameClient,
12431 page: cssBoxModel.withScroll(frameClient),
12432 scrollHeight: scrollableRef.scrollHeight,
12433 scrollWidth: scrollableRef.scrollWidth,
12434 scroll: getScroll(scrollableRef),
12435 shouldClipSubject: !ignoreContainerClipping
12436 };
12437 }();
12438
12439 return getDroppableDimension({
12440 descriptor: descriptor,
12441 isEnabled: !isDropDisabled,
12442 direction: direction,
12443 client: client,
12444 page: page,
12445 closest: closest$$1
12446 });
12447 };
12448
12449 var callbacks = {
12450 getDimensionAndWatchScroll: _this.getDimensionAndWatchScroll,
12451 unwatchScroll: _this.unwatchScroll,
12452 scroll: _this.scroll
12453 };
12454 _this.callbacks = callbacks;
12455 return _this;
12456 }
12457
12458 var _proto = DroppableDimensionPublisher.prototype;
12459
12460 _proto.componentDidMount = function componentDidMount() {
12461 this.publish();
12462 };
12463
12464 _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
12465 this.publish();
12466
12467 if (this.props.isDropDisabled === prevProps.isDropDisabled) {
12468 return;
12469 }
12470
12471 var marshal = this.context[dimensionMarshalKey];
12472 marshal.updateDroppableIsEnabled(this.props.droppableId, !this.props.isDropDisabled);
12473 };
12474
12475 _proto.componentWillUnmount = function componentWillUnmount() {
12476 if (this.watchingScroll) {
12477 if (process.env.NODE_ENV !== 'production') {
12478 console.warn('Unmounting droppable while it was watching scroll');
12479 }
12480
12481 this.unwatchScroll();
12482 }
12483
12484 this.unpublish();
12485 };
12486
12487 _proto.render = function render() {
12488 return this.props.children;
12489 };
12490
12491 return DroppableDimensionPublisher;
12492 }(React__default.Component);
12493
12494 DroppableDimensionPublisher.contextTypes = (_DroppableDimensionPu = {}, _DroppableDimensionPu[dimensionMarshalKey] = PropTypes.object.isRequired, _DroppableDimensionPu);
12495
12496 var Placeholder = function (_PureComponent) {
12497 _inheritsLoose(Placeholder, _PureComponent);
12498
12499 function Placeholder() {
12500 return _PureComponent.apply(this, arguments) || this;
12501 }
12502
12503 var _proto = Placeholder.prototype;
12504
12505 _proto.componentDidMount = function componentDidMount() {
12506 if (this.props.onMount) {
12507 this.props.onMount();
12508 }
12509 };
12510
12511 _proto.componentWillUnmount = function componentWillUnmount() {
12512 if (this.props.onUnmount) {
12513 this.props.onUnmount();
12514 }
12515 };
12516
12517 _proto.render = function render() {
12518 var placeholder = this.props.placeholder;
12519 var client = placeholder.client,
12520 display = placeholder.display,
12521 tagName = placeholder.tagName;
12522 var style = {
12523 display: display,
12524 boxSizing: 'border-box',
12525 width: client.borderBox.width,
12526 height: client.borderBox.height,
12527 marginTop: client.margin.top,
12528 marginRight: client.margin.right,
12529 marginBottom: client.margin.bottom,
12530 marginLeft: client.margin.left,
12531 flexShrink: '0',
12532 flexGrow: '0',
12533 pointerEvents: 'none'
12534 };
12535 return React__default.createElement(tagName, {
12536 style: style
12537 });
12538 };
12539
12540 return Placeholder;
12541 }(React.PureComponent);
12542
12543 var throwIfRefIsInvalid = (function (ref) {
12544 !(ref && ref instanceof HTMLElement) ? process.env.NODE_ENV !== "production" ? invariant(false, "\n provided.innerRef has not been provided with a HTMLElement.\n\n You can find a guide on using the innerRef callback functions at:\n https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/guides/using-inner-ref.md\n ") : invariant(false) : void 0;
12545 });
12546
12547 var _Droppable$contextTyp, _Droppable$childConte;
12548
12549 var Droppable = function (_Component) {
12550 _inheritsLoose(Droppable, _Component);
12551
12552 function Droppable(props, context) {
12553 var _this;
12554
12555 _this = _Component.call(this, props, context) || this;
12556 _this.styleContext = void 0;
12557 _this.ref = null;
12558 _this.isPlaceholderMounted = false;
12559
12560 _this.onPlaceholderMount = function () {
12561 _this.isPlaceholderMounted = true;
12562 };
12563
12564 _this.onPlaceholderUnmount = function () {
12565 _this.isPlaceholderMounted = false;
12566 };
12567
12568 _this.setRef = function (ref) {
12569 if (ref === null) {
12570 return;
12571 }
12572
12573 if (ref === _this.ref) {
12574 return;
12575 }
12576
12577 _this.ref = ref;
12578 throwIfRefIsInvalid(ref);
12579 };
12580
12581 _this.getDroppableRef = function () {
12582 return _this.ref;
12583 };
12584
12585 _this.styleContext = context[styleContextKey];
12586 return _this;
12587 }
12588
12589 var _proto = Droppable.prototype;
12590
12591 _proto.getChildContext = function getChildContext() {
12592 var _value;
12593
12594 var value = (_value = {}, _value[droppableIdKey] = this.props.droppableId, _value[droppableTypeKey] = this.props.type, _value);
12595 return value;
12596 };
12597
12598 _proto.componentDidMount = function componentDidMount() {
12599 throwIfRefIsInvalid(this.ref);
12600 this.warnIfPlaceholderNotMounted();
12601 };
12602
12603 _proto.componentDidUpdate = function componentDidUpdate() {
12604 this.warnIfPlaceholderNotMounted();
12605 };
12606
12607 _proto.warnIfPlaceholderNotMounted = function warnIfPlaceholderNotMounted() {
12608 if (process.env.NODE_ENV === 'production') {
12609 return;
12610 }
12611
12612 if (!this.props.placeholder) {
12613 return;
12614 }
12615
12616 if (this.isPlaceholderMounted) {
12617 return;
12618 }
12619
12620 console.warn("\n Droppable setup issue: DroppableProvided > placeholder could not be found.\n Please be sure to add the {provided.placeholder} Node as a child of your Droppable\n\n More information: https://github.com/atlassian/react-beautiful-dnd#1-provided-droppableprovided\n ");
12621 };
12622
12623 _proto.getPlaceholder = function getPlaceholder() {
12624 if (!this.props.placeholder) {
12625 return null;
12626 }
12627
12628 return React__default.createElement(Placeholder, {
12629 placeholder: this.props.placeholder,
12630 onMount: this.onPlaceholderMount,
12631 onUnmount: this.onPlaceholderUnmount
12632 });
12633 };
12634
12635 _proto.render = function render() {
12636 var _this$props = this.props,
12637 children = _this$props.children,
12638 direction = _this$props.direction,
12639 droppableId = _this$props.droppableId,
12640 ignoreContainerClipping = _this$props.ignoreContainerClipping,
12641 isDraggingOver = _this$props.isDraggingOver,
12642 isDropDisabled = _this$props.isDropDisabled,
12643 draggingOverWith = _this$props.draggingOverWith,
12644 type = _this$props.type;
12645 var provided = {
12646 innerRef: this.setRef,
12647 placeholder: this.getPlaceholder(),
12648 droppableProps: {
12649 'data-react-beautiful-dnd-droppable': this.styleContext
12650 }
12651 };
12652 var snapshot = {
12653 isDraggingOver: isDraggingOver,
12654 draggingOverWith: draggingOverWith
12655 };
12656 return React__default.createElement(DroppableDimensionPublisher, {
12657 droppableId: droppableId,
12658 type: type,
12659 direction: direction,
12660 ignoreContainerClipping: ignoreContainerClipping,
12661 isDropDisabled: isDropDisabled,
12662 getDroppableRef: this.getDroppableRef
12663 }, children(provided, snapshot));
12664 };
12665
12666 return Droppable;
12667 }(React.Component);
12668
12669 Droppable.contextTypes = (_Droppable$contextTyp = {}, _Droppable$contextTyp[styleContextKey] = PropTypes.string.isRequired, _Droppable$contextTyp);
12670 Droppable.childContextTypes = (_Droppable$childConte = {}, _Droppable$childConte[droppableIdKey] = PropTypes.string.isRequired, _Droppable$childConte[droppableTypeKey] = PropTypes.string.isRequired, _Droppable$childConte);
12671
12672 var isStrictEqual = (function (a, b) {
12673 return a === b;
12674 });
12675
12676 var makeMapStateToProps = function makeMapStateToProps() {
12677 var getIsDraggingOver = function getIsDraggingOver(id, destination) {
12678 if (!destination) {
12679 return false;
12680 }
12681
12682 return destination.droppableId === id;
12683 };
12684
12685 var shouldUsePlaceholder = function shouldUsePlaceholder(id, descriptor, destination) {
12686 if (!destination) {
12687 return false;
12688 }
12689
12690 if (id === descriptor.droppableId) {
12691 return false;
12692 }
12693
12694 return id === destination.droppableId;
12695 };
12696
12697 var getMapProps = memoizeOne(function (isDraggingOver, draggingOverWith, placeholder) {
12698 return {
12699 isDraggingOver: isDraggingOver,
12700 draggingOverWith: draggingOverWith,
12701 placeholder: placeholder
12702 };
12703 });
12704
12705 var getDefault = function getDefault() {
12706 return getMapProps(false, null, null);
12707 };
12708
12709 var selector = function selector(state, ownProps) {
12710 if (ownProps.isDropDisabled) {
12711 return getDefault();
12712 }
12713
12714 var id = ownProps.droppableId;
12715
12716 if (state.isDragging) {
12717 var destination = state.impact.destination;
12718 var isDraggingOver = getIsDraggingOver(id, destination);
12719 var draggableId = state.critical.draggable.id;
12720 var draggingOverWith = isDraggingOver ? draggableId : null;
12721 var draggable = state.dimensions.draggables[draggableId];
12722 var placeholder = shouldUsePlaceholder(id, draggable.descriptor, destination) ? draggable.placeholder : null;
12723 return getMapProps(isDraggingOver, draggingOverWith, placeholder);
12724 }
12725
12726 if (state.phase === 'DROP_ANIMATING') {
12727 var _destination = state.pending.impact.destination;
12728
12729 var _isDraggingOver = getIsDraggingOver(id, _destination);
12730
12731 var _draggableId = state.pending.result.draggableId;
12732
12733 var _draggingOverWith = _isDraggingOver ? _draggableId : null;
12734
12735 var _draggable = state.dimensions.draggables[_draggableId];
12736
12737 var _placeholder = shouldUsePlaceholder(id, _draggable.descriptor, _destination) ? _draggable.placeholder : null;
12738
12739 return getMapProps(_isDraggingOver, _draggingOverWith, _placeholder);
12740 }
12741
12742 return getDefault();
12743 };
12744
12745 return selector;
12746 };
12747 var connectedDroppable = reactRedux.connect(makeMapStateToProps, null, null, {
12748 storeKey: storeKey,
12749 pure: true,
12750 areStatePropsEqual: isStrictEqual
12751 })(Droppable);
12752 connectedDroppable.defaultProps = {
12753 type: 'DEFAULT',
12754 isDropDisabled: false,
12755 direction: 'vertical',
12756 ignoreContainerClipping: false
12757 };
12758
12759 var _DraggableDimensionPu;
12760
12761 var DraggableDimensionPublisher = function (_Component) {
12762 _inheritsLoose(DraggableDimensionPublisher, _Component);
12763
12764 function DraggableDimensionPublisher() {
12765 var _this;
12766
12767 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
12768 args[_key] = arguments[_key];
12769 }
12770
12771 _this = _Component.call.apply(_Component, [this].concat(args)) || this;
12772 _this.publishedDescriptor = null;
12773 _this.getMemoizedDescriptor = memoizeOne(function (id, index, droppableId, type) {
12774 return {
12775 id: id,
12776 index: index,
12777 droppableId: droppableId,
12778 type: type
12779 };
12780 });
12781
12782 _this.publish = function () {
12783 var marshal = _this.context[dimensionMarshalKey];
12784
12785 var descriptor = _this.getMemoizedDescriptor(_this.props.draggableId, _this.props.index, _this.props.droppableId, _this.props.type);
12786
12787 if (!_this.publishedDescriptor) {
12788 marshal.registerDraggable(descriptor, _this.getDimension);
12789 _this.publishedDescriptor = descriptor;
12790 return;
12791 }
12792
12793 if (descriptor === _this.publishedDescriptor) {
12794 return;
12795 }
12796
12797 marshal.updateDraggable(_this.publishedDescriptor, descriptor, _this.getDimension);
12798 _this.publishedDescriptor = descriptor;
12799 };
12800
12801 _this.unpublish = function () {
12802 !_this.publishedDescriptor ? process.env.NODE_ENV !== "production" ? invariant(false, 'Cannot unpublish descriptor when none is published') : invariant(false) : void 0;
12803 var marshal = _this.context[dimensionMarshalKey];
12804 marshal.unregisterDraggable(_this.publishedDescriptor);
12805 _this.publishedDescriptor = null;
12806 };
12807
12808 _this.getDimension = function (windowScroll) {
12809 var targetRef = _this.props.getDraggableRef();
12810
12811 var descriptor = _this.publishedDescriptor;
12812 !targetRef ? process.env.NODE_ENV !== "production" ? invariant(false, 'DraggableDimensionPublisher cannot calculate a dimension when not attached to the DOM') : invariant(false) : void 0;
12813 !descriptor ? process.env.NODE_ENV !== "production" ? invariant(false, 'Cannot get dimension for unpublished draggable') : invariant(false) : void 0;
12814 var computedStyles = window.getComputedStyle(targetRef);
12815 var borderBox = targetRef.getBoundingClientRect();
12816 var client = cssBoxModel.calculateBox(borderBox, computedStyles);
12817 var page = cssBoxModel.withScroll(client, windowScroll);
12818 var placeholder = {
12819 client: client,
12820 tagName: targetRef.tagName.toLowerCase(),
12821 display: computedStyles.display
12822 };
12823 var dimension = {
12824 descriptor: descriptor,
12825 placeholder: placeholder,
12826 client: client,
12827 page: page
12828 };
12829 return dimension;
12830 };
12831
12832 return _this;
12833 }
12834
12835 var _proto = DraggableDimensionPublisher.prototype;
12836
12837 _proto.componentDidMount = function componentDidMount() {
12838 this.publish();
12839 };
12840
12841 _proto.componentDidUpdate = function componentDidUpdate() {
12842 this.publish();
12843 };
12844
12845 _proto.componentWillUnmount = function componentWillUnmount() {
12846 this.unpublish();
12847 };
12848
12849 _proto.render = function render() {
12850 return this.props.children;
12851 };
12852
12853 return DraggableDimensionPublisher;
12854 }(React.Component);
12855
12856 DraggableDimensionPublisher.contextTypes = (_DraggableDimensionPu = {}, _DraggableDimensionPu[dimensionMarshalKey] = PropTypes.object.isRequired, _DraggableDimensionPu);
12857
12858 var DoubleRenderBlocker = function (_React$Component) {
12859 _inheritsLoose(DoubleRenderBlocker, _React$Component);
12860
12861 function DoubleRenderBlocker() {
12862 return _React$Component.apply(this, arguments) || this;
12863 }
12864
12865 var _proto = DoubleRenderBlocker.prototype;
12866
12867 _proto.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
12868 if (isEqual(origin, nextProps.change)) {
12869 return true;
12870 }
12871
12872 if (isEqual(this.props.change, nextProps.change)) {
12873 return false;
12874 }
12875
12876 return true;
12877 };
12878
12879 _proto.render = function render() {
12880 return this.props.children(this.props.change);
12881 };
12882
12883 return DoubleRenderBlocker;
12884 }(React__default.Component);
12885
12886 var Moveable = function (_Component) {
12887 _inheritsLoose(Moveable, _Component);
12888
12889 function Moveable() {
12890 return _Component.apply(this, arguments) || this;
12891 }
12892
12893 var _proto2 = Moveable.prototype;
12894
12895 _proto2.getFinal = function getFinal() {
12896 var destination = this.props.destination;
12897 var speed = this.props.speed;
12898
12899 if (speed === 'INSTANT') {
12900 return destination;
12901 }
12902
12903 var config = speed === 'FAST' ? physics.fast : physics.standard;
12904 return {
12905 x: reactMotion.spring(destination.x, config),
12906 y: reactMotion.spring(destination.y, config)
12907 };
12908 };
12909
12910 _proto2.render = function render() {
12911 var _this = this;
12912
12913 var final = this.getFinal();
12914 return React__default.createElement(reactMotion.Motion, {
12915 defaultStyle: origin,
12916 style: final,
12917 onRest: this.props.onMoveEnd
12918 }, function (current) {
12919 var _this$props = _this.props,
12920 speed = _this$props.speed,
12921 destination = _this$props.destination,
12922 children = _this$props.children;
12923 var target = speed === 'INSTANT' ? destination : current;
12924 return React__default.createElement(DoubleRenderBlocker, {
12925 change: target
12926 }, children);
12927 });
12928 };
12929
12930 return Moveable;
12931 }(React.Component);
12932
12933 Moveable.defaultProps = {
12934 destination: origin
12935 };
12936
12937 var getWindowFromRef = (function (ref) {
12938 return ref ? ref.ownerDocument.defaultView : window;
12939 });
12940
12941 var selector = "[" + dragHandle + "]";
12942
12943 var isSVG = function isSVG(el) {
12944 if (typeof SVGElement === 'undefined') {
12945 return false;
12946 }
12947
12948 return el instanceof SVGElement;
12949 };
12950
12951 var throwIfSVG = function throwIfSVG(el) {
12952 !!isSVG(el) ? process.env.NODE_ENV !== "production" ? invariant(false, "A drag handle cannot be an SVGElement: it has inconsistent focus support.\n\n More information: https://github.com/atlassian/react-beautiful-dnd/tree/master/docs/guides/dragging-svgs.md") : invariant(false) : void 0;
12953 };
12954
12955 var getDragHandleRef = function getDragHandleRef(draggableRef) {
12956 if (draggableRef.hasAttribute(dragHandle)) {
12957 throwIfSVG(draggableRef);
12958 return draggableRef;
12959 }
12960
12961 var el = draggableRef.querySelector(selector);
12962 throwIfSVG(draggableRef);
12963 !el ? process.env.NODE_ENV !== "production" ? invariant(false, "\n Cannot find drag handle element inside of Draggable.\n Please be sure to apply the {...provided.dragHandleProps} to your Draggable\n\n More information: https://github.com/atlassian/react-beautiful-dnd#draggable\n ") : invariant(false) : void 0;
12964 !(el instanceof HTMLElement) ? process.env.NODE_ENV !== "production" ? invariant(false, 'A drag handle must be a HTMLElement') : invariant(false) : void 0;
12965 return el;
12966 };
12967
12968 var retainingFocusFor = null;
12969 var listenerOptions$1 = {
12970 capture: true
12971 };
12972
12973 var clearRetentionOnFocusChange = function () {
12974 var isBound = false;
12975
12976 var bind = function bind() {
12977 if (isBound) {
12978 return;
12979 }
12980
12981 isBound = true;
12982 window.addEventListener('focus', onWindowFocusChange, listenerOptions$1);
12983 };
12984
12985 var unbind = function unbind() {
12986 if (!isBound) {
12987 return;
12988 }
12989
12990 isBound = false;
12991 window.removeEventListener('focus', onWindowFocusChange, listenerOptions$1);
12992 };
12993
12994 var onWindowFocusChange = function onWindowFocusChange() {
12995 unbind();
12996 retainingFocusFor = null;
12997 };
12998
12999 var result = function result() {
13000 return bind();
13001 };
13002
13003 result.cancel = function () {
13004 return unbind();
13005 };
13006
13007 return result;
13008 }();
13009
13010 var retain = function retain(id) {
13011 retainingFocusFor = id;
13012 clearRetentionOnFocusChange();
13013 };
13014
13015 var tryRestoreFocus = function tryRestoreFocus(id, draggableRef) {
13016 if (!retainingFocusFor) {
13017 return;
13018 }
13019
13020 if (id !== retainingFocusFor) {
13021 return;
13022 }
13023
13024 retainingFocusFor = null;
13025 clearRetentionOnFocusChange.cancel();
13026 var dragHandleRef = getDragHandleRef(draggableRef);
13027
13028 if (!dragHandleRef) {
13029 console.warn('Could not find drag handle in the DOM to focus on it');
13030 return;
13031 }
13032
13033 dragHandleRef.focus();
13034 };
13035
13036 var retainer = {
13037 retain: retain,
13038 tryRestoreFocus: tryRestoreFocus
13039 };
13040
13041 var interactiveTagNames = {
13042 input: true,
13043 button: true,
13044 textarea: true,
13045 select: true,
13046 option: true,
13047 optgroup: true,
13048 video: true,
13049 audio: true
13050 };
13051
13052 var isAnInteractiveElement = function isAnInteractiveElement(parent, current) {
13053 if (current == null) {
13054 return false;
13055 }
13056
13057 var hasAnInteractiveTag = Boolean(interactiveTagNames[current.tagName.toLowerCase()]);
13058
13059 if (hasAnInteractiveTag) {
13060 return true;
13061 }
13062
13063 var attribute = current.getAttribute('contenteditable');
13064
13065 if (attribute === 'true' || attribute === '') {
13066 return true;
13067 }
13068
13069 if (current === parent) {
13070 return false;
13071 }
13072
13073 return isAnInteractiveElement(parent, current.parentElement);
13074 };
13075
13076 var shouldAllowDraggingFromTarget = (function (event, props) {
13077 if (props.canDragInteractiveElements) {
13078 return true;
13079 }
13080
13081 var target = event.target,
13082 currentTarget = event.currentTarget;
13083
13084 if (!(target instanceof Element) || !(currentTarget instanceof Element)) {
13085 return true;
13086 }
13087
13088 return !isAnInteractiveElement(currentTarget, target);
13089 });
13090
13091 var createScheduler = (function (callbacks) {
13092 var memoizedMove = memoizeOne(function (x, y) {
13093 var point = {
13094 x: x,
13095 y: y
13096 };
13097 callbacks.onMove(point);
13098 });
13099 var move = rafSchd(function (point) {
13100 return memoizedMove(point.x, point.y);
13101 });
13102 var moveUp = rafSchd(callbacks.onMoveUp);
13103 var moveDown = rafSchd(callbacks.onMoveDown);
13104 var moveRight = rafSchd(callbacks.onMoveRight);
13105 var moveLeft = rafSchd(callbacks.onMoveLeft);
13106 var windowScrollMove = rafSchd(callbacks.onWindowScroll);
13107
13108 var cancel = function cancel() {
13109 move.cancel();
13110 moveUp.cancel();
13111 moveDown.cancel();
13112 moveRight.cancel();
13113 moveLeft.cancel();
13114 windowScrollMove.cancel();
13115 };
13116
13117 return {
13118 move: move,
13119 moveUp: moveUp,
13120 moveDown: moveDown,
13121 moveRight: moveRight,
13122 moveLeft: moveLeft,
13123 windowScrollMove: windowScrollMove,
13124 cancel: cancel
13125 };
13126 });
13127
13128 var sloppyClickThreshold = 5;
13129 var isSloppyClickThresholdExceeded = (function (original, current) {
13130 return Math.abs(current.x - original.x) >= sloppyClickThreshold || Math.abs(current.y - original.y) >= sloppyClickThreshold;
13131 });
13132
13133 var tab = 9;
13134 var enter = 13;
13135 var escape = 27;
13136 var space = 32;
13137 var pageUp = 33;
13138 var pageDown = 34;
13139 var end = 35;
13140 var home = 36;
13141 var arrowLeft = 37;
13142 var arrowUp = 38;
13143 var arrowRight = 39;
13144 var arrowDown = 40;
13145
13146 var _preventedKeys;
13147 var preventedKeys = (_preventedKeys = {}, _preventedKeys[enter] = true, _preventedKeys[tab] = true, _preventedKeys);
13148 var preventStandardKeyEvents = (function (event) {
13149 if (preventedKeys[event.keyCode]) {
13150 event.preventDefault();
13151 }
13152 });
13153
13154 var getOptions = function getOptions(shared, fromBinding) {
13155 return _extends({}, shared, fromBinding);
13156 };
13157
13158 var bindEvents = function bindEvents(el, bindings, sharedOptions) {
13159 bindings.forEach(function (binding) {
13160 var options = getOptions(sharedOptions, binding.options);
13161 el.addEventListener(binding.eventName, binding.fn, options);
13162 });
13163 };
13164 var unbindEvents = function unbindEvents(el, bindings, sharedOptions) {
13165 bindings.forEach(function (binding) {
13166 var options = getOptions(sharedOptions, binding.options);
13167 el.removeEventListener(binding.eventName, binding.fn, options);
13168 });
13169 };
13170
13171 var sharedOptions = {
13172 capture: true
13173 };
13174 var createPostDragEventPreventer = (function (getWindow) {
13175 var isBound = false;
13176
13177 var bind = function bind() {
13178 if (isBound) {
13179 return;
13180 }
13181
13182 isBound = true;
13183 bindEvents(getWindow(), pointerEvents, sharedOptions);
13184 };
13185
13186 var unbind = function unbind() {
13187 if (!isBound) {
13188 return;
13189 }
13190
13191 isBound = false;
13192 unbindEvents(getWindow(), pointerEvents, sharedOptions);
13193 };
13194
13195 var pointerEvents = [{
13196 eventName: 'click',
13197 fn: function fn(event) {
13198 event.preventDefault();
13199 unbind();
13200 }
13201 }, {
13202 eventName: 'mousedown',
13203 fn: unbind
13204 }, {
13205 eventName: 'touchstart',
13206 fn: unbind
13207 }];
13208
13209 var preventNext = function preventNext() {
13210 if (isBound) {
13211 unbind();
13212 }
13213
13214 bind();
13215 };
13216
13217 var preventer = {
13218 preventNext: preventNext,
13219 abort: unbind
13220 };
13221 return preventer;
13222 });
13223
13224 var createEventMarshal = (function () {
13225 var isMouseDownHandled = false;
13226
13227 var handle = function handle() {
13228 !!isMouseDownHandled ? process.env.NODE_ENV !== "production" ? invariant(false, 'Cannot handle mouse down as it is already handled') : invariant(false) : void 0;
13229 isMouseDownHandled = true;
13230 };
13231
13232 var isHandled = function isHandled() {
13233 return isMouseDownHandled;
13234 };
13235
13236 var reset = function reset() {
13237 isMouseDownHandled = false;
13238 };
13239
13240 return {
13241 handle: handle,
13242 isHandled: isHandled,
13243 reset: reset
13244 };
13245 });
13246
13247 var supportedEventName = function () {
13248 var base = 'visibilitychange';
13249
13250 if (typeof document === 'undefined') {
13251 return base;
13252 }
13253
13254 var candidates = [base, "ms" + base, "webkit" + base, "moz" + base, "o" + base];
13255 var supported = candidates.find(function (eventName) {
13256 return "on" + eventName in document;
13257 });
13258 return supported || base;
13259 }();
13260
13261 var primaryButton = 0;
13262
13263 var noop = function noop() {};
13264
13265 var mouseDownMarshal = createEventMarshal();
13266 var createMouseSensor = (function (_ref) {
13267 var callbacks = _ref.callbacks,
13268 getWindow = _ref.getWindow,
13269 canStartCapturing = _ref.canStartCapturing;
13270 var state = {
13271 isDragging: false,
13272 pending: null
13273 };
13274
13275 var setState = function setState(newState) {
13276 state = newState;
13277 };
13278
13279 var isDragging = function isDragging() {
13280 return state.isDragging;
13281 };
13282
13283 var isCapturing = function isCapturing() {
13284 return Boolean(state.pending || state.isDragging);
13285 };
13286
13287 var schedule = createScheduler(callbacks);
13288 var postDragEventPreventer = createPostDragEventPreventer(getWindow);
13289
13290 var startDragging = function startDragging(fn) {
13291 if (fn === void 0) {
13292 fn = noop;
13293 }
13294
13295 setState({
13296 pending: null,
13297 isDragging: true
13298 });
13299 fn();
13300 };
13301
13302 var stopDragging = function stopDragging(fn, shouldBlockClick) {
13303 if (fn === void 0) {
13304 fn = noop;
13305 }
13306
13307 if (shouldBlockClick === void 0) {
13308 shouldBlockClick = true;
13309 }
13310
13311 schedule.cancel();
13312 unbindWindowEvents();
13313 mouseDownMarshal.reset();
13314
13315 if (shouldBlockClick) {
13316 postDragEventPreventer.preventNext();
13317 }
13318
13319 setState({
13320 isDragging: false,
13321 pending: null
13322 });
13323 fn();
13324 };
13325
13326 var startPendingDrag = function startPendingDrag(point) {
13327 setState({
13328 pending: point,
13329 isDragging: false
13330 });
13331 bindWindowEvents();
13332 };
13333
13334 var stopPendingDrag = function stopPendingDrag() {
13335 stopDragging(noop, false);
13336 };
13337
13338 var kill = function kill(fn) {
13339 if (fn === void 0) {
13340 fn = noop;
13341 }
13342
13343 if (state.pending) {
13344 stopPendingDrag();
13345 return;
13346 }
13347
13348 stopDragging(fn);
13349 };
13350
13351 var unmount = function unmount() {
13352 kill();
13353 postDragEventPreventer.abort();
13354 };
13355
13356 var cancel = function cancel() {
13357 kill(callbacks.onCancel);
13358 };
13359
13360 var windowBindings = [{
13361 eventName: 'mousemove',
13362 fn: function fn(event) {
13363 var button = event.button,
13364 clientX = event.clientX,
13365 clientY = event.clientY;
13366
13367 if (button !== primaryButton) {
13368 return;
13369 }
13370
13371 var point = {
13372 x: clientX,
13373 y: clientY
13374 };
13375
13376 if (state.isDragging) {
13377 event.preventDefault();
13378 schedule.move(point);
13379 return;
13380 }
13381
13382 if (!state.pending) {
13383 kill();
13384 process.env.NODE_ENV !== "production" ? invariant(false, 'Expected there to be a pending drag') : invariant(false);
13385 }
13386
13387 if (!isSloppyClickThresholdExceeded(state.pending, point)) {
13388 return;
13389 }
13390
13391 event.preventDefault();
13392 startDragging(function () {
13393 return callbacks.onLift({
13394 clientSelection: point,
13395 autoScrollMode: 'FLUID'
13396 });
13397 });
13398 }
13399 }, {
13400 eventName: 'mouseup',
13401 fn: function fn(event) {
13402 if (state.pending) {
13403 stopPendingDrag();
13404 return;
13405 }
13406
13407 event.preventDefault();
13408 stopDragging(callbacks.onDrop);
13409 }
13410 }, {
13411 eventName: 'mousedown',
13412 fn: function fn(event) {
13413 if (state.isDragging) {
13414 event.preventDefault();
13415 }
13416
13417 stopDragging(callbacks.onCancel);
13418 }
13419 }, {
13420 eventName: 'keydown',
13421 fn: function fn(event) {
13422 if (!state.isDragging) {
13423 cancel();
13424 return;
13425 }
13426
13427 if (event.keyCode === escape) {
13428 event.preventDefault();
13429 cancel();
13430 return;
13431 }
13432
13433 preventStandardKeyEvents(event);
13434 }
13435 }, {
13436 eventName: 'resize',
13437 fn: cancel
13438 }, {
13439 eventName: 'scroll',
13440 options: {
13441 passive: true,
13442 capture: false
13443 },
13444 fn: function fn() {
13445 if (state.pending) {
13446 stopPendingDrag();
13447 return;
13448 }
13449
13450 schedule.windowScrollMove();
13451 }
13452 }, {
13453 eventName: 'webkitmouseforcechanged',
13454 fn: function fn(event) {
13455 if (event.webkitForce == null || MouseEvent.WEBKIT_FORCE_AT_FORCE_MOUSE_DOWN == null) {
13456 if (process.env.NODE_ENV !== 'production') {
13457 console.warn('handling a mouse force changed event when it is not supported');
13458 }
13459
13460 return;
13461 }
13462
13463 var forcePressThreshold = MouseEvent.WEBKIT_FORCE_AT_FORCE_MOUSE_DOWN;
13464 var isForcePressing = event.webkitForce >= forcePressThreshold;
13465
13466 if (isForcePressing) {
13467 cancel();
13468 }
13469 }
13470 }, {
13471 eventName: supportedEventName,
13472 fn: cancel
13473 }];
13474
13475 var bindWindowEvents = function bindWindowEvents() {
13476 var win = getWindow();
13477 bindEvents(win, windowBindings, {
13478 capture: true
13479 });
13480 };
13481
13482 var unbindWindowEvents = function unbindWindowEvents() {
13483 var win = getWindow();
13484 unbindEvents(win, windowBindings, {
13485 capture: true
13486 });
13487 };
13488
13489 var onMouseDown = function onMouseDown(event) {
13490 if (mouseDownMarshal.isHandled()) {
13491 return;
13492 }
13493
13494 !!isCapturing() ? process.env.NODE_ENV !== "production" ? invariant(false, 'Should not be able to perform a mouse down while a drag or pending drag is occurring') : invariant(false) : void 0;
13495
13496 if (!canStartCapturing(event)) {
13497 return;
13498 }
13499
13500 if (event.button !== primaryButton) {
13501 return;
13502 }
13503
13504 if (event.ctrlKey || event.metaKey || event.shiftKey || event.altKey) {
13505 return;
13506 }
13507
13508 mouseDownMarshal.handle();
13509 event.preventDefault();
13510 var point = {
13511 x: event.clientX,
13512 y: event.clientY
13513 };
13514 startPendingDrag(point);
13515 };
13516
13517 var sensor = {
13518 onMouseDown: onMouseDown,
13519 kill: kill,
13520 isCapturing: isCapturing,
13521 isDragging: isDragging,
13522 unmount: unmount
13523 };
13524 return sensor;
13525 });
13526
13527 var getBorderBoxCenterPosition = (function (el) {
13528 return cssBoxModel.getRect(el.getBoundingClientRect()).center;
13529 });
13530
13531 var _scrollJumpKeys;
13532 var scrollJumpKeys = (_scrollJumpKeys = {}, _scrollJumpKeys[pageDown] = true, _scrollJumpKeys[pageUp] = true, _scrollJumpKeys[home] = true, _scrollJumpKeys[end] = true, _scrollJumpKeys);
13533
13534 var noop$1 = function noop() {};
13535
13536 var createKeyboardSensor = (function (_ref) {
13537 var callbacks = _ref.callbacks,
13538 getWindow = _ref.getWindow,
13539 getDraggableRef = _ref.getDraggableRef,
13540 canStartCapturing = _ref.canStartCapturing;
13541 var state = {
13542 isDragging: false
13543 };
13544
13545 var setState = function setState(newState) {
13546 state = newState;
13547 };
13548
13549 var startDragging = function startDragging(fn) {
13550 if (fn === void 0) {
13551 fn = noop$1;
13552 }
13553
13554 setState({
13555 isDragging: true
13556 });
13557 bindWindowEvents();
13558 fn();
13559 };
13560
13561 var stopDragging = function stopDragging(fn) {
13562 if (fn === void 0) {
13563 fn = noop$1;
13564 }
13565
13566 schedule.cancel();
13567 unbindWindowEvents();
13568 setState({
13569 isDragging: false
13570 });
13571 fn();
13572 };
13573
13574 var kill = function kill() {
13575 return stopDragging();
13576 };
13577
13578 var cancel = function cancel() {
13579 stopDragging(callbacks.onCancel);
13580 };
13581
13582 var isDragging = function isDragging() {
13583 return state.isDragging;
13584 };
13585
13586 var schedule = createScheduler(callbacks);
13587
13588 var onKeyDown = function onKeyDown(event) {
13589 if (!isDragging()) {
13590 if (event.defaultPrevented) {
13591 return;
13592 }
13593
13594 if (!canStartCapturing(event)) {
13595 return;
13596 }
13597
13598 if (event.keyCode !== space) {
13599 return;
13600 }
13601
13602 var ref = getDraggableRef();
13603 !ref ? process.env.NODE_ENV !== "production" ? invariant(false, 'Cannot start a keyboard drag without a draggable ref') : invariant(false) : void 0;
13604 var center = getBorderBoxCenterPosition(ref);
13605 event.preventDefault();
13606 startDragging(function () {
13607 return callbacks.onLift({
13608 clientSelection: center,
13609 autoScrollMode: 'JUMP'
13610 });
13611 });
13612 return;
13613 }
13614
13615 if (event.keyCode === escape) {
13616 event.preventDefault();
13617 cancel();
13618 return;
13619 }
13620
13621 if (event.keyCode === space) {
13622 event.preventDefault();
13623 stopDragging(callbacks.onDrop);
13624 return;
13625 }
13626
13627 if (event.keyCode === arrowDown) {
13628 event.preventDefault();
13629 schedule.moveDown();
13630 return;
13631 }
13632
13633 if (event.keyCode === arrowUp) {
13634 event.preventDefault();
13635 schedule.moveUp();
13636 return;
13637 }
13638
13639 if (event.keyCode === arrowRight) {
13640 event.preventDefault();
13641 schedule.moveRight();
13642 return;
13643 }
13644
13645 if (event.keyCode === arrowLeft) {
13646 event.preventDefault();
13647 schedule.moveLeft();
13648 return;
13649 }
13650
13651 if (scrollJumpKeys[event.keyCode]) {
13652 event.preventDefault();
13653 return;
13654 }
13655
13656 preventStandardKeyEvents(event);
13657 };
13658
13659 var windowBindings = [{
13660 eventName: 'mousedown',
13661 fn: cancel
13662 }, {
13663 eventName: 'mouseup',
13664 fn: cancel
13665 }, {
13666 eventName: 'click',
13667 fn: cancel
13668 }, {
13669 eventName: 'touchstart',
13670 fn: cancel
13671 }, {
13672 eventName: 'resize',
13673 fn: cancel
13674 }, {
13675 eventName: 'wheel',
13676 fn: cancel
13677 }, {
13678 eventName: 'scroll',
13679 options: {
13680 capture: false
13681 },
13682 fn: callbacks.onWindowScroll
13683 }, {
13684 eventName: supportedEventName,
13685 fn: cancel
13686 }];
13687
13688 var bindWindowEvents = function bindWindowEvents() {
13689 bindEvents(getWindow(), windowBindings, {
13690 capture: true
13691 });
13692 };
13693
13694 var unbindWindowEvents = function unbindWindowEvents() {
13695 unbindEvents(getWindow(), windowBindings, {
13696 capture: true
13697 });
13698 };
13699
13700 var sensor = {
13701 onKeyDown: onKeyDown,
13702 kill: kill,
13703 isDragging: isDragging,
13704 isCapturing: isDragging,
13705 unmount: kill
13706 };
13707 return sensor;
13708 });
13709
13710 var timeForLongPress = 150;
13711 var forcePressThreshold = 0.15;
13712 var touchStartMarshal = createEventMarshal();
13713
13714 var noop$2 = function noop() {};
13715
13716 var webkitHack = function () {
13717 var stub = {
13718 preventTouchMove: noop$2,
13719 releaseTouchMove: noop$2
13720 };
13721
13722 if (typeof window === 'undefined') {
13723 return stub;
13724 }
13725
13726 if (!('ontouchstart' in window)) {
13727 return stub;
13728 }
13729
13730 var isBlocking = false;
13731 window.addEventListener('touchmove', function (event) {
13732 if (!isBlocking) {
13733 return;
13734 }
13735
13736 if (event.defaultPrevented) {
13737 return;
13738 }
13739
13740 event.preventDefault();
13741 }, {
13742 passive: false,
13743 capture: false
13744 });
13745
13746 var preventTouchMove = function preventTouchMove() {
13747 isBlocking = true;
13748 };
13749
13750 var releaseTouchMove = function releaseTouchMove() {
13751 isBlocking = false;
13752 };
13753
13754 return {
13755 preventTouchMove: preventTouchMove,
13756 releaseTouchMove: releaseTouchMove
13757 };
13758 }();
13759
13760 var initial = {
13761 isDragging: false,
13762 pending: null,
13763 hasMoved: false,
13764 longPressTimerId: null
13765 };
13766 var createTouchSensor = (function (_ref) {
13767 var callbacks = _ref.callbacks,
13768 getWindow = _ref.getWindow,
13769 canStartCapturing = _ref.canStartCapturing;
13770 var state = initial;
13771
13772 var setState = function setState(partial) {
13773 state = _extends({}, state, partial);
13774 };
13775
13776 var isDragging = function isDragging() {
13777 return state.isDragging;
13778 };
13779
13780 var isCapturing = function isCapturing() {
13781 return Boolean(state.pending || state.isDragging || state.longPressTimerId);
13782 };
13783
13784 var schedule = createScheduler(callbacks);
13785 var postDragEventPreventer = createPostDragEventPreventer(getWindow);
13786
13787 var startDragging = function startDragging() {
13788 var pending = state.pending;
13789
13790 if (!pending) {
13791 kill();
13792 process.env.NODE_ENV !== "production" ? invariant(false, 'cannot start a touch drag without a pending position') : invariant(false);
13793 }
13794
13795 setState({
13796 isDragging: true,
13797 hasMoved: false,
13798 pending: null,
13799 longPressTimerId: null
13800 });
13801 callbacks.onLift({
13802 clientSelection: pending,
13803 autoScrollMode: 'FLUID'
13804 });
13805 };
13806
13807 var stopDragging = function stopDragging(fn) {
13808 if (fn === void 0) {
13809 fn = noop$2;
13810 }
13811
13812 schedule.cancel();
13813 touchStartMarshal.reset();
13814 webkitHack.releaseTouchMove();
13815 unbindWindowEvents();
13816 postDragEventPreventer.preventNext();
13817 setState(initial);
13818 fn();
13819 };
13820
13821 var startPendingDrag = function startPendingDrag(event) {
13822 var touch = event.touches[0];
13823 var clientX = touch.clientX,
13824 clientY = touch.clientY;
13825 var point = {
13826 x: clientX,
13827 y: clientY
13828 };
13829 var longPressTimerId = setTimeout(startDragging, timeForLongPress);
13830 setState({
13831 longPressTimerId: longPressTimerId,
13832 pending: point,
13833 isDragging: false,
13834 hasMoved: false
13835 });
13836 bindWindowEvents();
13837 };
13838
13839 var stopPendingDrag = function stopPendingDrag() {
13840 if (state.longPressTimerId) {
13841 clearTimeout(state.longPressTimerId);
13842 }
13843
13844 schedule.cancel();
13845 touchStartMarshal.reset();
13846 webkitHack.releaseTouchMove();
13847 unbindWindowEvents();
13848 setState(initial);
13849 };
13850
13851 var kill = function kill(fn) {
13852 if (fn === void 0) {
13853 fn = noop$2;
13854 }
13855
13856 if (state.pending) {
13857 stopPendingDrag();
13858 return;
13859 }
13860
13861 stopDragging(fn);
13862 };
13863
13864 var unmount = function unmount() {
13865 kill();
13866 postDragEventPreventer.abort();
13867 };
13868
13869 var cancel = function cancel() {
13870 kill(callbacks.onCancel);
13871 };
13872
13873 var windowBindings = [{
13874 eventName: 'touchmove',
13875 options: {
13876 passive: false
13877 },
13878 fn: function fn(event) {
13879 if (!state.isDragging) {
13880 stopPendingDrag();
13881 return;
13882 }
13883
13884 if (!state.hasMoved) {
13885 setState({
13886 hasMoved: true
13887 });
13888 }
13889
13890 var _event$touches$ = event.touches[0],
13891 clientX = _event$touches$.clientX,
13892 clientY = _event$touches$.clientY;
13893 var point = {
13894 x: clientX,
13895 y: clientY
13896 };
13897 event.preventDefault();
13898 schedule.move(point);
13899 }
13900 }, {
13901 eventName: 'touchend',
13902 fn: function fn(event) {
13903 if (!state.isDragging) {
13904 stopPendingDrag();
13905 return;
13906 }
13907
13908 event.preventDefault();
13909 stopDragging(callbacks.onDrop);
13910 }
13911 }, {
13912 eventName: 'touchcancel',
13913 fn: function fn(event) {
13914 if (!state.isDragging) {
13915 stopPendingDrag();
13916 return;
13917 }
13918
13919 event.preventDefault();
13920 stopDragging(callbacks.onCancel);
13921 }
13922 }, {
13923 eventName: 'touchstart',
13924 fn: cancel
13925 }, {
13926 eventName: 'orientationchange',
13927 fn: cancel
13928 }, {
13929 eventName: 'resize',
13930 fn: cancel
13931 }, {
13932 eventName: 'scroll',
13933 options: {
13934 passive: true,
13935 capture: false
13936 },
13937 fn: function fn() {
13938 if (state.pending) {
13939 stopPendingDrag();
13940 return;
13941 }
13942
13943 schedule.windowScrollMove();
13944 }
13945 }, {
13946 eventName: 'contextmenu',
13947 fn: function fn(event) {
13948 event.preventDefault();
13949 }
13950 }, {
13951 eventName: 'keydown',
13952 fn: function fn(event) {
13953 if (!state.isDragging) {
13954 cancel();
13955 return;
13956 }
13957
13958 if (event.keyCode === escape) {
13959 event.preventDefault();
13960 }
13961
13962 cancel();
13963 }
13964 }, {
13965 eventName: 'touchforcechange',
13966 fn: function fn(event) {
13967 if (state.hasMoved) {
13968 event.preventDefault();
13969 return;
13970 }
13971
13972 var touch = event.touches[0];
13973
13974 if (touch.force >= forcePressThreshold) {
13975 cancel();
13976 }
13977 }
13978 }, {
13979 eventName: supportedEventName,
13980 fn: cancel
13981 }];
13982
13983 var bindWindowEvents = function bindWindowEvents() {
13984 bindEvents(getWindow(), windowBindings, {
13985 capture: true
13986 });
13987 };
13988
13989 var unbindWindowEvents = function unbindWindowEvents() {
13990 unbindEvents(getWindow(), windowBindings, {
13991 capture: true
13992 });
13993 };
13994
13995 var onTouchStart = function onTouchStart(event) {
13996 if (touchStartMarshal.isHandled()) {
13997 return;
13998 }
13999
14000 !!isCapturing() ? process.env.NODE_ENV !== "production" ? invariant(false, 'Should not be able to perform a touch start while a drag or pending drag is occurring') : invariant(false) : void 0;
14001
14002 if (!canStartCapturing(event)) {
14003 return;
14004 }
14005
14006 touchStartMarshal.handle();
14007 webkitHack.preventTouchMove();
14008 startPendingDrag(event);
14009 };
14010
14011 var sensor = {
14012 onTouchStart: onTouchStart,
14013 kill: kill,
14014 isCapturing: isCapturing,
14015 isDragging: isDragging,
14016 unmount: unmount
14017 };
14018 return sensor;
14019 });
14020
14021 var _DragHandle$contextTy;
14022
14023 var preventHtml5Dnd = function preventHtml5Dnd(event) {
14024 event.preventDefault();
14025 };
14026
14027 var DragHandle = function (_Component) {
14028 _inheritsLoose(DragHandle, _Component);
14029
14030 function DragHandle(props, context) {
14031 var _this;
14032
14033 _this = _Component.call(this, props, context) || this;
14034 _this.mouseSensor = void 0;
14035 _this.keyboardSensor = void 0;
14036 _this.touchSensor = void 0;
14037 _this.sensors = void 0;
14038 _this.styleContext = void 0;
14039 _this.canLift = void 0;
14040 _this.isFocused = false;
14041 _this.lastDraggableRef = void 0;
14042
14043 _this.onFocus = function () {
14044 _this.isFocused = true;
14045 };
14046
14047 _this.onBlur = function () {
14048 _this.isFocused = false;
14049 };
14050
14051 _this.onKeyDown = function (event) {
14052 if (_this.mouseSensor.isCapturing() || _this.touchSensor.isCapturing()) {
14053 return;
14054 }
14055
14056 _this.keyboardSensor.onKeyDown(event);
14057 };
14058
14059 _this.onMouseDown = function (event) {
14060 if (_this.keyboardSensor.isCapturing() || _this.mouseSensor.isCapturing()) {
14061 return;
14062 }
14063
14064 _this.mouseSensor.onMouseDown(event);
14065 };
14066
14067 _this.onTouchStart = function (event) {
14068 if (_this.mouseSensor.isCapturing() || _this.keyboardSensor.isCapturing()) {
14069 return;
14070 }
14071
14072 _this.touchSensor.onTouchStart(event);
14073 };
14074
14075 _this.canStartCapturing = function (event) {
14076 if (_this.isAnySensorCapturing()) {
14077 return false;
14078 }
14079
14080 if (!_this.canLift(_this.props.draggableId)) {
14081 return false;
14082 }
14083
14084 return shouldAllowDraggingFromTarget(event, _this.props);
14085 };
14086
14087 _this.isAnySensorCapturing = function () {
14088 return _this.sensors.some(function (sensor) {
14089 return sensor.isCapturing();
14090 });
14091 };
14092
14093 _this.getProvided = memoizeOne(function (isEnabled) {
14094 if (!isEnabled) {
14095 return null;
14096 }
14097
14098 var provided = {
14099 onMouseDown: _this.onMouseDown,
14100 onKeyDown: _this.onKeyDown,
14101 onTouchStart: _this.onTouchStart,
14102 onFocus: _this.onFocus,
14103 onBlur: _this.onBlur,
14104 tabIndex: 0,
14105 'data-react-beautiful-dnd-drag-handle': _this.styleContext,
14106 'aria-roledescription': 'Draggable item. Press space bar to lift',
14107 draggable: false,
14108 onDragStart: preventHtml5Dnd
14109 };
14110 return provided;
14111 });
14112
14113 var getWindow = function getWindow() {
14114 return getWindowFromRef(_this.props.getDraggableRef());
14115 };
14116
14117 var args = {
14118 callbacks: _this.props.callbacks,
14119 getDraggableRef: _this.props.getDraggableRef,
14120 getWindow: getWindow,
14121 canStartCapturing: _this.canStartCapturing
14122 };
14123 _this.mouseSensor = createMouseSensor(args);
14124 _this.keyboardSensor = createKeyboardSensor(args);
14125 _this.touchSensor = createTouchSensor(args);
14126 _this.sensors = [_this.mouseSensor, _this.keyboardSensor, _this.touchSensor];
14127 _this.styleContext = context[styleContextKey];
14128 _this.canLift = context[canLiftContextKey];
14129 return _this;
14130 }
14131
14132 var _proto = DragHandle.prototype;
14133
14134 _proto.componentDidMount = function componentDidMount() {
14135 var draggableRef = this.props.getDraggableRef();
14136 this.lastDraggableRef = draggableRef;
14137 !draggableRef ? process.env.NODE_ENV !== "production" ? invariant(false, 'Cannot get draggable ref from drag handle') : invariant(false) : void 0;
14138
14139 if (!this.props.isEnabled) {
14140 return;
14141 }
14142
14143 var dragHandleRef = getDragHandleRef(draggableRef);
14144 retainer.tryRestoreFocus(this.props.draggableId, dragHandleRef);
14145 };
14146
14147 _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
14148 var _this2 = this;
14149
14150 var ref = this.props.getDraggableRef();
14151
14152 if (ref !== this.lastDraggableRef) {
14153 this.lastDraggableRef = ref;
14154
14155 if (!ref || !this.isFocused) {
14156 return;
14157 }
14158
14159 if (!this.props.isEnabled) {
14160 return;
14161 }
14162
14163 getDragHandleRef(ref).focus();
14164 }
14165
14166 var isCapturing = this.isAnySensorCapturing();
14167
14168 if (!isCapturing) {
14169 return;
14170 }
14171
14172 var isDragStopping = prevProps.isDragging && !this.props.isDragging;
14173
14174 if (isDragStopping) {
14175 this.sensors.forEach(function (sensor) {
14176 if (sensor.isCapturing()) {
14177 sensor.kill();
14178 }
14179 });
14180 }
14181
14182 if (this.props.isEnabled) {
14183 return;
14184 }
14185
14186 this.sensors.forEach(function (sensor) {
14187 if (!sensor.isCapturing()) {
14188 return;
14189 }
14190
14191 var wasDragging = sensor.isDragging();
14192 sensor.kill();
14193
14194 if (wasDragging) {
14195 if (process.env.NODE_ENV !== 'production') {
14196 console.warn('You have disabled dragging on a Draggable while it was dragging. The drag has been cancelled');
14197 }
14198
14199 _this2.props.callbacks.onCancel();
14200 }
14201 });
14202 };
14203
14204 _proto.componentWillUnmount = function componentWillUnmount() {
14205 var _this3 = this;
14206
14207 this.sensors.forEach(function (sensor) {
14208 var wasDragging = sensor.isDragging();
14209 sensor.unmount();
14210
14211 if (wasDragging) {
14212 _this3.props.callbacks.onCancel();
14213 }
14214 });
14215
14216 var shouldRetainFocus = function () {
14217 if (!_this3.props.isEnabled) {
14218 return false;
14219 }
14220
14221 if (!_this3.isFocused) {
14222 return false;
14223 }
14224
14225 return _this3.props.isDragging || _this3.props.isDropAnimating;
14226 }();
14227
14228 if (shouldRetainFocus) {
14229 retainer.retain(this.props.draggableId);
14230 }
14231 };
14232
14233 _proto.render = function render() {
14234 var _this$props = this.props,
14235 children = _this$props.children,
14236 isEnabled = _this$props.isEnabled;
14237 return children(this.getProvided(isEnabled));
14238 };
14239
14240 return DragHandle;
14241 }(React.Component);
14242
14243 DragHandle.contextTypes = (_DragHandle$contextTy = {}, _DragHandle$contextTy[styleContextKey] = PropTypes.string.isRequired, _DragHandle$contextTy[canLiftContextKey] = PropTypes.func.isRequired, _DragHandle$contextTy);
14244
14245 var getWindowScroll = (function () {
14246 return {
14247 x: window.pageXOffset,
14248 y: window.pageYOffset
14249 };
14250 });
14251
14252 var getViewport = (function () {
14253 var scroll = getWindowScroll();
14254 var top = scroll.y;
14255 var left = scroll.x;
14256 var doc = document.documentElement;
14257 !doc ? process.env.NODE_ENV !== "production" ? invariant(false, 'Could not find document.documentElement') : invariant(false) : void 0;
14258 var width = doc.clientWidth;
14259 var height = doc.clientHeight;
14260 var right = left + width;
14261 var bottom = top + height;
14262 var frame = cssBoxModel.getRect({
14263 top: top,
14264 left: left,
14265 right: right,
14266 bottom: bottom
14267 });
14268 var maxScroll = getMaxScroll({
14269 scrollHeight: doc.scrollHeight,
14270 scrollWidth: doc.scrollWidth,
14271 width: frame.width,
14272 height: frame.height
14273 });
14274 var viewport = {
14275 frame: frame,
14276 scroll: {
14277 initial: scroll,
14278 current: scroll,
14279 max: maxScroll,
14280 diff: {
14281 value: origin,
14282 displacement: origin
14283 }
14284 }
14285 };
14286 return viewport;
14287 });
14288
14289 var _Draggable$contextTyp;
14290 var zIndexOptions = {
14291 dragging: 5000,
14292 dropAnimating: 4500
14293 };
14294
14295 var getTranslate = function getTranslate(offset) {
14296 if (isEqual(offset, origin)) {
14297 return null;
14298 }
14299
14300 return "translate(" + offset.x + "px, " + offset.y + "px)";
14301 };
14302
14303 var getSpeed$1 = function getSpeed(isDragging, shouldAnimateDragMovement, isDropAnimating) {
14304 if (isDropAnimating) {
14305 return 'STANDARD';
14306 }
14307
14308 if (isDragging && shouldAnimateDragMovement) {
14309 return 'FAST';
14310 }
14311
14312 return 'INSTANT';
14313 };
14314
14315 var Draggable = function (_Component) {
14316 _inheritsLoose(Draggable, _Component);
14317
14318 function Draggable(props, context) {
14319 var _this;
14320
14321 _this = _Component.call(this, props, context) || this;
14322 _this.callbacks = void 0;
14323 _this.styleContext = void 0;
14324 _this.ref = null;
14325
14326 _this.onMoveEnd = function () {
14327 if (_this.props.isDropAnimating) {
14328 _this.props.dropAnimationFinished();
14329 }
14330 };
14331
14332 _this.onLift = function (options) {
14333 start('LIFT');
14334 var ref = _this.ref;
14335 !ref ? process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0;
14336 !!_this.props.isDragDisabled ? process.env.NODE_ENV !== "production" ? invariant(false, 'Cannot lift a Draggable when it is disabled') : invariant(false) : void 0;
14337 var clientSelection = options.clientSelection,
14338 autoScrollMode = options.autoScrollMode;
14339 var _this$props = _this.props,
14340 lift = _this$props.lift,
14341 draggableId = _this$props.draggableId;
14342 var client = {
14343 selection: clientSelection,
14344 borderBoxCenter: getBorderBoxCenterPosition(ref),
14345 offset: origin
14346 };
14347 lift({
14348 id: draggableId,
14349 client: client,
14350 autoScrollMode: autoScrollMode,
14351 viewport: getViewport()
14352 });
14353 finish('LIFT');
14354 };
14355
14356 _this.setRef = function (ref) {
14357 if (ref === null) {
14358 return;
14359 }
14360
14361 if (ref === _this.ref) {
14362 return;
14363 }
14364
14365 _this.ref = ref;
14366 throwIfRefIsInvalid(ref);
14367 };
14368
14369 _this.getDraggableRef = function () {
14370 return _this.ref;
14371 };
14372
14373 _this.getDraggingStyle = memoizeOne(function (change, dimension, isDropAnimating) {
14374 var box = dimension.client;
14375 var style = {
14376 position: 'fixed',
14377 top: box.marginBox.top,
14378 left: box.marginBox.left,
14379 boxSizing: 'border-box',
14380 width: box.borderBox.width,
14381 height: box.borderBox.height,
14382 transition: 'none',
14383 zIndex: isDropAnimating ? zIndexOptions.dropAnimating : zIndexOptions.dragging,
14384 transform: getTranslate(change),
14385 pointerEvents: 'none'
14386 };
14387 return style;
14388 });
14389 _this.getNotDraggingStyle = memoizeOne(function (current, shouldAnimateDisplacement) {
14390 var style = {
14391 transform: getTranslate(current),
14392 transition: shouldAnimateDisplacement ? null : 'none'
14393 };
14394 return style;
14395 });
14396 _this.getProvided = memoizeOne(function (change, isDragging, isDropAnimating, shouldAnimateDisplacement, dimension, dragHandleProps) {
14397 var useDraggingStyle = isDragging || isDropAnimating;
14398
14399 var draggableStyle = function () {
14400 if (!useDraggingStyle) {
14401 return _this.getNotDraggingStyle(change, shouldAnimateDisplacement);
14402 }
14403
14404 !dimension ? process.env.NODE_ENV !== "production" ? invariant(false, 'draggable dimension required for dragging') : invariant(false) : void 0;
14405 return _this.getDraggingStyle(change, dimension, isDropAnimating);
14406 }();
14407
14408 var provided = {
14409 innerRef: _this.setRef,
14410 draggableProps: {
14411 'data-react-beautiful-dnd-draggable': _this.styleContext,
14412 style: draggableStyle
14413 },
14414 dragHandleProps: dragHandleProps
14415 };
14416 return provided;
14417 });
14418 _this.getSnapshot = memoizeOne(function (isDragging, isDropAnimating, draggingOver) {
14419 return {
14420 isDragging: isDragging || isDropAnimating,
14421 isDropAnimating: isDropAnimating,
14422 draggingOver: draggingOver
14423 };
14424 });
14425
14426 _this.renderChildren = function (change, dragHandleProps) {
14427 var _this$props2 = _this.props,
14428 isDragging = _this$props2.isDragging,
14429 isDropAnimating = _this$props2.isDropAnimating,
14430 dimension = _this$props2.dimension,
14431 draggingOver = _this$props2.draggingOver,
14432 shouldAnimateDisplacement = _this$props2.shouldAnimateDisplacement,
14433 children = _this$props2.children;
14434 var child = children(_this.getProvided(change, isDragging, isDropAnimating, shouldAnimateDisplacement, dimension, dragHandleProps), _this.getSnapshot(isDragging, isDropAnimating, draggingOver));
14435 var isDraggingOrDropping = isDragging || isDropAnimating;
14436
14437 var placeholder = function () {
14438 if (!isDraggingOrDropping) {
14439 return null;
14440 }
14441
14442 !dimension ? process.env.NODE_ENV !== "production" ? invariant(false, 'Draggable: Dimension is required for dragging') : invariant(false) : void 0;
14443 return React__default.createElement(Placeholder, {
14444 placeholder: dimension.placeholder
14445 });
14446 }();
14447
14448 return React__default.createElement(React.Fragment, null, child, placeholder);
14449 };
14450
14451 var callbacks = {
14452 onLift: _this.onLift,
14453 onMove: function onMove(clientSelection) {
14454 return props.move({
14455 client: clientSelection,
14456 shouldAnimate: false
14457 });
14458 },
14459 onDrop: function onDrop() {
14460 return props.drop({
14461 reason: 'DROP'
14462 });
14463 },
14464 onCancel: function onCancel() {
14465 return props.drop({
14466 reason: 'CANCEL'
14467 });
14468 },
14469 onMoveUp: props.moveUp,
14470 onMoveDown: props.moveDown,
14471 onMoveRight: props.moveRight,
14472 onMoveLeft: props.moveLeft,
14473 onWindowScroll: function onWindowScroll() {
14474 return props.moveByWindowScroll({
14475 scroll: getWindowScroll()
14476 });
14477 }
14478 };
14479 _this.callbacks = callbacks;
14480 _this.styleContext = context[styleContextKey];
14481 return _this;
14482 }
14483
14484 var _proto = Draggable.prototype;
14485
14486 _proto.componentWillUnmount = function componentWillUnmount() {
14487 this.ref = null;
14488 };
14489
14490 _proto.render = function render() {
14491 var _this2 = this;
14492
14493 var _this$props3 = this.props,
14494 draggableId = _this$props3.draggableId,
14495 index = _this$props3.index,
14496 offset = _this$props3.offset,
14497 isDragging = _this$props3.isDragging,
14498 isDropAnimating = _this$props3.isDropAnimating,
14499 isDragDisabled = _this$props3.isDragDisabled,
14500 shouldAnimateDragMovement = _this$props3.shouldAnimateDragMovement,
14501 disableInteractiveElementBlocking = _this$props3.disableInteractiveElementBlocking;
14502 var droppableId = this.context[droppableIdKey];
14503 var type = this.context[droppableTypeKey];
14504 var speed = getSpeed$1(isDragging, shouldAnimateDragMovement, isDropAnimating);
14505 return React__default.createElement(DraggableDimensionPublisher, {
14506 key: draggableId,
14507 draggableId: draggableId,
14508 droppableId: droppableId,
14509 type: type,
14510 index: index,
14511 getDraggableRef: this.getDraggableRef
14512 }, React__default.createElement(Moveable, {
14513 speed: speed,
14514 destination: offset,
14515 onMoveEnd: this.onMoveEnd
14516 }, function (change) {
14517 return React__default.createElement(DragHandle, {
14518 draggableId: draggableId,
14519 isDragging: isDragging,
14520 isDropAnimating: isDropAnimating,
14521 isEnabled: !isDragDisabled,
14522 callbacks: _this2.callbacks,
14523 getDraggableRef: _this2.getDraggableRef,
14524 canDragInteractiveElements: disableInteractiveElementBlocking
14525 }, function (dragHandleProps) {
14526 return _this2.renderChildren(change, dragHandleProps);
14527 });
14528 }));
14529 };
14530
14531 return Draggable;
14532 }(React.Component);
14533
14534 Draggable.contextTypes = (_Draggable$contextTyp = {}, _Draggable$contextTyp[droppableIdKey] = PropTypes.string.isRequired, _Draggable$contextTyp[droppableTypeKey] = PropTypes.string.isRequired, _Draggable$contextTyp[styleContextKey] = PropTypes.string.isRequired, _Draggable$contextTyp);
14535
14536 var defaultMapProps = {
14537 isDropAnimating: false,
14538 isDragging: false,
14539 offset: origin,
14540 shouldAnimateDragMovement: false,
14541 shouldAnimateDisplacement: true,
14542 dimension: null,
14543 draggingOver: null
14544 };
14545 var makeMapStateToProps$1 = function makeMapStateToProps() {
14546 var memoizedOffset = memoizeOne(function (x, y) {
14547 return {
14548 x: x,
14549 y: y
14550 };
14551 });
14552 var getNotDraggingProps = memoizeOne(function (offset, shouldAnimateDisplacement) {
14553 return {
14554 isDropAnimating: false,
14555 isDragging: false,
14556 offset: offset,
14557 shouldAnimateDisplacement: shouldAnimateDisplacement,
14558 shouldAnimateDragMovement: false,
14559 dimension: null,
14560 draggingOver: null
14561 };
14562 });
14563 var getDraggingProps = memoizeOne(function (offset, shouldAnimateDragMovement, dimension, draggingOver) {
14564 return {
14565 isDragging: true,
14566 isDropAnimating: false,
14567 shouldAnimateDisplacement: false,
14568 offset: offset,
14569 shouldAnimateDragMovement: shouldAnimateDragMovement,
14570 dimension: dimension,
14571 draggingOver: draggingOver
14572 };
14573 });
14574
14575 var getOutOfTheWayMovement = function getOutOfTheWayMovement(id, movement) {
14576 var map = getDisplacementMap(movement.displaced);
14577 var displacement = map[id];
14578
14579 if (!displacement) {
14580 return null;
14581 }
14582
14583 if (!displacement.isVisible) {
14584 return null;
14585 }
14586
14587 var amount = movement.isBeyondStartPosition ? negate(movement.amount) : movement.amount;
14588 return getNotDraggingProps(memoizedOffset(amount.x, amount.y), displacement.shouldAnimate);
14589 };
14590
14591 var draggingSelector = function draggingSelector(state, ownProps) {
14592 if (state.isDragging) {
14593 if (state.critical.draggable.id !== ownProps.draggableId) {
14594 return null;
14595 }
14596
14597 var offset = state.current.client.offset;
14598 var dimension = state.dimensions.draggables[ownProps.draggableId];
14599 var shouldAnimateDragMovement = state.shouldAnimate;
14600 var draggingOver = state.impact.destination ? state.impact.destination.droppableId : null;
14601 return getDraggingProps(memoizedOffset(offset.x, offset.y), shouldAnimateDragMovement, dimension, draggingOver);
14602 }
14603
14604 if (state.phase === 'DROP_ANIMATING') {
14605 var pending = state.pending;
14606
14607 if (pending.result.draggableId !== ownProps.draggableId) {
14608 return null;
14609 }
14610
14611 var _draggingOver = pending.result.destination ? pending.result.destination.droppableId : null;
14612
14613 return {
14614 isDragging: false,
14615 isDropAnimating: true,
14616 offset: pending.newHomeOffset,
14617 dimension: state.dimensions.draggables[ownProps.draggableId],
14618 draggingOver: _draggingOver,
14619 shouldAnimateDragMovement: false,
14620 shouldAnimateDisplacement: false
14621 };
14622 }
14623
14624 return null;
14625 };
14626
14627 var movingOutOfTheWaySelector = function movingOutOfTheWaySelector(state, ownProps) {
14628 if (state.isDragging) {
14629 if (state.critical.draggable.id === ownProps.draggableId) {
14630 return null;
14631 }
14632
14633 return getOutOfTheWayMovement(ownProps.draggableId, state.impact.movement);
14634 }
14635
14636 if (state.phase === 'DROP_ANIMATING') {
14637 if (state.pending.result.draggableId === ownProps.draggableId) {
14638 return null;
14639 }
14640
14641 return getOutOfTheWayMovement(ownProps.draggableId, state.pending.impact.movement);
14642 }
14643
14644 return null;
14645 };
14646
14647 var selector = function selector(state, ownProps) {
14648 var dragging = draggingSelector(state, ownProps);
14649
14650 if (dragging) {
14651 return dragging;
14652 }
14653
14654 var movingOutOfTheWay = movingOutOfTheWaySelector(state, ownProps);
14655
14656 if (movingOutOfTheWay) {
14657 return movingOutOfTheWay;
14658 }
14659
14660 return defaultMapProps;
14661 };
14662
14663 return selector;
14664 };
14665 var mapDispatchToProps = {
14666 lift: lift,
14667 move: move,
14668 moveUp: moveUp,
14669 moveDown: moveDown,
14670 moveLeft: moveLeft,
14671 moveRight: moveRight,
14672 moveByWindowScroll: moveByWindowScroll,
14673 drop: drop,
14674 dropAnimationFinished: dropAnimationFinished
14675 };
14676 var ConnectedDraggable = reactRedux.connect(makeMapStateToProps$1, mapDispatchToProps, null, {
14677 storeKey: storeKey,
14678 pure: true,
14679 areStatePropsEqual: isStrictEqual
14680 })(Draggable);
14681 ConnectedDraggable.defaultProps = {
14682 isDragDisabled: false,
14683 disableInteractiveElementBlocking: false
14684 };
14685
14686 exports.DragDropContext = DragDropContext;
14687 exports.Droppable = connectedDroppable;
14688 exports.Draggable = ConnectedDraggable;
14689 exports.resetServerContext = resetServerContext;
14690
14691 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(33)))
14692
14693/***/ }),
14694/* 88 */
14695/***/ (function(module, exports, __webpack_require__) {
14696
14697 var _Object$assign = __webpack_require__(89);
14698
14699 function _extends() {
14700 module.exports = _extends = _Object$assign || function (target) {
14701 for (var i = 1; i < arguments.length; i++) {
14702 var source = arguments[i];
14703
14704 for (var key in source) {
14705 if (Object.prototype.hasOwnProperty.call(source, key)) {
14706 target[key] = source[key];
14707 }
14708 }
14709 }
14710
14711 return target;
14712 };
14713
14714 return _extends.apply(this, arguments);
14715 }
14716
14717 module.exports = _extends;
14718
14719/***/ }),
14720/* 89 */
14721/***/ (function(module, exports, __webpack_require__) {
14722
14723 module.exports = __webpack_require__(90);
14724
14725/***/ }),
14726/* 90 */
14727/***/ (function(module, exports, __webpack_require__) {
14728
14729 __webpack_require__(91);
14730 module.exports = __webpack_require__(94).Object.assign;
14731
14732
14733/***/ }),
14734/* 91 */
14735/***/ (function(module, exports, __webpack_require__) {
14736
14737 // 19.1.3.1 Object.assign(target, source)
14738 var $export = __webpack_require__(92);
14739
14740 $export($export.S + $export.F, 'Object', { assign: __webpack_require__(108) });
14741
14742
14743/***/ }),
14744/* 92 */
14745/***/ (function(module, exports, __webpack_require__) {
14746
14747 var global = __webpack_require__(93);
14748 var core = __webpack_require__(94);
14749 var ctx = __webpack_require__(95);
14750 var hide = __webpack_require__(97);
14751 var has = __webpack_require__(107);
14752 var PROTOTYPE = 'prototype';
14753
14754 var $export = function (type, name, source) {
14755 var IS_FORCED = type & $export.F;
14756 var IS_GLOBAL = type & $export.G;
14757 var IS_STATIC = type & $export.S;
14758 var IS_PROTO = type & $export.P;
14759 var IS_BIND = type & $export.B;
14760 var IS_WRAP = type & $export.W;
14761 var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
14762 var expProto = exports[PROTOTYPE];
14763 var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];
14764 var key, own, out;
14765 if (IS_GLOBAL) source = name;
14766 for (key in source) {
14767 // contains in native
14768 own = !IS_FORCED && target && target[key] !== undefined;
14769 if (own && has(exports, key)) continue;
14770 // export native or passed
14771 out = own ? target[key] : source[key];
14772 // prevent global pollution for namespaces
14773 exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
14774 // bind timers to global for call from export context
14775 : IS_BIND && own ? ctx(out, global)
14776 // wrap global constructors for prevent change them in library
14777 : IS_WRAP && target[key] == out ? (function (C) {
14778 var F = function (a, b, c) {
14779 if (this instanceof C) {
14780 switch (arguments.length) {
14781 case 0: return new C();
14782 case 1: return new C(a);
14783 case 2: return new C(a, b);
14784 } return new C(a, b, c);
14785 } return C.apply(this, arguments);
14786 };
14787 F[PROTOTYPE] = C[PROTOTYPE];
14788 return F;
14789 // make static versions for prototype methods
14790 })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
14791 // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
14792 if (IS_PROTO) {
14793 (exports.virtual || (exports.virtual = {}))[key] = out;
14794 // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
14795 if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);
14796 }
14797 }
14798 };
14799 // type bitmap
14800 $export.F = 1; // forced
14801 $export.G = 2; // global
14802 $export.S = 4; // static
14803 $export.P = 8; // proto
14804 $export.B = 16; // bind
14805 $export.W = 32; // wrap
14806 $export.U = 64; // safe
14807 $export.R = 128; // real proto method for `library`
14808 module.exports = $export;
14809
14810
14811/***/ }),
14812/* 93 */
14813/***/ (function(module, exports) {
14814
14815 // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
14816 var global = module.exports = typeof window != 'undefined' && window.Math == Math
14817 ? window : typeof self != 'undefined' && self.Math == Math ? self
14818 // eslint-disable-next-line no-new-func
14819 : Function('return this')();
14820 if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
14821
14822
14823/***/ }),
14824/* 94 */
14825/***/ (function(module, exports) {
14826
14827 var core = module.exports = { version: '2.6.5' };
14828 if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
14829
14830
14831/***/ }),
14832/* 95 */
14833/***/ (function(module, exports, __webpack_require__) {
14834
14835 // optional / simple context binding
14836 var aFunction = __webpack_require__(96);
14837 module.exports = function (fn, that, length) {
14838 aFunction(fn);
14839 if (that === undefined) return fn;
14840 switch (length) {
14841 case 1: return function (a) {
14842 return fn.call(that, a);
14843 };
14844 case 2: return function (a, b) {
14845 return fn.call(that, a, b);
14846 };
14847 case 3: return function (a, b, c) {
14848 return fn.call(that, a, b, c);
14849 };
14850 }
14851 return function (/* ...args */) {
14852 return fn.apply(that, arguments);
14853 };
14854 };
14855
14856
14857/***/ }),
14858/* 96 */
14859/***/ (function(module, exports) {
14860
14861 module.exports = function (it) {
14862 if (typeof it != 'function') throw TypeError(it + ' is not a function!');
14863 return it;
14864 };
14865
14866
14867/***/ }),
14868/* 97 */
14869/***/ (function(module, exports, __webpack_require__) {
14870
14871 var dP = __webpack_require__(98);
14872 var createDesc = __webpack_require__(106);
14873 module.exports = __webpack_require__(102) ? function (object, key, value) {
14874 return dP.f(object, key, createDesc(1, value));
14875 } : function (object, key, value) {
14876 object[key] = value;
14877 return object;
14878 };
14879
14880
14881/***/ }),
14882/* 98 */
14883/***/ (function(module, exports, __webpack_require__) {
14884
14885 var anObject = __webpack_require__(99);
14886 var IE8_DOM_DEFINE = __webpack_require__(101);
14887 var toPrimitive = __webpack_require__(105);
14888 var dP = Object.defineProperty;
14889
14890 exports.f = __webpack_require__(102) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
14891 anObject(O);
14892 P = toPrimitive(P, true);
14893 anObject(Attributes);
14894 if (IE8_DOM_DEFINE) try {
14895 return dP(O, P, Attributes);
14896 } catch (e) { /* empty */ }
14897 if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
14898 if ('value' in Attributes) O[P] = Attributes.value;
14899 return O;
14900 };
14901
14902
14903/***/ }),
14904/* 99 */
14905/***/ (function(module, exports, __webpack_require__) {
14906
14907 var isObject = __webpack_require__(100);
14908 module.exports = function (it) {
14909 if (!isObject(it)) throw TypeError(it + ' is not an object!');
14910 return it;
14911 };
14912
14913
14914/***/ }),
14915/* 100 */
14916/***/ (function(module, exports) {
14917
14918 module.exports = function (it) {
14919 return typeof it === 'object' ? it !== null : typeof it === 'function';
14920 };
14921
14922
14923/***/ }),
14924/* 101 */
14925/***/ (function(module, exports, __webpack_require__) {
14926
14927 module.exports = !__webpack_require__(102) && !__webpack_require__(103)(function () {
14928 return Object.defineProperty(__webpack_require__(104)('div'), 'a', { get: function () { return 7; } }).a != 7;
14929 });
14930
14931
14932/***/ }),
14933/* 102 */
14934/***/ (function(module, exports, __webpack_require__) {
14935
14936 // Thank's IE8 for his funny defineProperty
14937 module.exports = !__webpack_require__(103)(function () {
14938 return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
14939 });
14940
14941
14942/***/ }),
14943/* 103 */
14944/***/ (function(module, exports) {
14945
14946 module.exports = function (exec) {
14947 try {
14948 return !!exec();
14949 } catch (e) {
14950 return true;
14951 }
14952 };
14953
14954
14955/***/ }),
14956/* 104 */
14957/***/ (function(module, exports, __webpack_require__) {
14958
14959 var isObject = __webpack_require__(100);
14960 var document = __webpack_require__(93).document;
14961 // typeof document.createElement is 'object' in old IE
14962 var is = isObject(document) && isObject(document.createElement);
14963 module.exports = function (it) {
14964 return is ? document.createElement(it) : {};
14965 };
14966
14967
14968/***/ }),
14969/* 105 */
14970/***/ (function(module, exports, __webpack_require__) {
14971
14972 // 7.1.1 ToPrimitive(input [, PreferredType])
14973 var isObject = __webpack_require__(100);
14974 // instead of the ES6 spec version, we didn't implement @@toPrimitive case
14975 // and the second argument - flag - preferred type is a string
14976 module.exports = function (it, S) {
14977 if (!isObject(it)) return it;
14978 var fn, val;
14979 if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
14980 if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
14981 if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
14982 throw TypeError("Can't convert object to primitive value");
14983 };
14984
14985
14986/***/ }),
14987/* 106 */
14988/***/ (function(module, exports) {
14989
14990 module.exports = function (bitmap, value) {
14991 return {
14992 enumerable: !(bitmap & 1),
14993 configurable: !(bitmap & 2),
14994 writable: !(bitmap & 4),
14995 value: value
14996 };
14997 };
14998
14999
15000/***/ }),
15001/* 107 */
15002/***/ (function(module, exports) {
15003
15004 var hasOwnProperty = {}.hasOwnProperty;
15005 module.exports = function (it, key) {
15006 return hasOwnProperty.call(it, key);
15007 };
15008
15009
15010/***/ }),
15011/* 108 */
15012/***/ (function(module, exports, __webpack_require__) {
15013
15014 'use strict';
15015 // 19.1.2.1 Object.assign(target, source, ...)
15016 var getKeys = __webpack_require__(109);
15017 var gOPS = __webpack_require__(124);
15018 var pIE = __webpack_require__(125);
15019 var toObject = __webpack_require__(126);
15020 var IObject = __webpack_require__(112);
15021 var $assign = Object.assign;
15022
15023 // should work with symbols and should have deterministic property order (V8 bug)
15024 module.exports = !$assign || __webpack_require__(103)(function () {
15025 var A = {};
15026 var B = {};
15027 // eslint-disable-next-line no-undef
15028 var S = Symbol();
15029 var K = 'abcdefghijklmnopqrst';
15030 A[S] = 7;
15031 K.split('').forEach(function (k) { B[k] = k; });
15032 return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
15033 }) ? function assign(target, source) { // eslint-disable-line no-unused-vars
15034 var T = toObject(target);
15035 var aLen = arguments.length;
15036 var index = 1;
15037 var getSymbols = gOPS.f;
15038 var isEnum = pIE.f;
15039 while (aLen > index) {
15040 var S = IObject(arguments[index++]);
15041 var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);
15042 var length = keys.length;
15043 var j = 0;
15044 var key;
15045 while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];
15046 } return T;
15047 } : $assign;
15048
15049
15050/***/ }),
15051/* 109 */
15052/***/ (function(module, exports, __webpack_require__) {
15053
15054 // 19.1.2.14 / 15.2.3.14 Object.keys(O)
15055 var $keys = __webpack_require__(110);
15056 var enumBugKeys = __webpack_require__(123);
15057
15058 module.exports = Object.keys || function keys(O) {
15059 return $keys(O, enumBugKeys);
15060 };
15061
15062
15063/***/ }),
15064/* 110 */
15065/***/ (function(module, exports, __webpack_require__) {
15066
15067 var has = __webpack_require__(107);
15068 var toIObject = __webpack_require__(111);
15069 var arrayIndexOf = __webpack_require__(115)(false);
15070 var IE_PROTO = __webpack_require__(119)('IE_PROTO');
15071
15072 module.exports = function (object, names) {
15073 var O = toIObject(object);
15074 var i = 0;
15075 var result = [];
15076 var key;
15077 for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
15078 // Don't enum bug & hidden keys
15079 while (names.length > i) if (has(O, key = names[i++])) {
15080 ~arrayIndexOf(result, key) || result.push(key);
15081 }
15082 return result;
15083 };
15084
15085
15086/***/ }),
15087/* 111 */
15088/***/ (function(module, exports, __webpack_require__) {
15089
15090 // to indexed object, toObject with fallback for non-array-like ES3 strings
15091 var IObject = __webpack_require__(112);
15092 var defined = __webpack_require__(114);
15093 module.exports = function (it) {
15094 return IObject(defined(it));
15095 };
15096
15097
15098/***/ }),
15099/* 112 */
15100/***/ (function(module, exports, __webpack_require__) {
15101
15102 // fallback for non-array-like ES3 and non-enumerable old V8 strings
15103 var cof = __webpack_require__(113);
15104 // eslint-disable-next-line no-prototype-builtins
15105 module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
15106 return cof(it) == 'String' ? it.split('') : Object(it);
15107 };
15108
15109
15110/***/ }),
15111/* 113 */
15112/***/ (function(module, exports) {
15113
15114 var toString = {}.toString;
15115
15116 module.exports = function (it) {
15117 return toString.call(it).slice(8, -1);
15118 };
15119
15120
15121/***/ }),
15122/* 114 */
15123/***/ (function(module, exports) {
15124
15125 // 7.2.1 RequireObjectCoercible(argument)
15126 module.exports = function (it) {
15127 if (it == undefined) throw TypeError("Can't call method on " + it);
15128 return it;
15129 };
15130
15131
15132/***/ }),
15133/* 115 */
15134/***/ (function(module, exports, __webpack_require__) {
15135
15136 // false -> Array#indexOf
15137 // true -> Array#includes
15138 var toIObject = __webpack_require__(111);
15139 var toLength = __webpack_require__(116);
15140 var toAbsoluteIndex = __webpack_require__(118);
15141 module.exports = function (IS_INCLUDES) {
15142 return function ($this, el, fromIndex) {
15143 var O = toIObject($this);
15144 var length = toLength(O.length);
15145 var index = toAbsoluteIndex(fromIndex, length);
15146 var value;
15147 // Array#includes uses SameValueZero equality algorithm
15148 // eslint-disable-next-line no-self-compare
15149 if (IS_INCLUDES && el != el) while (length > index) {
15150 value = O[index++];
15151 // eslint-disable-next-line no-self-compare
15152 if (value != value) return true;
15153 // Array#indexOf ignores holes, Array#includes - not
15154 } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
15155 if (O[index] === el) return IS_INCLUDES || index || 0;
15156 } return !IS_INCLUDES && -1;
15157 };
15158 };
15159
15160
15161/***/ }),
15162/* 116 */
15163/***/ (function(module, exports, __webpack_require__) {
15164
15165 // 7.1.15 ToLength
15166 var toInteger = __webpack_require__(117);
15167 var min = Math.min;
15168 module.exports = function (it) {
15169 return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
15170 };
15171
15172
15173/***/ }),
15174/* 117 */
15175/***/ (function(module, exports) {
15176
15177 // 7.1.4 ToInteger
15178 var ceil = Math.ceil;
15179 var floor = Math.floor;
15180 module.exports = function (it) {
15181 return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
15182 };
15183
15184
15185/***/ }),
15186/* 118 */
15187/***/ (function(module, exports, __webpack_require__) {
15188
15189 var toInteger = __webpack_require__(117);
15190 var max = Math.max;
15191 var min = Math.min;
15192 module.exports = function (index, length) {
15193 index = toInteger(index);
15194 return index < 0 ? max(index + length, 0) : min(index, length);
15195 };
15196
15197
15198/***/ }),
15199/* 119 */
15200/***/ (function(module, exports, __webpack_require__) {
15201
15202 var shared = __webpack_require__(120)('keys');
15203 var uid = __webpack_require__(122);
15204 module.exports = function (key) {
15205 return shared[key] || (shared[key] = uid(key));
15206 };
15207
15208
15209/***/ }),
15210/* 120 */
15211/***/ (function(module, exports, __webpack_require__) {
15212
15213 var core = __webpack_require__(94);
15214 var global = __webpack_require__(93);
15215 var SHARED = '__core-js_shared__';
15216 var store = global[SHARED] || (global[SHARED] = {});
15217
15218 (module.exports = function (key, value) {
15219 return store[key] || (store[key] = value !== undefined ? value : {});
15220 })('versions', []).push({
15221 version: core.version,
15222 mode: __webpack_require__(121) ? 'pure' : 'global',
15223 copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
15224 });
15225
15226
15227/***/ }),
15228/* 121 */
15229/***/ (function(module, exports) {
15230
15231 module.exports = true;
15232
15233
15234/***/ }),
15235/* 122 */
15236/***/ (function(module, exports) {
15237
15238 var id = 0;
15239 var px = Math.random();
15240 module.exports = function (key) {
15241 return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
15242 };
15243
15244
15245/***/ }),
15246/* 123 */
15247/***/ (function(module, exports) {
15248
15249 // IE 8- don't enum bug keys
15250 module.exports = (
15251 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
15252 ).split(',');
15253
15254
15255/***/ }),
15256/* 124 */
15257/***/ (function(module, exports) {
15258
15259 exports.f = Object.getOwnPropertySymbols;
15260
15261
15262/***/ }),
15263/* 125 */
15264/***/ (function(module, exports) {
15265
15266 exports.f = {}.propertyIsEnumerable;
15267
15268
15269/***/ }),
15270/* 126 */
15271/***/ (function(module, exports, __webpack_require__) {
15272
15273 // 7.1.13 ToObject(argument)
15274 var defined = __webpack_require__(114);
15275 module.exports = function (it) {
15276 return Object(defined(it));
15277 };
15278
15279
15280/***/ }),
15281/* 127 */
15282/***/ (function(module, exports, __webpack_require__) {
15283
15284 /* WEBPACK VAR INJECTION */(function(process) {'use strict';
15285
15286 var isProduction = process.env.NODE_ENV === 'production';
15287 var prefix = 'Invariant failed';
15288 function invariant(condition, message) {
15289 if (condition) {
15290 return;
15291 }
15292
15293 if (isProduction) {
15294 throw new Error(prefix);
15295 } else {
15296 throw new Error(prefix + ": " + (message || ''));
15297 }
15298 }
15299
15300 module.exports = invariant;
15301
15302 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(33)))
15303
15304/***/ }),
15305/* 128 */
15306/***/ (function(module, exports, __webpack_require__) {
15307
15308 /* WEBPACK VAR INJECTION */(function(process) {'use strict';
15309
15310 Object.defineProperty(exports, '__esModule', { value: true });
15311
15312 function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
15313
15314 var invariant = _interopDefault(__webpack_require__(127));
15315
15316 var getRect = function getRect(_ref) {
15317 var top = _ref.top,
15318 right = _ref.right,
15319 bottom = _ref.bottom,
15320 left = _ref.left;
15321 var width = right - left;
15322 var height = bottom - top;
15323 var rect = {
15324 top: top,
15325 right: right,
15326 bottom: bottom,
15327 left: left,
15328 width: width,
15329 height: height,
15330 x: left,
15331 y: top,
15332 center: {
15333 x: (right + left) / 2,
15334 y: (bottom + top) / 2
15335 }
15336 };
15337 return rect;
15338 };
15339 var expand = function expand(target, expandBy) {
15340 return {
15341 top: target.top - expandBy.top,
15342 left: target.left - expandBy.left,
15343 bottom: target.bottom + expandBy.bottom,
15344 right: target.right + expandBy.right
15345 };
15346 };
15347 var shrink = function shrink(target, shrinkBy) {
15348 return {
15349 top: target.top + shrinkBy.top,
15350 left: target.left + shrinkBy.left,
15351 bottom: target.bottom - shrinkBy.bottom,
15352 right: target.right - shrinkBy.right
15353 };
15354 };
15355
15356 var shift = function shift(target, shiftBy) {
15357 return {
15358 top: target.top + shiftBy.y,
15359 left: target.left + shiftBy.x,
15360 bottom: target.bottom + shiftBy.y,
15361 right: target.right + shiftBy.x
15362 };
15363 };
15364
15365 var noSpacing = {
15366 top: 0,
15367 right: 0,
15368 bottom: 0,
15369 left: 0
15370 };
15371 var createBox = function createBox(_ref2) {
15372 var borderBox = _ref2.borderBox,
15373 _ref2$margin = _ref2.margin,
15374 margin = _ref2$margin === void 0 ? noSpacing : _ref2$margin,
15375 _ref2$border = _ref2.border,
15376 border = _ref2$border === void 0 ? noSpacing : _ref2$border,
15377 _ref2$padding = _ref2.padding,
15378 padding = _ref2$padding === void 0 ? noSpacing : _ref2$padding;
15379 var marginBox = getRect(expand(borderBox, margin));
15380 var paddingBox = getRect(shrink(borderBox, border));
15381 var contentBox = getRect(shrink(paddingBox, padding));
15382 return {
15383 marginBox: marginBox,
15384 borderBox: getRect(borderBox),
15385 paddingBox: paddingBox,
15386 contentBox: contentBox,
15387 margin: margin,
15388 border: border,
15389 padding: padding
15390 };
15391 };
15392
15393 var parse = function parse(raw) {
15394 var value = raw.slice(0, -2);
15395 var suffix = raw.slice(-2);
15396 !(suffix === 'px') ? process.env.NODE_ENV !== "production" ? invariant(false, "Expected value to be a pixel value.\n Expected form: 10px\n Actual value: " + raw + "\n ") : invariant(false) : void 0;
15397 var result = Number(value);
15398 !!isNaN(result) ? process.env.NODE_ENV !== "production" ? invariant(false, "Could not parse value [raw: " + raw + ", without suffix: " + value + "]") : invariant(false) : void 0;
15399 return result;
15400 };
15401
15402 var getWindowScroll = function getWindowScroll() {
15403 return {
15404 x: window.pageXOffset,
15405 y: window.pageYOffset
15406 };
15407 };
15408
15409 var offset = function offset(original, change) {
15410 var borderBox = original.borderBox,
15411 border = original.border,
15412 margin = original.margin,
15413 padding = original.padding;
15414 var shifted = shift(borderBox, change);
15415 return createBox({
15416 borderBox: shifted,
15417 border: border,
15418 margin: margin,
15419 padding: padding
15420 });
15421 };
15422 var withScroll = function withScroll(original, scroll) {
15423 if (scroll === void 0) {
15424 scroll = getWindowScroll();
15425 }
15426
15427 return offset(original, scroll);
15428 };
15429 var calculateBox = function calculateBox(borderBox, styles) {
15430 var margin = {
15431 top: parse(styles.marginTop),
15432 right: parse(styles.marginRight),
15433 bottom: parse(styles.marginBottom),
15434 left: parse(styles.marginLeft)
15435 };
15436 var padding = {
15437 top: parse(styles.paddingTop),
15438 right: parse(styles.paddingRight),
15439 bottom: parse(styles.paddingBottom),
15440 left: parse(styles.paddingLeft)
15441 };
15442 var border = {
15443 top: parse(styles.borderTopWidth),
15444 right: parse(styles.borderRightWidth),
15445 bottom: parse(styles.borderBottomWidth),
15446 left: parse(styles.borderLeftWidth)
15447 };
15448 return createBox({
15449 borderBox: borderBox,
15450 margin: margin,
15451 padding: padding,
15452 border: border
15453 });
15454 };
15455 var getBox = function getBox(el) {
15456 var borderBox = el.getBoundingClientRect();
15457 var styles = window.getComputedStyle(el);
15458 return calculateBox(borderBox, styles);
15459 };
15460
15461 exports.getRect = getRect;
15462 exports.expand = expand;
15463 exports.shrink = shrink;
15464 exports.createBox = createBox;
15465 exports.offset = offset;
15466 exports.withScroll = withScroll;
15467 exports.calculateBox = calculateBox;
15468 exports.getBox = getBox;
15469
15470 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(33)))
15471
15472/***/ }),
15473/* 129 */
15474/***/ (function(module, exports, __webpack_require__) {
15475
15476 module.exports = __webpack_require__(130);
15477
15478/***/ }),
15479/* 130 */
15480/***/ (function(module, exports, __webpack_require__) {
15481
15482 __webpack_require__(131);
15483 module.exports = __webpack_require__(94).Object.keys;
15484
15485
15486/***/ }),
15487/* 131 */
15488/***/ (function(module, exports, __webpack_require__) {
15489
15490 // 19.1.2.14 Object.keys(O)
15491 var toObject = __webpack_require__(126);
15492 var $keys = __webpack_require__(109);
15493
15494 __webpack_require__(132)('keys', function () {
15495 return function keys(it) {
15496 return $keys(toObject(it));
15497 };
15498 });
15499
15500
15501/***/ }),
15502/* 132 */
15503/***/ (function(module, exports, __webpack_require__) {
15504
15505 // most Object methods by ES6 should accept primitives
15506 var $export = __webpack_require__(92);
15507 var core = __webpack_require__(94);
15508 var fails = __webpack_require__(103);
15509 module.exports = function (KEY, exec) {
15510 var fn = (core.Object || {})[KEY] || Object[KEY];
15511 var exp = {};
15512 exp[KEY] = exec(fn);
15513 $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);
15514 };
15515
15516
15517/***/ }),
15518/* 133 */
15519/***/ (function(module, exports) {
15520
15521 'use strict';
15522
15523 var simpleIsEqual = function simpleIsEqual(a, b) {
15524 return a === b;
15525 };
15526
15527 function index (resultFn, isEqual) {
15528 if (isEqual === void 0) {
15529 isEqual = simpleIsEqual;
15530 }
15531
15532 var lastThis;
15533 var lastArgs = [];
15534 var lastResult;
15535 var calledOnce = false;
15536
15537 var isNewArgEqualToLast = function isNewArgEqualToLast(newArg, index) {
15538 return isEqual(newArg, lastArgs[index], index);
15539 };
15540
15541 var result = function result() {
15542 for (var _len = arguments.length, newArgs = new Array(_len), _key = 0; _key < _len; _key++) {
15543 newArgs[_key] = arguments[_key];
15544 }
15545
15546 if (calledOnce && lastThis === this && newArgs.length === lastArgs.length && newArgs.every(isNewArgEqualToLast)) {
15547 return lastResult;
15548 }
15549
15550 lastResult = resultFn.apply(this, newArgs);
15551 calledOnce = true;
15552 lastThis = this;
15553 lastArgs = newArgs;
15554 return lastResult;
15555 };
15556
15557 return result;
15558 }
15559
15560 module.exports = index;
15561
15562
15563/***/ }),
15564/* 134 */
15565/***/ (function(module, exports, __webpack_require__) {
15566
15567 /* WEBPACK VAR INJECTION */(function(process) {'use strict';
15568
15569 Object.defineProperty(exports, '__esModule', { value: true });
15570
15571 function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
15572
15573 var $$observable = _interopDefault(__webpack_require__(135));
15574
15575 /**
15576 * These are private action types reserved by Redux.
15577 * For any unknown actions, you must return the current state.
15578 * If the current state is undefined, you must return the initial state.
15579 * Do not reference these action types directly in your code.
15580 */
15581 var randomString = function randomString() {
15582 return Math.random().toString(36).substring(7).split('').join('.');
15583 };
15584
15585 var ActionTypes = {
15586 INIT: "@@redux/INIT" + randomString(),
15587 REPLACE: "@@redux/REPLACE" + randomString(),
15588 PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {
15589 return "@@redux/PROBE_UNKNOWN_ACTION" + randomString();
15590 }
15591 };
15592
15593 /**
15594 * @param {any} obj The object to inspect.
15595 * @returns {boolean} True if the argument appears to be a plain object.
15596 */
15597 function isPlainObject(obj) {
15598 if (typeof obj !== 'object' || obj === null) return false;
15599 var proto = obj;
15600
15601 while (Object.getPrototypeOf(proto) !== null) {
15602 proto = Object.getPrototypeOf(proto);
15603 }
15604
15605 return Object.getPrototypeOf(obj) === proto;
15606 }
15607
15608 /**
15609 * Creates a Redux store that holds the state tree.
15610 * The only way to change the data in the store is to call `dispatch()` on it.
15611 *
15612 * There should only be a single store in your app. To specify how different
15613 * parts of the state tree respond to actions, you may combine several reducers
15614 * into a single reducer function by using `combineReducers`.
15615 *
15616 * @param {Function} reducer A function that returns the next state tree, given
15617 * the current state tree and the action to handle.
15618 *
15619 * @param {any} [preloadedState] The initial state. You may optionally specify it
15620 * to hydrate the state from the server in universal apps, or to restore a
15621 * previously serialized user session.
15622 * If you use `combineReducers` to produce the root reducer function, this must be
15623 * an object with the same shape as `combineReducers` keys.
15624 *
15625 * @param {Function} [enhancer] The store enhancer. You may optionally specify it
15626 * to enhance the store with third-party capabilities such as middleware,
15627 * time travel, persistence, etc. The only store enhancer that ships with Redux
15628 * is `applyMiddleware()`.
15629 *
15630 * @returns {Store} A Redux store that lets you read the state, dispatch actions
15631 * and subscribe to changes.
15632 */
15633
15634 function createStore(reducer, preloadedState, enhancer) {
15635 var _ref2;
15636
15637 if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {
15638 throw new Error('It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function');
15639 }
15640
15641 if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
15642 enhancer = preloadedState;
15643 preloadedState = undefined;
15644 }
15645
15646 if (typeof enhancer !== 'undefined') {
15647 if (typeof enhancer !== 'function') {
15648 throw new Error('Expected the enhancer to be a function.');
15649 }
15650
15651 return enhancer(createStore)(reducer, preloadedState);
15652 }
15653
15654 if (typeof reducer !== 'function') {
15655 throw new Error('Expected the reducer to be a function.');
15656 }
15657
15658 var currentReducer = reducer;
15659 var currentState = preloadedState;
15660 var currentListeners = [];
15661 var nextListeners = currentListeners;
15662 var isDispatching = false;
15663
15664 function ensureCanMutateNextListeners() {
15665 if (nextListeners === currentListeners) {
15666 nextListeners = currentListeners.slice();
15667 }
15668 }
15669 /**
15670 * Reads the state tree managed by the store.
15671 *
15672 * @returns {any} The current state tree of your application.
15673 */
15674
15675
15676 function getState() {
15677 if (isDispatching) {
15678 throw new Error('You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');
15679 }
15680
15681 return currentState;
15682 }
15683 /**
15684 * Adds a change listener. It will be called any time an action is dispatched,
15685 * and some part of the state tree may potentially have changed. You may then
15686 * call `getState()` to read the current state tree inside the callback.
15687 *
15688 * You may call `dispatch()` from a change listener, with the following
15689 * caveats:
15690 *
15691 * 1. The subscriptions are snapshotted just before every `dispatch()` call.
15692 * If you subscribe or unsubscribe while the listeners are being invoked, this
15693 * will not have any effect on the `dispatch()` that is currently in progress.
15694 * However, the next `dispatch()` call, whether nested or not, will use a more
15695 * recent snapshot of the subscription list.
15696 *
15697 * 2. The listener should not expect to see all state changes, as the state
15698 * might have been updated multiple times during a nested `dispatch()` before
15699 * the listener is called. It is, however, guaranteed that all subscribers
15700 * registered before the `dispatch()` started will be called with the latest
15701 * state by the time it exits.
15702 *
15703 * @param {Function} listener A callback to be invoked on every dispatch.
15704 * @returns {Function} A function to remove this change listener.
15705 */
15706
15707
15708 function subscribe(listener) {
15709 if (typeof listener !== 'function') {
15710 throw new Error('Expected the listener to be a function.');
15711 }
15712
15713 if (isDispatching) {
15714 throw new Error('You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api-reference/store#subscribe(listener) for more details.');
15715 }
15716
15717 var isSubscribed = true;
15718 ensureCanMutateNextListeners();
15719 nextListeners.push(listener);
15720 return function unsubscribe() {
15721 if (!isSubscribed) {
15722 return;
15723 }
15724
15725 if (isDispatching) {
15726 throw new Error('You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api-reference/store#subscribe(listener) for more details.');
15727 }
15728
15729 isSubscribed = false;
15730 ensureCanMutateNextListeners();
15731 var index = nextListeners.indexOf(listener);
15732 nextListeners.splice(index, 1);
15733 };
15734 }
15735 /**
15736 * Dispatches an action. It is the only way to trigger a state change.
15737 *
15738 * The `reducer` function, used to create the store, will be called with the
15739 * current state tree and the given `action`. Its return value will
15740 * be considered the **next** state of the tree, and the change listeners
15741 * will be notified.
15742 *
15743 * The base implementation only supports plain object actions. If you want to
15744 * dispatch a Promise, an Observable, a thunk, or something else, you need to
15745 * wrap your store creating function into the corresponding middleware. For
15746 * example, see the documentation for the `redux-thunk` package. Even the
15747 * middleware will eventually dispatch plain object actions using this method.
15748 *
15749 * @param {Object} action A plain object representing “what changed”. It is
15750 * a good idea to keep actions serializable so you can record and replay user
15751 * sessions, or use the time travelling `redux-devtools`. An action must have
15752 * a `type` property which may not be `undefined`. It is a good idea to use
15753 * string constants for action types.
15754 *
15755 * @returns {Object} For convenience, the same action object you dispatched.
15756 *
15757 * Note that, if you use a custom middleware, it may wrap `dispatch()` to
15758 * return something else (for example, a Promise you can await).
15759 */
15760
15761
15762 function dispatch(action) {
15763 if (!isPlainObject(action)) {
15764 throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.');
15765 }
15766
15767 if (typeof action.type === 'undefined') {
15768 throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?');
15769 }
15770
15771 if (isDispatching) {
15772 throw new Error('Reducers may not dispatch actions.');
15773 }
15774
15775 try {
15776 isDispatching = true;
15777 currentState = currentReducer(currentState, action);
15778 } finally {
15779 isDispatching = false;
15780 }
15781
15782 var listeners = currentListeners = nextListeners;
15783
15784 for (var i = 0; i < listeners.length; i++) {
15785 var listener = listeners[i];
15786 listener();
15787 }
15788
15789 return action;
15790 }
15791 /**
15792 * Replaces the reducer currently used by the store to calculate the state.
15793 *
15794 * You might need this if your app implements code splitting and you want to
15795 * load some of the reducers dynamically. You might also need this if you
15796 * implement a hot reloading mechanism for Redux.
15797 *
15798 * @param {Function} nextReducer The reducer for the store to use instead.
15799 * @returns {void}
15800 */
15801
15802
15803 function replaceReducer(nextReducer) {
15804 if (typeof nextReducer !== 'function') {
15805 throw new Error('Expected the nextReducer to be a function.');
15806 }
15807
15808 currentReducer = nextReducer;
15809 dispatch({
15810 type: ActionTypes.REPLACE
15811 });
15812 }
15813 /**
15814 * Interoperability point for observable/reactive libraries.
15815 * @returns {observable} A minimal observable of state changes.
15816 * For more information, see the observable proposal:
15817 * https://github.com/tc39/proposal-observable
15818 */
15819
15820
15821 function observable() {
15822 var _ref;
15823
15824 var outerSubscribe = subscribe;
15825 return _ref = {
15826 /**
15827 * The minimal observable subscription method.
15828 * @param {Object} observer Any object that can be used as an observer.
15829 * The observer object should have a `next` method.
15830 * @returns {subscription} An object with an `unsubscribe` method that can
15831 * be used to unsubscribe the observable from the store, and prevent further
15832 * emission of values from the observable.
15833 */
15834 subscribe: function subscribe(observer) {
15835 if (typeof observer !== 'object' || observer === null) {
15836 throw new TypeError('Expected the observer to be an object.');
15837 }
15838
15839 function observeState() {
15840 if (observer.next) {
15841 observer.next(getState());
15842 }
15843 }
15844
15845 observeState();
15846 var unsubscribe = outerSubscribe(observeState);
15847 return {
15848 unsubscribe: unsubscribe
15849 };
15850 }
15851 }, _ref[$$observable] = function () {
15852 return this;
15853 }, _ref;
15854 } // When a store is created, an "INIT" action is dispatched so that every
15855 // reducer returns their initial state. This effectively populates
15856 // the initial state tree.
15857
15858
15859 dispatch({
15860 type: ActionTypes.INIT
15861 });
15862 return _ref2 = {
15863 dispatch: dispatch,
15864 subscribe: subscribe,
15865 getState: getState,
15866 replaceReducer: replaceReducer
15867 }, _ref2[$$observable] = observable, _ref2;
15868 }
15869
15870 /**
15871 * Prints a warning in the console if it exists.
15872 *
15873 * @param {String} message The warning message.
15874 * @returns {void}
15875 */
15876 function warning(message) {
15877 /* eslint-disable no-console */
15878 if (typeof console !== 'undefined' && typeof console.error === 'function') {
15879 console.error(message);
15880 }
15881 /* eslint-enable no-console */
15882
15883
15884 try {
15885 // This error was thrown as a convenience so that if you enable
15886 // "break on all exceptions" in your console,
15887 // it would pause the execution at this line.
15888 throw new Error(message);
15889 } catch (e) {} // eslint-disable-line no-empty
15890
15891 }
15892
15893 function getUndefinedStateErrorMessage(key, action) {
15894 var actionType = action && action.type;
15895 var actionDescription = actionType && "action \"" + String(actionType) + "\"" || 'an action';
15896 return "Given " + actionDescription + ", reducer \"" + key + "\" returned undefined. " + "To ignore an action, you must explicitly return the previous state. " + "If you want this reducer to hold no value, you can return null instead of undefined.";
15897 }
15898
15899 function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
15900 var reducerKeys = Object.keys(reducers);
15901 var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';
15902
15903 if (reducerKeys.length === 0) {
15904 return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';
15905 }
15906
15907 if (!isPlainObject(inputState)) {
15908 return "The " + argumentName + " has unexpected type of \"" + {}.toString.call(inputState).match(/\s([a-z|A-Z]+)/)[1] + "\". Expected argument to be an object with the following " + ("keys: \"" + reducerKeys.join('", "') + "\"");
15909 }
15910
15911 var unexpectedKeys = Object.keys(inputState).filter(function (key) {
15912 return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];
15913 });
15914 unexpectedKeys.forEach(function (key) {
15915 unexpectedKeyCache[key] = true;
15916 });
15917 if (action && action.type === ActionTypes.REPLACE) return;
15918
15919 if (unexpectedKeys.length > 0) {
15920 return "Unexpected " + (unexpectedKeys.length > 1 ? 'keys' : 'key') + " " + ("\"" + unexpectedKeys.join('", "') + "\" found in " + argumentName + ". ") + "Expected to find one of the known reducer keys instead: " + ("\"" + reducerKeys.join('", "') + "\". Unexpected keys will be ignored.");
15921 }
15922 }
15923
15924 function assertReducerShape(reducers) {
15925 Object.keys(reducers).forEach(function (key) {
15926 var reducer = reducers[key];
15927 var initialState = reducer(undefined, {
15928 type: ActionTypes.INIT
15929 });
15930
15931 if (typeof initialState === 'undefined') {
15932 throw new Error("Reducer \"" + key + "\" returned undefined during initialization. " + "If the state passed to the reducer is undefined, you must " + "explicitly return the initial state. The initial state may " + "not be undefined. If you don't want to set a value for this reducer, " + "you can use null instead of undefined.");
15933 }
15934
15935 if (typeof reducer(undefined, {
15936 type: ActionTypes.PROBE_UNKNOWN_ACTION()
15937 }) === 'undefined') {
15938 throw new Error("Reducer \"" + key + "\" returned undefined when probed with a random type. " + ("Don't try to handle " + ActionTypes.INIT + " or other actions in \"redux/*\" ") + "namespace. They are considered private. Instead, you must return the " + "current state for any unknown actions, unless it is undefined, " + "in which case you must return the initial state, regardless of the " + "action type. The initial state may not be undefined, but can be null.");
15939 }
15940 });
15941 }
15942 /**
15943 * Turns an object whose values are different reducer functions, into a single
15944 * reducer function. It will call every child reducer, and gather their results
15945 * into a single state object, whose keys correspond to the keys of the passed
15946 * reducer functions.
15947 *
15948 * @param {Object} reducers An object whose values correspond to different
15949 * reducer functions that need to be combined into one. One handy way to obtain
15950 * it is to use ES6 `import * as reducers` syntax. The reducers may never return
15951 * undefined for any action. Instead, they should return their initial state
15952 * if the state passed to them was undefined, and the current state for any
15953 * unrecognized action.
15954 *
15955 * @returns {Function} A reducer function that invokes every reducer inside the
15956 * passed object, and builds a state object with the same shape.
15957 */
15958
15959
15960 function combineReducers(reducers) {
15961 var reducerKeys = Object.keys(reducers);
15962 var finalReducers = {};
15963
15964 for (var i = 0; i < reducerKeys.length; i++) {
15965 var key = reducerKeys[i];
15966
15967 if (process.env.NODE_ENV !== 'production') {
15968 if (typeof reducers[key] === 'undefined') {
15969 warning("No reducer provided for key \"" + key + "\"");
15970 }
15971 }
15972
15973 if (typeof reducers[key] === 'function') {
15974 finalReducers[key] = reducers[key];
15975 }
15976 }
15977
15978 var finalReducerKeys = Object.keys(finalReducers);
15979 var unexpectedKeyCache;
15980
15981 if (process.env.NODE_ENV !== 'production') {
15982 unexpectedKeyCache = {};
15983 }
15984
15985 var shapeAssertionError;
15986
15987 try {
15988 assertReducerShape(finalReducers);
15989 } catch (e) {
15990 shapeAssertionError = e;
15991 }
15992
15993 return function combination(state, action) {
15994 if (state === void 0) {
15995 state = {};
15996 }
15997
15998 if (shapeAssertionError) {
15999 throw shapeAssertionError;
16000 }
16001
16002 if (process.env.NODE_ENV !== 'production') {
16003 var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);
16004
16005 if (warningMessage) {
16006 warning(warningMessage);
16007 }
16008 }
16009
16010 var hasChanged = false;
16011 var nextState = {};
16012
16013 for (var _i = 0; _i < finalReducerKeys.length; _i++) {
16014 var _key = finalReducerKeys[_i];
16015 var reducer = finalReducers[_key];
16016 var previousStateForKey = state[_key];
16017 var nextStateForKey = reducer(previousStateForKey, action);
16018
16019 if (typeof nextStateForKey === 'undefined') {
16020 var errorMessage = getUndefinedStateErrorMessage(_key, action);
16021 throw new Error(errorMessage);
16022 }
16023
16024 nextState[_key] = nextStateForKey;
16025 hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
16026 }
16027
16028 return hasChanged ? nextState : state;
16029 };
16030 }
16031
16032 function bindActionCreator(actionCreator, dispatch) {
16033 return function () {
16034 return dispatch(actionCreator.apply(this, arguments));
16035 };
16036 }
16037 /**
16038 * Turns an object whose values are action creators, into an object with the
16039 * same keys, but with every function wrapped into a `dispatch` call so they
16040 * may be invoked directly. This is just a convenience method, as you can call
16041 * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.
16042 *
16043 * For convenience, you can also pass a single function as the first argument,
16044 * and get a function in return.
16045 *
16046 * @param {Function|Object} actionCreators An object whose values are action
16047 * creator functions. One handy way to obtain it is to use ES6 `import * as`
16048 * syntax. You may also pass a single function.
16049 *
16050 * @param {Function} dispatch The `dispatch` function available on your Redux
16051 * store.
16052 *
16053 * @returns {Function|Object} The object mimicking the original object, but with
16054 * every action creator wrapped into the `dispatch` call. If you passed a
16055 * function as `actionCreators`, the return value will also be a single
16056 * function.
16057 */
16058
16059
16060 function bindActionCreators(actionCreators, dispatch) {
16061 if (typeof actionCreators === 'function') {
16062 return bindActionCreator(actionCreators, dispatch);
16063 }
16064
16065 if (typeof actionCreators !== 'object' || actionCreators === null) {
16066 throw new Error("bindActionCreators expected an object or a function, instead received " + (actionCreators === null ? 'null' : typeof actionCreators) + ". " + "Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?");
16067 }
16068
16069 var keys = Object.keys(actionCreators);
16070 var boundActionCreators = {};
16071
16072 for (var i = 0; i < keys.length; i++) {
16073 var key = keys[i];
16074 var actionCreator = actionCreators[key];
16075
16076 if (typeof actionCreator === 'function') {
16077 boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
16078 }
16079 }
16080
16081 return boundActionCreators;
16082 }
16083
16084 function _defineProperty(obj, key, value) {
16085 if (key in obj) {
16086 Object.defineProperty(obj, key, {
16087 value: value,
16088 enumerable: true,
16089 configurable: true,
16090 writable: true
16091 });
16092 } else {
16093 obj[key] = value;
16094 }
16095
16096 return obj;
16097 }
16098
16099 function _objectSpread(target) {
16100 for (var i = 1; i < arguments.length; i++) {
16101 var source = arguments[i] != null ? arguments[i] : {};
16102 var ownKeys = Object.keys(source);
16103
16104 if (typeof Object.getOwnPropertySymbols === 'function') {
16105 ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
16106 return Object.getOwnPropertyDescriptor(source, sym).enumerable;
16107 }));
16108 }
16109
16110 ownKeys.forEach(function (key) {
16111 _defineProperty(target, key, source[key]);
16112 });
16113 }
16114
16115 return target;
16116 }
16117
16118 /**
16119 * Composes single-argument functions from right to left. The rightmost
16120 * function can take multiple arguments as it provides the signature for
16121 * the resulting composite function.
16122 *
16123 * @param {...Function} funcs The functions to compose.
16124 * @returns {Function} A function obtained by composing the argument functions
16125 * from right to left. For example, compose(f, g, h) is identical to doing
16126 * (...args) => f(g(h(...args))).
16127 */
16128 function compose() {
16129 for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
16130 funcs[_key] = arguments[_key];
16131 }
16132
16133 if (funcs.length === 0) {
16134 return function (arg) {
16135 return arg;
16136 };
16137 }
16138
16139 if (funcs.length === 1) {
16140 return funcs[0];
16141 }
16142
16143 return funcs.reduce(function (a, b) {
16144 return function () {
16145 return a(b.apply(void 0, arguments));
16146 };
16147 });
16148 }
16149
16150 /**
16151 * Creates a store enhancer that applies middleware to the dispatch method
16152 * of the Redux store. This is handy for a variety of tasks, such as expressing
16153 * asynchronous actions in a concise manner, or logging every action payload.
16154 *
16155 * See `redux-thunk` package as an example of the Redux middleware.
16156 *
16157 * Because middleware is potentially asynchronous, this should be the first
16158 * store enhancer in the composition chain.
16159 *
16160 * Note that each middleware will be given the `dispatch` and `getState` functions
16161 * as named arguments.
16162 *
16163 * @param {...Function} middlewares The middleware chain to be applied.
16164 * @returns {Function} A store enhancer applying the middleware.
16165 */
16166
16167 function applyMiddleware() {
16168 for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {
16169 middlewares[_key] = arguments[_key];
16170 }
16171
16172 return function (createStore) {
16173 return function () {
16174 var store = createStore.apply(void 0, arguments);
16175
16176 var _dispatch = function dispatch() {
16177 throw new Error("Dispatching while constructing your middleware is not allowed. " + "Other middleware would not be applied to this dispatch.");
16178 };
16179
16180 var middlewareAPI = {
16181 getState: store.getState,
16182 dispatch: function dispatch() {
16183 return _dispatch.apply(void 0, arguments);
16184 }
16185 };
16186 var chain = middlewares.map(function (middleware) {
16187 return middleware(middlewareAPI);
16188 });
16189 _dispatch = compose.apply(void 0, chain)(store.dispatch);
16190 return _objectSpread({}, store, {
16191 dispatch: _dispatch
16192 });
16193 };
16194 };
16195 }
16196
16197 /*
16198 * This is a dummy function to check if the function name has been altered by minification.
16199 * If the function has been minified and NODE_ENV !== 'production', warn the user.
16200 */
16201
16202 function isCrushed() {}
16203
16204 if (process.env.NODE_ENV !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {
16205 warning('You are currently using minified code outside of NODE_ENV === "production". ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or setting mode to production in webpack (https://webpack.js.org/concepts/mode/) ' + 'to ensure you have the correct code for your production build.');
16206 }
16207
16208 exports.createStore = createStore;
16209 exports.combineReducers = combineReducers;
16210 exports.bindActionCreators = bindActionCreators;
16211 exports.applyMiddleware = applyMiddleware;
16212 exports.compose = compose;
16213 exports.__DO_NOT_USE__ActionTypes = ActionTypes;
16214
16215 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(33)))
16216
16217/***/ }),
16218/* 135 */
16219/***/ (function(module, exports, __webpack_require__) {
16220
16221 /* WEBPACK VAR INJECTION */(function(global, module) {'use strict';
16222
16223 Object.defineProperty(exports, "__esModule", {
16224 value: true
16225 });
16226
16227 var _ponyfill = __webpack_require__(137);
16228
16229 var _ponyfill2 = _interopRequireDefault(_ponyfill);
16230
16231 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
16232
16233 var root; /* global window */
16234
16235
16236 if (typeof self !== 'undefined') {
16237 root = self;
16238 } else if (typeof window !== 'undefined') {
16239 root = window;
16240 } else if (typeof global !== 'undefined') {
16241 root = global;
16242 } else if (true) {
16243 root = module;
16244 } else {
16245 root = Function('return this')();
16246 }
16247
16248 var result = (0, _ponyfill2['default'])(root);
16249 exports['default'] = result;
16250 /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(136)(module)))
16251
16252/***/ }),
16253/* 136 */
16254/***/ (function(module, exports) {
16255
16256 module.exports = function(module) {
16257 if(!module.webpackPolyfill) {
16258 module.deprecate = function() {};
16259 module.paths = [];
16260 // module.parent = undefined by default
16261 module.children = [];
16262 module.webpackPolyfill = 1;
16263 }
16264 return module;
16265 }
16266
16267
16268/***/ }),
16269/* 137 */
16270/***/ (function(module, exports) {
16271
16272 'use strict';
16273
16274 Object.defineProperty(exports, "__esModule", {
16275 value: true
16276 });
16277 exports['default'] = symbolObservablePonyfill;
16278 function symbolObservablePonyfill(root) {
16279 var result;
16280 var _Symbol = root.Symbol;
16281
16282 if (typeof _Symbol === 'function') {
16283 if (_Symbol.observable) {
16284 result = _Symbol.observable;
16285 } else {
16286 result = _Symbol('observable');
16287 _Symbol.observable = result;
16288 }
16289 } else {
16290 result = '@@observable';
16291 }
16292
16293 return result;
16294 };
16295
16296/***/ }),
16297/* 138 */
16298/***/ (function(module, exports) {
16299
16300 'use strict';
16301
16302 var index = (function (fn) {
16303 var lastArgs = [];
16304 var frameId = null;
16305
16306 var wrapperFn = function wrapperFn() {
16307 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
16308 args[_key] = arguments[_key];
16309 }
16310
16311 lastArgs = args;
16312
16313 if (frameId) {
16314 return;
16315 }
16316
16317 frameId = requestAnimationFrame(function () {
16318 frameId = null;
16319 fn.apply(undefined, lastArgs);
16320 });
16321 };
16322
16323 wrapperFn.cancel = function () {
16324 if (!frameId) {
16325 return;
16326 }
16327
16328 cancelAnimationFrame(frameId);
16329 frameId = null;
16330 };
16331
16332 var resultFn = wrapperFn;
16333
16334 return resultFn;
16335 });
16336
16337 module.exports = index;
16338
16339
16340/***/ }),
16341/* 139 */
16342/***/ (function(module, exports, __webpack_require__) {
16343
16344 var _Object$create = __webpack_require__(140);
16345
16346 function _inheritsLoose(subClass, superClass) {
16347 subClass.prototype = _Object$create(superClass.prototype);
16348 subClass.prototype.constructor = subClass;
16349 subClass.__proto__ = superClass;
16350 }
16351
16352 module.exports = _inheritsLoose;
16353
16354/***/ }),
16355/* 140 */
16356/***/ (function(module, exports, __webpack_require__) {
16357
16358 module.exports = __webpack_require__(141);
16359
16360/***/ }),
16361/* 141 */
16362/***/ (function(module, exports, __webpack_require__) {
16363
16364 __webpack_require__(142);
16365 var $Object = __webpack_require__(94).Object;
16366 module.exports = function create(P, D) {
16367 return $Object.create(P, D);
16368 };
16369
16370
16371/***/ }),
16372/* 142 */
16373/***/ (function(module, exports, __webpack_require__) {
16374
16375 var $export = __webpack_require__(92);
16376 // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
16377 $export($export.S, 'Object', { create: __webpack_require__(143) });
16378
16379
16380/***/ }),
16381/* 143 */
16382/***/ (function(module, exports, __webpack_require__) {
16383
16384 // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
16385 var anObject = __webpack_require__(99);
16386 var dPs = __webpack_require__(144);
16387 var enumBugKeys = __webpack_require__(123);
16388 var IE_PROTO = __webpack_require__(119)('IE_PROTO');
16389 var Empty = function () { /* empty */ };
16390 var PROTOTYPE = 'prototype';
16391
16392 // Create object with fake `null` prototype: use iframe Object with cleared prototype
16393 var createDict = function () {
16394 // Thrash, waste and sodomy: IE GC bug
16395 var iframe = __webpack_require__(104)('iframe');
16396 var i = enumBugKeys.length;
16397 var lt = '<';
16398 var gt = '>';
16399 var iframeDocument;
16400 iframe.style.display = 'none';
16401 __webpack_require__(145).appendChild(iframe);
16402 iframe.src = 'javascript:'; // eslint-disable-line no-script-url
16403 // createDict = iframe.contentWindow.Object;
16404 // html.removeChild(iframe);
16405 iframeDocument = iframe.contentWindow.document;
16406 iframeDocument.open();
16407 iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
16408 iframeDocument.close();
16409 createDict = iframeDocument.F;
16410 while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
16411 return createDict();
16412 };
16413
16414 module.exports = Object.create || function create(O, Properties) {
16415 var result;
16416 if (O !== null) {
16417 Empty[PROTOTYPE] = anObject(O);
16418 result = new Empty();
16419 Empty[PROTOTYPE] = null;
16420 // add "__proto__" for Object.getPrototypeOf polyfill
16421 result[IE_PROTO] = O;
16422 } else result = createDict();
16423 return Properties === undefined ? result : dPs(result, Properties);
16424 };
16425
16426
16427/***/ }),
16428/* 144 */
16429/***/ (function(module, exports, __webpack_require__) {
16430
16431 var dP = __webpack_require__(98);
16432 var anObject = __webpack_require__(99);
16433 var getKeys = __webpack_require__(109);
16434
16435 module.exports = __webpack_require__(102) ? Object.defineProperties : function defineProperties(O, Properties) {
16436 anObject(O);
16437 var keys = getKeys(Properties);
16438 var length = keys.length;
16439 var i = 0;
16440 var P;
16441 while (length > i) dP.f(O, P = keys[i++], Properties[P]);
16442 return O;
16443 };
16444
16445
16446/***/ }),
16447/* 145 */
16448/***/ (function(module, exports, __webpack_require__) {
16449
16450 var document = __webpack_require__(93).document;
16451 module.exports = document && document.documentElement;
16452
16453
16454/***/ }),
16455/* 146 */
16456/***/ (function(module, exports, __webpack_require__) {
16457
16458 "use strict";
16459
16460 var _interopRequireDefault = __webpack_require__(14);
16461
16462 var _interopRequireWildcard = __webpack_require__(147);
16463
16464 exports.__esModule = true;
16465
16466 var _Provider = _interopRequireWildcard(__webpack_require__(148));
16467
16468 exports.Provider = _Provider.default;
16469 exports.createProvider = _Provider.createProvider;
16470
16471 var _connectAdvanced = _interopRequireDefault(__webpack_require__(152));
16472
16473 exports.connectAdvanced = _connectAdvanced.default;
16474
16475 var _connect = _interopRequireDefault(__webpack_require__(162));
16476
16477 exports.connect = _connect.default;
16478
16479/***/ }),
16480/* 147 */
16481/***/ (function(module, exports) {
16482
16483 function _interopRequireWildcard(obj) {
16484 if (obj && obj.__esModule) {
16485 return obj;
16486 } else {
16487 var newObj = {};
16488
16489 if (obj != null) {
16490 for (var key in obj) {
16491 if (Object.prototype.hasOwnProperty.call(obj, key)) {
16492 var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
16493
16494 if (desc.get || desc.set) {
16495 Object.defineProperty(newObj, key, desc);
16496 } else {
16497 newObj[key] = obj[key];
16498 }
16499 }
16500 }
16501 }
16502
16503 newObj.default = obj;
16504 return newObj;
16505 }
16506 }
16507
16508 module.exports = _interopRequireWildcard;
16509
16510/***/ }),
16511/* 148 */
16512/***/ (function(module, exports, __webpack_require__) {
16513
16514 /* WEBPACK VAR INJECTION */(function(process) {"use strict";
16515
16516 var _interopRequireDefault = __webpack_require__(14);
16517
16518 exports.__esModule = true;
16519 exports.createProvider = createProvider;
16520 exports.default = void 0;
16521
16522 var _inheritsLoose2 = _interopRequireDefault(__webpack_require__(149));
16523
16524 var _react = __webpack_require__(4);
16525
16526 var _propTypes = _interopRequireDefault(__webpack_require__(5));
16527
16528 var _PropTypes = __webpack_require__(150);
16529
16530 var _warning = _interopRequireDefault(__webpack_require__(151));
16531
16532 var didWarnAboutReceivingStore = false;
16533
16534 function warnAboutReceivingStore() {
16535 if (didWarnAboutReceivingStore) {
16536 return;
16537 }
16538
16539 didWarnAboutReceivingStore = true;
16540 (0, _warning.default)('<Provider> does not support changing `store` on the fly. ' + 'It is most likely that you see this error because you updated to ' + 'Redux 2.x and React Redux 2.x which no longer hot reload reducers ' + 'automatically. See https://github.com/reduxjs/react-redux/releases/' + 'tag/v2.0.0 for the migration instructions.');
16541 }
16542
16543 function createProvider(storeKey) {
16544 var _Provider$childContex;
16545
16546 if (storeKey === void 0) {
16547 storeKey = 'store';
16548 }
16549
16550 var subscriptionKey = storeKey + "Subscription";
16551
16552 var Provider =
16553 /*#__PURE__*/
16554 function (_Component) {
16555 (0, _inheritsLoose2.default)(Provider, _Component);
16556 var _proto = Provider.prototype;
16557
16558 _proto.getChildContext = function getChildContext() {
16559 var _ref;
16560
16561 return _ref = {}, _ref[storeKey] = this[storeKey], _ref[subscriptionKey] = null, _ref;
16562 };
16563
16564 function Provider(props, context) {
16565 var _this;
16566
16567 _this = _Component.call(this, props, context) || this;
16568 _this[storeKey] = props.store;
16569 return _this;
16570 }
16571
16572 _proto.render = function render() {
16573 return _react.Children.only(this.props.children);
16574 };
16575
16576 return Provider;
16577 }(_react.Component);
16578
16579 if (process.env.NODE_ENV !== 'production') {
16580 Provider.prototype.componentWillReceiveProps = function (nextProps) {
16581 if (this[storeKey] !== nextProps.store) {
16582 warnAboutReceivingStore();
16583 }
16584 };
16585 }
16586
16587 Provider.propTypes = {
16588 store: _PropTypes.storeShape.isRequired,
16589 children: _propTypes.default.element.isRequired
16590 };
16591 Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[storeKey] = _PropTypes.storeShape.isRequired, _Provider$childContex[subscriptionKey] = _PropTypes.subscriptionShape, _Provider$childContex);
16592 return Provider;
16593 }
16594
16595 var _default = createProvider();
16596
16597 exports.default = _default;
16598 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(33)))
16599
16600/***/ }),
16601/* 149 */
16602/***/ (function(module, exports) {
16603
16604 function _inheritsLoose(subClass, superClass) {
16605 subClass.prototype = Object.create(superClass.prototype);
16606 subClass.prototype.constructor = subClass;
16607 subClass.__proto__ = superClass;
16608 }
16609
16610 module.exports = _inheritsLoose;
16611
16612/***/ }),
16613/* 150 */
16614/***/ (function(module, exports, __webpack_require__) {
16615
16616 "use strict";
16617
16618 var _interopRequireDefault = __webpack_require__(14);
16619
16620 exports.__esModule = true;
16621 exports.storeShape = exports.subscriptionShape = void 0;
16622
16623 var _propTypes = _interopRequireDefault(__webpack_require__(5));
16624
16625 var subscriptionShape = _propTypes.default.shape({
16626 trySubscribe: _propTypes.default.func.isRequired,
16627 tryUnsubscribe: _propTypes.default.func.isRequired,
16628 notifyNestedSubs: _propTypes.default.func.isRequired,
16629 isSubscribed: _propTypes.default.func.isRequired
16630 });
16631
16632 exports.subscriptionShape = subscriptionShape;
16633
16634 var storeShape = _propTypes.default.shape({
16635 subscribe: _propTypes.default.func.isRequired,
16636 dispatch: _propTypes.default.func.isRequired,
16637 getState: _propTypes.default.func.isRequired
16638 });
16639
16640 exports.storeShape = storeShape;
16641
16642/***/ }),
16643/* 151 */
16644/***/ (function(module, exports) {
16645
16646 "use strict";
16647
16648 exports.__esModule = true;
16649 exports.default = warning;
16650
16651 /**
16652 * Prints a warning in the console if it exists.
16653 *
16654 * @param {String} message The warning message.
16655 * @returns {void}
16656 */
16657 function warning(message) {
16658 /* eslint-disable no-console */
16659 if (typeof console !== 'undefined' && typeof console.error === 'function') {
16660 console.error(message);
16661 }
16662 /* eslint-enable no-console */
16663
16664
16665 try {
16666 // This error was thrown as a convenience so that if you enable
16667 // "break on all exceptions" in your console,
16668 // it would pause the execution at this line.
16669 throw new Error(message);
16670 /* eslint-disable no-empty */
16671 } catch (e) {}
16672 /* eslint-enable no-empty */
16673
16674 }
16675
16676/***/ }),
16677/* 152 */
16678/***/ (function(module, exports, __webpack_require__) {
16679
16680 /* WEBPACK VAR INJECTION */(function(process) {"use strict";
16681
16682 var _interopRequireDefault = __webpack_require__(14);
16683
16684 exports.__esModule = true;
16685 exports.default = connectAdvanced;
16686
16687 var _inheritsLoose2 = _interopRequireDefault(__webpack_require__(149));
16688
16689 var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(153));
16690
16691 var _extends2 = _interopRequireDefault(__webpack_require__(154));
16692
16693 var _objectWithoutPropertiesLoose2 = _interopRequireDefault(__webpack_require__(155));
16694
16695 var _hoistNonReactStatics = _interopRequireDefault(__webpack_require__(156));
16696
16697 var _invariant = _interopRequireDefault(__webpack_require__(160));
16698
16699 var _react = __webpack_require__(4);
16700
16701 var _reactIs = __webpack_require__(157);
16702
16703 var _Subscription = _interopRequireDefault(__webpack_require__(161));
16704
16705 var _PropTypes = __webpack_require__(150);
16706
16707 var hotReloadingVersion = 0;
16708 var dummyState = {};
16709
16710 function noop() {}
16711
16712 function makeSelectorStateful(sourceSelector, store) {
16713 // wrap the selector in an object that tracks its results between runs.
16714 var selector = {
16715 run: function runComponentSelector(props) {
16716 try {
16717 var nextProps = sourceSelector(store.getState(), props);
16718
16719 if (nextProps !== selector.props || selector.error) {
16720 selector.shouldComponentUpdate = true;
16721 selector.props = nextProps;
16722 selector.error = null;
16723 }
16724 } catch (error) {
16725 selector.shouldComponentUpdate = true;
16726 selector.error = error;
16727 }
16728 }
16729 };
16730 return selector;
16731 }
16732
16733 function connectAdvanced(
16734 /*
16735 selectorFactory is a func that is responsible for returning the selector function used to
16736 compute new props from state, props, and dispatch. For example:
16737 export default connectAdvanced((dispatch, options) => (state, props) => ({
16738 thing: state.things[props.thingId],
16739 saveThing: fields => dispatch(actionCreators.saveThing(props.thingId, fields)),
16740 }))(YourComponent)
16741 Access to dispatch is provided to the factory so selectorFactories can bind actionCreators
16742 outside of their selector as an optimization. Options passed to connectAdvanced are passed to
16743 the selectorFactory, along with displayName and WrappedComponent, as the second argument.
16744 Note that selectorFactory is responsible for all caching/memoization of inbound and outbound
16745 props. Do not use connectAdvanced directly without memoizing results between calls to your
16746 selector, otherwise the Connect component will re-render on every state or props change.
16747 */
16748 selectorFactory, // options object:
16749 _ref) {
16750 var _contextTypes, _childContextTypes;
16751
16752 if (_ref === void 0) {
16753 _ref = {};
16754 }
16755
16756 var _ref2 = _ref,
16757 _ref2$getDisplayName = _ref2.getDisplayName,
16758 getDisplayName = _ref2$getDisplayName === void 0 ? function (name) {
16759 return "ConnectAdvanced(" + name + ")";
16760 } : _ref2$getDisplayName,
16761 _ref2$methodName = _ref2.methodName,
16762 methodName = _ref2$methodName === void 0 ? 'connectAdvanced' : _ref2$methodName,
16763 _ref2$renderCountProp = _ref2.renderCountProp,
16764 renderCountProp = _ref2$renderCountProp === void 0 ? undefined : _ref2$renderCountProp,
16765 _ref2$shouldHandleSta = _ref2.shouldHandleStateChanges,
16766 shouldHandleStateChanges = _ref2$shouldHandleSta === void 0 ? true : _ref2$shouldHandleSta,
16767 _ref2$storeKey = _ref2.storeKey,
16768 storeKey = _ref2$storeKey === void 0 ? 'store' : _ref2$storeKey,
16769 _ref2$withRef = _ref2.withRef,
16770 withRef = _ref2$withRef === void 0 ? false : _ref2$withRef,
16771 connectOptions = (0, _objectWithoutPropertiesLoose2.default)(_ref2, ["getDisplayName", "methodName", "renderCountProp", "shouldHandleStateChanges", "storeKey", "withRef"]);
16772 var subscriptionKey = storeKey + 'Subscription';
16773 var version = hotReloadingVersion++;
16774 var contextTypes = (_contextTypes = {}, _contextTypes[storeKey] = _PropTypes.storeShape, _contextTypes[subscriptionKey] = _PropTypes.subscriptionShape, _contextTypes);
16775 var childContextTypes = (_childContextTypes = {}, _childContextTypes[subscriptionKey] = _PropTypes.subscriptionShape, _childContextTypes);
16776 return function wrapWithConnect(WrappedComponent) {
16777 (0, _invariant.default)((0, _reactIs.isValidElementType)(WrappedComponent), "You must pass a component to the function returned by " + (methodName + ". Instead received " + JSON.stringify(WrappedComponent)));
16778 var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';
16779 var displayName = getDisplayName(wrappedComponentName);
16780 var selectorFactoryOptions = (0, _extends2.default)({}, connectOptions, {
16781 getDisplayName: getDisplayName,
16782 methodName: methodName,
16783 renderCountProp: renderCountProp,
16784 shouldHandleStateChanges: shouldHandleStateChanges,
16785 storeKey: storeKey,
16786 withRef: withRef,
16787 displayName: displayName,
16788 wrappedComponentName: wrappedComponentName,
16789 WrappedComponent: WrappedComponent // TODO Actually fix our use of componentWillReceiveProps
16790
16791 /* eslint-disable react/no-deprecated */
16792
16793 });
16794
16795 var Connect =
16796 /*#__PURE__*/
16797 function (_Component) {
16798 (0, _inheritsLoose2.default)(Connect, _Component);
16799
16800 function Connect(props, context) {
16801 var _this;
16802
16803 _this = _Component.call(this, props, context) || this;
16804 _this.version = version;
16805 _this.state = {};
16806 _this.renderCount = 0;
16807 _this.store = props[storeKey] || context[storeKey];
16808 _this.propsMode = Boolean(props[storeKey]);
16809 _this.setWrappedInstance = _this.setWrappedInstance.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
16810 (0, _invariant.default)(_this.store, "Could not find \"" + storeKey + "\" in either the context or props of " + ("\"" + displayName + "\". Either wrap the root component in a <Provider>, ") + ("or explicitly pass \"" + storeKey + "\" as a prop to \"" + displayName + "\"."));
16811
16812 _this.initSelector();
16813
16814 _this.initSubscription();
16815
16816 return _this;
16817 }
16818
16819 var _proto = Connect.prototype;
16820
16821 _proto.getChildContext = function getChildContext() {
16822 var _ref3;
16823
16824 // If this component received store from props, its subscription should be transparent
16825 // to any descendants receiving store+subscription from context; it passes along
16826 // subscription passed to it. Otherwise, it shadows the parent subscription, which allows
16827 // Connect to control ordering of notifications to flow top-down.
16828 var subscription = this.propsMode ? null : this.subscription;
16829 return _ref3 = {}, _ref3[subscriptionKey] = subscription || this.context[subscriptionKey], _ref3;
16830 };
16831
16832 _proto.componentDidMount = function componentDidMount() {
16833 if (!shouldHandleStateChanges) return; // componentWillMount fires during server side rendering, but componentDidMount and
16834 // componentWillUnmount do not. Because of this, trySubscribe happens during ...didMount.
16835 // Otherwise, unsubscription would never take place during SSR, causing a memory leak.
16836 // To handle the case where a child component may have triggered a state change by
16837 // dispatching an action in its componentWillMount, we have to re-run the select and maybe
16838 // re-render.
16839
16840 this.subscription.trySubscribe();
16841 this.selector.run(this.props);
16842 if (this.selector.shouldComponentUpdate) this.forceUpdate();
16843 };
16844
16845 _proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
16846 this.selector.run(nextProps);
16847 };
16848
16849 _proto.shouldComponentUpdate = function shouldComponentUpdate() {
16850 return this.selector.shouldComponentUpdate;
16851 };
16852
16853 _proto.componentWillUnmount = function componentWillUnmount() {
16854 if (this.subscription) this.subscription.tryUnsubscribe();
16855 this.subscription = null;
16856 this.notifyNestedSubs = noop;
16857 this.store = null;
16858 this.selector.run = noop;
16859 this.selector.shouldComponentUpdate = false;
16860 };
16861
16862 _proto.getWrappedInstance = function getWrappedInstance() {
16863 (0, _invariant.default)(withRef, "To access the wrapped instance, you need to specify " + ("{ withRef: true } in the options argument of the " + methodName + "() call."));
16864 return this.wrappedInstance;
16865 };
16866
16867 _proto.setWrappedInstance = function setWrappedInstance(ref) {
16868 this.wrappedInstance = ref;
16869 };
16870
16871 _proto.initSelector = function initSelector() {
16872 var sourceSelector = selectorFactory(this.store.dispatch, selectorFactoryOptions);
16873 this.selector = makeSelectorStateful(sourceSelector, this.store);
16874 this.selector.run(this.props);
16875 };
16876
16877 _proto.initSubscription = function initSubscription() {
16878 if (!shouldHandleStateChanges) return; // parentSub's source should match where store came from: props vs. context. A component
16879 // connected to the store via props shouldn't use subscription from context, or vice versa.
16880
16881 var parentSub = (this.propsMode ? this.props : this.context)[subscriptionKey];
16882 this.subscription = new _Subscription.default(this.store, parentSub, this.onStateChange.bind(this)); // `notifyNestedSubs` is duplicated to handle the case where the component is unmounted in
16883 // the middle of the notification loop, where `this.subscription` will then be null. An
16884 // extra null check every change can be avoided by copying the method onto `this` and then
16885 // replacing it with a no-op on unmount. This can probably be avoided if Subscription's
16886 // listeners logic is changed to not call listeners that have been unsubscribed in the
16887 // middle of the notification loop.
16888
16889 this.notifyNestedSubs = this.subscription.notifyNestedSubs.bind(this.subscription);
16890 };
16891
16892 _proto.onStateChange = function onStateChange() {
16893 this.selector.run(this.props);
16894
16895 if (!this.selector.shouldComponentUpdate) {
16896 this.notifyNestedSubs();
16897 } else {
16898 this.componentDidUpdate = this.notifyNestedSubsOnComponentDidUpdate;
16899 this.setState(dummyState);
16900 }
16901 };
16902
16903 _proto.notifyNestedSubsOnComponentDidUpdate = function notifyNestedSubsOnComponentDidUpdate() {
16904 // `componentDidUpdate` is conditionally implemented when `onStateChange` determines it
16905 // needs to notify nested subs. Once called, it unimplements itself until further state
16906 // changes occur. Doing it this way vs having a permanent `componentDidUpdate` that does
16907 // a boolean check every time avoids an extra method call most of the time, resulting
16908 // in some perf boost.
16909 this.componentDidUpdate = undefined;
16910 this.notifyNestedSubs();
16911 };
16912
16913 _proto.isSubscribed = function isSubscribed() {
16914 return Boolean(this.subscription) && this.subscription.isSubscribed();
16915 };
16916
16917 _proto.addExtraProps = function addExtraProps(props) {
16918 if (!withRef && !renderCountProp && !(this.propsMode && this.subscription)) return props; // make a shallow copy so that fields added don't leak to the original selector.
16919 // this is especially important for 'ref' since that's a reference back to the component
16920 // instance. a singleton memoized selector would then be holding a reference to the
16921 // instance, preventing the instance from being garbage collected, and that would be bad
16922
16923 var withExtras = (0, _extends2.default)({}, props);
16924 if (withRef) withExtras.ref = this.setWrappedInstance;
16925 if (renderCountProp) withExtras[renderCountProp] = this.renderCount++;
16926 if (this.propsMode && this.subscription) withExtras[subscriptionKey] = this.subscription;
16927 return withExtras;
16928 };
16929
16930 _proto.render = function render() {
16931 var selector = this.selector;
16932 selector.shouldComponentUpdate = false;
16933
16934 if (selector.error) {
16935 throw selector.error;
16936 } else {
16937 return (0, _react.createElement)(WrappedComponent, this.addExtraProps(selector.props));
16938 }
16939 };
16940
16941 return Connect;
16942 }(_react.Component);
16943 /* eslint-enable react/no-deprecated */
16944
16945
16946 Connect.WrappedComponent = WrappedComponent;
16947 Connect.displayName = displayName;
16948 Connect.childContextTypes = childContextTypes;
16949 Connect.contextTypes = contextTypes;
16950 Connect.propTypes = contextTypes;
16951
16952 if (process.env.NODE_ENV !== 'production') {
16953 Connect.prototype.componentWillUpdate = function componentWillUpdate() {
16954 var _this2 = this;
16955
16956 // We are hot reloading!
16957 if (this.version !== version) {
16958 this.version = version;
16959 this.initSelector(); // If any connected descendants don't hot reload (and resubscribe in the process), their
16960 // listeners will be lost when we unsubscribe. Unfortunately, by copying over all
16961 // listeners, this does mean that the old versions of connected descendants will still be
16962 // notified of state changes; however, their onStateChange function is a no-op so this
16963 // isn't a huge deal.
16964
16965 var oldListeners = [];
16966
16967 if (this.subscription) {
16968 oldListeners = this.subscription.listeners.get();
16969 this.subscription.tryUnsubscribe();
16970 }
16971
16972 this.initSubscription();
16973
16974 if (shouldHandleStateChanges) {
16975 this.subscription.trySubscribe();
16976 oldListeners.forEach(function (listener) {
16977 return _this2.subscription.listeners.subscribe(listener);
16978 });
16979 }
16980 }
16981 };
16982 }
16983
16984 return (0, _hoistNonReactStatics.default)(Connect, WrappedComponent);
16985 };
16986 }
16987 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(33)))
16988
16989/***/ }),
16990/* 153 */
16991/***/ (function(module, exports) {
16992
16993 function _assertThisInitialized(self) {
16994 if (self === void 0) {
16995 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
16996 }
16997
16998 return self;
16999 }
17000
17001 module.exports = _assertThisInitialized;
17002
17003/***/ }),
17004/* 154 */
17005/***/ (function(module, exports) {
17006
17007 function _extends() {
17008 module.exports = _extends = Object.assign || function (target) {
17009 for (var i = 1; i < arguments.length; i++) {
17010 var source = arguments[i];
17011
17012 for (var key in source) {
17013 if (Object.prototype.hasOwnProperty.call(source, key)) {
17014 target[key] = source[key];
17015 }
17016 }
17017 }
17018
17019 return target;
17020 };
17021
17022 return _extends.apply(this, arguments);
17023 }
17024
17025 module.exports = _extends;
17026
17027/***/ }),
17028/* 155 */
17029/***/ (function(module, exports) {
17030
17031 function _objectWithoutPropertiesLoose(source, excluded) {
17032 if (source == null) return {};
17033 var target = {};
17034 var sourceKeys = Object.keys(source);
17035 var key, i;
17036
17037 for (i = 0; i < sourceKeys.length; i++) {
17038 key = sourceKeys[i];
17039 if (excluded.indexOf(key) >= 0) continue;
17040 target[key] = source[key];
17041 }
17042
17043 return target;
17044 }
17045
17046 module.exports = _objectWithoutPropertiesLoose;
17047
17048/***/ }),
17049/* 156 */
17050/***/ (function(module, exports, __webpack_require__) {
17051
17052 'use strict';
17053
17054 /**
17055 * Copyright 2015, Yahoo! Inc.
17056 * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
17057 */
17058 var ReactIs = __webpack_require__(157);
17059 var REACT_STATICS = {
17060 childContextTypes: true,
17061 contextType: true,
17062 contextTypes: true,
17063 defaultProps: true,
17064 displayName: true,
17065 getDefaultProps: true,
17066 getDerivedStateFromError: true,
17067 getDerivedStateFromProps: true,
17068 mixins: true,
17069 propTypes: true,
17070 type: true
17071 };
17072
17073 var KNOWN_STATICS = {
17074 name: true,
17075 length: true,
17076 prototype: true,
17077 caller: true,
17078 callee: true,
17079 arguments: true,
17080 arity: true
17081 };
17082
17083 var FORWARD_REF_STATICS = {
17084 '$$typeof': true,
17085 render: true,
17086 defaultProps: true,
17087 displayName: true,
17088 propTypes: true
17089 };
17090
17091 var MEMO_STATICS = {
17092 '$$typeof': true,
17093 compare: true,
17094 defaultProps: true,
17095 displayName: true,
17096 propTypes: true,
17097 type: true
17098 };
17099
17100 var TYPE_STATICS = {};
17101 TYPE_STATICS[ReactIs.ForwardRef] = FORWARD_REF_STATICS;
17102
17103 function getStatics(component) {
17104 if (ReactIs.isMemo(component)) {
17105 return MEMO_STATICS;
17106 }
17107 return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;
17108 }
17109
17110 var defineProperty = Object.defineProperty;
17111 var getOwnPropertyNames = Object.getOwnPropertyNames;
17112 var getOwnPropertySymbols = Object.getOwnPropertySymbols;
17113 var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
17114 var getPrototypeOf = Object.getPrototypeOf;
17115 var objectPrototype = Object.prototype;
17116
17117 function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
17118 if (typeof sourceComponent !== 'string') {
17119 // don't hoist over string (html) components
17120
17121 if (objectPrototype) {
17122 var inheritedComponent = getPrototypeOf(sourceComponent);
17123 if (inheritedComponent && inheritedComponent !== objectPrototype) {
17124 hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
17125 }
17126 }
17127
17128 var keys = getOwnPropertyNames(sourceComponent);
17129
17130 if (getOwnPropertySymbols) {
17131 keys = keys.concat(getOwnPropertySymbols(sourceComponent));
17132 }
17133
17134 var targetStatics = getStatics(targetComponent);
17135 var sourceStatics = getStatics(sourceComponent);
17136
17137 for (var i = 0; i < keys.length; ++i) {
17138 var key = keys[i];
17139 if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
17140 var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
17141 try {
17142 // Avoid failures from read-only properties
17143 defineProperty(targetComponent, key, descriptor);
17144 } catch (e) {}
17145 }
17146 }
17147
17148 return targetComponent;
17149 }
17150
17151 return targetComponent;
17152 }
17153
17154 module.exports = hoistNonReactStatics;
17155
17156
17157/***/ }),
17158/* 157 */
17159/***/ (function(module, exports, __webpack_require__) {
17160
17161 /* WEBPACK VAR INJECTION */(function(process) {'use strict';
17162
17163 if (process.env.NODE_ENV === 'production') {
17164 module.exports = __webpack_require__(158);
17165 } else {
17166 module.exports = __webpack_require__(159);
17167 }
17168
17169 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(33)))
17170
17171/***/ }),
17172/* 158 */
17173/***/ (function(module, exports) {
17174
17175 /** @license React v16.8.4
17176 * react-is.production.min.js
17177 *
17178 * Copyright (c) Facebook, Inc. and its affiliates.
17179 *
17180 * This source code is licensed under the MIT license found in the
17181 * LICENSE file in the root directory of this source tree.
17182 */
17183
17184 'use strict';Object.defineProperty(exports,"__esModule",{value:!0});
17185 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.memo"):
17186 60115,r=b?Symbol.for("react.lazy"):60116;function t(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 r:case q:case d:return u}}}function v(a){return t(a)===m}exports.typeOf=t;exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;
17187 exports.Fragment=e;exports.Lazy=r;exports.Memo=q;exports.Portal=d;exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||"object"===typeof a&&null!==a&&(a.$$typeof===r||a.$$typeof===q||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n)};exports.isAsyncMode=function(a){return v(a)||t(a)===l};exports.isConcurrentMode=v;exports.isContextConsumer=function(a){return t(a)===k};
17188 exports.isContextProvider=function(a){return t(a)===h};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return t(a)===n};exports.isFragment=function(a){return t(a)===e};exports.isLazy=function(a){return t(a)===r};exports.isMemo=function(a){return t(a)===q};exports.isPortal=function(a){return t(a)===d};exports.isProfiler=function(a){return t(a)===g};exports.isStrictMode=function(a){return t(a)===f};
17189 exports.isSuspense=function(a){return t(a)===p};
17190
17191
17192/***/ }),
17193/* 159 */
17194/***/ (function(module, exports, __webpack_require__) {
17195
17196 /* WEBPACK VAR INJECTION */(function(process) {/** @license React v16.8.4
17197 * react-is.development.js
17198 *
17199 * Copyright (c) Facebook, Inc. and its affiliates.
17200 *
17201 * This source code is licensed under the MIT license found in the
17202 * LICENSE file in the root directory of this source tree.
17203 */
17204
17205 'use strict';
17206
17207
17208
17209 if (process.env.NODE_ENV !== "production") {
17210 (function() {
17211 'use strict';
17212
17213 Object.defineProperty(exports, '__esModule', { value: true });
17214
17215 // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
17216 // nor polyfill, then a plain number is used for performance.
17217 var hasSymbol = typeof Symbol === 'function' && Symbol.for;
17218
17219 var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
17220 var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
17221 var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
17222 var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
17223 var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
17224 var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
17225 var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
17226 var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
17227 var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
17228 var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
17229 var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
17230 var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
17231 var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
17232
17233 function isValidElementType(type) {
17234 return typeof type === 'string' || typeof type === 'function' ||
17235 // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
17236 type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_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);
17237 }
17238
17239 /**
17240 * Forked from fbjs/warning:
17241 * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
17242 *
17243 * Only change is we use console.warn instead of console.error,
17244 * and do nothing when 'console' is not supported.
17245 * This really simplifies the code.
17246 * ---
17247 * Similar to invariant but only logs a warning if the condition is not met.
17248 * This can be used to log issues in development environments in critical
17249 * paths. Removing the logging code for production environments will keep the
17250 * same logic and follow the same code paths.
17251 */
17252
17253 var lowPriorityWarning = function () {};
17254
17255 {
17256 var printWarning = function (format) {
17257 for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
17258 args[_key - 1] = arguments[_key];
17259 }
17260
17261 var argIndex = 0;
17262 var message = 'Warning: ' + format.replace(/%s/g, function () {
17263 return args[argIndex++];
17264 });
17265 if (typeof console !== 'undefined') {
17266 console.warn(message);
17267 }
17268 try {
17269 // --- Welcome to debugging React ---
17270 // This error was thrown as a convenience so that you can use this stack
17271 // to find the callsite that caused this warning to fire.
17272 throw new Error(message);
17273 } catch (x) {}
17274 };
17275
17276 lowPriorityWarning = function (condition, format) {
17277 if (format === undefined) {
17278 throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument');
17279 }
17280 if (!condition) {
17281 for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
17282 args[_key2 - 2] = arguments[_key2];
17283 }
17284
17285 printWarning.apply(undefined, [format].concat(args));
17286 }
17287 };
17288 }
17289
17290 var lowPriorityWarning$1 = lowPriorityWarning;
17291
17292 function typeOf(object) {
17293 if (typeof object === 'object' && object !== null) {
17294 var $$typeof = object.$$typeof;
17295 switch ($$typeof) {
17296 case REACT_ELEMENT_TYPE:
17297 var type = object.type;
17298
17299 switch (type) {
17300 case REACT_ASYNC_MODE_TYPE:
17301 case REACT_CONCURRENT_MODE_TYPE:
17302 case REACT_FRAGMENT_TYPE:
17303 case REACT_PROFILER_TYPE:
17304 case REACT_STRICT_MODE_TYPE:
17305 case REACT_SUSPENSE_TYPE:
17306 return type;
17307 default:
17308 var $$typeofType = type && type.$$typeof;
17309
17310 switch ($$typeofType) {
17311 case REACT_CONTEXT_TYPE:
17312 case REACT_FORWARD_REF_TYPE:
17313 case REACT_PROVIDER_TYPE:
17314 return $$typeofType;
17315 default:
17316 return $$typeof;
17317 }
17318 }
17319 case REACT_LAZY_TYPE:
17320 case REACT_MEMO_TYPE:
17321 case REACT_PORTAL_TYPE:
17322 return $$typeof;
17323 }
17324 }
17325
17326 return undefined;
17327 }
17328
17329 // AsyncMode is deprecated along with isAsyncMode
17330 var AsyncMode = REACT_ASYNC_MODE_TYPE;
17331 var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
17332 var ContextConsumer = REACT_CONTEXT_TYPE;
17333 var ContextProvider = REACT_PROVIDER_TYPE;
17334 var Element = REACT_ELEMENT_TYPE;
17335 var ForwardRef = REACT_FORWARD_REF_TYPE;
17336 var Fragment = REACT_FRAGMENT_TYPE;
17337 var Lazy = REACT_LAZY_TYPE;
17338 var Memo = REACT_MEMO_TYPE;
17339 var Portal = REACT_PORTAL_TYPE;
17340 var Profiler = REACT_PROFILER_TYPE;
17341 var StrictMode = REACT_STRICT_MODE_TYPE;
17342 var Suspense = REACT_SUSPENSE_TYPE;
17343
17344 var hasWarnedAboutDeprecatedIsAsyncMode = false;
17345
17346 // AsyncMode should be deprecated
17347 function isAsyncMode(object) {
17348 {
17349 if (!hasWarnedAboutDeprecatedIsAsyncMode) {
17350 hasWarnedAboutDeprecatedIsAsyncMode = true;
17351 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.');
17352 }
17353 }
17354 return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
17355 }
17356 function isConcurrentMode(object) {
17357 return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
17358 }
17359 function isContextConsumer(object) {
17360 return typeOf(object) === REACT_CONTEXT_TYPE;
17361 }
17362 function isContextProvider(object) {
17363 return typeOf(object) === REACT_PROVIDER_TYPE;
17364 }
17365 function isElement(object) {
17366 return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
17367 }
17368 function isForwardRef(object) {
17369 return typeOf(object) === REACT_FORWARD_REF_TYPE;
17370 }
17371 function isFragment(object) {
17372 return typeOf(object) === REACT_FRAGMENT_TYPE;
17373 }
17374 function isLazy(object) {
17375 return typeOf(object) === REACT_LAZY_TYPE;
17376 }
17377 function isMemo(object) {
17378 return typeOf(object) === REACT_MEMO_TYPE;
17379 }
17380 function isPortal(object) {
17381 return typeOf(object) === REACT_PORTAL_TYPE;
17382 }
17383 function isProfiler(object) {
17384 return typeOf(object) === REACT_PROFILER_TYPE;
17385 }
17386 function isStrictMode(object) {
17387 return typeOf(object) === REACT_STRICT_MODE_TYPE;
17388 }
17389 function isSuspense(object) {
17390 return typeOf(object) === REACT_SUSPENSE_TYPE;
17391 }
17392
17393 exports.typeOf = typeOf;
17394 exports.AsyncMode = AsyncMode;
17395 exports.ConcurrentMode = ConcurrentMode;
17396 exports.ContextConsumer = ContextConsumer;
17397 exports.ContextProvider = ContextProvider;
17398 exports.Element = Element;
17399 exports.ForwardRef = ForwardRef;
17400 exports.Fragment = Fragment;
17401 exports.Lazy = Lazy;
17402 exports.Memo = Memo;
17403 exports.Portal = Portal;
17404 exports.Profiler = Profiler;
17405 exports.StrictMode = StrictMode;
17406 exports.Suspense = Suspense;
17407 exports.isValidElementType = isValidElementType;
17408 exports.isAsyncMode = isAsyncMode;
17409 exports.isConcurrentMode = isConcurrentMode;
17410 exports.isContextConsumer = isContextConsumer;
17411 exports.isContextProvider = isContextProvider;
17412 exports.isElement = isElement;
17413 exports.isForwardRef = isForwardRef;
17414 exports.isFragment = isFragment;
17415 exports.isLazy = isLazy;
17416 exports.isMemo = isMemo;
17417 exports.isPortal = isPortal;
17418 exports.isProfiler = isProfiler;
17419 exports.isStrictMode = isStrictMode;
17420 exports.isSuspense = isSuspense;
17421 })();
17422 }
17423
17424 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(33)))
17425
17426/***/ }),
17427/* 160 */
17428/***/ (function(module, exports, __webpack_require__) {
17429
17430 /* WEBPACK VAR INJECTION */(function(process) {/**
17431 * Copyright (c) 2013-present, Facebook, Inc.
17432 *
17433 * This source code is licensed under the MIT license found in the
17434 * LICENSE file in the root directory of this source tree.
17435 */
17436
17437 'use strict';
17438
17439 /**
17440 * Use invariant() to assert state which your program assumes to be true.
17441 *
17442 * Provide sprintf-style format (only %s is supported) and arguments
17443 * to provide information about what broke and what you were
17444 * expecting.
17445 *
17446 * The invariant message will be stripped in production, but the invariant
17447 * will remain to ensure logic does not differ in production.
17448 */
17449
17450 var invariant = function(condition, format, a, b, c, d, e, f) {
17451 if (process.env.NODE_ENV !== 'production') {
17452 if (format === undefined) {
17453 throw new Error('invariant requires an error message argument');
17454 }
17455 }
17456
17457 if (!condition) {
17458 var error;
17459 if (format === undefined) {
17460 error = new Error(
17461 'Minified exception occurred; use the non-minified dev environment ' +
17462 'for the full error message and additional helpful warnings.'
17463 );
17464 } else {
17465 var args = [a, b, c, d, e, f];
17466 var argIndex = 0;
17467 error = new Error(
17468 format.replace(/%s/g, function() { return args[argIndex++]; })
17469 );
17470 error.name = 'Invariant Violation';
17471 }
17472
17473 error.framesToPop = 1; // we don't care about invariant's own frame
17474 throw error;
17475 }
17476 };
17477
17478 module.exports = invariant;
17479
17480 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(33)))
17481
17482/***/ }),
17483/* 161 */
17484/***/ (function(module, exports) {
17485
17486 "use strict";
17487
17488 exports.__esModule = true;
17489 exports.default = void 0;
17490 // encapsulates the subscription logic for connecting a component to the redux store, as
17491 // well as nesting subscriptions of descendant components, so that we can ensure the
17492 // ancestor components re-render before descendants
17493 var CLEARED = null;
17494 var nullListeners = {
17495 notify: function notify() {}
17496 };
17497
17498 function createListenerCollection() {
17499 // the current/next pattern is copied from redux's createStore code.
17500 // TODO: refactor+expose that code to be reusable here?
17501 var current = [];
17502 var next = [];
17503 return {
17504 clear: function clear() {
17505 next = CLEARED;
17506 current = CLEARED;
17507 },
17508 notify: function notify() {
17509 var listeners = current = next;
17510
17511 for (var i = 0; i < listeners.length; i++) {
17512 listeners[i]();
17513 }
17514 },
17515 get: function get() {
17516 return next;
17517 },
17518 subscribe: function subscribe(listener) {
17519 var isSubscribed = true;
17520 if (next === current) next = current.slice();
17521 next.push(listener);
17522 return function unsubscribe() {
17523 if (!isSubscribed || current === CLEARED) return;
17524 isSubscribed = false;
17525 if (next === current) next = current.slice();
17526 next.splice(next.indexOf(listener), 1);
17527 };
17528 }
17529 };
17530 }
17531
17532 var Subscription =
17533 /*#__PURE__*/
17534 function () {
17535 function Subscription(store, parentSub, onStateChange) {
17536 this.store = store;
17537 this.parentSub = parentSub;
17538 this.onStateChange = onStateChange;
17539 this.unsubscribe = null;
17540 this.listeners = nullListeners;
17541 }
17542
17543 var _proto = Subscription.prototype;
17544
17545 _proto.addNestedSub = function addNestedSub(listener) {
17546 this.trySubscribe();
17547 return this.listeners.subscribe(listener);
17548 };
17549
17550 _proto.notifyNestedSubs = function notifyNestedSubs() {
17551 this.listeners.notify();
17552 };
17553
17554 _proto.isSubscribed = function isSubscribed() {
17555 return Boolean(this.unsubscribe);
17556 };
17557
17558 _proto.trySubscribe = function trySubscribe() {
17559 if (!this.unsubscribe) {
17560 this.unsubscribe = this.parentSub ? this.parentSub.addNestedSub(this.onStateChange) : this.store.subscribe(this.onStateChange);
17561 this.listeners = createListenerCollection();
17562 }
17563 };
17564
17565 _proto.tryUnsubscribe = function tryUnsubscribe() {
17566 if (this.unsubscribe) {
17567 this.unsubscribe();
17568 this.unsubscribe = null;
17569 this.listeners.clear();
17570 this.listeners = nullListeners;
17571 }
17572 };
17573
17574 return Subscription;
17575 }();
17576
17577 exports.default = Subscription;
17578
17579/***/ }),
17580/* 162 */
17581/***/ (function(module, exports, __webpack_require__) {
17582
17583 "use strict";
17584
17585 var _interopRequireDefault = __webpack_require__(14);
17586
17587 exports.__esModule = true;
17588 exports.createConnect = createConnect;
17589 exports.default = void 0;
17590
17591 var _extends2 = _interopRequireDefault(__webpack_require__(154));
17592
17593 var _objectWithoutPropertiesLoose2 = _interopRequireDefault(__webpack_require__(155));
17594
17595 var _connectAdvanced = _interopRequireDefault(__webpack_require__(152));
17596
17597 var _shallowEqual = _interopRequireDefault(__webpack_require__(163));
17598
17599 var _mapDispatchToProps = _interopRequireDefault(__webpack_require__(164));
17600
17601 var _mapStateToProps = _interopRequireDefault(__webpack_require__(168));
17602
17603 var _mergeProps = _interopRequireDefault(__webpack_require__(169));
17604
17605 var _selectorFactory = _interopRequireDefault(__webpack_require__(170));
17606
17607 /*
17608 connect is a facade over connectAdvanced. It turns its args into a compatible
17609 selectorFactory, which has the signature:
17610
17611 (dispatch, options) => (nextState, nextOwnProps) => nextFinalProps
17612
17613 connect passes its args to connectAdvanced as options, which will in turn pass them to
17614 selectorFactory each time a Connect component instance is instantiated or hot reloaded.
17615
17616 selectorFactory returns a final props selector from its mapStateToProps,
17617 mapStateToPropsFactories, mapDispatchToProps, mapDispatchToPropsFactories, mergeProps,
17618 mergePropsFactories, and pure args.
17619
17620 The resulting final props selector is called by the Connect component instance whenever
17621 it receives new props or store state.
17622 */
17623 function match(arg, factories, name) {
17624 for (var i = factories.length - 1; i >= 0; i--) {
17625 var result = factories[i](arg);
17626 if (result) return result;
17627 }
17628
17629 return function (dispatch, options) {
17630 throw new Error("Invalid value of type " + typeof arg + " for " + name + " argument when connecting component " + options.wrappedComponentName + ".");
17631 };
17632 }
17633
17634 function strictEqual(a, b) {
17635 return a === b;
17636 } // createConnect with default args builds the 'official' connect behavior. Calling it with
17637 // different options opens up some testing and extensibility scenarios
17638
17639
17640 function createConnect(_temp) {
17641 var _ref = _temp === void 0 ? {} : _temp,
17642 _ref$connectHOC = _ref.connectHOC,
17643 connectHOC = _ref$connectHOC === void 0 ? _connectAdvanced.default : _ref$connectHOC,
17644 _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,
17645 mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? _mapStateToProps.default : _ref$mapStateToPropsF,
17646 _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,
17647 mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? _mapDispatchToProps.default : _ref$mapDispatchToPro,
17648 _ref$mergePropsFactor = _ref.mergePropsFactories,
17649 mergePropsFactories = _ref$mergePropsFactor === void 0 ? _mergeProps.default : _ref$mergePropsFactor,
17650 _ref$selectorFactory = _ref.selectorFactory,
17651 selectorFactory = _ref$selectorFactory === void 0 ? _selectorFactory.default : _ref$selectorFactory;
17652
17653 return function connect(mapStateToProps, mapDispatchToProps, mergeProps, _ref2) {
17654 if (_ref2 === void 0) {
17655 _ref2 = {};
17656 }
17657
17658 var _ref3 = _ref2,
17659 _ref3$pure = _ref3.pure,
17660 pure = _ref3$pure === void 0 ? true : _ref3$pure,
17661 _ref3$areStatesEqual = _ref3.areStatesEqual,
17662 areStatesEqual = _ref3$areStatesEqual === void 0 ? strictEqual : _ref3$areStatesEqual,
17663 _ref3$areOwnPropsEqua = _ref3.areOwnPropsEqual,
17664 areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? _shallowEqual.default : _ref3$areOwnPropsEqua,
17665 _ref3$areStatePropsEq = _ref3.areStatePropsEqual,
17666 areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? _shallowEqual.default : _ref3$areStatePropsEq,
17667 _ref3$areMergedPropsE = _ref3.areMergedPropsEqual,
17668 areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? _shallowEqual.default : _ref3$areMergedPropsE,
17669 extraOptions = (0, _objectWithoutPropertiesLoose2.default)(_ref3, ["pure", "areStatesEqual", "areOwnPropsEqual", "areStatePropsEqual", "areMergedPropsEqual"]);
17670 var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');
17671 var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');
17672 var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');
17673 return connectHOC(selectorFactory, (0, _extends2.default)({
17674 // used in error messages
17675 methodName: 'connect',
17676 // used to compute Connect's displayName from the wrapped component's displayName.
17677 getDisplayName: function getDisplayName(name) {
17678 return "Connect(" + name + ")";
17679 },
17680 // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes
17681 shouldHandleStateChanges: Boolean(mapStateToProps),
17682 // passed through to selectorFactory
17683 initMapStateToProps: initMapStateToProps,
17684 initMapDispatchToProps: initMapDispatchToProps,
17685 initMergeProps: initMergeProps,
17686 pure: pure,
17687 areStatesEqual: areStatesEqual,
17688 areOwnPropsEqual: areOwnPropsEqual,
17689 areStatePropsEqual: areStatePropsEqual,
17690 areMergedPropsEqual: areMergedPropsEqual
17691 }, extraOptions));
17692 };
17693 }
17694
17695 var _default = createConnect();
17696
17697 exports.default = _default;
17698
17699/***/ }),
17700/* 163 */
17701/***/ (function(module, exports) {
17702
17703 "use strict";
17704
17705 exports.__esModule = true;
17706 exports.default = shallowEqual;
17707 var hasOwn = Object.prototype.hasOwnProperty;
17708
17709 function is(x, y) {
17710 if (x === y) {
17711 return x !== 0 || y !== 0 || 1 / x === 1 / y;
17712 } else {
17713 return x !== x && y !== y;
17714 }
17715 }
17716
17717 function shallowEqual(objA, objB) {
17718 if (is(objA, objB)) return true;
17719
17720 if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
17721 return false;
17722 }
17723
17724 var keysA = Object.keys(objA);
17725 var keysB = Object.keys(objB);
17726 if (keysA.length !== keysB.length) return false;
17727
17728 for (var i = 0; i < keysA.length; i++) {
17729 if (!hasOwn.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
17730 return false;
17731 }
17732 }
17733
17734 return true;
17735 }
17736
17737/***/ }),
17738/* 164 */
17739/***/ (function(module, exports, __webpack_require__) {
17740
17741 "use strict";
17742
17743 exports.__esModule = true;
17744 exports.whenMapDispatchToPropsIsFunction = whenMapDispatchToPropsIsFunction;
17745 exports.whenMapDispatchToPropsIsMissing = whenMapDispatchToPropsIsMissing;
17746 exports.whenMapDispatchToPropsIsObject = whenMapDispatchToPropsIsObject;
17747 exports.default = void 0;
17748
17749 var _redux = __webpack_require__(134);
17750
17751 var _wrapMapToProps = __webpack_require__(165);
17752
17753 function whenMapDispatchToPropsIsFunction(mapDispatchToProps) {
17754 return typeof mapDispatchToProps === 'function' ? (0, _wrapMapToProps.wrapMapToPropsFunc)(mapDispatchToProps, 'mapDispatchToProps') : undefined;
17755 }
17756
17757 function whenMapDispatchToPropsIsMissing(mapDispatchToProps) {
17758 return !mapDispatchToProps ? (0, _wrapMapToProps.wrapMapToPropsConstant)(function (dispatch) {
17759 return {
17760 dispatch: dispatch
17761 };
17762 }) : undefined;
17763 }
17764
17765 function whenMapDispatchToPropsIsObject(mapDispatchToProps) {
17766 return mapDispatchToProps && typeof mapDispatchToProps === 'object' ? (0, _wrapMapToProps.wrapMapToPropsConstant)(function (dispatch) {
17767 return (0, _redux.bindActionCreators)(mapDispatchToProps, dispatch);
17768 }) : undefined;
17769 }
17770
17771 var _default = [whenMapDispatchToPropsIsFunction, whenMapDispatchToPropsIsMissing, whenMapDispatchToPropsIsObject];
17772 exports.default = _default;
17773
17774/***/ }),
17775/* 165 */
17776/***/ (function(module, exports, __webpack_require__) {
17777
17778 /* WEBPACK VAR INJECTION */(function(process) {"use strict";
17779
17780 var _interopRequireDefault = __webpack_require__(14);
17781
17782 exports.__esModule = true;
17783 exports.wrapMapToPropsConstant = wrapMapToPropsConstant;
17784 exports.getDependsOnOwnProps = getDependsOnOwnProps;
17785 exports.wrapMapToPropsFunc = wrapMapToPropsFunc;
17786
17787 var _verifyPlainObject = _interopRequireDefault(__webpack_require__(166));
17788
17789 function wrapMapToPropsConstant(getConstant) {
17790 return function initConstantSelector(dispatch, options) {
17791 var constant = getConstant(dispatch, options);
17792
17793 function constantSelector() {
17794 return constant;
17795 }
17796
17797 constantSelector.dependsOnOwnProps = false;
17798 return constantSelector;
17799 };
17800 } // dependsOnOwnProps is used by createMapToPropsProxy to determine whether to pass props as args
17801 // to the mapToProps function being wrapped. It is also used by makePurePropsSelector to determine
17802 // whether mapToProps needs to be invoked when props have changed.
17803 //
17804 // A length of one signals that mapToProps does not depend on props from the parent component.
17805 // A length of zero is assumed to mean mapToProps is getting args via arguments or ...args and
17806 // therefore not reporting its length accurately..
17807
17808
17809 function getDependsOnOwnProps(mapToProps) {
17810 return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;
17811 } // Used by whenMapStateToPropsIsFunction and whenMapDispatchToPropsIsFunction,
17812 // this function wraps mapToProps in a proxy function which does several things:
17813 //
17814 // * Detects whether the mapToProps function being called depends on props, which
17815 // is used by selectorFactory to decide if it should reinvoke on props changes.
17816 //
17817 // * On first call, handles mapToProps if returns another function, and treats that
17818 // new function as the true mapToProps for subsequent calls.
17819 //
17820 // * On first call, verifies the first result is a plain object, in order to warn
17821 // the developer that their mapToProps function is not returning a valid result.
17822 //
17823
17824
17825 function wrapMapToPropsFunc(mapToProps, methodName) {
17826 return function initProxySelector(dispatch, _ref) {
17827 var displayName = _ref.displayName;
17828
17829 var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {
17830 return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);
17831 }; // allow detectFactoryAndVerify to get ownProps
17832
17833
17834 proxy.dependsOnOwnProps = true;
17835
17836 proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {
17837 proxy.mapToProps = mapToProps;
17838 proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);
17839 var props = proxy(stateOrDispatch, ownProps);
17840
17841 if (typeof props === 'function') {
17842 proxy.mapToProps = props;
17843 proxy.dependsOnOwnProps = getDependsOnOwnProps(props);
17844 props = proxy(stateOrDispatch, ownProps);
17845 }
17846
17847 if (process.env.NODE_ENV !== 'production') (0, _verifyPlainObject.default)(props, displayName, methodName);
17848 return props;
17849 };
17850
17851 return proxy;
17852 };
17853 }
17854 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(33)))
17855
17856/***/ }),
17857/* 166 */
17858/***/ (function(module, exports, __webpack_require__) {
17859
17860 "use strict";
17861
17862 var _interopRequireDefault = __webpack_require__(14);
17863
17864 exports.__esModule = true;
17865 exports.default = verifyPlainObject;
17866
17867 var _isPlainObject = _interopRequireDefault(__webpack_require__(167));
17868
17869 var _warning = _interopRequireDefault(__webpack_require__(151));
17870
17871 function verifyPlainObject(value, displayName, methodName) {
17872 if (!(0, _isPlainObject.default)(value)) {
17873 (0, _warning.default)(methodName + "() in " + displayName + " must return a plain object. Instead received " + value + ".");
17874 }
17875 }
17876
17877/***/ }),
17878/* 167 */
17879/***/ (function(module, exports) {
17880
17881 "use strict";
17882
17883 exports.__esModule = true;
17884 exports.default = isPlainObject;
17885
17886 /**
17887 * @param {any} obj The object to inspect.
17888 * @returns {boolean} True if the argument appears to be a plain object.
17889 */
17890 function isPlainObject(obj) {
17891 if (typeof obj !== 'object' || obj === null) return false;
17892 var proto = Object.getPrototypeOf(obj);
17893 if (proto === null) return true;
17894 var baseProto = proto;
17895
17896 while (Object.getPrototypeOf(baseProto) !== null) {
17897 baseProto = Object.getPrototypeOf(baseProto);
17898 }
17899
17900 return proto === baseProto;
17901 }
17902
17903/***/ }),
17904/* 168 */
17905/***/ (function(module, exports, __webpack_require__) {
17906
17907 "use strict";
17908
17909 exports.__esModule = true;
17910 exports.whenMapStateToPropsIsFunction = whenMapStateToPropsIsFunction;
17911 exports.whenMapStateToPropsIsMissing = whenMapStateToPropsIsMissing;
17912 exports.default = void 0;
17913
17914 var _wrapMapToProps = __webpack_require__(165);
17915
17916 function whenMapStateToPropsIsFunction(mapStateToProps) {
17917 return typeof mapStateToProps === 'function' ? (0, _wrapMapToProps.wrapMapToPropsFunc)(mapStateToProps, 'mapStateToProps') : undefined;
17918 }
17919
17920 function whenMapStateToPropsIsMissing(mapStateToProps) {
17921 return !mapStateToProps ? (0, _wrapMapToProps.wrapMapToPropsConstant)(function () {
17922 return {};
17923 }) : undefined;
17924 }
17925
17926 var _default = [whenMapStateToPropsIsFunction, whenMapStateToPropsIsMissing];
17927 exports.default = _default;
17928
17929/***/ }),
17930/* 169 */
17931/***/ (function(module, exports, __webpack_require__) {
17932
17933 /* WEBPACK VAR INJECTION */(function(process) {"use strict";
17934
17935 var _interopRequireDefault = __webpack_require__(14);
17936
17937 exports.__esModule = true;
17938 exports.defaultMergeProps = defaultMergeProps;
17939 exports.wrapMergePropsFunc = wrapMergePropsFunc;
17940 exports.whenMergePropsIsFunction = whenMergePropsIsFunction;
17941 exports.whenMergePropsIsOmitted = whenMergePropsIsOmitted;
17942 exports.default = void 0;
17943
17944 var _extends2 = _interopRequireDefault(__webpack_require__(154));
17945
17946 var _verifyPlainObject = _interopRequireDefault(__webpack_require__(166));
17947
17948 function defaultMergeProps(stateProps, dispatchProps, ownProps) {
17949 return (0, _extends2.default)({}, ownProps, stateProps, dispatchProps);
17950 }
17951
17952 function wrapMergePropsFunc(mergeProps) {
17953 return function initMergePropsProxy(dispatch, _ref) {
17954 var displayName = _ref.displayName,
17955 pure = _ref.pure,
17956 areMergedPropsEqual = _ref.areMergedPropsEqual;
17957 var hasRunOnce = false;
17958 var mergedProps;
17959 return function mergePropsProxy(stateProps, dispatchProps, ownProps) {
17960 var nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps);
17961
17962 if (hasRunOnce) {
17963 if (!pure || !areMergedPropsEqual(nextMergedProps, mergedProps)) mergedProps = nextMergedProps;
17964 } else {
17965 hasRunOnce = true;
17966 mergedProps = nextMergedProps;
17967 if (process.env.NODE_ENV !== 'production') (0, _verifyPlainObject.default)(mergedProps, displayName, 'mergeProps');
17968 }
17969
17970 return mergedProps;
17971 };
17972 };
17973 }
17974
17975 function whenMergePropsIsFunction(mergeProps) {
17976 return typeof mergeProps === 'function' ? wrapMergePropsFunc(mergeProps) : undefined;
17977 }
17978
17979 function whenMergePropsIsOmitted(mergeProps) {
17980 return !mergeProps ? function () {
17981 return defaultMergeProps;
17982 } : undefined;
17983 }
17984
17985 var _default = [whenMergePropsIsFunction, whenMergePropsIsOmitted];
17986 exports.default = _default;
17987 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(33)))
17988
17989/***/ }),
17990/* 170 */
17991/***/ (function(module, exports, __webpack_require__) {
17992
17993 /* WEBPACK VAR INJECTION */(function(process) {"use strict";
17994
17995 var _interopRequireDefault = __webpack_require__(14);
17996
17997 exports.__esModule = true;
17998 exports.impureFinalPropsSelectorFactory = impureFinalPropsSelectorFactory;
17999 exports.pureFinalPropsSelectorFactory = pureFinalPropsSelectorFactory;
18000 exports.default = finalPropsSelectorFactory;
18001
18002 var _objectWithoutPropertiesLoose2 = _interopRequireDefault(__webpack_require__(155));
18003
18004 var _verifySubselectors = _interopRequireDefault(__webpack_require__(171));
18005
18006 function impureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch) {
18007 return function impureFinalPropsSelector(state, ownProps) {
18008 return mergeProps(mapStateToProps(state, ownProps), mapDispatchToProps(dispatch, ownProps), ownProps);
18009 };
18010 }
18011
18012 function pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, _ref) {
18013 var areStatesEqual = _ref.areStatesEqual,
18014 areOwnPropsEqual = _ref.areOwnPropsEqual,
18015 areStatePropsEqual = _ref.areStatePropsEqual;
18016 var hasRunAtLeastOnce = false;
18017 var state;
18018 var ownProps;
18019 var stateProps;
18020 var dispatchProps;
18021 var mergedProps;
18022
18023 function handleFirstCall(firstState, firstOwnProps) {
18024 state = firstState;
18025 ownProps = firstOwnProps;
18026 stateProps = mapStateToProps(state, ownProps);
18027 dispatchProps = mapDispatchToProps(dispatch, ownProps);
18028 mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
18029 hasRunAtLeastOnce = true;
18030 return mergedProps;
18031 }
18032
18033 function handleNewPropsAndNewState() {
18034 stateProps = mapStateToProps(state, ownProps);
18035 if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);
18036 mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
18037 return mergedProps;
18038 }
18039
18040 function handleNewProps() {
18041 if (mapStateToProps.dependsOnOwnProps) stateProps = mapStateToProps(state, ownProps);
18042 if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);
18043 mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
18044 return mergedProps;
18045 }
18046
18047 function handleNewState() {
18048 var nextStateProps = mapStateToProps(state, ownProps);
18049 var statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps);
18050 stateProps = nextStateProps;
18051 if (statePropsChanged) mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
18052 return mergedProps;
18053 }
18054
18055 function handleSubsequentCalls(nextState, nextOwnProps) {
18056 var propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps);
18057 var stateChanged = !areStatesEqual(nextState, state);
18058 state = nextState;
18059 ownProps = nextOwnProps;
18060 if (propsChanged && stateChanged) return handleNewPropsAndNewState();
18061 if (propsChanged) return handleNewProps();
18062 if (stateChanged) return handleNewState();
18063 return mergedProps;
18064 }
18065
18066 return function pureFinalPropsSelector(nextState, nextOwnProps) {
18067 return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps);
18068 };
18069 } // TODO: Add more comments
18070 // If pure is true, the selector returned by selectorFactory will memoize its results,
18071 // allowing connectAdvanced's shouldComponentUpdate to return false if final
18072 // props have not changed. If false, the selector will always return a new
18073 // object and shouldComponentUpdate will always return true.
18074
18075
18076 function finalPropsSelectorFactory(dispatch, _ref2) {
18077 var initMapStateToProps = _ref2.initMapStateToProps,
18078 initMapDispatchToProps = _ref2.initMapDispatchToProps,
18079 initMergeProps = _ref2.initMergeProps,
18080 options = (0, _objectWithoutPropertiesLoose2.default)(_ref2, ["initMapStateToProps", "initMapDispatchToProps", "initMergeProps"]);
18081 var mapStateToProps = initMapStateToProps(dispatch, options);
18082 var mapDispatchToProps = initMapDispatchToProps(dispatch, options);
18083 var mergeProps = initMergeProps(dispatch, options);
18084
18085 if (process.env.NODE_ENV !== 'production') {
18086 (0, _verifySubselectors.default)(mapStateToProps, mapDispatchToProps, mergeProps, options.displayName);
18087 }
18088
18089 var selectorFactory = options.pure ? pureFinalPropsSelectorFactory : impureFinalPropsSelectorFactory;
18090 return selectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options);
18091 }
18092 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(33)))
18093
18094/***/ }),
18095/* 171 */
18096/***/ (function(module, exports, __webpack_require__) {
18097
18098 "use strict";
18099
18100 var _interopRequireDefault = __webpack_require__(14);
18101
18102 exports.__esModule = true;
18103 exports.default = verifySubselectors;
18104
18105 var _warning = _interopRequireDefault(__webpack_require__(151));
18106
18107 function verify(selector, methodName, displayName) {
18108 if (!selector) {
18109 throw new Error("Unexpected value for " + methodName + " in " + displayName + ".");
18110 } else if (methodName === 'mapStateToProps' || methodName === 'mapDispatchToProps') {
18111 if (!selector.hasOwnProperty('dependsOnOwnProps')) {
18112 (0, _warning.default)("The selector for " + methodName + " of " + displayName + " did not specify a value for dependsOnOwnProps.");
18113 }
18114 }
18115 }
18116
18117 function verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, displayName) {
18118 verify(mapStateToProps, 'mapStateToProps', displayName);
18119 verify(mapDispatchToProps, 'mapDispatchToProps', displayName);
18120 verify(mergeProps, 'mergeProps', displayName);
18121 }
18122
18123/***/ }),
18124/* 172 */
18125/***/ (function(module, exports, __webpack_require__) {
18126
18127 'use strict';
18128
18129 exports.__esModule = true;
18130
18131 function _interopRequire(obj) { return obj && obj.__esModule ? obj['default'] : obj; }
18132
18133 var _Motion = __webpack_require__(173);
18134
18135 exports.Motion = _interopRequire(_Motion);
18136
18137 var _StaggeredMotion = __webpack_require__(180);
18138
18139 exports.StaggeredMotion = _interopRequire(_StaggeredMotion);
18140
18141 var _TransitionMotion = __webpack_require__(181);
18142
18143 exports.TransitionMotion = _interopRequire(_TransitionMotion);
18144
18145 var _spring = __webpack_require__(183);
18146
18147 exports.spring = _interopRequire(_spring);
18148
18149 var _presets = __webpack_require__(184);
18150
18151 exports.presets = _interopRequire(_presets);
18152
18153 var _stripStyle = __webpack_require__(175);
18154
18155 exports.stripStyle = _interopRequire(_stripStyle);
18156
18157 // deprecated, dummy warning function
18158
18159 var _reorderKeys = __webpack_require__(185);
18160
18161 exports.reorderKeys = _interopRequire(_reorderKeys);
18162
18163/***/ }),
18164/* 173 */
18165/***/ (function(module, exports, __webpack_require__) {
18166
18167 'use strict';
18168
18169 exports.__esModule = true;
18170
18171 var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
18172
18173 var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
18174
18175 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
18176
18177 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
18178
18179 function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
18180
18181 var _mapToZero = __webpack_require__(174);
18182
18183 var _mapToZero2 = _interopRequireDefault(_mapToZero);
18184
18185 var _stripStyle = __webpack_require__(175);
18186
18187 var _stripStyle2 = _interopRequireDefault(_stripStyle);
18188
18189 var _stepper3 = __webpack_require__(176);
18190
18191 var _stepper4 = _interopRequireDefault(_stepper3);
18192
18193 var _performanceNow = __webpack_require__(177);
18194
18195 var _performanceNow2 = _interopRequireDefault(_performanceNow);
18196
18197 var _raf = __webpack_require__(178);
18198
18199 var _raf2 = _interopRequireDefault(_raf);
18200
18201 var _shouldStopAnimation = __webpack_require__(179);
18202
18203 var _shouldStopAnimation2 = _interopRequireDefault(_shouldStopAnimation);
18204
18205 var _react = __webpack_require__(4);
18206
18207 var _react2 = _interopRequireDefault(_react);
18208
18209 var _propTypes = __webpack_require__(5);
18210
18211 var _propTypes2 = _interopRequireDefault(_propTypes);
18212
18213 var msPerFrame = 1000 / 60;
18214
18215 var Motion = (function (_React$Component) {
18216 _inherits(Motion, _React$Component);
18217
18218 _createClass(Motion, null, [{
18219 key: 'propTypes',
18220 value: {
18221 // TOOD: warn against putting a config in here
18222 defaultStyle: _propTypes2['default'].objectOf(_propTypes2['default'].number),
18223 style: _propTypes2['default'].objectOf(_propTypes2['default'].oneOfType([_propTypes2['default'].number, _propTypes2['default'].object])).isRequired,
18224 children: _propTypes2['default'].func.isRequired,
18225 onRest: _propTypes2['default'].func
18226 },
18227 enumerable: true
18228 }]);
18229
18230 function Motion(props) {
18231 var _this = this;
18232
18233 _classCallCheck(this, Motion);
18234
18235 _React$Component.call(this, props);
18236 this.wasAnimating = false;
18237 this.animationID = null;
18238 this.prevTime = 0;
18239 this.accumulatedTime = 0;
18240 this.unreadPropStyle = null;
18241
18242 this.clearUnreadPropStyle = function (destStyle) {
18243 var dirty = false;
18244 var _state = _this.state;
18245 var currentStyle = _state.currentStyle;
18246 var currentVelocity = _state.currentVelocity;
18247 var lastIdealStyle = _state.lastIdealStyle;
18248 var lastIdealVelocity = _state.lastIdealVelocity;
18249
18250 for (var key in destStyle) {
18251 if (!Object.prototype.hasOwnProperty.call(destStyle, key)) {
18252 continue;
18253 }
18254
18255 var styleValue = destStyle[key];
18256 if (typeof styleValue === 'number') {
18257 if (!dirty) {
18258 dirty = true;
18259 currentStyle = _extends({}, currentStyle);
18260 currentVelocity = _extends({}, currentVelocity);
18261 lastIdealStyle = _extends({}, lastIdealStyle);
18262 lastIdealVelocity = _extends({}, lastIdealVelocity);
18263 }
18264
18265 currentStyle[key] = styleValue;
18266 currentVelocity[key] = 0;
18267 lastIdealStyle[key] = styleValue;
18268 lastIdealVelocity[key] = 0;
18269 }
18270 }
18271
18272 if (dirty) {
18273 _this.setState({ currentStyle: currentStyle, currentVelocity: currentVelocity, lastIdealStyle: lastIdealStyle, lastIdealVelocity: lastIdealVelocity });
18274 }
18275 };
18276
18277 this.startAnimationIfNecessary = function () {
18278 // TODO: when config is {a: 10} and dest is {a: 10} do we raf once and
18279 // call cb? No, otherwise accidental parent rerender causes cb trigger
18280 _this.animationID = _raf2['default'](function (timestamp) {
18281 // check if we need to animate in the first place
18282 var propsStyle = _this.props.style;
18283 if (_shouldStopAnimation2['default'](_this.state.currentStyle, propsStyle, _this.state.currentVelocity)) {
18284 if (_this.wasAnimating && _this.props.onRest) {
18285 _this.props.onRest();
18286 }
18287
18288 // no need to cancel animationID here; shouldn't have any in flight
18289 _this.animationID = null;
18290 _this.wasAnimating = false;
18291 _this.accumulatedTime = 0;
18292 return;
18293 }
18294
18295 _this.wasAnimating = true;
18296
18297 var currentTime = timestamp || _performanceNow2['default']();
18298 var timeDelta = currentTime - _this.prevTime;
18299 _this.prevTime = currentTime;
18300 _this.accumulatedTime = _this.accumulatedTime + timeDelta;
18301 // more than 10 frames? prolly switched browser tab. Restart
18302 if (_this.accumulatedTime > msPerFrame * 10) {
18303 _this.accumulatedTime = 0;
18304 }
18305
18306 if (_this.accumulatedTime === 0) {
18307 // no need to cancel animationID here; shouldn't have any in flight
18308 _this.animationID = null;
18309 _this.startAnimationIfNecessary();
18310 return;
18311 }
18312
18313 var currentFrameCompletion = (_this.accumulatedTime - Math.floor(_this.accumulatedTime / msPerFrame) * msPerFrame) / msPerFrame;
18314 var framesToCatchUp = Math.floor(_this.accumulatedTime / msPerFrame);
18315
18316 var newLastIdealStyle = {};
18317 var newLastIdealVelocity = {};
18318 var newCurrentStyle = {};
18319 var newCurrentVelocity = {};
18320
18321 for (var key in propsStyle) {
18322 if (!Object.prototype.hasOwnProperty.call(propsStyle, key)) {
18323 continue;
18324 }
18325
18326 var styleValue = propsStyle[key];
18327 if (typeof styleValue === 'number') {
18328 newCurrentStyle[key] = styleValue;
18329 newCurrentVelocity[key] = 0;
18330 newLastIdealStyle[key] = styleValue;
18331 newLastIdealVelocity[key] = 0;
18332 } else {
18333 var newLastIdealStyleValue = _this.state.lastIdealStyle[key];
18334 var newLastIdealVelocityValue = _this.state.lastIdealVelocity[key];
18335 for (var i = 0; i < framesToCatchUp; i++) {
18336 var _stepper = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision);
18337
18338 newLastIdealStyleValue = _stepper[0];
18339 newLastIdealVelocityValue = _stepper[1];
18340 }
18341
18342 var _stepper2 = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision);
18343
18344 var nextIdealX = _stepper2[0];
18345 var nextIdealV = _stepper2[1];
18346
18347 newCurrentStyle[key] = newLastIdealStyleValue + (nextIdealX - newLastIdealStyleValue) * currentFrameCompletion;
18348 newCurrentVelocity[key] = newLastIdealVelocityValue + (nextIdealV - newLastIdealVelocityValue) * currentFrameCompletion;
18349 newLastIdealStyle[key] = newLastIdealStyleValue;
18350 newLastIdealVelocity[key] = newLastIdealVelocityValue;
18351 }
18352 }
18353
18354 _this.animationID = null;
18355 // the amount we're looped over above
18356 _this.accumulatedTime -= framesToCatchUp * msPerFrame;
18357
18358 _this.setState({
18359 currentStyle: newCurrentStyle,
18360 currentVelocity: newCurrentVelocity,
18361 lastIdealStyle: newLastIdealStyle,
18362 lastIdealVelocity: newLastIdealVelocity
18363 });
18364
18365 _this.unreadPropStyle = null;
18366
18367 _this.startAnimationIfNecessary();
18368 });
18369 };
18370
18371 this.state = this.defaultState();
18372 }
18373
18374 Motion.prototype.defaultState = function defaultState() {
18375 var _props = this.props;
18376 var defaultStyle = _props.defaultStyle;
18377 var style = _props.style;
18378
18379 var currentStyle = defaultStyle || _stripStyle2['default'](style);
18380 var currentVelocity = _mapToZero2['default'](currentStyle);
18381 return {
18382 currentStyle: currentStyle,
18383 currentVelocity: currentVelocity,
18384 lastIdealStyle: currentStyle,
18385 lastIdealVelocity: currentVelocity
18386 };
18387 };
18388
18389 // it's possible that currentStyle's value is stale: if props is immediately
18390 // changed from 0 to 400 to spring(0) again, the async currentStyle is still
18391 // at 0 (didn't have time to tick and interpolate even once). If we naively
18392 // compare currentStyle with destVal it'll be 0 === 0 (no animation, stop).
18393 // In reality currentStyle should be 400
18394
18395 Motion.prototype.componentDidMount = function componentDidMount() {
18396 this.prevTime = _performanceNow2['default']();
18397 this.startAnimationIfNecessary();
18398 };
18399
18400 Motion.prototype.componentWillReceiveProps = function componentWillReceiveProps(props) {
18401 if (this.unreadPropStyle != null) {
18402 // previous props haven't had the chance to be set yet; set them here
18403 this.clearUnreadPropStyle(this.unreadPropStyle);
18404 }
18405
18406 this.unreadPropStyle = props.style;
18407 if (this.animationID == null) {
18408 this.prevTime = _performanceNow2['default']();
18409 this.startAnimationIfNecessary();
18410 }
18411 };
18412
18413 Motion.prototype.componentWillUnmount = function componentWillUnmount() {
18414 if (this.animationID != null) {
18415 _raf2['default'].cancel(this.animationID);
18416 this.animationID = null;
18417 }
18418 };
18419
18420 Motion.prototype.render = function render() {
18421 var renderedChildren = this.props.children(this.state.currentStyle);
18422 return renderedChildren && _react2['default'].Children.only(renderedChildren);
18423 };
18424
18425 return Motion;
18426 })(_react2['default'].Component);
18427
18428 exports['default'] = Motion;
18429 module.exports = exports['default'];
18430
18431 // after checking for unreadPropStyle != null, we manually go set the
18432 // non-interpolating values (those that are a number, without a spring
18433 // config)
18434
18435/***/ }),
18436/* 174 */
18437/***/ (function(module, exports) {
18438
18439
18440
18441 // currently used to initiate the velocity style object to 0
18442 'use strict';
18443
18444 exports.__esModule = true;
18445 exports['default'] = mapToZero;
18446
18447 function mapToZero(obj) {
18448 var ret = {};
18449 for (var key in obj) {
18450 if (Object.prototype.hasOwnProperty.call(obj, key)) {
18451 ret[key] = 0;
18452 }
18453 }
18454 return ret;
18455 }
18456
18457 module.exports = exports['default'];
18458
18459/***/ }),
18460/* 175 */
18461/***/ (function(module, exports) {
18462
18463
18464 // turn {x: {val: 1, stiffness: 1, damping: 2}, y: 2} generated by
18465 // `{x: spring(1, {stiffness: 1, damping: 2}), y: 2}` into {x: 1, y: 2}
18466
18467 'use strict';
18468
18469 exports.__esModule = true;
18470 exports['default'] = stripStyle;
18471
18472 function stripStyle(style) {
18473 var ret = {};
18474 for (var key in style) {
18475 if (!Object.prototype.hasOwnProperty.call(style, key)) {
18476 continue;
18477 }
18478 ret[key] = typeof style[key] === 'number' ? style[key] : style[key].val;
18479 }
18480 return ret;
18481 }
18482
18483 module.exports = exports['default'];
18484
18485/***/ }),
18486/* 176 */
18487/***/ (function(module, exports) {
18488
18489
18490
18491 // stepper is used a lot. Saves allocation to return the same array wrapper.
18492 // This is fine and danger-free against mutations because the callsite
18493 // immediately destructures it and gets the numbers inside without passing the
18494 "use strict";
18495
18496 exports.__esModule = true;
18497 exports["default"] = stepper;
18498
18499 var reusedTuple = [0, 0];
18500
18501 function stepper(secondPerFrame, x, v, destX, k, b, precision) {
18502 // Spring stiffness, in kg / s^2
18503
18504 // for animations, destX is really spring length (spring at rest). initial
18505 // position is considered as the stretched/compressed position of a spring
18506 var Fspring = -k * (x - destX);
18507
18508 // Damping, in kg / s
18509 var Fdamper = -b * v;
18510
18511 // usually we put mass here, but for animation purposes, specifying mass is a
18512 // bit redundant. you could simply adjust k and b accordingly
18513 // let a = (Fspring + Fdamper) / mass;
18514 var a = Fspring + Fdamper;
18515
18516 var newV = v + a * secondPerFrame;
18517 var newX = x + newV * secondPerFrame;
18518
18519 if (Math.abs(newV) < precision && Math.abs(newX - destX) < precision) {
18520 reusedTuple[0] = destX;
18521 reusedTuple[1] = 0;
18522 return reusedTuple;
18523 }
18524
18525 reusedTuple[0] = newX;
18526 reusedTuple[1] = newV;
18527 return reusedTuple;
18528 }
18529
18530 module.exports = exports["default"];
18531 // array reference around.
18532
18533/***/ }),
18534/* 177 */
18535/***/ (function(module, exports, __webpack_require__) {
18536
18537 /* WEBPACK VAR INJECTION */(function(process) {// Generated by CoffeeScript 1.7.1
18538 (function() {
18539 var getNanoSeconds, hrtime, loadTime;
18540
18541 if ((typeof performance !== "undefined" && performance !== null) && performance.now) {
18542 module.exports = function() {
18543 return performance.now();
18544 };
18545 } else if ((typeof process !== "undefined" && process !== null) && process.hrtime) {
18546 module.exports = function() {
18547 return (getNanoSeconds() - loadTime) / 1e6;
18548 };
18549 hrtime = process.hrtime;
18550 getNanoSeconds = function() {
18551 var hr;
18552 hr = hrtime();
18553 return hr[0] * 1e9 + hr[1];
18554 };
18555 loadTime = getNanoSeconds();
18556 } else if (Date.now) {
18557 module.exports = function() {
18558 return Date.now() - loadTime;
18559 };
18560 loadTime = Date.now();
18561 } else {
18562 module.exports = function() {
18563 return new Date().getTime() - loadTime;
18564 };
18565 loadTime = new Date().getTime();
18566 }
18567
18568 }).call(this);
18569
18570 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(33)))
18571
18572/***/ }),
18573/* 178 */
18574/***/ (function(module, exports, __webpack_require__) {
18575
18576 /* WEBPACK VAR INJECTION */(function(global) {var now = __webpack_require__(177)
18577 , root = typeof window === 'undefined' ? global : window
18578 , vendors = ['moz', 'webkit']
18579 , suffix = 'AnimationFrame'
18580 , raf = root['request' + suffix]
18581 , caf = root['cancel' + suffix] || root['cancelRequest' + suffix]
18582
18583 for(var i = 0; !raf && i < vendors.length; i++) {
18584 raf = root[vendors[i] + 'Request' + suffix]
18585 caf = root[vendors[i] + 'Cancel' + suffix]
18586 || root[vendors[i] + 'CancelRequest' + suffix]
18587 }
18588
18589 // Some versions of FF have rAF but not cAF
18590 if(!raf || !caf) {
18591 var last = 0
18592 , id = 0
18593 , queue = []
18594 , frameDuration = 1000 / 60
18595
18596 raf = function(callback) {
18597 if(queue.length === 0) {
18598 var _now = now()
18599 , next = Math.max(0, frameDuration - (_now - last))
18600 last = next + _now
18601 setTimeout(function() {
18602 var cp = queue.slice(0)
18603 // Clear queue here to prevent
18604 // callbacks from appending listeners
18605 // to the current frame's queue
18606 queue.length = 0
18607 for(var i = 0; i < cp.length; i++) {
18608 if(!cp[i].cancelled) {
18609 try{
18610 cp[i].callback(last)
18611 } catch(e) {
18612 setTimeout(function() { throw e }, 0)
18613 }
18614 }
18615 }
18616 }, Math.round(next))
18617 }
18618 queue.push({
18619 handle: ++id,
18620 callback: callback,
18621 cancelled: false
18622 })
18623 return id
18624 }
18625
18626 caf = function(handle) {
18627 for(var i = 0; i < queue.length; i++) {
18628 if(queue[i].handle === handle) {
18629 queue[i].cancelled = true
18630 }
18631 }
18632 }
18633 }
18634
18635 module.exports = function(fn) {
18636 // Wrap in a new function to prevent
18637 // `cancel` potentially being assigned
18638 // to the native rAF function
18639 return raf.call(root, fn)
18640 }
18641 module.exports.cancel = function() {
18642 caf.apply(root, arguments)
18643 }
18644 module.exports.polyfill = function(object) {
18645 if (!object) {
18646 object = root;
18647 }
18648 object.requestAnimationFrame = raf
18649 object.cancelAnimationFrame = caf
18650 }
18651
18652 /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
18653
18654/***/ }),
18655/* 179 */
18656/***/ (function(module, exports) {
18657
18658
18659
18660 // usage assumption: currentStyle values have already been rendered but it says
18661 // nothing of whether currentStyle is stale (see unreadPropStyle)
18662 'use strict';
18663
18664 exports.__esModule = true;
18665 exports['default'] = shouldStopAnimation;
18666
18667 function shouldStopAnimation(currentStyle, style, currentVelocity) {
18668 for (var key in style) {
18669 if (!Object.prototype.hasOwnProperty.call(style, key)) {
18670 continue;
18671 }
18672
18673 if (currentVelocity[key] !== 0) {
18674 return false;
18675 }
18676
18677 var styleValue = typeof style[key] === 'number' ? style[key] : style[key].val;
18678 // stepper will have already taken care of rounding precision errors, so
18679 // won't have such thing as 0.9999 !=== 1
18680 if (currentStyle[key] !== styleValue) {
18681 return false;
18682 }
18683 }
18684
18685 return true;
18686 }
18687
18688 module.exports = exports['default'];
18689
18690/***/ }),
18691/* 180 */
18692/***/ (function(module, exports, __webpack_require__) {
18693
18694 'use strict';
18695
18696 exports.__esModule = true;
18697
18698 var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
18699
18700 var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
18701
18702 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
18703
18704 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
18705
18706 function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
18707
18708 var _mapToZero = __webpack_require__(174);
18709
18710 var _mapToZero2 = _interopRequireDefault(_mapToZero);
18711
18712 var _stripStyle = __webpack_require__(175);
18713
18714 var _stripStyle2 = _interopRequireDefault(_stripStyle);
18715
18716 var _stepper3 = __webpack_require__(176);
18717
18718 var _stepper4 = _interopRequireDefault(_stepper3);
18719
18720 var _performanceNow = __webpack_require__(177);
18721
18722 var _performanceNow2 = _interopRequireDefault(_performanceNow);
18723
18724 var _raf = __webpack_require__(178);
18725
18726 var _raf2 = _interopRequireDefault(_raf);
18727
18728 var _shouldStopAnimation = __webpack_require__(179);
18729
18730 var _shouldStopAnimation2 = _interopRequireDefault(_shouldStopAnimation);
18731
18732 var _react = __webpack_require__(4);
18733
18734 var _react2 = _interopRequireDefault(_react);
18735
18736 var _propTypes = __webpack_require__(5);
18737
18738 var _propTypes2 = _interopRequireDefault(_propTypes);
18739
18740 var msPerFrame = 1000 / 60;
18741
18742 function shouldStopAnimationAll(currentStyles, styles, currentVelocities) {
18743 for (var i = 0; i < currentStyles.length; i++) {
18744 if (!_shouldStopAnimation2['default'](currentStyles[i], styles[i], currentVelocities[i])) {
18745 return false;
18746 }
18747 }
18748 return true;
18749 }
18750
18751 var StaggeredMotion = (function (_React$Component) {
18752 _inherits(StaggeredMotion, _React$Component);
18753
18754 _createClass(StaggeredMotion, null, [{
18755 key: 'propTypes',
18756 value: {
18757 // TOOD: warn against putting a config in here
18758 defaultStyles: _propTypes2['default'].arrayOf(_propTypes2['default'].objectOf(_propTypes2['default'].number)),
18759 styles: _propTypes2['default'].func.isRequired,
18760 children: _propTypes2['default'].func.isRequired
18761 },
18762 enumerable: true
18763 }]);
18764
18765 function StaggeredMotion(props) {
18766 var _this = this;
18767
18768 _classCallCheck(this, StaggeredMotion);
18769
18770 _React$Component.call(this, props);
18771 this.animationID = null;
18772 this.prevTime = 0;
18773 this.accumulatedTime = 0;
18774 this.unreadPropStyles = null;
18775
18776 this.clearUnreadPropStyle = function (unreadPropStyles) {
18777 var _state = _this.state;
18778 var currentStyles = _state.currentStyles;
18779 var currentVelocities = _state.currentVelocities;
18780 var lastIdealStyles = _state.lastIdealStyles;
18781 var lastIdealVelocities = _state.lastIdealVelocities;
18782
18783 var someDirty = false;
18784 for (var i = 0; i < unreadPropStyles.length; i++) {
18785 var unreadPropStyle = unreadPropStyles[i];
18786 var dirty = false;
18787
18788 for (var key in unreadPropStyle) {
18789 if (!Object.prototype.hasOwnProperty.call(unreadPropStyle, key)) {
18790 continue;
18791 }
18792
18793 var styleValue = unreadPropStyle[key];
18794 if (typeof styleValue === 'number') {
18795 if (!dirty) {
18796 dirty = true;
18797 someDirty = true;
18798 currentStyles[i] = _extends({}, currentStyles[i]);
18799 currentVelocities[i] = _extends({}, currentVelocities[i]);
18800 lastIdealStyles[i] = _extends({}, lastIdealStyles[i]);
18801 lastIdealVelocities[i] = _extends({}, lastIdealVelocities[i]);
18802 }
18803 currentStyles[i][key] = styleValue;
18804 currentVelocities[i][key] = 0;
18805 lastIdealStyles[i][key] = styleValue;
18806 lastIdealVelocities[i][key] = 0;
18807 }
18808 }
18809 }
18810
18811 if (someDirty) {
18812 _this.setState({ currentStyles: currentStyles, currentVelocities: currentVelocities, lastIdealStyles: lastIdealStyles, lastIdealVelocities: lastIdealVelocities });
18813 }
18814 };
18815
18816 this.startAnimationIfNecessary = function () {
18817 // TODO: when config is {a: 10} and dest is {a: 10} do we raf once and
18818 // call cb? No, otherwise accidental parent rerender causes cb trigger
18819 _this.animationID = _raf2['default'](function (timestamp) {
18820 var destStyles = _this.props.styles(_this.state.lastIdealStyles);
18821
18822 // check if we need to animate in the first place
18823 if (shouldStopAnimationAll(_this.state.currentStyles, destStyles, _this.state.currentVelocities)) {
18824 // no need to cancel animationID here; shouldn't have any in flight
18825 _this.animationID = null;
18826 _this.accumulatedTime = 0;
18827 return;
18828 }
18829
18830 var currentTime = timestamp || _performanceNow2['default']();
18831 var timeDelta = currentTime - _this.prevTime;
18832 _this.prevTime = currentTime;
18833 _this.accumulatedTime = _this.accumulatedTime + timeDelta;
18834 // more than 10 frames? prolly switched browser tab. Restart
18835 if (_this.accumulatedTime > msPerFrame * 10) {
18836 _this.accumulatedTime = 0;
18837 }
18838
18839 if (_this.accumulatedTime === 0) {
18840 // no need to cancel animationID here; shouldn't have any in flight
18841 _this.animationID = null;
18842 _this.startAnimationIfNecessary();
18843 return;
18844 }
18845
18846 var currentFrameCompletion = (_this.accumulatedTime - Math.floor(_this.accumulatedTime / msPerFrame) * msPerFrame) / msPerFrame;
18847 var framesToCatchUp = Math.floor(_this.accumulatedTime / msPerFrame);
18848
18849 var newLastIdealStyles = [];
18850 var newLastIdealVelocities = [];
18851 var newCurrentStyles = [];
18852 var newCurrentVelocities = [];
18853
18854 for (var i = 0; i < destStyles.length; i++) {
18855 var destStyle = destStyles[i];
18856 var newCurrentStyle = {};
18857 var newCurrentVelocity = {};
18858 var newLastIdealStyle = {};
18859 var newLastIdealVelocity = {};
18860
18861 for (var key in destStyle) {
18862 if (!Object.prototype.hasOwnProperty.call(destStyle, key)) {
18863 continue;
18864 }
18865
18866 var styleValue = destStyle[key];
18867 if (typeof styleValue === 'number') {
18868 newCurrentStyle[key] = styleValue;
18869 newCurrentVelocity[key] = 0;
18870 newLastIdealStyle[key] = styleValue;
18871 newLastIdealVelocity[key] = 0;
18872 } else {
18873 var newLastIdealStyleValue = _this.state.lastIdealStyles[i][key];
18874 var newLastIdealVelocityValue = _this.state.lastIdealVelocities[i][key];
18875 for (var j = 0; j < framesToCatchUp; j++) {
18876 var _stepper = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision);
18877
18878 newLastIdealStyleValue = _stepper[0];
18879 newLastIdealVelocityValue = _stepper[1];
18880 }
18881
18882 var _stepper2 = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision);
18883
18884 var nextIdealX = _stepper2[0];
18885 var nextIdealV = _stepper2[1];
18886
18887 newCurrentStyle[key] = newLastIdealStyleValue + (nextIdealX - newLastIdealStyleValue) * currentFrameCompletion;
18888 newCurrentVelocity[key] = newLastIdealVelocityValue + (nextIdealV - newLastIdealVelocityValue) * currentFrameCompletion;
18889 newLastIdealStyle[key] = newLastIdealStyleValue;
18890 newLastIdealVelocity[key] = newLastIdealVelocityValue;
18891 }
18892 }
18893
18894 newCurrentStyles[i] = newCurrentStyle;
18895 newCurrentVelocities[i] = newCurrentVelocity;
18896 newLastIdealStyles[i] = newLastIdealStyle;
18897 newLastIdealVelocities[i] = newLastIdealVelocity;
18898 }
18899
18900 _this.animationID = null;
18901 // the amount we're looped over above
18902 _this.accumulatedTime -= framesToCatchUp * msPerFrame;
18903
18904 _this.setState({
18905 currentStyles: newCurrentStyles,
18906 currentVelocities: newCurrentVelocities,
18907 lastIdealStyles: newLastIdealStyles,
18908 lastIdealVelocities: newLastIdealVelocities
18909 });
18910
18911 _this.unreadPropStyles = null;
18912
18913 _this.startAnimationIfNecessary();
18914 });
18915 };
18916
18917 this.state = this.defaultState();
18918 }
18919
18920 StaggeredMotion.prototype.defaultState = function defaultState() {
18921 var _props = this.props;
18922 var defaultStyles = _props.defaultStyles;
18923 var styles = _props.styles;
18924
18925 var currentStyles = defaultStyles || styles().map(_stripStyle2['default']);
18926 var currentVelocities = currentStyles.map(function (currentStyle) {
18927 return _mapToZero2['default'](currentStyle);
18928 });
18929 return {
18930 currentStyles: currentStyles,
18931 currentVelocities: currentVelocities,
18932 lastIdealStyles: currentStyles,
18933 lastIdealVelocities: currentVelocities
18934 };
18935 };
18936
18937 StaggeredMotion.prototype.componentDidMount = function componentDidMount() {
18938 this.prevTime = _performanceNow2['default']();
18939 this.startAnimationIfNecessary();
18940 };
18941
18942 StaggeredMotion.prototype.componentWillReceiveProps = function componentWillReceiveProps(props) {
18943 if (this.unreadPropStyles != null) {
18944 // previous props haven't had the chance to be set yet; set them here
18945 this.clearUnreadPropStyle(this.unreadPropStyles);
18946 }
18947
18948 this.unreadPropStyles = props.styles(this.state.lastIdealStyles);
18949 if (this.animationID == null) {
18950 this.prevTime = _performanceNow2['default']();
18951 this.startAnimationIfNecessary();
18952 }
18953 };
18954
18955 StaggeredMotion.prototype.componentWillUnmount = function componentWillUnmount() {
18956 if (this.animationID != null) {
18957 _raf2['default'].cancel(this.animationID);
18958 this.animationID = null;
18959 }
18960 };
18961
18962 StaggeredMotion.prototype.render = function render() {
18963 var renderedChildren = this.props.children(this.state.currentStyles);
18964 return renderedChildren && _react2['default'].Children.only(renderedChildren);
18965 };
18966
18967 return StaggeredMotion;
18968 })(_react2['default'].Component);
18969
18970 exports['default'] = StaggeredMotion;
18971 module.exports = exports['default'];
18972
18973 // it's possible that currentStyle's value is stale: if props is immediately
18974 // changed from 0 to 400 to spring(0) again, the async currentStyle is still
18975 // at 0 (didn't have time to tick and interpolate even once). If we naively
18976 // compare currentStyle with destVal it'll be 0 === 0 (no animation, stop).
18977 // In reality currentStyle should be 400
18978
18979 // after checking for unreadPropStyles != null, we manually go set the
18980 // non-interpolating values (those that are a number, without a spring
18981 // config)
18982
18983/***/ }),
18984/* 181 */
18985/***/ (function(module, exports, __webpack_require__) {
18986
18987 'use strict';
18988
18989 exports.__esModule = true;
18990
18991 var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
18992
18993 var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
18994
18995 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
18996
18997 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
18998
18999 function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
19000
19001 var _mapToZero = __webpack_require__(174);
19002
19003 var _mapToZero2 = _interopRequireDefault(_mapToZero);
19004
19005 var _stripStyle = __webpack_require__(175);
19006
19007 var _stripStyle2 = _interopRequireDefault(_stripStyle);
19008
19009 var _stepper3 = __webpack_require__(176);
19010
19011 var _stepper4 = _interopRequireDefault(_stepper3);
19012
19013 var _mergeDiff = __webpack_require__(182);
19014
19015 var _mergeDiff2 = _interopRequireDefault(_mergeDiff);
19016
19017 var _performanceNow = __webpack_require__(177);
19018
19019 var _performanceNow2 = _interopRequireDefault(_performanceNow);
19020
19021 var _raf = __webpack_require__(178);
19022
19023 var _raf2 = _interopRequireDefault(_raf);
19024
19025 var _shouldStopAnimation = __webpack_require__(179);
19026
19027 var _shouldStopAnimation2 = _interopRequireDefault(_shouldStopAnimation);
19028
19029 var _react = __webpack_require__(4);
19030
19031 var _react2 = _interopRequireDefault(_react);
19032
19033 var _propTypes = __webpack_require__(5);
19034
19035 var _propTypes2 = _interopRequireDefault(_propTypes);
19036
19037 var msPerFrame = 1000 / 60;
19038
19039 // the children function & (potential) styles function asks as param an
19040 // Array<TransitionPlainStyle>, where each TransitionPlainStyle is of the format
19041 // {key: string, data?: any, style: PlainStyle}. However, the way we keep
19042 // internal states doesn't contain such a data structure (check the state and
19043 // TransitionMotionState). So when children function and others ask for such
19044 // data we need to generate them on the fly by combining mergedPropsStyles and
19045 // currentStyles/lastIdealStyles
19046 function rehydrateStyles(mergedPropsStyles, unreadPropStyles, plainStyles) {
19047 // Copy the value to a `const` so that Flow understands that the const won't
19048 // change and will be non-nullable in the callback below.
19049 var cUnreadPropStyles = unreadPropStyles;
19050 if (cUnreadPropStyles == null) {
19051 return mergedPropsStyles.map(function (mergedPropsStyle, i) {
19052 return {
19053 key: mergedPropsStyle.key,
19054 data: mergedPropsStyle.data,
19055 style: plainStyles[i]
19056 };
19057 });
19058 }
19059 return mergedPropsStyles.map(function (mergedPropsStyle, i) {
19060 for (var j = 0; j < cUnreadPropStyles.length; j++) {
19061 if (cUnreadPropStyles[j].key === mergedPropsStyle.key) {
19062 return {
19063 key: cUnreadPropStyles[j].key,
19064 data: cUnreadPropStyles[j].data,
19065 style: plainStyles[i]
19066 };
19067 }
19068 }
19069 return { key: mergedPropsStyle.key, data: mergedPropsStyle.data, style: plainStyles[i] };
19070 });
19071 }
19072
19073 function shouldStopAnimationAll(currentStyles, destStyles, currentVelocities, mergedPropsStyles) {
19074 if (mergedPropsStyles.length !== destStyles.length) {
19075 return false;
19076 }
19077
19078 for (var i = 0; i < mergedPropsStyles.length; i++) {
19079 if (mergedPropsStyles[i].key !== destStyles[i].key) {
19080 return false;
19081 }
19082 }
19083
19084 // we have the invariant that mergedPropsStyles and
19085 // currentStyles/currentVelocities/last* are synced in terms of cells, see
19086 // mergeAndSync comment for more info
19087 for (var i = 0; i < mergedPropsStyles.length; i++) {
19088 if (!_shouldStopAnimation2['default'](currentStyles[i], destStyles[i].style, currentVelocities[i])) {
19089 return false;
19090 }
19091 }
19092
19093 return true;
19094 }
19095
19096 // core key merging logic
19097
19098 // things to do: say previously merged style is {a, b}, dest style (prop) is {b,
19099 // c}, previous current (interpolating) style is {a, b}
19100 // **invariant**: current[i] corresponds to merged[i] in terms of key
19101
19102 // steps:
19103 // turn merged style into {a?, b, c}
19104 // add c, value of c is destStyles.c
19105 // maybe remove a, aka call willLeave(a), then merged is either {b, c} or {a, b, c}
19106 // turn current (interpolating) style from {a, b} into {a?, b, c}
19107 // maybe remove a
19108 // certainly add c, value of c is willEnter(c)
19109 // loop over merged and construct new current
19110 // dest doesn't change, that's owner's
19111 function mergeAndSync(willEnter, willLeave, didLeave, oldMergedPropsStyles, destStyles, oldCurrentStyles, oldCurrentVelocities, oldLastIdealStyles, oldLastIdealVelocities) {
19112 var newMergedPropsStyles = _mergeDiff2['default'](oldMergedPropsStyles, destStyles, function (oldIndex, oldMergedPropsStyle) {
19113 var leavingStyle = willLeave(oldMergedPropsStyle);
19114 if (leavingStyle == null) {
19115 didLeave({ key: oldMergedPropsStyle.key, data: oldMergedPropsStyle.data });
19116 return null;
19117 }
19118 if (_shouldStopAnimation2['default'](oldCurrentStyles[oldIndex], leavingStyle, oldCurrentVelocities[oldIndex])) {
19119 didLeave({ key: oldMergedPropsStyle.key, data: oldMergedPropsStyle.data });
19120 return null;
19121 }
19122 return { key: oldMergedPropsStyle.key, data: oldMergedPropsStyle.data, style: leavingStyle };
19123 });
19124
19125 var newCurrentStyles = [];
19126 var newCurrentVelocities = [];
19127 var newLastIdealStyles = [];
19128 var newLastIdealVelocities = [];
19129 for (var i = 0; i < newMergedPropsStyles.length; i++) {
19130 var newMergedPropsStyleCell = newMergedPropsStyles[i];
19131 var foundOldIndex = null;
19132 for (var j = 0; j < oldMergedPropsStyles.length; j++) {
19133 if (oldMergedPropsStyles[j].key === newMergedPropsStyleCell.key) {
19134 foundOldIndex = j;
19135 break;
19136 }
19137 }
19138 // TODO: key search code
19139 if (foundOldIndex == null) {
19140 var plainStyle = willEnter(newMergedPropsStyleCell);
19141 newCurrentStyles[i] = plainStyle;
19142 newLastIdealStyles[i] = plainStyle;
19143
19144 var velocity = _mapToZero2['default'](newMergedPropsStyleCell.style);
19145 newCurrentVelocities[i] = velocity;
19146 newLastIdealVelocities[i] = velocity;
19147 } else {
19148 newCurrentStyles[i] = oldCurrentStyles[foundOldIndex];
19149 newLastIdealStyles[i] = oldLastIdealStyles[foundOldIndex];
19150 newCurrentVelocities[i] = oldCurrentVelocities[foundOldIndex];
19151 newLastIdealVelocities[i] = oldLastIdealVelocities[foundOldIndex];
19152 }
19153 }
19154
19155 return [newMergedPropsStyles, newCurrentStyles, newCurrentVelocities, newLastIdealStyles, newLastIdealVelocities];
19156 }
19157
19158 var TransitionMotion = (function (_React$Component) {
19159 _inherits(TransitionMotion, _React$Component);
19160
19161 _createClass(TransitionMotion, null, [{
19162 key: 'propTypes',
19163 value: {
19164 defaultStyles: _propTypes2['default'].arrayOf(_propTypes2['default'].shape({
19165 key: _propTypes2['default'].string.isRequired,
19166 data: _propTypes2['default'].any,
19167 style: _propTypes2['default'].objectOf(_propTypes2['default'].number).isRequired
19168 })),
19169 styles: _propTypes2['default'].oneOfType([_propTypes2['default'].func, _propTypes2['default'].arrayOf(_propTypes2['default'].shape({
19170 key: _propTypes2['default'].string.isRequired,
19171 data: _propTypes2['default'].any,
19172 style: _propTypes2['default'].objectOf(_propTypes2['default'].oneOfType([_propTypes2['default'].number, _propTypes2['default'].object])).isRequired
19173 }))]).isRequired,
19174 children: _propTypes2['default'].func.isRequired,
19175 willEnter: _propTypes2['default'].func,
19176 willLeave: _propTypes2['default'].func,
19177 didLeave: _propTypes2['default'].func
19178 },
19179 enumerable: true
19180 }, {
19181 key: 'defaultProps',
19182 value: {
19183 willEnter: function willEnter(styleThatEntered) {
19184 return _stripStyle2['default'](styleThatEntered.style);
19185 },
19186 // recall: returning null makes the current unmounting TransitionStyle
19187 // disappear immediately
19188 willLeave: function willLeave() {
19189 return null;
19190 },
19191 didLeave: function didLeave() {}
19192 },
19193 enumerable: true
19194 }]);
19195
19196 function TransitionMotion(props) {
19197 var _this = this;
19198
19199 _classCallCheck(this, TransitionMotion);
19200
19201 _React$Component.call(this, props);
19202 this.unmounting = false;
19203 this.animationID = null;
19204 this.prevTime = 0;
19205 this.accumulatedTime = 0;
19206 this.unreadPropStyles = null;
19207
19208 this.clearUnreadPropStyle = function (unreadPropStyles) {
19209 var _mergeAndSync = mergeAndSync(_this.props.willEnter, _this.props.willLeave, _this.props.didLeave, _this.state.mergedPropsStyles, unreadPropStyles, _this.state.currentStyles, _this.state.currentVelocities, _this.state.lastIdealStyles, _this.state.lastIdealVelocities);
19210
19211 var mergedPropsStyles = _mergeAndSync[0];
19212 var currentStyles = _mergeAndSync[1];
19213 var currentVelocities = _mergeAndSync[2];
19214 var lastIdealStyles = _mergeAndSync[3];
19215 var lastIdealVelocities = _mergeAndSync[4];
19216
19217 for (var i = 0; i < unreadPropStyles.length; i++) {
19218 var unreadPropStyle = unreadPropStyles[i].style;
19219 var dirty = false;
19220
19221 for (var key in unreadPropStyle) {
19222 if (!Object.prototype.hasOwnProperty.call(unreadPropStyle, key)) {
19223 continue;
19224 }
19225
19226 var styleValue = unreadPropStyle[key];
19227 if (typeof styleValue === 'number') {
19228 if (!dirty) {
19229 dirty = true;
19230 currentStyles[i] = _extends({}, currentStyles[i]);
19231 currentVelocities[i] = _extends({}, currentVelocities[i]);
19232 lastIdealStyles[i] = _extends({}, lastIdealStyles[i]);
19233 lastIdealVelocities[i] = _extends({}, lastIdealVelocities[i]);
19234 mergedPropsStyles[i] = {
19235 key: mergedPropsStyles[i].key,
19236 data: mergedPropsStyles[i].data,
19237 style: _extends({}, mergedPropsStyles[i].style)
19238 };
19239 }
19240 currentStyles[i][key] = styleValue;
19241 currentVelocities[i][key] = 0;
19242 lastIdealStyles[i][key] = styleValue;
19243 lastIdealVelocities[i][key] = 0;
19244 mergedPropsStyles[i].style[key] = styleValue;
19245 }
19246 }
19247 }
19248
19249 // unlike the other 2 components, we can't detect staleness and optionally
19250 // opt out of setState here. each style object's data might contain new
19251 // stuff we're not/cannot compare
19252 _this.setState({
19253 currentStyles: currentStyles,
19254 currentVelocities: currentVelocities,
19255 mergedPropsStyles: mergedPropsStyles,
19256 lastIdealStyles: lastIdealStyles,
19257 lastIdealVelocities: lastIdealVelocities
19258 });
19259 };
19260
19261 this.startAnimationIfNecessary = function () {
19262 if (_this.unmounting) {
19263 return;
19264 }
19265
19266 // TODO: when config is {a: 10} and dest is {a: 10} do we raf once and
19267 // call cb? No, otherwise accidental parent rerender causes cb trigger
19268 _this.animationID = _raf2['default'](function (timestamp) {
19269 // https://github.com/chenglou/react-motion/pull/420
19270 // > if execution passes the conditional if (this.unmounting), then
19271 // executes async defaultRaf and after that component unmounts and after
19272 // that the callback of defaultRaf is called, then setState will be called
19273 // on unmounted component.
19274 if (_this.unmounting) {
19275 return;
19276 }
19277
19278 var propStyles = _this.props.styles;
19279 var destStyles = typeof propStyles === 'function' ? propStyles(rehydrateStyles(_this.state.mergedPropsStyles, _this.unreadPropStyles, _this.state.lastIdealStyles)) : propStyles;
19280
19281 // check if we need to animate in the first place
19282 if (shouldStopAnimationAll(_this.state.currentStyles, destStyles, _this.state.currentVelocities, _this.state.mergedPropsStyles)) {
19283 // no need to cancel animationID here; shouldn't have any in flight
19284 _this.animationID = null;
19285 _this.accumulatedTime = 0;
19286 return;
19287 }
19288
19289 var currentTime = timestamp || _performanceNow2['default']();
19290 var timeDelta = currentTime - _this.prevTime;
19291 _this.prevTime = currentTime;
19292 _this.accumulatedTime = _this.accumulatedTime + timeDelta;
19293 // more than 10 frames? prolly switched browser tab. Restart
19294 if (_this.accumulatedTime > msPerFrame * 10) {
19295 _this.accumulatedTime = 0;
19296 }
19297
19298 if (_this.accumulatedTime === 0) {
19299 // no need to cancel animationID here; shouldn't have any in flight
19300 _this.animationID = null;
19301 _this.startAnimationIfNecessary();
19302 return;
19303 }
19304
19305 var currentFrameCompletion = (_this.accumulatedTime - Math.floor(_this.accumulatedTime / msPerFrame) * msPerFrame) / msPerFrame;
19306 var framesToCatchUp = Math.floor(_this.accumulatedTime / msPerFrame);
19307
19308 var _mergeAndSync2 = mergeAndSync(_this.props.willEnter, _this.props.willLeave, _this.props.didLeave, _this.state.mergedPropsStyles, destStyles, _this.state.currentStyles, _this.state.currentVelocities, _this.state.lastIdealStyles, _this.state.lastIdealVelocities);
19309
19310 var newMergedPropsStyles = _mergeAndSync2[0];
19311 var newCurrentStyles = _mergeAndSync2[1];
19312 var newCurrentVelocities = _mergeAndSync2[2];
19313 var newLastIdealStyles = _mergeAndSync2[3];
19314 var newLastIdealVelocities = _mergeAndSync2[4];
19315
19316 for (var i = 0; i < newMergedPropsStyles.length; i++) {
19317 var newMergedPropsStyle = newMergedPropsStyles[i].style;
19318 var newCurrentStyle = {};
19319 var newCurrentVelocity = {};
19320 var newLastIdealStyle = {};
19321 var newLastIdealVelocity = {};
19322
19323 for (var key in newMergedPropsStyle) {
19324 if (!Object.prototype.hasOwnProperty.call(newMergedPropsStyle, key)) {
19325 continue;
19326 }
19327
19328 var styleValue = newMergedPropsStyle[key];
19329 if (typeof styleValue === 'number') {
19330 newCurrentStyle[key] = styleValue;
19331 newCurrentVelocity[key] = 0;
19332 newLastIdealStyle[key] = styleValue;
19333 newLastIdealVelocity[key] = 0;
19334 } else {
19335 var newLastIdealStyleValue = newLastIdealStyles[i][key];
19336 var newLastIdealVelocityValue = newLastIdealVelocities[i][key];
19337 for (var j = 0; j < framesToCatchUp; j++) {
19338 var _stepper = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision);
19339
19340 newLastIdealStyleValue = _stepper[0];
19341 newLastIdealVelocityValue = _stepper[1];
19342 }
19343
19344 var _stepper2 = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision);
19345
19346 var nextIdealX = _stepper2[0];
19347 var nextIdealV = _stepper2[1];
19348
19349 newCurrentStyle[key] = newLastIdealStyleValue + (nextIdealX - newLastIdealStyleValue) * currentFrameCompletion;
19350 newCurrentVelocity[key] = newLastIdealVelocityValue + (nextIdealV - newLastIdealVelocityValue) * currentFrameCompletion;
19351 newLastIdealStyle[key] = newLastIdealStyleValue;
19352 newLastIdealVelocity[key] = newLastIdealVelocityValue;
19353 }
19354 }
19355
19356 newLastIdealStyles[i] = newLastIdealStyle;
19357 newLastIdealVelocities[i] = newLastIdealVelocity;
19358 newCurrentStyles[i] = newCurrentStyle;
19359 newCurrentVelocities[i] = newCurrentVelocity;
19360 }
19361
19362 _this.animationID = null;
19363 // the amount we're looped over above
19364 _this.accumulatedTime -= framesToCatchUp * msPerFrame;
19365
19366 _this.setState({
19367 currentStyles: newCurrentStyles,
19368 currentVelocities: newCurrentVelocities,
19369 lastIdealStyles: newLastIdealStyles,
19370 lastIdealVelocities: newLastIdealVelocities,
19371 mergedPropsStyles: newMergedPropsStyles
19372 });
19373
19374 _this.unreadPropStyles = null;
19375
19376 _this.startAnimationIfNecessary();
19377 });
19378 };
19379
19380 this.state = this.defaultState();
19381 }
19382
19383 TransitionMotion.prototype.defaultState = function defaultState() {
19384 var _props = this.props;
19385 var defaultStyles = _props.defaultStyles;
19386 var styles = _props.styles;
19387 var willEnter = _props.willEnter;
19388 var willLeave = _props.willLeave;
19389 var didLeave = _props.didLeave;
19390
19391 var destStyles = typeof styles === 'function' ? styles(defaultStyles) : styles;
19392
19393 // this is special. for the first time around, we don't have a comparison
19394 // between last (no last) and current merged props. we'll compute last so:
19395 // say default is {a, b} and styles (dest style) is {b, c}, we'll
19396 // fabricate last as {a, b}
19397 var oldMergedPropsStyles = undefined;
19398 if (defaultStyles == null) {
19399 oldMergedPropsStyles = destStyles;
19400 } else {
19401 oldMergedPropsStyles = defaultStyles.map(function (defaultStyleCell) {
19402 // TODO: key search code
19403 for (var i = 0; i < destStyles.length; i++) {
19404 if (destStyles[i].key === defaultStyleCell.key) {
19405 return destStyles[i];
19406 }
19407 }
19408 return defaultStyleCell;
19409 });
19410 }
19411 var oldCurrentStyles = defaultStyles == null ? destStyles.map(function (s) {
19412 return _stripStyle2['default'](s.style);
19413 }) : defaultStyles.map(function (s) {
19414 return _stripStyle2['default'](s.style);
19415 });
19416 var oldCurrentVelocities = defaultStyles == null ? destStyles.map(function (s) {
19417 return _mapToZero2['default'](s.style);
19418 }) : defaultStyles.map(function (s) {
19419 return _mapToZero2['default'](s.style);
19420 });
19421
19422 var _mergeAndSync3 = mergeAndSync(
19423 // Because this is an old-style createReactClass component, Flow doesn't
19424 // understand that the willEnter and willLeave props have default values
19425 // and will always be present.
19426 willEnter, willLeave, didLeave, oldMergedPropsStyles, destStyles, oldCurrentStyles, oldCurrentVelocities, oldCurrentStyles, // oldLastIdealStyles really
19427 oldCurrentVelocities);
19428
19429 var mergedPropsStyles = _mergeAndSync3[0];
19430 var currentStyles = _mergeAndSync3[1];
19431 var currentVelocities = _mergeAndSync3[2];
19432 var lastIdealStyles = _mergeAndSync3[3];
19433 var lastIdealVelocities = _mergeAndSync3[4];
19434 // oldLastIdealVelocities really
19435
19436 return {
19437 currentStyles: currentStyles,
19438 currentVelocities: currentVelocities,
19439 lastIdealStyles: lastIdealStyles,
19440 lastIdealVelocities: lastIdealVelocities,
19441 mergedPropsStyles: mergedPropsStyles
19442 };
19443 };
19444
19445 // after checking for unreadPropStyles != null, we manually go set the
19446 // non-interpolating values (those that are a number, without a spring
19447 // config)
19448
19449 TransitionMotion.prototype.componentDidMount = function componentDidMount() {
19450 this.prevTime = _performanceNow2['default']();
19451 this.startAnimationIfNecessary();
19452 };
19453
19454 TransitionMotion.prototype.componentWillReceiveProps = function componentWillReceiveProps(props) {
19455 if (this.unreadPropStyles) {
19456 // previous props haven't had the chance to be set yet; set them here
19457 this.clearUnreadPropStyle(this.unreadPropStyles);
19458 }
19459
19460 var styles = props.styles;
19461 if (typeof styles === 'function') {
19462 this.unreadPropStyles = styles(rehydrateStyles(this.state.mergedPropsStyles, this.unreadPropStyles, this.state.lastIdealStyles));
19463 } else {
19464 this.unreadPropStyles = styles;
19465 }
19466
19467 if (this.animationID == null) {
19468 this.prevTime = _performanceNow2['default']();
19469 this.startAnimationIfNecessary();
19470 }
19471 };
19472
19473 TransitionMotion.prototype.componentWillUnmount = function componentWillUnmount() {
19474 this.unmounting = true;
19475 if (this.animationID != null) {
19476 _raf2['default'].cancel(this.animationID);
19477 this.animationID = null;
19478 }
19479 };
19480
19481 TransitionMotion.prototype.render = function render() {
19482 var hydratedStyles = rehydrateStyles(this.state.mergedPropsStyles, this.unreadPropStyles, this.state.currentStyles);
19483 var renderedChildren = this.props.children(hydratedStyles);
19484 return renderedChildren && _react2['default'].Children.only(renderedChildren);
19485 };
19486
19487 return TransitionMotion;
19488 })(_react2['default'].Component);
19489
19490 exports['default'] = TransitionMotion;
19491 module.exports = exports['default'];
19492
19493 // list of styles, each containing interpolating values. Part of what's passed
19494 // to children function. Notice that this is
19495 // Array<ActualInterpolatingStyleObject>, without the wrapper that is {key: ...,
19496 // data: ... style: ActualInterpolatingStyleObject}. Only mergedPropsStyles
19497 // contains the key & data info (so that we only have a single source of truth
19498 // for these, and to save space). Check the comment for `rehydrateStyles` to
19499 // see how we regenerate the entirety of what's passed to children function
19500
19501 // the array that keeps track of currently rendered stuff! Including stuff
19502 // that you've unmounted but that's still animating. This is where it lives
19503
19504 // it's possible that currentStyle's value is stale: if props is immediately
19505 // changed from 0 to 400 to spring(0) again, the async currentStyle is still
19506 // at 0 (didn't have time to tick and interpolate even once). If we naively
19507 // compare currentStyle with destVal it'll be 0 === 0 (no animation, stop).
19508 // In reality currentStyle should be 400
19509
19510/***/ }),
19511/* 182 */
19512/***/ (function(module, exports) {
19513
19514
19515
19516 // core keys merging algorithm. If previous render's keys are [a, b], and the
19517 // next render's [c, b, d], what's the final merged keys and ordering?
19518
19519 // - c and a must both be before b
19520 // - b before d
19521 // - ordering between a and c ambiguous
19522
19523 // this reduces to merging two partially ordered lists (e.g. lists where not
19524 // every item has a definite ordering, like comparing a and c above). For the
19525 // ambiguous ordering we deterministically choose to place the next render's
19526 // item after the previous'; so c after a
19527
19528 // this is called a topological sorting. Except the existing algorithms don't
19529 // work well with js bc of the amount of allocation, and isn't optimized for our
19530 // current use-case bc the runtime is linear in terms of edges (see wiki for
19531 // meaning), which is huge when two lists have many common elements
19532 'use strict';
19533
19534 exports.__esModule = true;
19535 exports['default'] = mergeDiff;
19536
19537 function mergeDiff(prev, next, onRemove) {
19538 // bookkeeping for easier access of a key's index below. This is 2 allocations +
19539 // potentially triggering chrome hash map mode for objs (so it might be faster
19540
19541 var prevKeyIndex = {};
19542 for (var i = 0; i < prev.length; i++) {
19543 prevKeyIndex[prev[i].key] = i;
19544 }
19545 var nextKeyIndex = {};
19546 for (var i = 0; i < next.length; i++) {
19547 nextKeyIndex[next[i].key] = i;
19548 }
19549
19550 // first, an overly elaborate way of merging prev and next, eliminating
19551 // duplicates (in terms of keys). If there's dupe, keep the item in next).
19552 // This way of writing it saves allocations
19553 var ret = [];
19554 for (var i = 0; i < next.length; i++) {
19555 ret[i] = next[i];
19556 }
19557 for (var i = 0; i < prev.length; i++) {
19558 if (!Object.prototype.hasOwnProperty.call(nextKeyIndex, prev[i].key)) {
19559 // this is called my TM's `mergeAndSync`, which calls willLeave. We don't
19560 // merge in keys that the user desires to kill
19561 var fill = onRemove(i, prev[i]);
19562 if (fill != null) {
19563 ret.push(fill);
19564 }
19565 }
19566 }
19567
19568 // now all the items all present. Core sorting logic to have the right order
19569 return ret.sort(function (a, b) {
19570 var nextOrderA = nextKeyIndex[a.key];
19571 var nextOrderB = nextKeyIndex[b.key];
19572 var prevOrderA = prevKeyIndex[a.key];
19573 var prevOrderB = prevKeyIndex[b.key];
19574
19575 if (nextOrderA != null && nextOrderB != null) {
19576 // both keys in next
19577 return nextKeyIndex[a.key] - nextKeyIndex[b.key];
19578 } else if (prevOrderA != null && prevOrderB != null) {
19579 // both keys in prev
19580 return prevKeyIndex[a.key] - prevKeyIndex[b.key];
19581 } else if (nextOrderA != null) {
19582 // key a in next, key b in prev
19583
19584 // how to determine the order between a and b? We find a "pivot" (term
19585 // abuse), a key present in both prev and next, that is sandwiched between
19586 // a and b. In the context of our above example, if we're comparing a and
19587 // d, b's (the only) pivot
19588 for (var i = 0; i < next.length; i++) {
19589 var pivot = next[i].key;
19590 if (!Object.prototype.hasOwnProperty.call(prevKeyIndex, pivot)) {
19591 continue;
19592 }
19593
19594 if (nextOrderA < nextKeyIndex[pivot] && prevOrderB > prevKeyIndex[pivot]) {
19595 return -1;
19596 } else if (nextOrderA > nextKeyIndex[pivot] && prevOrderB < prevKeyIndex[pivot]) {
19597 return 1;
19598 }
19599 }
19600 // pluggable. default to: next bigger than prev
19601 return 1;
19602 }
19603 // prevOrderA, nextOrderB
19604 for (var i = 0; i < next.length; i++) {
19605 var pivot = next[i].key;
19606 if (!Object.prototype.hasOwnProperty.call(prevKeyIndex, pivot)) {
19607 continue;
19608 }
19609 if (nextOrderB < nextKeyIndex[pivot] && prevOrderA > prevKeyIndex[pivot]) {
19610 return 1;
19611 } else if (nextOrderB > nextKeyIndex[pivot] && prevOrderA < prevKeyIndex[pivot]) {
19612 return -1;
19613 }
19614 }
19615 // pluggable. default to: next bigger than prev
19616 return -1;
19617 });
19618 }
19619
19620 module.exports = exports['default'];
19621 // to loop through and find a key's index each time), but I no longer care
19622
19623/***/ }),
19624/* 183 */
19625/***/ (function(module, exports, __webpack_require__) {
19626
19627 'use strict';
19628
19629 exports.__esModule = true;
19630
19631 var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
19632
19633 exports['default'] = spring;
19634
19635 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
19636
19637 var _presets = __webpack_require__(184);
19638
19639 var _presets2 = _interopRequireDefault(_presets);
19640
19641 var defaultConfig = _extends({}, _presets2['default'].noWobble, {
19642 precision: 0.01
19643 });
19644
19645 function spring(val, config) {
19646 return _extends({}, defaultConfig, config, { val: val });
19647 }
19648
19649 module.exports = exports['default'];
19650
19651/***/ }),
19652/* 184 */
19653/***/ (function(module, exports) {
19654
19655 "use strict";
19656
19657 exports.__esModule = true;
19658 exports["default"] = {
19659 noWobble: { stiffness: 170, damping: 26 }, // the default, if nothing provided
19660 gentle: { stiffness: 120, damping: 14 },
19661 wobbly: { stiffness: 180, damping: 12 },
19662 stiff: { stiffness: 210, damping: 20 }
19663 };
19664 module.exports = exports["default"];
19665
19666/***/ }),
19667/* 185 */
19668/***/ (function(module, exports, __webpack_require__) {
19669
19670 /* WEBPACK VAR INJECTION */(function(process) {'use strict';
19671
19672 exports.__esModule = true;
19673 exports['default'] = reorderKeys;
19674
19675 var hasWarned = false;
19676
19677 function reorderKeys() {
19678 if (process.env.NODE_ENV === 'development') {
19679 if (!hasWarned) {
19680 hasWarned = true;
19681 console.error('`reorderKeys` has been removed, since it is no longer needed for TransitionMotion\'s new styles array API.');
19682 }
19683 }
19684 }
19685
19686 module.exports = exports['default'];
19687 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(33)))
19688
19689/***/ }),
19690/* 186 */
19691/***/ (function(module, exports, __webpack_require__) {
19692
19693 (function (global, factory) {
19694 true ? module.exports = factory(__webpack_require__(12), __webpack_require__(4)) :
19695 typeof define === 'function' && define.amd ? define(['react-dom', 'react'], factory) :
19696 (global.ReactDraggable = factory(global.ReactDOM,global.React));
19697 }(this, (function (ReactDOM,React) { 'use strict';
19698
19699 ReactDOM = ReactDOM && ReactDOM.hasOwnProperty('default') ? ReactDOM['default'] : ReactDOM;
19700 React = React && React.hasOwnProperty('default') ? React['default'] : React;
19701
19702 function createCommonjsModule(fn, module) {
19703 return module = { exports: {} }, fn(module, module.exports), module.exports;
19704 }
19705
19706 /**
19707 * Copyright (c) 2013-present, Facebook, Inc.
19708 *
19709 * This source code is licensed under the MIT license found in the
19710 * LICENSE file in the root directory of this source tree.
19711 *
19712 *
19713 */
19714
19715 function makeEmptyFunction(arg) {
19716 return function () {
19717 return arg;
19718 };
19719 }
19720
19721 /**
19722 * This function accepts and discards inputs; it has no side effects. This is
19723 * primarily useful idiomatically for overridable function endpoints which
19724 * always need to be callable, since JS lacks a null-call idiom ala Cocoa.
19725 */
19726 var emptyFunction = function emptyFunction() {};
19727
19728 emptyFunction.thatReturns = makeEmptyFunction;
19729 emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
19730 emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
19731 emptyFunction.thatReturnsNull = makeEmptyFunction(null);
19732 emptyFunction.thatReturnsThis = function () {
19733 return this;
19734 };
19735 emptyFunction.thatReturnsArgument = function (arg) {
19736 return arg;
19737 };
19738
19739 var emptyFunction_1 = emptyFunction;
19740
19741 /**
19742 * Copyright (c) 2013-present, Facebook, Inc.
19743 *
19744 * This source code is licensed under the MIT license found in the
19745 * LICENSE file in the root directory of this source tree.
19746 *
19747 */
19748
19749 /**
19750 * Use invariant() to assert state which your program assumes to be true.
19751 *
19752 * Provide sprintf-style format (only %s is supported) and arguments
19753 * to provide information about what broke and what you were
19754 * expecting.
19755 *
19756 * The invariant message will be stripped in production, but the invariant
19757 * will remain to ensure logic does not differ in production.
19758 */
19759
19760 var validateFormat = function validateFormat(format) {};
19761
19762 {
19763 validateFormat = function validateFormat(format) {
19764 if (format === undefined) {
19765 throw new Error('invariant requires an error message argument');
19766 }
19767 };
19768 }
19769
19770 function invariant(condition, format, a, b, c, d, e, f) {
19771 validateFormat(format);
19772
19773 if (!condition) {
19774 var error;
19775 if (format === undefined) {
19776 error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
19777 } else {
19778 var args = [a, b, c, d, e, f];
19779 var argIndex = 0;
19780 error = new Error(format.replace(/%s/g, function () {
19781 return args[argIndex++];
19782 }));
19783 error.name = 'Invariant Violation';
19784 }
19785
19786 error.framesToPop = 1; // we don't care about invariant's own frame
19787 throw error;
19788 }
19789 }
19790
19791 var invariant_1 = invariant;
19792
19793 /**
19794 * Similar to invariant but only logs a warning if the condition is not met.
19795 * This can be used to log issues in development environments in critical
19796 * paths. Removing the logging code for production environments will keep the
19797 * same logic and follow the same code paths.
19798 */
19799
19800 var warning = emptyFunction_1;
19801
19802 {
19803 var printWarning = function printWarning(format) {
19804 for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
19805 args[_key - 1] = arguments[_key];
19806 }
19807
19808 var argIndex = 0;
19809 var message = 'Warning: ' + format.replace(/%s/g, function () {
19810 return args[argIndex++];
19811 });
19812 if (typeof console !== 'undefined') {
19813 console.error(message);
19814 }
19815 try {
19816 // --- Welcome to debugging React ---
19817 // This error was thrown as a convenience so that you can use this stack
19818 // to find the callsite that caused this warning to fire.
19819 throw new Error(message);
19820 } catch (x) {}
19821 };
19822
19823 warning = function warning(condition, format) {
19824 if (format === undefined) {
19825 throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
19826 }
19827
19828 if (format.indexOf('Failed Composite propType: ') === 0) {
19829 return; // Ignore CompositeComponent proptype check.
19830 }
19831
19832 if (!condition) {
19833 for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
19834 args[_key2 - 2] = arguments[_key2];
19835 }
19836
19837 printWarning.apply(undefined, [format].concat(args));
19838 }
19839 };
19840 }
19841
19842 var warning_1 = warning;
19843
19844 /*
19845 object-assign
19846 (c) Sindre Sorhus
19847 @license MIT
19848 */
19849 /* eslint-disable no-unused-vars */
19850 var getOwnPropertySymbols = Object.getOwnPropertySymbols;
19851 var hasOwnProperty = Object.prototype.hasOwnProperty;
19852 var propIsEnumerable = Object.prototype.propertyIsEnumerable;
19853
19854 function toObject(val) {
19855 if (val === null || val === undefined) {
19856 throw new TypeError('Object.assign cannot be called with null or undefined');
19857 }
19858
19859 return Object(val);
19860 }
19861
19862 function shouldUseNative() {
19863 try {
19864 if (!Object.assign) {
19865 return false;
19866 }
19867
19868 // Detect buggy property enumeration order in older V8 versions.
19869
19870 // https://bugs.chromium.org/p/v8/issues/detail?id=4118
19871 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
19872 test1[5] = 'de';
19873 if (Object.getOwnPropertyNames(test1)[0] === '5') {
19874 return false;
19875 }
19876
19877 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
19878 var test2 = {};
19879 for (var i = 0; i < 10; i++) {
19880 test2['_' + String.fromCharCode(i)] = i;
19881 }
19882 var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
19883 return test2[n];
19884 });
19885 if (order2.join('') !== '0123456789') {
19886 return false;
19887 }
19888
19889 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
19890 var test3 = {};
19891 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
19892 test3[letter] = letter;
19893 });
19894 if (Object.keys(Object.assign({}, test3)).join('') !==
19895 'abcdefghijklmnopqrst') {
19896 return false;
19897 }
19898
19899 return true;
19900 } catch (err) {
19901 // We don't expect any of the above to throw, but better to be safe.
19902 return false;
19903 }
19904 }
19905
19906 var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
19907 var from;
19908 var to = toObject(target);
19909 var symbols;
19910
19911 for (var s = 1; s < arguments.length; s++) {
19912 from = Object(arguments[s]);
19913
19914 for (var key in from) {
19915 if (hasOwnProperty.call(from, key)) {
19916 to[key] = from[key];
19917 }
19918 }
19919
19920 if (getOwnPropertySymbols) {
19921 symbols = getOwnPropertySymbols(from);
19922 for (var i = 0; i < symbols.length; i++) {
19923 if (propIsEnumerable.call(from, symbols[i])) {
19924 to[symbols[i]] = from[symbols[i]];
19925 }
19926 }
19927 }
19928 }
19929
19930 return to;
19931 };
19932
19933 /**
19934 * Copyright (c) 2013-present, Facebook, Inc.
19935 *
19936 * This source code is licensed under the MIT license found in the
19937 * LICENSE file in the root directory of this source tree.
19938 */
19939
19940 var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
19941
19942 var ReactPropTypesSecret_1 = ReactPropTypesSecret;
19943
19944 {
19945 var invariant$1 = invariant_1;
19946 var warning$1 = warning_1;
19947 var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
19948 var loggedTypeFailures = {};
19949 }
19950
19951 /**
19952 * Assert that the values match with the type specs.
19953 * Error messages are memorized and will only be shown once.
19954 *
19955 * @param {object} typeSpecs Map of name to a ReactPropType
19956 * @param {object} values Runtime values that need to be type-checked
19957 * @param {string} location e.g. "prop", "context", "child context"
19958 * @param {string} componentName Name of the component for error messages.
19959 * @param {?Function} getStack Returns the component stack.
19960 * @private
19961 */
19962 function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
19963 {
19964 for (var typeSpecName in typeSpecs) {
19965 if (typeSpecs.hasOwnProperty(typeSpecName)) {
19966 var error;
19967 // Prop type validation may throw. In case they do, we don't want to
19968 // fail the render phase where it didn't fail before. So we log it.
19969 // After these have been cleaned up, we'll let them throw.
19970 try {
19971 // This is intentionally an invariant that gets caught. It's the same
19972 // behavior as without this statement except with a better message.
19973 invariant$1(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'the `prop-types` package, but received `%s`.', componentName || 'React class', location, typeSpecName, typeof typeSpecs[typeSpecName]);
19974 error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$1);
19975 } catch (ex) {
19976 error = ex;
19977 }
19978 warning$1(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);
19979 if (error instanceof Error && !(error.message in loggedTypeFailures)) {
19980 // Only monitor this failure once because there tends to be a lot of the
19981 // same error.
19982 loggedTypeFailures[error.message] = true;
19983
19984 var stack = getStack ? getStack() : '';
19985
19986 warning$1(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');
19987 }
19988 }
19989 }
19990 }
19991 }
19992
19993 var checkPropTypes_1 = checkPropTypes;
19994
19995 var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
19996 /* global Symbol */
19997 var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
19998 var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
19999
20000 /**
20001 * Returns the iterator method function contained on the iterable object.
20002 *
20003 * Be sure to invoke the function with the iterable as context:
20004 *
20005 * var iteratorFn = getIteratorFn(myIterable);
20006 * if (iteratorFn) {
20007 * var iterator = iteratorFn.call(myIterable);
20008 * ...
20009 * }
20010 *
20011 * @param {?object} maybeIterable
20012 * @return {?function}
20013 */
20014 function getIteratorFn(maybeIterable) {
20015 var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
20016 if (typeof iteratorFn === 'function') {
20017 return iteratorFn;
20018 }
20019 }
20020
20021 /**
20022 * Collection of methods that allow declaration and validation of props that are
20023 * supplied to React components. Example usage:
20024 *
20025 * var Props = require('ReactPropTypes');
20026 * var MyArticle = React.createClass({
20027 * propTypes: {
20028 * // An optional string prop named "description".
20029 * description: Props.string,
20030 *
20031 * // A required enum prop named "category".
20032 * category: Props.oneOf(['News','Photos']).isRequired,
20033 *
20034 * // A prop named "dialog" that requires an instance of Dialog.
20035 * dialog: Props.instanceOf(Dialog).isRequired
20036 * },
20037 * render: function() { ... }
20038 * });
20039 *
20040 * A more formal specification of how these methods are used:
20041 *
20042 * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
20043 * decl := ReactPropTypes.{type}(.isRequired)?
20044 *
20045 * Each and every declaration produces a function with the same signature. This
20046 * allows the creation of custom validation functions. For example:
20047 *
20048 * var MyLink = React.createClass({
20049 * propTypes: {
20050 * // An optional string or URI prop named "href".
20051 * href: function(props, propName, componentName) {
20052 * var propValue = props[propName];
20053 * if (propValue != null && typeof propValue !== 'string' &&
20054 * !(propValue instanceof URI)) {
20055 * return new Error(
20056 * 'Expected a string or an URI for ' + propName + ' in ' +
20057 * componentName
20058 * );
20059 * }
20060 * }
20061 * },
20062 * render: function() {...}
20063 * });
20064 *
20065 * @internal
20066 */
20067
20068 var ANONYMOUS = '<<anonymous>>';
20069
20070 // Important!
20071 // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
20072 var ReactPropTypes = {
20073 array: createPrimitiveTypeChecker('array'),
20074 bool: createPrimitiveTypeChecker('boolean'),
20075 func: createPrimitiveTypeChecker('function'),
20076 number: createPrimitiveTypeChecker('number'),
20077 object: createPrimitiveTypeChecker('object'),
20078 string: createPrimitiveTypeChecker('string'),
20079 symbol: createPrimitiveTypeChecker('symbol'),
20080
20081 any: createAnyTypeChecker(),
20082 arrayOf: createArrayOfTypeChecker,
20083 element: createElementTypeChecker(),
20084 instanceOf: createInstanceTypeChecker,
20085 node: createNodeChecker(),
20086 objectOf: createObjectOfTypeChecker,
20087 oneOf: createEnumTypeChecker,
20088 oneOfType: createUnionTypeChecker,
20089 shape: createShapeTypeChecker,
20090 exact: createStrictShapeTypeChecker,
20091 };
20092
20093 /**
20094 * inlined Object.is polyfill to avoid requiring consumers ship their own
20095 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
20096 */
20097 /*eslint-disable no-self-compare*/
20098 function is(x, y) {
20099 // SameValue algorithm
20100 if (x === y) {
20101 // Steps 1-5, 7-10
20102 // Steps 6.b-6.e: +0 != -0
20103 return x !== 0 || 1 / x === 1 / y;
20104 } else {
20105 // Step 6.a: NaN == NaN
20106 return x !== x && y !== y;
20107 }
20108 }
20109 /*eslint-enable no-self-compare*/
20110
20111 /**
20112 * We use an Error-like object for backward compatibility as people may call
20113 * PropTypes directly and inspect their output. However, we don't use real
20114 * Errors anymore. We don't inspect their stack anyway, and creating them
20115 * is prohibitively expensive if they are created too often, such as what
20116 * happens in oneOfType() for any type before the one that matched.
20117 */
20118 function PropTypeError(message) {
20119 this.message = message;
20120 this.stack = '';
20121 }
20122 // Make `instanceof Error` still work for returned errors.
20123 PropTypeError.prototype = Error.prototype;
20124
20125 function createChainableTypeChecker(validate) {
20126 {
20127 var manualPropTypeCallCache = {};
20128 var manualPropTypeWarningCount = 0;
20129 }
20130 function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
20131 componentName = componentName || ANONYMOUS;
20132 propFullName = propFullName || propName;
20133
20134 if (secret !== ReactPropTypesSecret_1) {
20135 if (throwOnDirectAccess) {
20136 // New behavior only for users of `prop-types` package
20137 invariant_1(
20138 false,
20139 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
20140 'Use `PropTypes.checkPropTypes()` to call them. ' +
20141 'Read more at http://fb.me/use-check-prop-types'
20142 );
20143 } else if ("development" !== 'production' && typeof console !== 'undefined') {
20144 // Old behavior for people using React.PropTypes
20145 var cacheKey = componentName + ':' + propName;
20146 if (
20147 !manualPropTypeCallCache[cacheKey] &&
20148 // Avoid spamming the console because they are often not actionable except for lib authors
20149 manualPropTypeWarningCount < 3
20150 ) {
20151 warning_1(
20152 false,
20153 'You are manually calling a React.PropTypes validation ' +
20154 'function for the `%s` prop on `%s`. This is deprecated ' +
20155 'and will throw in the standalone `prop-types` package. ' +
20156 'You may be seeing this warning due to a third-party PropTypes ' +
20157 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.',
20158 propFullName,
20159 componentName
20160 );
20161 manualPropTypeCallCache[cacheKey] = true;
20162 manualPropTypeWarningCount++;
20163 }
20164 }
20165 }
20166 if (props[propName] == null) {
20167 if (isRequired) {
20168 if (props[propName] === null) {
20169 return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
20170 }
20171 return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
20172 }
20173 return null;
20174 } else {
20175 return validate(props, propName, componentName, location, propFullName);
20176 }
20177 }
20178
20179 var chainedCheckType = checkType.bind(null, false);
20180 chainedCheckType.isRequired = checkType.bind(null, true);
20181
20182 return chainedCheckType;
20183 }
20184
20185 function createPrimitiveTypeChecker(expectedType) {
20186 function validate(props, propName, componentName, location, propFullName, secret) {
20187 var propValue = props[propName];
20188 var propType = getPropType(propValue);
20189 if (propType !== expectedType) {
20190 // `propValue` being instance of, say, date/regexp, pass the 'object'
20191 // check, but we can offer a more precise error message here rather than
20192 // 'of type `object`'.
20193 var preciseType = getPreciseType(propValue);
20194
20195 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
20196 }
20197 return null;
20198 }
20199 return createChainableTypeChecker(validate);
20200 }
20201
20202 function createAnyTypeChecker() {
20203 return createChainableTypeChecker(emptyFunction_1.thatReturnsNull);
20204 }
20205
20206 function createArrayOfTypeChecker(typeChecker) {
20207 function validate(props, propName, componentName, location, propFullName) {
20208 if (typeof typeChecker !== 'function') {
20209 return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
20210 }
20211 var propValue = props[propName];
20212 if (!Array.isArray(propValue)) {
20213 var propType = getPropType(propValue);
20214 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
20215 }
20216 for (var i = 0; i < propValue.length; i++) {
20217 var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret_1);
20218 if (error instanceof Error) {
20219 return error;
20220 }
20221 }
20222 return null;
20223 }
20224 return createChainableTypeChecker(validate);
20225 }
20226
20227 function createElementTypeChecker() {
20228 function validate(props, propName, componentName, location, propFullName) {
20229 var propValue = props[propName];
20230 if (!isValidElement(propValue)) {
20231 var propType = getPropType(propValue);
20232 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
20233 }
20234 return null;
20235 }
20236 return createChainableTypeChecker(validate);
20237 }
20238
20239 function createInstanceTypeChecker(expectedClass) {
20240 function validate(props, propName, componentName, location, propFullName) {
20241 if (!(props[propName] instanceof expectedClass)) {
20242 var expectedClassName = expectedClass.name || ANONYMOUS;
20243 var actualClassName = getClassName(props[propName]);
20244 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
20245 }
20246 return null;
20247 }
20248 return createChainableTypeChecker(validate);
20249 }
20250
20251 function createEnumTypeChecker(expectedValues) {
20252 if (!Array.isArray(expectedValues)) {
20253 warning_1(false, 'Invalid argument supplied to oneOf, expected an instance of array.');
20254 return emptyFunction_1.thatReturnsNull;
20255 }
20256
20257 function validate(props, propName, componentName, location, propFullName) {
20258 var propValue = props[propName];
20259 for (var i = 0; i < expectedValues.length; i++) {
20260 if (is(propValue, expectedValues[i])) {
20261 return null;
20262 }
20263 }
20264
20265 var valuesString = JSON.stringify(expectedValues);
20266 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
20267 }
20268 return createChainableTypeChecker(validate);
20269 }
20270
20271 function createObjectOfTypeChecker(typeChecker) {
20272 function validate(props, propName, componentName, location, propFullName) {
20273 if (typeof typeChecker !== 'function') {
20274 return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
20275 }
20276 var propValue = props[propName];
20277 var propType = getPropType(propValue);
20278 if (propType !== 'object') {
20279 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
20280 }
20281 for (var key in propValue) {
20282 if (propValue.hasOwnProperty(key)) {
20283 var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
20284 if (error instanceof Error) {
20285 return error;
20286 }
20287 }
20288 }
20289 return null;
20290 }
20291 return createChainableTypeChecker(validate);
20292 }
20293
20294 function createUnionTypeChecker(arrayOfTypeCheckers) {
20295 if (!Array.isArray(arrayOfTypeCheckers)) {
20296 warning_1(false, 'Invalid argument supplied to oneOfType, expected an instance of array.');
20297 return emptyFunction_1.thatReturnsNull;
20298 }
20299
20300 for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
20301 var checker = arrayOfTypeCheckers[i];
20302 if (typeof checker !== 'function') {
20303 warning_1(
20304 false,
20305 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
20306 'received %s at index %s.',
20307 getPostfixForTypeWarning(checker),
20308 i
20309 );
20310 return emptyFunction_1.thatReturnsNull;
20311 }
20312 }
20313
20314 function validate(props, propName, componentName, location, propFullName) {
20315 for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
20316 var checker = arrayOfTypeCheckers[i];
20317 if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret_1) == null) {
20318 return null;
20319 }
20320 }
20321
20322 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
20323 }
20324 return createChainableTypeChecker(validate);
20325 }
20326
20327 function createNodeChecker() {
20328 function validate(props, propName, componentName, location, propFullName) {
20329 if (!isNode(props[propName])) {
20330 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
20331 }
20332 return null;
20333 }
20334 return createChainableTypeChecker(validate);
20335 }
20336
20337 function createShapeTypeChecker(shapeTypes) {
20338 function validate(props, propName, componentName, location, propFullName) {
20339 var propValue = props[propName];
20340 var propType = getPropType(propValue);
20341 if (propType !== 'object') {
20342 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
20343 }
20344 for (var key in shapeTypes) {
20345 var checker = shapeTypes[key];
20346 if (!checker) {
20347 continue;
20348 }
20349 var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
20350 if (error) {
20351 return error;
20352 }
20353 }
20354 return null;
20355 }
20356 return createChainableTypeChecker(validate);
20357 }
20358
20359 function createStrictShapeTypeChecker(shapeTypes) {
20360 function validate(props, propName, componentName, location, propFullName) {
20361 var propValue = props[propName];
20362 var propType = getPropType(propValue);
20363 if (propType !== 'object') {
20364 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
20365 }
20366 // We need to check all keys in case some are required but missing from
20367 // props.
20368 var allKeys = objectAssign({}, props[propName], shapeTypes);
20369 for (var key in allKeys) {
20370 var checker = shapeTypes[key];
20371 if (!checker) {
20372 return new PropTypeError(
20373 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
20374 '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
20375 '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
20376 );
20377 }
20378 var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
20379 if (error) {
20380 return error;
20381 }
20382 }
20383 return null;
20384 }
20385
20386 return createChainableTypeChecker(validate);
20387 }
20388
20389 function isNode(propValue) {
20390 switch (typeof propValue) {
20391 case 'number':
20392 case 'string':
20393 case 'undefined':
20394 return true;
20395 case 'boolean':
20396 return !propValue;
20397 case 'object':
20398 if (Array.isArray(propValue)) {
20399 return propValue.every(isNode);
20400 }
20401 if (propValue === null || isValidElement(propValue)) {
20402 return true;
20403 }
20404
20405 var iteratorFn = getIteratorFn(propValue);
20406 if (iteratorFn) {
20407 var iterator = iteratorFn.call(propValue);
20408 var step;
20409 if (iteratorFn !== propValue.entries) {
20410 while (!(step = iterator.next()).done) {
20411 if (!isNode(step.value)) {
20412 return false;
20413 }
20414 }
20415 } else {
20416 // Iterator will provide entry [k,v] tuples rather than values.
20417 while (!(step = iterator.next()).done) {
20418 var entry = step.value;
20419 if (entry) {
20420 if (!isNode(entry[1])) {
20421 return false;
20422 }
20423 }
20424 }
20425 }
20426 } else {
20427 return false;
20428 }
20429
20430 return true;
20431 default:
20432 return false;
20433 }
20434 }
20435
20436 function isSymbol(propType, propValue) {
20437 // Native Symbol.
20438 if (propType === 'symbol') {
20439 return true;
20440 }
20441
20442 // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
20443 if (propValue['@@toStringTag'] === 'Symbol') {
20444 return true;
20445 }
20446
20447 // Fallback for non-spec compliant Symbols which are polyfilled.
20448 if (typeof Symbol === 'function' && propValue instanceof Symbol) {
20449 return true;
20450 }
20451
20452 return false;
20453 }
20454
20455 // Equivalent of `typeof` but with special handling for array and regexp.
20456 function getPropType(propValue) {
20457 var propType = typeof propValue;
20458 if (Array.isArray(propValue)) {
20459 return 'array';
20460 }
20461 if (propValue instanceof RegExp) {
20462 // Old webkits (at least until Android 4.0) return 'function' rather than
20463 // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
20464 // passes PropTypes.object.
20465 return 'object';
20466 }
20467 if (isSymbol(propType, propValue)) {
20468 return 'symbol';
20469 }
20470 return propType;
20471 }
20472
20473 // This handles more types than `getPropType`. Only used for error messages.
20474 // See `createPrimitiveTypeChecker`.
20475 function getPreciseType(propValue) {
20476 if (typeof propValue === 'undefined' || propValue === null) {
20477 return '' + propValue;
20478 }
20479 var propType = getPropType(propValue);
20480 if (propType === 'object') {
20481 if (propValue instanceof Date) {
20482 return 'date';
20483 } else if (propValue instanceof RegExp) {
20484 return 'regexp';
20485 }
20486 }
20487 return propType;
20488 }
20489
20490 // Returns a string that is postfixed to a warning about an invalid type.
20491 // For example, "undefined" or "of type array"
20492 function getPostfixForTypeWarning(value) {
20493 var type = getPreciseType(value);
20494 switch (type) {
20495 case 'array':
20496 case 'object':
20497 return 'an ' + type;
20498 case 'boolean':
20499 case 'date':
20500 case 'regexp':
20501 return 'a ' + type;
20502 default:
20503 return type;
20504 }
20505 }
20506
20507 // Returns class name of the object, if any.
20508 function getClassName(propValue) {
20509 if (!propValue.constructor || !propValue.constructor.name) {
20510 return ANONYMOUS;
20511 }
20512 return propValue.constructor.name;
20513 }
20514
20515 ReactPropTypes.checkPropTypes = checkPropTypes_1;
20516 ReactPropTypes.PropTypes = ReactPropTypes;
20517
20518 return ReactPropTypes;
20519 };
20520
20521 var propTypes = createCommonjsModule(function (module) {
20522 /**
20523 * Copyright (c) 2013-present, Facebook, Inc.
20524 *
20525 * This source code is licensed under the MIT license found in the
20526 * LICENSE file in the root directory of this source tree.
20527 */
20528
20529 {
20530 var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&
20531 Symbol.for &&
20532 Symbol.for('react.element')) ||
20533 0xeac7;
20534
20535 var isValidElement = function(object) {
20536 return typeof object === 'object' &&
20537 object !== null &&
20538 object.$$typeof === REACT_ELEMENT_TYPE;
20539 };
20540
20541 // By explicitly using `prop-types` you are opting into new development behavior.
20542 // http://fb.me/prop-types-in-prod
20543 var throwOnDirectAccess = true;
20544 module.exports = factoryWithTypeCheckers(isValidElement, throwOnDirectAccess);
20545 }
20546 });
20547
20548 var classnames = createCommonjsModule(function (module) {
20549 /*!
20550 Copyright (c) 2016 Jed Watson.
20551 Licensed under the MIT License (MIT), see
20552 http://jedwatson.github.io/classnames
20553 */
20554 /* global define */
20555
20556 (function () {
20557
20558 var hasOwn = {}.hasOwnProperty;
20559
20560 function classNames () {
20561 var classes = [];
20562
20563 for (var i = 0; i < arguments.length; i++) {
20564 var arg = arguments[i];
20565 if (!arg) continue;
20566
20567 var argType = typeof arg;
20568
20569 if (argType === 'string' || argType === 'number') {
20570 classes.push(arg);
20571 } else if (Array.isArray(arg)) {
20572 classes.push(classNames.apply(null, arg));
20573 } else if (argType === 'object') {
20574 for (var key in arg) {
20575 if (hasOwn.call(arg, key) && arg[key]) {
20576 classes.push(key);
20577 }
20578 }
20579 }
20580 }
20581
20582 return classes.join(' ');
20583 }
20584
20585 if ('object' !== 'undefined' && module.exports) {
20586 module.exports = classNames;
20587 } else if (false) {
20588 // register as 'classnames', consistent with npm package name
20589 undefined('classnames', [], function () {
20590 return classNames;
20591 });
20592 } else {
20593 window.classNames = classNames;
20594 }
20595 }());
20596 });
20597
20598 // @credits https://gist.github.com/rogozhnikoff/a43cfed27c41e4e68cdc
20599 function findInArray(array /*: Array<any> | TouchList*/, callback /*: Function*/) /*: any*/ {
20600 for (var i = 0, length = array.length; i < length; i++) {
20601 if (callback.apply(callback, [array[i], i, array])) return array[i];
20602 }
20603 }
20604
20605 function isFunction(func /*: any*/) /*: boolean*/ {
20606 return typeof func === 'function' || Object.prototype.toString.call(func) === '[object Function]';
20607 }
20608
20609 function isNum(num /*: any*/) /*: boolean*/ {
20610 return typeof num === 'number' && !isNaN(num);
20611 }
20612
20613 function int(a /*: string*/) /*: number*/ {
20614 return parseInt(a, 10);
20615 }
20616
20617 function dontSetMe(props /*: Object*/, propName /*: string*/, componentName /*: string*/) {
20618 if (props[propName]) {
20619 return new Error('Invalid prop ' + propName + ' passed to ' + componentName + ' - do not set this, set it on the child.');
20620 }
20621 }
20622
20623 var prefixes = ['Moz', 'Webkit', 'O', 'ms'];
20624 function getPrefix() /*: string*/ {
20625 var prop /*: string*/ = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'transform';
20626
20627 // Checking specifically for 'window.document' is for pseudo-browser server-side
20628 // environments that define 'window' as the global context.
20629 // E.g. React-rails (see https://github.com/reactjs/react-rails/pull/84)
20630 if (typeof window === 'undefined' || typeof window.document === 'undefined') return '';
20631
20632 var style = window.document.documentElement.style;
20633
20634 if (prop in style) return '';
20635
20636 for (var i = 0; i < prefixes.length; i++) {
20637 if (browserPrefixToKey(prop, prefixes[i]) in style) return prefixes[i];
20638 }
20639
20640 return '';
20641 }
20642
20643 function browserPrefixToKey(prop /*: string*/, prefix /*: string*/) /*: string*/ {
20644 return prefix ? '' + prefix + kebabToTitleCase(prop) : prop;
20645 }
20646
20647 function kebabToTitleCase(str /*: string*/) /*: string*/ {
20648 var out = '';
20649 var shouldCapitalize = true;
20650 for (var i = 0; i < str.length; i++) {
20651 if (shouldCapitalize) {
20652 out += str[i].toUpperCase();
20653 shouldCapitalize = false;
20654 } else if (str[i] === '-') {
20655 shouldCapitalize = true;
20656 } else {
20657 out += str[i];
20658 }
20659 }
20660 return out;
20661 }
20662
20663 // Default export is the prefix itself, like 'Moz', 'Webkit', etc
20664 // Note that you may have to re-test for certain things; for instance, Chrome 50
20665 // can handle unprefixed `transform`, but not unprefixed `user-select`
20666 var browserPrefix = getPrefix();
20667
20668 var classCallCheck = function (instance, Constructor) {
20669 if (!(instance instanceof Constructor)) {
20670 throw new TypeError("Cannot call a class as a function");
20671 }
20672 };
20673
20674 var createClass = function () {
20675 function defineProperties(target, props) {
20676 for (var i = 0; i < props.length; i++) {
20677 var descriptor = props[i];
20678 descriptor.enumerable = descriptor.enumerable || false;
20679 descriptor.configurable = true;
20680 if ("value" in descriptor) descriptor.writable = true;
20681 Object.defineProperty(target, descriptor.key, descriptor);
20682 }
20683 }
20684
20685 return function (Constructor, protoProps, staticProps) {
20686 if (protoProps) defineProperties(Constructor.prototype, protoProps);
20687 if (staticProps) defineProperties(Constructor, staticProps);
20688 return Constructor;
20689 };
20690 }();
20691
20692 var defineProperty = function (obj, key, value) {
20693 if (key in obj) {
20694 Object.defineProperty(obj, key, {
20695 value: value,
20696 enumerable: true,
20697 configurable: true,
20698 writable: true
20699 });
20700 } else {
20701 obj[key] = value;
20702 }
20703
20704 return obj;
20705 };
20706
20707 var _extends = Object.assign || function (target) {
20708 for (var i = 1; i < arguments.length; i++) {
20709 var source = arguments[i];
20710
20711 for (var key in source) {
20712 if (Object.prototype.hasOwnProperty.call(source, key)) {
20713 target[key] = source[key];
20714 }
20715 }
20716 }
20717
20718 return target;
20719 };
20720
20721 var inherits = function (subClass, superClass) {
20722 if (typeof superClass !== "function" && superClass !== null) {
20723 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
20724 }
20725
20726 subClass.prototype = Object.create(superClass && superClass.prototype, {
20727 constructor: {
20728 value: subClass,
20729 enumerable: false,
20730 writable: true,
20731 configurable: true
20732 }
20733 });
20734 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
20735 };
20736
20737 var possibleConstructorReturn = function (self, call) {
20738 if (!self) {
20739 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
20740 }
20741
20742 return call && (typeof call === "object" || typeof call === "function") ? call : self;
20743 };
20744
20745 var slicedToArray = function () {
20746 function sliceIterator(arr, i) {
20747 var _arr = [];
20748 var _n = true;
20749 var _d = false;
20750 var _e = undefined;
20751
20752 try {
20753 for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
20754 _arr.push(_s.value);
20755
20756 if (i && _arr.length === i) break;
20757 }
20758 } catch (err) {
20759 _d = true;
20760 _e = err;
20761 } finally {
20762 try {
20763 if (!_n && _i["return"]) _i["return"]();
20764 } finally {
20765 if (_d) throw _e;
20766 }
20767 }
20768
20769 return _arr;
20770 }
20771
20772 return function (arr, i) {
20773 if (Array.isArray(arr)) {
20774 return arr;
20775 } else if (Symbol.iterator in Object(arr)) {
20776 return sliceIterator(arr, i);
20777 } else {
20778 throw new TypeError("Invalid attempt to destructure non-iterable instance");
20779 }
20780 };
20781 }();
20782
20783 /*:: import type {ControlPosition, MouseTouchEvent} from './types';*/
20784
20785
20786 var matchesSelectorFunc = '';
20787 function matchesSelector(el /*: Node*/, selector /*: string*/) /*: boolean*/ {
20788 if (!matchesSelectorFunc) {
20789 matchesSelectorFunc = findInArray(['matches', 'webkitMatchesSelector', 'mozMatchesSelector', 'msMatchesSelector', 'oMatchesSelector'], function (method) {
20790 // $FlowIgnore: Doesn't think elements are indexable
20791 return isFunction(el[method]);
20792 });
20793 }
20794
20795 // Might not be found entirely (not an Element?) - in that case, bail
20796 // $FlowIgnore: Doesn't think elements are indexable
20797 if (!isFunction(el[matchesSelectorFunc])) return false;
20798
20799 // $FlowIgnore: Doesn't think elements are indexable
20800 return el[matchesSelectorFunc](selector);
20801 }
20802
20803 // Works up the tree to the draggable itself attempting to match selector.
20804 function matchesSelectorAndParentsTo(el /*: Node*/, selector /*: string*/, baseNode /*: Node*/) /*: boolean*/ {
20805 var node = el;
20806 do {
20807 if (matchesSelector(node, selector)) return true;
20808 if (node === baseNode) return false;
20809 node = node.parentNode;
20810 } while (node);
20811
20812 return false;
20813 }
20814
20815 function addEvent(el /*: ?Node*/, event /*: string*/, handler /*: Function*/) /*: void*/ {
20816 if (!el) {
20817 return;
20818 }
20819 if (el.attachEvent) {
20820 el.attachEvent('on' + event, handler);
20821 } else if (el.addEventListener) {
20822 el.addEventListener(event, handler, true);
20823 } else {
20824 // $FlowIgnore: Doesn't think elements are indexable
20825 el['on' + event] = handler;
20826 }
20827 }
20828
20829 function removeEvent(el /*: ?Node*/, event /*: string*/, handler /*: Function*/) /*: void*/ {
20830 if (!el) {
20831 return;
20832 }
20833 if (el.detachEvent) {
20834 el.detachEvent('on' + event, handler);
20835 } else if (el.removeEventListener) {
20836 el.removeEventListener(event, handler, true);
20837 } else {
20838 // $FlowIgnore: Doesn't think elements are indexable
20839 el['on' + event] = null;
20840 }
20841 }
20842
20843 function outerHeight(node /*: HTMLElement*/) /*: number*/ {
20844 // This is deliberately excluding margin for our calculations, since we are using
20845 // offsetTop which is including margin. See getBoundPosition
20846 var height = node.clientHeight;
20847 var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
20848 height += int(computedStyle.borderTopWidth);
20849 height += int(computedStyle.borderBottomWidth);
20850 return height;
20851 }
20852
20853 function outerWidth(node /*: HTMLElement*/) /*: number*/ {
20854 // This is deliberately excluding margin for our calculations, since we are using
20855 // offsetLeft which is including margin. See getBoundPosition
20856 var width = node.clientWidth;
20857 var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
20858 width += int(computedStyle.borderLeftWidth);
20859 width += int(computedStyle.borderRightWidth);
20860 return width;
20861 }
20862 function innerHeight(node /*: HTMLElement*/) /*: number*/ {
20863 var height = node.clientHeight;
20864 var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
20865 height -= int(computedStyle.paddingTop);
20866 height -= int(computedStyle.paddingBottom);
20867 return height;
20868 }
20869
20870 function innerWidth(node /*: HTMLElement*/) /*: number*/ {
20871 var width = node.clientWidth;
20872 var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
20873 width -= int(computedStyle.paddingLeft);
20874 width -= int(computedStyle.paddingRight);
20875 return width;
20876 }
20877
20878 // Get from offsetParent
20879 function offsetXYFromParent(evt /*: {clientX: number, clientY: number}*/, offsetParent /*: HTMLElement*/) /*: ControlPosition*/ {
20880 var isBody = offsetParent === offsetParent.ownerDocument.body;
20881 var offsetParentRect = isBody ? { left: 0, top: 0 } : offsetParent.getBoundingClientRect();
20882
20883 var x = evt.clientX + offsetParent.scrollLeft - offsetParentRect.left;
20884 var y = evt.clientY + offsetParent.scrollTop - offsetParentRect.top;
20885
20886 return { x: x, y: y };
20887 }
20888
20889 function createCSSTransform(_ref) /*: Object*/ {
20890 var x = _ref.x,
20891 y = _ref.y;
20892
20893 // Replace unitless items with px
20894 return defineProperty({}, browserPrefixToKey('transform', browserPrefix), 'translate(' + x + 'px,' + y + 'px)');
20895 }
20896
20897 function createSVGTransform(_ref3) /*: string*/ {
20898 var x = _ref3.x,
20899 y = _ref3.y;
20900
20901 return 'translate(' + x + ',' + y + ')';
20902 }
20903
20904 function getTouch(e /*: MouseTouchEvent*/, identifier /*: number*/) /*: ?{clientX: number, clientY: number}*/ {
20905 return e.targetTouches && findInArray(e.targetTouches, function (t) {
20906 return identifier === t.identifier;
20907 }) || e.changedTouches && findInArray(e.changedTouches, function (t) {
20908 return identifier === t.identifier;
20909 });
20910 }
20911
20912 function getTouchIdentifier(e /*: MouseTouchEvent*/) /*: ?number*/ {
20913 if (e.targetTouches && e.targetTouches[0]) return e.targetTouches[0].identifier;
20914 if (e.changedTouches && e.changedTouches[0]) return e.changedTouches[0].identifier;
20915 }
20916
20917 // User-select Hacks:
20918 //
20919 // Useful for preventing blue highlights all over everything when dragging.
20920
20921 // Note we're passing `document` b/c we could be iframed
20922 function addUserSelectStyles(doc /*: ?Document*/) {
20923 if (!doc) return;
20924 var styleEl = doc.getElementById('react-draggable-style-el');
20925 if (!styleEl) {
20926 styleEl = doc.createElement('style');
20927 styleEl.type = 'text/css';
20928 styleEl.id = 'react-draggable-style-el';
20929 styleEl.innerHTML = '.react-draggable-transparent-selection *::-moz-selection {background: transparent;}\n';
20930 styleEl.innerHTML += '.react-draggable-transparent-selection *::selection {background: transparent;}\n';
20931 doc.getElementsByTagName('head')[0].appendChild(styleEl);
20932 }
20933 if (doc.body) addClassName(doc.body, 'react-draggable-transparent-selection');
20934 }
20935
20936 function removeUserSelectStyles(doc /*: ?Document*/) {
20937 try {
20938 if (doc && doc.body) removeClassName(doc.body, 'react-draggable-transparent-selection');
20939 // $FlowIgnore: IE
20940 if (doc.selection) {
20941 // $FlowIgnore: IE
20942 doc.selection.empty();
20943 } else {
20944 window.getSelection().removeAllRanges(); // remove selection caused by scroll
20945 }
20946 } catch (e) {
20947 // probably IE
20948 }
20949 }
20950
20951 function styleHacks() /*: Object*/ {
20952 var childStyle /*: Object*/ = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
20953
20954 // Workaround IE pointer events; see #51
20955 // https://github.com/mzabriskie/react-draggable/issues/51#issuecomment-103488278
20956 return _extends({
20957 touchAction: 'none'
20958 }, childStyle);
20959 }
20960
20961 function addClassName(el /*: HTMLElement*/, className /*: string*/) {
20962 if (el.classList) {
20963 el.classList.add(className);
20964 } else {
20965 if (!el.className.match(new RegExp('(?:^|\\s)' + className + '(?!\\S)'))) {
20966 el.className += ' ' + className;
20967 }
20968 }
20969 }
20970
20971 function removeClassName(el /*: HTMLElement*/, className /*: string*/) {
20972 if (el.classList) {
20973 el.classList.remove(className);
20974 } else {
20975 el.className = el.className.replace(new RegExp('(?:^|\\s)' + className + '(?!\\S)', 'g'), '');
20976 }
20977 }
20978
20979 /*:: import type Draggable from '../Draggable';*/
20980 /*:: import type {Bounds, ControlPosition, DraggableData, MouseTouchEvent} from './types';*/
20981 /*:: import type DraggableCore from '../DraggableCore';*/
20982
20983
20984 function getBoundPosition(draggable /*: Draggable*/, x /*: number*/, y /*: number*/) /*: [number, number]*/ {
20985 // If no bounds, short-circuit and move on
20986 if (!draggable.props.bounds) return [x, y];
20987
20988 // Clone new bounds
20989 var bounds = draggable.props.bounds;
20990
20991 bounds = typeof bounds === 'string' ? bounds : cloneBounds(bounds);
20992 var node = findDOMNode(draggable);
20993
20994 if (typeof bounds === 'string') {
20995 var ownerDocument = node.ownerDocument;
20996
20997 var ownerWindow = ownerDocument.defaultView;
20998 var boundNode = void 0;
20999 if (bounds === 'parent') {
21000 boundNode = node.parentNode;
21001 } else {
21002 boundNode = ownerDocument.querySelector(bounds);
21003 }
21004 if (!(boundNode instanceof ownerWindow.HTMLElement)) {
21005 throw new Error('Bounds selector "' + bounds + '" could not find an element.');
21006 }
21007 var nodeStyle = ownerWindow.getComputedStyle(node);
21008 var boundNodeStyle = ownerWindow.getComputedStyle(boundNode);
21009 // Compute bounds. This is a pain with padding and offsets but this gets it exactly right.
21010 bounds = {
21011 left: -node.offsetLeft + int(boundNodeStyle.paddingLeft) + int(nodeStyle.marginLeft),
21012 top: -node.offsetTop + int(boundNodeStyle.paddingTop) + int(nodeStyle.marginTop),
21013 right: innerWidth(boundNode) - outerWidth(node) - node.offsetLeft + int(boundNodeStyle.paddingRight) - int(nodeStyle.marginRight),
21014 bottom: innerHeight(boundNode) - outerHeight(node) - node.offsetTop + int(boundNodeStyle.paddingBottom) - int(nodeStyle.marginBottom)
21015 };
21016 }
21017
21018 // Keep x and y below right and bottom limits...
21019 if (isNum(bounds.right)) x = Math.min(x, bounds.right);
21020 if (isNum(bounds.bottom)) y = Math.min(y, bounds.bottom);
21021
21022 // But above left and top limits.
21023 if (isNum(bounds.left)) x = Math.max(x, bounds.left);
21024 if (isNum(bounds.top)) y = Math.max(y, bounds.top);
21025
21026 return [x, y];
21027 }
21028
21029 function snapToGrid(grid /*: [number, number]*/, pendingX /*: number*/, pendingY /*: number*/) /*: [number, number]*/ {
21030 var x = Math.round(pendingX / grid[0]) * grid[0];
21031 var y = Math.round(pendingY / grid[1]) * grid[1];
21032 return [x, y];
21033 }
21034
21035 function canDragX(draggable /*: Draggable*/) /*: boolean*/ {
21036 return draggable.props.axis === 'both' || draggable.props.axis === 'x';
21037 }
21038
21039 function canDragY(draggable /*: Draggable*/) /*: boolean*/ {
21040 return draggable.props.axis === 'both' || draggable.props.axis === 'y';
21041 }
21042
21043 // Get {x, y} positions from event.
21044 function getControlPosition(e /*: MouseTouchEvent*/, touchIdentifier /*: ?number*/, draggableCore /*: DraggableCore*/) /*: ?ControlPosition*/ {
21045 var touchObj = typeof touchIdentifier === 'number' ? getTouch(e, touchIdentifier) : null;
21046 if (typeof touchIdentifier === 'number' && !touchObj) return null; // not the right touch
21047 var node = findDOMNode(draggableCore);
21048 // User can provide an offsetParent if desired.
21049 var offsetParent = draggableCore.props.offsetParent || node.offsetParent || node.ownerDocument.body;
21050 return offsetXYFromParent(touchObj || e, offsetParent);
21051 }
21052
21053 // Create an data object exposed by <DraggableCore>'s events
21054 function createCoreData(draggable /*: DraggableCore*/, x /*: number*/, y /*: number*/) /*: DraggableData*/ {
21055 var state = draggable.state;
21056 var isStart = !isNum(state.lastX);
21057 var node = findDOMNode(draggable);
21058
21059 if (isStart) {
21060 // If this is our first move, use the x and y as last coords.
21061 return {
21062 node: node,
21063 deltaX: 0, deltaY: 0,
21064 lastX: x, lastY: y,
21065 x: x, y: y
21066 };
21067 } else {
21068 // Otherwise calculate proper values.
21069 return {
21070 node: node,
21071 deltaX: x - state.lastX, deltaY: y - state.lastY,
21072 lastX: state.lastX, lastY: state.lastY,
21073 x: x, y: y
21074 };
21075 }
21076 }
21077
21078 // Create an data exposed by <Draggable>'s events
21079 function createDraggableData(draggable /*: Draggable*/, coreData /*: DraggableData*/) /*: DraggableData*/ {
21080 var scale = draggable.props.scale;
21081 return {
21082 node: coreData.node,
21083 x: draggable.state.x + coreData.deltaX / scale,
21084 y: draggable.state.y + coreData.deltaY / scale,
21085 deltaX: coreData.deltaX / scale,
21086 deltaY: coreData.deltaY / scale,
21087 lastX: draggable.state.x,
21088 lastY: draggable.state.y
21089 };
21090 }
21091
21092 // A lot faster than stringify/parse
21093 function cloneBounds(bounds /*: Bounds*/) /*: Bounds*/ {
21094 return {
21095 left: bounds.left,
21096 top: bounds.top,
21097 right: bounds.right,
21098 bottom: bounds.bottom
21099 };
21100 }
21101
21102 function findDOMNode(draggable /*: Draggable | DraggableCore*/) /*: HTMLElement*/ {
21103 var node = ReactDOM.findDOMNode(draggable);
21104 if (!node) {
21105 throw new Error('<DraggableCore>: Unmounted during event!');
21106 }
21107 // $FlowIgnore we can't assert on HTMLElement due to tests... FIXME
21108 return node;
21109 }
21110
21111 /*eslint no-console:0*/
21112 function log() {
21113 }
21114
21115 /*:: import type {EventHandler, MouseTouchEvent} from './utils/types';*/
21116
21117
21118 // Simple abstraction for dragging events names.
21119 /*:: import type {Element as ReactElement} from 'react';*/
21120 var eventsFor = {
21121 touch: {
21122 start: 'touchstart',
21123 move: 'touchmove',
21124 stop: 'touchend'
21125 },
21126 mouse: {
21127 start: 'mousedown',
21128 move: 'mousemove',
21129 stop: 'mouseup'
21130 }
21131 };
21132
21133 // Default to mouse events.
21134 var dragEventFor = eventsFor.mouse;
21135
21136 /*:: type DraggableCoreState = {
21137 dragging: boolean,
21138 lastX: number,
21139 lastY: number,
21140 touchIdentifier: ?number
21141 };*/
21142 /*:: export type DraggableBounds = {
21143 left: number,
21144 right: number,
21145 top: number,
21146 bottom: number,
21147 };*/
21148 /*:: export type DraggableData = {
21149 node: HTMLElement,
21150 x: number, y: number,
21151 deltaX: number, deltaY: number,
21152 lastX: number, lastY: number,
21153 };*/
21154 /*:: export type DraggableEventHandler = (e: MouseEvent, data: DraggableData) => void;*/
21155 /*:: export type ControlPosition = {x: number, y: number};*/
21156
21157
21158 //
21159 // Define <DraggableCore>.
21160 //
21161 // <DraggableCore> is for advanced usage of <Draggable>. It maintains minimal internal state so it can
21162 // work well with libraries that require more control over the element.
21163 //
21164
21165 /*:: export type DraggableCoreProps = {
21166 allowAnyClick: boolean,
21167 cancel: string,
21168 children: ReactElement<any>,
21169 disabled: boolean,
21170 enableUserSelectHack: boolean,
21171 offsetParent: HTMLElement,
21172 grid: [number, number],
21173 handle: string,
21174 onStart: DraggableEventHandler,
21175 onDrag: DraggableEventHandler,
21176 onStop: DraggableEventHandler,
21177 onMouseDown: (e: MouseEvent) => void,
21178 };*/
21179
21180 var DraggableCore = function (_React$Component) {
21181 inherits(DraggableCore, _React$Component);
21182
21183 function DraggableCore() {
21184 var _ref;
21185
21186 var _temp, _this, _ret;
21187
21188 classCallCheck(this, DraggableCore);
21189
21190 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
21191 args[_key] = arguments[_key];
21192 }
21193
21194 return _ret = (_temp = (_this = possibleConstructorReturn(this, (_ref = DraggableCore.__proto__ || Object.getPrototypeOf(DraggableCore)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
21195 dragging: false,
21196 // Used while dragging to determine deltas.
21197 lastX: NaN, lastY: NaN,
21198 touchIdentifier: null
21199 }, _this.handleDragStart = function (e) {
21200 // Make it possible to attach event handlers on top of this one.
21201 _this.props.onMouseDown(e);
21202
21203 // Only accept left-clicks.
21204 if (!_this.props.allowAnyClick && typeof e.button === 'number' && e.button !== 0) return false;
21205
21206 // Get nodes. Be sure to grab relative document (could be iframed)
21207 var thisNode = ReactDOM.findDOMNode(_this);
21208 if (!thisNode || !thisNode.ownerDocument || !thisNode.ownerDocument.body) {
21209 throw new Error('<DraggableCore> not mounted on DragStart!');
21210 }
21211 var ownerDocument = thisNode.ownerDocument;
21212
21213 // Short circuit if handle or cancel prop was provided and selector doesn't match.
21214
21215 if (_this.props.disabled || !(e.target instanceof ownerDocument.defaultView.Node) || _this.props.handle && !matchesSelectorAndParentsTo(e.target, _this.props.handle, thisNode) || _this.props.cancel && matchesSelectorAndParentsTo(e.target, _this.props.cancel, thisNode)) {
21216 return;
21217 }
21218
21219 // Set touch identifier in component state if this is a touch event. This allows us to
21220 // distinguish between individual touches on multitouch screens by identifying which
21221 // touchpoint was set to this element.
21222 var touchIdentifier = getTouchIdentifier(e);
21223 _this.setState({ touchIdentifier: touchIdentifier });
21224
21225 // Get the current drag point from the event. This is used as the offset.
21226 var position = getControlPosition(e, touchIdentifier, _this);
21227 if (position == null) return; // not possible but satisfies flow
21228 var x = position.x,
21229 y = position.y;
21230
21231 // Create an event object with all the data parents need to make a decision here.
21232
21233 var coreEvent = createCoreData(_this, x, y);
21234
21235 // Call event handler. If it returns explicit false, cancel.
21236 log('calling', _this.props.onStart);
21237 var shouldUpdate = _this.props.onStart(e, coreEvent);
21238 if (shouldUpdate === false) return;
21239
21240 // Add a style to the body to disable user-select. This prevents text from
21241 // being selected all over the page.
21242 if (_this.props.enableUserSelectHack) addUserSelectStyles(ownerDocument);
21243
21244 // Initiate dragging. Set the current x and y as offsets
21245 // so we know how much we've moved during the drag. This allows us
21246 // to drag elements around even if they have been moved, without issue.
21247 _this.setState({
21248 dragging: true,
21249
21250 lastX: x,
21251 lastY: y
21252 });
21253
21254 // Add events to the document directly so we catch when the user's mouse/touch moves outside of
21255 // this element. We use different events depending on whether or not we have detected that this
21256 // is a touch-capable device.
21257 addEvent(ownerDocument, dragEventFor.move, _this.handleDrag);
21258 addEvent(ownerDocument, dragEventFor.stop, _this.handleDragStop);
21259 }, _this.handleDrag = function (e) {
21260
21261 // Prevent scrolling on mobile devices, like ipad/iphone.
21262 if (e.type === 'touchmove') e.preventDefault();
21263
21264 // Get the current drag point from the event. This is used as the offset.
21265 var position = getControlPosition(e, _this.state.touchIdentifier, _this);
21266 if (position == null) return;
21267 var x = position.x,
21268 y = position.y;
21269
21270 // Snap to grid if prop has been provided
21271
21272 if (Array.isArray(_this.props.grid)) {
21273 var _deltaX = x - _this.state.lastX,
21274 _deltaY = y - _this.state.lastY;
21275
21276 var _snapToGrid = snapToGrid(_this.props.grid, _deltaX, _deltaY);
21277
21278 var _snapToGrid2 = slicedToArray(_snapToGrid, 2);
21279
21280 _deltaX = _snapToGrid2[0];
21281 _deltaY = _snapToGrid2[1];
21282
21283 if (!_deltaX && !_deltaY) return; // skip useless drag
21284 x = _this.state.lastX + _deltaX, y = _this.state.lastY + _deltaY;
21285 }
21286
21287 var coreEvent = createCoreData(_this, x, y);
21288
21289 // Call event handler. If it returns explicit false, trigger end.
21290 var shouldUpdate = _this.props.onDrag(e, coreEvent);
21291 if (shouldUpdate === false) {
21292 try {
21293 // $FlowIgnore
21294 _this.handleDragStop(new MouseEvent('mouseup'));
21295 } catch (err) {
21296 // Old browsers
21297 var event = ((document.createEvent('MouseEvents') /*: any*/) /*: MouseTouchEvent*/);
21298 // I see why this insanity was deprecated
21299 // $FlowIgnore
21300 event.initMouseEvent('mouseup', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
21301 _this.handleDragStop(event);
21302 }
21303 return;
21304 }
21305
21306 _this.setState({
21307 lastX: x,
21308 lastY: y
21309 });
21310 }, _this.handleDragStop = function (e) {
21311 if (!_this.state.dragging) return;
21312
21313 var position = getControlPosition(e, _this.state.touchIdentifier, _this);
21314 if (position == null) return;
21315 var x = position.x,
21316 y = position.y;
21317
21318 var coreEvent = createCoreData(_this, x, y);
21319
21320 var thisNode = ReactDOM.findDOMNode(_this);
21321 if (thisNode) {
21322 // Remove user-select hack
21323 if (_this.props.enableUserSelectHack) removeUserSelectStyles(thisNode.ownerDocument);
21324 }
21325
21326 // Reset the el.
21327 _this.setState({
21328 dragging: false,
21329 lastX: NaN,
21330 lastY: NaN
21331 });
21332
21333 // Call event handler
21334 _this.props.onStop(e, coreEvent);
21335
21336 if (thisNode) {
21337 removeEvent(thisNode.ownerDocument, dragEventFor.move, _this.handleDrag);
21338 removeEvent(thisNode.ownerDocument, dragEventFor.stop, _this.handleDragStop);
21339 }
21340 }, _this.onMouseDown = function (e) {
21341 dragEventFor = eventsFor.mouse; // on touchscreen laptops we could switch back to mouse
21342
21343 return _this.handleDragStart(e);
21344 }, _this.onMouseUp = function (e) {
21345 dragEventFor = eventsFor.mouse;
21346
21347 return _this.handleDragStop(e);
21348 }, _this.onTouchStart = function (e) {
21349 // We're on a touch device now, so change the event handlers
21350 dragEventFor = eventsFor.touch;
21351
21352 return _this.handleDragStart(e);
21353 }, _this.onTouchEnd = function (e) {
21354 // We're on a touch device now, so change the event handlers
21355 dragEventFor = eventsFor.touch;
21356
21357 return _this.handleDragStop(e);
21358 }, _temp), possibleConstructorReturn(_this, _ret);
21359 }
21360
21361 createClass(DraggableCore, [{
21362 key: 'componentWillUnmount',
21363 value: function componentWillUnmount() {
21364 // Remove any leftover event handlers. Remove both touch and mouse handlers in case
21365 // some browser quirk caused a touch event to fire during a mouse move, or vice versa.
21366 var thisNode = ReactDOM.findDOMNode(this);
21367 if (thisNode) {
21368 var ownerDocument = thisNode.ownerDocument;
21369
21370 removeEvent(ownerDocument, eventsFor.mouse.move, this.handleDrag);
21371 removeEvent(ownerDocument, eventsFor.touch.move, this.handleDrag);
21372 removeEvent(ownerDocument, eventsFor.mouse.stop, this.handleDragStop);
21373 removeEvent(ownerDocument, eventsFor.touch.stop, this.handleDragStop);
21374 if (this.props.enableUserSelectHack) removeUserSelectStyles(ownerDocument);
21375 }
21376 }
21377
21378 // Same as onMouseDown (start drag), but now consider this a touch device.
21379
21380 }, {
21381 key: 'render',
21382 value: function render() {
21383 // Reuse the child provided
21384 // This makes it flexible to use whatever element is wanted (div, ul, etc)
21385 return React.cloneElement(React.Children.only(this.props.children), {
21386 style: styleHacks(this.props.children.props.style),
21387
21388 // Note: mouseMove handler is attached to document so it will still function
21389 // when the user drags quickly and leaves the bounds of the element.
21390 onMouseDown: this.onMouseDown,
21391 onTouchStart: this.onTouchStart,
21392 onMouseUp: this.onMouseUp,
21393 onTouchEnd: this.onTouchEnd
21394 });
21395 }
21396 }]);
21397 return DraggableCore;
21398 }(React.Component);
21399
21400 DraggableCore.displayName = 'DraggableCore';
21401 DraggableCore.propTypes = {
21402 /**
21403 * `allowAnyClick` allows dragging using any mouse button.
21404 * By default, we only accept the left button.
21405 *
21406 * Defaults to `false`.
21407 */
21408 allowAnyClick: propTypes.bool,
21409
21410 /**
21411 * `disabled`, if true, stops the <Draggable> from dragging. All handlers,
21412 * with the exception of `onMouseDown`, will not fire.
21413 */
21414 disabled: propTypes.bool,
21415
21416 /**
21417 * By default, we add 'user-select:none' attributes to the document body
21418 * to prevent ugly text selection during drag. If this is causing problems
21419 * for your app, set this to `false`.
21420 */
21421 enableUserSelectHack: propTypes.bool,
21422
21423 /**
21424 * `offsetParent`, if set, uses the passed DOM node to compute drag offsets
21425 * instead of using the parent node.
21426 */
21427 offsetParent: function offsetParent(props /*: DraggableCoreProps*/, propName /*: $Keys<DraggableCoreProps>*/) {
21428 if (props[propName] && props[propName].nodeType !== 1) {
21429 throw new Error('Draggable\'s offsetParent must be a DOM Node.');
21430 }
21431 },
21432
21433 /**
21434 * `grid` specifies the x and y that dragging should snap to.
21435 */
21436 grid: propTypes.arrayOf(propTypes.number),
21437
21438 /**
21439 * `scale` specifies the scale of the area you are dragging inside of. It allows
21440 * the drag deltas to scale correctly with how far zoomed in/out you are.
21441 */
21442 scale: propTypes.number,
21443
21444 /**
21445 * `handle` specifies a selector to be used as the handle that initiates drag.
21446 *
21447 * Example:
21448 *
21449 * ```jsx
21450 * let App = React.createClass({
21451 * render: function () {
21452 * return (
21453 * <Draggable handle=".handle">
21454 * <div>
21455 * <div className="handle">Click me to drag</div>
21456 * <div>This is some other content</div>
21457 * </div>
21458 * </Draggable>
21459 * );
21460 * }
21461 * });
21462 * ```
21463 */
21464 handle: propTypes.string,
21465
21466 /**
21467 * `cancel` specifies a selector to be used to prevent drag initialization.
21468 *
21469 * Example:
21470 *
21471 * ```jsx
21472 * let App = React.createClass({
21473 * render: function () {
21474 * return(
21475 * <Draggable cancel=".cancel">
21476 * <div>
21477 * <div className="cancel">You can't drag from here</div>
21478 * <div>Dragging here works fine</div>
21479 * </div>
21480 * </Draggable>
21481 * );
21482 * }
21483 * });
21484 * ```
21485 */
21486 cancel: propTypes.string,
21487
21488 /**
21489 * Called when dragging starts.
21490 * If this function returns the boolean false, dragging will be canceled.
21491 */
21492 onStart: propTypes.func,
21493
21494 /**
21495 * Called while dragging.
21496 * If this function returns the boolean false, dragging will be canceled.
21497 */
21498 onDrag: propTypes.func,
21499
21500 /**
21501 * Called when dragging stops.
21502 * If this function returns the boolean false, the drag will remain active.
21503 */
21504 onStop: propTypes.func,
21505
21506 /**
21507 * A workaround option which can be passed if onMouseDown needs to be accessed,
21508 * since it'll always be blocked (as there is internal use of onMouseDown)
21509 */
21510 onMouseDown: propTypes.func,
21511
21512 /**
21513 * These properties should be defined on the child, not here.
21514 */
21515 className: dontSetMe,
21516 style: dontSetMe,
21517 transform: dontSetMe
21518 };
21519 DraggableCore.defaultProps = {
21520 allowAnyClick: false, // by default only accept left click
21521 cancel: null,
21522 disabled: false,
21523 enableUserSelectHack: true,
21524 offsetParent: null,
21525 handle: null,
21526 grid: null,
21527 transform: null,
21528 onStart: function onStart() {},
21529 onDrag: function onDrag() {},
21530 onStop: function onStop() {},
21531 onMouseDown: function onMouseDown() {}
21532 };
21533
21534 /*:: import type {DraggableEventHandler} from './utils/types';*/
21535 /*:: import type {Element as ReactElement} from 'react';*/
21536 /*:: type DraggableState = {
21537 dragging: boolean,
21538 dragged: boolean,
21539 x: number, y: number,
21540 slackX: number, slackY: number,
21541 isElementSVG: boolean
21542 };*/
21543
21544
21545 //
21546 // Define <Draggable>
21547 //
21548
21549 /*:: export type DraggableProps = {
21550 ...$Exact<DraggableCoreProps>,
21551 axis: 'both' | 'x' | 'y' | 'none',
21552 bounds: DraggableBounds | string | false,
21553 defaultClassName: string,
21554 defaultClassNameDragging: string,
21555 defaultClassNameDragged: string,
21556 defaultPosition: ControlPosition,
21557 position: ControlPosition,
21558 scale: number
21559 };*/
21560
21561 var Draggable = function (_React$Component) {
21562 inherits(Draggable, _React$Component);
21563
21564 function Draggable(props /*: DraggableProps*/) {
21565 classCallCheck(this, Draggable);
21566
21567 var _this = possibleConstructorReturn(this, (Draggable.__proto__ || Object.getPrototypeOf(Draggable)).call(this, props));
21568
21569 _this.onDragStart = function (e, coreData) {
21570
21571 // Short-circuit if user's callback killed it.
21572 var shouldStart = _this.props.onStart(e, createDraggableData(_this, coreData));
21573 // Kills start event on core as well, so move handlers are never bound.
21574 if (shouldStart === false) return false;
21575
21576 _this.setState({ dragging: true, dragged: true });
21577 };
21578
21579 _this.onDrag = function (e, coreData) {
21580 if (!_this.state.dragging) return false;
21581
21582 var uiData = createDraggableData(_this, coreData);
21583
21584 var newState /*: $Shape<DraggableState>*/ = {
21585 x: uiData.x,
21586 y: uiData.y
21587 };
21588
21589 // Keep within bounds.
21590 if (_this.props.bounds) {
21591 // Save original x and y.
21592 var _x = newState.x,
21593 _y = newState.y;
21594
21595 // Add slack to the values used to calculate bound position. This will ensure that if
21596 // we start removing slack, the element won't react to it right away until it's been
21597 // completely removed.
21598
21599 newState.x += _this.state.slackX;
21600 newState.y += _this.state.slackY;
21601
21602 // Get bound position. This will ceil/floor the x and y within the boundaries.
21603
21604 var _getBoundPosition = getBoundPosition(_this, newState.x, newState.y),
21605 _getBoundPosition2 = slicedToArray(_getBoundPosition, 2),
21606 newStateX = _getBoundPosition2[0],
21607 newStateY = _getBoundPosition2[1];
21608
21609 newState.x = newStateX;
21610 newState.y = newStateY;
21611
21612 // Recalculate slack by noting how much was shaved by the boundPosition handler.
21613 newState.slackX = _this.state.slackX + (_x - newState.x);
21614 newState.slackY = _this.state.slackY + (_y - newState.y);
21615
21616 // Update the event we fire to reflect what really happened after bounds took effect.
21617 uiData.x = newState.x;
21618 uiData.y = newState.y;
21619 uiData.deltaX = newState.x - _this.state.x;
21620 uiData.deltaY = newState.y - _this.state.y;
21621 }
21622
21623 // Short-circuit if user's callback killed it.
21624 var shouldUpdate = _this.props.onDrag(e, uiData);
21625 if (shouldUpdate === false) return false;
21626
21627 _this.setState(newState);
21628 };
21629
21630 _this.onDragStop = function (e, coreData) {
21631 if (!_this.state.dragging) return false;
21632
21633 // Short-circuit if user's callback killed it.
21634 var shouldStop = _this.props.onStop(e, createDraggableData(_this, coreData));
21635 if (shouldStop === false) return false;
21636
21637 var newState /*: $Shape<DraggableState>*/ = {
21638 dragging: false,
21639 slackX: 0,
21640 slackY: 0
21641 };
21642
21643 // If this is a controlled component, the result of this operation will be to
21644 // revert back to the old position. We expect a handler on `onDragStop`, at the least.
21645 var controlled = Boolean(_this.props.position);
21646 if (controlled) {
21647 var _this$props$position = _this.props.position,
21648 _x2 = _this$props$position.x,
21649 _y2 = _this$props$position.y;
21650
21651 newState.x = _x2;
21652 newState.y = _y2;
21653 }
21654
21655 _this.setState(newState);
21656 };
21657
21658 _this.state = {
21659 // Whether or not we are currently dragging.
21660 dragging: false,
21661
21662 // Whether or not we have been dragged before.
21663 dragged: false,
21664
21665 // Current transform x and y.
21666 x: props.position ? props.position.x : props.defaultPosition.x,
21667 y: props.position ? props.position.y : props.defaultPosition.y,
21668
21669 // Used for compensating for out-of-bounds drags
21670 slackX: 0, slackY: 0,
21671
21672 // Can only determine if SVG after mounting
21673 isElementSVG: false
21674 };
21675 return _this;
21676 }
21677
21678 createClass(Draggable, [{
21679 key: 'componentWillMount',
21680 value: function componentWillMount() {
21681 if (this.props.position && !(this.props.onDrag || this.props.onStop)) {
21682 // eslint-disable-next-line
21683 console.warn('A `position` was applied to this <Draggable>, without drag handlers. This will make this ' + 'component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the ' + '`position` of this element.');
21684 }
21685 }
21686 }, {
21687 key: 'componentDidMount',
21688 value: function componentDidMount() {
21689 // Check to see if the element passed is an instanceof SVGElement
21690 if (typeof window.SVGElement !== 'undefined' && ReactDOM.findDOMNode(this) instanceof window.SVGElement) {
21691 this.setState({ isElementSVG: true });
21692 }
21693 }
21694 }, {
21695 key: 'componentWillReceiveProps',
21696 value: function componentWillReceiveProps(nextProps /*: Object*/) {
21697 // Set x/y if position has changed
21698 if (nextProps.position && (!this.props.position || nextProps.position.x !== this.props.position.x || nextProps.position.y !== this.props.position.y)) {
21699 this.setState({ x: nextProps.position.x, y: nextProps.position.y });
21700 }
21701 }
21702 }, {
21703 key: 'componentWillUnmount',
21704 value: function componentWillUnmount() {
21705 this.setState({ dragging: false }); // prevents invariant if unmounted while dragging
21706 }
21707 }, {
21708 key: 'render',
21709 value: function render() /*: ReactElement<any>*/ {
21710 var _classNames;
21711
21712 var style = {},
21713 svgTransform = null;
21714
21715 // If this is controlled, we don't want to move it - unless it's dragging.
21716 var controlled = Boolean(this.props.position);
21717 var draggable = !controlled || this.state.dragging;
21718
21719 var position = this.props.position || this.props.defaultPosition;
21720 var transformOpts = {
21721 // Set left if horizontal drag is enabled
21722 x: canDragX(this) && draggable ? this.state.x : position.x,
21723
21724 // Set top if vertical drag is enabled
21725 y: canDragY(this) && draggable ? this.state.y : position.y
21726 };
21727
21728 // If this element was SVG, we use the `transform` attribute.
21729 if (this.state.isElementSVG) {
21730 svgTransform = createSVGTransform(transformOpts);
21731 } else {
21732 // Add a CSS transform to move the element around. This allows us to move the element around
21733 // without worrying about whether or not it is relatively or absolutely positioned.
21734 // If the item you are dragging already has a transform set, wrap it in a <span> so <Draggable>
21735 // has a clean slate.
21736 style = createCSSTransform(transformOpts);
21737 }
21738
21739 var _props = this.props,
21740 defaultClassName = _props.defaultClassName,
21741 defaultClassNameDragging = _props.defaultClassNameDragging,
21742 defaultClassNameDragged = _props.defaultClassNameDragged;
21743
21744
21745 var children = React.Children.only(this.props.children);
21746
21747 // Mark with class while dragging
21748 var className = classnames(children.props.className || '', defaultClassName, (_classNames = {}, defineProperty(_classNames, defaultClassNameDragging, this.state.dragging), defineProperty(_classNames, defaultClassNameDragged, this.state.dragged), _classNames));
21749
21750 // Reuse the child provided
21751 // This makes it flexible to use whatever element is wanted (div, ul, etc)
21752 return React.createElement(
21753 DraggableCore,
21754 _extends({}, this.props, { onStart: this.onDragStart, onDrag: this.onDrag, onStop: this.onDragStop }),
21755 React.cloneElement(children, {
21756 className: className,
21757 style: _extends({}, children.props.style, style),
21758 transform: svgTransform
21759 })
21760 );
21761 }
21762 }]);
21763 return Draggable;
21764 }(React.Component);
21765
21766 Draggable.displayName = 'Draggable';
21767 Draggable.propTypes = _extends({}, DraggableCore.propTypes, {
21768
21769 /**
21770 * `axis` determines which axis the draggable can move.
21771 *
21772 * Note that all callbacks will still return data as normal. This only
21773 * controls flushing to the DOM.
21774 *
21775 * 'both' allows movement horizontally and vertically.
21776 * 'x' limits movement to horizontal axis.
21777 * 'y' limits movement to vertical axis.
21778 * 'none' limits all movement.
21779 *
21780 * Defaults to 'both'.
21781 */
21782 axis: propTypes.oneOf(['both', 'x', 'y', 'none']),
21783
21784 /**
21785 * `bounds` determines the range of movement available to the element.
21786 * Available values are:
21787 *
21788 * 'parent' restricts movement within the Draggable's parent node.
21789 *
21790 * Alternatively, pass an object with the following properties, all of which are optional:
21791 *
21792 * {left: LEFT_BOUND, right: RIGHT_BOUND, bottom: BOTTOM_BOUND, top: TOP_BOUND}
21793 *
21794 * All values are in px.
21795 *
21796 * Example:
21797 *
21798 * ```jsx
21799 * let App = React.createClass({
21800 * render: function () {
21801 * return (
21802 * <Draggable bounds={{right: 300, bottom: 300}}>
21803 * <div>Content</div>
21804 * </Draggable>
21805 * );
21806 * }
21807 * });
21808 * ```
21809 */
21810 bounds: propTypes.oneOfType([propTypes.shape({
21811 left: propTypes.number,
21812 right: propTypes.number,
21813 top: propTypes.number,
21814 bottom: propTypes.number
21815 }), propTypes.string, propTypes.oneOf([false])]),
21816
21817 defaultClassName: propTypes.string,
21818 defaultClassNameDragging: propTypes.string,
21819 defaultClassNameDragged: propTypes.string,
21820
21821 /**
21822 * `defaultPosition` specifies the x and y that the dragged item should start at
21823 *
21824 * Example:
21825 *
21826 * ```jsx
21827 * let App = React.createClass({
21828 * render: function () {
21829 * return (
21830 * <Draggable defaultPosition={{x: 25, y: 25}}>
21831 * <div>I start with transformX: 25px and transformY: 25px;</div>
21832 * </Draggable>
21833 * );
21834 * }
21835 * });
21836 * ```
21837 */
21838 defaultPosition: propTypes.shape({
21839 x: propTypes.number,
21840 y: propTypes.number
21841 }),
21842
21843 /**
21844 * `position`, if present, defines the current position of the element.
21845 *
21846 * This is similar to how form elements in React work - if no `position` is supplied, the component
21847 * is uncontrolled.
21848 *
21849 * Example:
21850 *
21851 * ```jsx
21852 * let App = React.createClass({
21853 * render: function () {
21854 * return (
21855 * <Draggable position={{x: 25, y: 25}}>
21856 * <div>I start with transformX: 25px and transformY: 25px;</div>
21857 * </Draggable>
21858 * );
21859 * }
21860 * });
21861 * ```
21862 */
21863 position: propTypes.shape({
21864 x: propTypes.number,
21865 y: propTypes.number
21866 }),
21867
21868 /**
21869 * These properties should be defined on the child, not here.
21870 */
21871 className: dontSetMe,
21872 style: dontSetMe,
21873 transform: dontSetMe
21874 });
21875 Draggable.defaultProps = _extends({}, DraggableCore.defaultProps, {
21876 axis: 'both',
21877 bounds: false,
21878 defaultClassName: 'react-draggable',
21879 defaultClassNameDragging: 'react-draggable-dragging',
21880 defaultClassNameDragged: 'react-draggable-dragged',
21881 defaultPosition: { x: 0, y: 0 },
21882 position: null,
21883 scale: 1
21884 });
21885
21886 // Previous versions of this lib exported <Draggable> as the root export. As to not break
21887 // them, or TypeScript, we export *both* as the root and as 'default'.
21888 // See https://github.com/mzabriskie/react-draggable/pull/254
21889 // and https://github.com/mzabriskie/react-draggable/issues/266
21890 Draggable.default = Draggable;
21891 Draggable.DraggableCore = DraggableCore;
21892
21893 return Draggable;
21894
21895 })));
21896 //# sourceMappingURL=react-draggable.js.map
21897
21898
21899/***/ }),
21900/* 187 */
21901/***/ (function(module, exports, __webpack_require__) {
21902
21903 /* WEBPACK VAR INJECTION */(function(global, module) {/**
21904 * Lodash (Custom Build) <https://lodash.com/>
21905 * Build: `lodash modularize exports="npm" -o ./`
21906 * Copyright JS Foundation and other contributors <https://js.foundation/>
21907 * Released under MIT license <https://lodash.com/license>
21908 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
21909 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
21910 */
21911
21912 /** Used as the size to enable large array optimizations. */
21913 var LARGE_ARRAY_SIZE = 200;
21914
21915 /** Used to stand-in for `undefined` hash values. */
21916 var HASH_UNDEFINED = '__lodash_hash_undefined__';
21917
21918 /** Used to compose bitmasks for value comparisons. */
21919 var COMPARE_PARTIAL_FLAG = 1,
21920 COMPARE_UNORDERED_FLAG = 2;
21921
21922 /** Used as references for various `Number` constants. */
21923 var MAX_SAFE_INTEGER = 9007199254740991;
21924
21925 /** `Object#toString` result references. */
21926 var argsTag = '[object Arguments]',
21927 arrayTag = '[object Array]',
21928 asyncTag = '[object AsyncFunction]',
21929 boolTag = '[object Boolean]',
21930 dateTag = '[object Date]',
21931 errorTag = '[object Error]',
21932 funcTag = '[object Function]',
21933 genTag = '[object GeneratorFunction]',
21934 mapTag = '[object Map]',
21935 numberTag = '[object Number]',
21936 nullTag = '[object Null]',
21937 objectTag = '[object Object]',
21938 promiseTag = '[object Promise]',
21939 proxyTag = '[object Proxy]',
21940 regexpTag = '[object RegExp]',
21941 setTag = '[object Set]',
21942 stringTag = '[object String]',
21943 symbolTag = '[object Symbol]',
21944 undefinedTag = '[object Undefined]',
21945 weakMapTag = '[object WeakMap]';
21946
21947 var arrayBufferTag = '[object ArrayBuffer]',
21948 dataViewTag = '[object DataView]',
21949 float32Tag = '[object Float32Array]',
21950 float64Tag = '[object Float64Array]',
21951 int8Tag = '[object Int8Array]',
21952 int16Tag = '[object Int16Array]',
21953 int32Tag = '[object Int32Array]',
21954 uint8Tag = '[object Uint8Array]',
21955 uint8ClampedTag = '[object Uint8ClampedArray]',
21956 uint16Tag = '[object Uint16Array]',
21957 uint32Tag = '[object Uint32Array]';
21958
21959 /**
21960 * Used to match `RegExp`
21961 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
21962 */
21963 var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
21964
21965 /** Used to detect host constructors (Safari). */
21966 var reIsHostCtor = /^\[object .+?Constructor\]$/;
21967
21968 /** Used to detect unsigned integer values. */
21969 var reIsUint = /^(?:0|[1-9]\d*)$/;
21970
21971 /** Used to identify `toStringTag` values of typed arrays. */
21972 var typedArrayTags = {};
21973 typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
21974 typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
21975 typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
21976 typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
21977 typedArrayTags[uint32Tag] = true;
21978 typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
21979 typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
21980 typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
21981 typedArrayTags[errorTag] = typedArrayTags[funcTag] =
21982 typedArrayTags[mapTag] = typedArrayTags[numberTag] =
21983 typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
21984 typedArrayTags[setTag] = typedArrayTags[stringTag] =
21985 typedArrayTags[weakMapTag] = false;
21986
21987 /** Detect free variable `global` from Node.js. */
21988 var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
21989
21990 /** Detect free variable `self`. */
21991 var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
21992
21993 /** Used as a reference to the global object. */
21994 var root = freeGlobal || freeSelf || Function('return this')();
21995
21996 /** Detect free variable `exports`. */
21997 var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
21998
21999 /** Detect free variable `module`. */
22000 var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
22001
22002 /** Detect the popular CommonJS extension `module.exports`. */
22003 var moduleExports = freeModule && freeModule.exports === freeExports;
22004
22005 /** Detect free variable `process` from Node.js. */
22006 var freeProcess = moduleExports && freeGlobal.process;
22007
22008 /** Used to access faster Node.js helpers. */
22009 var nodeUtil = (function() {
22010 try {
22011 return freeProcess && freeProcess.binding && freeProcess.binding('util');
22012 } catch (e) {}
22013 }());
22014
22015 /* Node.js helper references. */
22016 var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
22017
22018 /**
22019 * A specialized version of `_.filter` for arrays without support for
22020 * iteratee shorthands.
22021 *
22022 * @private
22023 * @param {Array} [array] The array to iterate over.
22024 * @param {Function} predicate The function invoked per iteration.
22025 * @returns {Array} Returns the new filtered array.
22026 */
22027 function arrayFilter(array, predicate) {
22028 var index = -1,
22029 length = array == null ? 0 : array.length,
22030 resIndex = 0,
22031 result = [];
22032
22033 while (++index < length) {
22034 var value = array[index];
22035 if (predicate(value, index, array)) {
22036 result[resIndex++] = value;
22037 }
22038 }
22039 return result;
22040 }
22041
22042 /**
22043 * Appends the elements of `values` to `array`.
22044 *
22045 * @private
22046 * @param {Array} array The array to modify.
22047 * @param {Array} values The values to append.
22048 * @returns {Array} Returns `array`.
22049 */
22050 function arrayPush(array, values) {
22051 var index = -1,
22052 length = values.length,
22053 offset = array.length;
22054
22055 while (++index < length) {
22056 array[offset + index] = values[index];
22057 }
22058 return array;
22059 }
22060
22061 /**
22062 * A specialized version of `_.some` for arrays without support for iteratee
22063 * shorthands.
22064 *
22065 * @private
22066 * @param {Array} [array] The array to iterate over.
22067 * @param {Function} predicate The function invoked per iteration.
22068 * @returns {boolean} Returns `true` if any element passes the predicate check,
22069 * else `false`.
22070 */
22071 function arraySome(array, predicate) {
22072 var index = -1,
22073 length = array == null ? 0 : array.length;
22074
22075 while (++index < length) {
22076 if (predicate(array[index], index, array)) {
22077 return true;
22078 }
22079 }
22080 return false;
22081 }
22082
22083 /**
22084 * The base implementation of `_.times` without support for iteratee shorthands
22085 * or max array length checks.
22086 *
22087 * @private
22088 * @param {number} n The number of times to invoke `iteratee`.
22089 * @param {Function} iteratee The function invoked per iteration.
22090 * @returns {Array} Returns the array of results.
22091 */
22092 function baseTimes(n, iteratee) {
22093 var index = -1,
22094 result = Array(n);
22095
22096 while (++index < n) {
22097 result[index] = iteratee(index);
22098 }
22099 return result;
22100 }
22101
22102 /**
22103 * The base implementation of `_.unary` without support for storing metadata.
22104 *
22105 * @private
22106 * @param {Function} func The function to cap arguments for.
22107 * @returns {Function} Returns the new capped function.
22108 */
22109 function baseUnary(func) {
22110 return function(value) {
22111 return func(value);
22112 };
22113 }
22114
22115 /**
22116 * Checks if a `cache` value for `key` exists.
22117 *
22118 * @private
22119 * @param {Object} cache The cache to query.
22120 * @param {string} key The key of the entry to check.
22121 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
22122 */
22123 function cacheHas(cache, key) {
22124 return cache.has(key);
22125 }
22126
22127 /**
22128 * Gets the value at `key` of `object`.
22129 *
22130 * @private
22131 * @param {Object} [object] The object to query.
22132 * @param {string} key The key of the property to get.
22133 * @returns {*} Returns the property value.
22134 */
22135 function getValue(object, key) {
22136 return object == null ? undefined : object[key];
22137 }
22138
22139 /**
22140 * Converts `map` to its key-value pairs.
22141 *
22142 * @private
22143 * @param {Object} map The map to convert.
22144 * @returns {Array} Returns the key-value pairs.
22145 */
22146 function mapToArray(map) {
22147 var index = -1,
22148 result = Array(map.size);
22149
22150 map.forEach(function(value, key) {
22151 result[++index] = [key, value];
22152 });
22153 return result;
22154 }
22155
22156 /**
22157 * Creates a unary function that invokes `func` with its argument transformed.
22158 *
22159 * @private
22160 * @param {Function} func The function to wrap.
22161 * @param {Function} transform The argument transform.
22162 * @returns {Function} Returns the new function.
22163 */
22164 function overArg(func, transform) {
22165 return function(arg) {
22166 return func(transform(arg));
22167 };
22168 }
22169
22170 /**
22171 * Converts `set` to an array of its values.
22172 *
22173 * @private
22174 * @param {Object} set The set to convert.
22175 * @returns {Array} Returns the values.
22176 */
22177 function setToArray(set) {
22178 var index = -1,
22179 result = Array(set.size);
22180
22181 set.forEach(function(value) {
22182 result[++index] = value;
22183 });
22184 return result;
22185 }
22186
22187 /** Used for built-in method references. */
22188 var arrayProto = Array.prototype,
22189 funcProto = Function.prototype,
22190 objectProto = Object.prototype;
22191
22192 /** Used to detect overreaching core-js shims. */
22193 var coreJsData = root['__core-js_shared__'];
22194
22195 /** Used to resolve the decompiled source of functions. */
22196 var funcToString = funcProto.toString;
22197
22198 /** Used to check objects for own properties. */
22199 var hasOwnProperty = objectProto.hasOwnProperty;
22200
22201 /** Used to detect methods masquerading as native. */
22202 var maskSrcKey = (function() {
22203 var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
22204 return uid ? ('Symbol(src)_1.' + uid) : '';
22205 }());
22206
22207 /**
22208 * Used to resolve the
22209 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
22210 * of values.
22211 */
22212 var nativeObjectToString = objectProto.toString;
22213
22214 /** Used to detect if a method is native. */
22215 var reIsNative = RegExp('^' +
22216 funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
22217 .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
22218 );
22219
22220 /** Built-in value references. */
22221 var Buffer = moduleExports ? root.Buffer : undefined,
22222 Symbol = root.Symbol,
22223 Uint8Array = root.Uint8Array,
22224 propertyIsEnumerable = objectProto.propertyIsEnumerable,
22225 splice = arrayProto.splice,
22226 symToStringTag = Symbol ? Symbol.toStringTag : undefined;
22227
22228 /* Built-in method references for those with the same name as other `lodash` methods. */
22229 var nativeGetSymbols = Object.getOwnPropertySymbols,
22230 nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
22231 nativeKeys = overArg(Object.keys, Object);
22232
22233 /* Built-in method references that are verified to be native. */
22234 var DataView = getNative(root, 'DataView'),
22235 Map = getNative(root, 'Map'),
22236 Promise = getNative(root, 'Promise'),
22237 Set = getNative(root, 'Set'),
22238 WeakMap = getNative(root, 'WeakMap'),
22239 nativeCreate = getNative(Object, 'create');
22240
22241 /** Used to detect maps, sets, and weakmaps. */
22242 var dataViewCtorString = toSource(DataView),
22243 mapCtorString = toSource(Map),
22244 promiseCtorString = toSource(Promise),
22245 setCtorString = toSource(Set),
22246 weakMapCtorString = toSource(WeakMap);
22247
22248 /** Used to convert symbols to primitives and strings. */
22249 var symbolProto = Symbol ? Symbol.prototype : undefined,
22250 symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
22251
22252 /**
22253 * Creates a hash object.
22254 *
22255 * @private
22256 * @constructor
22257 * @param {Array} [entries] The key-value pairs to cache.
22258 */
22259 function Hash(entries) {
22260 var index = -1,
22261 length = entries == null ? 0 : entries.length;
22262
22263 this.clear();
22264 while (++index < length) {
22265 var entry = entries[index];
22266 this.set(entry[0], entry[1]);
22267 }
22268 }
22269
22270 /**
22271 * Removes all key-value entries from the hash.
22272 *
22273 * @private
22274 * @name clear
22275 * @memberOf Hash
22276 */
22277 function hashClear() {
22278 this.__data__ = nativeCreate ? nativeCreate(null) : {};
22279 this.size = 0;
22280 }
22281
22282 /**
22283 * Removes `key` and its value from the hash.
22284 *
22285 * @private
22286 * @name delete
22287 * @memberOf Hash
22288 * @param {Object} hash The hash to modify.
22289 * @param {string} key The key of the value to remove.
22290 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
22291 */
22292 function hashDelete(key) {
22293 var result = this.has(key) && delete this.__data__[key];
22294 this.size -= result ? 1 : 0;
22295 return result;
22296 }
22297
22298 /**
22299 * Gets the hash value for `key`.
22300 *
22301 * @private
22302 * @name get
22303 * @memberOf Hash
22304 * @param {string} key The key of the value to get.
22305 * @returns {*} Returns the entry value.
22306 */
22307 function hashGet(key) {
22308 var data = this.__data__;
22309 if (nativeCreate) {
22310 var result = data[key];
22311 return result === HASH_UNDEFINED ? undefined : result;
22312 }
22313 return hasOwnProperty.call(data, key) ? data[key] : undefined;
22314 }
22315
22316 /**
22317 * Checks if a hash value for `key` exists.
22318 *
22319 * @private
22320 * @name has
22321 * @memberOf Hash
22322 * @param {string} key The key of the entry to check.
22323 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
22324 */
22325 function hashHas(key) {
22326 var data = this.__data__;
22327 return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
22328 }
22329
22330 /**
22331 * Sets the hash `key` to `value`.
22332 *
22333 * @private
22334 * @name set
22335 * @memberOf Hash
22336 * @param {string} key The key of the value to set.
22337 * @param {*} value The value to set.
22338 * @returns {Object} Returns the hash instance.
22339 */
22340 function hashSet(key, value) {
22341 var data = this.__data__;
22342 this.size += this.has(key) ? 0 : 1;
22343 data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
22344 return this;
22345 }
22346
22347 // Add methods to `Hash`.
22348 Hash.prototype.clear = hashClear;
22349 Hash.prototype['delete'] = hashDelete;
22350 Hash.prototype.get = hashGet;
22351 Hash.prototype.has = hashHas;
22352 Hash.prototype.set = hashSet;
22353
22354 /**
22355 * Creates an list cache object.
22356 *
22357 * @private
22358 * @constructor
22359 * @param {Array} [entries] The key-value pairs to cache.
22360 */
22361 function ListCache(entries) {
22362 var index = -1,
22363 length = entries == null ? 0 : entries.length;
22364
22365 this.clear();
22366 while (++index < length) {
22367 var entry = entries[index];
22368 this.set(entry[0], entry[1]);
22369 }
22370 }
22371
22372 /**
22373 * Removes all key-value entries from the list cache.
22374 *
22375 * @private
22376 * @name clear
22377 * @memberOf ListCache
22378 */
22379 function listCacheClear() {
22380 this.__data__ = [];
22381 this.size = 0;
22382 }
22383
22384 /**
22385 * Removes `key` and its value from the list cache.
22386 *
22387 * @private
22388 * @name delete
22389 * @memberOf ListCache
22390 * @param {string} key The key of the value to remove.
22391 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
22392 */
22393 function listCacheDelete(key) {
22394 var data = this.__data__,
22395 index = assocIndexOf(data, key);
22396
22397 if (index < 0) {
22398 return false;
22399 }
22400 var lastIndex = data.length - 1;
22401 if (index == lastIndex) {
22402 data.pop();
22403 } else {
22404 splice.call(data, index, 1);
22405 }
22406 --this.size;
22407 return true;
22408 }
22409
22410 /**
22411 * Gets the list cache value for `key`.
22412 *
22413 * @private
22414 * @name get
22415 * @memberOf ListCache
22416 * @param {string} key The key of the value to get.
22417 * @returns {*} Returns the entry value.
22418 */
22419 function listCacheGet(key) {
22420 var data = this.__data__,
22421 index = assocIndexOf(data, key);
22422
22423 return index < 0 ? undefined : data[index][1];
22424 }
22425
22426 /**
22427 * Checks if a list cache value for `key` exists.
22428 *
22429 * @private
22430 * @name has
22431 * @memberOf ListCache
22432 * @param {string} key The key of the entry to check.
22433 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
22434 */
22435 function listCacheHas(key) {
22436 return assocIndexOf(this.__data__, key) > -1;
22437 }
22438
22439 /**
22440 * Sets the list cache `key` to `value`.
22441 *
22442 * @private
22443 * @name set
22444 * @memberOf ListCache
22445 * @param {string} key The key of the value to set.
22446 * @param {*} value The value to set.
22447 * @returns {Object} Returns the list cache instance.
22448 */
22449 function listCacheSet(key, value) {
22450 var data = this.__data__,
22451 index = assocIndexOf(data, key);
22452
22453 if (index < 0) {
22454 ++this.size;
22455 data.push([key, value]);
22456 } else {
22457 data[index][1] = value;
22458 }
22459 return this;
22460 }
22461
22462 // Add methods to `ListCache`.
22463 ListCache.prototype.clear = listCacheClear;
22464 ListCache.prototype['delete'] = listCacheDelete;
22465 ListCache.prototype.get = listCacheGet;
22466 ListCache.prototype.has = listCacheHas;
22467 ListCache.prototype.set = listCacheSet;
22468
22469 /**
22470 * Creates a map cache object to store key-value pairs.
22471 *
22472 * @private
22473 * @constructor
22474 * @param {Array} [entries] The key-value pairs to cache.
22475 */
22476 function MapCache(entries) {
22477 var index = -1,
22478 length = entries == null ? 0 : entries.length;
22479
22480 this.clear();
22481 while (++index < length) {
22482 var entry = entries[index];
22483 this.set(entry[0], entry[1]);
22484 }
22485 }
22486
22487 /**
22488 * Removes all key-value entries from the map.
22489 *
22490 * @private
22491 * @name clear
22492 * @memberOf MapCache
22493 */
22494 function mapCacheClear() {
22495 this.size = 0;
22496 this.__data__ = {
22497 'hash': new Hash,
22498 'map': new (Map || ListCache),
22499 'string': new Hash
22500 };
22501 }
22502
22503 /**
22504 * Removes `key` and its value from the map.
22505 *
22506 * @private
22507 * @name delete
22508 * @memberOf MapCache
22509 * @param {string} key The key of the value to remove.
22510 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
22511 */
22512 function mapCacheDelete(key) {
22513 var result = getMapData(this, key)['delete'](key);
22514 this.size -= result ? 1 : 0;
22515 return result;
22516 }
22517
22518 /**
22519 * Gets the map value for `key`.
22520 *
22521 * @private
22522 * @name get
22523 * @memberOf MapCache
22524 * @param {string} key The key of the value to get.
22525 * @returns {*} Returns the entry value.
22526 */
22527 function mapCacheGet(key) {
22528 return getMapData(this, key).get(key);
22529 }
22530
22531 /**
22532 * Checks if a map value for `key` exists.
22533 *
22534 * @private
22535 * @name has
22536 * @memberOf MapCache
22537 * @param {string} key The key of the entry to check.
22538 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
22539 */
22540 function mapCacheHas(key) {
22541 return getMapData(this, key).has(key);
22542 }
22543
22544 /**
22545 * Sets the map `key` to `value`.
22546 *
22547 * @private
22548 * @name set
22549 * @memberOf MapCache
22550 * @param {string} key The key of the value to set.
22551 * @param {*} value The value to set.
22552 * @returns {Object} Returns the map cache instance.
22553 */
22554 function mapCacheSet(key, value) {
22555 var data = getMapData(this, key),
22556 size = data.size;
22557
22558 data.set(key, value);
22559 this.size += data.size == size ? 0 : 1;
22560 return this;
22561 }
22562
22563 // Add methods to `MapCache`.
22564 MapCache.prototype.clear = mapCacheClear;
22565 MapCache.prototype['delete'] = mapCacheDelete;
22566 MapCache.prototype.get = mapCacheGet;
22567 MapCache.prototype.has = mapCacheHas;
22568 MapCache.prototype.set = mapCacheSet;
22569
22570 /**
22571 *
22572 * Creates an array cache object to store unique values.
22573 *
22574 * @private
22575 * @constructor
22576 * @param {Array} [values] The values to cache.
22577 */
22578 function SetCache(values) {
22579 var index = -1,
22580 length = values == null ? 0 : values.length;
22581
22582 this.__data__ = new MapCache;
22583 while (++index < length) {
22584 this.add(values[index]);
22585 }
22586 }
22587
22588 /**
22589 * Adds `value` to the array cache.
22590 *
22591 * @private
22592 * @name add
22593 * @memberOf SetCache
22594 * @alias push
22595 * @param {*} value The value to cache.
22596 * @returns {Object} Returns the cache instance.
22597 */
22598 function setCacheAdd(value) {
22599 this.__data__.set(value, HASH_UNDEFINED);
22600 return this;
22601 }
22602
22603 /**
22604 * Checks if `value` is in the array cache.
22605 *
22606 * @private
22607 * @name has
22608 * @memberOf SetCache
22609 * @param {*} value The value to search for.
22610 * @returns {number} Returns `true` if `value` is found, else `false`.
22611 */
22612 function setCacheHas(value) {
22613 return this.__data__.has(value);
22614 }
22615
22616 // Add methods to `SetCache`.
22617 SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
22618 SetCache.prototype.has = setCacheHas;
22619
22620 /**
22621 * Creates a stack cache object to store key-value pairs.
22622 *
22623 * @private
22624 * @constructor
22625 * @param {Array} [entries] The key-value pairs to cache.
22626 */
22627 function Stack(entries) {
22628 var data = this.__data__ = new ListCache(entries);
22629 this.size = data.size;
22630 }
22631
22632 /**
22633 * Removes all key-value entries from the stack.
22634 *
22635 * @private
22636 * @name clear
22637 * @memberOf Stack
22638 */
22639 function stackClear() {
22640 this.__data__ = new ListCache;
22641 this.size = 0;
22642 }
22643
22644 /**
22645 * Removes `key` and its value from the stack.
22646 *
22647 * @private
22648 * @name delete
22649 * @memberOf Stack
22650 * @param {string} key The key of the value to remove.
22651 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
22652 */
22653 function stackDelete(key) {
22654 var data = this.__data__,
22655 result = data['delete'](key);
22656
22657 this.size = data.size;
22658 return result;
22659 }
22660
22661 /**
22662 * Gets the stack value for `key`.
22663 *
22664 * @private
22665 * @name get
22666 * @memberOf Stack
22667 * @param {string} key The key of the value to get.
22668 * @returns {*} Returns the entry value.
22669 */
22670 function stackGet(key) {
22671 return this.__data__.get(key);
22672 }
22673
22674 /**
22675 * Checks if a stack value for `key` exists.
22676 *
22677 * @private
22678 * @name has
22679 * @memberOf Stack
22680 * @param {string} key The key of the entry to check.
22681 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
22682 */
22683 function stackHas(key) {
22684 return this.__data__.has(key);
22685 }
22686
22687 /**
22688 * Sets the stack `key` to `value`.
22689 *
22690 * @private
22691 * @name set
22692 * @memberOf Stack
22693 * @param {string} key The key of the value to set.
22694 * @param {*} value The value to set.
22695 * @returns {Object} Returns the stack cache instance.
22696 */
22697 function stackSet(key, value) {
22698 var data = this.__data__;
22699 if (data instanceof ListCache) {
22700 var pairs = data.__data__;
22701 if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
22702 pairs.push([key, value]);
22703 this.size = ++data.size;
22704 return this;
22705 }
22706 data = this.__data__ = new MapCache(pairs);
22707 }
22708 data.set(key, value);
22709 this.size = data.size;
22710 return this;
22711 }
22712
22713 // Add methods to `Stack`.
22714 Stack.prototype.clear = stackClear;
22715 Stack.prototype['delete'] = stackDelete;
22716 Stack.prototype.get = stackGet;
22717 Stack.prototype.has = stackHas;
22718 Stack.prototype.set = stackSet;
22719
22720 /**
22721 * Creates an array of the enumerable property names of the array-like `value`.
22722 *
22723 * @private
22724 * @param {*} value The value to query.
22725 * @param {boolean} inherited Specify returning inherited property names.
22726 * @returns {Array} Returns the array of property names.
22727 */
22728 function arrayLikeKeys(value, inherited) {
22729 var isArr = isArray(value),
22730 isArg = !isArr && isArguments(value),
22731 isBuff = !isArr && !isArg && isBuffer(value),
22732 isType = !isArr && !isArg && !isBuff && isTypedArray(value),
22733 skipIndexes = isArr || isArg || isBuff || isType,
22734 result = skipIndexes ? baseTimes(value.length, String) : [],
22735 length = result.length;
22736
22737 for (var key in value) {
22738 if ((inherited || hasOwnProperty.call(value, key)) &&
22739 !(skipIndexes && (
22740 // Safari 9 has enumerable `arguments.length` in strict mode.
22741 key == 'length' ||
22742 // Node.js 0.10 has enumerable non-index properties on buffers.
22743 (isBuff && (key == 'offset' || key == 'parent')) ||
22744 // PhantomJS 2 has enumerable non-index properties on typed arrays.
22745 (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
22746 // Skip index properties.
22747 isIndex(key, length)
22748 ))) {
22749 result.push(key);
22750 }
22751 }
22752 return result;
22753 }
22754
22755 /**
22756 * Gets the index at which the `key` is found in `array` of key-value pairs.
22757 *
22758 * @private
22759 * @param {Array} array The array to inspect.
22760 * @param {*} key The key to search for.
22761 * @returns {number} Returns the index of the matched value, else `-1`.
22762 */
22763 function assocIndexOf(array, key) {
22764 var length = array.length;
22765 while (length--) {
22766 if (eq(array[length][0], key)) {
22767 return length;
22768 }
22769 }
22770 return -1;
22771 }
22772
22773 /**
22774 * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
22775 * `keysFunc` and `symbolsFunc` to get the enumerable property names and
22776 * symbols of `object`.
22777 *
22778 * @private
22779 * @param {Object} object The object to query.
22780 * @param {Function} keysFunc The function to get the keys of `object`.
22781 * @param {Function} symbolsFunc The function to get the symbols of `object`.
22782 * @returns {Array} Returns the array of property names and symbols.
22783 */
22784 function baseGetAllKeys(object, keysFunc, symbolsFunc) {
22785 var result = keysFunc(object);
22786 return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
22787 }
22788
22789 /**
22790 * The base implementation of `getTag` without fallbacks for buggy environments.
22791 *
22792 * @private
22793 * @param {*} value The value to query.
22794 * @returns {string} Returns the `toStringTag`.
22795 */
22796 function baseGetTag(value) {
22797 if (value == null) {
22798 return value === undefined ? undefinedTag : nullTag;
22799 }
22800 return (symToStringTag && symToStringTag in Object(value))
22801 ? getRawTag(value)
22802 : objectToString(value);
22803 }
22804
22805 /**
22806 * The base implementation of `_.isArguments`.
22807 *
22808 * @private
22809 * @param {*} value The value to check.
22810 * @returns {boolean} Returns `true` if `value` is an `arguments` object,
22811 */
22812 function baseIsArguments(value) {
22813 return isObjectLike(value) && baseGetTag(value) == argsTag;
22814 }
22815
22816 /**
22817 * The base implementation of `_.isEqual` which supports partial comparisons
22818 * and tracks traversed objects.
22819 *
22820 * @private
22821 * @param {*} value The value to compare.
22822 * @param {*} other The other value to compare.
22823 * @param {boolean} bitmask The bitmask flags.
22824 * 1 - Unordered comparison
22825 * 2 - Partial comparison
22826 * @param {Function} [customizer] The function to customize comparisons.
22827 * @param {Object} [stack] Tracks traversed `value` and `other` objects.
22828 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
22829 */
22830 function baseIsEqual(value, other, bitmask, customizer, stack) {
22831 if (value === other) {
22832 return true;
22833 }
22834 if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
22835 return value !== value && other !== other;
22836 }
22837 return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
22838 }
22839
22840 /**
22841 * A specialized version of `baseIsEqual` for arrays and objects which performs
22842 * deep comparisons and tracks traversed objects enabling objects with circular
22843 * references to be compared.
22844 *
22845 * @private
22846 * @param {Object} object The object to compare.
22847 * @param {Object} other The other object to compare.
22848 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
22849 * @param {Function} customizer The function to customize comparisons.
22850 * @param {Function} equalFunc The function to determine equivalents of values.
22851 * @param {Object} [stack] Tracks traversed `object` and `other` objects.
22852 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
22853 */
22854 function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
22855 var objIsArr = isArray(object),
22856 othIsArr = isArray(other),
22857 objTag = objIsArr ? arrayTag : getTag(object),
22858 othTag = othIsArr ? arrayTag : getTag(other);
22859
22860 objTag = objTag == argsTag ? objectTag : objTag;
22861 othTag = othTag == argsTag ? objectTag : othTag;
22862
22863 var objIsObj = objTag == objectTag,
22864 othIsObj = othTag == objectTag,
22865 isSameTag = objTag == othTag;
22866
22867 if (isSameTag && isBuffer(object)) {
22868 if (!isBuffer(other)) {
22869 return false;
22870 }
22871 objIsArr = true;
22872 objIsObj = false;
22873 }
22874 if (isSameTag && !objIsObj) {
22875 stack || (stack = new Stack);
22876 return (objIsArr || isTypedArray(object))
22877 ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
22878 : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
22879 }
22880 if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
22881 var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
22882 othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
22883
22884 if (objIsWrapped || othIsWrapped) {
22885 var objUnwrapped = objIsWrapped ? object.value() : object,
22886 othUnwrapped = othIsWrapped ? other.value() : other;
22887
22888 stack || (stack = new Stack);
22889 return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
22890 }
22891 }
22892 if (!isSameTag) {
22893 return false;
22894 }
22895 stack || (stack = new Stack);
22896 return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
22897 }
22898
22899 /**
22900 * The base implementation of `_.isNative` without bad shim checks.
22901 *
22902 * @private
22903 * @param {*} value The value to check.
22904 * @returns {boolean} Returns `true` if `value` is a native function,
22905 * else `false`.
22906 */
22907 function baseIsNative(value) {
22908 if (!isObject(value) || isMasked(value)) {
22909 return false;
22910 }
22911 var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
22912 return pattern.test(toSource(value));
22913 }
22914
22915 /**
22916 * The base implementation of `_.isTypedArray` without Node.js optimizations.
22917 *
22918 * @private
22919 * @param {*} value The value to check.
22920 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
22921 */
22922 function baseIsTypedArray(value) {
22923 return isObjectLike(value) &&
22924 isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
22925 }
22926
22927 /**
22928 * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
22929 *
22930 * @private
22931 * @param {Object} object The object to query.
22932 * @returns {Array} Returns the array of property names.
22933 */
22934 function baseKeys(object) {
22935 if (!isPrototype(object)) {
22936 return nativeKeys(object);
22937 }
22938 var result = [];
22939 for (var key in Object(object)) {
22940 if (hasOwnProperty.call(object, key) && key != 'constructor') {
22941 result.push(key);
22942 }
22943 }
22944 return result;
22945 }
22946
22947 /**
22948 * A specialized version of `baseIsEqualDeep` for arrays with support for
22949 * partial deep comparisons.
22950 *
22951 * @private
22952 * @param {Array} array The array to compare.
22953 * @param {Array} other The other array to compare.
22954 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
22955 * @param {Function} customizer The function to customize comparisons.
22956 * @param {Function} equalFunc The function to determine equivalents of values.
22957 * @param {Object} stack Tracks traversed `array` and `other` objects.
22958 * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
22959 */
22960 function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
22961 var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
22962 arrLength = array.length,
22963 othLength = other.length;
22964
22965 if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
22966 return false;
22967 }
22968 // Assume cyclic values are equal.
22969 var stacked = stack.get(array);
22970 if (stacked && stack.get(other)) {
22971 return stacked == other;
22972 }
22973 var index = -1,
22974 result = true,
22975 seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
22976
22977 stack.set(array, other);
22978 stack.set(other, array);
22979
22980 // Ignore non-index properties.
22981 while (++index < arrLength) {
22982 var arrValue = array[index],
22983 othValue = other[index];
22984
22985 if (customizer) {
22986 var compared = isPartial
22987 ? customizer(othValue, arrValue, index, other, array, stack)
22988 : customizer(arrValue, othValue, index, array, other, stack);
22989 }
22990 if (compared !== undefined) {
22991 if (compared) {
22992 continue;
22993 }
22994 result = false;
22995 break;
22996 }
22997 // Recursively compare arrays (susceptible to call stack limits).
22998 if (seen) {
22999 if (!arraySome(other, function(othValue, othIndex) {
23000 if (!cacheHas(seen, othIndex) &&
23001 (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
23002 return seen.push(othIndex);
23003 }
23004 })) {
23005 result = false;
23006 break;
23007 }
23008 } else if (!(
23009 arrValue === othValue ||
23010 equalFunc(arrValue, othValue, bitmask, customizer, stack)
23011 )) {
23012 result = false;
23013 break;
23014 }
23015 }
23016 stack['delete'](array);
23017 stack['delete'](other);
23018 return result;
23019 }
23020
23021 /**
23022 * A specialized version of `baseIsEqualDeep` for comparing objects of
23023 * the same `toStringTag`.
23024 *
23025 * **Note:** This function only supports comparing values with tags of
23026 * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
23027 *
23028 * @private
23029 * @param {Object} object The object to compare.
23030 * @param {Object} other The other object to compare.
23031 * @param {string} tag The `toStringTag` of the objects to compare.
23032 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
23033 * @param {Function} customizer The function to customize comparisons.
23034 * @param {Function} equalFunc The function to determine equivalents of values.
23035 * @param {Object} stack Tracks traversed `object` and `other` objects.
23036 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
23037 */
23038 function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
23039 switch (tag) {
23040 case dataViewTag:
23041 if ((object.byteLength != other.byteLength) ||
23042 (object.byteOffset != other.byteOffset)) {
23043 return false;
23044 }
23045 object = object.buffer;
23046 other = other.buffer;
23047
23048 case arrayBufferTag:
23049 if ((object.byteLength != other.byteLength) ||
23050 !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
23051 return false;
23052 }
23053 return true;
23054
23055 case boolTag:
23056 case dateTag:
23057 case numberTag:
23058 // Coerce booleans to `1` or `0` and dates to milliseconds.
23059 // Invalid dates are coerced to `NaN`.
23060 return eq(+object, +other);
23061
23062 case errorTag:
23063 return object.name == other.name && object.message == other.message;
23064
23065 case regexpTag:
23066 case stringTag:
23067 // Coerce regexes to strings and treat strings, primitives and objects,
23068 // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
23069 // for more details.
23070 return object == (other + '');
23071
23072 case mapTag:
23073 var convert = mapToArray;
23074
23075 case setTag:
23076 var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
23077 convert || (convert = setToArray);
23078
23079 if (object.size != other.size && !isPartial) {
23080 return false;
23081 }
23082 // Assume cyclic values are equal.
23083 var stacked = stack.get(object);
23084 if (stacked) {
23085 return stacked == other;
23086 }
23087 bitmask |= COMPARE_UNORDERED_FLAG;
23088
23089 // Recursively compare objects (susceptible to call stack limits).
23090 stack.set(object, other);
23091 var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
23092 stack['delete'](object);
23093 return result;
23094
23095 case symbolTag:
23096 if (symbolValueOf) {
23097 return symbolValueOf.call(object) == symbolValueOf.call(other);
23098 }
23099 }
23100 return false;
23101 }
23102
23103 /**
23104 * A specialized version of `baseIsEqualDeep` for objects with support for
23105 * partial deep comparisons.
23106 *
23107 * @private
23108 * @param {Object} object The object to compare.
23109 * @param {Object} other The other object to compare.
23110 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
23111 * @param {Function} customizer The function to customize comparisons.
23112 * @param {Function} equalFunc The function to determine equivalents of values.
23113 * @param {Object} stack Tracks traversed `object` and `other` objects.
23114 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
23115 */
23116 function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
23117 var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
23118 objProps = getAllKeys(object),
23119 objLength = objProps.length,
23120 othProps = getAllKeys(other),
23121 othLength = othProps.length;
23122
23123 if (objLength != othLength && !isPartial) {
23124 return false;
23125 }
23126 var index = objLength;
23127 while (index--) {
23128 var key = objProps[index];
23129 if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
23130 return false;
23131 }
23132 }
23133 // Assume cyclic values are equal.
23134 var stacked = stack.get(object);
23135 if (stacked && stack.get(other)) {
23136 return stacked == other;
23137 }
23138 var result = true;
23139 stack.set(object, other);
23140 stack.set(other, object);
23141
23142 var skipCtor = isPartial;
23143 while (++index < objLength) {
23144 key = objProps[index];
23145 var objValue = object[key],
23146 othValue = other[key];
23147
23148 if (customizer) {
23149 var compared = isPartial
23150 ? customizer(othValue, objValue, key, other, object, stack)
23151 : customizer(objValue, othValue, key, object, other, stack);
23152 }
23153 // Recursively compare objects (susceptible to call stack limits).
23154 if (!(compared === undefined
23155 ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
23156 : compared
23157 )) {
23158 result = false;
23159 break;
23160 }
23161 skipCtor || (skipCtor = key == 'constructor');
23162 }
23163 if (result && !skipCtor) {
23164 var objCtor = object.constructor,
23165 othCtor = other.constructor;
23166
23167 // Non `Object` object instances with different constructors are not equal.
23168 if (objCtor != othCtor &&
23169 ('constructor' in object && 'constructor' in other) &&
23170 !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
23171 typeof othCtor == 'function' && othCtor instanceof othCtor)) {
23172 result = false;
23173 }
23174 }
23175 stack['delete'](object);
23176 stack['delete'](other);
23177 return result;
23178 }
23179
23180 /**
23181 * Creates an array of own enumerable property names and symbols of `object`.
23182 *
23183 * @private
23184 * @param {Object} object The object to query.
23185 * @returns {Array} Returns the array of property names and symbols.
23186 */
23187 function getAllKeys(object) {
23188 return baseGetAllKeys(object, keys, getSymbols);
23189 }
23190
23191 /**
23192 * Gets the data for `map`.
23193 *
23194 * @private
23195 * @param {Object} map The map to query.
23196 * @param {string} key The reference key.
23197 * @returns {*} Returns the map data.
23198 */
23199 function getMapData(map, key) {
23200 var data = map.__data__;
23201 return isKeyable(key)
23202 ? data[typeof key == 'string' ? 'string' : 'hash']
23203 : data.map;
23204 }
23205
23206 /**
23207 * Gets the native function at `key` of `object`.
23208 *
23209 * @private
23210 * @param {Object} object The object to query.
23211 * @param {string} key The key of the method to get.
23212 * @returns {*} Returns the function if it's native, else `undefined`.
23213 */
23214 function getNative(object, key) {
23215 var value = getValue(object, key);
23216 return baseIsNative(value) ? value : undefined;
23217 }
23218
23219 /**
23220 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
23221 *
23222 * @private
23223 * @param {*} value The value to query.
23224 * @returns {string} Returns the raw `toStringTag`.
23225 */
23226 function getRawTag(value) {
23227 var isOwn = hasOwnProperty.call(value, symToStringTag),
23228 tag = value[symToStringTag];
23229
23230 try {
23231 value[symToStringTag] = undefined;
23232 var unmasked = true;
23233 } catch (e) {}
23234
23235 var result = nativeObjectToString.call(value);
23236 if (unmasked) {
23237 if (isOwn) {
23238 value[symToStringTag] = tag;
23239 } else {
23240 delete value[symToStringTag];
23241 }
23242 }
23243 return result;
23244 }
23245
23246 /**
23247 * Creates an array of the own enumerable symbols of `object`.
23248 *
23249 * @private
23250 * @param {Object} object The object to query.
23251 * @returns {Array} Returns the array of symbols.
23252 */
23253 var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
23254 if (object == null) {
23255 return [];
23256 }
23257 object = Object(object);
23258 return arrayFilter(nativeGetSymbols(object), function(symbol) {
23259 return propertyIsEnumerable.call(object, symbol);
23260 });
23261 };
23262
23263 /**
23264 * Gets the `toStringTag` of `value`.
23265 *
23266 * @private
23267 * @param {*} value The value to query.
23268 * @returns {string} Returns the `toStringTag`.
23269 */
23270 var getTag = baseGetTag;
23271
23272 // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
23273 if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
23274 (Map && getTag(new Map) != mapTag) ||
23275 (Promise && getTag(Promise.resolve()) != promiseTag) ||
23276 (Set && getTag(new Set) != setTag) ||
23277 (WeakMap && getTag(new WeakMap) != weakMapTag)) {
23278 getTag = function(value) {
23279 var result = baseGetTag(value),
23280 Ctor = result == objectTag ? value.constructor : undefined,
23281 ctorString = Ctor ? toSource(Ctor) : '';
23282
23283 if (ctorString) {
23284 switch (ctorString) {
23285 case dataViewCtorString: return dataViewTag;
23286 case mapCtorString: return mapTag;
23287 case promiseCtorString: return promiseTag;
23288 case setCtorString: return setTag;
23289 case weakMapCtorString: return weakMapTag;
23290 }
23291 }
23292 return result;
23293 };
23294 }
23295
23296 /**
23297 * Checks if `value` is a valid array-like index.
23298 *
23299 * @private
23300 * @param {*} value The value to check.
23301 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
23302 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
23303 */
23304 function isIndex(value, length) {
23305 length = length == null ? MAX_SAFE_INTEGER : length;
23306 return !!length &&
23307 (typeof value == 'number' || reIsUint.test(value)) &&
23308 (value > -1 && value % 1 == 0 && value < length);
23309 }
23310
23311 /**
23312 * Checks if `value` is suitable for use as unique object key.
23313 *
23314 * @private
23315 * @param {*} value The value to check.
23316 * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
23317 */
23318 function isKeyable(value) {
23319 var type = typeof value;
23320 return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
23321 ? (value !== '__proto__')
23322 : (value === null);
23323 }
23324
23325 /**
23326 * Checks if `func` has its source masked.
23327 *
23328 * @private
23329 * @param {Function} func The function to check.
23330 * @returns {boolean} Returns `true` if `func` is masked, else `false`.
23331 */
23332 function isMasked(func) {
23333 return !!maskSrcKey && (maskSrcKey in func);
23334 }
23335
23336 /**
23337 * Checks if `value` is likely a prototype object.
23338 *
23339 * @private
23340 * @param {*} value The value to check.
23341 * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
23342 */
23343 function isPrototype(value) {
23344 var Ctor = value && value.constructor,
23345 proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
23346
23347 return value === proto;
23348 }
23349
23350 /**
23351 * Converts `value` to a string using `Object.prototype.toString`.
23352 *
23353 * @private
23354 * @param {*} value The value to convert.
23355 * @returns {string} Returns the converted string.
23356 */
23357 function objectToString(value) {
23358 return nativeObjectToString.call(value);
23359 }
23360
23361 /**
23362 * Converts `func` to its source code.
23363 *
23364 * @private
23365 * @param {Function} func The function to convert.
23366 * @returns {string} Returns the source code.
23367 */
23368 function toSource(func) {
23369 if (func != null) {
23370 try {
23371 return funcToString.call(func);
23372 } catch (e) {}
23373 try {
23374 return (func + '');
23375 } catch (e) {}
23376 }
23377 return '';
23378 }
23379
23380 /**
23381 * Performs a
23382 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
23383 * comparison between two values to determine if they are equivalent.
23384 *
23385 * @static
23386 * @memberOf _
23387 * @since 4.0.0
23388 * @category Lang
23389 * @param {*} value The value to compare.
23390 * @param {*} other The other value to compare.
23391 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
23392 * @example
23393 *
23394 * var object = { 'a': 1 };
23395 * var other = { 'a': 1 };
23396 *
23397 * _.eq(object, object);
23398 * // => true
23399 *
23400 * _.eq(object, other);
23401 * // => false
23402 *
23403 * _.eq('a', 'a');
23404 * // => true
23405 *
23406 * _.eq('a', Object('a'));
23407 * // => false
23408 *
23409 * _.eq(NaN, NaN);
23410 * // => true
23411 */
23412 function eq(value, other) {
23413 return value === other || (value !== value && other !== other);
23414 }
23415
23416 /**
23417 * Checks if `value` is likely an `arguments` object.
23418 *
23419 * @static
23420 * @memberOf _
23421 * @since 0.1.0
23422 * @category Lang
23423 * @param {*} value The value to check.
23424 * @returns {boolean} Returns `true` if `value` is an `arguments` object,
23425 * else `false`.
23426 * @example
23427 *
23428 * _.isArguments(function() { return arguments; }());
23429 * // => true
23430 *
23431 * _.isArguments([1, 2, 3]);
23432 * // => false
23433 */
23434 var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
23435 return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
23436 !propertyIsEnumerable.call(value, 'callee');
23437 };
23438
23439 /**
23440 * Checks if `value` is classified as an `Array` object.
23441 *
23442 * @static
23443 * @memberOf _
23444 * @since 0.1.0
23445 * @category Lang
23446 * @param {*} value The value to check.
23447 * @returns {boolean} Returns `true` if `value` is an array, else `false`.
23448 * @example
23449 *
23450 * _.isArray([1, 2, 3]);
23451 * // => true
23452 *
23453 * _.isArray(document.body.children);
23454 * // => false
23455 *
23456 * _.isArray('abc');
23457 * // => false
23458 *
23459 * _.isArray(_.noop);
23460 * // => false
23461 */
23462 var isArray = Array.isArray;
23463
23464 /**
23465 * Checks if `value` is array-like. A value is considered array-like if it's
23466 * not a function and has a `value.length` that's an integer greater than or
23467 * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
23468 *
23469 * @static
23470 * @memberOf _
23471 * @since 4.0.0
23472 * @category Lang
23473 * @param {*} value The value to check.
23474 * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
23475 * @example
23476 *
23477 * _.isArrayLike([1, 2, 3]);
23478 * // => true
23479 *
23480 * _.isArrayLike(document.body.children);
23481 * // => true
23482 *
23483 * _.isArrayLike('abc');
23484 * // => true
23485 *
23486 * _.isArrayLike(_.noop);
23487 * // => false
23488 */
23489 function isArrayLike(value) {
23490 return value != null && isLength(value.length) && !isFunction(value);
23491 }
23492
23493 /**
23494 * Checks if `value` is a buffer.
23495 *
23496 * @static
23497 * @memberOf _
23498 * @since 4.3.0
23499 * @category Lang
23500 * @param {*} value The value to check.
23501 * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
23502 * @example
23503 *
23504 * _.isBuffer(new Buffer(2));
23505 * // => true
23506 *
23507 * _.isBuffer(new Uint8Array(2));
23508 * // => false
23509 */
23510 var isBuffer = nativeIsBuffer || stubFalse;
23511
23512 /**
23513 * Performs a deep comparison between two values to determine if they are
23514 * equivalent.
23515 *
23516 * **Note:** This method supports comparing arrays, array buffers, booleans,
23517 * date objects, error objects, maps, numbers, `Object` objects, regexes,
23518 * sets, strings, symbols, and typed arrays. `Object` objects are compared
23519 * by their own, not inherited, enumerable properties. Functions and DOM
23520 * nodes are compared by strict equality, i.e. `===`.
23521 *
23522 * @static
23523 * @memberOf _
23524 * @since 0.1.0
23525 * @category Lang
23526 * @param {*} value The value to compare.
23527 * @param {*} other The other value to compare.
23528 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
23529 * @example
23530 *
23531 * var object = { 'a': 1 };
23532 * var other = { 'a': 1 };
23533 *
23534 * _.isEqual(object, other);
23535 * // => true
23536 *
23537 * object === other;
23538 * // => false
23539 */
23540 function isEqual(value, other) {
23541 return baseIsEqual(value, other);
23542 }
23543
23544 /**
23545 * Checks if `value` is classified as a `Function` object.
23546 *
23547 * @static
23548 * @memberOf _
23549 * @since 0.1.0
23550 * @category Lang
23551 * @param {*} value The value to check.
23552 * @returns {boolean} Returns `true` if `value` is a function, else `false`.
23553 * @example
23554 *
23555 * _.isFunction(_);
23556 * // => true
23557 *
23558 * _.isFunction(/abc/);
23559 * // => false
23560 */
23561 function isFunction(value) {
23562 if (!isObject(value)) {
23563 return false;
23564 }
23565 // The use of `Object#toString` avoids issues with the `typeof` operator
23566 // in Safari 9 which returns 'object' for typed arrays and other constructors.
23567 var tag = baseGetTag(value);
23568 return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
23569 }
23570
23571 /**
23572 * Checks if `value` is a valid array-like length.
23573 *
23574 * **Note:** This method is loosely based on
23575 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
23576 *
23577 * @static
23578 * @memberOf _
23579 * @since 4.0.0
23580 * @category Lang
23581 * @param {*} value The value to check.
23582 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
23583 * @example
23584 *
23585 * _.isLength(3);
23586 * // => true
23587 *
23588 * _.isLength(Number.MIN_VALUE);
23589 * // => false
23590 *
23591 * _.isLength(Infinity);
23592 * // => false
23593 *
23594 * _.isLength('3');
23595 * // => false
23596 */
23597 function isLength(value) {
23598 return typeof value == 'number' &&
23599 value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
23600 }
23601
23602 /**
23603 * Checks if `value` is the
23604 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
23605 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
23606 *
23607 * @static
23608 * @memberOf _
23609 * @since 0.1.0
23610 * @category Lang
23611 * @param {*} value The value to check.
23612 * @returns {boolean} Returns `true` if `value` is an object, else `false`.
23613 * @example
23614 *
23615 * _.isObject({});
23616 * // => true
23617 *
23618 * _.isObject([1, 2, 3]);
23619 * // => true
23620 *
23621 * _.isObject(_.noop);
23622 * // => true
23623 *
23624 * _.isObject(null);
23625 * // => false
23626 */
23627 function isObject(value) {
23628 var type = typeof value;
23629 return value != null && (type == 'object' || type == 'function');
23630 }
23631
23632 /**
23633 * Checks if `value` is object-like. A value is object-like if it's not `null`
23634 * and has a `typeof` result of "object".
23635 *
23636 * @static
23637 * @memberOf _
23638 * @since 4.0.0
23639 * @category Lang
23640 * @param {*} value The value to check.
23641 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
23642 * @example
23643 *
23644 * _.isObjectLike({});
23645 * // => true
23646 *
23647 * _.isObjectLike([1, 2, 3]);
23648 * // => true
23649 *
23650 * _.isObjectLike(_.noop);
23651 * // => false
23652 *
23653 * _.isObjectLike(null);
23654 * // => false
23655 */
23656 function isObjectLike(value) {
23657 return value != null && typeof value == 'object';
23658 }
23659
23660 /**
23661 * Checks if `value` is classified as a typed array.
23662 *
23663 * @static
23664 * @memberOf _
23665 * @since 3.0.0
23666 * @category Lang
23667 * @param {*} value The value to check.
23668 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
23669 * @example
23670 *
23671 * _.isTypedArray(new Uint8Array);
23672 * // => true
23673 *
23674 * _.isTypedArray([]);
23675 * // => false
23676 */
23677 var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
23678
23679 /**
23680 * Creates an array of the own enumerable property names of `object`.
23681 *
23682 * **Note:** Non-object values are coerced to objects. See the
23683 * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
23684 * for more details.
23685 *
23686 * @static
23687 * @since 0.1.0
23688 * @memberOf _
23689 * @category Object
23690 * @param {Object} object The object to query.
23691 * @returns {Array} Returns the array of property names.
23692 * @example
23693 *
23694 * function Foo() {
23695 * this.a = 1;
23696 * this.b = 2;
23697 * }
23698 *
23699 * Foo.prototype.c = 3;
23700 *
23701 * _.keys(new Foo);
23702 * // => ['a', 'b'] (iteration order is not guaranteed)
23703 *
23704 * _.keys('hi');
23705 * // => ['0', '1']
23706 */
23707 function keys(object) {
23708 return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
23709 }
23710
23711 /**
23712 * This method returns a new empty array.
23713 *
23714 * @static
23715 * @memberOf _
23716 * @since 4.13.0
23717 * @category Util
23718 * @returns {Array} Returns the new empty array.
23719 * @example
23720 *
23721 * var arrays = _.times(2, _.stubArray);
23722 *
23723 * console.log(arrays);
23724 * // => [[], []]
23725 *
23726 * console.log(arrays[0] === arrays[1]);
23727 * // => false
23728 */
23729 function stubArray() {
23730 return [];
23731 }
23732
23733 /**
23734 * This method returns `false`.
23735 *
23736 * @static
23737 * @memberOf _
23738 * @since 4.13.0
23739 * @category Util
23740 * @returns {boolean} Returns `false`.
23741 * @example
23742 *
23743 * _.times(2, _.stubFalse);
23744 * // => [false, false]
23745 */
23746 function stubFalse() {
23747 return false;
23748 }
23749
23750 module.exports = isEqual;
23751
23752 /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(136)(module)))
23753
23754/***/ }),
23755/* 188 */
23756/***/ (function(module, exports, __webpack_require__) {
23757
23758 'use strict';
23759
23760 Object.defineProperty(exports, "__esModule", {
23761 value: true
23762 });
23763
23764 var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
23765
23766 var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
23767
23768 var _react = __webpack_require__(4);
23769
23770 var _react2 = _interopRequireDefault(_react);
23771
23772 var _reactDom = __webpack_require__(12);
23773
23774 var _reactDom2 = _interopRequireDefault(_reactDom);
23775
23776 var _reactBeautifulDnd = __webpack_require__(87);
23777
23778 var _util = __webpack_require__(189);
23779
23780 var _classnames = __webpack_require__(3);
23781
23782 var _classnames2 = _interopRequireDefault(_classnames);
23783
23784 var _lodash = __webpack_require__(187);
23785
23786 var _lodash2 = _interopRequireDefault(_lodash);
23787
23788 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
23789
23790 function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
23791
23792 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
23793
23794 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
23795
23796 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
23797
23798 var reorder = function reorder(list, startIndex, endIndex) {
23799 var result = Array.from(list);
23800
23801 var _result$splice = result.splice(startIndex, 1),
23802 _result$splice2 = _slicedToArray(_result$splice, 1),
23803 removed = _result$splice2[0];
23804
23805 result.splice(endIndex, 0, removed);
23806
23807 return result;
23808 };
23809
23810 var Vertical = function (_Component) {
23811 _inherits(Vertical, _Component);
23812
23813 function Vertical(props) {
23814 _classCallCheck(this, Vertical);
23815
23816 var _this = _possibleConstructorReturn(this, _Component.call(this, props));
23817
23818 _this.onDragEnd = function (result) {
23819 if (!result.destination) {
23820 return;
23821 }
23822 var items = reorder(_this.state.items, result.source.index, result.destination.index);
23823
23824 _this.setState({
23825 items: items
23826 });
23827 _this.props.onStop(result, items);
23828 };
23829
23830 _this.onDragStart = function (result) {
23831 _this.props.onStart(result, _this.state.items);
23832 };
23833
23834 _this.state = {
23835 items: _this.props.list || []
23836 };
23837 return _this;
23838 }
23839
23840 Vertical.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
23841 if (!(0, _lodash2['default'])(this.state.items, nextProps.list)) {
23842 this.setState({
23843 items: nextProps.list
23844 });
23845 }
23846 };
23847
23848 Vertical.prototype.render = function render() {
23849 var _this2 = this;
23850
23851 var _props = this.props,
23852 onStart = _props.onStart,
23853 onDrag = _props.onDrag,
23854 onStop = _props.onStop,
23855 onDragUpdate = _props.onDragUpdate,
23856 dropClass = _props.dropClass,
23857 dropOverClass = _props.dropOverClass,
23858 dragClass = _props.dragClass,
23859 dragingClass = _props.dragingClass,
23860 showKey = _props.showKey,
23861 type = _props.type;
23862
23863
23864 return _react2['default'].createElement(
23865 _reactBeautifulDnd.DragDropContext,
23866 { onDragEnd: this.onDragEnd, onDragStart: this.onDragStart, onDragUpdate: onDragUpdate },
23867 _react2['default'].createElement(
23868 _reactBeautifulDnd.Droppable,
23869 { droppableId: 'droppable', direction: type },
23870 function (provided, snapshot) {
23871 return _react2['default'].createElement(
23872 'div',
23873 {
23874 ref: provided.innerRef,
23875 className: (0, _classnames2['default'])(_extends({}, (0, _util.getClass)(_this2.props, snapshot.isDraggingOver).drop))
23876 },
23877 _this2.state.items.map(function (item, index) {
23878 return _react2['default'].createElement(
23879 _reactBeautifulDnd.Draggable,
23880 { key: index, draggableId: index, index: index },
23881 function (provided, snapshot) {
23882 return _react2['default'].createElement(
23883 'div',
23884 _extends({
23885 ref: provided.innerRef
23886 }, provided.draggableProps, provided.dragHandleProps, {
23887 className: (0, _classnames2['default'])(_extends({}, (0, _util.getClass)(_this2.props, snapshot.isDragging).drag)),
23888 style: _extends({}, provided.draggableProps.style)
23889 }),
23890 showKey ? item[showKey] : item
23891 );
23892 }
23893 );
23894 }),
23895 provided.placeholder
23896 );
23897 }
23898 )
23899 );
23900 };
23901
23902 return Vertical;
23903 }(_react.Component);
23904
23905 exports['default'] = Vertical;
23906 module.exports = exports['default'];
23907
23908/***/ }),
23909/* 189 */
23910/***/ (function(module, exports) {
23911
23912 'use strict';
23913
23914 Object.defineProperty(exports, "__esModule", {
23915 value: true
23916 });
23917 var getClass = exports.getClass = function getClass(props, doing) {
23918 var dropClass = props.dropClass,
23919 dropOverClass = props.dropOverClass,
23920 dragClass = props.dragClass,
23921 dragingClass = props.dragingClass,
23922 type = props.type;
23923
23924
23925 var verticalObj = {
23926 drop: {}, drag: {}
23927 };
23928 verticalObj.drop['u-drop ' + dropClass] = true;
23929 verticalObj.drop['u-droping ' + dropOverClass] = doing;
23930 verticalObj.drag['u-drag ' + dragClass] = true;
23931 verticalObj.drag['u-draging ' + dragingClass] = doing;
23932
23933 var horizontalObj = {
23934 drop: {}, drag: {}
23935 };
23936 horizontalObj.drop['u-drop u-drop-horizontal ' + dropClass] = true;
23937 horizontalObj.drop['u-droping u-droping-horizontal ' + dropOverClass] = doing;
23938 horizontalObj.drag['u-drag u-drag-horizontal ' + dragClass] = true;
23939 horizontalObj.drag['u-draging u-draging-horizontal ' + dragingClass] = doing;
23940
23941 switch (type) {
23942 case 'vertical':
23943 return verticalObj;
23944 break;
23945 case 'horizontal':
23946 return horizontalObj;
23947 break;
23948 case 'betweenVertical':
23949 return verticalObj;
23950 break;
23951 case 'betweenHorizontal':
23952 return horizontalObj;
23953 break;
23954 }
23955 };
23956
23957/***/ }),
23958/* 190 */
23959/***/ (function(module, exports, __webpack_require__) {
23960
23961 'use strict';
23962
23963 Object.defineProperty(exports, "__esModule", {
23964 value: true
23965 });
23966
23967 var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
23968
23969 var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
23970
23971 var _react = __webpack_require__(4);
23972
23973 var _react2 = _interopRequireDefault(_react);
23974
23975 var _reactDom = __webpack_require__(12);
23976
23977 var _reactDom2 = _interopRequireDefault(_reactDom);
23978
23979 var _reactBeautifulDnd = __webpack_require__(87);
23980
23981 var _util = __webpack_require__(189);
23982
23983 var _classnames = __webpack_require__(3);
23984
23985 var _classnames2 = _interopRequireDefault(_classnames);
23986
23987 var _lodash = __webpack_require__(187);
23988
23989 var _lodash2 = _interopRequireDefault(_lodash);
23990
23991 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
23992
23993 function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
23994
23995 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
23996
23997 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
23998
23999 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
24000
24001 var reorder = function reorder(list, startIndex, endIndex) {
24002 var result = Array.from(list);
24003
24004 var _result$splice = result.splice(startIndex, 1),
24005 _result$splice2 = _slicedToArray(_result$splice, 1),
24006 removed = _result$splice2[0];
24007
24008 result.splice(endIndex, 0, removed);
24009
24010 return result;
24011 };
24012
24013 /**
24014 * Moves an item from one list to another list.
24015 */
24016 var move = function move(source, destination, droppableSource, droppableDestination) {
24017 var sourceClone = Array.from(source);
24018 var destClone = Array.from(destination);
24019
24020 var _sourceClone$splice = sourceClone.splice(droppableSource.index, 1),
24021 _sourceClone$splice2 = _slicedToArray(_sourceClone$splice, 1),
24022 removed = _sourceClone$splice2[0];
24023
24024 destClone.splice(droppableDestination.index, 0, removed);
24025
24026 var result = {};
24027 result[droppableSource.droppableId] = sourceClone;
24028 result[droppableDestination.droppableId] = destClone;
24029
24030 return result;
24031 };
24032
24033 var Between = function (_Component) {
24034 _inherits(Between, _Component);
24035
24036 function Between(props) {
24037 _classCallCheck(this, Between);
24038
24039 var _this = _possibleConstructorReturn(this, _Component.call(this, props));
24040
24041 _this.id2List = {
24042 droppable: 'items',
24043 droppable2: 'selected'
24044 };
24045
24046 _this.getList = function (id) {
24047 return _this.state[_this.id2List[id]];
24048 };
24049
24050 _this.onDragEnd = function (result) {
24051 console.log(result);
24052 var source = result.source,
24053 destination = result.destination;
24054
24055 // dropped outside the list
24056
24057 if (!destination) {
24058 return;
24059 }
24060 var list = _this.state.items;
24061 var otherList = _this.state.selected;
24062
24063 if (source.droppableId === destination.droppableId) {
24064 var items = reorder(_this.getList(source.droppableId), source.index, destination.index);
24065
24066 var state = { items: items };
24067 list = items;
24068
24069 if (source.droppableId === 'droppable2') {
24070 state = { selected: items };
24071 otherList = items;
24072 list = _this.state.items;
24073 }
24074 _this.setState(state);
24075 } else {
24076 var _result = move(_this.getList(source.droppableId), _this.getList(destination.droppableId), source, destination);
24077
24078 _this.setState({
24079 items: _result.droppable,
24080 selected: _result.droppable2
24081 });
24082 list = _result.droppable;
24083 otherList = _result.droppable2;
24084 }
24085 _this.props.onStop(result, {
24086 list: list,
24087 otherList: otherList
24088 });
24089 };
24090
24091 _this.onDragStart = function (result) {
24092 _this.props.onStart(result, {
24093 list: _this.state.list,
24094 otherList: _this.state.selected
24095 });
24096 };
24097
24098 _this.state = {
24099 items: _this.props.list,
24100 selected: _this.props.otherList
24101 };
24102 return _this;
24103 }
24104
24105 Between.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
24106 if (!(0, _lodash2['default'])(this.state.items, nextProps.list)) {
24107 this.setState({
24108 items: nextProps.list
24109 });
24110 }
24111 if (!(0, _lodash2['default'])(this.state.selected, nextProps.otherList)) {
24112 this.setState({
24113 selected: nextProps.otherList
24114 });
24115 }
24116 };
24117
24118 Between.prototype.render = function render() {
24119 var _this2 = this;
24120
24121 var _props = this.props,
24122 onStart = _props.onStart,
24123 onDrag = _props.onDrag,
24124 onStop = _props.onStop,
24125 onDragUpdate = _props.onDragUpdate,
24126 dropClass = _props.dropClass,
24127 dropOverClass = _props.dropOverClass,
24128 dragClass = _props.dragClass,
24129 dragingClass = _props.dragingClass,
24130 showKey = _props.showKey,
24131 type = _props.type;
24132
24133
24134 return _react2['default'].createElement(
24135 'div',
24136 { className: (0, _classnames2['default'])({
24137 'u-drag-between': type == 'betweenVertical',
24138 'u-drag-between u-drag-between-horizontal': type == 'betweenHorizontal'
24139
24140 }) },
24141 _react2['default'].createElement(
24142 _reactBeautifulDnd.DragDropContext,
24143 { onDragEnd: this.onDragEnd, onDragStart: this.onDragStart, onDragUpdate: onDragUpdate },
24144 _react2['default'].createElement(
24145 _reactBeautifulDnd.Droppable,
24146 { droppableId: 'droppable', direction: type == 'betweenVertical' ? 'vertical' : 'horizontal' },
24147 function (provided, snapshot) {
24148 return _react2['default'].createElement(
24149 'div',
24150 {
24151 ref: provided.innerRef,
24152 className: (0, _classnames2['default'])(_extends({}, (0, _util.getClass)(_this2.props, snapshot.isDraggingOver).drop)) },
24153 _this2.state.items.map(function (item, index) {
24154 return _react2['default'].createElement(
24155 _reactBeautifulDnd.Draggable,
24156 {
24157 key: '1' + index,
24158 draggableId: '1' + index,
24159 index: index },
24160 function (provided, snapshot) {
24161 return _react2['default'].createElement(
24162 'div',
24163 _extends({
24164 ref: provided.innerRef
24165 }, provided.draggableProps, provided.dragHandleProps, {
24166 className: (0, _classnames2['default'])(_extends({}, (0, _util.getClass)(_this2.props, snapshot.isDragging).drag)),
24167 style: _extends({}, provided.draggableProps.style) }),
24168 showKey ? item[showKey] : item
24169 );
24170 }
24171 );
24172 }),
24173 provided.placeholder
24174 );
24175 }
24176 ),
24177 _react2['default'].createElement(
24178 _reactBeautifulDnd.Droppable,
24179 { droppableId: 'droppable2', direction: type == 'betweenVertical' ? 'vertical' : 'horizontal' },
24180 function (provided, snapshot) {
24181 return _react2['default'].createElement(
24182 'div',
24183 {
24184 ref: provided.innerRef,
24185 className: (0, _classnames2['default'])(_extends({}, (0, _util.getClass)(_this2.props, snapshot.isDraggingOver).drop)) },
24186 _this2.state.selected.map(function (item, index) {
24187 return _react2['default'].createElement(
24188 _reactBeautifulDnd.Draggable,
24189 {
24190 key: '2' + index,
24191 draggableId: '2' + index,
24192 index: index },
24193 function (provided, snapshot) {
24194 return _react2['default'].createElement(
24195 'div',
24196 _extends({
24197 ref: provided.innerRef
24198 }, provided.draggableProps, provided.dragHandleProps, {
24199 className: (0, _classnames2['default'])(_extends({}, (0, _util.getClass)(_this2.props, snapshot.isDragging).drag)),
24200 style: _extends({}, provided.draggableProps.style) }),
24201 showKey ? item[showKey] : item
24202 );
24203 }
24204 );
24205 }),
24206 provided.placeholder
24207 );
24208 }
24209 )
24210 )
24211 );
24212 };
24213
24214 return Between;
24215 }(_react.Component);
24216
24217 exports['default'] = Between;
24218 module.exports = exports['default'];
24219
24220/***/ }),
24221/* 191 */
24222/***/ (function(module, exports, __webpack_require__) {
24223
24224 'use strict';
24225
24226 Object.defineProperty(exports, "__esModule", {
24227 value: true
24228 });
24229
24230 var _react = __webpack_require__(4);
24231
24232 var _react2 = _interopRequireDefault(_react);
24233
24234 var _beeButton = __webpack_require__(82);
24235
24236 var _beeButton2 = _interopRequireDefault(_beeButton);
24237
24238 var _index = __webpack_require__(85);
24239
24240 var _index2 = _interopRequireDefault(_index);
24241
24242 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
24243
24244 function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
24245
24246 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
24247
24248 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
24249
24250 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
24251 /**
24252 *
24253 * @title 单个元素沿x轴y轴拖拽
24254 * @description 设置axis="x"只可以沿着x轴拖拽,同理axis="y"只可以沿着y轴拖拽
24255 *
24256 */
24257
24258 var Demo2 = function (_Component) {
24259 _inherits(Demo2, _Component);
24260
24261 function Demo2() {
24262 var _temp, _this, _ret;
24263
24264 _classCallCheck(this, Demo2);
24265
24266 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
24267 args[_key] = arguments[_key];
24268 }
24269
24270 return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.onStart = function () {
24271 console.log('start');
24272 }, _this.onStop = function () {
24273 console.log('stop');
24274 }, _temp), _possibleConstructorReturn(_this, _ret);
24275 }
24276
24277 Demo2.prototype.render = function render() {
24278 return _react2['default'].createElement(
24279 'div',
24280 null,
24281 _react2['default'].createElement(
24282 _index2['default'],
24283 { axis: 'x', onStart: this.onStart, onStop: this.onStop },
24284 _react2['default'].createElement(
24285 'div',
24286 { className: 'demo' },
24287 '\u6211\u53EA\u53EF\u5EF6X\u8F74\u62D6\u62FD'
24288 )
24289 )
24290 );
24291 };
24292
24293 return Demo2;
24294 }(_react.Component);
24295
24296 exports['default'] = Demo2;
24297 module.exports = exports['default'];
24298
24299/***/ }),
24300/* 192 */
24301/***/ (function(module, exports, __webpack_require__) {
24302
24303 'use strict';
24304
24305 Object.defineProperty(exports, "__esModule", {
24306 value: true
24307 });
24308
24309 var _react = __webpack_require__(4);
24310
24311 var _react2 = _interopRequireDefault(_react);
24312
24313 var _beeButton = __webpack_require__(82);
24314
24315 var _beeButton2 = _interopRequireDefault(_beeButton);
24316
24317 var _index = __webpack_require__(85);
24318
24319 var _index2 = _interopRequireDefault(_index);
24320
24321 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
24322
24323 function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
24324
24325 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
24326
24327 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
24328
24329 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
24330 /**
24331 *
24332 * @title 设置元素不可拖拽
24333 * @description 设置 onStart 的返回值为false,则不可以拖拽
24334 *
24335 */
24336
24337 var Demo3 = function (_Component) {
24338 _inherits(Demo3, _Component);
24339
24340 function Demo3() {
24341 var _temp, _this, _ret;
24342
24343 _classCallCheck(this, Demo3);
24344
24345 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
24346 args[_key] = arguments[_key];
24347 }
24348
24349 return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.onStart = function () {
24350 console.log('start');
24351 return false;
24352 }, _this.onStop = function () {
24353 console.log('stop');
24354 }, _temp), _possibleConstructorReturn(_this, _ret);
24355 }
24356
24357 Demo3.prototype.render = function render() {
24358 return _react2['default'].createElement(
24359 'div',
24360 { className: 'demo-3' },
24361 _react2['default'].createElement(
24362 _index2['default'],
24363 { onStart: this.onStart, onStop: this.onStop },
24364 _react2['default'].createElement(
24365 'div',
24366 { className: 'demo3 demo' },
24367 '\u6211\u4E0D\u53EF\u4EE5\u62D6\u62FD'
24368 )
24369 )
24370 );
24371 };
24372
24373 return Demo3;
24374 }(_react.Component);
24375
24376 exports['default'] = Demo3;
24377 module.exports = exports['default'];
24378
24379/***/ }),
24380/* 193 */
24381/***/ (function(module, exports, __webpack_require__) {
24382
24383 'use strict';
24384
24385 Object.defineProperty(exports, "__esModule", {
24386 value: true
24387 });
24388
24389 var _react = __webpack_require__(4);
24390
24391 var _react2 = _interopRequireDefault(_react);
24392
24393 var _beeIcon = __webpack_require__(194);
24394
24395 var _beeIcon2 = _interopRequireDefault(_beeIcon);
24396
24397 var _index = __webpack_require__(85);
24398
24399 var _index2 = _interopRequireDefault(_index);
24400
24401 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
24402
24403 function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
24404
24405 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
24406
24407 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
24408
24409 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } /**
24410 *
24411 * @title 单个元素拖拽把手
24412 * @description 设置 handle,值为选择器,例如 '.handle'
24413 * 设置不可拖拽区域 cancel,值为选择器,例如 '.handle'
24414 */
24415
24416 var Demo4 = function (_Component) {
24417 _inherits(Demo4, _Component);
24418
24419 function Demo4() {
24420 var _temp, _this, _ret;
24421
24422 _classCallCheck(this, Demo4);
24423
24424 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
24425 args[_key] = arguments[_key];
24426 }
24427
24428 return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.onStart = function () {
24429 console.log('start');
24430 }, _this.onStop = function () {
24431 console.log('stop');
24432 }, _temp), _possibleConstructorReturn(_this, _ret);
24433 }
24434
24435 Demo4.prototype.render = function render() {
24436 return _react2['default'].createElement(
24437 'div',
24438 { className: 'demo-4' },
24439 _react2['default'].createElement(
24440 'div',
24441 null,
24442 _react2['default'].createElement(
24443 _index2['default'],
24444 { handle: '.handle', onStart: this.onStart, onStop: this.onStop },
24445 _react2['default'].createElement(
24446 'div',
24447 { className: 'demo4 demo' },
24448 '\u9700\u8981\u62D6\u62FD\u628A\u624B',
24449 _react2['default'].createElement(
24450 'div',
24451 { className: 'handle' },
24452 _react2['default'].createElement(_beeIcon2['default'], { type: 'uf-move' })
24453 )
24454 )
24455 )
24456 )
24457 );
24458 };
24459
24460 return Demo4;
24461 }(_react.Component);
24462
24463 exports['default'] = Demo4;
24464 module.exports = exports['default'];
24465
24466/***/ }),
24467/* 194 */
24468/***/ (function(module, exports, __webpack_require__) {
24469
24470 'use strict';
24471
24472 Object.defineProperty(exports, "__esModule", {
24473 value: true
24474 });
24475
24476 var _Icon = __webpack_require__(195);
24477
24478 var _Icon2 = _interopRequireDefault(_Icon);
24479
24480 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
24481
24482 exports["default"] = _Icon2["default"];
24483 module.exports = exports['default'];
24484
24485/***/ }),
24486/* 195 */
24487/***/ (function(module, exports, __webpack_require__) {
24488
24489 'use strict';
24490
24491 Object.defineProperty(exports, "__esModule", {
24492 value: true
24493 });
24494
24495 var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
24496
24497 var _react = __webpack_require__(4);
24498
24499 var _react2 = _interopRequireDefault(_react);
24500
24501 var _classnames = __webpack_require__(3);
24502
24503 var _classnames2 = _interopRequireDefault(_classnames);
24504
24505 var _propTypes = __webpack_require__(5);
24506
24507 var _propTypes2 = _interopRequireDefault(_propTypes);
24508
24509 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
24510
24511 function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
24512
24513 function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
24514
24515 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
24516
24517 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
24518
24519 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
24520
24521 var propTypes = {
24522 type: _propTypes2["default"].string
24523
24524 };
24525 /**
24526 * badge 默认显示内容1
24527 */
24528 var defaultProps = {
24529 clsPrefix: 'uf'
24530 };
24531
24532 var Icon = function (_Component) {
24533 _inherits(Icon, _Component);
24534
24535 function Icon(props) {
24536 _classCallCheck(this, Icon);
24537
24538 return _possibleConstructorReturn(this, _Component.call(this, props));
24539 }
24540
24541 Icon.prototype.render = function render() {
24542 var _props = this.props,
24543 type = _props.type,
24544 className = _props.className,
24545 clsPrefix = _props.clsPrefix,
24546 others = _objectWithoutProperties(_props, ['type', 'className', 'clsPrefix']);
24547
24548 var clsObj = {};
24549
24550 var classNames = (0, _classnames2["default"])(clsPrefix, type);
24551
24552 return _react2["default"].createElement('i', _extends({}, others, { className: (0, _classnames2["default"])(classNames, className) }));
24553 };
24554
24555 return Icon;
24556 }(_react.Component);
24557
24558 Icon.defaultProps = defaultProps;
24559 Icon.propTypes = propTypes;
24560
24561 exports["default"] = Icon;
24562 module.exports = exports['default'];
24563
24564/***/ }),
24565/* 196 */
24566/***/ (function(module, exports, __webpack_require__) {
24567
24568 'use strict';
24569
24570 Object.defineProperty(exports, "__esModule", {
24571 value: true
24572 });
24573
24574 var _react = __webpack_require__(4);
24575
24576 var _react2 = _interopRequireDefault(_react);
24577
24578 var _beeButton = __webpack_require__(82);
24579
24580 var _beeButton2 = _interopRequireDefault(_beeButton);
24581
24582 var _index = __webpack_require__(85);
24583
24584 var _index2 = _interopRequireDefault(_index);
24585
24586 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
24587
24588 function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
24589
24590 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
24591
24592 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
24593
24594 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
24595 /**
24596 *
24597 * @title 每次拖拽移动距离
24598 * @description 设置 grid={[x,y]}
24599 *
24600 */
24601
24602 var Demo5 = function (_Component) {
24603 _inherits(Demo5, _Component);
24604
24605 function Demo5() {
24606 var _temp, _this, _ret;
24607
24608 _classCallCheck(this, Demo5);
24609
24610 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
24611 args[_key] = arguments[_key];
24612 }
24613
24614 return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.onStart = function () {
24615 console.log('start');
24616 }, _this.onStop = function () {
24617 console.log('stop');
24618 }, _temp), _possibleConstructorReturn(_this, _ret);
24619 }
24620
24621 Demo5.prototype.render = function render() {
24622 return _react2['default'].createElement(
24623 'div',
24624 null,
24625 _react2['default'].createElement(
24626 _index2['default'],
24627 { grid: [25, 25], onStart: this.onStart, onStop: this.onStop },
24628 _react2['default'].createElement(
24629 'div',
24630 { className: 'demo' },
24631 '\u6211\u6BCF\u6B21\u62D6\u62FD\u53EF\u79FB\u52A825px'
24632 )
24633 )
24634 );
24635 };
24636
24637 return Demo5;
24638 }(_react.Component);
24639
24640 exports['default'] = Demo5;
24641 module.exports = exports['default'];
24642
24643/***/ }),
24644/* 197 */
24645/***/ (function(module, exports, __webpack_require__) {
24646
24647 'use strict';
24648
24649 Object.defineProperty(exports, "__esModule", {
24650 value: true
24651 });
24652
24653 var _react = __webpack_require__(4);
24654
24655 var _react2 = _interopRequireDefault(_react);
24656
24657 var _index = __webpack_require__(85);
24658
24659 var _index2 = _interopRequireDefault(_index);
24660
24661 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
24662
24663 function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
24664
24665 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
24666
24667 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
24668
24669 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
24670 /**
24671 *
24672 * @title 元素拖拽范围
24673 * @description 设置上下左右可拖拽范围 bounds={{top: -xxx, left: -xxx, right: xxx, bottom: xx}}
24674 *
24675 */
24676
24677 var Demo6 = function (_Component) {
24678 _inherits(Demo6, _Component);
24679
24680 function Demo6() {
24681 var _temp, _this, _ret;
24682
24683 _classCallCheck(this, Demo6);
24684
24685 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
24686 args[_key] = arguments[_key];
24687 }
24688
24689 return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.onStart = function () {
24690 console.log('start');
24691 }, _this.onStop = function () {
24692 console.log('stop');
24693 }, _temp), _possibleConstructorReturn(_this, _ret);
24694 }
24695
24696 Demo6.prototype.render = function render() {
24697 return _react2['default'].createElement(
24698 'div',
24699 { className: 'demo6' },
24700 _react2['default'].createElement(
24701 _index2['default'],
24702 { bounds: { top: -50, left: -50, right: 50, bottom: 50 }, onStart: this.onStart, onStop: this.onStop },
24703 _react2['default'].createElement(
24704 'div',
24705 { className: 'demo' },
24706 '\u6211\u53EA\u80FD\u518D\u4E0A\u4E0B\u5DE6\u53F350px\u5185\u79FB\u52A8'
24707 )
24708 )
24709 );
24710 };
24711
24712 return Demo6;
24713 }(_react.Component);
24714
24715 exports['default'] = Demo6;
24716 module.exports = exports['default'];
24717
24718/***/ }),
24719/* 198 */
24720/***/ (function(module, exports, __webpack_require__) {
24721
24722 'use strict';
24723
24724 Object.defineProperty(exports, "__esModule", {
24725 value: true
24726 });
24727
24728 var _react = __webpack_require__(4);
24729
24730 var _react2 = _interopRequireDefault(_react);
24731
24732 var _beeButton = __webpack_require__(82);
24733
24734 var _beeButton2 = _interopRequireDefault(_beeButton);
24735
24736 var _index = __webpack_require__(85);
24737
24738 var _index2 = _interopRequireDefault(_index);
24739
24740 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
24741
24742 function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
24743
24744 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
24745
24746 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
24747
24748 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
24749 /**
24750 *
24751 * @title 在指定容器中拖拽
24752 * @description 设置只可以在指定容器中移动
24753 * bounds的也可以设置为选择器,bounds=".demo8-parent"意为在class=demo8-parent的容器中移动
24754 */
24755
24756 var Demo7 = function (_Component) {
24757 _inherits(Demo7, _Component);
24758
24759 function Demo7() {
24760 var _temp, _this, _ret;
24761
24762 _classCallCheck(this, Demo7);
24763
24764 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
24765 args[_key] = arguments[_key];
24766 }
24767
24768 return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.onStart = function () {
24769 console.log('start');
24770 }, _this.onStop = function () {
24771 console.log('stop');
24772 }, _temp), _possibleConstructorReturn(_this, _ret);
24773 }
24774
24775 Demo7.prototype.render = function render() {
24776 return _react2['default'].createElement(
24777 'div',
24778 null,
24779 _react2['default'].createElement(
24780 'div',
24781 { className: 'demo7-parent' },
24782 _react2['default'].createElement(
24783 _index2['default'],
24784 { bounds: '.demo7-parent', onStart: this.onStart, onStop: this.onStop },
24785 _react2['default'].createElement(
24786 'div',
24787 { className: 'demo' },
24788 '\u6211\u53EA\u80FD\u5728\u7236\u7EA7\u5143\u7D20\u4E2D\u79FB\u52A8'
24789 )
24790 )
24791 )
24792 );
24793 };
24794
24795 return Demo7;
24796 }(_react.Component);
24797
24798 exports['default'] = Demo7;
24799 module.exports = exports['default'];
24800
24801/***/ }),
24802/* 199 */
24803/***/ (function(module, exports, __webpack_require__) {
24804
24805 'use strict';
24806
24807 Object.defineProperty(exports, "__esModule", {
24808 value: true
24809 });
24810
24811 var _react = __webpack_require__(4);
24812
24813 var _react2 = _interopRequireDefault(_react);
24814
24815 var _index = __webpack_require__(85);
24816
24817 var _index2 = _interopRequireDefault(_index);
24818
24819 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
24820
24821 function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
24822
24823 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
24824
24825 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
24826
24827 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } /**
24828 *
24829 * @title 数据集合拖拽列表排序
24830 * @description 增加list 可以为 [1,2,3]数组,
24831 * 也可以为 [{},{}...],需要配置 showKey 。
24832 * 也可以为 dom集合,见后边示例
24833 *
24834 */
24835
24836 var Demo8 = function (_Component) {
24837 _inherits(Demo8, _Component);
24838
24839 function Demo8() {
24840 var _temp, _this, _ret;
24841
24842 _classCallCheck(this, Demo8);
24843
24844 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
24845 args[_key] = arguments[_key];
24846 }
24847
24848 return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.onDragStart = function (result, list) {
24849 console.log('开始');
24850 }, _this.onDragEnd = function (result, list) {
24851 console.log('结束');
24852 }, _this.onDragUpdate = function (result) {
24853 console.log('update');
24854 }, _temp), _possibleConstructorReturn(_this, _ret);
24855 }
24856
24857 Demo8.prototype.render = function render() {
24858 var list = [{
24859 name: '第一',
24860 code: 'a'
24861 }, {
24862 name: '第二',
24863 code: 'b'
24864 }, {
24865 name: '第三',
24866 code: 'c'
24867 }, {
24868 name: '第四',
24869 code: 'd'
24870 }, {
24871 name: '第五',
24872 code: 'e'
24873 }];
24874 return _react2['default'].createElement(_index2['default'], { showKey: 'name', list: list, onDragUpdate: this.onDragUpdate, onStart: this.onDragStart, onStop: this.onDragEnd });
24875 };
24876
24877 return Demo8;
24878 }(_react.Component);
24879
24880 exports['default'] = Demo8;
24881 module.exports = exports['default'];
24882
24883/***/ }),
24884/* 200 */
24885/***/ (function(module, exports, __webpack_require__) {
24886
24887 'use strict';
24888
24889 Object.defineProperty(exports, "__esModule", {
24890 value: true
24891 });
24892
24893 var _react = __webpack_require__(4);
24894
24895 var _react2 = _interopRequireDefault(_react);
24896
24897 var _index = __webpack_require__(85);
24898
24899 var _index2 = _interopRequireDefault(_index);
24900
24901 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
24902
24903 function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
24904
24905 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
24906
24907 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
24908
24909 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
24910 /**
24911 *
24912 * @title DOM集合拖拽列表排序
24913 * @description list传dom集合
24914 *
24915 */
24916
24917 var Demo9 = function (_Component) {
24918 _inherits(Demo9, _Component);
24919
24920 function Demo9() {
24921 var _temp, _this, _ret;
24922
24923 _classCallCheck(this, Demo9);
24924
24925 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
24926 args[_key] = arguments[_key];
24927 }
24928
24929 return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.onDragStart = function (result, list) {
24930 console.log('开始');
24931 }, _this.onDragEnd = function (result, list) {
24932 console.log('结束');
24933 }, _temp), _possibleConstructorReturn(_this, _ret);
24934 }
24935
24936 Demo9.prototype.render = function render() {
24937 var list = [_react2['default'].createElement(
24938 'div',
24939 null,
24940 'DOM\u7B2C\u4E00'
24941 ), _react2['default'].createElement(
24942 'div',
24943 null,
24944 'DOM\u7B2C\u4E8C'
24945 ), _react2['default'].createElement(
24946 'div',
24947 null,
24948 'DOM\u7B2C\u4E09'
24949 ), _react2['default'].createElement(
24950 'div',
24951 null,
24952 'DOM\u7B2C\u56DB'
24953 ), _react2['default'].createElement(
24954 'div',
24955 null,
24956 'DOM\u7B2C\u4E94'
24957 )];
24958 return _react2['default'].createElement(_index2['default'], { list: list, onStart: this.onDragStart, onStop: this.onDragEnd });
24959 };
24960
24961 return Demo9;
24962 }(_react.Component);
24963
24964 exports['default'] = Demo9;
24965 module.exports = exports['default'];
24966
24967/***/ }),
24968/* 201 */
24969/***/ (function(module, exports, __webpack_require__) {
24970
24971 'use strict';
24972
24973 Object.defineProperty(exports, "__esModule", {
24974 value: true
24975 });
24976
24977 var _react = __webpack_require__(4);
24978
24979 var _react2 = _interopRequireDefault(_react);
24980
24981 var _Dnd = __webpack_require__(86);
24982
24983 var _Dnd2 = _interopRequireDefault(_Dnd);
24984
24985 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
24986
24987 function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
24988
24989 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
24990
24991 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
24992
24993 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
24994 /**
24995 *
24996 * @title 横向拖拽列表排序
24997 * @description type='horizontal'
24998 *
24999 */
25000
25001 var Demo90 = function (_Component) {
25002 _inherits(Demo90, _Component);
25003
25004 function Demo90() {
25005 _classCallCheck(this, Demo90);
25006
25007 return _possibleConstructorReturn(this, _Component.apply(this, arguments));
25008 }
25009
25010 Demo90.prototype.render = function render() {
25011 var list = ['第一', '第二', '第三', '第四', '第五'];
25012 return _react2['default'].createElement(_Dnd2['default'], { list: list, type: 'horizontal' });
25013 };
25014
25015 return Demo90;
25016 }(_react.Component);
25017
25018 exports['default'] = Demo90;
25019 module.exports = exports['default'];
25020
25021/***/ }),
25022/* 202 */
25023/***/ (function(module, exports, __webpack_require__) {
25024
25025 'use strict';
25026
25027 Object.defineProperty(exports, "__esModule", {
25028 value: true
25029 });
25030
25031 var _react = __webpack_require__(4);
25032
25033 var _react2 = _interopRequireDefault(_react);
25034
25035 var _Dnd = __webpack_require__(86);
25036
25037 var _Dnd2 = _interopRequireDefault(_Dnd);
25038
25039 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
25040
25041 function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
25042
25043 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
25044
25045 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
25046
25047 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
25048 /**
25049 *
25050 * @title 两列纵向拖拽
25051 * @description 设置 type='betweenVertical'。 如果不设置高度以及 overflow: scroll; 则高度会自动撑开
25052 *
25053 */
25054
25055 var Demo90 = function (_Component) {
25056 _inherits(Demo90, _Component);
25057
25058 function Demo90() {
25059 _classCallCheck(this, Demo90);
25060
25061 return _possibleConstructorReturn(this, _Component.apply(this, arguments));
25062 }
25063
25064 Demo90.prototype.render = function render() {
25065 var list1 = ['第一', '第二', '第三', '第四', '第五'];
25066 var list2 = ['1', '2', '3', '4', '5'];
25067 return _react2['default'].createElement(_Dnd2['default'], { className: 'demo91', list: list1, otherList: list2, type: 'betweenVertical' });
25068 };
25069
25070 return Demo90;
25071 }(_react.Component);
25072
25073 exports['default'] = Demo90;
25074 module.exports = exports['default'];
25075
25076/***/ }),
25077/* 203 */
25078/***/ (function(module, exports, __webpack_require__) {
25079
25080 'use strict';
25081
25082 Object.defineProperty(exports, "__esModule", {
25083 value: true
25084 });
25085
25086 var _react = __webpack_require__(4);
25087
25088 var _react2 = _interopRequireDefault(_react);
25089
25090 var _Dnd = __webpack_require__(86);
25091
25092 var _Dnd2 = _interopRequireDefault(_Dnd);
25093
25094 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
25095
25096 function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
25097
25098 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
25099
25100 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
25101
25102 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
25103 /**
25104 *
25105 * @title 两列横向拖拽
25106 * @description 设置 type='betweenVertical'
25107 *
25108 */
25109
25110 var Demo90 = function (_Component) {
25111 _inherits(Demo90, _Component);
25112
25113 function Demo90() {
25114 var _temp, _this, _ret;
25115
25116 _classCallCheck(this, Demo90);
25117
25118 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
25119 args[_key] = arguments[_key];
25120 }
25121
25122 return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.onDragStart = function (result, list) {
25123 console.log('开始');
25124 }, _this.onDragEnd = function (result, listObj) {
25125 console.log('结束');
25126 console.log(listObj);
25127 }, _temp), _possibleConstructorReturn(_this, _ret);
25128 }
25129
25130 Demo90.prototype.render = function render() {
25131 var list1 = ['第一', '第二', '第三', '第四', '第五'];
25132 var list2 = ['1', '2', '3', '4', '5'];
25133 return _react2['default'].createElement(_Dnd2['default'], { list: list1, otherList: list2, type: 'betweenHorizontal', onStart: this.onDragStart, onStop: this.onDragEnd });
25134 };
25135
25136 return Demo90;
25137 }(_react.Component);
25138
25139 exports['default'] = Demo90;
25140 module.exports = exports['default'];
25141
25142/***/ })
25143/******/ ]);
25144//# sourceMappingURL=demo.js.map
\No newline at end of file