1 | (function(modules) {
|
2 |
|
3 | var installedModules = {};
|
4 |
|
5 |
|
6 | function __webpack_require__(moduleId) {
|
7 |
|
8 |
|
9 | if(installedModules[moduleId])
|
10 | return installedModules[moduleId].exports;
|
11 |
|
12 |
|
13 | var module = installedModules[moduleId] = {
|
14 | exports: {},
|
15 | id: moduleId,
|
16 | loaded: false
|
17 | };
|
18 |
|
19 |
|
20 | modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
21 |
|
22 |
|
23 | module.loaded = true;
|
24 |
|
25 |
|
26 | return module.exports;
|
27 | }
|
28 |
|
29 |
|
30 |
|
31 | __webpack_require__.m = modules;
|
32 |
|
33 |
|
34 | __webpack_require__.c = installedModules;
|
35 |
|
36 |
|
37 | __webpack_require__.p = "";
|
38 |
|
39 |
|
40 | return __webpack_require__(0);
|
41 | })
|
42 |
|
43 | ([
|
44 |
|
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__(221);var Demo3 = __webpack_require__(222);var Demo4 = __webpack_require__(223);var Demo5 = __webpack_require__(224);var Demo6 = __webpack_require__(239);var Demo7 = __webpack_require__(240);var Demo8 = __webpack_require__(241);var DemoArray = [{ "example": _react2['default'].createElement(Demo1, null), "title": " 横向Menu纯菜单导航", "code": "/**\r\n * @title 横向Menu纯菜单导航\r\n * @description 更简洁,更方便\r\n */\r\n\r\nimport React, { Component } from 'react';\r\nimport { Menu } from 'tinper-bee';\r\n\r\nconst SubMenu = Menu.SubMenu;\r\nconst MenuItemGroup = Menu.ItemGroup;\r\n\r\n\r\nclass Demo1 extends Component {\r\n constructor(props, context) {\r\n super(props, context);\r\n this.state = {\r\n current: 'mail'\r\n }\r\n }\r\n\r\n handleClick = (e) => {\r\n this.setState({\r\n current: e.key,\r\n });\r\n }\r\n\r\n render() {\r\n return (\r\n <Menu onClick={this.handleClick}\r\n selectedKeys={[this.state.current]}\r\n mode=\"horizontal\"\r\n >\r\n <Menu.Item key=\"mail\" attribute={{'type': 'mail'}}>\r\n 组织 1\r\n </Menu.Item>\r\n <Menu.Item key=\"app\" disabled>\r\n 组织 2\r\n </Menu.Item>\r\n <SubMenu title={<span>组织 1 - 子</span>}>\r\n <MenuItemGroup title=\"组 1\">\r\n <Menu.Item key=\"setting:1\">选项 1</Menu.Item>\r\n <Menu.Item key=\"setting:2\">选项 2</Menu.Item>\r\n </MenuItemGroup>\r\n <MenuItemGroup title=\"组 2\">\r\n <Menu.Item key=\"setting:3\">选项 3</Menu.Item>\r\n <Menu.Item key=\"setting:4\">选项 4</Menu.Item>\r\n </MenuItemGroup>\r\n </SubMenu>\r\n </Menu>\r\n )\r\n }\r\n}\r\n\r\n", "desc": " 更简洁,更方便" }, { "example": _react2['default'].createElement(Demo2, null), "title": " 竖向Menu基础样式", "code": "/**\r\n * @title 竖向Menu基础样式\r\n * @description 子菜单竖向显示,可折叠。\r\n */\r\n\r\nimport React, { Component } from 'react';\r\nimport { Menu } from 'tinper-bee';\r\n\r\nconst SubMenu = Menu.SubMenu;\r\nconst MenuItemGroup = Menu.ItemGroup;\r\n\r\n\r\nclass Demo2 extends Component {\r\n constructor(props, context) {\r\n super(props, context);\r\n this.state = {\r\n current: 1\r\n }\r\n }\r\n\r\n handleClick = (e) => {\r\n\r\n this.setState({\r\n current: e.key,\r\n });\r\n }\r\n\r\n render() {\r\n return (\r\n <Menu theme=\"dark\" onClick={this.handleClick} style={{ width: 240 }} defaultOpenKeys={['demo3sub1']} selectedKeys={[this.state.current]} mode=\"inline\">\r\n <SubMenu key=\"demo3sub1\" title={<span><span>组织 1</span></span>}>\r\n <MenuItemGroup title=\"组 1\">\r\n <Menu.Item key=\"1\">选项 1</Menu.Item>\r\n <Menu.Item key=\"2\">选项 2</Menu.Item>\r\n </MenuItemGroup>\r\n <MenuItemGroup title=\"组 2\">\r\n <Menu.Item key=\"3\">选项 3</Menu.Item>\r\n <Menu.Item key=\"4\">选项 4</Menu.Item>\r\n </MenuItemGroup>\r\n </SubMenu>\r\n <SubMenu key=\"demo3sub2\" title={<span><span>组织 2</span></span>}>\r\n <Menu.Item key=\"5\">选项 5</Menu.Item>\r\n <Menu.Item key=\"6\">选项 6</Menu.Item>\r\n <SubMenu key=\"demo3sub3\" title=\"子项\">\r\n <Menu.Item key=\"7\">选项 7</Menu.Item>\r\n <Menu.Item key=\"8\">选项 8</Menu.Item>\r\n </SubMenu>\r\n </SubMenu>\r\n <SubMenu key=\"demo3sub4\" title={<span><span>组织 3</span></span>}>\r\n <Menu.Item key=\"9\">选项 9</Menu.Item>\r\n <Menu.Item key=\"10\">选项 10</Menu.Item>\r\n <Menu.Item key=\"11\">选项 11</Menu.Item>\r\n <Menu.Item key=\"12\">选项 12</Menu.Item>\r\n </SubMenu>\r\n </Menu>\r\n )\r\n }\r\n}\r\n\r\n", "desc": " 子菜单竖向显示,可折叠。" }, { "example": _react2['default'].createElement(Demo3, null), "title": " 竖向手风琴Menu", "code": "/**\r\n * @title 竖向手风琴Menu\r\n * @description 菜单展开是手风琴形式。\r\n */\r\n\r\n\r\nimport React, { Component } from 'react';\r\nimport { Menu } from 'tinper-bee';\r\n\r\nconst SubMenu = Menu.SubMenu;\r\n\r\n\r\nclass Demo3 extends Component {\r\n constructor(props, context) {\r\n super(props, context);\r\n this.state = {\r\n current: '1',\r\n openKeys: []\r\n }\r\n }\r\n handleClick = (e) => {\r\n console.log('Clicked: ', e);\r\n this.setState({current: e.key});\r\n }\r\n onOpenChange = (openKeys) => {\r\n const state = this.state;\r\n\r\n const latestOpenKey = this.myfilter(openKeys,state.openKeys);\r\n const latestCloseKey = this.myfilter(state.openKeys,openKeys);\r\n\r\n let nextOpenKeys = [];\r\n if (latestOpenKey) {\r\n nextOpenKeys = this.getAncestorKeys(latestOpenKey).concat(latestOpenKey);\r\n }\r\n if (latestCloseKey) {\r\n nextOpenKeys = this.getAncestorKeys(latestCloseKey);\r\n }\r\n this.setState({openKeys: nextOpenKeys});\r\n }\r\n\r\n //IE下 array.find()方法不可用\r\n myfilter = (arr1,arr2) => {\r\n if(arr2.length === 0 || !arr2) {\r\n return arr1[0];\r\n }\r\n\r\n for(var i=0;i<arr1.length;i++)\r\n {\r\n if(arr2.indexOf(arr1[i].toString()) === -1)\r\n {\r\n return arr1[i];\r\n } \r\n }\r\n return false;\r\n }\r\n\r\n getAncestorKeys = (key) => {\r\n const map = {\r\n sub3: ['sub2'],\r\n };\r\n return map[key] || [];\r\n }\r\n\r\n render() {\r\n return (\r\n <Menu\r\n mode=\"inline\"\r\n openKeys={this.state.openKeys}\r\n selectedKeys={[this.state.current]}\r\n style={{ width: 240 }}\r\n onOpenChange={this.onOpenChange}\r\n onClick={this.handleClick}>\r\n <SubMenu key=\"sub1\" title={<span><span>组织 1</span></span>}>\r\n <Menu.Item key=\"1\">选项 1</Menu.Item>\r\n <Menu.Item key=\"2\">选项 2</Menu.Item>\r\n <Menu.Item key=\"3\">选项 3</Menu.Item>\r\n <Menu.Item key=\"4\">选项 4</Menu.Item>\r\n </SubMenu>\r\n <SubMenu key=\"sub2\" title={<span><span>组织 2</span></span>}>\r\n <Menu.Item key=\"5\">选项 5</Menu.Item>\r\n <Menu.Item key=\"6\">选项 6</Menu.Item>\r\n <SubMenu key=\"sub3\" title=\"子项\">\r\n <Menu.Item key=\"7\">选项 7</Menu.Item>\r\n <Menu.Item key=\"8\">选项 8</Menu.Item>\r\n </SubMenu>\r\n </SubMenu>\r\n <SubMenu key=\"sub4\" title={<span><span>组织 3</span></span>}>\r\n <Menu.Item key=\"9\">选项 9</Menu.Item>\r\n <Menu.Item key=\"10\">选项 10</Menu.Item>\r\n <Menu.Item key=\"11\">选项 11</Menu.Item>\r\n <Menu.Item key=\"12\">选项 12</Menu.Item>\r\n </SubMenu>\r\n </Menu>\r\n )\r\n }\r\n}\r\n\r\n", "desc": " 菜单展开是手风琴形式。" }, { "example": _react2['default'].createElement(Demo4, null), "title": " 子菜单呼出形式Menu", "code": "/**\r\n * @title 子菜单呼出形式Menu\r\n * @description 子菜单在右侧呼出形式显示。\r\n */\r\n\r\nimport React, { Component } from 'react';\r\nimport { Menu } from 'tinper-bee';\r\n\r\nconst SubMenu = Menu.SubMenu;\r\nconst MenuItemGroup = Menu.ItemGroup;\r\n\r\n\r\n\r\nclass Demo4 extends Component {\r\n\r\n handleClick = (e) => {\r\n console.log('click', e);\r\n }\r\n render() {\r\n return (\r\n <Menu onClick={this.handleClick} style={{ width: 240 }} mode=\"vertical\">\r\n <SubMenu key=\"sub1\" title={<span><span>组织 1</span></span>}>\r\n <MenuItemGroup title=\"Item 1\">\r\n <Menu.Item key=\"1\">选项 1</Menu.Item>\r\n <Menu.Item key=\"2\">选项 2</Menu.Item>\r\n </MenuItemGroup>\r\n <MenuItemGroup title=\"Iteom 2\">\r\n <Menu.Item key=\"3\">选项 3</Menu.Item>\r\n <Menu.Item key=\"4\">选项 4</Menu.Item>\r\n </MenuItemGroup>\r\n </SubMenu>\r\n <SubMenu key=\"sub2\" title={<span><span>组织 2</span></span>}>\r\n <Menu.Item key=\"5\">选项 5</Menu.Item>\r\n <Menu.Item key=\"6\">选项 6</Menu.Item>\r\n <SubMenu key=\"sub3\" title=\"Submenu\">\r\n <Menu.Item key=\"7\">选项 7</Menu.Item>\r\n <Menu.Item key=\"8\">选项 8</Menu.Item>\r\n </SubMenu>\r\n </SubMenu>\r\n <SubMenu key=\"sub4\" title={<span><span>组织 3</span></span>}>\r\n <Menu.Item key=\"9\">选项 9</Menu.Item>\r\n <Menu.Item key=\"10\">选项 10</Menu.Item>\r\n <Menu.Item key=\"11\">选项 11</Menu.Item>\r\n <Menu.Item key=\"12\">选项 12</Menu.Item>\r\n </SubMenu>\r\n </Menu>\r\n )\r\n }\r\n}\r\n\r\n", "desc": " 子菜单在右侧呼出形式显示。" }, { "example": _react2['default'].createElement(Demo5, null), "title": " Navbar和Menus的组合", "code": "/**\r\n * @title Navbar和Menus的组合\r\n * @description 示例采取navbar与menus的组合,达到一种PC端常用的复合导航菜单。导航添加了常用的搜索表单消息提醒等组件。\r\n *\r\n */\r\n\r\nimport React, { Component } from 'react';\r\nimport { Menu, Navbar, Icon, Badge, FormControl } from 'tinper-bee';\r\n\n\n\n\r\n\r\n\n\r\nconst SubMenu = Menu.SubMenu;\r\nconst MenuItemGroup = Menu.ItemGroup;\r\nconst MenuToggle = Menu.MenuToggle;\r\nconst SideContainer = Menu.SideContainer;\r\n\r\nconst NavItem = Navbar.NavItem;\r\nconst Header = Navbar.Header;\r\nconst Brand = Navbar.Brand;\r\nconst Nav = Navbar.Nav;\r\n\r\n\r\nclass Demo5 extends Component {\r\n constructor(props, context) {\r\n super(props, context);\r\n this.state = {\r\n expanded: false,\r\n current: 1,\r\n searchValue:\"Search\"\r\n }\r\n }\r\n\r\n onToggle = (value) => {\r\n this.setState({expanded: value});\r\n }\r\n\r\n handleClick = (e) => {\r\n console.log('click ', e);\r\n this.setState({\r\n current: e.key\r\n });\r\n }\r\n\r\n onChange = (e) => {\r\n this.setState({searchValue:e});\r\n }\r\n\r\n render() {\r\n return (\r\n <div id=\"demo5\">\r\n <Navbar expanded={this.state.expanded} onToggle={this.onToggle}>\r\n <MenuToggle show/>\r\n <Header>\r\n <Brand>\r\n <a href=\"#\"><img style={{width:140}} src=\"http://design.yyuap.com/logos/logox.png\"/></a>\r\n </Brand>\r\n </Header>\r\n\r\n <Nav pullRight>\r\n <NavItem eventKey={1}>\r\n <FormControl\r\n type=\"text\"\r\n placeholder=\"Search\"\r\n onChange={this.onChange}\r\n value={this.state.searchValue}\r\n />\r\n </NavItem>\r\n <NavItem eventKey={2}>\r\n <Badge dataBadge=\"4\" colors=\"warning\">\r\n <Icon\r\n type=\"uf-bell\"\r\n />\r\n </Badge>\r\n </NavItem>\r\n <NavItem eventKey={3}>\r\n <Icon type=\"uf-bubble-o\" />\r\n </NavItem>\r\n <Menu mode=\"horizontal\" className=\"dropdown\">\r\n <SubMenu title={<span>刘认华<Icon type=\"uf-triangle-down\" /></span>}>\r\n <Menu.Item key=\"setting:1\">选项 1</Menu.Item>\r\n <Menu.Item key=\"setting:2\">选项 2</Menu.Item>\r\n <Menu.Item key=\"setting:3\">选项 3</Menu.Item>\r\n <Menu.Item key=\"setting:4\">选项 4</Menu.Item>\r\n </SubMenu>\r\n </Menu>\r\n </Nav>\r\n </Navbar>\r\n <SideContainer\r\n onToggle={this.onToggle}\r\n expanded={this.state.expanded}>\r\n <Menu onClick={this.handleClick}\r\n style={{ width: 240 }}\r\n defaultOpenKeys={['demo3sub1']}\r\n selectedKeys={[this.state.current]}\r\n mode=\"inline\"\r\n >\r\n <SubMenu key=\"demo3sub1\" title={<span><span>组织 1</span></span>}>\r\n <MenuItemGroup title=\"组 1\">\r\n <Menu.Item key=\"1\">选项 1</Menu.Item>\r\n <Menu.Item key=\"2\">选项 2</Menu.Item>\r\n </MenuItemGroup>\r\n <MenuItemGroup title=\"组 2\">\r\n <Menu.Item key=\"3\">选项 3</Menu.Item>\r\n <Menu.Item key=\"4\">选项 4</Menu.Item>\r\n </MenuItemGroup>\r\n </SubMenu>\r\n <SubMenu key=\"demo3sub2\" title={<span><span>组织 2</span></span>}>\r\n <Menu.Item key=\"5\">选项 5</Menu.Item>\r\n <Menu.Item key=\"6\">选项 6</Menu.Item>\r\n <SubMenu key=\"demo3sub3\" title=\"子项\">\r\n <Menu.Item key=\"7\">选项 7</Menu.Item>\r\n <Menu.Item key=\"8\">选项 8</Menu.Item>\r\n </SubMenu>\r\n </SubMenu>\r\n <SubMenu key=\"demo3sub4\" title={<span><span>组织 3</span></span>}>\r\n <Menu.Item key=\"9\">选项 9</Menu.Item>\r\n <Menu.Item key=\"10\">选项 10</Menu.Item>\r\n <Menu.Item key=\"11\">选项 11</Menu.Item>\r\n <Menu.Item key=\"12\">选项 12</Menu.Item>\r\n </SubMenu>\r\n </Menu>\r\n </SideContainer>\r\n </div>\r\n )\r\n }\r\n}\r\n\r\n", "desc": " 示例采取navbar与menus的组合,达到一种PC端常用的复合导航菜单。导航添加了常用的搜索表单消息提醒等组件。" }, { "example": _react2['default'].createElement(Demo6, null), "title": " 基础下拉菜单", "code": "/**\r\n * @title 基础下拉菜单\r\n * @description 如何获取选中对象自定义对象和数据\r\n *\r\n */\r\nimport React, { Component } from 'react';\r\nimport { Menu } from 'tinper-bee';\r\n\r\nconst SubMenu = Menu.SubMenu;\r\nconst MenuItemGroup = Menu.ItemGroup;\r\n\r\nclass Demo6 extends Component {\r\n constructor(props, context) {\r\n super(props, context);\r\n this.state = {\r\n current: 1\r\n }\r\n }\r\n\r\n handleClick = (e) => {\r\n\r\n this.setState({\r\n current: e.key,\r\n });\r\n }\r\n \r\n /**\r\n * 获取当前选中行的item对象。\r\n * @param {*} value \r\n */\r\n onSelect({item,key,selectedKeys}){ \r\n console.log(`${key} selected`); //获取key\r\n let currentObject = {};\r\n currentObject.value = item.props.children; //获取选中对象的数据\r\n currentObject.key = item.props.eventKey;\r\n console.log(currentObject); \r\n }\r\n\r\n render() {\r\n return (\r\n <Menu theme=\"dark\" onClick={this.handleClick} style={{ width: 240 }} defaultOpenKeys={['demo3sub1']} selectedKeys={[this.state.current]} mode=\"inline\" onSelect={this.onSelect.bind(this)}>\r\n <SubMenu key=\"demo3sub1\" title={<span><span>组织 1</span></span>}>\r\n <MenuItemGroup title=\"组 1\">\r\n <Menu.Item key=\"1\">选项 1</Menu.Item>\r\n <Menu.Item key=\"2\">选项 2</Menu.Item>\r\n </MenuItemGroup>\r\n <MenuItemGroup title=\"组 2\">\r\n <Menu.Item key=\"3\">选项 3</Menu.Item>\r\n <Menu.Item key=\"4\">选项 4</Menu.Item>\r\n </MenuItemGroup>\r\n </SubMenu>\r\n <SubMenu key=\"demo3sub2\" title={<span><span>组织 2</span></span>}>\r\n <Menu.Item key=\"5\">选项 5</Menu.Item>\r\n <Menu.Item key=\"6\">选项 6</Menu.Item>\r\n <SubMenu key=\"demo3sub3\" title=\"子项\">\r\n <Menu.Item key=\"7\">选项 7</Menu.Item>\r\n <Menu.Item key=\"8\">选项 8</Menu.Item>\r\n </SubMenu>\r\n </SubMenu>\r\n <SubMenu key=\"demo3sub4\" title={<span><span>组织 3</span></span>}>\r\n <Menu.Item key=\"9\">选项 9</Menu.Item>\r\n <Menu.Item key=\"10\">选项 10</Menu.Item>\r\n <Menu.Item key=\"11\">选项 11</Menu.Item>\r\n <Menu.Item key=\"12\">选项 12</Menu.Item>\r\n </SubMenu>\r\n </Menu>\r\n )\r\n }\r\n}\r\n\r\n", "desc": " 如何获取选中对象自定义对象和数据" }, { "example": _react2['default'].createElement(Demo7, null), "title": " 键盘操作示例一:子菜单在右侧呼出形式显示", "code": "/**\r\n * @title 键盘操作示例一:子菜单在右侧呼出形式显示\r\n * @description 子菜单在右侧呼出形式显示。\r\n */\r\n\r\nimport React, { Component } from 'react';\r\nimport { Menu } from 'tinper-bee';\r\n\r\nconst SubMenu = Menu.SubMenu;\r\nconst MenuItemGroup = Menu.ItemGroup;\r\n\r\n\r\n\r\nclass Demo4 extends Component {\r\n\r\n handleClick = (e) => {\r\n console.log('click', e);\r\n }\r\n render() {\r\n return (\r\n <div>\r\n <input style={{'marginBottom':'10px'}} placeholder=\"我是为了获得焦点\"/>\r\n <Menu onClick={this.handleClick} keyboard={true} style={{ width: 240 }} mode=\"vertical\">\r\n <SubMenu key=\"sub1\" title={<span><span>组织 1</span></span>}>\r\n <MenuItemGroup title=\"Item 1\">\r\n <Menu.Item key=\"1\">选项 1</Menu.Item>\r\n <Menu.Item key=\"2\">选项 2</Menu.Item>\r\n </MenuItemGroup>\r\n <MenuItemGroup title=\"Iteom 2\">\r\n <Menu.Item key=\"3\">选项 3</Menu.Item>\r\n <Menu.Item key=\"4\">选项 4</Menu.Item>\r\n </MenuItemGroup>\r\n </SubMenu>\r\n <SubMenu key=\"sub2\" title={<span><span>组织 2</span></span>}>\r\n <Menu.Item key=\"5\">选项 5</Menu.Item>\r\n <Menu.Item key=\"6\">选项 6</Menu.Item>\r\n <SubMenu key=\"sub3\" title=\"Submenu\">\r\n <Menu.Item key=\"7\">选项 7</Menu.Item>\r\n <Menu.Item key=\"8\">选项 8</Menu.Item>\r\n </SubMenu>\r\n </SubMenu>\r\n <SubMenu key=\"sub4\" title={<span><span>组织 3</span></span>}>\r\n <Menu.Item key=\"9\">选项 9</Menu.Item>\r\n <Menu.Item key=\"10\">选项 10</Menu.Item>\r\n <Menu.Item key=\"11\">选项 11</Menu.Item>\r\n <Menu.Item key=\"12\">选项 12</Menu.Item>\r\n </SubMenu>\r\n </Menu>\r\n </div>\r\n \r\n )\r\n }\r\n}\r\n\r\n", "desc": " 子菜单在右侧呼出形式显示。" }, { "example": _react2['default'].createElement(Demo8, null), "title": " 键盘操作示例二:竖向手风琴Menu", "code": "/**\r\n * @title 键盘操作示例二:竖向手风琴Menu\r\n * @description 菜单展开是手风琴形式。\r\n */\r\n\r\n\r\nimport React, { Component } from 'react';\r\nimport { Menu } from 'tinper-bee';\r\n\r\nconst SubMenu = Menu.SubMenu;\r\n\r\n\r\nclass Demo3 extends Component {\r\n constructor(props, context) {\r\n super(props, context);\r\n this.state = {\r\n current: '1',\r\n openKeys: []\r\n }\r\n }\r\n handleClick = (e) => {\r\n console.log('Clicked: ', e);\r\n this.setState({current: e.key});\r\n }\r\n onOpenChange = (openKeys) => {\r\n const state = this.state;\r\n\r\n const latestOpenKey = this.myfilter(openKeys,state.openKeys);\r\n const latestCloseKey = this.myfilter(state.openKeys,openKeys);\r\n\r\n let nextOpenKeys = [];\r\n if (latestOpenKey) {\r\n nextOpenKeys = this.getAncestorKeys(latestOpenKey).concat(latestOpenKey);\r\n }\r\n if (latestCloseKey) {\r\n nextOpenKeys = this.getAncestorKeys(latestCloseKey);\r\n }\r\n this.setState({openKeys: nextOpenKeys});\r\n }\r\n\r\n //IE下 array.find()方法不可用\r\n myfilter = (arr1,arr2) => {\r\n if(arr2.length === 0 || !arr2) {\r\n return arr1[0];\r\n }\r\n\r\n for(var i=0;i<arr1.length;i++)\r\n {\r\n if(arr2.indexOf(arr1[i].toString()) === -1)\r\n {\r\n return arr1[i];\r\n } \r\n }\r\n return false;\r\n }\r\n\r\n getAncestorKeys = (key) => {\r\n const map = {\r\n sub3: ['sub2'],\r\n };\r\n return map[key] || [];\r\n }\r\n\r\n render() {\r\n return (\r\n <div>\r\n <input style={{'marginBottom':'10px'}} placeholder=\"我是为了获得焦点\"/>\r\n <Menu\r\n mode=\"inline\" keyboard={true}\r\n openKeys={this.state.openKeys}\r\n selectedKeys={[this.state.current]}\r\n style={{ width: 240 }}\r\n onOpenChange={this.onOpenChange}\r\n onClick={this.handleClick}>\r\n <SubMenu key=\"sub1\" title={<span><span>组织 1</span></span>}>\r\n <Menu.Item key=\"1\">选项 1</Menu.Item>\r\n <Menu.Item key=\"2\">选项 2</Menu.Item>\r\n <Menu.Item key=\"3\">选项 3</Menu.Item>\r\n <Menu.Item key=\"4\">选项 4</Menu.Item>\r\n </SubMenu>\r\n <SubMenu key=\"sub2\" title={<span><span>组织 2</span></span>}>\r\n <Menu.Item key=\"5\">选项 5</Menu.Item>\r\n <Menu.Item key=\"6\">选项 6</Menu.Item>\r\n <SubMenu key=\"sub3\" title=\"子项\">\r\n <Menu.Item key=\"7\">选项 7</Menu.Item>\r\n <Menu.Item key=\"8\">选项 8</Menu.Item>\r\n </SubMenu>\r\n </SubMenu>\r\n <SubMenu key=\"sub4\" title={<span><span>组织 3</span></span>}>\r\n <Menu.Item key=\"9\">选项 9</Menu.Item>\r\n <Menu.Item key=\"10\">选项 10</Menu.Item>\r\n <Menu.Item key=\"11\">选项 11</Menu.Item>\r\n <Menu.Item key=\"12\">选项 12</Menu.Item>\r\n </SubMenu>\r\n </Menu>\r\n </div>\r\n \r\n )\r\n }\r\n}\r\n\r\n", "desc": " 菜单展开是手风琴形式。" }];
|
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 },
|
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 | { collapsible: true, headerContent: true, expanded: this.state.open, colors: 'bordered', header: header,
|
138 | footerStyle: { padding: 0 } },
|
139 | _react2['default'].createElement(
|
140 | 'pre',
|
141 | null,
|
142 | _react2['default'].createElement(
|
143 | 'code',
|
144 | { className: 'hljs javascript' },
|
145 | code
|
146 | )
|
147 | ),
|
148 | !!scss_code ? _react2['default'].createElement(
|
149 | 'pre',
|
150 | null,
|
151 | _react2['default'].createElement(
|
152 | 'code',
|
153 | { className: 'hljs css' },
|
154 | scss_code
|
155 | )
|
156 | ) : null
|
157 | )
|
158 | );
|
159 | };
|
160 |
|
161 | return Demo;
|
162 | }(_react.Component);
|
163 |
|
164 | var DemoGroup = function (_Component2) {
|
165 | _inherits(DemoGroup, _Component2);
|
166 |
|
167 | function DemoGroup(props) {
|
168 | _classCallCheck(this, DemoGroup);
|
169 |
|
170 | return _possibleConstructorReturn(this, _Component2.call(this, props));
|
171 | }
|
172 |
|
173 | DemoGroup.prototype.render = function render() {
|
174 | return _react2['default'].createElement(
|
175 | _beeLayout.Row,
|
176 | null,
|
177 | DemoArray.map(function (child, index) {
|
178 |
|
179 | return _react2['default'].createElement(Demo, { example: child.example, title: child.title, code: child.code, scss_code: child.scss_code,
|
180 | desc: child.desc, key: index });
|
181 | })
|
182 | );
|
183 | };
|
184 |
|
185 | return DemoGroup;
|
186 | }(_react.Component);
|
187 |
|
188 | _reactDom2['default'].render(_react2['default'].createElement(DemoGroup, null), document.getElementById('tinperBeeDemo'));
|
189 |
|
190 | }),
|
191 |
|
192 | (function(module, exports, __webpack_require__) {
|
193 |
|
194 | 'use strict';
|
195 |
|
196 | Object.defineProperty(exports, "__esModule", {
|
197 | value: true
|
198 | });
|
199 | exports.Con = exports.Row = exports.Col = undefined;
|
200 |
|
201 | var _Col2 = __webpack_require__(2);
|
202 |
|
203 | var _Col3 = _interopRequireDefault(_Col2);
|
204 |
|
205 | var _Row2 = __webpack_require__(6);
|
206 |
|
207 | var _Row3 = _interopRequireDefault(_Row2);
|
208 |
|
209 | var _Layout = __webpack_require__(7);
|
210 |
|
211 | var _Layout2 = _interopRequireDefault(_Layout);
|
212 |
|
213 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
214 |
|
215 | exports.Col = _Col3["default"];
|
216 | exports.Row = _Row3["default"];
|
217 | exports.Con = _Layout2["default"];
|
218 |
|
219 | }),
|
220 |
|
221 | (function(module, exports, __webpack_require__) {
|
222 |
|
223 | 'use strict';
|
224 |
|
225 | Object.defineProperty(exports, "__esModule", {
|
226 | value: true
|
227 | });
|
228 |
|
229 | 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; };
|
230 |
|
231 | var _classnames = __webpack_require__(3);
|
232 |
|
233 | var _classnames2 = _interopRequireDefault(_classnames);
|
234 |
|
235 | var _react = __webpack_require__(4);
|
236 |
|
237 | var _react2 = _interopRequireDefault(_react);
|
238 |
|
239 | var _propTypes = __webpack_require__(5);
|
240 |
|
241 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
242 |
|
243 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
244 |
|
245 | 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; }
|
246 |
|
247 | 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; }
|
248 |
|
249 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
250 |
|
251 | 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; }
|
252 |
|
253 | 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); }
|
254 |
|
255 | var propTypes = {
|
256 | componentClass: _propTypes2["default"].oneOfType([_propTypes2["default"].element, _propTypes2["default"].string]),
|
257 |
|
258 | |
259 |
|
260 |
|
261 | xs: _propTypes2["default"].number,
|
262 | |
263 |
|
264 |
|
265 | sm: _propTypes2["default"].number,
|
266 | |
267 |
|
268 |
|
269 | md: _propTypes2["default"].number,
|
270 | |
271 |
|
272 |
|
273 | lg: _propTypes2["default"].number,
|
274 | |
275 |
|
276 |
|
277 | xsOffset: _propTypes2["default"].number,
|
278 | |
279 |
|
280 |
|
281 | smOffset: _propTypes2["default"].number,
|
282 | |
283 |
|
284 |
|
285 | mdOffset: _propTypes2["default"].number,
|
286 | |
287 |
|
288 |
|
289 | lgOffset: _propTypes2["default"].number,
|
290 | |
291 |
|
292 |
|
293 | xsPush: _propTypes2["default"].number,
|
294 | |
295 |
|
296 |
|
297 | smPush: _propTypes2["default"].number,
|
298 | |
299 |
|
300 |
|
301 | mdPush: _propTypes2["default"].number,
|
302 | |
303 |
|
304 |
|
305 | lgPush: _propTypes2["default"].number,
|
306 | |
307 |
|
308 |
|
309 | xsPull: _propTypes2["default"].number,
|
310 | |
311 |
|
312 |
|
313 | smPull: _propTypes2["default"].number,
|
314 | |
315 |
|
316 |
|
317 | mdPull: _propTypes2["default"].number,
|
318 | |
319 |
|
320 |
|
321 | lgPull: _propTypes2["default"].number
|
322 | };
|
323 |
|
324 | var defaultProps = {
|
325 | componentClass: 'div',
|
326 | clsPrefix: 'u-col'
|
327 | };
|
328 |
|
329 | var DEVICE_SIZES = ['lg', 'md', 'sm', 'xs'];
|
330 |
|
331 | var Col = function (_Component) {
|
332 | _inherits(Col, _Component);
|
333 |
|
334 | function Col() {
|
335 | _classCallCheck(this, Col);
|
336 |
|
337 | return _possibleConstructorReturn(this, _Component.apply(this, arguments));
|
338 | }
|
339 |
|
340 | Col.prototype.render = function render() {
|
341 | var _props = this.props,
|
342 | Component = _props.componentClass,
|
343 | className = _props.className,
|
344 | clsPrefix = _props.clsPrefix,
|
345 | others = _objectWithoutProperties(_props, ['componentClass', 'className', 'clsPrefix']);
|
346 |
|
347 | var tbClass = [];
|
348 | |
349 |
|
350 |
|
351 |
|
352 | DEVICE_SIZES.forEach(function (size) {
|
353 | function popProp(propSuffix, modifier) {
|
354 | var propName = '' + size + propSuffix;
|
355 | var propValue = others[propName];
|
356 |
|
357 | if (propValue != undefined && propValue != null) {
|
358 | tbClass.push(clsPrefix + '-' + size + modifier + '-' + propValue);
|
359 | }
|
360 |
|
361 | delete others[propName];
|
362 | }
|
363 |
|
364 | popProp('', '');
|
365 | popProp('Offset', '-offset');
|
366 | popProp('Push', '-push');
|
367 | popProp('Pull', '-pull');
|
368 | });
|
369 |
|
370 | return _react2["default"].createElement(
|
371 | Component,
|
372 | _extends({
|
373 | className: (0, _classnames2["default"])(tbClass, className)
|
374 | }, others),
|
375 | this.props.children
|
376 | );
|
377 | };
|
378 |
|
379 | return Col;
|
380 | }(_react.Component);
|
381 |
|
382 | Col.defaultProps = defaultProps;
|
383 | Col.propTypes = propTypes;
|
384 |
|
385 | exports["default"] = Col;
|
386 | module.exports = exports['default'];
|
387 |
|
388 | }),
|
389 |
|
390 | (function(module, exports, __webpack_require__) {
|
391 |
|
392 | var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; |
393 |
|
394 |
|
395 |
|
396 |
|
397 |
|
398 |
|
399 | (function () {
|
400 | 'use strict';
|
401 |
|
402 | var hasOwn = {}.hasOwnProperty;
|
403 |
|
404 | function classNames () {
|
405 | var classes = [];
|
406 |
|
407 | for (var i = 0; i < arguments.length; i++) {
|
408 | var arg = arguments[i];
|
409 | if (!arg) continue;
|
410 |
|
411 | var argType = typeof arg;
|
412 |
|
413 | if (argType === 'string' || argType === 'number') {
|
414 | classes.push(arg);
|
415 | } else if (Array.isArray(arg) && arg.length) {
|
416 | var inner = classNames.apply(null, arg);
|
417 | if (inner) {
|
418 | classes.push(inner);
|
419 | }
|
420 | } else if (argType === 'object') {
|
421 | for (var key in arg) {
|
422 | if (hasOwn.call(arg, key) && arg[key]) {
|
423 | classes.push(key);
|
424 | }
|
425 | }
|
426 | }
|
427 | }
|
428 |
|
429 | return classes.join(' ');
|
430 | }
|
431 |
|
432 | if (typeof module !== 'undefined' && module.exports) {
|
433 | classNames.default = classNames;
|
434 | module.exports = classNames;
|
435 | } else if (true) {
|
436 |
|
437 | !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () {
|
438 | return classNames;
|
439 | }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
440 | } else {
|
441 | window.classNames = classNames;
|
442 | }
|
443 | }());
|
444 |
|
445 |
|
446 | }),
|
447 |
|
448 | (function(module, exports) {
|
449 |
|
450 | module.exports = React;
|
451 |
|
452 | }),
|
453 |
|
454 | (function(module, exports) {
|
455 |
|
456 | module.exports = PropTypes;
|
457 |
|
458 | }),
|
459 |
|
460 | (function(module, exports, __webpack_require__) {
|
461 |
|
462 | 'use strict';
|
463 |
|
464 | Object.defineProperty(exports, "__esModule", {
|
465 | value: true
|
466 | });
|
467 |
|
468 | 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; };
|
469 |
|
470 | var _classnames = __webpack_require__(3);
|
471 |
|
472 | var _classnames2 = _interopRequireDefault(_classnames);
|
473 |
|
474 | var _react = __webpack_require__(4);
|
475 |
|
476 | var _react2 = _interopRequireDefault(_react);
|
477 |
|
478 | var _propTypes = __webpack_require__(5);
|
479 |
|
480 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
481 |
|
482 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
483 |
|
484 | 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; }
|
485 |
|
486 | 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; }
|
487 |
|
488 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
489 |
|
490 | 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; }
|
491 |
|
492 | 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); }
|
493 |
|
494 | var propTypes = {
|
495 | componentClass: _propTypes2["default"].oneOfType([_propTypes2["default"].element, _propTypes2["default"].string])
|
496 | };
|
497 |
|
498 | var defaultProps = {
|
499 | componentClass: 'div',
|
500 | clsPrefix: 'u-row'
|
501 | };
|
502 |
|
503 | var Row = function (_Component) {
|
504 | _inherits(Row, _Component);
|
505 |
|
506 | function Row() {
|
507 | _classCallCheck(this, Row);
|
508 |
|
509 | return _possibleConstructorReturn(this, _Component.apply(this, arguments));
|
510 | }
|
511 |
|
512 | Row.prototype.render = function render() {
|
513 | var _props = this.props,
|
514 | Component = _props.componentClass,
|
515 | clsPrefix = _props.clsPrefix,
|
516 | className = _props.className,
|
517 | others = _objectWithoutProperties(_props, ['componentClass', 'clsPrefix', 'className']);
|
518 |
|
519 | var bsclass = '' + clsPrefix;
|
520 |
|
521 | return _react2["default"].createElement(
|
522 | Component,
|
523 | _extends({}, others, {
|
524 | className: (0, _classnames2["default"])(bsclass, className)
|
525 | }),
|
526 | this.props.children
|
527 | );
|
528 | };
|
529 |
|
530 | return Row;
|
531 | }(_react.Component);
|
532 |
|
533 | Row.propTypes = propTypes;
|
534 | Row.defaultProps = defaultProps;
|
535 |
|
536 | exports["default"] = Row;
|
537 | module.exports = exports['default'];
|
538 |
|
539 | }),
|
540 |
|
541 | (function(module, exports, __webpack_require__) {
|
542 |
|
543 | 'use strict';
|
544 |
|
545 | Object.defineProperty(exports, "__esModule", {
|
546 | value: true
|
547 | });
|
548 |
|
549 | 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; };
|
550 |
|
551 | var _classnames = __webpack_require__(3);
|
552 |
|
553 | var _classnames2 = _interopRequireDefault(_classnames);
|
554 |
|
555 | var _react = __webpack_require__(4);
|
556 |
|
557 | var _react2 = _interopRequireDefault(_react);
|
558 |
|
559 | var _propTypes = __webpack_require__(5);
|
560 |
|
561 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
562 |
|
563 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
564 |
|
565 | 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; }
|
566 |
|
567 | 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; }
|
568 |
|
569 | 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; }
|
570 |
|
571 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
572 |
|
573 | 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; }
|
574 |
|
575 | 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); }
|
576 |
|
577 | var propTypes = {
|
578 | |
579 |
|
580 |
|
581 | fluid: _propTypes2["default"].bool,
|
582 | |
583 |
|
584 |
|
585 | componentClass: _propTypes2["default"].oneOfType([_propTypes2["default"].element, _propTypes2["default"].string])
|
586 | };
|
587 |
|
588 | var defaultProps = {
|
589 | componentClass: 'div',
|
590 | fluid: false,
|
591 | clsPrefix: 'u-container'
|
592 | };
|
593 |
|
594 | var Con = function (_React$Component) {
|
595 | _inherits(Con, _React$Component);
|
596 |
|
597 | function Con() {
|
598 | _classCallCheck(this, Con);
|
599 |
|
600 | return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
601 | }
|
602 |
|
603 | Con.prototype.render = function render() {
|
604 | var _tbclass;
|
605 |
|
606 | var _props = this.props,
|
607 | fluid = _props.fluid,
|
608 | Component = _props.componentClass,
|
609 | clsPrefix = _props.clsPrefix,
|
610 | className = _props.className,
|
611 | others = _objectWithoutProperties(_props, ['fluid', 'componentClass', 'clsPrefix', 'className']);
|
612 |
|
613 | var tbclass = (_tbclass = {}, _defineProperty(_tbclass, '' + clsPrefix, !fluid), _defineProperty(_tbclass, clsPrefix + '-fluid', fluid), _tbclass);
|
614 |
|
615 | return _react2["default"].createElement(
|
616 | Component,
|
617 | _extends({}, others, {
|
618 | className: (0, _classnames2["default"])(tbclass, className)
|
619 | }),
|
620 | this.props.children
|
621 | );
|
622 | };
|
623 |
|
624 | return Con;
|
625 | }(_react2["default"].Component);
|
626 |
|
627 | Con.propTypes = propTypes;
|
628 | Con.defaultProps = defaultProps;
|
629 |
|
630 | exports["default"] = Con;
|
631 | module.exports = exports['default'];
|
632 |
|
633 | }),
|
634 |
|
635 | (function(module, exports, __webpack_require__) {
|
636 |
|
637 | 'use strict';
|
638 |
|
639 | Object.defineProperty(exports, "__esModule", {
|
640 | value: true
|
641 | });
|
642 | exports.PanelGroup = exports.Panel = undefined;
|
643 |
|
644 | var _Panel2 = __webpack_require__(9);
|
645 |
|
646 | var _Panel3 = _interopRequireDefault(_Panel2);
|
647 |
|
648 | var _PanelGroup2 = __webpack_require__(81);
|
649 |
|
650 | var _PanelGroup3 = _interopRequireDefault(_PanelGroup2);
|
651 |
|
652 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
653 |
|
654 | exports.Panel = _Panel3["default"];
|
655 | exports.PanelGroup = _PanelGroup3["default"];
|
656 |
|
657 | }),
|
658 |
|
659 | (function(module, exports, __webpack_require__) {
|
660 |
|
661 | 'use strict';
|
662 |
|
663 | Object.defineProperty(exports, "__esModule", {
|
664 | value: true
|
665 | });
|
666 |
|
667 | 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; };
|
668 |
|
669 | var _classnames = __webpack_require__(3);
|
670 |
|
671 | var _classnames2 = _interopRequireDefault(_classnames);
|
672 |
|
673 | var _react = __webpack_require__(4);
|
674 |
|
675 | var _react2 = _interopRequireDefault(_react);
|
676 |
|
677 | var _beeTransition = __webpack_require__(10);
|
678 |
|
679 | var _beeMessage = __webpack_require__(65);
|
680 |
|
681 | var _beeMessage2 = _interopRequireDefault(_beeMessage);
|
682 |
|
683 | var _propTypes = __webpack_require__(5);
|
684 |
|
685 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
686 |
|
687 | var _copyToClipboard = __webpack_require__(79);
|
688 |
|
689 | var _copyToClipboard2 = _interopRequireDefault(_copyToClipboard);
|
690 |
|
691 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
692 |
|
693 | 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; }
|
694 |
|
695 | 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; }
|
696 |
|
697 | 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; }
|
698 |
|
699 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
700 |
|
701 | 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; }
|
702 |
|
703 | 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); }
|
704 |
|
705 | var propTypes = {
|
706 |
|
707 | collapsible: _propTypes2["default"].bool,
|
708 | onSelect: _propTypes2["default"].func,
|
709 |
|
710 | header: _propTypes2["default"].node,
|
711 | headerStyle: _propTypes2["default"].object,
|
712 | id: _propTypes2["default"].oneOfType([_propTypes2["default"].string, _propTypes2["default"].number]),
|
713 | headerContent: _propTypes2["default"].bool,
|
714 |
|
715 | footer: _propTypes2["default"].node,
|
716 | footerStyle: _propTypes2["default"].object,
|
717 |
|
718 | defaultExpanded: _propTypes2["default"].bool,
|
719 |
|
720 | expanded: _propTypes2["default"].bool,
|
721 |
|
722 | eventKey: _propTypes2["default"].any,
|
723 | headerRole: _propTypes2["default"].string,
|
724 | panelRole: _propTypes2["default"].string,
|
725 |
|
726 | colors: _propTypes2["default"].oneOf(['primary', 'accent', 'success', 'info', 'warning', 'danger', 'default', 'bordered']),
|
727 |
|
728 |
|
729 | onEnter: _propTypes2["default"].func,
|
730 | onEntering: _propTypes2["default"].func,
|
731 | onEntered: _propTypes2["default"].func,
|
732 | onExit: _propTypes2["default"].func,
|
733 | onExiting: _propTypes2["default"].func,
|
734 | onExited: _propTypes2["default"].func,
|
735 |
|
736 | copyable: _propTypes2["default"].bool
|
737 | };
|
738 |
|
739 | var defaultProps = {
|
740 | defaultExpanded: false,
|
741 | clsPrefix: "u-panel",
|
742 | colors: "default"
|
743 | };
|
744 |
|
745 | var Panel = function (_React$Component) {
|
746 | _inherits(Panel, _React$Component);
|
747 |
|
748 | function Panel(props, context) {
|
749 | _classCallCheck(this, Panel);
|
750 |
|
751 | var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context));
|
752 |
|
753 | _this.handleClickTitle = _this.handleClickTitle.bind(_this);
|
754 |
|
755 | _this.state = {
|
756 | expanded: _this.props.defaultExpanded
|
757 | };
|
758 | return _this;
|
759 | }
|
760 |
|
761 |
|
762 |
|
763 |
|
764 | Panel.prototype.handleClickTitle = function handleClickTitle(e) {
|
765 |
|
766 | e.persist();
|
767 | e.selected = true;
|
768 |
|
769 | if (this.props.onSelect) {
|
770 | this.props.onSelect(this.props.eventKey, e);
|
771 | } else {
|
772 | e.preventDefault();
|
773 | }
|
774 |
|
775 | if (e.selected) {
|
776 | this.setState({ expanded: !this.state.expanded });
|
777 | }
|
778 | };
|
779 |
|
780 |
|
781 |
|
782 |
|
783 | Panel.prototype.renderHeader = function renderHeader(collapsible, header, id, role, expanded, clsPrefix) {
|
784 | var titleClassName = clsPrefix + '-title';
|
785 |
|
786 | if (!collapsible) {
|
787 | if (!_react2["default"].isValidElement(header)) {
|
788 | return header;
|
789 | }
|
790 |
|
791 | return (0, _react.cloneElement)(header, {
|
792 | className: (0, _classnames2["default"])(header.props.className, titleClassName)
|
793 | });
|
794 | }
|
795 |
|
796 | if (!_react2["default"].isValidElement(header)) {
|
797 | return _react2["default"].createElement(
|
798 | 'h4',
|
799 | { role: 'presentation', className: titleClassName },
|
800 | this.renderAnchor(header, id, role, expanded)
|
801 | );
|
802 | }
|
803 | if (this.props.headerContent) {
|
804 | return (0, _react.cloneElement)(header, {
|
805 | className: (0, _classnames2["default"])(header.props.className, titleClassName)
|
806 | });
|
807 | }
|
808 |
|
809 | return (0, _react.cloneElement)(header, {
|
810 | className: (0, _classnames2["default"])(header.props.className, titleClassName),
|
811 | children: this.renderAnchor(header.props.children, id, role, expanded)
|
812 | });
|
813 | };
|
814 |
|
815 |
|
816 |
|
817 |
|
818 | Panel.prototype.renderAnchor = function renderAnchor(header, id, role, expanded) {
|
819 | return _react2["default"].createElement(
|
820 | 'a',
|
821 | {
|
822 | role: role,
|
823 | href: id && '#' + id,
|
824 | 'aria-controls': id,
|
825 | 'aria-expanded': expanded,
|
826 | 'aria-selected': expanded,
|
827 | className: expanded ? null : 'collapsed'
|
828 | },
|
829 | header
|
830 | );
|
831 | };
|
832 |
|
833 |
|
834 |
|
835 |
|
836 | Panel.prototype.copyDemo = function copyDemo(e) {
|
837 | var panelTarget = e.target.parentNode;
|
838 | var clipBoardContent = panelTarget.firstChild.innerText;
|
839 | (0, _copyToClipboard2["default"])(clipBoardContent);
|
840 | _beeMessage2["default"].create({ content: '复制成功!', color: 'success', duration: 2 });
|
841 | };
|
842 |
|
843 |
|
844 |
|
845 |
|
846 | Panel.prototype.renderCollapsibleBody = function renderCollapsibleBody(id, expanded, role, children, clsPrefix, copyable, animationHooks) {
|
847 | return _react2["default"].createElement(
|
848 | _beeTransition.Collapse,
|
849 | _extends({ 'in': expanded }, animationHooks),
|
850 | _react2["default"].createElement(
|
851 | 'div',
|
852 | {
|
853 | id: id,
|
854 | role: role,
|
855 | className: clsPrefix + '-collapse',
|
856 | 'aria-hidden': !expanded
|
857 | },
|
858 | this.renderBody(children, clsPrefix, copyable)
|
859 | )
|
860 | );
|
861 | };
|
862 |
|
863 |
|
864 |
|
865 |
|
866 | Panel.prototype.renderBody = function renderBody(rawChildren, clsPrefix, copyable) {
|
867 | var self = this;
|
868 | var children = [];
|
869 | var bodyChildren = [];
|
870 |
|
871 | var bodyClassName = clsPrefix + '-body';
|
872 |
|
873 | function maybeAddBody(self) {
|
874 | if (!bodyChildren.length) {
|
875 | return;
|
876 | }
|
877 |
|
878 | children.push(_react2["default"].createElement(
|
879 | 'div',
|
880 | { key: children.length, className: bodyClassName },
|
881 | bodyChildren,
|
882 | copyable && _react2["default"].createElement('i', { className: clsPrefix + '-copy uf uf-files-o', onClick: self.copyDemo })
|
883 | ));
|
884 | bodyChildren = [];
|
885 | }
|
886 |
|
887 |
|
888 | _react2["default"].Children.toArray(rawChildren).forEach(function (child) {
|
889 | if (_react2["default"].isValidElement(child) && child.props.fill) {
|
890 | maybeAddBody(self);
|
891 |
|
892 |
|
893 | children.push((0, _react.cloneElement)(child, { fill: undefined }));
|
894 |
|
895 | return;
|
896 | }
|
897 | bodyChildren.push(child);
|
898 | });
|
899 |
|
900 | maybeAddBody(self);
|
901 |
|
902 | return children;
|
903 | };
|
904 |
|
905 | Panel.prototype.render = function render() {
|
906 | var _props = this.props,
|
907 | collapsible = _props.collapsible,
|
908 | header = _props.header,
|
909 | id = _props.id,
|
910 | footer = _props.footer,
|
911 | propsExpanded = _props.expanded,
|
912 | footerStyle = _props.footerStyle,
|
913 | headerStyle = _props.headerStyle,
|
914 | headerRole = _props.headerRole,
|
915 | panelRole = _props.panelRole,
|
916 | className = _props.className,
|
917 | colors = _props.colors,
|
918 | children = _props.children,
|
919 | onEnter = _props.onEnter,
|
920 | onEntering = _props.onEntering,
|
921 | onEntered = _props.onEntered,
|
922 | clsPrefix = _props.clsPrefix,
|
923 | onExit = _props.onExit,
|
924 | headerContent = _props.headerContent,
|
925 | onExiting = _props.onExiting,
|
926 | onExited = _props.onExited,
|
927 | defaultExpanded = _props.defaultExpanded,
|
928 | eventKey = _props.eventKey,
|
929 | onSelect = _props.onSelect,
|
930 | copyable = _props.copyable,
|
931 | 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']);
|
932 |
|
933 | var expanded = propsExpanded != null ? propsExpanded : this.state.expanded;
|
934 |
|
935 | var classes = {};
|
936 | classes['' + clsPrefix] = true;
|
937 | classes[clsPrefix + '-' + colors] = true;
|
938 |
|
939 | var headerClass = _defineProperty({}, clsPrefix + '-heading', true);
|
940 |
|
941 | copyable === false ? false : true;
|
942 | return _react2["default"].createElement(
|
943 | 'div',
|
944 | _extends({}, props, {
|
945 | className: (0, _classnames2["default"])(className, classes),
|
946 | id: collapsible ? null : id
|
947 | }),
|
948 | header && _react2["default"].createElement(
|
949 | 'div',
|
950 | { className: (0, _classnames2["default"])(headerClass), style: headerStyle, onClick: this.handleClickTitle },
|
951 | this.renderHeader(collapsible, header, id, headerRole, expanded, clsPrefix)
|
952 | ),
|
953 | 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),
|
954 | footer && _react2["default"].createElement(
|
955 | 'div',
|
956 | { className: clsPrefix + '-footer', style: footerStyle },
|
957 | footer
|
958 | )
|
959 | );
|
960 | };
|
961 |
|
962 | return Panel;
|
963 | }(_react2["default"].Component);
|
964 |
|
965 | Panel.propTypes = propTypes;
|
966 | Panel.defaultProps = defaultProps;
|
967 |
|
968 | exports["default"] = Panel;
|
969 | module.exports = exports['default'];
|
970 |
|
971 | }),
|
972 |
|
973 | (function(module, exports, __webpack_require__) {
|
974 |
|
975 | 'use strict';
|
976 |
|
977 | Object.defineProperty(exports, "__esModule", {
|
978 | value: true
|
979 | });
|
980 | exports.Fade = exports.Collapse = exports.Transition = undefined;
|
981 |
|
982 | var _Transition2 = __webpack_require__(11);
|
983 |
|
984 | var _Transition3 = _interopRequireDefault(_Transition2);
|
985 |
|
986 | var _Collapse2 = __webpack_require__(17);
|
987 |
|
988 | var _Collapse3 = _interopRequireDefault(_Collapse2);
|
989 |
|
990 | var _Fade2 = __webpack_require__(64);
|
991 |
|
992 | var _Fade3 = _interopRequireDefault(_Fade2);
|
993 |
|
994 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
995 |
|
996 | exports.Transition = _Transition3["default"];
|
997 | exports.Collapse = _Collapse3["default"];
|
998 | exports.Fade = _Fade3["default"];
|
999 |
|
1000 | }),
|
1001 |
|
1002 | (function(module, exports, __webpack_require__) {
|
1003 |
|
1004 | 'use strict';
|
1005 |
|
1006 | Object.defineProperty(exports, "__esModule", {
|
1007 | value: true
|
1008 | });
|
1009 | exports.EXITING = exports.ENTERED = exports.ENTERING = exports.EXITED = exports.UNMOUNTED = undefined;
|
1010 |
|
1011 | 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; };
|
1012 |
|
1013 | var _react = __webpack_require__(4);
|
1014 |
|
1015 | var _react2 = _interopRequireDefault(_react);
|
1016 |
|
1017 | var _reactDom = __webpack_require__(12);
|
1018 |
|
1019 | var _reactDom2 = _interopRequireDefault(_reactDom);
|
1020 |
|
1021 | var _properties = __webpack_require__(13);
|
1022 |
|
1023 | var _properties2 = _interopRequireDefault(_properties);
|
1024 |
|
1025 | var _on = __webpack_require__(16);
|
1026 |
|
1027 | var _on2 = _interopRequireDefault(_on);
|
1028 |
|
1029 | var _classnames = __webpack_require__(3);
|
1030 |
|
1031 | var _classnames2 = _interopRequireDefault(_classnames);
|
1032 |
|
1033 | var _propTypes = __webpack_require__(5);
|
1034 |
|
1035 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
1036 |
|
1037 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
1038 |
|
1039 | 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; }
|
1040 |
|
1041 | 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; }
|
1042 |
|
1043 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
1044 |
|
1045 | 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; }
|
1046 |
|
1047 | 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); }
|
1048 |
|
1049 | var transitionEndEvent = _properties2["default"].end;
|
1050 |
|
1051 |
|
1052 | var UNMOUNTED = exports.UNMOUNTED = 0;
|
1053 | var EXITED = exports.EXITED = 1;
|
1054 | var ENTERING = exports.ENTERING = 2;
|
1055 | var ENTERED = exports.ENTERED = 3;
|
1056 | var EXITING = exports.EXITING = 4;
|
1057 |
|
1058 | var propTypes = {
|
1059 | |
1060 |
|
1061 |
|
1062 | "in": _propTypes2["default"].bool,
|
1063 |
|
1064 | |
1065 |
|
1066 |
|
1067 | unmountOnExit: _propTypes2["default"].bool,
|
1068 |
|
1069 | |
1070 |
|
1071 |
|
1072 | transitionAppear: _propTypes2["default"].bool,
|
1073 |
|
1074 | |
1075 |
|
1076 |
|
1077 | timeout: _propTypes2["default"].number,
|
1078 |
|
1079 | |
1080 |
|
1081 |
|
1082 | exitedClassName: _propTypes2["default"].string,
|
1083 | |
1084 |
|
1085 |
|
1086 | exitingClassName: _propTypes2["default"].string,
|
1087 | |
1088 |
|
1089 |
|
1090 | enteredClassName: _propTypes2["default"].string,
|
1091 | |
1092 |
|
1093 |
|
1094 | enteringClassName: _propTypes2["default"].string,
|
1095 |
|
1096 | |
1097 |
|
1098 |
|
1099 | onEnter: _propTypes2["default"].func,
|
1100 | |
1101 |
|
1102 |
|
1103 | onEntering: _propTypes2["default"].func,
|
1104 | |
1105 |
|
1106 |
|
1107 | onEntered: _propTypes2["default"].func,
|
1108 | |
1109 |
|
1110 |
|
1111 | onExit: _propTypes2["default"].func,
|
1112 | |
1113 |
|
1114 |
|
1115 | onExiting: _propTypes2["default"].func,
|
1116 | |
1117 |
|
1118 |
|
1119 | onExited: _propTypes2["default"].func
|
1120 | };
|
1121 |
|
1122 | function noop() {}
|
1123 |
|
1124 | var defaultProps = {
|
1125 | "in": false,
|
1126 | unmountOnExit: false,
|
1127 | transitionAppear: false,
|
1128 | timeout: 5000,
|
1129 | onEnter: noop,
|
1130 | onEntering: noop,
|
1131 | onEntered: noop,
|
1132 | onExit: noop,
|
1133 | onExiting: noop,
|
1134 | onExited: noop
|
1135 | };
|
1136 |
|
1137 | |
1138 |
|
1139 |
|
1140 |
|
1141 | var Transition = function (_Component) {
|
1142 | _inherits(Transition, _Component);
|
1143 |
|
1144 | function Transition(props, context) {
|
1145 | _classCallCheck(this, Transition);
|
1146 |
|
1147 | var _this = _possibleConstructorReturn(this, _Component.call(this, props, context));
|
1148 |
|
1149 | var initialStatus = void 0;
|
1150 | if (props["in"]) {
|
1151 |
|
1152 | initialStatus = props.transitionAppear ? EXITED : ENTERED;
|
1153 | } else {
|
1154 | initialStatus = props.unmountOnExit ? UNMOUNTED : EXITED;
|
1155 | }
|
1156 | _this.state = { status: initialStatus };
|
1157 |
|
1158 | _this.nextCallback = null;
|
1159 | return _this;
|
1160 | }
|
1161 |
|
1162 | Transition.prototype.componentDidMount = function componentDidMount() {
|
1163 | if (this.props.transitionAppear && this.props["in"]) {
|
1164 | this.performEnter(this.props);
|
1165 | }
|
1166 | };
|
1167 |
|
1168 | Transition.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
1169 | if (nextProps["in"] && this.props.unmountOnExit) {
|
1170 | if (this.state.status === UNMOUNTED) {
|
1171 |
|
1172 | this.setState({ status: EXITED });
|
1173 | }
|
1174 | } else {
|
1175 | this._needsUpdate = true;
|
1176 | }
|
1177 | };
|
1178 |
|
1179 | Transition.prototype.componentDidUpdate = function componentDidUpdate() {
|
1180 | var status = this.state.status;
|
1181 |
|
1182 | if (this.props.unmountOnExit && status === EXITED) {
|
1183 |
|
1184 | if (this.props["in"]) {
|
1185 | this.performEnter(this.props);
|
1186 | } else {
|
1187 | this.setState({ status: UNMOUNTED });
|
1188 | }
|
1189 |
|
1190 | return;
|
1191 | }
|
1192 |
|
1193 |
|
1194 | if (this._needsUpdate) {
|
1195 | this._needsUpdate = false;
|
1196 |
|
1197 | if (this.props["in"]) {
|
1198 | if (status === EXITING) {
|
1199 | this.performEnter(this.props);
|
1200 | } else if (status === EXITED) {
|
1201 | this.performEnter(this.props);
|
1202 | }
|
1203 |
|
1204 | } else {
|
1205 | if (status === ENTERING || status === ENTERED) {
|
1206 | this.performExit(this.props);
|
1207 | }
|
1208 |
|
1209 | }
|
1210 | }
|
1211 | };
|
1212 |
|
1213 | Transition.prototype.componentWillUnmount = function componentWillUnmount() {
|
1214 | this.cancelNextCallback();
|
1215 | };
|
1216 |
|
1217 | Transition.prototype.performEnter = function performEnter(props) {
|
1218 | var _this2 = this;
|
1219 |
|
1220 | this.cancelNextCallback();
|
1221 | var node = _reactDom2["default"].findDOMNode(this);
|
1222 |
|
1223 |
|
1224 | props.onEnter(node);
|
1225 |
|
1226 | this.safeSetState({ status: ENTERING }, function () {
|
1227 | _this2.props.onEntering(node);
|
1228 |
|
1229 | _this2.onTransitionEnd(node, function () {
|
1230 | _this2.safeSetState({ status: ENTERED }, function () {
|
1231 | _this2.props.onEntered(node);
|
1232 | });
|
1233 | });
|
1234 | });
|
1235 | };
|
1236 |
|
1237 | Transition.prototype.performExit = function performExit(props) {
|
1238 | var _this3 = this;
|
1239 |
|
1240 | this.cancelNextCallback();
|
1241 | var node = _reactDom2["default"].findDOMNode(this);
|
1242 |
|
1243 | props.onExit(node);
|
1244 |
|
1245 | this.safeSetState({ status: EXITING }, function () {
|
1246 | _this3.props.onExiting(node);
|
1247 |
|
1248 | _this3.onTransitionEnd(node, function () {
|
1249 | _this3.safeSetState({ status: EXITED }, function () {
|
1250 | _this3.props.onExited(node);
|
1251 | });
|
1252 | });
|
1253 | });
|
1254 | };
|
1255 |
|
1256 | Transition.prototype.cancelNextCallback = function cancelNextCallback() {
|
1257 | if (this.nextCallback !== null) {
|
1258 | this.nextCallback.cancel();
|
1259 | this.nextCallback = null;
|
1260 | }
|
1261 | };
|
1262 |
|
1263 | Transition.prototype.safeSetState = function safeSetState(nextState, callback) {
|
1264 |
|
1265 | this.setState(nextState, this.setNextCallback(callback));
|
1266 | };
|
1267 |
|
1268 | Transition.prototype.setNextCallback = function setNextCallback(callback) {
|
1269 | var _this4 = this;
|
1270 |
|
1271 | var active = true;
|
1272 |
|
1273 | this.nextCallback = function (event) {
|
1274 | if (active) {
|
1275 | active = false;
|
1276 | _this4.nextCallback = null;
|
1277 |
|
1278 | callback(event);
|
1279 | }
|
1280 | };
|
1281 |
|
1282 | this.nextCallback.cancel = function () {
|
1283 | active = false;
|
1284 | };
|
1285 |
|
1286 | return this.nextCallback;
|
1287 | };
|
1288 |
|
1289 | Transition.prototype.onTransitionEnd = function onTransitionEnd(node, handler) {
|
1290 | this.setNextCallback(handler);
|
1291 |
|
1292 | if (node) {
|
1293 | if (transitionEndEvent == undefined) {
|
1294 | this.nextCallback();
|
1295 | } else {
|
1296 | (0, _on2["default"])(node, transitionEndEvent, this.nextCallback);
|
1297 | }
|
1298 | setTimeout(this.nextCallback, this.props.timeout);
|
1299 | } else {
|
1300 | setTimeout(this.nextCallback, 0);
|
1301 | }
|
1302 | };
|
1303 |
|
1304 | Transition.prototype.render = function render() {
|
1305 | var status = this.state.status;
|
1306 | if (status === UNMOUNTED) {
|
1307 | return null;
|
1308 | }
|
1309 |
|
1310 | var _props = this.props,
|
1311 | children = _props.children,
|
1312 | className = _props.className,
|
1313 | childProps = _objectWithoutProperties(_props, ['children', 'className']);
|
1314 |
|
1315 | Object.keys(Transition.propTypes).forEach(function (key) {
|
1316 | return delete childProps[key];
|
1317 | });
|
1318 |
|
1319 | var transitionClassName = void 0;
|
1320 | if (status === EXITED) {
|
1321 | transitionClassName = this.props.exitedClassName;
|
1322 | } else if (status === ENTERING) {
|
1323 | transitionClassName = this.props.enteringClassName;
|
1324 | } else if (status === ENTERED) {
|
1325 | transitionClassName = this.props.enteredClassName;
|
1326 | } else if (status === EXITING) {
|
1327 | transitionClassName = this.props.exitingClassName;
|
1328 | }
|
1329 |
|
1330 | var child = _react2["default"].Children.only(children);
|
1331 | return _react2["default"].cloneElement(child, _extends({}, childProps, {
|
1332 | className: (0, _classnames2["default"])(child.props.className, className, transitionClassName)
|
1333 | }));
|
1334 | };
|
1335 |
|
1336 | return Transition;
|
1337 | }(_react.Component);
|
1338 |
|
1339 | Transition.propTypes = propTypes;
|
1340 |
|
1341 | Transition.defaultProps = defaultProps;
|
1342 |
|
1343 | exports["default"] = Transition;
|
1344 |
|
1345 | }),
|
1346 |
|
1347 | (function(module, exports) {
|
1348 |
|
1349 | module.exports = ReactDOM;
|
1350 |
|
1351 | }),
|
1352 |
|
1353 | (function(module, exports, __webpack_require__) {
|
1354 |
|
1355 | "use strict";
|
1356 |
|
1357 | var _interopRequireDefault = __webpack_require__(14);
|
1358 |
|
1359 | exports.__esModule = true;
|
1360 | 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;
|
1361 |
|
1362 | var _inDOM = _interopRequireDefault(__webpack_require__(15));
|
1363 |
|
1364 | var transform = 'transform';
|
1365 | exports.transform = transform;
|
1366 | var prefix, transitionEnd, animationEnd;
|
1367 | exports.animationEnd = animationEnd;
|
1368 | exports.transitionEnd = transitionEnd;
|
1369 | var transitionProperty, transitionDuration, transitionTiming, transitionDelay;
|
1370 | exports.transitionDelay = transitionDelay;
|
1371 | exports.transitionTiming = transitionTiming;
|
1372 | exports.transitionDuration = transitionDuration;
|
1373 | exports.transitionProperty = transitionProperty;
|
1374 | var animationName, animationDuration, animationTiming, animationDelay;
|
1375 | exports.animationDelay = animationDelay;
|
1376 | exports.animationTiming = animationTiming;
|
1377 | exports.animationDuration = animationDuration;
|
1378 | exports.animationName = animationName;
|
1379 |
|
1380 | if (_inDOM.default) {
|
1381 | var _getTransitionPropert = getTransitionProperties();
|
1382 |
|
1383 | prefix = _getTransitionPropert.prefix;
|
1384 | exports.transitionEnd = transitionEnd = _getTransitionPropert.transitionEnd;
|
1385 | exports.animationEnd = animationEnd = _getTransitionPropert.animationEnd;
|
1386 | exports.transform = transform = prefix + "-" + transform;
|
1387 | exports.transitionProperty = transitionProperty = prefix + "-transition-property";
|
1388 | exports.transitionDuration = transitionDuration = prefix + "-transition-duration";
|
1389 | exports.transitionDelay = transitionDelay = prefix + "-transition-delay";
|
1390 | exports.transitionTiming = transitionTiming = prefix + "-transition-timing-function";
|
1391 | exports.animationName = animationName = prefix + "-animation-name";
|
1392 | exports.animationDuration = animationDuration = prefix + "-animation-duration";
|
1393 | exports.animationTiming = animationTiming = prefix + "-animation-delay";
|
1394 | exports.animationDelay = animationDelay = prefix + "-animation-timing-function";
|
1395 | }
|
1396 |
|
1397 | var _default = {
|
1398 | transform: transform,
|
1399 | end: transitionEnd,
|
1400 | property: transitionProperty,
|
1401 | timing: transitionTiming,
|
1402 | delay: transitionDelay,
|
1403 | duration: transitionDuration
|
1404 | };
|
1405 | exports.default = _default;
|
1406 |
|
1407 | function getTransitionProperties() {
|
1408 | var style = document.createElement('div').style;
|
1409 | var vendorMap = {
|
1410 | O: function O(e) {
|
1411 | return "o" + e.toLowerCase();
|
1412 | },
|
1413 | Moz: function Moz(e) {
|
1414 | return e.toLowerCase();
|
1415 | },
|
1416 | Webkit: function Webkit(e) {
|
1417 | return "webkit" + e;
|
1418 | },
|
1419 | ms: function ms(e) {
|
1420 | return "MS" + e;
|
1421 | }
|
1422 | };
|
1423 | var vendors = Object.keys(vendorMap);
|
1424 | var transitionEnd, animationEnd;
|
1425 | var prefix = '';
|
1426 |
|
1427 | for (var i = 0; i < vendors.length; i++) {
|
1428 | var vendor = vendors[i];
|
1429 |
|
1430 | if (vendor + "TransitionProperty" in style) {
|
1431 | prefix = "-" + vendor.toLowerCase();
|
1432 | transitionEnd = vendorMap[vendor]('TransitionEnd');
|
1433 | animationEnd = vendorMap[vendor]('AnimationEnd');
|
1434 | break;
|
1435 | }
|
1436 | }
|
1437 |
|
1438 | if (!transitionEnd && 'transitionProperty' in style) transitionEnd = 'transitionend';
|
1439 | if (!animationEnd && 'animationName' in style) animationEnd = 'animationend';
|
1440 | style = null;
|
1441 | return {
|
1442 | animationEnd: animationEnd,
|
1443 | transitionEnd: transitionEnd,
|
1444 | prefix: prefix
|
1445 | };
|
1446 | }
|
1447 |
|
1448 | }),
|
1449 |
|
1450 | (function(module, exports) {
|
1451 |
|
1452 | function _interopRequireDefault(obj) {
|
1453 | return obj && obj.__esModule ? obj : {
|
1454 | default: obj
|
1455 | };
|
1456 | }
|
1457 |
|
1458 | module.exports = _interopRequireDefault;
|
1459 |
|
1460 | }),
|
1461 |
|
1462 | (function(module, exports) {
|
1463 |
|
1464 | "use strict";
|
1465 |
|
1466 | exports.__esModule = true;
|
1467 | exports.default = void 0;
|
1468 |
|
1469 | var _default = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
1470 |
|
1471 | exports.default = _default;
|
1472 | module.exports = exports["default"];
|
1473 |
|
1474 | }),
|
1475 |
|
1476 | (function(module, exports, __webpack_require__) {
|
1477 |
|
1478 | "use strict";
|
1479 |
|
1480 | var _interopRequireDefault = __webpack_require__(14);
|
1481 |
|
1482 | exports.__esModule = true;
|
1483 | exports.default = void 0;
|
1484 |
|
1485 | var _inDOM = _interopRequireDefault(__webpack_require__(15));
|
1486 |
|
1487 | var on = function on() {};
|
1488 |
|
1489 | if (_inDOM.default) {
|
1490 | on = function () {
|
1491 | if (document.addEventListener) return function (node, eventName, handler, capture) {
|
1492 | return node.addEventListener(eventName, handler, capture || false);
|
1493 | };else if (document.attachEvent) return function (node, eventName, handler) {
|
1494 | return node.attachEvent('on' + eventName, function (e) {
|
1495 | e = e || window.event;
|
1496 | e.target = e.target || e.srcElement;
|
1497 | e.currentTarget = node;
|
1498 | handler.call(node, e);
|
1499 | });
|
1500 | };
|
1501 | }();
|
1502 | }
|
1503 |
|
1504 | var _default = on;
|
1505 | exports.default = _default;
|
1506 | module.exports = exports["default"];
|
1507 |
|
1508 | }),
|
1509 |
|
1510 | (function(module, exports, __webpack_require__) {
|
1511 |
|
1512 | 'use strict';
|
1513 |
|
1514 | Object.defineProperty(exports, "__esModule", {
|
1515 | value: true
|
1516 | });
|
1517 |
|
1518 | 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; };
|
1519 |
|
1520 | var _classnames = __webpack_require__(3);
|
1521 |
|
1522 | var _classnames2 = _interopRequireDefault(_classnames);
|
1523 |
|
1524 | var _style = __webpack_require__(18);
|
1525 |
|
1526 | var _style2 = _interopRequireDefault(_style);
|
1527 |
|
1528 | var _react = __webpack_require__(4);
|
1529 |
|
1530 | var _react2 = _interopRequireDefault(_react);
|
1531 |
|
1532 | var _propTypes = __webpack_require__(5);
|
1533 |
|
1534 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
1535 |
|
1536 | var _Transition = __webpack_require__(11);
|
1537 |
|
1538 | var _Transition2 = _interopRequireDefault(_Transition);
|
1539 |
|
1540 | var _capitalize = __webpack_require__(26);
|
1541 |
|
1542 | var _capitalize2 = _interopRequireDefault(_capitalize);
|
1543 |
|
1544 | var _tinperBeeCore = __webpack_require__(27);
|
1545 |
|
1546 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
1547 |
|
1548 | 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; }
|
1549 |
|
1550 | 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; }
|
1551 |
|
1552 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
1553 |
|
1554 | 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; }
|
1555 |
|
1556 | 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); }
|
1557 |
|
1558 | var MARGINS = {
|
1559 | height: ['marginTop', 'marginBottom'],
|
1560 | width: ['marginLeft', 'marginRight']
|
1561 | };
|
1562 |
|
1563 |
|
1564 |
|
1565 | function triggerBrowserReflow(node) {
|
1566 | node.offsetHeight;
|
1567 | }
|
1568 |
|
1569 | function getDimensionValue(dimension, elem) {
|
1570 | var value = elem['offset' + (0, _capitalize2["default"])(dimension)];
|
1571 | var margins = MARGINS[dimension];
|
1572 |
|
1573 | return value + parseInt((0, _style2["default"])(elem, margins[0]), 10) + parseInt((0, _style2["default"])(elem, margins[1]), 10);
|
1574 | }
|
1575 |
|
1576 | var propTypes = {
|
1577 | |
1578 |
|
1579 |
|
1580 | "in": _propTypes2["default"].bool,
|
1581 |
|
1582 | |
1583 |
|
1584 |
|
1585 | unmountOnExit: _propTypes2["default"].bool,
|
1586 |
|
1587 | |
1588 |
|
1589 |
|
1590 |
|
1591 | transitionAppear: _propTypes2["default"].bool,
|
1592 |
|
1593 | |
1594 |
|
1595 |
|
1596 |
|
1597 |
|
1598 | timeout: _propTypes2["default"].number,
|
1599 |
|
1600 | |
1601 |
|
1602 |
|
1603 | onEnter: _propTypes2["default"].func,
|
1604 | |
1605 |
|
1606 |
|
1607 | onEntering: _propTypes2["default"].func,
|
1608 | |
1609 |
|
1610 |
|
1611 | onEntered: _propTypes2["default"].func,
|
1612 | |
1613 |
|
1614 |
|
1615 | onExit: _propTypes2["default"].func,
|
1616 | |
1617 |
|
1618 |
|
1619 | onExiting: _propTypes2["default"].func,
|
1620 | |
1621 |
|
1622 |
|
1623 | onExited: _propTypes2["default"].func,
|
1624 |
|
1625 | |
1626 |
|
1627 |
|
1628 |
|
1629 |
|
1630 |
|
1631 |
|
1632 | dimension: _propTypes2["default"].oneOfType([_propTypes2["default"].oneOf(['height', 'width']), _propTypes2["default"].func]),
|
1633 |
|
1634 | |
1635 |
|
1636 |
|
1637 |
|
1638 |
|
1639 |
|
1640 |
|
1641 | getDimensionValue: _propTypes2["default"].func,
|
1642 |
|
1643 | |
1644 |
|
1645 |
|
1646 | role: _propTypes2["default"].string
|
1647 | };
|
1648 |
|
1649 | var defaultProps = {
|
1650 | "in": false,
|
1651 | timeout: 300,
|
1652 | unmountOnExit: false,
|
1653 | transitionAppear: false,
|
1654 |
|
1655 | dimension: 'height',
|
1656 | getDimensionValue: getDimensionValue
|
1657 | };
|
1658 |
|
1659 | var Collapse = function (_React$Component) {
|
1660 | _inherits(Collapse, _React$Component);
|
1661 |
|
1662 | function Collapse(props, context) {
|
1663 | _classCallCheck(this, Collapse);
|
1664 |
|
1665 | var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context));
|
1666 |
|
1667 | _this.handleEnter = _this.handleEnter.bind(_this);
|
1668 | _this.handleEntering = _this.handleEntering.bind(_this);
|
1669 | _this.handleEntered = _this.handleEntered.bind(_this);
|
1670 | _this.handleExit = _this.handleExit.bind(_this);
|
1671 | _this.handleExiting = _this.handleExiting.bind(_this);
|
1672 | return _this;
|
1673 | }
|
1674 |
|
1675 |
|
1676 |
|
1677 |
|
1678 | Collapse.prototype.handleEnter = function handleEnter(elem) {
|
1679 | var dimension = this._dimension();
|
1680 | elem.style[dimension] = '0';
|
1681 | };
|
1682 |
|
1683 | Collapse.prototype.handleEntering = function handleEntering(elem) {
|
1684 | var dimension = this._dimension();
|
1685 | elem.style[dimension] = this._getScrollDimensionValue(elem, dimension);
|
1686 | };
|
1687 |
|
1688 | Collapse.prototype.handleEntered = function handleEntered(elem) {
|
1689 | var dimension = this._dimension();
|
1690 | elem.style[dimension] = null;
|
1691 | };
|
1692 |
|
1693 |
|
1694 |
|
1695 |
|
1696 | Collapse.prototype.handleExit = function handleExit(elem) {
|
1697 | var dimension = this._dimension();
|
1698 | elem.style[dimension] = this.props.getDimensionValue(dimension, elem) + 'px';
|
1699 | triggerBrowserReflow(elem);
|
1700 | };
|
1701 |
|
1702 | Collapse.prototype.handleExiting = function handleExiting(elem) {
|
1703 | var dimension = this._dimension();
|
1704 | elem.style[dimension] = '0';
|
1705 | };
|
1706 |
|
1707 | Collapse.prototype._dimension = function _dimension() {
|
1708 | return typeof this.props.dimension === 'function' ? this.props.dimension() : this.props.dimension;
|
1709 | };
|
1710 |
|
1711 |
|
1712 |
|
1713 |
|
1714 | Collapse.prototype._getScrollDimensionValue = function _getScrollDimensionValue(elem, dimension) {
|
1715 | return elem['scroll' + (0, _capitalize2["default"])(dimension)] + 'px';
|
1716 | };
|
1717 |
|
1718 | Collapse.prototype.render = function render() {
|
1719 | var _props = this.props,
|
1720 | onEnter = _props.onEnter,
|
1721 | onEntering = _props.onEntering,
|
1722 | onEntered = _props.onEntered,
|
1723 | onExit = _props.onExit,
|
1724 | onExiting = _props.onExiting,
|
1725 | className = _props.className,
|
1726 | props = _objectWithoutProperties(_props, ['onEnter', 'onEntering', 'onEntered', 'onExit', 'onExiting', 'className']);
|
1727 |
|
1728 | delete props.dimension;
|
1729 | delete props.getDimensionValue;
|
1730 |
|
1731 | var handleEnter = (0, _tinperBeeCore.createChainedFunction)(this.handleEnter, onEnter);
|
1732 | var handleEntering = (0, _tinperBeeCore.createChainedFunction)(this.handleEntering, onEntering);
|
1733 | var handleEntered = (0, _tinperBeeCore.createChainedFunction)(this.handleEntered, onEntered);
|
1734 | var handleExit = (0, _tinperBeeCore.createChainedFunction)(this.handleExit, onExit);
|
1735 | var handleExiting = (0, _tinperBeeCore.createChainedFunction)(this.handleExiting, onExiting);
|
1736 |
|
1737 | var classes = {
|
1738 | width: this._dimension() === 'width'
|
1739 | };
|
1740 |
|
1741 | return _react2["default"].createElement(_Transition2["default"], _extends({}, props, {
|
1742 | 'aria-expanded': props.role ? props["in"] : null,
|
1743 | className: (0, _classnames2["default"])(className, classes),
|
1744 | exitedClassName: 'collapse',
|
1745 | exitingClassName: 'collapsing',
|
1746 | enteredClassName: 'collapse in',
|
1747 | enteringClassName: 'collapsing',
|
1748 | onEnter: handleEnter,
|
1749 | onEntering: handleEntering,
|
1750 | onEntered: handleEntered,
|
1751 | onExit: handleExit,
|
1752 | onExiting: handleExiting
|
1753 | }));
|
1754 | };
|
1755 |
|
1756 | return Collapse;
|
1757 | }(_react2["default"].Component);
|
1758 |
|
1759 | Collapse.propTypes = propTypes;
|
1760 | Collapse.defaultProps = defaultProps;
|
1761 |
|
1762 | exports["default"] = Collapse;
|
1763 | module.exports = exports['default'];
|
1764 |
|
1765 | }),
|
1766 |
|
1767 | (function(module, exports, __webpack_require__) {
|
1768 |
|
1769 | "use strict";
|
1770 |
|
1771 | var _interopRequireDefault = __webpack_require__(14);
|
1772 |
|
1773 | exports.__esModule = true;
|
1774 | exports.default = style;
|
1775 |
|
1776 | var _camelizeStyle = _interopRequireDefault(__webpack_require__(19));
|
1777 |
|
1778 | var _hyphenateStyle = _interopRequireDefault(__webpack_require__(21));
|
1779 |
|
1780 | var _getComputedStyle2 = _interopRequireDefault(__webpack_require__(23));
|
1781 |
|
1782 | var _removeStyle = _interopRequireDefault(__webpack_require__(24));
|
1783 |
|
1784 | var _properties = __webpack_require__(13);
|
1785 |
|
1786 | var _isTransform = _interopRequireDefault(__webpack_require__(25));
|
1787 |
|
1788 | function style(node, property, value) {
|
1789 | var css = '';
|
1790 | var transforms = '';
|
1791 | var props = property;
|
1792 |
|
1793 | if (typeof property === 'string') {
|
1794 | if (value === undefined) {
|
1795 | return node.style[(0, _camelizeStyle.default)(property)] || (0, _getComputedStyle2.default)(node).getPropertyValue((0, _hyphenateStyle.default)(property));
|
1796 | } else {
|
1797 | (props = {})[property] = value;
|
1798 | }
|
1799 | }
|
1800 |
|
1801 | Object.keys(props).forEach(function (key) {
|
1802 | var value = props[key];
|
1803 |
|
1804 | if (!value && value !== 0) {
|
1805 | (0, _removeStyle.default)(node, (0, _hyphenateStyle.default)(key));
|
1806 | } else if ((0, _isTransform.default)(key)) {
|
1807 | transforms += key + "(" + value + ") ";
|
1808 | } else {
|
1809 | css += (0, _hyphenateStyle.default)(key) + ": " + value + ";";
|
1810 | }
|
1811 | });
|
1812 |
|
1813 | if (transforms) {
|
1814 | css += _properties.transform + ": " + transforms + ";";
|
1815 | }
|
1816 |
|
1817 | node.style.cssText += ';' + css;
|
1818 | }
|
1819 |
|
1820 | module.exports = exports["default"];
|
1821 |
|
1822 | }),
|
1823 |
|
1824 | (function(module, exports, __webpack_require__) {
|
1825 |
|
1826 | "use strict";
|
1827 |
|
1828 | var _interopRequireDefault = __webpack_require__(14);
|
1829 |
|
1830 | exports.__esModule = true;
|
1831 | exports.default = camelizeStyleName;
|
1832 |
|
1833 | var _camelize = _interopRequireDefault(__webpack_require__(20));
|
1834 |
|
1835 | |
1836 |
|
1837 |
|
1838 |
|
1839 |
|
1840 | var msPattern = /^-ms-/;
|
1841 |
|
1842 | function camelizeStyleName(string) {
|
1843 | return (0, _camelize.default)(string.replace(msPattern, 'ms-'));
|
1844 | }
|
1845 |
|
1846 | module.exports = exports["default"];
|
1847 |
|
1848 | }),
|
1849 |
|
1850 | (function(module, exports) {
|
1851 |
|
1852 | "use strict";
|
1853 |
|
1854 | exports.__esModule = true;
|
1855 | exports.default = camelize;
|
1856 | var rHyphen = /-(.)/g;
|
1857 |
|
1858 | function camelize(string) {
|
1859 | return string.replace(rHyphen, function (_, chr) {
|
1860 | return chr.toUpperCase();
|
1861 | });
|
1862 | }
|
1863 |
|
1864 | module.exports = exports["default"];
|
1865 |
|
1866 | }),
|
1867 |
|
1868 | (function(module, exports, __webpack_require__) {
|
1869 |
|
1870 | "use strict";
|
1871 |
|
1872 | var _interopRequireDefault = __webpack_require__(14);
|
1873 |
|
1874 | exports.__esModule = true;
|
1875 | exports.default = hyphenateStyleName;
|
1876 |
|
1877 | var _hyphenate = _interopRequireDefault(__webpack_require__(22));
|
1878 |
|
1879 | |
1880 |
|
1881 |
|
1882 |
|
1883 |
|
1884 | var msPattern = /^ms-/;
|
1885 |
|
1886 | function hyphenateStyleName(string) {
|
1887 | return (0, _hyphenate.default)(string).replace(msPattern, '-ms-');
|
1888 | }
|
1889 |
|
1890 | module.exports = exports["default"];
|
1891 |
|
1892 | }),
|
1893 |
|
1894 | (function(module, exports) {
|
1895 |
|
1896 | "use strict";
|
1897 |
|
1898 | exports.__esModule = true;
|
1899 | exports.default = hyphenate;
|
1900 | var rUpper = /([A-Z])/g;
|
1901 |
|
1902 | function hyphenate(string) {
|
1903 | return string.replace(rUpper, '-$1').toLowerCase();
|
1904 | }
|
1905 |
|
1906 | module.exports = exports["default"];
|
1907 |
|
1908 | }),
|
1909 |
|
1910 | (function(module, exports, __webpack_require__) {
|
1911 |
|
1912 | "use strict";
|
1913 |
|
1914 | var _interopRequireDefault = __webpack_require__(14);
|
1915 |
|
1916 | exports.__esModule = true;
|
1917 | exports.default = _getComputedStyle;
|
1918 |
|
1919 | var _camelizeStyle = _interopRequireDefault(__webpack_require__(19));
|
1920 |
|
1921 | var rposition = /^(top|right|bottom|left)$/;
|
1922 | var rnumnonpx = /^([+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|))(?!px)[a-z%]+$/i;
|
1923 |
|
1924 | function _getComputedStyle(node) {
|
1925 | if (!node) throw new TypeError('No Element passed to `getComputedStyle()`');
|
1926 | var doc = node.ownerDocument;
|
1927 | return 'defaultView' in doc ? doc.defaultView.opener ? node.ownerDocument.defaultView.getComputedStyle(node, null) : window.getComputedStyle(node, null) : {
|
1928 |
|
1929 | getPropertyValue: function getPropertyValue(prop) {
|
1930 | var style = node.style;
|
1931 | prop = (0, _camelizeStyle.default)(prop);
|
1932 | if (prop == 'float') prop = 'styleFloat';
|
1933 | var current = node.currentStyle[prop] || null;
|
1934 | if (current == null && style && style[prop]) current = style[prop];
|
1935 |
|
1936 | if (rnumnonpx.test(current) && !rposition.test(prop)) {
|
1937 |
|
1938 | var left = style.left;
|
1939 | var runStyle = node.runtimeStyle;
|
1940 | var rsLeft = runStyle && runStyle.left;
|
1941 |
|
1942 | if (rsLeft) runStyle.left = node.currentStyle.left;
|
1943 | style.left = prop === 'fontSize' ? '1em' : current;
|
1944 | current = style.pixelLeft + 'px';
|
1945 |
|
1946 | style.left = left;
|
1947 | if (rsLeft) runStyle.left = rsLeft;
|
1948 | }
|
1949 |
|
1950 | return current;
|
1951 | }
|
1952 | };
|
1953 | }
|
1954 |
|
1955 | module.exports = exports["default"];
|
1956 |
|
1957 | }),
|
1958 |
|
1959 | (function(module, exports) {
|
1960 |
|
1961 | "use strict";
|
1962 |
|
1963 | exports.__esModule = true;
|
1964 | exports.default = removeStyle;
|
1965 |
|
1966 | function removeStyle(node, key) {
|
1967 | return 'removeProperty' in node.style ? node.style.removeProperty(key) : node.style.removeAttribute(key);
|
1968 | }
|
1969 |
|
1970 | module.exports = exports["default"];
|
1971 |
|
1972 | }),
|
1973 |
|
1974 | (function(module, exports) {
|
1975 |
|
1976 | "use strict";
|
1977 |
|
1978 | exports.__esModule = true;
|
1979 | exports.default = isTransform;
|
1980 | var supportedTransforms = /^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;
|
1981 |
|
1982 | function isTransform(property) {
|
1983 | return !!(property && supportedTransforms.test(property));
|
1984 | }
|
1985 |
|
1986 | module.exports = exports["default"];
|
1987 |
|
1988 | }),
|
1989 |
|
1990 | (function(module, exports) {
|
1991 |
|
1992 | "use strict";
|
1993 |
|
1994 | Object.defineProperty(exports, "__esModule", {
|
1995 | value: true
|
1996 | });
|
1997 | exports["default"] = capitalize;
|
1998 | function capitalize(string) {
|
1999 | return "" + string.charAt(0).toUpperCase() + string.slice(1);
|
2000 | }
|
2001 | module.exports = exports["default"];
|
2002 |
|
2003 | }),
|
2004 |
|
2005 | (function(module, exports, __webpack_require__) {
|
2006 |
|
2007 | 'use strict';
|
2008 |
|
2009 | exports.__esModule = true;
|
2010 | 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;
|
2011 |
|
2012 | var _all2 = __webpack_require__(28);
|
2013 |
|
2014 | var _all3 = _interopRequireDefault(_all2);
|
2015 |
|
2016 | var _componentOrElement2 = __webpack_require__(30);
|
2017 |
|
2018 | var _componentOrElement3 = _interopRequireDefault(_componentOrElement2);
|
2019 |
|
2020 | var _deprecated2 = __webpack_require__(31);
|
2021 |
|
2022 | var _deprecated3 = _interopRequireDefault(_deprecated2);
|
2023 |
|
2024 | var _elementType2 = __webpack_require__(34);
|
2025 |
|
2026 | var _elementType3 = _interopRequireDefault(_elementType2);
|
2027 |
|
2028 | var _isRequiredForA11y2 = __webpack_require__(35);
|
2029 |
|
2030 | var _isRequiredForA11y3 = _interopRequireDefault(_isRequiredForA11y2);
|
2031 |
|
2032 | var _splitComponent2 = __webpack_require__(36);
|
2033 |
|
2034 | var _splitComponent3 = _interopRequireDefault(_splitComponent2);
|
2035 |
|
2036 | var _createChainedFunction2 = __webpack_require__(37);
|
2037 |
|
2038 | var _createChainedFunction3 = _interopRequireDefault(_createChainedFunction2);
|
2039 |
|
2040 | var _keyCode = __webpack_require__(38);
|
2041 |
|
2042 | var _keyCode2 = _interopRequireDefault(_keyCode);
|
2043 |
|
2044 | var _contains2 = __webpack_require__(39);
|
2045 |
|
2046 | var _contains3 = _interopRequireDefault(_contains2);
|
2047 |
|
2048 | var _addEventListener2 = __webpack_require__(40);
|
2049 |
|
2050 | var _addEventListener3 = _interopRequireDefault(_addEventListener2);
|
2051 |
|
2052 | var _cssAnimation2 = __webpack_require__(45);
|
2053 |
|
2054 | var _cssAnimation3 = _interopRequireDefault(_cssAnimation2);
|
2055 |
|
2056 | var _toArray2 = __webpack_require__(49);
|
2057 |
|
2058 | var _toArray3 = _interopRequireDefault(_toArray2);
|
2059 |
|
2060 | var _Align2 = __webpack_require__(50);
|
2061 |
|
2062 | var _Align3 = _interopRequireDefault(_Align2);
|
2063 |
|
2064 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
2065 |
|
2066 | exports.all = _all3.default;
|
2067 | exports.componentOrElement = _componentOrElement3.default;
|
2068 | exports.deprecated = _deprecated3.default;
|
2069 | exports.elementType = _elementType3.default;
|
2070 | exports.isRequiredForA11y = _isRequiredForA11y3.default;
|
2071 | exports.splitComponent = _splitComponent3.default;
|
2072 | exports.createChainedFunction = _createChainedFunction3.default;
|
2073 | exports.KeyCode = _keyCode2.default;
|
2074 | exports.contains = _contains3.default;
|
2075 | exports.addEventListener = _addEventListener3.default;
|
2076 | exports.cssAnimation = _cssAnimation3.default;
|
2077 | exports.toArray = _toArray3.default;
|
2078 |
|
2079 |
|
2080 | exports.Align = _Align3.default;
|
2081 |
|
2082 | }),
|
2083 |
|
2084 | (function(module, exports, __webpack_require__) {
|
2085 |
|
2086 | 'use strict';
|
2087 |
|
2088 | exports.__esModule = true;
|
2089 | exports.default = all;
|
2090 |
|
2091 | var _createChainableTypeChecker = __webpack_require__(29);
|
2092 |
|
2093 | var _createChainableTypeChecker2 = _interopRequireDefault(_createChainableTypeChecker);
|
2094 |
|
2095 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
2096 |
|
2097 | function all() {
|
2098 | for (var _len = arguments.length, validators = Array(_len), _key = 0; _key < _len; _key++) {
|
2099 | validators[_key] = arguments[_key];
|
2100 | }
|
2101 |
|
2102 | function allPropTypes() {
|
2103 | for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
2104 | args[_key2] = arguments[_key2];
|
2105 | }
|
2106 |
|
2107 | var error = null;
|
2108 |
|
2109 | validators.forEach(function (validator) {
|
2110 | if (error != null) {
|
2111 | return;
|
2112 | }
|
2113 |
|
2114 | var result = validator.apply(undefined, args);
|
2115 | if (result != null) {
|
2116 | error = result;
|
2117 | }
|
2118 | });
|
2119 |
|
2120 | return error;
|
2121 | }
|
2122 |
|
2123 | return (0, _createChainableTypeChecker2.default)(allPropTypes);
|
2124 | }
|
2125 |
|
2126 | }),
|
2127 |
|
2128 | (function(module, exports) {
|
2129 |
|
2130 | 'use strict';
|
2131 |
|
2132 | exports.__esModule = true;
|
2133 | exports.default = createChainableTypeChecker;
|
2134 | |
2135 |
|
2136 |
|
2137 |
|
2138 |
|
2139 |
|
2140 |
|
2141 |
|
2142 |
|
2143 |
|
2144 |
|
2145 | function createChainableTypeChecker(validate) {
|
2146 | function checkType(isRequired, props, propName, componentName, location, propFullName) {
|
2147 | var componentNameSafe = componentName || '<<anonymous>>';
|
2148 | var propFullNameSafe = propFullName || propName;
|
2149 |
|
2150 | if (props[propName] == null) {
|
2151 | if (isRequired) {
|
2152 | return new Error('Required ' + location + ' `' + propFullNameSafe + '` was not specified ' + ('in `' + componentNameSafe + '`.'));
|
2153 | }
|
2154 |
|
2155 | return null;
|
2156 | }
|
2157 |
|
2158 | for (var _len = arguments.length, args = Array(_len > 6 ? _len - 6 : 0), _key = 6; _key < _len; _key++) {
|
2159 | args[_key - 6] = arguments[_key];
|
2160 | }
|
2161 |
|
2162 | return validate.apply(undefined, [props, propName, componentNameSafe, location, propFullNameSafe].concat(args));
|
2163 | }
|
2164 |
|
2165 | var chainedCheckType = checkType.bind(null, false);
|
2166 | chainedCheckType.isRequired = checkType.bind(null, true);
|
2167 |
|
2168 | return chainedCheckType;
|
2169 | }
|
2170 |
|
2171 | }),
|
2172 |
|
2173 | (function(module, exports, __webpack_require__) {
|
2174 |
|
2175 | 'use strict';
|
2176 |
|
2177 | exports.__esModule = true;
|
2178 |
|
2179 | 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; };
|
2180 |
|
2181 | var _react = __webpack_require__(4);
|
2182 |
|
2183 | var _react2 = _interopRequireDefault(_react);
|
2184 |
|
2185 | var _createChainableTypeChecker = __webpack_require__(29);
|
2186 |
|
2187 | var _createChainableTypeChecker2 = _interopRequireDefault(_createChainableTypeChecker);
|
2188 |
|
2189 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
2190 |
|
2191 | function validate(props, propName, componentName, location, propFullName) {
|
2192 | var propValue = props[propName];
|
2193 | var propType = typeof propValue === 'undefined' ? 'undefined' : _typeof(propValue);
|
2194 |
|
2195 | if (_react2.default.isValidElement(propValue)) {
|
2196 | 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.');
|
2197 | }
|
2198 |
|
2199 | if ((propType !== 'object' || typeof propValue.render !== 'function') && propValue.nodeType !== 1) {
|
2200 | return new Error('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected a ReactComponent or a ') + 'DOMElement.');
|
2201 | }
|
2202 |
|
2203 | return null;
|
2204 | }
|
2205 |
|
2206 | exports.default = (0, _createChainableTypeChecker2.default)(validate);
|
2207 |
|
2208 | }),
|
2209 |
|
2210 | (function(module, exports, __webpack_require__) {
|
2211 |
|
2212 | 'use strict';
|
2213 |
|
2214 | exports.__esModule = true;
|
2215 | exports.default = deprecated;
|
2216 |
|
2217 | var _warning = __webpack_require__(32);
|
2218 |
|
2219 | var _warning2 = _interopRequireDefault(_warning);
|
2220 |
|
2221 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
2222 |
|
2223 | var warned = {};
|
2224 |
|
2225 | function deprecated(validator, reason) {
|
2226 | return function validate(props, propName, componentName, location, propFullName) {
|
2227 | var componentNameSafe = componentName || '<<anonymous>>';
|
2228 | var propFullNameSafe = propFullName || propName;
|
2229 |
|
2230 | if (props[propName] != null) {
|
2231 | var messageKey = componentName + '.' + propName;
|
2232 |
|
2233 | (0, _warning2.default)(warned[messageKey], 'The ' + location + ' `' + propFullNameSafe + '` of ' + ('`' + componentNameSafe + '` is deprecated. ' + reason + '.'));
|
2234 |
|
2235 | warned[messageKey] = true;
|
2236 | }
|
2237 |
|
2238 | for (var _len = arguments.length, args = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) {
|
2239 | args[_key - 5] = arguments[_key];
|
2240 | }
|
2241 |
|
2242 | return validator.apply(undefined, [props, propName, componentName, location, propFullName].concat(args));
|
2243 | };
|
2244 | }
|
2245 |
|
2246 |
|
2247 | function _resetWarned() {
|
2248 | warned = {};
|
2249 | }
|
2250 |
|
2251 | deprecated._resetWarned = _resetWarned;
|
2252 |
|
2253 |
|
2254 | }),
|
2255 |
|
2256 | (function(module, exports, __webpack_require__) {
|
2257 |
|
2258 | (function(process) { |
2259 |
|
2260 |
|
2261 |
|
2262 |
|
2263 |
|
2264 |
|
2265 | 'use strict';
|
2266 |
|
2267 | |
2268 |
|
2269 |
|
2270 |
|
2271 |
|
2272 |
|
2273 |
|
2274 | var __DEV__ = process.env.NODE_ENV !== 'production';
|
2275 |
|
2276 | var warning = function() {};
|
2277 |
|
2278 | if (__DEV__) {
|
2279 | var printWarning = function printWarning(format, args) {
|
2280 | var len = arguments.length;
|
2281 | args = new Array(len > 2 ? len - 2 : 0);
|
2282 | for (var key = 2; key < len; key++) {
|
2283 | args[key - 2] = arguments[key];
|
2284 | }
|
2285 | var argIndex = 0;
|
2286 | var message = 'Warning: ' +
|
2287 | format.replace(/%s/g, function() {
|
2288 | return args[argIndex++];
|
2289 | });
|
2290 | if (typeof console !== 'undefined') {
|
2291 | console.error(message);
|
2292 | }
|
2293 | try {
|
2294 |
|
2295 |
|
2296 |
|
2297 | throw new Error(message);
|
2298 | } catch (x) {}
|
2299 | }
|
2300 |
|
2301 | warning = function(condition, format, args) {
|
2302 | var len = arguments.length;
|
2303 | args = new Array(len > 2 ? len - 2 : 0);
|
2304 | for (var key = 2; key < len; key++) {
|
2305 | args[key - 2] = arguments[key];
|
2306 | }
|
2307 | if (format === undefined) {
|
2308 | throw new Error(
|
2309 | '`warning(condition, format, ...args)` requires a warning ' +
|
2310 | 'message argument'
|
2311 | );
|
2312 | }
|
2313 | if (!condition) {
|
2314 | printWarning.apply(null, [format].concat(args));
|
2315 | }
|
2316 | };
|
2317 | }
|
2318 |
|
2319 | module.exports = warning;
|
2320 |
|
2321 | }.call(exports, __webpack_require__(33)))
|
2322 |
|
2323 | }),
|
2324 |
|
2325 | (function(module, exports) {
|
2326 |
|
2327 |
|
2328 | var process = module.exports = {};
|
2329 |
|
2330 |
|
2331 |
|
2332 |
|
2333 |
|
2334 |
|
2335 | var cachedSetTimeout;
|
2336 | var cachedClearTimeout;
|
2337 |
|
2338 | function defaultSetTimout() {
|
2339 | throw new Error('setTimeout has not been defined');
|
2340 | }
|
2341 | function defaultClearTimeout () {
|
2342 | throw new Error('clearTimeout has not been defined');
|
2343 | }
|
2344 | (function () {
|
2345 | try {
|
2346 | if (typeof setTimeout === 'function') {
|
2347 | cachedSetTimeout = setTimeout;
|
2348 | } else {
|
2349 | cachedSetTimeout = defaultSetTimout;
|
2350 | }
|
2351 | } catch (e) {
|
2352 | cachedSetTimeout = defaultSetTimout;
|
2353 | }
|
2354 | try {
|
2355 | if (typeof clearTimeout === 'function') {
|
2356 | cachedClearTimeout = clearTimeout;
|
2357 | } else {
|
2358 | cachedClearTimeout = defaultClearTimeout;
|
2359 | }
|
2360 | } catch (e) {
|
2361 | cachedClearTimeout = defaultClearTimeout;
|
2362 | }
|
2363 | } ())
|
2364 | function runTimeout(fun) {
|
2365 | if (cachedSetTimeout === setTimeout) {
|
2366 |
|
2367 | return setTimeout(fun, 0);
|
2368 | }
|
2369 |
|
2370 | if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
|
2371 | cachedSetTimeout = setTimeout;
|
2372 | return setTimeout(fun, 0);
|
2373 | }
|
2374 | try {
|
2375 |
|
2376 | return cachedSetTimeout(fun, 0);
|
2377 | } catch(e){
|
2378 | try {
|
2379 |
|
2380 | return cachedSetTimeout.call(null, fun, 0);
|
2381 | } catch(e){
|
2382 |
|
2383 | return cachedSetTimeout.call(this, fun, 0);
|
2384 | }
|
2385 | }
|
2386 |
|
2387 |
|
2388 | }
|
2389 | function runClearTimeout(marker) {
|
2390 | if (cachedClearTimeout === clearTimeout) {
|
2391 |
|
2392 | return clearTimeout(marker);
|
2393 | }
|
2394 |
|
2395 | if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
|
2396 | cachedClearTimeout = clearTimeout;
|
2397 | return clearTimeout(marker);
|
2398 | }
|
2399 | try {
|
2400 |
|
2401 | return cachedClearTimeout(marker);
|
2402 | } catch (e){
|
2403 | try {
|
2404 |
|
2405 | return cachedClearTimeout.call(null, marker);
|
2406 | } catch (e){
|
2407 |
|
2408 |
|
2409 | return cachedClearTimeout.call(this, marker);
|
2410 | }
|
2411 | }
|
2412 |
|
2413 |
|
2414 |
|
2415 | }
|
2416 | var queue = [];
|
2417 | var draining = false;
|
2418 | var currentQueue;
|
2419 | var queueIndex = -1;
|
2420 |
|
2421 | function cleanUpNextTick() {
|
2422 | if (!draining || !currentQueue) {
|
2423 | return;
|
2424 | }
|
2425 | draining = false;
|
2426 | if (currentQueue.length) {
|
2427 | queue = currentQueue.concat(queue);
|
2428 | } else {
|
2429 | queueIndex = -1;
|
2430 | }
|
2431 | if (queue.length) {
|
2432 | drainQueue();
|
2433 | }
|
2434 | }
|
2435 |
|
2436 | function drainQueue() {
|
2437 | if (draining) {
|
2438 | return;
|
2439 | }
|
2440 | var timeout = runTimeout(cleanUpNextTick);
|
2441 | draining = true;
|
2442 |
|
2443 | var len = queue.length;
|
2444 | while(len) {
|
2445 | currentQueue = queue;
|
2446 | queue = [];
|
2447 | while (++queueIndex < len) {
|
2448 | if (currentQueue) {
|
2449 | currentQueue[queueIndex].run();
|
2450 | }
|
2451 | }
|
2452 | queueIndex = -1;
|
2453 | len = queue.length;
|
2454 | }
|
2455 | currentQueue = null;
|
2456 | draining = false;
|
2457 | runClearTimeout(timeout);
|
2458 | }
|
2459 |
|
2460 | process.nextTick = function (fun) {
|
2461 | var args = new Array(arguments.length - 1);
|
2462 | if (arguments.length > 1) {
|
2463 | for (var i = 1; i < arguments.length; i++) {
|
2464 | args[i - 1] = arguments[i];
|
2465 | }
|
2466 | }
|
2467 | queue.push(new Item(fun, args));
|
2468 | if (queue.length === 1 && !draining) {
|
2469 | runTimeout(drainQueue);
|
2470 | }
|
2471 | };
|
2472 |
|
2473 |
|
2474 | function Item(fun, array) {
|
2475 | this.fun = fun;
|
2476 | this.array = array;
|
2477 | }
|
2478 | Item.prototype.run = function () {
|
2479 | this.fun.apply(null, this.array);
|
2480 | };
|
2481 | process.title = 'browser';
|
2482 | process.browser = true;
|
2483 | process.env = {};
|
2484 | process.argv = [];
|
2485 | process.version = '';
|
2486 | process.versions = {};
|
2487 |
|
2488 | function noop() {}
|
2489 |
|
2490 | process.on = noop;
|
2491 | process.addListener = noop;
|
2492 | process.once = noop;
|
2493 | process.off = noop;
|
2494 | process.removeListener = noop;
|
2495 | process.removeAllListeners = noop;
|
2496 | process.emit = noop;
|
2497 | process.prependListener = noop;
|
2498 | process.prependOnceListener = noop;
|
2499 |
|
2500 | process.listeners = function (name) { return [] }
|
2501 |
|
2502 | process.binding = function (name) {
|
2503 | throw new Error('process.binding is not supported');
|
2504 | };
|
2505 |
|
2506 | process.cwd = function () { return '/' };
|
2507 | process.chdir = function (dir) {
|
2508 | throw new Error('process.chdir is not supported');
|
2509 | };
|
2510 | process.umask = function() { return 0; };
|
2511 |
|
2512 |
|
2513 | }),
|
2514 |
|
2515 | (function(module, exports, __webpack_require__) {
|
2516 |
|
2517 | 'use strict';
|
2518 |
|
2519 | exports.__esModule = true;
|
2520 |
|
2521 | 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; };
|
2522 |
|
2523 | var _react = __webpack_require__(4);
|
2524 |
|
2525 | var _react2 = _interopRequireDefault(_react);
|
2526 |
|
2527 | var _createChainableTypeChecker = __webpack_require__(29);
|
2528 |
|
2529 | var _createChainableTypeChecker2 = _interopRequireDefault(_createChainableTypeChecker);
|
2530 |
|
2531 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
2532 |
|
2533 | function elementType(props, propName, componentName, location, propFullName) {
|
2534 | var propValue = props[propName];
|
2535 | var propType = typeof propValue === 'undefined' ? 'undefined' : _typeof(propValue);
|
2536 |
|
2537 | if (_react2.default.isValidElement(propValue)) {
|
2538 | return new Error('Invalid ' + location + ' `' + propFullName + '` of type ReactElement ' + ('supplied to `' + componentName + '`, expected an element type (a string ') + 'or a ReactClass).');
|
2539 | }
|
2540 |
|
2541 | if (propType !== 'function' && propType !== 'string') {
|
2542 | return new Error('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected an element type (a string ') + 'or a ReactClass).');
|
2543 | }
|
2544 |
|
2545 | return null;
|
2546 | }
|
2547 |
|
2548 | exports.default = (0, _createChainableTypeChecker2.default)(elementType);
|
2549 |
|
2550 | }),
|
2551 |
|
2552 | (function(module, exports) {
|
2553 |
|
2554 | 'use strict';
|
2555 |
|
2556 | exports.__esModule = true;
|
2557 | exports.default = isRequiredForA11y;
|
2558 | function isRequiredForA11y(validator) {
|
2559 | return function validate(props, propName, componentName, location, propFullName) {
|
2560 | var componentNameSafe = componentName || '<<anonymous>>';
|
2561 | var propFullNameSafe = propFullName || propName;
|
2562 |
|
2563 | if (props[propName] == null) {
|
2564 | return new Error('The ' + location + ' `' + propFullNameSafe + '` is required to make ' + ('`' + componentNameSafe + '` accessible for users of assistive ') + 'technologies such as screen readers.');
|
2565 | }
|
2566 |
|
2567 | for (var _len = arguments.length, args = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) {
|
2568 | args[_key - 5] = arguments[_key];
|
2569 | }
|
2570 |
|
2571 | return validator.apply(undefined, [props, propName, componentName, location, propFullName].concat(args));
|
2572 | };
|
2573 | }
|
2574 |
|
2575 | }),
|
2576 |
|
2577 | (function(module, exports) {
|
2578 |
|
2579 | "use strict";
|
2580 |
|
2581 | exports.__esModule = true;
|
2582 | exports.default = splitComponentProps;
|
2583 | function _objectEntries(obj) {
|
2584 | var entries = [];
|
2585 | var keys = Object.keys(obj);
|
2586 |
|
2587 | for (var k = 0; k < keys.length; ++k) {
|
2588 | entries.push([keys[k], obj[keys[k]]]);
|
2589 | }return entries;
|
2590 | }
|
2591 |
|
2592 | |
2593 |
|
2594 |
|
2595 |
|
2596 |
|
2597 |
|
2598 | function splitComponentProps(props, Component) {
|
2599 | var componentPropTypes = Component.propTypes;
|
2600 |
|
2601 | var parentProps = {};
|
2602 | var childProps = {};
|
2603 |
|
2604 | _objectEntries(props).forEach(function (_ref) {
|
2605 | var propName = _ref[0],
|
2606 | propValue = _ref[1];
|
2607 |
|
2608 | if (componentPropTypes[propName]) {
|
2609 | parentProps[propName] = propValue;
|
2610 | } else {
|
2611 | childProps[propName] = propValue;
|
2612 | }
|
2613 | });
|
2614 |
|
2615 | return [parentProps, childProps];
|
2616 | }
|
2617 |
|
2618 | }),
|
2619 |
|
2620 | (function(module, exports) {
|
2621 |
|
2622 | 'use strict';
|
2623 |
|
2624 | exports.__esModule = true;
|
2625 | function createChainedFunction() {
|
2626 | for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {
|
2627 | funcs[_key] = arguments[_key];
|
2628 | }
|
2629 |
|
2630 | return funcs.filter(function (f) {
|
2631 | return f != null;
|
2632 | }).reduce(function (acc, f) {
|
2633 | if (typeof f !== 'function') {
|
2634 | throw new Error('Invalid Argument Type, must only provide functions, undefined, or null.');
|
2635 | }
|
2636 |
|
2637 | if (acc === null) {
|
2638 | return f;
|
2639 | }
|
2640 |
|
2641 | return function chainedFunction() {
|
2642 | for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
2643 | args[_key2] = arguments[_key2];
|
2644 | }
|
2645 |
|
2646 | acc.apply(this, args);
|
2647 | f.apply(this, args);
|
2648 | };
|
2649 | }, null);
|
2650 | }
|
2651 | exports.default = createChainedFunction;
|
2652 |
|
2653 | }),
|
2654 |
|
2655 | (function(module, exports) {
|
2656 |
|
2657 | 'use strict';
|
2658 |
|
2659 | |
2660 |
|
2661 |
|
2662 |
|
2663 |
|
2664 |
|
2665 | var KeyCode = {
|
2666 | |
2667 |
|
2668 |
|
2669 | MAC_ENTER: 3,
|
2670 | |
2671 |
|
2672 |
|
2673 | BACKSPACE: 8,
|
2674 | |
2675 |
|
2676 |
|
2677 | TAB: 9,
|
2678 | |
2679 |
|
2680 |
|
2681 | NUM_CENTER: 12,
|
2682 | |
2683 |
|
2684 |
|
2685 | ENTER: 13,
|
2686 | |
2687 |
|
2688 |
|
2689 | SHIFT: 16,
|
2690 | |
2691 |
|
2692 |
|
2693 | CTRL: 17,
|
2694 | |
2695 |
|
2696 |
|
2697 | ALT: 18,
|
2698 | |
2699 |
|
2700 |
|
2701 | PAUSE: 19,
|
2702 | |
2703 |
|
2704 |
|
2705 | CAPS_LOCK: 20,
|
2706 | |
2707 |
|
2708 |
|
2709 | ESC: 27,
|
2710 | |
2711 |
|
2712 |
|
2713 | SPACE: 32,
|
2714 | |
2715 |
|
2716 |
|
2717 | PAGE_UP: 33,
|
2718 | |
2719 |
|
2720 |
|
2721 | PAGE_DOWN: 34,
|
2722 | |
2723 |
|
2724 |
|
2725 | END: 35,
|
2726 | |
2727 |
|
2728 |
|
2729 | HOME: 36,
|
2730 | |
2731 |
|
2732 |
|
2733 | LEFT: 37,
|
2734 | |
2735 |
|
2736 |
|
2737 | UP: 38,
|
2738 | |
2739 |
|
2740 |
|
2741 | RIGHT: 39,
|
2742 | |
2743 |
|
2744 |
|
2745 | DOWN: 40,
|
2746 | |
2747 |
|
2748 |
|
2749 | PRINT_SCREEN: 44,
|
2750 | |
2751 |
|
2752 |
|
2753 | INSERT: 45,
|
2754 | |
2755 |
|
2756 |
|
2757 | DELETE: 46,
|
2758 | |
2759 |
|
2760 |
|
2761 | ZERO: 48,
|
2762 | |
2763 |
|
2764 |
|
2765 | ONE: 49,
|
2766 | |
2767 |
|
2768 |
|
2769 | TWO: 50,
|
2770 | |
2771 |
|
2772 |
|
2773 | THREE: 51,
|
2774 | |
2775 |
|
2776 |
|
2777 | FOUR: 52,
|
2778 | |
2779 |
|
2780 |
|
2781 | FIVE: 53,
|
2782 | |
2783 |
|
2784 |
|
2785 | SIX: 54,
|
2786 | |
2787 |
|
2788 |
|
2789 | SEVEN: 55,
|
2790 | |
2791 |
|
2792 |
|
2793 | EIGHT: 56,
|
2794 | |
2795 |
|
2796 |
|
2797 | NINE: 57,
|
2798 | |
2799 |
|
2800 |
|
2801 | QUESTION_MARK: 63,
|
2802 | |
2803 |
|
2804 |
|
2805 | A: 65,
|
2806 | |
2807 |
|
2808 |
|
2809 | B: 66,
|
2810 | |
2811 |
|
2812 |
|
2813 | C: 67,
|
2814 | |
2815 |
|
2816 |
|
2817 | D: 68,
|
2818 | |
2819 |
|
2820 |
|
2821 | E: 69,
|
2822 | |
2823 |
|
2824 |
|
2825 | F: 70,
|
2826 | |
2827 |
|
2828 |
|
2829 | G: 71,
|
2830 | |
2831 |
|
2832 |
|
2833 | H: 72,
|
2834 | |
2835 |
|
2836 |
|
2837 | I: 73,
|
2838 | |
2839 |
|
2840 |
|
2841 | J: 74,
|
2842 | |
2843 |
|
2844 |
|
2845 | K: 75,
|
2846 | |
2847 |
|
2848 |
|
2849 | L: 76,
|
2850 | |
2851 |
|
2852 |
|
2853 | M: 77,
|
2854 | |
2855 |
|
2856 |
|
2857 | N: 78,
|
2858 | |
2859 |
|
2860 |
|
2861 | O: 79,
|
2862 | |
2863 |
|
2864 |
|
2865 | P: 80,
|
2866 | |
2867 |
|
2868 |
|
2869 | Q: 81,
|
2870 | |
2871 |
|
2872 |
|
2873 | R: 82,
|
2874 | |
2875 |
|
2876 |
|
2877 | S: 83,
|
2878 | |
2879 |
|
2880 |
|
2881 | T: 84,
|
2882 | |
2883 |
|
2884 |
|
2885 | U: 85,
|
2886 | |
2887 |
|
2888 |
|
2889 | V: 86,
|
2890 | |
2891 |
|
2892 |
|
2893 | W: 87,
|
2894 | |
2895 |
|
2896 |
|
2897 | X: 88,
|
2898 | |
2899 |
|
2900 |
|
2901 | Y: 89,
|
2902 | |
2903 |
|
2904 |
|
2905 | Z: 90,
|
2906 | |
2907 |
|
2908 |
|
2909 | META: 91,
|
2910 | |
2911 |
|
2912 |
|
2913 | WIN_KEY_RIGHT: 92,
|
2914 | |
2915 |
|
2916 |
|
2917 | CONTEXT_MENU: 93,
|
2918 | |
2919 |
|
2920 |
|
2921 | NUM_ZERO: 96,
|
2922 | |
2923 |
|
2924 |
|
2925 | NUM_ONE: 97,
|
2926 | |
2927 |
|
2928 |
|
2929 | NUM_TWO: 98,
|
2930 | |
2931 |
|
2932 |
|
2933 | NUM_THREE: 99,
|
2934 | |
2935 |
|
2936 |
|
2937 | NUM_FOUR: 100,
|
2938 | |
2939 |
|
2940 |
|
2941 | NUM_FIVE: 101,
|
2942 | |
2943 |
|
2944 |
|
2945 | NUM_SIX: 102,
|
2946 | |
2947 |
|
2948 |
|
2949 | NUM_SEVEN: 103,
|
2950 | |
2951 |
|
2952 |
|
2953 | NUM_EIGHT: 104,
|
2954 | |
2955 |
|
2956 |
|
2957 | NUM_NINE: 105,
|
2958 | |
2959 |
|
2960 |
|
2961 | NUM_MULTIPLY: 106,
|
2962 | |
2963 |
|
2964 |
|
2965 | NUM_PLUS: 107,
|
2966 | |
2967 |
|
2968 |
|
2969 | NUM_MINUS: 109,
|
2970 | |
2971 |
|
2972 |
|
2973 | NUM_PERIOD: 110,
|
2974 | |
2975 |
|
2976 |
|
2977 | NUM_DIVISION: 111,
|
2978 | |
2979 |
|
2980 |
|
2981 | F1: 112,
|
2982 | |
2983 |
|
2984 |
|
2985 | F2: 113,
|
2986 | |
2987 |
|
2988 |
|
2989 | F3: 114,
|
2990 | |
2991 |
|
2992 |
|
2993 | F4: 115,
|
2994 | |
2995 |
|
2996 |
|
2997 | F5: 116,
|
2998 | |
2999 |
|
3000 |
|
3001 | F6: 117,
|
3002 | |
3003 |
|
3004 |
|
3005 | F7: 118,
|
3006 | |
3007 |
|
3008 |
|
3009 | F8: 119,
|
3010 | |
3011 |
|
3012 |
|
3013 | F9: 120,
|
3014 | |
3015 |
|
3016 |
|
3017 | F10: 121,
|
3018 | |
3019 |
|
3020 |
|
3021 | F11: 122,
|
3022 | |
3023 |
|
3024 |
|
3025 | F12: 123,
|
3026 | |
3027 |
|
3028 |
|
3029 | NUMLOCK: 144,
|
3030 | |
3031 |
|
3032 |
|
3033 | SEMICOLON: 186,
|
3034 | |
3035 |
|
3036 |
|
3037 | DASH: 189,
|
3038 | |
3039 |
|
3040 |
|
3041 | EQUALS: 187,
|
3042 | |
3043 |
|
3044 |
|
3045 | COMMA: 188,
|
3046 | |
3047 |
|
3048 |
|
3049 | PERIOD: 190,
|
3050 | |
3051 |
|
3052 |
|
3053 | SLASH: 191,
|
3054 | |
3055 |
|
3056 |
|
3057 | APOSTROPHE: 192,
|
3058 | |
3059 |
|
3060 |
|
3061 | SINGLE_QUOTE: 222,
|
3062 | |
3063 |
|
3064 |
|
3065 | OPEN_SQUARE_BRACKET: 219,
|
3066 | |
3067 |
|
3068 |
|
3069 | BACKSLASH: 220,
|
3070 | |
3071 |
|
3072 |
|
3073 | CLOSE_SQUARE_BRACKET: 221,
|
3074 | |
3075 |
|
3076 |
|
3077 | WIN_KEY: 224,
|
3078 | |
3079 |
|
3080 |
|
3081 | MAC_FF_META: 224,
|
3082 | |
3083 |
|
3084 |
|
3085 | WIN_IME: 229
|
3086 | };
|
3087 |
|
3088 | |
3089 |
|
3090 |
|
3091 | KeyCode.isTextModifyingKeyEvent = function isTextModifyingKeyEvent(e) {
|
3092 | var keyCode = e.keyCode;
|
3093 | if (e.altKey && !e.ctrlKey || e.metaKey ||
|
3094 |
|
3095 | keyCode >= KeyCode.F1 && keyCode <= KeyCode.F12) {
|
3096 | return false;
|
3097 | }
|
3098 |
|
3099 |
|
3100 |
|
3101 | switch (keyCode) {
|
3102 | case KeyCode.ALT:
|
3103 | case KeyCode.CAPS_LOCK:
|
3104 | case KeyCode.CONTEXT_MENU:
|
3105 | case KeyCode.CTRL:
|
3106 | case KeyCode.DOWN:
|
3107 | case KeyCode.END:
|
3108 | case KeyCode.ESC:
|
3109 | case KeyCode.HOME:
|
3110 | case KeyCode.INSERT:
|
3111 | case KeyCode.LEFT:
|
3112 | case KeyCode.MAC_FF_META:
|
3113 | case KeyCode.META:
|
3114 | case KeyCode.NUMLOCK:
|
3115 | case KeyCode.NUM_CENTER:
|
3116 | case KeyCode.PAGE_DOWN:
|
3117 | case KeyCode.PAGE_UP:
|
3118 | case KeyCode.PAUSE:
|
3119 | case KeyCode.PRINT_SCREEN:
|
3120 | case KeyCode.RIGHT:
|
3121 | case KeyCode.SHIFT:
|
3122 | case KeyCode.UP:
|
3123 | case KeyCode.WIN_KEY:
|
3124 | case KeyCode.WIN_KEY_RIGHT:
|
3125 | return false;
|
3126 | default:
|
3127 | return true;
|
3128 | }
|
3129 | };
|
3130 |
|
3131 | |
3132 |
|
3133 |
|
3134 | KeyCode.isCharacterKey = function isCharacterKey(keyCode) {
|
3135 | if (keyCode >= KeyCode.ZERO && keyCode <= KeyCode.NINE) {
|
3136 | return true;
|
3137 | }
|
3138 |
|
3139 | if (keyCode >= KeyCode.NUM_ZERO && keyCode <= KeyCode.NUM_MULTIPLY) {
|
3140 | return true;
|
3141 | }
|
3142 |
|
3143 | if (keyCode >= KeyCode.A && keyCode <= KeyCode.Z) {
|
3144 | return true;
|
3145 | }
|
3146 |
|
3147 |
|
3148 | if (window.navigation.userAgent.indexOf('WebKit') !== -1 && keyCode === 0) {
|
3149 | return true;
|
3150 | }
|
3151 |
|
3152 | switch (keyCode) {
|
3153 | case KeyCode.SPACE:
|
3154 | case KeyCode.QUESTION_MARK:
|
3155 | case KeyCode.NUM_PLUS:
|
3156 | case KeyCode.NUM_MINUS:
|
3157 | case KeyCode.NUM_PERIOD:
|
3158 | case KeyCode.NUM_DIVISION:
|
3159 | case KeyCode.SEMICOLON:
|
3160 | case KeyCode.DASH:
|
3161 | case KeyCode.EQUALS:
|
3162 | case KeyCode.COMMA:
|
3163 | case KeyCode.PERIOD:
|
3164 | case KeyCode.SLASH:
|
3165 | case KeyCode.APOSTROPHE:
|
3166 | case KeyCode.SINGLE_QUOTE:
|
3167 | case KeyCode.OPEN_SQUARE_BRACKET:
|
3168 | case KeyCode.BACKSLASH:
|
3169 | case KeyCode.CLOSE_SQUARE_BRACKET:
|
3170 | return true;
|
3171 | default:
|
3172 | return false;
|
3173 | }
|
3174 | };
|
3175 |
|
3176 | module.exports = KeyCode;
|
3177 |
|
3178 | }),
|
3179 |
|
3180 | (function(module, exports) {
|
3181 |
|
3182 | "use strict";
|
3183 |
|
3184 | exports.__esModule = true;
|
3185 | exports.default = contains;
|
3186 | function contains(root, n) {
|
3187 | var node = n;
|
3188 | while (node) {
|
3189 | if (node === root) {
|
3190 | return true;
|
3191 | }
|
3192 | node = node.parentNode;
|
3193 | }
|
3194 |
|
3195 | return false;
|
3196 | }
|
3197 |
|
3198 | }),
|
3199 |
|
3200 | (function(module, exports, __webpack_require__) {
|
3201 |
|
3202 | 'use strict';
|
3203 |
|
3204 | exports.__esModule = true;
|
3205 | exports.default = addEventListenerWrap;
|
3206 |
|
3207 | var _addDomEventListener = __webpack_require__(41);
|
3208 |
|
3209 | var _addDomEventListener2 = _interopRequireDefault(_addDomEventListener);
|
3210 |
|
3211 | var _reactDom = __webpack_require__(12);
|
3212 |
|
3213 | var _reactDom2 = _interopRequireDefault(_reactDom);
|
3214 |
|
3215 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
3216 |
|
3217 | function addEventListenerWrap(target, eventType, cb) {
|
3218 |
|
3219 | var callback = _reactDom2.default.unstable_batchedUpdates ? function run(e) {
|
3220 | _reactDom2.default.unstable_batchedUpdates(cb, e);
|
3221 | } : cb;
|
3222 | return (0, _addDomEventListener2.default)(target, eventType, callback);
|
3223 | }
|
3224 |
|
3225 | }),
|
3226 |
|
3227 | (function(module, exports, __webpack_require__) {
|
3228 |
|
3229 | 'use strict';
|
3230 |
|
3231 | Object.defineProperty(exports, '__esModule', {
|
3232 | value: true
|
3233 | });
|
3234 | exports['default'] = addEventListener;
|
3235 |
|
3236 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
3237 |
|
3238 | var _EventObject = __webpack_require__(42);
|
3239 |
|
3240 | var _EventObject2 = _interopRequireDefault(_EventObject);
|
3241 |
|
3242 | function addEventListener(target, eventType, callback, option) {
|
3243 | function wrapCallback(e) {
|
3244 | var ne = new _EventObject2['default'](e);
|
3245 | callback.call(target, ne);
|
3246 | }
|
3247 |
|
3248 | if (target.addEventListener) {
|
3249 | var _ret = (function () {
|
3250 | var useCapture = false;
|
3251 | if (typeof option === 'object') {
|
3252 | useCapture = option.capture || false;
|
3253 | } else if (typeof option === 'boolean') {
|
3254 | useCapture = option;
|
3255 | }
|
3256 |
|
3257 | target.addEventListener(eventType, wrapCallback, option || false);
|
3258 |
|
3259 | return {
|
3260 | v: {
|
3261 | remove: function remove() {
|
3262 | target.removeEventListener(eventType, wrapCallback, useCapture);
|
3263 | }
|
3264 | }
|
3265 | };
|
3266 | })();
|
3267 |
|
3268 | if (typeof _ret === 'object') return _ret.v;
|
3269 | } else if (target.attachEvent) {
|
3270 | target.attachEvent('on' + eventType, wrapCallback);
|
3271 | return {
|
3272 | remove: function remove() {
|
3273 | target.detachEvent('on' + eventType, wrapCallback);
|
3274 | }
|
3275 | };
|
3276 | }
|
3277 | }
|
3278 |
|
3279 | module.exports = exports['default'];
|
3280 |
|
3281 | }),
|
3282 |
|
3283 | (function(module, exports, __webpack_require__) {
|
3284 |
|
3285 | |
3286 |
|
3287 |
|
3288 |
|
3289 |
|
3290 |
|
3291 | 'use strict';
|
3292 |
|
3293 | Object.defineProperty(exports, '__esModule', {
|
3294 | value: true
|
3295 | });
|
3296 |
|
3297 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
3298 |
|
3299 | var _EventBaseObject = __webpack_require__(43);
|
3300 |
|
3301 | var _EventBaseObject2 = _interopRequireDefault(_EventBaseObject);
|
3302 |
|
3303 | var _objectAssign = __webpack_require__(44);
|
3304 |
|
3305 | var _objectAssign2 = _interopRequireDefault(_objectAssign);
|
3306 |
|
3307 | var TRUE = true;
|
3308 | var FALSE = false;
|
3309 | var commonProps = ['altKey', 'bubbles', 'cancelable', 'ctrlKey', 'currentTarget', 'eventPhase', 'metaKey', 'shiftKey', 'target', 'timeStamp', 'view', 'type'];
|
3310 |
|
3311 | function isNullOrUndefined(w) {
|
3312 | return w === null || w === undefined;
|
3313 | }
|
3314 |
|
3315 | var eventNormalizers = [{
|
3316 | reg: /^key/,
|
3317 | props: ['char', 'charCode', 'key', 'keyCode', 'which'],
|
3318 | fix: function fix(event, nativeEvent) {
|
3319 | if (isNullOrUndefined(event.which)) {
|
3320 | event.which = !isNullOrUndefined(nativeEvent.charCode) ? nativeEvent.charCode : nativeEvent.keyCode;
|
3321 | }
|
3322 |
|
3323 |
|
3324 | if (event.metaKey === undefined) {
|
3325 | event.metaKey = event.ctrlKey;
|
3326 | }
|
3327 | }
|
3328 | }, {
|
3329 | reg: /^touch/,
|
3330 | props: ['touches', 'changedTouches', 'targetTouches']
|
3331 | }, {
|
3332 | reg: /^hashchange$/,
|
3333 | props: ['newURL', 'oldURL']
|
3334 | }, {
|
3335 | reg: /^gesturechange$/i,
|
3336 | props: ['rotation', 'scale']
|
3337 | }, {
|
3338 | reg: /^(mousewheel|DOMMouseScroll)$/,
|
3339 | props: [],
|
3340 | fix: function fix(event, nativeEvent) {
|
3341 | var deltaX = undefined;
|
3342 | var deltaY = undefined;
|
3343 | var delta = undefined;
|
3344 | var wheelDelta = nativeEvent.wheelDelta;
|
3345 | var axis = nativeEvent.axis;
|
3346 | var wheelDeltaY = nativeEvent.wheelDeltaY;
|
3347 | var wheelDeltaX = nativeEvent.wheelDeltaX;
|
3348 | var detail = nativeEvent.detail;
|
3349 |
|
3350 |
|
3351 | if (wheelDelta) {
|
3352 | delta = wheelDelta / 120;
|
3353 | }
|
3354 |
|
3355 |
|
3356 | if (detail) {
|
3357 |
|
3358 | delta = 0 - (detail % 3 === 0 ? detail / 3 : detail);
|
3359 | }
|
3360 |
|
3361 |
|
3362 | if (axis !== undefined) {
|
3363 | if (axis === event.HORIZONTAL_AXIS) {
|
3364 | deltaY = 0;
|
3365 | deltaX = 0 - delta;
|
3366 | } else if (axis === event.VERTICAL_AXIS) {
|
3367 | deltaX = 0;
|
3368 | deltaY = delta;
|
3369 | }
|
3370 | }
|
3371 |
|
3372 |
|
3373 | if (wheelDeltaY !== undefined) {
|
3374 | deltaY = wheelDeltaY / 120;
|
3375 | }
|
3376 | if (wheelDeltaX !== undefined) {
|
3377 | deltaX = -1 * wheelDeltaX / 120;
|
3378 | }
|
3379 |
|
3380 |
|
3381 | if (!deltaX && !deltaY) {
|
3382 | deltaY = delta;
|
3383 | }
|
3384 |
|
3385 | if (deltaX !== undefined) {
|
3386 | |
3387 |
|
3388 |
|
3389 |
|
3390 |
|
3391 | event.deltaX = deltaX;
|
3392 | }
|
3393 |
|
3394 | if (deltaY !== undefined) {
|
3395 | |
3396 |
|
3397 |
|
3398 |
|
3399 |
|
3400 | event.deltaY = deltaY;
|
3401 | }
|
3402 |
|
3403 | if (delta !== undefined) {
|
3404 | |
3405 |
|
3406 |
|
3407 |
|
3408 |
|
3409 | event.delta = delta;
|
3410 | }
|
3411 | }
|
3412 | }, {
|
3413 | reg: /^mouse|contextmenu|click|mspointer|(^DOMMouseScroll$)/i,
|
3414 | props: ['buttons', 'clientX', 'clientY', 'button', 'offsetX', 'relatedTarget', 'which', 'fromElement', 'toElement', 'offsetY', 'pageX', 'pageY', 'screenX', 'screenY'],
|
3415 | fix: function fix(event, nativeEvent) {
|
3416 | var eventDoc = undefined;
|
3417 | var doc = undefined;
|
3418 | var body = undefined;
|
3419 | var target = event.target;
|
3420 | var button = nativeEvent.button;
|
3421 |
|
3422 |
|
3423 | if (target && isNullOrUndefined(event.pageX) && !isNullOrUndefined(nativeEvent.clientX)) {
|
3424 | eventDoc = target.ownerDocument || document;
|
3425 | doc = eventDoc.documentElement;
|
3426 | body = eventDoc.body;
|
3427 | event.pageX = nativeEvent.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
|
3428 | event.pageY = nativeEvent.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
|
3429 | }
|
3430 |
|
3431 |
|
3432 |
|
3433 | if (!event.which && button !== undefined) {
|
3434 | if (button & 1) {
|
3435 | event.which = 1;
|
3436 | } else if (button & 2) {
|
3437 | event.which = 3;
|
3438 | } else if (button & 4) {
|
3439 | event.which = 2;
|
3440 | } else {
|
3441 | event.which = 0;
|
3442 | }
|
3443 | }
|
3444 |
|
3445 |
|
3446 | if (!event.relatedTarget && event.fromElement) {
|
3447 | event.relatedTarget = event.fromElement === target ? event.toElement : event.fromElement;
|
3448 | }
|
3449 |
|
3450 | return event;
|
3451 | }
|
3452 | }];
|
3453 |
|
3454 | function retTrue() {
|
3455 | return TRUE;
|
3456 | }
|
3457 |
|
3458 | function retFalse() {
|
3459 | return FALSE;
|
3460 | }
|
3461 |
|
3462 | function DomEventObject(nativeEvent) {
|
3463 | var type = nativeEvent.type;
|
3464 |
|
3465 | var isNative = typeof nativeEvent.stopPropagation === 'function' || typeof nativeEvent.cancelBubble === 'boolean';
|
3466 |
|
3467 | _EventBaseObject2['default'].call(this);
|
3468 |
|
3469 | this.nativeEvent = nativeEvent;
|
3470 |
|
3471 |
|
3472 | var isDefaultPrevented = retFalse;
|
3473 | if ('defaultPrevented' in nativeEvent) {
|
3474 | isDefaultPrevented = nativeEvent.defaultPrevented ? retTrue : retFalse;
|
3475 | } else if ('getPreventDefault' in nativeEvent) {
|
3476 |
|
3477 | isDefaultPrevented = nativeEvent.getPreventDefault() ? retTrue : retFalse;
|
3478 | } else if ('returnValue' in nativeEvent) {
|
3479 | isDefaultPrevented = nativeEvent.returnValue === FALSE ? retTrue : retFalse;
|
3480 | }
|
3481 |
|
3482 | this.isDefaultPrevented = isDefaultPrevented;
|
3483 |
|
3484 | var fixFns = [];
|
3485 | var fixFn = undefined;
|
3486 | var l = undefined;
|
3487 | var prop = undefined;
|
3488 | var props = commonProps.concat();
|
3489 |
|
3490 | eventNormalizers.forEach(function (normalizer) {
|
3491 | if (type.match(normalizer.reg)) {
|
3492 | props = props.concat(normalizer.props);
|
3493 | if (normalizer.fix) {
|
3494 | fixFns.push(normalizer.fix);
|
3495 | }
|
3496 | }
|
3497 | });
|
3498 |
|
3499 | l = props.length;
|
3500 |
|
3501 |
|
3502 | while (l) {
|
3503 | prop = props[--l];
|
3504 | this[prop] = nativeEvent[prop];
|
3505 | }
|
3506 |
|
3507 |
|
3508 | if (!this.target && isNative) {
|
3509 | this.target = nativeEvent.srcElement || document;
|
3510 | }
|
3511 |
|
3512 |
|
3513 | if (this.target && this.target.nodeType === 3) {
|
3514 | this.target = this.target.parentNode;
|
3515 | }
|
3516 |
|
3517 | l = fixFns.length;
|
3518 |
|
3519 | while (l) {
|
3520 | fixFn = fixFns[--l];
|
3521 | fixFn(this, nativeEvent);
|
3522 | }
|
3523 |
|
3524 | this.timeStamp = nativeEvent.timeStamp || Date.now();
|
3525 | }
|
3526 |
|
3527 | var EventBaseObjectProto = _EventBaseObject2['default'].prototype;
|
3528 |
|
3529 | (0, _objectAssign2['default'])(DomEventObject.prototype, EventBaseObjectProto, {
|
3530 | constructor: DomEventObject,
|
3531 |
|
3532 | preventDefault: function preventDefault() {
|
3533 | var e = this.nativeEvent;
|
3534 |
|
3535 |
|
3536 | if (e.preventDefault) {
|
3537 | e.preventDefault();
|
3538 | } else {
|
3539 |
|
3540 | e.returnValue = FALSE;
|
3541 | }
|
3542 |
|
3543 | EventBaseObjectProto.preventDefault.call(this);
|
3544 | },
|
3545 |
|
3546 | stopPropagation: function stopPropagation() {
|
3547 | var e = this.nativeEvent;
|
3548 |
|
3549 |
|
3550 | if (e.stopPropagation) {
|
3551 | e.stopPropagation();
|
3552 | } else {
|
3553 |
|
3554 | e.cancelBubble = TRUE;
|
3555 | }
|
3556 |
|
3557 | EventBaseObjectProto.stopPropagation.call(this);
|
3558 | }
|
3559 | });
|
3560 |
|
3561 | exports['default'] = DomEventObject;
|
3562 | module.exports = exports['default'];
|
3563 |
|
3564 | }),
|
3565 |
|
3566 | (function(module, exports) {
|
3567 |
|
3568 | |
3569 |
|
3570 |
|
3571 |
|
3572 |
|
3573 |
|
3574 | "use strict";
|
3575 |
|
3576 | Object.defineProperty(exports, "__esModule", {
|
3577 | value: true
|
3578 | });
|
3579 | function returnFalse() {
|
3580 | return false;
|
3581 | }
|
3582 |
|
3583 | function returnTrue() {
|
3584 | return true;
|
3585 | }
|
3586 |
|
3587 | function EventBaseObject() {
|
3588 | this.timeStamp = Date.now();
|
3589 | this.target = undefined;
|
3590 | this.currentTarget = undefined;
|
3591 | }
|
3592 |
|
3593 | EventBaseObject.prototype = {
|
3594 | isEventObject: 1,
|
3595 |
|
3596 | constructor: EventBaseObject,
|
3597 |
|
3598 | isDefaultPrevented: returnFalse,
|
3599 |
|
3600 | isPropagationStopped: returnFalse,
|
3601 |
|
3602 | isImmediatePropagationStopped: returnFalse,
|
3603 |
|
3604 | preventDefault: function preventDefault() {
|
3605 | this.isDefaultPrevented = returnTrue;
|
3606 | },
|
3607 |
|
3608 | stopPropagation: function stopPropagation() {
|
3609 | this.isPropagationStopped = returnTrue;
|
3610 | },
|
3611 |
|
3612 | stopImmediatePropagation: function stopImmediatePropagation() {
|
3613 | this.isImmediatePropagationStopped = returnTrue;
|
3614 |
|
3615 |
|
3616 | this.stopPropagation();
|
3617 | },
|
3618 |
|
3619 | halt: function halt(immediate) {
|
3620 | if (immediate) {
|
3621 | this.stopImmediatePropagation();
|
3622 | } else {
|
3623 | this.stopPropagation();
|
3624 | }
|
3625 | this.preventDefault();
|
3626 | }
|
3627 | };
|
3628 |
|
3629 | exports["default"] = EventBaseObject;
|
3630 | module.exports = exports["default"];
|
3631 |
|
3632 | }),
|
3633 |
|
3634 | (function(module, exports) {
|
3635 |
|
3636 | |
3637 |
|
3638 |
|
3639 |
|
3640 |
|
3641 |
|
3642 | 'use strict';
|
3643 |
|
3644 | var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
3645 | var hasOwnProperty = Object.prototype.hasOwnProperty;
|
3646 | var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
3647 |
|
3648 | function toObject(val) {
|
3649 | if (val === null || val === undefined) {
|
3650 | throw new TypeError('Object.assign cannot be called with null or undefined');
|
3651 | }
|
3652 |
|
3653 | return Object(val);
|
3654 | }
|
3655 |
|
3656 | function shouldUseNative() {
|
3657 | try {
|
3658 | if (!Object.assign) {
|
3659 | return false;
|
3660 | }
|
3661 |
|
3662 |
|
3663 |
|
3664 |
|
3665 | var test1 = new String('abc');
|
3666 | test1[5] = 'de';
|
3667 | if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
3668 | return false;
|
3669 | }
|
3670 |
|
3671 |
|
3672 | var test2 = {};
|
3673 | for (var i = 0; i < 10; i++) {
|
3674 | test2['_' + String.fromCharCode(i)] = i;
|
3675 | }
|
3676 | var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
3677 | return test2[n];
|
3678 | });
|
3679 | if (order2.join('') !== '0123456789') {
|
3680 | return false;
|
3681 | }
|
3682 |
|
3683 |
|
3684 | var test3 = {};
|
3685 | 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
3686 | test3[letter] = letter;
|
3687 | });
|
3688 | if (Object.keys(Object.assign({}, test3)).join('') !==
|
3689 | 'abcdefghijklmnopqrst') {
|
3690 | return false;
|
3691 | }
|
3692 |
|
3693 | return true;
|
3694 | } catch (err) {
|
3695 |
|
3696 | return false;
|
3697 | }
|
3698 | }
|
3699 |
|
3700 | module.exports = shouldUseNative() ? Object.assign : function (target, source) {
|
3701 | var from;
|
3702 | var to = toObject(target);
|
3703 | var symbols;
|
3704 |
|
3705 | for (var s = 1; s < arguments.length; s++) {
|
3706 | from = Object(arguments[s]);
|
3707 |
|
3708 | for (var key in from) {
|
3709 | if (hasOwnProperty.call(from, key)) {
|
3710 | to[key] = from[key];
|
3711 | }
|
3712 | }
|
3713 |
|
3714 | if (getOwnPropertySymbols) {
|
3715 | symbols = getOwnPropertySymbols(from);
|
3716 | for (var i = 0; i < symbols.length; i++) {
|
3717 | if (propIsEnumerable.call(from, symbols[i])) {
|
3718 | to[symbols[i]] = from[symbols[i]];
|
3719 | }
|
3720 | }
|
3721 | }
|
3722 | }
|
3723 |
|
3724 | return to;
|
3725 | };
|
3726 |
|
3727 |
|
3728 | }),
|
3729 |
|
3730 | (function(module, exports, __webpack_require__) {
|
3731 |
|
3732 | 'use strict';
|
3733 |
|
3734 | exports.__esModule = true;
|
3735 |
|
3736 | 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; };
|
3737 |
|
3738 | var _Event = __webpack_require__(46);
|
3739 |
|
3740 | var _Event2 = _interopRequireDefault(_Event);
|
3741 |
|
3742 | var _componentClasses = __webpack_require__(47);
|
3743 |
|
3744 | var _componentClasses2 = _interopRequireDefault(_componentClasses);
|
3745 |
|
3746 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
3747 |
|
3748 | var isCssAnimationSupported = _Event2.default.endEvents.length !== 0;
|
3749 |
|
3750 |
|
3751 | var capitalPrefixes = ['Webkit', 'Moz', 'O',
|
3752 |
|
3753 | 'ms'];
|
3754 | var prefixes = ['-webkit-', '-moz-', '-o-', 'ms-', ''];
|
3755 |
|
3756 | function getStyleProperty(node, name) {
|
3757 | var style = window.getComputedStyle(node);
|
3758 |
|
3759 | var ret = '';
|
3760 | for (var i = 0; i < prefixes.length; i++) {
|
3761 | ret = style.getPropertyValue(prefixes[i] + name);
|
3762 | if (ret) {
|
3763 | break;
|
3764 | }
|
3765 | }
|
3766 | return ret;
|
3767 | }
|
3768 |
|
3769 | function fixBrowserByTimeout(node) {
|
3770 | if (isCssAnimationSupported) {
|
3771 | var transitionDelay = parseFloat(getStyleProperty(node, 'transition-delay')) || 0;
|
3772 | var transitionDuration = parseFloat(getStyleProperty(node, 'transition-duration')) || 0;
|
3773 | var animationDelay = parseFloat(getStyleProperty(node, 'animation-delay')) || 0;
|
3774 | var animationDuration = parseFloat(getStyleProperty(node, 'animation-duration')) || 0;
|
3775 | var time = Math.max(transitionDuration + transitionDelay, animationDuration + animationDelay);
|
3776 |
|
3777 | node.rcEndAnimTimeout = setTimeout(function () {
|
3778 | node.rcEndAnimTimeout = null;
|
3779 | if (node.rcEndListener) {
|
3780 | node.rcEndListener();
|
3781 | }
|
3782 | }, time * 1000 + 200);
|
3783 | }
|
3784 | }
|
3785 |
|
3786 | function clearBrowserBugTimeout(node) {
|
3787 | if (node.rcEndAnimTimeout) {
|
3788 | clearTimeout(node.rcEndAnimTimeout);
|
3789 | node.rcEndAnimTimeout = null;
|
3790 | }
|
3791 | }
|
3792 |
|
3793 | var cssAnimation = function cssAnimation(node, transitionName, endCallback) {
|
3794 | var nameIsObj = (typeof transitionName === 'undefined' ? 'undefined' : _typeof(transitionName)) === 'object';
|
3795 | var className = nameIsObj ? transitionName.name : transitionName;
|
3796 | var activeClassName = nameIsObj ? transitionName.active : transitionName + '-active';
|
3797 | var end = endCallback;
|
3798 | var start = void 0;
|
3799 | var active = void 0;
|
3800 | var nodeClasses = (0, _componentClasses2.default)(node);
|
3801 |
|
3802 | if (endCallback && Object.prototype.toString.call(endCallback) === '[object Object]') {
|
3803 | end = endCallback.end;
|
3804 | start = endCallback.start;
|
3805 | active = endCallback.active;
|
3806 | }
|
3807 |
|
3808 | if (node.rcEndListener) {
|
3809 | node.rcEndListener();
|
3810 | }
|
3811 |
|
3812 | node.rcEndListener = function (e) {
|
3813 | if (e && e.target !== node) {
|
3814 | return;
|
3815 | }
|
3816 |
|
3817 | if (node.rcAnimTimeout) {
|
3818 | clearTimeout(node.rcAnimTimeout);
|
3819 | node.rcAnimTimeout = null;
|
3820 | }
|
3821 |
|
3822 | clearBrowserBugTimeout(node);
|
3823 |
|
3824 | nodeClasses.remove(className);
|
3825 | nodeClasses.remove(activeClassName);
|
3826 |
|
3827 | _Event2.default.removeEndEventListener(node, node.rcEndListener);
|
3828 | node.rcEndListener = null;
|
3829 |
|
3830 |
|
3831 |
|
3832 | if (end) {
|
3833 | end();
|
3834 | }
|
3835 | };
|
3836 |
|
3837 | _Event2.default.addEndEventListener(node, node.rcEndListener);
|
3838 |
|
3839 | if (start) {
|
3840 | start();
|
3841 | }
|
3842 | nodeClasses.add(className);
|
3843 |
|
3844 | node.rcAnimTimeout = setTimeout(function () {
|
3845 | node.rcAnimTimeout = null;
|
3846 | nodeClasses.add(activeClassName);
|
3847 | if (active) {
|
3848 | setTimeout(active, 0);
|
3849 | }
|
3850 | fixBrowserByTimeout(node);
|
3851 |
|
3852 | }, 30);
|
3853 |
|
3854 | return {
|
3855 | stop: function stop() {
|
3856 | if (node.rcEndListener) {
|
3857 | node.rcEndListener();
|
3858 | }
|
3859 | }
|
3860 | };
|
3861 | };
|
3862 |
|
3863 | cssAnimation.style = function (node, style, callback) {
|
3864 | if (node.rcEndListener) {
|
3865 | node.rcEndListener();
|
3866 | }
|
3867 |
|
3868 | node.rcEndListener = function (e) {
|
3869 | if (e && e.target !== node) {
|
3870 | return;
|
3871 | }
|
3872 |
|
3873 | if (node.rcAnimTimeout) {
|
3874 | clearTimeout(node.rcAnimTimeout);
|
3875 | node.rcAnimTimeout = null;
|
3876 | }
|
3877 |
|
3878 | clearBrowserBugTimeout(node);
|
3879 |
|
3880 | _Event2.default.removeEndEventListener(node, node.rcEndListener);
|
3881 | node.rcEndListener = null;
|
3882 |
|
3883 |
|
3884 |
|
3885 | if (callback) {
|
3886 | callback();
|
3887 | }
|
3888 | };
|
3889 |
|
3890 | _Event2.default.addEndEventListener(node, node.rcEndListener);
|
3891 |
|
3892 | node.rcAnimTimeout = setTimeout(function () {
|
3893 | for (var s in style) {
|
3894 | if (style.hasOwnProperty(s)) {
|
3895 | node.style[s] = style[s];
|
3896 | }
|
3897 | }
|
3898 | node.rcAnimTimeout = null;
|
3899 | fixBrowserByTimeout(node);
|
3900 | }, 0);
|
3901 | };
|
3902 |
|
3903 | cssAnimation.setTransition = function (node, p, value) {
|
3904 | var property = p;
|
3905 | var v = value;
|
3906 | if (value === undefined) {
|
3907 | v = property;
|
3908 | property = '';
|
3909 | }
|
3910 | property = property || '';
|
3911 | capitalPrefixes.forEach(function (prefix) {
|
3912 | node.style[prefix + 'Transition' + property] = v;
|
3913 | });
|
3914 | };
|
3915 |
|
3916 | cssAnimation.isCssAnimationSupported = isCssAnimationSupported;
|
3917 |
|
3918 | exports.default = cssAnimation;
|
3919 |
|
3920 | }),
|
3921 |
|
3922 | (function(module, exports) {
|
3923 |
|
3924 | 'use strict';
|
3925 |
|
3926 | exports.__esModule = true;
|
3927 | var EVENT_NAME_MAP = {
|
3928 | transitionend: {
|
3929 | transition: 'transitionend',
|
3930 | WebkitTransition: 'webkitTransitionEnd',
|
3931 | MozTransition: 'mozTransitionEnd',
|
3932 | OTransition: 'oTransitionEnd',
|
3933 | msTransition: 'MSTransitionEnd'
|
3934 | },
|
3935 |
|
3936 | animationend: {
|
3937 | animation: 'animationend',
|
3938 | WebkitAnimation: 'webkitAnimationEnd',
|
3939 | MozAnimation: 'mozAnimationEnd',
|
3940 | OAnimation: 'oAnimationEnd',
|
3941 | msAnimation: 'MSAnimationEnd'
|
3942 | }
|
3943 | };
|
3944 |
|
3945 | var endEvents = [];
|
3946 |
|
3947 | function detectEvents() {
|
3948 | var testEl = document.createElement('div');
|
3949 | var style = testEl.style;
|
3950 |
|
3951 | if (!('AnimationEvent' in window)) {
|
3952 | delete EVENT_NAME_MAP.animationend.animation;
|
3953 | }
|
3954 |
|
3955 | if (!('TransitionEvent' in window)) {
|
3956 | delete EVENT_NAME_MAP.transitionend.transition;
|
3957 | }
|
3958 |
|
3959 | for (var baseEventName in EVENT_NAME_MAP) {
|
3960 | if (EVENT_NAME_MAP.hasOwnProperty(baseEventName)) {
|
3961 | var baseEvents = EVENT_NAME_MAP[baseEventName];
|
3962 | for (var styleName in baseEvents) {
|
3963 | if (styleName in style) {
|
3964 | endEvents.push(baseEvents[styleName]);
|
3965 | break;
|
3966 | }
|
3967 | }
|
3968 | }
|
3969 | }
|
3970 | }
|
3971 |
|
3972 | if (typeof window !== 'undefined' && typeof document !== 'undefined') {
|
3973 | detectEvents();
|
3974 | }
|
3975 |
|
3976 | function addEventListener(node, eventName, eventListener) {
|
3977 | node.addEventListener(eventName, eventListener, false);
|
3978 | }
|
3979 |
|
3980 | function removeEventListener(node, eventName, eventListener) {
|
3981 | node.removeEventListener(eventName, eventListener, false);
|
3982 | }
|
3983 |
|
3984 | var TransitionEvents = {
|
3985 | addEndEventListener: function addEndEventListener(node, eventListener) {
|
3986 | if (endEvents.length === 0) {
|
3987 | window.setTimeout(eventListener, 0);
|
3988 | return;
|
3989 | }
|
3990 | endEvents.forEach(function (endEvent) {
|
3991 | addEventListener(node, endEvent, eventListener);
|
3992 | });
|
3993 | },
|
3994 |
|
3995 |
|
3996 | endEvents: endEvents,
|
3997 |
|
3998 | removeEndEventListener: function removeEndEventListener(node, eventListener) {
|
3999 | if (endEvents.length === 0) {
|
4000 | return;
|
4001 | }
|
4002 | endEvents.forEach(function (endEvent) {
|
4003 | removeEventListener(node, endEvent, eventListener);
|
4004 | });
|
4005 | }
|
4006 | };
|
4007 |
|
4008 | exports.default = TransitionEvents;
|
4009 |
|
4010 | }),
|
4011 |
|
4012 | (function(module, exports, __webpack_require__) {
|
4013 |
|
4014 | |
4015 |
|
4016 |
|
4017 |
|
4018 | try {
|
4019 | var index = __webpack_require__(48);
|
4020 | } catch (err) {
|
4021 | var index = __webpack_require__(48);
|
4022 | }
|
4023 |
|
4024 | |
4025 |
|
4026 |
|
4027 |
|
4028 | var re = /\s+/;
|
4029 |
|
4030 | |
4031 |
|
4032 |
|
4033 |
|
4034 | var toString = Object.prototype.toString;
|
4035 |
|
4036 | |
4037 |
|
4038 |
|
4039 |
|
4040 |
|
4041 |
|
4042 |
|
4043 |
|
4044 | module.exports = function(el){
|
4045 | return new ClassList(el);
|
4046 | };
|
4047 |
|
4048 | |
4049 |
|
4050 |
|
4051 |
|
4052 |
|
4053 |
|
4054 |
|
4055 | function ClassList(el) {
|
4056 | if (!el || !el.nodeType) {
|
4057 | throw new Error('A DOM element reference is required');
|
4058 | }
|
4059 | this.el = el;
|
4060 | this.list = el.classList;
|
4061 | }
|
4062 |
|
4063 | |
4064 |
|
4065 |
|
4066 |
|
4067 |
|
4068 |
|
4069 |
|
4070 |
|
4071 | ClassList.prototype.add = function(name){
|
4072 |
|
4073 | if (this.list) {
|
4074 | this.list.add(name);
|
4075 | return this;
|
4076 | }
|
4077 |
|
4078 |
|
4079 | var arr = this.array();
|
4080 | var i = index(arr, name);
|
4081 | if (!~i) arr.push(name);
|
4082 | this.el.className = arr.join(' ');
|
4083 | return this;
|
4084 | };
|
4085 |
|
4086 | |
4087 |
|
4088 |
|
4089 |
|
4090 |
|
4091 |
|
4092 |
|
4093 |
|
4094 |
|
4095 |
|
4096 | ClassList.prototype.remove = function(name){
|
4097 | if ('[object RegExp]' == toString.call(name)) {
|
4098 | return this.removeMatching(name);
|
4099 | }
|
4100 |
|
4101 |
|
4102 | if (this.list) {
|
4103 | this.list.remove(name);
|
4104 | return this;
|
4105 | }
|
4106 |
|
4107 |
|
4108 | var arr = this.array();
|
4109 | var i = index(arr, name);
|
4110 | if (~i) arr.splice(i, 1);
|
4111 | this.el.className = arr.join(' ');
|
4112 | return this;
|
4113 | };
|
4114 |
|
4115 | |
4116 |
|
4117 |
|
4118 |
|
4119 |
|
4120 |
|
4121 |
|
4122 |
|
4123 | ClassList.prototype.removeMatching = function(re){
|
4124 | var arr = this.array();
|
4125 | for (var i = 0; i < arr.length; i++) {
|
4126 | if (re.test(arr[i])) {
|
4127 | this.remove(arr[i]);
|
4128 | }
|
4129 | }
|
4130 | return this;
|
4131 | };
|
4132 |
|
4133 | |
4134 |
|
4135 |
|
4136 |
|
4137 |
|
4138 |
|
4139 |
|
4140 |
|
4141 |
|
4142 |
|
4143 |
|
4144 |
|
4145 | ClassList.prototype.toggle = function(name, force){
|
4146 |
|
4147 | if (this.list) {
|
4148 | if ("undefined" !== typeof force) {
|
4149 | if (force !== this.list.toggle(name, force)) {
|
4150 | this.list.toggle(name);
|
4151 | }
|
4152 | } else {
|
4153 | this.list.toggle(name);
|
4154 | }
|
4155 | return this;
|
4156 | }
|
4157 |
|
4158 |
|
4159 | if ("undefined" !== typeof force) {
|
4160 | if (!force) {
|
4161 | this.remove(name);
|
4162 | } else {
|
4163 | this.add(name);
|
4164 | }
|
4165 | } else {
|
4166 | if (this.has(name)) {
|
4167 | this.remove(name);
|
4168 | } else {
|
4169 | this.add(name);
|
4170 | }
|
4171 | }
|
4172 |
|
4173 | return this;
|
4174 | };
|
4175 |
|
4176 | |
4177 |
|
4178 |
|
4179 |
|
4180 |
|
4181 |
|
4182 |
|
4183 | ClassList.prototype.array = function(){
|
4184 | var className = this.el.getAttribute('class') || '';
|
4185 | var str = className.replace(/^\s+|\s+$/g, '');
|
4186 | var arr = str.split(re);
|
4187 | if ('' === arr[0]) arr.shift();
|
4188 | return arr;
|
4189 | };
|
4190 |
|
4191 | |
4192 |
|
4193 |
|
4194 |
|
4195 |
|
4196 |
|
4197 |
|
4198 |
|
4199 | ClassList.prototype.has =
|
4200 | ClassList.prototype.contains = function(name){
|
4201 | return this.list
|
4202 | ? this.list.contains(name)
|
4203 | : !! ~index(this.array(), name);
|
4204 | };
|
4205 |
|
4206 |
|
4207 | }),
|
4208 |
|
4209 | (function(module, exports) {
|
4210 |
|
4211 | module.exports = function(arr, obj){
|
4212 | if (arr.indexOf) return arr.indexOf(obj);
|
4213 | for (var i = 0; i < arr.length; ++i) {
|
4214 | if (arr[i] === obj) return i;
|
4215 | }
|
4216 | return -1;
|
4217 | };
|
4218 |
|
4219 | }),
|
4220 |
|
4221 | (function(module, exports, __webpack_require__) {
|
4222 |
|
4223 | 'use strict';
|
4224 |
|
4225 | exports.__esModule = true;
|
4226 | exports.default = toArray;
|
4227 |
|
4228 | var _react = __webpack_require__(4);
|
4229 |
|
4230 | var _react2 = _interopRequireDefault(_react);
|
4231 |
|
4232 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
4233 |
|
4234 | function toArray(children) {
|
4235 | var ret = [];
|
4236 | _react2.default.Children.forEach(children, function (c) {
|
4237 | ret.push(c);
|
4238 | });
|
4239 | return ret;
|
4240 | }
|
4241 |
|
4242 | }),
|
4243 |
|
4244 | (function(module, exports, __webpack_require__) {
|
4245 |
|
4246 | 'use strict';
|
4247 |
|
4248 | exports.__esModule = true;
|
4249 |
|
4250 | var _react = __webpack_require__(4);
|
4251 |
|
4252 | var _react2 = _interopRequireDefault(_react);
|
4253 |
|
4254 | var _propTypes = __webpack_require__(5);
|
4255 |
|
4256 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
4257 |
|
4258 | var _reactDom = __webpack_require__(12);
|
4259 |
|
4260 | var _reactDom2 = _interopRequireDefault(_reactDom);
|
4261 |
|
4262 | var _domAlign = __webpack_require__(51);
|
4263 |
|
4264 | var _domAlign2 = _interopRequireDefault(_domAlign);
|
4265 |
|
4266 | var _addEventListener = __webpack_require__(40);
|
4267 |
|
4268 | var _addEventListener2 = _interopRequireDefault(_addEventListener);
|
4269 |
|
4270 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
4271 |
|
4272 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
4273 |
|
4274 | 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; }
|
4275 |
|
4276 | 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; }
|
4277 |
|
4278 |
|
4279 |
|
4280 | function isWindow(obj) {
|
4281 |
|
4282 |
|
4283 | return obj != null && obj == obj.window;
|
4284 | }
|
4285 |
|
4286 | function buffer(fn, ms) {
|
4287 | var timer = void 0;
|
4288 |
|
4289 | function clear() {
|
4290 | if (timer) {
|
4291 | clearTimeout(timer);
|
4292 | timer = null;
|
4293 | }
|
4294 | }
|
4295 |
|
4296 | function bufferFn() {
|
4297 | clear();
|
4298 | timer = setTimeout(fn, ms);
|
4299 | }
|
4300 |
|
4301 | bufferFn.clear = clear;
|
4302 |
|
4303 | return bufferFn;
|
4304 | }
|
4305 |
|
4306 | var propTypes = {
|
4307 | childrenProps: _propTypes2.default.object,
|
4308 | align: _propTypes2.default.object.isRequired,
|
4309 | target: _propTypes2.default.func,
|
4310 | onAlign: _propTypes2.default.func,
|
4311 | monitorBufferTime: _propTypes2.default.number,
|
4312 | monitorWindowResize: _propTypes2.default.bool,
|
4313 | disabled: _propTypes2.default.bool,
|
4314 | children: _propTypes2.default.any
|
4315 | };
|
4316 |
|
4317 | var defaultProps = {
|
4318 | target: function target() {
|
4319 | return window;
|
4320 | },
|
4321 | onAlign: function onAlign() {},
|
4322 |
|
4323 | monitorBufferTime: 50,
|
4324 | monitorWindowResize: false,
|
4325 | disabled: false
|
4326 | };
|
4327 |
|
4328 | var Align = function (_React$Component) {
|
4329 | _inherits(Align, _React$Component);
|
4330 |
|
4331 | function Align(props) {
|
4332 | _classCallCheck(this, Align);
|
4333 |
|
4334 | var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
|
4335 |
|
4336 | _initialiseProps.call(_this);
|
4337 |
|
4338 | return _this;
|
4339 | }
|
4340 |
|
4341 | Align.prototype.componentDidMount = function componentDidMount() {
|
4342 | var props = this.props;
|
4343 |
|
4344 | this.forceAlign();
|
4345 | if (!props.disabled && props.monitorWindowResize) {
|
4346 | this.startMonitorWindowResize();
|
4347 | }
|
4348 | };
|
4349 |
|
4350 | Align.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {
|
4351 | var reAlign = false;
|
4352 | var props = this.props;
|
4353 |
|
4354 | if (!props.disabled) {
|
4355 | if (prevProps.disabled || prevProps.align !== props.align) {
|
4356 | reAlign = true;
|
4357 | } else {
|
4358 | var lastTarget = prevProps.target();
|
4359 | var currentTarget = props.target();
|
4360 | if (isWindow(lastTarget) && isWindow(currentTarget)) {
|
4361 | reAlign = false;
|
4362 | } else if (lastTarget !== currentTarget) {
|
4363 | reAlign = true;
|
4364 | }
|
4365 | }
|
4366 | }
|
4367 |
|
4368 | if (reAlign) {
|
4369 | this.forceAlign();
|
4370 | }
|
4371 |
|
4372 | if (props.monitorWindowResize && !props.disabled) {
|
4373 | this.startMonitorWindowResize();
|
4374 | } else {
|
4375 | this.stopMonitorWindowResize();
|
4376 | }
|
4377 | };
|
4378 |
|
4379 | Align.prototype.componentWillUnmount = function componentWillUnmount() {
|
4380 | this.stopMonitorWindowResize();
|
4381 | };
|
4382 |
|
4383 | Align.prototype.render = function render() {
|
4384 | var _props = this.props,
|
4385 | childrenProps = _props.childrenProps,
|
4386 | children = _props.children;
|
4387 |
|
4388 | var child = _react2.default.Children.only(children);
|
4389 | if (childrenProps) {
|
4390 | var newProps = {};
|
4391 | for (var prop in childrenProps) {
|
4392 | if (childrenProps.hasOwnProperty(prop)) {
|
4393 | newProps[prop] = this.props[childrenProps[prop]];
|
4394 | }
|
4395 | }
|
4396 | return _react2.default.cloneElement(child, newProps);
|
4397 | }
|
4398 | return child;
|
4399 | };
|
4400 |
|
4401 | return Align;
|
4402 | }(_react2.default.Component);
|
4403 |
|
4404 | var _initialiseProps = function _initialiseProps() {
|
4405 | var _this2 = this;
|
4406 |
|
4407 | this.startMonitorWindowResize = function () {
|
4408 | if (!_this2.resizeHandler) {
|
4409 | _this2.bufferMonitor = buffer(_this2.forceAlign, _this2.props.monitorBufferTime);
|
4410 | _this2.resizeHandler = (0, _addEventListener2.default)(window, 'resize', _this2.bufferMonitor);
|
4411 | }
|
4412 | };
|
4413 |
|
4414 | this.stopMonitorWindowResize = function () {
|
4415 | if (_this2.resizeHandler) {
|
4416 | _this2.bufferMonitor.clear();
|
4417 | _this2.resizeHandler.remove();
|
4418 | _this2.resizeHandler = null;
|
4419 | }
|
4420 | };
|
4421 |
|
4422 | this.forceAlign = function () {
|
4423 | var props = _this2.props;
|
4424 | if (!props.disabled) {
|
4425 | var source = _reactDom2.default.findDOMNode(_this2);
|
4426 | props.onAlign(source, (0, _domAlign2.default)(source, props.target(), props.align));
|
4427 | }
|
4428 | };
|
4429 | };
|
4430 |
|
4431 | ;
|
4432 |
|
4433 | Align.defaultProps = defaultProps;
|
4434 | Align.propTypes = propTypes;
|
4435 |
|
4436 | exports.default = Align;
|
4437 |
|
4438 | }),
|
4439 |
|
4440 | (function(module, exports, __webpack_require__) {
|
4441 |
|
4442 | 'use strict';
|
4443 |
|
4444 | Object.defineProperty(exports, "__esModule", {
|
4445 | value: true
|
4446 | });
|
4447 | exports.alignPoint = exports.alignElement = undefined;
|
4448 |
|
4449 | var _alignElement = __webpack_require__(52);
|
4450 |
|
4451 | var _alignElement2 = _interopRequireDefault(_alignElement);
|
4452 |
|
4453 | var _alignPoint = __webpack_require__(63);
|
4454 |
|
4455 | var _alignPoint2 = _interopRequireDefault(_alignPoint);
|
4456 |
|
4457 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
4458 |
|
4459 | exports.alignElement = _alignElement2['default'];
|
4460 | exports.alignPoint = _alignPoint2['default'];
|
4461 | exports['default'] = _alignElement2['default'];
|
4462 |
|
4463 | }),
|
4464 |
|
4465 | (function(module, exports, __webpack_require__) {
|
4466 |
|
4467 | 'use strict';
|
4468 |
|
4469 | Object.defineProperty(exports, "__esModule", {
|
4470 | value: true
|
4471 | });
|
4472 |
|
4473 | var _align = __webpack_require__(53);
|
4474 |
|
4475 | var _align2 = _interopRequireDefault(_align);
|
4476 |
|
4477 | var _getOffsetParent = __webpack_require__(57);
|
4478 |
|
4479 | var _getOffsetParent2 = _interopRequireDefault(_getOffsetParent);
|
4480 |
|
4481 | var _getVisibleRectForElement = __webpack_require__(56);
|
4482 |
|
4483 | var _getVisibleRectForElement2 = _interopRequireDefault(_getVisibleRectForElement);
|
4484 |
|
4485 | var _getRegion = __webpack_require__(60);
|
4486 |
|
4487 | var _getRegion2 = _interopRequireDefault(_getRegion);
|
4488 |
|
4489 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
4490 |
|
4491 | function isOutOfVisibleRect(target) {
|
4492 | var visibleRect = (0, _getVisibleRectForElement2['default'])(target);
|
4493 | var targetRegion = (0, _getRegion2['default'])(target);
|
4494 |
|
4495 | return !visibleRect || targetRegion.left + targetRegion.width <= visibleRect.left || targetRegion.top + targetRegion.height <= visibleRect.top || targetRegion.left >= visibleRect.right || targetRegion.top >= visibleRect.bottom;
|
4496 | }
|
4497 |
|
4498 | function alignElement(el, refNode, align) {
|
4499 | var target = align.target || refNode;
|
4500 | var refNodeRegion = (0, _getRegion2['default'])(target);
|
4501 |
|
4502 | var isTargetNotOutOfVisible = !isOutOfVisibleRect(target);
|
4503 |
|
4504 | return (0, _align2['default'])(el, refNodeRegion, align, isTargetNotOutOfVisible);
|
4505 | }
|
4506 |
|
4507 | alignElement.__getOffsetParent = _getOffsetParent2['default'];
|
4508 |
|
4509 | alignElement.__getVisibleRectForElement = _getVisibleRectForElement2['default'];
|
4510 |
|
4511 | exports['default'] = alignElement;
|
4512 | module.exports = exports['default'];
|
4513 |
|
4514 | }),
|
4515 |
|
4516 | (function(module, exports, __webpack_require__) {
|
4517 |
|
4518 | 'use strict';
|
4519 |
|
4520 | Object.defineProperty(exports, "__esModule", {
|
4521 | value: true
|
4522 | });
|
4523 |
|
4524 | var _utils = __webpack_require__(54);
|
4525 |
|
4526 | var _utils2 = _interopRequireDefault(_utils);
|
4527 |
|
4528 | var _getVisibleRectForElement = __webpack_require__(56);
|
4529 |
|
4530 | var _getVisibleRectForElement2 = _interopRequireDefault(_getVisibleRectForElement);
|
4531 |
|
4532 | var _adjustForViewport = __webpack_require__(59);
|
4533 |
|
4534 | var _adjustForViewport2 = _interopRequireDefault(_adjustForViewport);
|
4535 |
|
4536 | var _getRegion = __webpack_require__(60);
|
4537 |
|
4538 | var _getRegion2 = _interopRequireDefault(_getRegion);
|
4539 |
|
4540 | var _getElFuturePos = __webpack_require__(61);
|
4541 |
|
4542 | var _getElFuturePos2 = _interopRequireDefault(_getElFuturePos);
|
4543 |
|
4544 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
4545 |
|
4546 |
|
4547 |
|
4548 | function isFailX(elFuturePos, elRegion, visibleRect) {
|
4549 | return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;
|
4550 | } |
4551 |
|
4552 |
|
4553 |
|
4554 |
|
4555 | function isFailY(elFuturePos, elRegion, visibleRect) {
|
4556 | return elFuturePos.top < visibleRect.top || elFuturePos.top + elRegion.height > visibleRect.bottom;
|
4557 | }
|
4558 |
|
4559 | function isCompleteFailX(elFuturePos, elRegion, visibleRect) {
|
4560 | return elFuturePos.left > visibleRect.right || elFuturePos.left + elRegion.width < visibleRect.left;
|
4561 | }
|
4562 |
|
4563 | function isCompleteFailY(elFuturePos, elRegion, visibleRect) {
|
4564 | return elFuturePos.top > visibleRect.bottom || elFuturePos.top + elRegion.height < visibleRect.top;
|
4565 | }
|
4566 |
|
4567 | function flip(points, reg, map) {
|
4568 | var ret = [];
|
4569 | _utils2['default'].each(points, function (p) {
|
4570 | ret.push(p.replace(reg, function (m) {
|
4571 | return map[m];
|
4572 | }));
|
4573 | });
|
4574 | return ret;
|
4575 | }
|
4576 |
|
4577 | function flipOffset(offset, index) {
|
4578 | offset[index] = -offset[index];
|
4579 | return offset;
|
4580 | }
|
4581 |
|
4582 | function convertOffset(str, offsetLen) {
|
4583 | var n = void 0;
|
4584 | if (/%$/.test(str)) {
|
4585 | n = parseInt(str.substring(0, str.length - 1), 10) / 100 * offsetLen;
|
4586 | } else {
|
4587 | n = parseInt(str, 10);
|
4588 | }
|
4589 | return n || 0;
|
4590 | }
|
4591 |
|
4592 | function normalizeOffset(offset, el) {
|
4593 | offset[0] = convertOffset(offset[0], el.width);
|
4594 | offset[1] = convertOffset(offset[1], el.height);
|
4595 | }
|
4596 |
|
4597 | |
4598 |
|
4599 |
|
4600 |
|
4601 |
|
4602 | function doAlign(el, tgtRegion, align, isTgtRegionVisible) {
|
4603 | var points = align.points;
|
4604 | var offset = align.offset || [0, 0];
|
4605 | var targetOffset = align.targetOffset || [0, 0];
|
4606 | var overflow = align.overflow;
|
4607 | var source = align.source || el;
|
4608 | offset = [].concat(offset);
|
4609 | targetOffset = [].concat(targetOffset);
|
4610 | overflow = overflow || {};
|
4611 | var newOverflowCfg = {};
|
4612 | var fail = 0;
|
4613 |
|
4614 | var visibleRect = (0, _getVisibleRectForElement2['default'])(source);
|
4615 |
|
4616 | var elRegion = (0, _getRegion2['default'])(source);
|
4617 |
|
4618 | normalizeOffset(offset, elRegion);
|
4619 | normalizeOffset(targetOffset, tgtRegion);
|
4620 |
|
4621 | var elFuturePos = (0, _getElFuturePos2['default'])(elRegion, tgtRegion, points, offset, targetOffset);
|
4622 |
|
4623 | var newElRegion = _utils2['default'].merge(elRegion, elFuturePos);
|
4624 |
|
4625 |
|
4626 | if (visibleRect && (overflow.adjustX || overflow.adjustY) && isTgtRegionVisible) {
|
4627 | if (overflow.adjustX) {
|
4628 |
|
4629 | if (isFailX(elFuturePos, elRegion, visibleRect)) {
|
4630 |
|
4631 | var newPoints = flip(points, /[lr]/ig, {
|
4632 | l: 'r',
|
4633 | r: 'l'
|
4634 | });
|
4635 |
|
4636 | var newOffset = flipOffset(offset, 0);
|
4637 | var newTargetOffset = flipOffset(targetOffset, 0);
|
4638 | var newElFuturePos = (0, _getElFuturePos2['default'])(elRegion, tgtRegion, newPoints, newOffset, newTargetOffset);
|
4639 |
|
4640 | if (!isCompleteFailX(newElFuturePos, elRegion, visibleRect)) {
|
4641 | fail = 1;
|
4642 | points = newPoints;
|
4643 | offset = newOffset;
|
4644 | targetOffset = newTargetOffset;
|
4645 | }
|
4646 | }
|
4647 | }
|
4648 |
|
4649 | if (overflow.adjustY) {
|
4650 |
|
4651 | if (isFailY(elFuturePos, elRegion, visibleRect)) {
|
4652 |
|
4653 | var _newPoints = flip(points, /[tb]/ig, {
|
4654 | t: 'b',
|
4655 | b: 't'
|
4656 | });
|
4657 |
|
4658 | var _newOffset = flipOffset(offset, 1);
|
4659 | var _newTargetOffset = flipOffset(targetOffset, 1);
|
4660 | var _newElFuturePos = (0, _getElFuturePos2['default'])(elRegion, tgtRegion, _newPoints, _newOffset, _newTargetOffset);
|
4661 |
|
4662 | if (!isCompleteFailY(_newElFuturePos, elRegion, visibleRect)) {
|
4663 | fail = 1;
|
4664 | points = _newPoints;
|
4665 | offset = _newOffset;
|
4666 | targetOffset = _newTargetOffset;
|
4667 | }
|
4668 | }
|
4669 | }
|
4670 |
|
4671 |
|
4672 | if (fail) {
|
4673 | elFuturePos = (0, _getElFuturePos2['default'])(elRegion, tgtRegion, points, offset, targetOffset);
|
4674 | _utils2['default'].mix(newElRegion, elFuturePos);
|
4675 | }
|
4676 | var isStillFailX = isFailX(elFuturePos, elRegion, visibleRect);
|
4677 | var isStillFailY = isFailY(elFuturePos, elRegion, visibleRect);
|
4678 |
|
4679 |
|
4680 | if (isStillFailX || isStillFailY) {
|
4681 | points = align.points;
|
4682 | offset = align.offset || [0, 0];
|
4683 | targetOffset = align.targetOffset || [0, 0];
|
4684 | }
|
4685 |
|
4686 | newOverflowCfg.adjustX = overflow.adjustX && isStillFailX;
|
4687 | newOverflowCfg.adjustY = overflow.adjustY && isStillFailY;
|
4688 |
|
4689 |
|
4690 | if (newOverflowCfg.adjustX || newOverflowCfg.adjustY) {
|
4691 | newElRegion = (0, _adjustForViewport2['default'])(elFuturePos, elRegion, visibleRect, newOverflowCfg);
|
4692 | }
|
4693 | }
|
4694 |
|
4695 |
|
4696 | if (newElRegion.width !== elRegion.width) {
|
4697 | _utils2['default'].css(source, 'width', _utils2['default'].width(source) + newElRegion.width - elRegion.width);
|
4698 | }
|
4699 |
|
4700 | if (newElRegion.height !== elRegion.height) {
|
4701 | _utils2['default'].css(source, 'height', _utils2['default'].height(source) + newElRegion.height - elRegion.height);
|
4702 | }
|
4703 |
|
4704 |
|
4705 |
|
4706 |
|
4707 | _utils2['default'].offset(source, {
|
4708 | left: newElRegion.left,
|
4709 | top: newElRegion.top
|
4710 | }, {
|
4711 | useCssRight: align.useCssRight,
|
4712 | useCssBottom: align.useCssBottom,
|
4713 | useCssTransform: align.useCssTransform,
|
4714 | ignoreShake: align.ignoreShake
|
4715 | });
|
4716 |
|
4717 | return {
|
4718 | points: points,
|
4719 | offset: offset,
|
4720 | targetOffset: targetOffset,
|
4721 | overflow: newOverflowCfg
|
4722 | };
|
4723 | }
|
4724 |
|
4725 | exports['default'] = doAlign;
|
4726 | |
4727 |
|
4728 |
|
4729 |
|
4730 |
|
4731 |
|
4732 |
|
4733 |
|
4734 |
|
4735 | module.exports = exports['default'];
|
4736 |
|
4737 | }),
|
4738 |
|
4739 | (function(module, exports, __webpack_require__) {
|
4740 |
|
4741 | 'use strict';
|
4742 |
|
4743 | Object.defineProperty(exports, "__esModule", {
|
4744 | value: true
|
4745 | });
|
4746 |
|
4747 | 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; };
|
4748 |
|
4749 | var _propertyUtils = __webpack_require__(55);
|
4750 |
|
4751 | var RE_NUM = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source;
|
4752 |
|
4753 | var getComputedStyleX = void 0;
|
4754 |
|
4755 |
|
4756 | function forceRelayout(elem) {
|
4757 | var originalStyle = elem.style.display;
|
4758 | elem.style.display = 'none';
|
4759 | elem.offsetHeight;
|
4760 | elem.style.display = originalStyle;
|
4761 | }
|
4762 |
|
4763 | function css(el, name, v) {
|
4764 | var value = v;
|
4765 | if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {
|
4766 | for (var i in name) {
|
4767 | if (name.hasOwnProperty(i)) {
|
4768 | css(el, i, name[i]);
|
4769 | }
|
4770 | }
|
4771 | return undefined;
|
4772 | }
|
4773 | if (typeof value !== 'undefined') {
|
4774 | if (typeof value === 'number') {
|
4775 | value = value + 'px';
|
4776 | }
|
4777 | el.style[name] = value;
|
4778 | return undefined;
|
4779 | }
|
4780 | return getComputedStyleX(el, name);
|
4781 | }
|
4782 |
|
4783 | function getClientPosition(elem) {
|
4784 | var box = void 0;
|
4785 | var x = void 0;
|
4786 | var y = void 0;
|
4787 | var doc = elem.ownerDocument;
|
4788 | var body = doc.body;
|
4789 | var docElem = doc && doc.documentElement;
|
4790 |
|
4791 | box = elem.getBoundingClientRect();
|
4792 |
|
4793 |
|
4794 |
|
4795 |
|
4796 |
|
4797 | x = box.left;
|
4798 | y = box.top;
|
4799 |
|
4800 |
|
4801 |
|
4802 |
|
4803 |
|
4804 |
|
4805 |
|
4806 |
|
4807 |
|
4808 |
|
4809 |
|
4810 |
|
4811 |
|
4812 |
|
4813 |
|
4814 |
|
4815 |
|
4816 |
|
4817 |
|
4818 |
|
4819 |
|
4820 | x -= docElem.clientLeft || body.clientLeft || 0;
|
4821 | y -= docElem.clientTop || body.clientTop || 0;
|
4822 |
|
4823 | return {
|
4824 | left: x,
|
4825 | top: y
|
4826 | };
|
4827 | }
|
4828 |
|
4829 | function getScroll(w, top) {
|
4830 | var ret = w['page' + (top ? 'Y' : 'X') + 'Offset'];
|
4831 | var method = 'scroll' + (top ? 'Top' : 'Left');
|
4832 | if (typeof ret !== 'number') {
|
4833 | var d = w.document;
|
4834 |
|
4835 | ret = d.documentElement[method];
|
4836 | if (typeof ret !== 'number') {
|
4837 |
|
4838 | ret = d.body[method];
|
4839 | }
|
4840 | }
|
4841 | return ret;
|
4842 | }
|
4843 |
|
4844 | function getScrollLeft(w) {
|
4845 | return getScroll(w);
|
4846 | }
|
4847 |
|
4848 | function getScrollTop(w) {
|
4849 | return getScroll(w, true);
|
4850 | }
|
4851 |
|
4852 | function getOffset(el) {
|
4853 | var pos = getClientPosition(el);
|
4854 | var doc = el.ownerDocument;
|
4855 | var w = doc.defaultView || doc.parentWindow;
|
4856 | pos.left += getScrollLeft(w);
|
4857 | pos.top += getScrollTop(w);
|
4858 | return pos;
|
4859 | }
|
4860 |
|
4861 | |
4862 |
|
4863 |
|
4864 |
|
4865 | function isWindow(obj) {
|
4866 |
|
4867 |
|
4868 | return obj !== null && obj !== undefined && obj == obj.window;
|
4869 | }
|
4870 |
|
4871 | function getDocument(node) {
|
4872 | if (isWindow(node)) {
|
4873 | return node.document;
|
4874 | }
|
4875 | if (node.nodeType === 9) {
|
4876 | return node;
|
4877 | }
|
4878 | return node.ownerDocument;
|
4879 | }
|
4880 |
|
4881 | function _getComputedStyle(elem, name, cs) {
|
4882 | var computedStyle = cs;
|
4883 | var val = '';
|
4884 | var d = getDocument(elem);
|
4885 | computedStyle = computedStyle || d.defaultView.getComputedStyle(elem, null);
|
4886 |
|
4887 |
|
4888 | if (computedStyle) {
|
4889 | val = computedStyle.getPropertyValue(name) || computedStyle[name];
|
4890 | }
|
4891 |
|
4892 | return val;
|
4893 | }
|
4894 |
|
4895 | var _RE_NUM_NO_PX = new RegExp('^(' + RE_NUM + ')(?!px)[a-z%]+$', 'i');
|
4896 | var RE_POS = /^(top|right|bottom|left)$/;
|
4897 | var CURRENT_STYLE = 'currentStyle';
|
4898 | var RUNTIME_STYLE = 'runtimeStyle';
|
4899 | var LEFT = 'left';
|
4900 | var PX = 'px';
|
4901 |
|
4902 | function _getComputedStyleIE(elem, name) {
|
4903 |
|
4904 |
|
4905 | var ret = elem[CURRENT_STYLE] && elem[CURRENT_STYLE][name];
|
4906 |
|
4907 |
|
4908 |
|
4909 |
|
4910 |
|
4911 |
|
4912 |
|
4913 |
|
4914 |
|
4915 |
|
4916 |
|
4917 | if (_RE_NUM_NO_PX.test(ret) && !RE_POS.test(name)) {
|
4918 |
|
4919 | var style = elem.style;
|
4920 | var left = style[LEFT];
|
4921 | var rsLeft = elem[RUNTIME_STYLE][LEFT];
|
4922 |
|
4923 |
|
4924 | elem[RUNTIME_STYLE][LEFT] = elem[CURRENT_STYLE][LEFT];
|
4925 |
|
4926 |
|
4927 | style[LEFT] = name === 'fontSize' ? '1em' : ret || 0;
|
4928 | ret = style.pixelLeft + PX;
|
4929 |
|
4930 |
|
4931 | style[LEFT] = left;
|
4932 |
|
4933 | elem[RUNTIME_STYLE][LEFT] = rsLeft;
|
4934 | }
|
4935 | return ret === '' ? 'auto' : ret;
|
4936 | }
|
4937 |
|
4938 | if (typeof window !== 'undefined') {
|
4939 | getComputedStyleX = window.getComputedStyle ? _getComputedStyle : _getComputedStyleIE;
|
4940 | }
|
4941 |
|
4942 | function getOffsetDirection(dir, option) {
|
4943 | if (dir === 'left') {
|
4944 | return option.useCssRight ? 'right' : dir;
|
4945 | }
|
4946 | return option.useCssBottom ? 'bottom' : dir;
|
4947 | }
|
4948 |
|
4949 | function oppositeOffsetDirection(dir) {
|
4950 | if (dir === 'left') {
|
4951 | return 'right';
|
4952 | } else if (dir === 'right') {
|
4953 | return 'left';
|
4954 | } else if (dir === 'top') {
|
4955 | return 'bottom';
|
4956 | } else if (dir === 'bottom') {
|
4957 | return 'top';
|
4958 | }
|
4959 | }
|
4960 |
|
4961 |
|
4962 | function setLeftTop(elem, offset, option) {
|
4963 |
|
4964 | if (css(elem, 'position') === 'static') {
|
4965 | elem.style.position = 'relative';
|
4966 | }
|
4967 | var presetH = -999;
|
4968 | var presetV = -999;
|
4969 | var horizontalProperty = getOffsetDirection('left', option);
|
4970 | var verticalProperty = getOffsetDirection('top', option);
|
4971 | var oppositeHorizontalProperty = oppositeOffsetDirection(horizontalProperty);
|
4972 | var oppositeVerticalProperty = oppositeOffsetDirection(verticalProperty);
|
4973 |
|
4974 | if (horizontalProperty !== 'left') {
|
4975 | presetH = 999;
|
4976 | }
|
4977 |
|
4978 | if (verticalProperty !== 'top') {
|
4979 | presetV = 999;
|
4980 | }
|
4981 | var originalTransition = '';
|
4982 | var originalOffset = getOffset(elem);
|
4983 | if ('left' in offset || 'top' in offset) {
|
4984 | originalTransition = (0, _propertyUtils.getTransitionProperty)(elem) || '';
|
4985 | (0, _propertyUtils.setTransitionProperty)(elem, 'none');
|
4986 | }
|
4987 | if ('left' in offset) {
|
4988 | elem.style[oppositeHorizontalProperty] = '';
|
4989 | elem.style[horizontalProperty] = presetH + 'px';
|
4990 | }
|
4991 | if ('top' in offset) {
|
4992 | elem.style[oppositeVerticalProperty] = '';
|
4993 | elem.style[verticalProperty] = presetV + 'px';
|
4994 | }
|
4995 |
|
4996 | forceRelayout(elem);
|
4997 | var old = getOffset(elem);
|
4998 | var originalStyle = {};
|
4999 | for (var key in offset) {
|
5000 | if (offset.hasOwnProperty(key)) {
|
5001 | var dir = getOffsetDirection(key, option);
|
5002 | var preset = key === 'left' ? presetH : presetV;
|
5003 | var off = originalOffset[key] - old[key];
|
5004 | if (dir === key) {
|
5005 | originalStyle[dir] = preset + off;
|
5006 | } else {
|
5007 | originalStyle[dir] = preset - off;
|
5008 | }
|
5009 | }
|
5010 | }
|
5011 | css(elem, originalStyle);
|
5012 |
|
5013 | forceRelayout(elem);
|
5014 | if ('left' in offset || 'top' in offset) {
|
5015 | (0, _propertyUtils.setTransitionProperty)(elem, originalTransition);
|
5016 | }
|
5017 | var ret = {};
|
5018 | for (var _key in offset) {
|
5019 | if (offset.hasOwnProperty(_key)) {
|
5020 | var _dir = getOffsetDirection(_key, option);
|
5021 | var _off = offset[_key] - originalOffset[_key];
|
5022 | if (_key === _dir) {
|
5023 | ret[_dir] = originalStyle[_dir] + _off;
|
5024 | } else {
|
5025 | ret[_dir] = originalStyle[_dir] - _off;
|
5026 | }
|
5027 | }
|
5028 | }
|
5029 | css(elem, ret);
|
5030 | }
|
5031 |
|
5032 | function setTransform(elem, offset) {
|
5033 | var originalOffset = getOffset(elem);
|
5034 | var originalXY = (0, _propertyUtils.getTransformXY)(elem);
|
5035 | var resultXY = { x: originalXY.x, y: originalXY.y };
|
5036 | if ('left' in offset) {
|
5037 | resultXY.x = originalXY.x + offset.left - originalOffset.left;
|
5038 | }
|
5039 | if ('top' in offset) {
|
5040 | resultXY.y = originalXY.y + offset.top - originalOffset.top;
|
5041 | }
|
5042 | (0, _propertyUtils.setTransformXY)(elem, resultXY);
|
5043 | }
|
5044 |
|
5045 | function setOffset(elem, offset, option) {
|
5046 | if (option.ignoreShake) {
|
5047 | var oriOffset = getOffset(elem);
|
5048 |
|
5049 | var oLeft = oriOffset.left.toFixed(0);
|
5050 | var oTop = oriOffset.top.toFixed(0);
|
5051 | var tLeft = offset.left.toFixed(0);
|
5052 | var tTop = offset.top.toFixed(0);
|
5053 |
|
5054 | if (oLeft === tLeft && oTop === tTop) {
|
5055 | return;
|
5056 | }
|
5057 | }
|
5058 |
|
5059 | if (option.useCssRight || option.useCssBottom) {
|
5060 | setLeftTop(elem, offset, option);
|
5061 | } else if (option.useCssTransform && (0, _propertyUtils.getTransformName)() in document.body.style) {
|
5062 | setTransform(elem, offset, option);
|
5063 | } else {
|
5064 | setLeftTop(elem, offset, option);
|
5065 | }
|
5066 | }
|
5067 |
|
5068 | function each(arr, fn) {
|
5069 | for (var i = 0; i < arr.length; i++) {
|
5070 | fn(arr[i]);
|
5071 | }
|
5072 | }
|
5073 |
|
5074 | function isBorderBoxFn(elem) {
|
5075 | return getComputedStyleX(elem, 'boxSizing') === 'border-box';
|
5076 | }
|
5077 |
|
5078 | var BOX_MODELS = ['margin', 'border', 'padding'];
|
5079 | var CONTENT_INDEX = -1;
|
5080 | var PADDING_INDEX = 2;
|
5081 | var BORDER_INDEX = 1;
|
5082 | var MARGIN_INDEX = 0;
|
5083 |
|
5084 | function swap(elem, options, callback) {
|
5085 | var old = {};
|
5086 | var style = elem.style;
|
5087 | var name = void 0;
|
5088 |
|
5089 |
|
5090 | for (name in options) {
|
5091 | if (options.hasOwnProperty(name)) {
|
5092 | old[name] = style[name];
|
5093 | style[name] = options[name];
|
5094 | }
|
5095 | }
|
5096 |
|
5097 | callback.call(elem);
|
5098 |
|
5099 |
|
5100 | for (name in options) {
|
5101 | if (options.hasOwnProperty(name)) {
|
5102 | style[name] = old[name];
|
5103 | }
|
5104 | }
|
5105 | }
|
5106 |
|
5107 | function getPBMWidth(elem, props, which) {
|
5108 | var value = 0;
|
5109 | var prop = void 0;
|
5110 | var j = void 0;
|
5111 | var i = void 0;
|
5112 | for (j = 0; j < props.length; j++) {
|
5113 | prop = props[j];
|
5114 | if (prop) {
|
5115 | for (i = 0; i < which.length; i++) {
|
5116 | var cssProp = void 0;
|
5117 | if (prop === 'border') {
|
5118 | cssProp = '' + prop + which[i] + 'Width';
|
5119 | } else {
|
5120 | cssProp = prop + which[i];
|
5121 | }
|
5122 | value += parseFloat(getComputedStyleX(elem, cssProp)) || 0;
|
5123 | }
|
5124 | }
|
5125 | }
|
5126 | return value;
|
5127 | }
|
5128 |
|
5129 | var domUtils = {};
|
5130 |
|
5131 | each(['Width', 'Height'], function (name) {
|
5132 | domUtils['doc' + name] = function (refWin) {
|
5133 | var d = refWin.document;
|
5134 | return Math.max(
|
5135 |
|
5136 |
|
5137 | d.documentElement['scroll' + name],
|
5138 |
|
5139 | d.body['scroll' + name], domUtils['viewport' + name](d));
|
5140 | };
|
5141 |
|
5142 | domUtils['viewport' + name] = function (win) {
|
5143 |
|
5144 | var prop = 'client' + name;
|
5145 | var doc = win.document;
|
5146 | var body = doc.body;
|
5147 | var documentElement = doc.documentElement;
|
5148 | var documentElementProp = documentElement[prop];
|
5149 |
|
5150 |
|
5151 | return doc.compatMode === 'CSS1Compat' && documentElementProp || body && body[prop] || documentElementProp;
|
5152 | };
|
5153 | });
|
5154 |
|
5155 | |
5156 |
|
5157 |
|
5158 |
|
5159 |
|
5160 |
|
5161 |
|
5162 |
|
5163 | function getWH(elem, name, ex) {
|
5164 | var extra = ex;
|
5165 | if (isWindow(elem)) {
|
5166 | return name === 'width' ? domUtils.viewportWidth(elem) : domUtils.viewportHeight(elem);
|
5167 | } else if (elem.nodeType === 9) {
|
5168 | return name === 'width' ? domUtils.docWidth(elem) : domUtils.docHeight(elem);
|
5169 | }
|
5170 | var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];
|
5171 | var borderBoxValue = name === 'width' ? elem.getBoundingClientRect().width : elem.getBoundingClientRect().height;
|
5172 | var computedStyle = getComputedStyleX(elem);
|
5173 | var isBorderBox = isBorderBoxFn(elem, computedStyle);
|
5174 | var cssBoxValue = 0;
|
5175 | if (borderBoxValue === null || borderBoxValue === undefined || borderBoxValue <= 0) {
|
5176 | borderBoxValue = undefined;
|
5177 |
|
5178 | cssBoxValue = getComputedStyleX(elem, name);
|
5179 | if (cssBoxValue === null || cssBoxValue === undefined || Number(cssBoxValue) < 0) {
|
5180 | cssBoxValue = elem.style[name] || 0;
|
5181 | }
|
5182 |
|
5183 | cssBoxValue = parseFloat(cssBoxValue) || 0;
|
5184 | }
|
5185 | if (extra === undefined) {
|
5186 | extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX;
|
5187 | }
|
5188 | var borderBoxValueOrIsBorderBox = borderBoxValue !== undefined || isBorderBox;
|
5189 | var val = borderBoxValue || cssBoxValue;
|
5190 | if (extra === CONTENT_INDEX) {
|
5191 | if (borderBoxValueOrIsBorderBox) {
|
5192 | return val - getPBMWidth(elem, ['border', 'padding'], which, computedStyle);
|
5193 | }
|
5194 | return cssBoxValue;
|
5195 | } else if (borderBoxValueOrIsBorderBox) {
|
5196 | if (extra === BORDER_INDEX) {
|
5197 | return val;
|
5198 | }
|
5199 | return val + (extra === PADDING_INDEX ? -getPBMWidth(elem, ['border'], which, computedStyle) : getPBMWidth(elem, ['margin'], which, computedStyle));
|
5200 | }
|
5201 | return cssBoxValue + getPBMWidth(elem, BOX_MODELS.slice(extra), which, computedStyle);
|
5202 | }
|
5203 |
|
5204 | var cssShow = {
|
5205 | position: 'absolute',
|
5206 | visibility: 'hidden',
|
5207 | display: 'block'
|
5208 | };
|
5209 |
|
5210 |
|
5211 | function getWHIgnoreDisplay() {
|
5212 | for (var _len = arguments.length, args = Array(_len), _key2 = 0; _key2 < _len; _key2++) {
|
5213 | args[_key2] = arguments[_key2];
|
5214 | }
|
5215 |
|
5216 | var val = void 0;
|
5217 | var elem = args[0];
|
5218 |
|
5219 |
|
5220 | if (elem.offsetWidth !== 0) {
|
5221 | val = getWH.apply(undefined, args);
|
5222 | } else {
|
5223 | swap(elem, cssShow, function () {
|
5224 | val = getWH.apply(undefined, args);
|
5225 | });
|
5226 | }
|
5227 | return val;
|
5228 | }
|
5229 |
|
5230 | each(['width', 'height'], function (name) {
|
5231 | var first = name.charAt(0).toUpperCase() + name.slice(1);
|
5232 | domUtils['outer' + first] = function (el, includeMargin) {
|
5233 | return el && getWHIgnoreDisplay(el, name, includeMargin ? MARGIN_INDEX : BORDER_INDEX);
|
5234 | };
|
5235 | var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];
|
5236 |
|
5237 | domUtils[name] = function (elem, v) {
|
5238 | var val = v;
|
5239 | if (val !== undefined) {
|
5240 | if (elem) {
|
5241 | var computedStyle = getComputedStyleX(elem);
|
5242 | var isBorderBox = isBorderBoxFn(elem);
|
5243 | if (isBorderBox) {
|
5244 | val += getPBMWidth(elem, ['padding', 'border'], which, computedStyle);
|
5245 | }
|
5246 | return css(elem, name, val);
|
5247 | }
|
5248 | return undefined;
|
5249 | }
|
5250 | return elem && getWHIgnoreDisplay(elem, name, CONTENT_INDEX);
|
5251 | };
|
5252 | });
|
5253 |
|
5254 | function mix(to, from) {
|
5255 | for (var i in from) {
|
5256 | if (from.hasOwnProperty(i)) {
|
5257 | to[i] = from[i];
|
5258 | }
|
5259 | }
|
5260 | return to;
|
5261 | }
|
5262 |
|
5263 | var utils = {
|
5264 | getWindow: function getWindow(node) {
|
5265 | if (node && node.document && node.setTimeout) {
|
5266 | return node;
|
5267 | }
|
5268 | var doc = node.ownerDocument || node;
|
5269 | return doc.defaultView || doc.parentWindow;
|
5270 | },
|
5271 |
|
5272 | getDocument: getDocument,
|
5273 | offset: function offset(el, value, option) {
|
5274 | if (typeof value !== 'undefined') {
|
5275 | setOffset(el, value, option || {});
|
5276 | } else {
|
5277 | return getOffset(el);
|
5278 | }
|
5279 | },
|
5280 |
|
5281 | isWindow: isWindow,
|
5282 | each: each,
|
5283 | css: css,
|
5284 | clone: function clone(obj) {
|
5285 | var i = void 0;
|
5286 | var ret = {};
|
5287 | for (i in obj) {
|
5288 | if (obj.hasOwnProperty(i)) {
|
5289 | ret[i] = obj[i];
|
5290 | }
|
5291 | }
|
5292 | var overflow = obj.overflow;
|
5293 | if (overflow) {
|
5294 | for (i in obj) {
|
5295 | if (obj.hasOwnProperty(i)) {
|
5296 | ret.overflow[i] = obj.overflow[i];
|
5297 | }
|
5298 | }
|
5299 | }
|
5300 | return ret;
|
5301 | },
|
5302 |
|
5303 | mix: mix,
|
5304 | getWindowScrollLeft: function getWindowScrollLeft(w) {
|
5305 | return getScrollLeft(w);
|
5306 | },
|
5307 | getWindowScrollTop: function getWindowScrollTop(w) {
|
5308 | return getScrollTop(w);
|
5309 | },
|
5310 | merge: function merge() {
|
5311 | var ret = {};
|
5312 |
|
5313 | for (var _len2 = arguments.length, args = Array(_len2), _key3 = 0; _key3 < _len2; _key3++) {
|
5314 | args[_key3] = arguments[_key3];
|
5315 | }
|
5316 |
|
5317 | for (var i = 0; i < args.length; i++) {
|
5318 | utils.mix(ret, args[i]);
|
5319 | }
|
5320 | return ret;
|
5321 | },
|
5322 |
|
5323 | viewportWidth: 0,
|
5324 | viewportHeight: 0
|
5325 | };
|
5326 |
|
5327 | mix(utils, domUtils);
|
5328 |
|
5329 | exports['default'] = utils;
|
5330 | module.exports = exports['default'];
|
5331 |
|
5332 | }),
|
5333 |
|
5334 | (function(module, exports) {
|
5335 |
|
5336 | 'use strict';
|
5337 |
|
5338 | Object.defineProperty(exports, "__esModule", {
|
5339 | value: true
|
5340 | });
|
5341 | exports.getTransformName = getTransformName;
|
5342 | exports.setTransitionProperty = setTransitionProperty;
|
5343 | exports.getTransitionProperty = getTransitionProperty;
|
5344 | exports.getTransformXY = getTransformXY;
|
5345 | exports.setTransformXY = setTransformXY;
|
5346 | var vendorPrefix = void 0;
|
5347 |
|
5348 | var jsCssMap = {
|
5349 | Webkit: '-webkit-',
|
5350 | Moz: '-moz-',
|
5351 |
|
5352 | ms: '-ms-',
|
5353 | O: '-o-'
|
5354 | };
|
5355 |
|
5356 | function getVendorPrefix() {
|
5357 | if (vendorPrefix !== undefined) {
|
5358 | return vendorPrefix;
|
5359 | }
|
5360 | vendorPrefix = '';
|
5361 | var style = document.createElement('p').style;
|
5362 | var testProp = 'Transform';
|
5363 | for (var key in jsCssMap) {
|
5364 | if (key + testProp in style) {
|
5365 | vendorPrefix = key;
|
5366 | }
|
5367 | }
|
5368 | return vendorPrefix;
|
5369 | }
|
5370 |
|
5371 | function getTransitionName() {
|
5372 | return getVendorPrefix() ? getVendorPrefix() + 'TransitionProperty' : 'transitionProperty';
|
5373 | }
|
5374 |
|
5375 | function getTransformName() {
|
5376 | return getVendorPrefix() ? getVendorPrefix() + 'Transform' : 'transform';
|
5377 | }
|
5378 |
|
5379 | function setTransitionProperty(node, value) {
|
5380 | var name = getTransitionName();
|
5381 | if (name) {
|
5382 | node.style[name] = value;
|
5383 | if (name !== 'transitionProperty') {
|
5384 | node.style.transitionProperty = value;
|
5385 | }
|
5386 | }
|
5387 | }
|
5388 |
|
5389 | function setTransform(node, value) {
|
5390 | var name = getTransformName();
|
5391 | if (name) {
|
5392 | node.style[name] = value;
|
5393 | if (name !== 'transform') {
|
5394 | node.style.transform = value;
|
5395 | }
|
5396 | }
|
5397 | }
|
5398 |
|
5399 | function getTransitionProperty(node) {
|
5400 | return node.style.transitionProperty || node.style[getTransitionName()];
|
5401 | }
|
5402 |
|
5403 | function getTransformXY(node) {
|
5404 | var style = window.getComputedStyle(node, null);
|
5405 | var transform = style.getPropertyValue('transform') || style.getPropertyValue(getTransformName());
|
5406 | if (transform && transform !== 'none') {
|
5407 | var matrix = transform.replace(/[^0-9\-.,]/g, '').split(',');
|
5408 | return { x: parseFloat(matrix[12] || matrix[4], 0), y: parseFloat(matrix[13] || matrix[5], 0) };
|
5409 | }
|
5410 | return {
|
5411 | x: 0,
|
5412 | y: 0
|
5413 | };
|
5414 | }
|
5415 |
|
5416 | var matrix2d = /matrix\((.*)\)/;
|
5417 | var matrix3d = /matrix3d\((.*)\)/;
|
5418 |
|
5419 | function setTransformXY(node, xy) {
|
5420 | var style = window.getComputedStyle(node, null);
|
5421 | var transform = style.getPropertyValue('transform') || style.getPropertyValue(getTransformName());
|
5422 | if (transform && transform !== 'none') {
|
5423 | var arr = void 0;
|
5424 | var match2d = transform.match(matrix2d);
|
5425 | if (match2d) {
|
5426 | match2d = match2d[1];
|
5427 | arr = match2d.split(',').map(function (item) {
|
5428 | return parseFloat(item, 10);
|
5429 | });
|
5430 | arr[4] = xy.x;
|
5431 | arr[5] = xy.y;
|
5432 | setTransform(node, 'matrix(' + arr.join(',') + ')');
|
5433 | } else {
|
5434 | var match3d = transform.match(matrix3d)[1];
|
5435 | arr = match3d.split(',').map(function (item) {
|
5436 | return parseFloat(item, 10);
|
5437 | });
|
5438 | arr[12] = xy.x;
|
5439 | arr[13] = xy.y;
|
5440 | setTransform(node, 'matrix3d(' + arr.join(',') + ')');
|
5441 | }
|
5442 | } else {
|
5443 | setTransform(node, 'translateX(' + xy.x + 'px) translateY(' + xy.y + 'px) translateZ(0)');
|
5444 | }
|
5445 | }
|
5446 |
|
5447 | }),
|
5448 |
|
5449 | (function(module, exports, __webpack_require__) {
|
5450 |
|
5451 | 'use strict';
|
5452 |
|
5453 | Object.defineProperty(exports, "__esModule", {
|
5454 | value: true
|
5455 | });
|
5456 |
|
5457 | var _utils = __webpack_require__(54);
|
5458 |
|
5459 | var _utils2 = _interopRequireDefault(_utils);
|
5460 |
|
5461 | var _getOffsetParent = __webpack_require__(57);
|
5462 |
|
5463 | var _getOffsetParent2 = _interopRequireDefault(_getOffsetParent);
|
5464 |
|
5465 | var _isAncestorFixed = __webpack_require__(58);
|
5466 |
|
5467 | var _isAncestorFixed2 = _interopRequireDefault(_isAncestorFixed);
|
5468 |
|
5469 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
5470 |
|
5471 | |
5472 |
|
5473 |
|
5474 | function getVisibleRectForElement(element) {
|
5475 | var visibleRect = {
|
5476 | left: 0,
|
5477 | right: Infinity,
|
5478 | top: 0,
|
5479 | bottom: Infinity
|
5480 | };
|
5481 | var el = (0, _getOffsetParent2['default'])(element);
|
5482 | var doc = _utils2['default'].getDocument(element);
|
5483 | var win = doc.defaultView || doc.parentWindow;
|
5484 | var body = doc.body;
|
5485 | var documentElement = doc.documentElement;
|
5486 |
|
5487 |
|
5488 |
|
5489 | while (el) {
|
5490 |
|
5491 | if ((navigator.userAgent.indexOf('MSIE') === -1 || el.clientWidth !== 0) &&
|
5492 |
|
5493 |
|
5494 |
|
5495 | el !== body && el !== documentElement && _utils2['default'].css(el, 'overflow') !== 'visible') {
|
5496 | var pos = _utils2['default'].offset(el);
|
5497 |
|
5498 | pos.left += el.clientLeft;
|
5499 | pos.top += el.clientTop;
|
5500 | visibleRect.top = Math.max(visibleRect.top, pos.top);
|
5501 | visibleRect.right = Math.min(visibleRect.right,
|
5502 |
|
5503 | pos.left + el.clientWidth);
|
5504 | visibleRect.bottom = Math.min(visibleRect.bottom, pos.top + el.clientHeight);
|
5505 | visibleRect.left = Math.max(visibleRect.left, pos.left);
|
5506 | } else if (el === body || el === documentElement) {
|
5507 | break;
|
5508 | }
|
5509 | el = (0, _getOffsetParent2['default'])(el);
|
5510 | }
|
5511 |
|
5512 |
|
5513 |
|
5514 |
|
5515 | var originalPosition = null;
|
5516 | if (!_utils2['default'].isWindow(element) && element.nodeType !== 9) {
|
5517 | originalPosition = element.style.position;
|
5518 | var position = _utils2['default'].css(element, 'position');
|
5519 | if (position === 'absolute') {
|
5520 | element.style.position = 'fixed';
|
5521 | }
|
5522 | }
|
5523 |
|
5524 | var scrollX = _utils2['default'].getWindowScrollLeft(win);
|
5525 | var scrollY = _utils2['default'].getWindowScrollTop(win);
|
5526 | var viewportWidth = _utils2['default'].viewportWidth(win);
|
5527 | var viewportHeight = _utils2['default'].viewportHeight(win);
|
5528 | var documentWidth = documentElement.scrollWidth;
|
5529 | var documentHeight = documentElement.scrollHeight;
|
5530 |
|
5531 |
|
5532 | if (element.style) {
|
5533 | element.style.position = originalPosition;
|
5534 | }
|
5535 |
|
5536 | if ((0, _isAncestorFixed2['default'])(element)) {
|
5537 |
|
5538 | visibleRect.left = Math.max(visibleRect.left, scrollX);
|
5539 | visibleRect.top = Math.max(visibleRect.top, scrollY);
|
5540 | visibleRect.right = Math.min(visibleRect.right, scrollX + viewportWidth);
|
5541 | visibleRect.bottom = Math.min(visibleRect.bottom, scrollY + viewportHeight);
|
5542 | } else {
|
5543 |
|
5544 | var maxVisibleWidth = Math.max(documentWidth, scrollX + viewportWidth);
|
5545 | visibleRect.right = Math.min(visibleRect.right, maxVisibleWidth);
|
5546 |
|
5547 | var maxVisibleHeight = Math.max(documentHeight, scrollY + viewportHeight);
|
5548 | visibleRect.bottom = Math.min(visibleRect.bottom, maxVisibleHeight);
|
5549 | }
|
5550 |
|
5551 | return visibleRect.top >= 0 && visibleRect.left >= 0 && visibleRect.bottom > visibleRect.top && visibleRect.right > visibleRect.left ? visibleRect : null;
|
5552 | }
|
5553 |
|
5554 | exports['default'] = getVisibleRectForElement;
|
5555 | module.exports = exports['default'];
|
5556 |
|
5557 | }),
|
5558 |
|
5559 | (function(module, exports, __webpack_require__) {
|
5560 |
|
5561 | 'use strict';
|
5562 |
|
5563 | Object.defineProperty(exports, "__esModule", {
|
5564 | value: true
|
5565 | });
|
5566 |
|
5567 | var _utils = __webpack_require__(54);
|
5568 |
|
5569 | var _utils2 = _interopRequireDefault(_utils);
|
5570 |
|
5571 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
5572 |
|
5573 | |
5574 |
|
5575 |
|
5576 |
|
5577 | function getOffsetParent(element) {
|
5578 | if (_utils2['default'].isWindow(element) || element.nodeType === 9) {
|
5579 | return null;
|
5580 | }
|
5581 |
|
5582 | |
5583 |
|
5584 |
|
5585 |
|
5586 |
|
5587 |
|
5588 |
|
5589 |
|
5590 |
|
5591 |
|
5592 |
|
5593 |
|
5594 |
|
5595 |
|
5596 | var doc = _utils2['default'].getDocument(element);
|
5597 | var body = doc.body;
|
5598 | var parent = void 0;
|
5599 | var positionStyle = _utils2['default'].css(element, 'position');
|
5600 | var skipStatic = positionStyle === 'fixed' || positionStyle === 'absolute';
|
5601 |
|
5602 | if (!skipStatic) {
|
5603 | return element.nodeName.toLowerCase() === 'html' ? null : element.parentNode;
|
5604 | }
|
5605 |
|
5606 | for (parent = element.parentNode; parent && parent !== body; parent = parent.parentNode) {
|
5607 | positionStyle = _utils2['default'].css(parent, 'position');
|
5608 | if (positionStyle !== 'static') {
|
5609 | return parent;
|
5610 | }
|
5611 | }
|
5612 | return null;
|
5613 | }
|
5614 |
|
5615 | exports['default'] = getOffsetParent;
|
5616 | module.exports = exports['default'];
|
5617 |
|
5618 | }),
|
5619 |
|
5620 | (function(module, exports, __webpack_require__) {
|
5621 |
|
5622 | 'use strict';
|
5623 |
|
5624 | Object.defineProperty(exports, "__esModule", {
|
5625 | value: true
|
5626 | });
|
5627 | exports['default'] = isAncestorFixed;
|
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 | function isAncestorFixed(element) {
|
5636 | if (_utils2['default'].isWindow(element) || element.nodeType === 9) {
|
5637 | return false;
|
5638 | }
|
5639 |
|
5640 | var doc = _utils2['default'].getDocument(element);
|
5641 | var body = doc.body;
|
5642 | var parent = null;
|
5643 | for (parent = element.parentNode; parent && parent !== body; parent = parent.parentNode) {
|
5644 | var positionStyle = _utils2['default'].css(parent, 'position');
|
5645 | if (positionStyle === 'fixed') {
|
5646 | return true;
|
5647 | }
|
5648 | }
|
5649 | return false;
|
5650 | }
|
5651 | module.exports = exports['default'];
|
5652 |
|
5653 | }),
|
5654 |
|
5655 | (function(module, exports, __webpack_require__) {
|
5656 |
|
5657 | 'use strict';
|
5658 |
|
5659 | Object.defineProperty(exports, "__esModule", {
|
5660 | value: true
|
5661 | });
|
5662 |
|
5663 | var _utils = __webpack_require__(54);
|
5664 |
|
5665 | var _utils2 = _interopRequireDefault(_utils);
|
5666 |
|
5667 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
5668 |
|
5669 | function adjustForViewport(elFuturePos, elRegion, visibleRect, overflow) {
|
5670 | var pos = _utils2['default'].clone(elFuturePos);
|
5671 | var size = {
|
5672 | width: elRegion.width,
|
5673 | height: elRegion.height
|
5674 | };
|
5675 |
|
5676 | if (overflow.adjustX && pos.left < visibleRect.left) {
|
5677 | pos.left = visibleRect.left;
|
5678 | }
|
5679 |
|
5680 |
|
5681 | if (overflow.resizeWidth && pos.left >= visibleRect.left && pos.left + size.width > visibleRect.right) {
|
5682 | size.width -= pos.left + size.width - visibleRect.right;
|
5683 | }
|
5684 |
|
5685 |
|
5686 | if (overflow.adjustX && pos.left + size.width > visibleRect.right) {
|
5687 |
|
5688 | pos.left = Math.max(visibleRect.right - size.width, visibleRect.left);
|
5689 | }
|
5690 |
|
5691 |
|
5692 | if (overflow.adjustY && pos.top < visibleRect.top) {
|
5693 | pos.top = visibleRect.top;
|
5694 | }
|
5695 |
|
5696 |
|
5697 | if (overflow.resizeHeight && pos.top >= visibleRect.top && pos.top + size.height > visibleRect.bottom) {
|
5698 | size.height -= pos.top + size.height - visibleRect.bottom;
|
5699 | }
|
5700 |
|
5701 |
|
5702 | if (overflow.adjustY && pos.top + size.height > visibleRect.bottom) {
|
5703 |
|
5704 | pos.top = Math.max(visibleRect.bottom - size.height, visibleRect.top);
|
5705 | }
|
5706 |
|
5707 | return _utils2['default'].mix(pos, size);
|
5708 | }
|
5709 |
|
5710 | exports['default'] = adjustForViewport;
|
5711 | module.exports = exports['default'];
|
5712 |
|
5713 | }),
|
5714 |
|
5715 | (function(module, exports, __webpack_require__) {
|
5716 |
|
5717 | 'use strict';
|
5718 |
|
5719 | Object.defineProperty(exports, "__esModule", {
|
5720 | value: true
|
5721 | });
|
5722 |
|
5723 | var _utils = __webpack_require__(54);
|
5724 |
|
5725 | var _utils2 = _interopRequireDefault(_utils);
|
5726 |
|
5727 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
5728 |
|
5729 | function getRegion(node) {
|
5730 | var offset = void 0;
|
5731 | var w = void 0;
|
5732 | var h = void 0;
|
5733 | if (!_utils2['default'].isWindow(node) && node.nodeType !== 9) {
|
5734 | offset = _utils2['default'].offset(node);
|
5735 | w = _utils2['default'].outerWidth(node);
|
5736 | h = _utils2['default'].outerHeight(node);
|
5737 | } else {
|
5738 | var win = _utils2['default'].getWindow(node);
|
5739 | offset = {
|
5740 | left: _utils2['default'].getWindowScrollLeft(win),
|
5741 | top: _utils2['default'].getWindowScrollTop(win)
|
5742 | };
|
5743 | w = _utils2['default'].viewportWidth(win);
|
5744 | h = _utils2['default'].viewportHeight(win);
|
5745 | }
|
5746 | offset.width = w;
|
5747 | offset.height = h;
|
5748 | return offset;
|
5749 | }
|
5750 |
|
5751 | exports['default'] = getRegion;
|
5752 | module.exports = exports['default'];
|
5753 |
|
5754 | }),
|
5755 |
|
5756 | (function(module, exports, __webpack_require__) {
|
5757 |
|
5758 | 'use strict';
|
5759 |
|
5760 | Object.defineProperty(exports, "__esModule", {
|
5761 | value: true
|
5762 | });
|
5763 |
|
5764 | var _getAlignOffset = __webpack_require__(62);
|
5765 |
|
5766 | var _getAlignOffset2 = _interopRequireDefault(_getAlignOffset);
|
5767 |
|
5768 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
5769 |
|
5770 | function getElFuturePos(elRegion, refNodeRegion, points, offset, targetOffset) {
|
5771 | var p1 = (0, _getAlignOffset2['default'])(refNodeRegion, points[1]);
|
5772 | var p2 = (0, _getAlignOffset2['default'])(elRegion, points[0]);
|
5773 | var diff = [p2.left - p1.left, p2.top - p1.top];
|
5774 |
|
5775 | return {
|
5776 | left: elRegion.left - diff[0] + offset[0] - targetOffset[0],
|
5777 | top: elRegion.top - diff[1] + offset[1] - targetOffset[1]
|
5778 | };
|
5779 | }
|
5780 |
|
5781 | exports['default'] = getElFuturePos;
|
5782 | module.exports = exports['default'];
|
5783 |
|
5784 | }),
|
5785 |
|
5786 | (function(module, exports) {
|
5787 |
|
5788 | 'use strict';
|
5789 |
|
5790 | Object.defineProperty(exports, "__esModule", {
|
5791 | value: true
|
5792 | });
|
5793 | |
5794 |
|
5795 |
|
5796 |
|
5797 | function getAlignOffset(region, align) {
|
5798 | var V = align.charAt(0);
|
5799 | var H = align.charAt(1);
|
5800 | var w = region.width;
|
5801 | var h = region.height;
|
5802 |
|
5803 | var x = region.left;
|
5804 | var y = region.top;
|
5805 |
|
5806 | if (V === 'c') {
|
5807 | y += h / 2;
|
5808 | } else if (V === 'b') {
|
5809 | y += h;
|
5810 | }
|
5811 |
|
5812 | if (H === 'c') {
|
5813 | x += w / 2;
|
5814 | } else if (H === 'r') {
|
5815 | x += w;
|
5816 | }
|
5817 |
|
5818 | return {
|
5819 | left: x,
|
5820 | top: y
|
5821 | };
|
5822 | }
|
5823 |
|
5824 | exports['default'] = getAlignOffset;
|
5825 | module.exports = exports['default'];
|
5826 |
|
5827 | }),
|
5828 |
|
5829 | (function(module, exports, __webpack_require__) {
|
5830 |
|
5831 | 'use strict';
|
5832 |
|
5833 | Object.defineProperty(exports, "__esModule", {
|
5834 | value: true
|
5835 | });
|
5836 |
|
5837 | 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; };
|
5838 |
|
5839 | var _utils = __webpack_require__(54);
|
5840 |
|
5841 | var _utils2 = _interopRequireDefault(_utils);
|
5842 |
|
5843 | var _align = __webpack_require__(53);
|
5844 |
|
5845 | var _align2 = _interopRequireDefault(_align);
|
5846 |
|
5847 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
5848 |
|
5849 | |
5850 |
|
5851 |
|
5852 |
|
5853 |
|
5854 | function alignPoint(el, tgtPoint, align) {
|
5855 | var pageX = void 0;
|
5856 | var pageY = void 0;
|
5857 |
|
5858 | var doc = _utils2['default'].getDocument(el);
|
5859 | var win = doc.defaultView || doc.parentWindow;
|
5860 |
|
5861 | var scrollX = _utils2['default'].getWindowScrollLeft(win);
|
5862 | var scrollY = _utils2['default'].getWindowScrollTop(win);
|
5863 | var viewportWidth = _utils2['default'].viewportWidth(win);
|
5864 | var viewportHeight = _utils2['default'].viewportHeight(win);
|
5865 |
|
5866 | if ('pageX' in tgtPoint) {
|
5867 | pageX = tgtPoint.pageX;
|
5868 | } else {
|
5869 | pageX = scrollX + tgtPoint.clientX;
|
5870 | }
|
5871 |
|
5872 | if ('pageY' in tgtPoint) {
|
5873 | pageY = tgtPoint.pageY;
|
5874 | } else {
|
5875 | pageY = scrollY + tgtPoint.clientY;
|
5876 | }
|
5877 |
|
5878 | var tgtRegion = {
|
5879 | left: pageX,
|
5880 | top: pageY,
|
5881 | width: 0,
|
5882 | height: 0
|
5883 | };
|
5884 |
|
5885 | var pointInView = pageX >= 0 && pageX <= scrollX + viewportWidth && pageY >= 0 && pageY <= scrollY + viewportHeight;
|
5886 |
|
5887 |
|
5888 | var points = [align.points[0], 'cc'];
|
5889 |
|
5890 | return (0, _align2['default'])(el, tgtRegion, _extends({}, align, { points: points }), pointInView);
|
5891 | }
|
5892 |
|
5893 | exports['default'] = alignPoint;
|
5894 | module.exports = exports['default'];
|
5895 |
|
5896 | }),
|
5897 |
|
5898 | (function(module, exports, __webpack_require__) {
|
5899 |
|
5900 | 'use strict';
|
5901 |
|
5902 | Object.defineProperty(exports, "__esModule", {
|
5903 | value: true
|
5904 | });
|
5905 |
|
5906 | 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; };
|
5907 |
|
5908 | var _classnames = __webpack_require__(3);
|
5909 |
|
5910 | var _classnames2 = _interopRequireDefault(_classnames);
|
5911 |
|
5912 | var _react = __webpack_require__(4);
|
5913 |
|
5914 | var _react2 = _interopRequireDefault(_react);
|
5915 |
|
5916 | var _propTypes = __webpack_require__(5);
|
5917 |
|
5918 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
5919 |
|
5920 | var _Transition = __webpack_require__(11);
|
5921 |
|
5922 | var _Transition2 = _interopRequireDefault(_Transition);
|
5923 |
|
5924 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
5925 |
|
5926 | 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; }
|
5927 |
|
5928 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
5929 |
|
5930 | 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; }
|
5931 |
|
5932 | 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); }
|
5933 |
|
5934 | var propTypes = {
|
5935 | |
5936 |
|
5937 |
|
5938 | "in": _propTypes2["default"].bool,
|
5939 |
|
5940 | |
5941 |
|
5942 |
|
5943 | unmountOnExit: _propTypes2["default"].bool,
|
5944 |
|
5945 | |
5946 |
|
5947 |
|
5948 |
|
5949 | transitionAppear: _propTypes2["default"].bool,
|
5950 |
|
5951 | |
5952 |
|
5953 |
|
5954 |
|
5955 |
|
5956 | timeout: _propTypes2["default"].number,
|
5957 |
|
5958 | |
5959 |
|
5960 |
|
5961 | onEnter: _propTypes2["default"].func,
|
5962 | |
5963 |
|
5964 |
|
5965 | onEntering: _propTypes2["default"].func,
|
5966 | |
5967 |
|
5968 |
|
5969 | onEntered: _propTypes2["default"].func,
|
5970 | |
5971 |
|
5972 |
|
5973 | onExit: _propTypes2["default"].func,
|
5974 | |
5975 |
|
5976 |
|
5977 | onExiting: _propTypes2["default"].func,
|
5978 | |
5979 |
|
5980 |
|
5981 | onExited: _propTypes2["default"].func
|
5982 | };
|
5983 |
|
5984 | var defaultProps = {
|
5985 | "in": false,
|
5986 | timeout: 300,
|
5987 | unmountOnExit: false,
|
5988 | transitionAppear: false
|
5989 | };
|
5990 |
|
5991 | var Fade = function (_React$Component) {
|
5992 | _inherits(Fade, _React$Component);
|
5993 |
|
5994 | function Fade() {
|
5995 | _classCallCheck(this, Fade);
|
5996 |
|
5997 | return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
5998 | }
|
5999 |
|
6000 | Fade.prototype.render = function render() {
|
6001 | return _react2["default"].createElement(_Transition2["default"], _extends({}, this.props, {
|
6002 | className: (0, _classnames2["default"])(this.props.className, 'fade'),
|
6003 | enteredClassName: 'in',
|
6004 | enteringClassName: 'in'
|
6005 | }));
|
6006 | };
|
6007 |
|
6008 | return Fade;
|
6009 | }(_react2["default"].Component);
|
6010 |
|
6011 | Fade.propTypes = propTypes;
|
6012 | Fade.defaultProps = defaultProps;
|
6013 |
|
6014 | exports["default"] = Fade;
|
6015 | module.exports = exports['default'];
|
6016 |
|
6017 | }),
|
6018 |
|
6019 | (function(module, exports, __webpack_require__) {
|
6020 |
|
6021 | 'use strict';
|
6022 |
|
6023 | Object.defineProperty(exports, "__esModule", {
|
6024 | value: true
|
6025 | });
|
6026 |
|
6027 | var _Message = __webpack_require__(66);
|
6028 |
|
6029 | var _Message2 = _interopRequireDefault(_Message);
|
6030 |
|
6031 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
6032 |
|
6033 | exports["default"] = _Message2["default"];
|
6034 | module.exports = exports['default'];
|
6035 |
|
6036 | }),
|
6037 |
|
6038 | (function(module, exports, __webpack_require__) {
|
6039 |
|
6040 | 'use strict';
|
6041 |
|
6042 | Object.defineProperty(exports, "__esModule", {
|
6043 | value: true
|
6044 | });
|
6045 |
|
6046 | 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; };
|
6047 |
|
6048 | 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; };
|
6049 |
|
6050 | var _react = __webpack_require__(4);
|
6051 |
|
6052 | var _react2 = _interopRequireDefault(_react);
|
6053 |
|
6054 | var _beeNotification = __webpack_require__(67);
|
6055 |
|
6056 | var _beeNotification2 = _interopRequireDefault(_beeNotification);
|
6057 |
|
6058 | var _classnames = __webpack_require__(3);
|
6059 |
|
6060 | var _classnames2 = _interopRequireDefault(_classnames);
|
6061 |
|
6062 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
6063 |
|
6064 | var defaultDuration = 1.5;
|
6065 | var defaultTop = 0;
|
6066 | var defaultBottom = 48;
|
6067 | var bottom = 90;
|
6068 | var padding = 30;
|
6069 | var width = 200;
|
6070 | var messageInstance = void 0;
|
6071 | var key = 1;
|
6072 | var clsPrefix = 'u-message';
|
6073 | var noop = function noop() {};
|
6074 |
|
6075 | var positionObj = {
|
6076 | "top": {
|
6077 | messageStyle: {
|
6078 | width: "100%"
|
6079 | },
|
6080 | notificationStyle: {
|
6081 | top: defaultTop,
|
6082 | width: "100%"
|
6083 | },
|
6084 | transitionName: 'top'
|
6085 | },
|
6086 | "bottom": {
|
6087 | messageStyle: {
|
6088 | width: "100%"
|
6089 | },
|
6090 | notificationStyle: {
|
6091 | bottom: defaultBottom,
|
6092 | width: "100%"
|
6093 | },
|
6094 | transitionName: 'bottom'
|
6095 | },
|
6096 | "topRight": {
|
6097 | messageStyle: {
|
6098 | width: width
|
6099 | },
|
6100 | notificationStyle: {
|
6101 | top: padding,
|
6102 | right: padding,
|
6103 | width: width
|
6104 | },
|
6105 | transitionName: 'right'
|
6106 | },
|
6107 | "bottomRight": {
|
6108 | messageStyle: {
|
6109 | width: width
|
6110 | },
|
6111 | notificationStyle: {
|
6112 | bottom: bottom,
|
6113 | right: padding,
|
6114 | width: width
|
6115 | },
|
6116 | transitionName: 'right'
|
6117 | },
|
6118 | "topLeft": {
|
6119 | messageStyle: {
|
6120 | width: width
|
6121 | },
|
6122 | notificationStyle: {
|
6123 | top: padding,
|
6124 | left: padding,
|
6125 | width: width
|
6126 | },
|
6127 | transitionName: 'left'
|
6128 | },
|
6129 | "bottomLeft": {
|
6130 | messageStyle: {
|
6131 | width: width
|
6132 | },
|
6133 | notificationStyle: {
|
6134 | bottom: bottom,
|
6135 | left: padding,
|
6136 | width: width
|
6137 | },
|
6138 | transitionName: 'left'
|
6139 | }
|
6140 | };
|
6141 |
|
6142 | function getMessageInstance() {
|
6143 | var position = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'top';
|
6144 | var callback = arguments[1];
|
6145 | var keyboard = arguments[2];
|
6146 | var onEscapeKeyUp = arguments[3];
|
6147 |
|
6148 | if (messageInstance) {
|
6149 | callback(messageInstance);
|
6150 | return;
|
6151 | }
|
6152 | var style = positionObj[position].notificationStyle;
|
6153 | var instanceObj = {
|
6154 | clsPrefix: clsPrefix,
|
6155 | transitionName: clsPrefix + '-' + positionObj[position].transitionName,
|
6156 | style: style,
|
6157 | position: ''
|
6158 | };
|
6159 | if (typeof keyboard === 'boolean') {
|
6160 | instanceObj.keyboard = keyboard;
|
6161 | }
|
6162 | if (typeof onEscapeKeyUp === 'function') {
|
6163 | instanceObj.onEscapeKeyUp = onEscapeKeyUp;
|
6164 | }
|
6165 | _beeNotification2["default"].newInstance(instanceObj, function (instance) {
|
6166 | messageInstance = instance;
|
6167 | callback(instance);
|
6168 | });
|
6169 | }
|
6170 |
|
6171 | function notice(content, duration, type, onClose, position, style, keyboard, onEscapeKeyUp, showIcon) {
|
6172 | var iconType = {
|
6173 | info: 'uf uf-i-c-2',
|
6174 | success: 'uf uf-correct',
|
6175 | danger: 'uf uf-close-c',
|
6176 | warning: 'uf uf-exc-t',
|
6177 | light: 'uf uf-notification',
|
6178 | dark: 'uf uf-bubble',
|
6179 | news: 'uf uf-bell',
|
6180 | infolight: 'uf uf-i-c-2',
|
6181 | successlight: 'uf uf-correct',
|
6182 | dangerlight: 'uf uf-close-c',
|
6183 | warninglight: 'uf uf-exc-t'
|
6184 | }[type];
|
6185 |
|
6186 | var positionStyle = positionObj[position].messageStyle;
|
6187 |
|
6188 | getMessageInstance(position, function (instance) {
|
6189 | instance.notice({
|
6190 | key: key,
|
6191 | duration: duration,
|
6192 | color: type,
|
6193 | style: _extends({}, positionStyle, style),
|
6194 | content: _react2["default"].createElement(
|
6195 | 'div',
|
6196 | null,
|
6197 | showIcon ? _react2["default"].createElement(
|
6198 | 'div',
|
6199 | { className: clsPrefix + '-notice-description-icon' },
|
6200 | _react2["default"].createElement('i', { className: (0, _classnames2["default"])(iconType) })
|
6201 | ) : null,
|
6202 | _react2["default"].createElement(
|
6203 | 'div',
|
6204 | { className: clsPrefix + '-notice-description-content' },
|
6205 | content
|
6206 | )
|
6207 | ),
|
6208 | onClose: onClose
|
6209 | });
|
6210 | }, keyboard, onEscapeKeyUp);
|
6211 | return function () {
|
6212 | var target = key++;
|
6213 | return function () {
|
6214 | if (messageInstance) {
|
6215 | messageInstance.removeNotice(target);
|
6216 | }
|
6217 | };
|
6218 | }();
|
6219 | }
|
6220 |
|
6221 | exports["default"] = {
|
6222 | create: function create(obj) {
|
6223 | var content = obj.content || '';
|
6224 | var duration = _typeof(obj.duration) == undefined ? defaultDuration : obj.duration;
|
6225 | var color = obj.color || 'dark';
|
6226 | var onClose = obj.onClose || noop;
|
6227 | var position = obj.position || "top";
|
6228 | var style = obj.style || {};
|
6229 | var showIcon = obj.showIcon || false;
|
6230 | return notice(content, duration, color, onClose, position, style, obj.keyboard, obj.onEscapeKeyUp, showIcon);
|
6231 | },
|
6232 | config: function config(options) {
|
6233 | if (options.top !== undefined) {
|
6234 | defaultTop = options.top;
|
6235 | }
|
6236 | if (options.duration !== undefined) {
|
6237 | defaultDuration = options.duration;
|
6238 | }
|
6239 | if (options.clsPrefix !== undefined) {
|
6240 | clsPrefix = options.clsPrefix;
|
6241 | }
|
6242 | if (options.defaultBottom !== undefined) {
|
6243 | defaultBottom = options.defaultBottom;
|
6244 | }
|
6245 | if (options.bottom !== undefined) {
|
6246 | bottom = options.bottom;
|
6247 | }
|
6248 | if (options.width !== undefined) {
|
6249 | bottom = options.width;
|
6250 | }
|
6251 | },
|
6252 | destroy: function destroy() {
|
6253 | if (messageInstance) {
|
6254 | messageInstance.destroy();
|
6255 | messageInstance = null;
|
6256 | }
|
6257 | }
|
6258 | };
|
6259 | module.exports = exports['default'];
|
6260 |
|
6261 | }),
|
6262 |
|
6263 | (function(module, exports, __webpack_require__) {
|
6264 |
|
6265 | 'use strict';
|
6266 |
|
6267 | Object.defineProperty(exports, "__esModule", {
|
6268 | value: true
|
6269 | });
|
6270 |
|
6271 | var _Notification = __webpack_require__(68);
|
6272 |
|
6273 | var _Notification2 = _interopRequireDefault(_Notification);
|
6274 |
|
6275 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
6276 |
|
6277 | exports["default"] = _Notification2["default"];
|
6278 | module.exports = exports['default'];
|
6279 |
|
6280 | }),
|
6281 |
|
6282 | (function(module, exports, __webpack_require__) {
|
6283 |
|
6284 | 'use strict';
|
6285 |
|
6286 | Object.defineProperty(exports, "__esModule", {
|
6287 | value: true
|
6288 | });
|
6289 |
|
6290 | 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; };
|
6291 |
|
6292 | var _react = __webpack_require__(4);
|
6293 |
|
6294 | var _react2 = _interopRequireDefault(_react);
|
6295 |
|
6296 | var _propTypes = __webpack_require__(5);
|
6297 |
|
6298 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
6299 |
|
6300 | var _reactDom = __webpack_require__(12);
|
6301 |
|
6302 | var _reactDom2 = _interopRequireDefault(_reactDom);
|
6303 |
|
6304 | var _beeAnimate = __webpack_require__(69);
|
6305 |
|
6306 | var _beeAnimate2 = _interopRequireDefault(_beeAnimate);
|
6307 |
|
6308 | var _createChainedFunction = __webpack_require__(37);
|
6309 |
|
6310 | var _createChainedFunction2 = _interopRequireDefault(_createChainedFunction);
|
6311 |
|
6312 | var _ownerDocument = __webpack_require__(74);
|
6313 |
|
6314 | var _ownerDocument2 = _interopRequireDefault(_ownerDocument);
|
6315 |
|
6316 | var _addEventListener = __webpack_require__(76);
|
6317 |
|
6318 | var _addEventListener2 = _interopRequireDefault(_addEventListener);
|
6319 |
|
6320 | var _classnames = __webpack_require__(3);
|
6321 |
|
6322 | var _classnames2 = _interopRequireDefault(_classnames);
|
6323 |
|
6324 | var _Notice = __webpack_require__(78);
|
6325 |
|
6326 | var _Notice2 = _interopRequireDefault(_Notice);
|
6327 |
|
6328 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
6329 |
|
6330 | 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; }
|
6331 |
|
6332 | 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; }
|
6333 |
|
6334 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
6335 |
|
6336 | 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; }
|
6337 |
|
6338 | 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); }
|
6339 |
|
6340 | var seed = 0;
|
6341 | var now = Date.now();
|
6342 |
|
6343 | function getUuid() {
|
6344 | return 'uNotification_' + now + '_' + seed++;
|
6345 | }
|
6346 |
|
6347 | var propTypes = {
|
6348 | show: _propTypes2["default"].bool,
|
6349 | clsPrefix: _propTypes2["default"].string,
|
6350 | style: _propTypes2["default"].object,
|
6351 | position: _propTypes2["default"].oneOf(['topRight', 'bottomRight', '']),
|
6352 | transitionName: _propTypes2["default"].string,
|
6353 | keyboard: _propTypes2["default"].bool,
|
6354 | onEscapeKeyUp: _propTypes2["default"].func,
|
6355 | animation: _propTypes2["default"].oneOfType([_propTypes2["default"].string, _propTypes2["default"].object])
|
6356 | };
|
6357 |
|
6358 | var defaultProps = {
|
6359 | clsPrefix: 'u-notification',
|
6360 | animation: 'fade',
|
6361 | keyboard: true,
|
6362 | position: 'topRight'
|
6363 | };
|
6364 |
|
6365 | var Notification = function (_Component) {
|
6366 | _inherits(Notification, _Component);
|
6367 |
|
6368 | function Notification(props) {
|
6369 | _classCallCheck(this, Notification);
|
6370 |
|
6371 | var _this = _possibleConstructorReturn(this, _Component.call(this, props));
|
6372 |
|
6373 | _this.handleDocumentKeyUp = function (e) {
|
6374 | if (_this.props.keyboard && e.keyCode === 27 && _this.state.notices.length) {
|
6375 | _this.setState(function (previousState) {
|
6376 | previousState.notices.shift();
|
6377 | return {
|
6378 | notices: previousState.notices
|
6379 | };
|
6380 | });
|
6381 | if (_this.props.onEscapeKeyUp) {
|
6382 | _this.props.onEscapeKeyUp(e);
|
6383 | }
|
6384 | }
|
6385 | };
|
6386 |
|
6387 | _this.state = {
|
6388 | notices: []
|
6389 | };
|
6390 | _this.add = _this.add.bind(_this);
|
6391 | _this.remove = _this.remove.bind(_this);
|
6392 |
|
6393 | return _this;
|
6394 | }
|
6395 |
|
6396 | Notification.prototype.componentDidMount = function componentDidMount() {
|
6397 |
|
6398 | var doc = (0, _ownerDocument2["default"])(this);
|
6399 | this._onDocumentKeyupListener = (0, _addEventListener2["default"])(doc, 'keyup', this.handleDocumentKeyUp);
|
6400 | };
|
6401 |
|
6402 | Notification.prototype.componentWillUnmount = function componentWillUnmount() {
|
6403 | this._onDocumentKeyupListener.remove();
|
6404 | };
|
6405 |
|
6406 | Notification.prototype.getTransitionName = function getTransitionName() {
|
6407 | var props = this.props;
|
6408 | var transitionName = props.transitionName;
|
6409 | if (!transitionName && props.animation) {
|
6410 | transitionName = props.clsPrefix + '-' + props.animation;
|
6411 | }
|
6412 | return transitionName;
|
6413 | };
|
6414 |
|
6415 | Notification.prototype.add = function add(notice) {
|
6416 | var key = notice.key = notice.key || getUuid();
|
6417 | this.setState(function (previousState) {
|
6418 | var notices = previousState.notices;
|
6419 | if (!notices.filter(function (v) {
|
6420 | return v.key === key;
|
6421 | }).length) {
|
6422 | return {
|
6423 | notices: notices.concat(notice)
|
6424 | };
|
6425 | }
|
6426 | });
|
6427 | };
|
6428 |
|
6429 | Notification.prototype.remove = function remove(key) {
|
6430 | this.setState(function (previousState) {
|
6431 | return {
|
6432 | notices: previousState.notices.filter(function (notice) {
|
6433 | return notice.key !== key;
|
6434 | })
|
6435 | };
|
6436 | });
|
6437 | };
|
6438 |
|
6439 | |
6440 |
|
6441 |
|
6442 |
|
6443 |
|
6444 | Notification.prototype.render = function render() {
|
6445 | var _this2 = this,
|
6446 | _classes;
|
6447 |
|
6448 | var _props = this.props,
|
6449 | clsPrefix = _props.clsPrefix,
|
6450 | className = _props.className,
|
6451 | position = _props.position,
|
6452 | style = _props.style;
|
6453 |
|
6454 | var noticeNodes = this.state.notices.map(function (notice) {
|
6455 | var onClose = (0, _createChainedFunction2["default"])(_this2.remove.bind(_this2, notice.key), notice.onClose);
|
6456 | return _react2["default"].createElement(
|
6457 | _Notice2["default"],
|
6458 | _extends({
|
6459 | clsPrefix: clsPrefix
|
6460 | }, notice, {
|
6461 | onClose: onClose
|
6462 | }),
|
6463 | notice.content
|
6464 | );
|
6465 | });
|
6466 | var classes = (_classes = {}, _defineProperty(_classes, clsPrefix, 1), _defineProperty(_classes, className, !!className), _classes);
|
6467 | if (position) {
|
6468 | classes[clsPrefix + '-' + position] = !!position;
|
6469 | }
|
6470 |
|
6471 | return _react2["default"].createElement(
|
6472 | 'div',
|
6473 | { className: (0, _classnames2["default"])(className, classes), style: style },
|
6474 | _react2["default"].createElement(
|
6475 | _beeAnimate2["default"],
|
6476 | { transitionName: this.getTransitionName() },
|
6477 | noticeNodes
|
6478 | )
|
6479 | );
|
6480 | };
|
6481 |
|
6482 | return Notification;
|
6483 | }(_react.Component);
|
6484 |
|
6485 | ;
|
6486 |
|
6487 | Notification.propTypes = propTypes;
|
6488 | Notification.defaultProps = defaultProps;
|
6489 |
|
6490 | Notification.newInstance = function newNotificationInstance(properties, callback) {
|
6491 | if (typeof callback !== 'function') {
|
6492 | console.error('You must introduce callback as the second parameter of Notification.newInstance().');
|
6493 | return;
|
6494 | }
|
6495 | var props = properties || {};
|
6496 | var div = document.createElement('div');
|
6497 | document.body.appendChild(div);
|
6498 |
|
6499 | var called = false;
|
6500 | function ref(notification) {
|
6501 | if (called) {
|
6502 | return;
|
6503 | }
|
6504 | called = true;
|
6505 | callback({
|
6506 | notice: function notice(noticeProps) {
|
6507 | notification.add(noticeProps);
|
6508 | },
|
6509 | removeNotice: function removeNotice(key) {
|
6510 | notification.remove(key);
|
6511 | },
|
6512 |
|
6513 | component: notification,
|
6514 | destroy: function destroy() {
|
6515 | _reactDom2["default"].unmountComponentAtNode(div);
|
6516 | document.body.removeChild(div);
|
6517 | }
|
6518 | });
|
6519 | }
|
6520 | _reactDom2["default"].render(_react2["default"].createElement(Notification, _extends({}, props, { ref: ref })), div);
|
6521 | };
|
6522 |
|
6523 | exports["default"] = Notification;
|
6524 | module.exports = exports['default'];
|
6525 |
|
6526 | }),
|
6527 |
|
6528 | (function(module, exports, __webpack_require__) {
|
6529 |
|
6530 | 'use strict';
|
6531 |
|
6532 | Object.defineProperty(exports, "__esModule", {
|
6533 | value: true
|
6534 | });
|
6535 |
|
6536 | var _Animate = __webpack_require__(70);
|
6537 |
|
6538 | var _Animate2 = _interopRequireDefault(_Animate);
|
6539 |
|
6540 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
6541 |
|
6542 | exports["default"] = _Animate2["default"];
|
6543 | module.exports = exports['default'];
|
6544 |
|
6545 | }),
|
6546 |
|
6547 | (function(module, exports, __webpack_require__) {
|
6548 |
|
6549 | 'use strict';
|
6550 |
|
6551 | Object.defineProperty(exports, "__esModule", {
|
6552 | value: true
|
6553 | });
|
6554 |
|
6555 | var _react = __webpack_require__(4);
|
6556 |
|
6557 | var _react2 = _interopRequireDefault(_react);
|
6558 |
|
6559 | var _propTypes = __webpack_require__(5);
|
6560 |
|
6561 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
6562 |
|
6563 | var _ChildrenUtils = __webpack_require__(71);
|
6564 |
|
6565 | var _AnimateChild = __webpack_require__(72);
|
6566 |
|
6567 | var _AnimateChild2 = _interopRequireDefault(_AnimateChild);
|
6568 |
|
6569 | var _util = __webpack_require__(73);
|
6570 |
|
6571 | var _util2 = _interopRequireDefault(_util);
|
6572 |
|
6573 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
6574 |
|
6575 | 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; }
|
6576 |
|
6577 | 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; }
|
6578 |
|
6579 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
6580 |
|
6581 | 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; }
|
6582 |
|
6583 | 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); }
|
6584 |
|
6585 | var defaultKey = 'u_animate_' + Date.now();
|
6586 |
|
6587 |
|
6588 | function getChildrenFromProps(props) {
|
6589 | var children = props.children;
|
6590 | if (_react2["default"].isValidElement(children)) {
|
6591 | if (!children.key) {
|
6592 | return _react2["default"].cloneElement(children, {
|
6593 | key: defaultKey
|
6594 | });
|
6595 | }
|
6596 | }
|
6597 | return children;
|
6598 | }
|
6599 |
|
6600 | function noop() {}
|
6601 |
|
6602 | var propTypes = {
|
6603 | component: _propTypes2["default"].any,
|
6604 | animation: _propTypes2["default"].object,
|
6605 | transitionName: _propTypes2["default"].oneOfType([_propTypes2["default"].string, _propTypes2["default"].object]),
|
6606 | transitionEnter: _propTypes2["default"].bool,
|
6607 | transitionAppear: _propTypes2["default"].bool,
|
6608 | exclusive: _propTypes2["default"].bool,
|
6609 | transitionLeave: _propTypes2["default"].bool,
|
6610 | onEnd: _propTypes2["default"].func,
|
6611 | onEnter: _propTypes2["default"].func,
|
6612 | onLeave: _propTypes2["default"].func,
|
6613 | onAppear: _propTypes2["default"].func,
|
6614 | showProp: _propTypes2["default"].string
|
6615 | };
|
6616 |
|
6617 | var defaultProps = {
|
6618 | animation: {},
|
6619 | component: 'span',
|
6620 | transitionEnter: true,
|
6621 | transitionLeave: true,
|
6622 | transitionAppear: false,
|
6623 | onEnd: noop,
|
6624 | onEnter: noop,
|
6625 | onLeave: noop,
|
6626 | onAppear: noop
|
6627 | };
|
6628 |
|
6629 | var Animate = function (_Component) {
|
6630 | _inherits(Animate, _Component);
|
6631 |
|
6632 | function Animate(props) {
|
6633 | _classCallCheck(this, Animate);
|
6634 |
|
6635 | var _this = _possibleConstructorReturn(this, _Component.call(this, props));
|
6636 |
|
6637 | _this.currentlyAnimatingKeys = {};
|
6638 | _this.keysToEnter = [];
|
6639 | _this.keysToLeave = [];
|
6640 | _this.state = {
|
6641 | children: (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(_this.props))
|
6642 | };
|
6643 |
|
6644 | _this.performEnter = _this.performEnter.bind(_this);
|
6645 | _this.performAppear = _this.performAppear.bind(_this);
|
6646 | _this.handleDoneAdding = _this.handleDoneAdding.bind(_this);
|
6647 | _this.performLeave = _this.performLeave.bind(_this);
|
6648 |
|
6649 | _this.performLeave = _this.performLeave.bind(_this);
|
6650 | _this.handleDoneLeaving = _this.handleDoneLeaving.bind(_this);
|
6651 | _this.isValidChildByKey = _this.isValidChildByKey.bind(_this);
|
6652 | _this.stop = _this.stop.bind(_this);
|
6653 | return _this;
|
6654 | }
|
6655 |
|
6656 | Animate.prototype.componentDidMount = function componentDidMount() {
|
6657 | var _this2 = this;
|
6658 |
|
6659 | this.mounted = true;
|
6660 | var showProp = this.props.showProp;
|
6661 | var children = this.state.children;
|
6662 | if (showProp) {
|
6663 | children = children.filter(function (child) {
|
6664 | return !!child.props[showProp];
|
6665 | });
|
6666 | }
|
6667 | children.forEach(function (child) {
|
6668 | if (child) {
|
6669 | _this2.performAppear(child.key);
|
6670 | }
|
6671 | });
|
6672 | };
|
6673 |
|
6674 | Animate.prototype.componentWillUnmount = function componentWillUnmount() {
|
6675 | this.mounted = false;
|
6676 | };
|
6677 |
|
6678 | Animate.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
6679 | var _this3 = this;
|
6680 |
|
6681 | this.nextProps = nextProps;
|
6682 | var nextChildren = (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(nextProps));
|
6683 | var props = this.props;
|
6684 |
|
6685 | if (props.exclusive) {
|
6686 | Object.keys(this.currentlyAnimatingKeys).forEach(function (key) {
|
6687 | _this3.stop(key);
|
6688 | });
|
6689 | }
|
6690 | var showProp = props.showProp;
|
6691 | var currentlyAnimatingKeys = this.currentlyAnimatingKeys;
|
6692 |
|
6693 | var currentChildren = props.exclusive ? (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(props)) : this.state.children;
|
6694 |
|
6695 | var newChildren = [];
|
6696 | if (showProp) {
|
6697 | currentChildren.forEach(function (currentChild) {
|
6698 | var nextChild = currentChild && (0, _ChildrenUtils.findChildInChildrenByKey)(nextChildren, currentChild.key);
|
6699 | var newChild = void 0;
|
6700 | if ((!nextChild || !nextChild.props[showProp]) && currentChild.props[showProp]) {
|
6701 | newChild = _react2["default"].cloneElement(nextChild || currentChild, _defineProperty({}, showProp, true));
|
6702 | } else {
|
6703 | newChild = nextChild;
|
6704 | }
|
6705 | if (newChild) {
|
6706 | newChildren.push(newChild);
|
6707 | }
|
6708 | });
|
6709 | nextChildren.forEach(function (nextChild) {
|
6710 | if (!nextChild || !(0, _ChildrenUtils.findChildInChildrenByKey)(currentChildren, nextChild.key)) {
|
6711 | newChildren.push(nextChild);
|
6712 | }
|
6713 | });
|
6714 | } else {
|
6715 | newChildren = (0, _ChildrenUtils.mergeChildren)(currentChildren, nextChildren);
|
6716 | }
|
6717 |
|
6718 |
|
6719 | this.setState({
|
6720 | children: newChildren
|
6721 | });
|
6722 |
|
6723 | nextChildren.forEach(function (child) {
|
6724 | var key = child && child.key;
|
6725 | if (child && currentlyAnimatingKeys[key]) {
|
6726 | return;
|
6727 | }
|
6728 | var hasPrev = child && (0, _ChildrenUtils.findChildInChildrenByKey)(currentChildren, key);
|
6729 | if (showProp) {
|
6730 | var showInNext = child.props[showProp];
|
6731 | if (hasPrev) {
|
6732 | var showInNow = (0, _ChildrenUtils.findShownChildInChildrenByKey)(currentChildren, key, showProp);
|
6733 | if (!showInNow && showInNext) {
|
6734 | _this3.keysToEnter.push(key);
|
6735 | }
|
6736 | } else if (showInNext) {
|
6737 | _this3.keysToEnter.push(key);
|
6738 | }
|
6739 | } else if (!hasPrev) {
|
6740 | _this3.keysToEnter.push(key);
|
6741 | }
|
6742 | });
|
6743 |
|
6744 | currentChildren.forEach(function (child) {
|
6745 | var key = child && child.key;
|
6746 | if (child && currentlyAnimatingKeys[key]) {
|
6747 | return;
|
6748 | }
|
6749 | var hasNext = child && (0, _ChildrenUtils.findChildInChildrenByKey)(nextChildren, key);
|
6750 | if (showProp) {
|
6751 | var showInNow = child.props[showProp];
|
6752 | if (hasNext) {
|
6753 | var showInNext = (0, _ChildrenUtils.findShownChildInChildrenByKey)(nextChildren, key, showProp);
|
6754 | if (!showInNext && showInNow) {
|
6755 | _this3.keysToLeave.push(key);
|
6756 | }
|
6757 | } else if (showInNow) {
|
6758 | _this3.keysToLeave.push(key);
|
6759 | }
|
6760 | } else if (!hasNext) {
|
6761 | _this3.keysToLeave.push(key);
|
6762 | }
|
6763 | });
|
6764 | };
|
6765 |
|
6766 | Animate.prototype.componentDidUpdate = function componentDidUpdate() {
|
6767 | var keysToEnter = this.keysToEnter;
|
6768 | this.keysToEnter = [];
|
6769 | keysToEnter.forEach(this.performEnter);
|
6770 | var keysToLeave = this.keysToLeave;
|
6771 | this.keysToLeave = [];
|
6772 | keysToLeave.forEach(this.performLeave);
|
6773 | };
|
6774 |
|
6775 | Animate.prototype.performEnter = function performEnter(key) {
|
6776 |
|
6777 | if (this.refs[key]) {
|
6778 | this.currentlyAnimatingKeys[key] = true;
|
6779 | this.refs[key].componentWillEnter(this.handleDoneAdding.bind(this, key, 'enter'));
|
6780 | }
|
6781 | };
|
6782 |
|
6783 | Animate.prototype.performAppear = function performAppear(key) {
|
6784 | if (this.refs[key]) {
|
6785 | this.currentlyAnimatingKeys[key] = true;
|
6786 | this.refs[key].componentWillAppear(this.handleDoneAdding.bind(this, key, 'appear'));
|
6787 | }
|
6788 | };
|
6789 |
|
6790 | Animate.prototype.handleDoneAdding = function handleDoneAdding(key, type) {
|
6791 | var props = this.props;
|
6792 | delete this.currentlyAnimatingKeys[key];
|
6793 |
|
6794 | if (props.exclusive && props !== this.nextProps) {
|
6795 | return;
|
6796 | }
|
6797 | var currentChildren = (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(props));
|
6798 | if (!this.isValidChildByKey(currentChildren, key)) {
|
6799 |
|
6800 | this.performLeave(key);
|
6801 | } else {
|
6802 | if (type === 'appear') {
|
6803 | if (_util2["default"].allowAppearCallback(props)) {
|
6804 | props.onAppear(key);
|
6805 | props.onEnd(key, true);
|
6806 | }
|
6807 | } else {
|
6808 | if (_util2["default"].allowEnterCallback(props)) {
|
6809 | props.onEnter(key);
|
6810 | props.onEnd(key, true);
|
6811 | }
|
6812 | }
|
6813 | }
|
6814 | };
|
6815 |
|
6816 | Animate.prototype.performLeave = function performLeave(key) {
|
6817 |
|
6818 | if (this.refs[key]) {
|
6819 | this.currentlyAnimatingKeys[key] = true;
|
6820 | this.refs[key].componentWillLeave(this.handleDoneLeaving.bind(this, key));
|
6821 | }
|
6822 | };
|
6823 |
|
6824 | Animate.prototype.handleDoneLeaving = function handleDoneLeaving(key) {
|
6825 | var props = this.props;
|
6826 | delete this.currentlyAnimatingKeys[key];
|
6827 |
|
6828 | if (props.exclusive && props !== this.nextProps) {
|
6829 | return;
|
6830 | }
|
6831 | var currentChildren = (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(props));
|
6832 |
|
6833 | if (this.isValidChildByKey(currentChildren, key)) {
|
6834 | this.performEnter(key);
|
6835 | } else {
|
6836 | var end = function end() {
|
6837 | if (_util2["default"].allowLeaveCallback(props)) {
|
6838 | props.onLeave(key);
|
6839 | props.onEnd(key, false);
|
6840 | }
|
6841 | };
|
6842 |
|
6843 | if (this.mounted && !(0, _ChildrenUtils.isSameChildren)(this.state.children, currentChildren, props.showProp)) {
|
6844 | this.setState({
|
6845 | children: currentChildren
|
6846 | }, end);
|
6847 | } else {
|
6848 | end();
|
6849 | }
|
6850 | }
|
6851 | };
|
6852 |
|
6853 | Animate.prototype.isValidChildByKey = function isValidChildByKey(currentChildren, key) {
|
6854 | var showProp = this.props.showProp;
|
6855 | if (showProp) {
|
6856 | return (0, _ChildrenUtils.findShownChildInChildrenByKey)(currentChildren, key, showProp);
|
6857 | }
|
6858 | return (0, _ChildrenUtils.findChildInChildrenByKey)(currentChildren, key);
|
6859 | };
|
6860 |
|
6861 | Animate.prototype.stop = function stop(key) {
|
6862 | delete this.currentlyAnimatingKeys[key];
|
6863 | var component = this.refs[key];
|
6864 | if (component) {
|
6865 | component.stop();
|
6866 | }
|
6867 | };
|
6868 |
|
6869 | Animate.prototype.render = function render() {
|
6870 | var props = this.props;
|
6871 | this.nextProps = props;
|
6872 | var stateChildren = this.state.children;
|
6873 | var children = null;
|
6874 | if (stateChildren) {
|
6875 | children = stateChildren.map(function (child) {
|
6876 | if (child === null || child === undefined) {
|
6877 | return child;
|
6878 | }
|
6879 | if (!child.key) {
|
6880 | throw new Error('must set key for <rc-animate> children');
|
6881 | }
|
6882 | return _react2["default"].createElement(
|
6883 | _AnimateChild2["default"],
|
6884 | {
|
6885 | key: child.key,
|
6886 | ref: child.key,
|
6887 | animation: props.animation,
|
6888 | transitionName: props.transitionName,
|
6889 | transitionEnter: props.transitionEnter,
|
6890 | transitionAppear: props.transitionAppear,
|
6891 | transitionLeave: props.transitionLeave
|
6892 | },
|
6893 | child
|
6894 | );
|
6895 | });
|
6896 | }
|
6897 | var Component = props.component;
|
6898 | if (Component) {
|
6899 | var passedProps = props;
|
6900 | if (typeof Component === 'string') {
|
6901 | passedProps = {
|
6902 | className: props.className,
|
6903 | style: props.style
|
6904 | };
|
6905 | }
|
6906 | return _react2["default"].createElement(
|
6907 | Component,
|
6908 | passedProps,
|
6909 | children
|
6910 | );
|
6911 | }
|
6912 | return children[0] || null;
|
6913 | };
|
6914 |
|
6915 | return Animate;
|
6916 | }(_react.Component);
|
6917 |
|
6918 | ;
|
6919 | Animate.defaultProps = defaultProps;
|
6920 | Animate.propTypes = Animate.propTypes;
|
6921 |
|
6922 | exports["default"] = Animate;
|
6923 | module.exports = exports['default'];
|
6924 |
|
6925 | }),
|
6926 |
|
6927 | (function(module, exports, __webpack_require__) {
|
6928 |
|
6929 | 'use strict';
|
6930 |
|
6931 | Object.defineProperty(exports, "__esModule", {
|
6932 | value: true
|
6933 | });
|
6934 | exports.toArrayChildren = toArrayChildren;
|
6935 | exports.findChildInChildrenByKey = findChildInChildrenByKey;
|
6936 | exports.findShownChildInChildrenByKey = findShownChildInChildrenByKey;
|
6937 | exports.findHiddenChildInChildrenByKey = findHiddenChildInChildrenByKey;
|
6938 | exports.isSameChildren = isSameChildren;
|
6939 | exports.mergeChildren = mergeChildren;
|
6940 |
|
6941 | var _react = __webpack_require__(4);
|
6942 |
|
6943 | var _react2 = _interopRequireDefault(_react);
|
6944 |
|
6945 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
6946 |
|
6947 | function toArrayChildren(children) {
|
6948 | var ret = [];
|
6949 | _react2["default"].Children.forEach(children, function (child) {
|
6950 | ret.push(child);
|
6951 | });
|
6952 | return ret;
|
6953 | }
|
6954 |
|
6955 | function findChildInChildrenByKey(children, key) {
|
6956 | var ret = null;
|
6957 | if (children) {
|
6958 | children.forEach(function (child) {
|
6959 | if (ret) {
|
6960 | return;
|
6961 | }
|
6962 | if (child && child.key === key) {
|
6963 | ret = child;
|
6964 | }
|
6965 | });
|
6966 | }
|
6967 | return ret;
|
6968 | }
|
6969 |
|
6970 | function findShownChildInChildrenByKey(children, key, showProp) {
|
6971 | var ret = null;
|
6972 | if (children) {
|
6973 | children.forEach(function (child) {
|
6974 | if (child && child.key === key && child.props[showProp]) {
|
6975 | if (ret) {
|
6976 | throw new Error('two child with same key for <rc-animate> children');
|
6977 | }
|
6978 | ret = child;
|
6979 | }
|
6980 | });
|
6981 | }
|
6982 | return ret;
|
6983 | }
|
6984 |
|
6985 | function findHiddenChildInChildrenByKey(children, key, showProp) {
|
6986 | var found = 0;
|
6987 | if (children) {
|
6988 | children.forEach(function (child) {
|
6989 | if (found) {
|
6990 | return;
|
6991 | }
|
6992 | found = child && child.key === key && !child.props[showProp];
|
6993 | });
|
6994 | }
|
6995 | return found;
|
6996 | }
|
6997 |
|
6998 | function isSameChildren(c1, c2, showProp) {
|
6999 | var same = c1.length === c2.length;
|
7000 | if (same) {
|
7001 | c1.forEach(function (child, index) {
|
7002 | var child2 = c2[index];
|
7003 | if (child && child2) {
|
7004 | if (child && !child2 || !child && child2) {
|
7005 | same = false;
|
7006 | } else if (child.key !== child2.key) {
|
7007 | same = false;
|
7008 | } else if (showProp && child.props[showProp] !== child2.props[showProp]) {
|
7009 | same = false;
|
7010 | }
|
7011 | }
|
7012 | });
|
7013 | }
|
7014 | return same;
|
7015 | }
|
7016 |
|
7017 | function mergeChildren(prev, next) {
|
7018 | var ret = [];
|
7019 |
|
7020 |
|
7021 |
|
7022 | var nextChildrenPending = {};
|
7023 | var pendingChildren = [];
|
7024 | prev.forEach(function (child) {
|
7025 | if (child && findChildInChildrenByKey(next, child.key)) {
|
7026 | if (pendingChildren.length) {
|
7027 | nextChildrenPending[child.key] = pendingChildren;
|
7028 | pendingChildren = [];
|
7029 | }
|
7030 | } else {
|
7031 | pendingChildren.push(child);
|
7032 | }
|
7033 | });
|
7034 |
|
7035 | next.forEach(function (child) {
|
7036 | if (child && nextChildrenPending.hasOwnProperty(child.key)) {
|
7037 | ret = ret.concat(nextChildrenPending[child.key]);
|
7038 | }
|
7039 | ret.push(child);
|
7040 | });
|
7041 |
|
7042 | ret = ret.concat(pendingChildren);
|
7043 |
|
7044 | return ret;
|
7045 | }
|
7046 |
|
7047 | }),
|
7048 |
|
7049 | (function(module, exports, __webpack_require__) {
|
7050 |
|
7051 | 'use strict';
|
7052 |
|
7053 | Object.defineProperty(exports, "__esModule", {
|
7054 | value: true
|
7055 | });
|
7056 |
|
7057 | 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; };
|
7058 |
|
7059 | var _react = __webpack_require__(4);
|
7060 |
|
7061 | var _react2 = _interopRequireDefault(_react);
|
7062 |
|
7063 | var _propTypes = __webpack_require__(5);
|
7064 |
|
7065 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
7066 |
|
7067 | var _reactDom = __webpack_require__(12);
|
7068 |
|
7069 | var _reactDom2 = _interopRequireDefault(_reactDom);
|
7070 |
|
7071 | var _tinperBeeCore = __webpack_require__(27);
|
7072 |
|
7073 | var _util = __webpack_require__(73);
|
7074 |
|
7075 | var _util2 = _interopRequireDefault(_util);
|
7076 |
|
7077 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
7078 |
|
7079 | 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; }
|
7080 |
|
7081 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
7082 |
|
7083 | 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; }
|
7084 |
|
7085 | 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); }
|
7086 |
|
7087 | var transitionMap = {
|
7088 | enter: 'transitionEnter',
|
7089 | appear: 'transitionAppear',
|
7090 | leave: 'transitionLeave'
|
7091 | };
|
7092 |
|
7093 | var propTypes = {
|
7094 | children: _propTypes2["default"].any
|
7095 | };
|
7096 |
|
7097 | var AnimateChild = function (_Component) {
|
7098 | _inherits(AnimateChild, _Component);
|
7099 |
|
7100 | function AnimateChild(props) {
|
7101 | _classCallCheck(this, AnimateChild);
|
7102 |
|
7103 | var _this = _possibleConstructorReturn(this, _Component.call(this, props));
|
7104 |
|
7105 | _this.transition = _this.transition.bind(_this);
|
7106 | _this.stop = _this.stop.bind(_this);
|
7107 | return _this;
|
7108 | }
|
7109 |
|
7110 | AnimateChild.prototype.componentWillUnmount = function componentWillUnmount() {
|
7111 | this.stop();
|
7112 | };
|
7113 |
|
7114 | AnimateChild.prototype.componentWillEnter = function componentWillEnter(done) {
|
7115 | if (_util2["default"].isEnterSupported(this.props)) {
|
7116 | this.transition('enter', done);
|
7117 | } else {
|
7118 | done();
|
7119 | }
|
7120 | };
|
7121 |
|
7122 | AnimateChild.prototype.componentWillAppear = function componentWillAppear(done) {
|
7123 | if (_util2["default"].isAppearSupported(this.props)) {
|
7124 | this.transition('appear', done);
|
7125 | } else {
|
7126 | done();
|
7127 | }
|
7128 | };
|
7129 |
|
7130 | AnimateChild.prototype.componentWillLeave = function componentWillLeave(done) {
|
7131 | if (_util2["default"].isLeaveSupported(this.props)) {
|
7132 | this.transition('leave', done);
|
7133 | } else {
|
7134 |
|
7135 |
|
7136 |
|
7137 | done();
|
7138 | }
|
7139 | };
|
7140 |
|
7141 | AnimateChild.prototype.transition = function transition(animationType, finishCallback) {
|
7142 | var _this2 = this;
|
7143 |
|
7144 | var node = _reactDom2["default"].findDOMNode(this);
|
7145 | var props = this.props;
|
7146 | var transitionName = props.transitionName;
|
7147 | var nameIsObj = (typeof transitionName === 'undefined' ? 'undefined' : _typeof(transitionName)) === 'object';
|
7148 | this.stop();
|
7149 | var end = function end() {
|
7150 | _this2.stopper = null;
|
7151 | finishCallback();
|
7152 | };
|
7153 | if ((_tinperBeeCore.cssAnimation.isCssAnimationSupported || !props.animation[animationType]) && transitionName && props[transitionMap[animationType]]) {
|
7154 | var name = nameIsObj ? transitionName[animationType] : transitionName + '-' + animationType;
|
7155 | var activeName = name + '-active';
|
7156 | if (nameIsObj && transitionName[animationType + 'Active']) {
|
7157 | activeName = transitionName[animationType + 'Active'];
|
7158 | }
|
7159 | this.stopper = (0, _tinperBeeCore.cssAnimation)(node, {
|
7160 | name: name,
|
7161 | active: activeName
|
7162 | }, end);
|
7163 | } else {
|
7164 | this.stopper = props.animation[animationType](node, end);
|
7165 | }
|
7166 | };
|
7167 |
|
7168 | AnimateChild.prototype.stop = function stop() {
|
7169 | var stopper = this.stopper;
|
7170 | if (stopper) {
|
7171 | this.stopper = null;
|
7172 | stopper.stop();
|
7173 | }
|
7174 | };
|
7175 |
|
7176 | AnimateChild.prototype.render = function render() {
|
7177 | return this.props.children;
|
7178 | };
|
7179 |
|
7180 | return AnimateChild;
|
7181 | }(_react.Component);
|
7182 |
|
7183 | ;
|
7184 |
|
7185 | AnimateChild.propTypes = propTypes;
|
7186 |
|
7187 | exports["default"] = AnimateChild;
|
7188 | module.exports = exports['default'];
|
7189 |
|
7190 | }),
|
7191 |
|
7192 | (function(module, exports) {
|
7193 |
|
7194 | "use strict";
|
7195 |
|
7196 | Object.defineProperty(exports, "__esModule", {
|
7197 | value: true
|
7198 | });
|
7199 | var util = {
|
7200 | isAppearSupported: function isAppearSupported(props) {
|
7201 | return props.transitionName && props.transitionAppear || props.animation.appear;
|
7202 | },
|
7203 | isEnterSupported: function isEnterSupported(props) {
|
7204 | return props.transitionName && props.transitionEnter || props.animation.enter;
|
7205 | },
|
7206 | isLeaveSupported: function isLeaveSupported(props) {
|
7207 | return props.transitionName && props.transitionLeave || props.animation.leave;
|
7208 | },
|
7209 | allowAppearCallback: function allowAppearCallback(props) {
|
7210 | return props.transitionAppear || props.animation.appear;
|
7211 | },
|
7212 | allowEnterCallback: function allowEnterCallback(props) {
|
7213 | return props.transitionEnter || props.animation.enter;
|
7214 | },
|
7215 | allowLeaveCallback: function allowLeaveCallback(props) {
|
7216 | return props.transitionLeave || props.animation.leave;
|
7217 | }
|
7218 | };
|
7219 | exports["default"] = util;
|
7220 | module.exports = exports["default"];
|
7221 |
|
7222 | }),
|
7223 |
|
7224 | (function(module, exports, __webpack_require__) {
|
7225 |
|
7226 | 'use strict';
|
7227 |
|
7228 | Object.defineProperty(exports, "__esModule", {
|
7229 | value: true
|
7230 | });
|
7231 |
|
7232 | exports["default"] = function (componentOrElement) {
|
7233 | return (0, _ownerDocument2["default"])(_reactDom2["default"].findDOMNode(componentOrElement));
|
7234 | };
|
7235 |
|
7236 | var _reactDom = __webpack_require__(12);
|
7237 |
|
7238 | var _reactDom2 = _interopRequireDefault(_reactDom);
|
7239 |
|
7240 | var _ownerDocument = __webpack_require__(75);
|
7241 |
|
7242 | var _ownerDocument2 = _interopRequireDefault(_ownerDocument);
|
7243 |
|
7244 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
7245 |
|
7246 | module.exports = exports['default'];
|
7247 |
|
7248 | }),
|
7249 |
|
7250 | (function(module, exports) {
|
7251 |
|
7252 | "use strict";
|
7253 |
|
7254 | exports.__esModule = true;
|
7255 | exports.default = ownerDocument;
|
7256 |
|
7257 | function ownerDocument(node) {
|
7258 | return node && node.ownerDocument || document;
|
7259 | }
|
7260 |
|
7261 | module.exports = exports["default"];
|
7262 |
|
7263 | }),
|
7264 |
|
7265 | (function(module, exports, __webpack_require__) {
|
7266 |
|
7267 | 'use strict';
|
7268 |
|
7269 | Object.defineProperty(exports, "__esModule", {
|
7270 | value: true
|
7271 | });
|
7272 |
|
7273 | exports["default"] = function (node, event, handler, capture) {
|
7274 | (0, _on2["default"])(node, event, handler, capture);
|
7275 |
|
7276 | return {
|
7277 | remove: function remove() {
|
7278 | (0, _off2["default"])(node, event, handler, capture);
|
7279 | }
|
7280 | };
|
7281 | };
|
7282 |
|
7283 | var _on = __webpack_require__(16);
|
7284 |
|
7285 | var _on2 = _interopRequireDefault(_on);
|
7286 |
|
7287 | var _off = __webpack_require__(77);
|
7288 |
|
7289 | var _off2 = _interopRequireDefault(_off);
|
7290 |
|
7291 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
7292 |
|
7293 | module.exports = exports['default'];
|
7294 |
|
7295 | }),
|
7296 |
|
7297 | (function(module, exports, __webpack_require__) {
|
7298 |
|
7299 | "use strict";
|
7300 |
|
7301 | var _interopRequireDefault = __webpack_require__(14);
|
7302 |
|
7303 | exports.__esModule = true;
|
7304 | exports.default = void 0;
|
7305 |
|
7306 | var _inDOM = _interopRequireDefault(__webpack_require__(15));
|
7307 |
|
7308 | var off = function off() {};
|
7309 |
|
7310 | if (_inDOM.default) {
|
7311 | off = function () {
|
7312 | if (document.addEventListener) return function (node, eventName, handler, capture) {
|
7313 | return node.removeEventListener(eventName, handler, capture || false);
|
7314 | };else if (document.attachEvent) return function (node, eventName, handler) {
|
7315 | return node.detachEvent('on' + eventName, handler);
|
7316 | };
|
7317 | }();
|
7318 | }
|
7319 |
|
7320 | var _default = off;
|
7321 | exports.default = _default;
|
7322 | module.exports = exports["default"];
|
7323 |
|
7324 | }),
|
7325 |
|
7326 | (function(module, exports, __webpack_require__) {
|
7327 |
|
7328 | 'use strict';
|
7329 |
|
7330 | Object.defineProperty(exports, "__esModule", {
|
7331 | value: true
|
7332 | });
|
7333 |
|
7334 | var _react = __webpack_require__(4);
|
7335 |
|
7336 | var _react2 = _interopRequireDefault(_react);
|
7337 |
|
7338 | var _classnames = __webpack_require__(3);
|
7339 |
|
7340 | var _classnames2 = _interopRequireDefault(_classnames);
|
7341 |
|
7342 | var _propTypes = __webpack_require__(5);
|
7343 |
|
7344 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
7345 |
|
7346 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
7347 |
|
7348 | 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; }
|
7349 |
|
7350 | 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; }
|
7351 |
|
7352 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
7353 |
|
7354 | 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; }
|
7355 |
|
7356 | 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); }
|
7357 |
|
7358 | var propTypes = {
|
7359 | duration: _propTypes2["default"].number,
|
7360 | onClose: _propTypes2["default"].func,
|
7361 | children: _propTypes2["default"].any,
|
7362 | color: _propTypes2["default"].oneOf(['info', 'success', 'danger', 'warning', 'light', 'dark', 'news', 'infolight', 'successlight', 'dangerlight', 'warninglight']),
|
7363 | title: _propTypes2["default"].any
|
7364 | };
|
7365 |
|
7366 | function noop() {}
|
7367 |
|
7368 | var defaultProps = {
|
7369 | onEnd: noop,
|
7370 | onClose: noop,
|
7371 | duration: 4.5,
|
7372 | closable: true
|
7373 | };
|
7374 |
|
7375 | var Notice = function (_React$Component) {
|
7376 | _inherits(Notice, _React$Component);
|
7377 |
|
7378 | function Notice(props) {
|
7379 | _classCallCheck(this, Notice);
|
7380 |
|
7381 | var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
|
7382 |
|
7383 | _this.clearCloseTimer = _this.clearCloseTimer.bind(_this);
|
7384 | _this.close = _this.close.bind(_this);
|
7385 | return _this;
|
7386 | }
|
7387 |
|
7388 | Notice.prototype.componentDidMount = function componentDidMount() {
|
7389 | var _this2 = this;
|
7390 |
|
7391 | if (this.props.duration) {
|
7392 | this.closeTimer = setTimeout(function () {
|
7393 | _this2.close();
|
7394 | }, this.props.duration * 1000);
|
7395 | }
|
7396 | };
|
7397 |
|
7398 | Notice.prototype.componentWillUnmount = function componentWillUnmount() {
|
7399 | this.clearCloseTimer();
|
7400 | };
|
7401 |
|
7402 | Notice.prototype.clearCloseTimer = function clearCloseTimer() {
|
7403 | if (this.closeTimer) {
|
7404 | clearTimeout(this.closeTimer);
|
7405 | this.closeTimer = null;
|
7406 | }
|
7407 | };
|
7408 |
|
7409 | Notice.prototype.close = function close() {
|
7410 | this.clearCloseTimer();
|
7411 | this.props.onClose();
|
7412 | };
|
7413 |
|
7414 | Notice.prototype.render = function render() {
|
7415 | var _classes;
|
7416 |
|
7417 | var _props = this.props,
|
7418 | closable = _props.closable,
|
7419 | clsPrefix = _props.clsPrefix,
|
7420 | className = _props.className,
|
7421 | style = _props.style,
|
7422 | children = _props.children,
|
7423 | color = _props.color,
|
7424 | title = _props.title;
|
7425 |
|
7426 | var componentClass = clsPrefix + '-notice';
|
7427 | var classes = (_classes = {}, _defineProperty(_classes, '' + componentClass, 1), _defineProperty(_classes, componentClass + '-closable', closable), _defineProperty(_classes, className, !!className), _classes);
|
7428 | if (color) {
|
7429 | classes[componentClass + '-' + color] = true;
|
7430 | }
|
7431 | return _react2["default"].createElement(
|
7432 | 'div',
|
7433 | { className: (0, _classnames2["default"])(classes), style: style, onClick: this.close },
|
7434 | _react2["default"].createElement(
|
7435 | 'div',
|
7436 | { className: componentClass + '-content' },
|
7437 | title && _react2["default"].createElement(
|
7438 | 'div',
|
7439 | { className: componentClass + '-title' },
|
7440 | title
|
7441 | ),
|
7442 | _react2["default"].createElement(
|
7443 | 'div',
|
7444 | { className: componentClass + '-description' },
|
7445 | children
|
7446 | )
|
7447 | ),
|
7448 | closable ? _react2["default"].createElement(
|
7449 | 'a',
|
7450 | { tabIndex: '0', onClick: this.close, className: componentClass + '-close' },
|
7451 | _react2["default"].createElement('span', { className: componentClass + '-close-x' })
|
7452 | ) : null
|
7453 | );
|
7454 | };
|
7455 |
|
7456 | return Notice;
|
7457 | }(_react2["default"].Component);
|
7458 |
|
7459 | ;
|
7460 |
|
7461 | Notice.propTypes = propTypes;
|
7462 | Notice.defaultProps = defaultProps;
|
7463 |
|
7464 | exports["default"] = Notice;
|
7465 | module.exports = exports['default'];
|
7466 |
|
7467 | }),
|
7468 |
|
7469 | (function(module, exports, __webpack_require__) {
|
7470 |
|
7471 | 'use strict';
|
7472 |
|
7473 | var deselectCurrent = __webpack_require__(80);
|
7474 |
|
7475 | var defaultMessage = 'Copy to clipboard: #{key}, Enter';
|
7476 |
|
7477 | function format(message) {
|
7478 | var copyKey = (/mac os x/i.test(navigator.userAgent) ? '⌘' : 'Ctrl') + '+C';
|
7479 | return message.replace(/#{\s*key\s*}/g, copyKey);
|
7480 | }
|
7481 |
|
7482 | function copy(text, options) {
|
7483 | var debug, message, reselectPrevious, range, selection, mark, success = false;
|
7484 | if (!options) { options = {}; }
|
7485 | debug = options.debug || false;
|
7486 | try {
|
7487 | reselectPrevious = deselectCurrent();
|
7488 |
|
7489 | range = document.createRange();
|
7490 | selection = document.getSelection();
|
7491 |
|
7492 | mark = document.createElement('span');
|
7493 | mark.textContent = text;
|
7494 |
|
7495 | mark.style.all = 'unset';
|
7496 |
|
7497 | mark.style.position = 'fixed';
|
7498 | mark.style.top = 0;
|
7499 | mark.style.clip = 'rect(0, 0, 0, 0)';
|
7500 |
|
7501 | mark.style.whiteSpace = 'pre';
|
7502 |
|
7503 | mark.style.webkitUserSelect = 'text';
|
7504 | mark.style.MozUserSelect = 'text';
|
7505 | mark.style.msUserSelect = 'text';
|
7506 | mark.style.userSelect = 'text';
|
7507 |
|
7508 | document.body.appendChild(mark);
|
7509 |
|
7510 | range.selectNode(mark);
|
7511 | selection.addRange(range);
|
7512 |
|
7513 | var successful = document.execCommand('copy');
|
7514 | if (!successful) {
|
7515 | throw new Error('copy command was unsuccessful');
|
7516 | }
|
7517 | success = true;
|
7518 | } catch (err) {
|
7519 | debug && console.error('unable to copy using execCommand: ', err);
|
7520 | debug && console.warn('trying IE specific stuff');
|
7521 | try {
|
7522 | window.clipboardData.setData('text', text);
|
7523 | success = true;
|
7524 | } catch (err) {
|
7525 | debug && console.error('unable to copy using clipboardData: ', err);
|
7526 | debug && console.error('falling back to prompt');
|
7527 | message = format('message' in options ? options.message : defaultMessage);
|
7528 | window.prompt(message, text);
|
7529 | }
|
7530 | } finally {
|
7531 | if (selection) {
|
7532 | if (typeof selection.removeRange == 'function') {
|
7533 | selection.removeRange(range);
|
7534 | } else {
|
7535 | selection.removeAllRanges();
|
7536 | }
|
7537 | }
|
7538 |
|
7539 | if (mark) {
|
7540 | document.body.removeChild(mark);
|
7541 | }
|
7542 | reselectPrevious();
|
7543 | }
|
7544 |
|
7545 | return success;
|
7546 | }
|
7547 |
|
7548 | module.exports = copy;
|
7549 |
|
7550 |
|
7551 | }),
|
7552 |
|
7553 | (function(module, exports) {
|
7554 |
|
7555 |
|
7556 | module.exports = function () {
|
7557 | var selection = document.getSelection();
|
7558 | if (!selection.rangeCount) {
|
7559 | return function () {};
|
7560 | }
|
7561 | var active = document.activeElement;
|
7562 |
|
7563 | var ranges = [];
|
7564 | for (var i = 0; i < selection.rangeCount; i++) {
|
7565 | ranges.push(selection.getRangeAt(i));
|
7566 | }
|
7567 |
|
7568 | switch (active.tagName.toUpperCase()) {
|
7569 | case 'INPUT':
|
7570 | case 'TEXTAREA':
|
7571 | active.blur();
|
7572 | break;
|
7573 |
|
7574 | default:
|
7575 | active = null;
|
7576 | break;
|
7577 | }
|
7578 |
|
7579 | selection.removeAllRanges();
|
7580 | return function () {
|
7581 | selection.type === 'Caret' &&
|
7582 | selection.removeAllRanges();
|
7583 |
|
7584 | if (!selection.rangeCount) {
|
7585 | ranges.forEach(function(range) {
|
7586 | selection.addRange(range);
|
7587 | });
|
7588 | }
|
7589 |
|
7590 | active &&
|
7591 | active.focus();
|
7592 | };
|
7593 | };
|
7594 |
|
7595 |
|
7596 | }),
|
7597 |
|
7598 | (function(module, exports, __webpack_require__) {
|
7599 |
|
7600 | 'use strict';
|
7601 |
|
7602 | Object.defineProperty(exports, "__esModule", {
|
7603 | value: true
|
7604 | });
|
7605 |
|
7606 | 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; };
|
7607 |
|
7608 | var _classnames = __webpack_require__(3);
|
7609 |
|
7610 | var _classnames2 = _interopRequireDefault(_classnames);
|
7611 |
|
7612 | var _react = __webpack_require__(4);
|
7613 |
|
7614 | var _react2 = _interopRequireDefault(_react);
|
7615 |
|
7616 | var _propTypes = __webpack_require__(5);
|
7617 |
|
7618 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
7619 |
|
7620 | var _tinperBeeCore = __webpack_require__(27);
|
7621 |
|
7622 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
7623 |
|
7624 | 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; }
|
7625 |
|
7626 | 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; }
|
7627 |
|
7628 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
7629 |
|
7630 | 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; }
|
7631 |
|
7632 | 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); }
|
7633 |
|
7634 | var propTypes = {
|
7635 |
|
7636 | accordion: _propTypes2["default"].bool,
|
7637 |
|
7638 | activeKey: _propTypes2["default"].any,
|
7639 |
|
7640 | defaultActiveKey: _propTypes2["default"].any,
|
7641 |
|
7642 | onSelect: _propTypes2["default"].func,
|
7643 | role: _propTypes2["default"].string
|
7644 | };
|
7645 |
|
7646 | var defaultProps = {
|
7647 | accordion: false,
|
7648 | clsPrefix: 'u-panel-group'
|
7649 | };
|
7650 |
|
7651 |
|
7652 |
|
7653 | var PanelGroup = function (_React$Component) {
|
7654 | _inherits(PanelGroup, _React$Component);
|
7655 |
|
7656 | function PanelGroup(props, context) {
|
7657 | _classCallCheck(this, PanelGroup);
|
7658 |
|
7659 | var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context));
|
7660 |
|
7661 | _this.handleSelect = _this.handleSelect.bind(_this);
|
7662 |
|
7663 | _this.state = {
|
7664 | activeKey: props.defaultActiveKey
|
7665 | };
|
7666 | return _this;
|
7667 | }
|
7668 |
|
7669 | PanelGroup.prototype.handleSelect = function handleSelect(key, e) {
|
7670 | e.preventDefault();
|
7671 |
|
7672 | if (this.props.onSelect) {
|
7673 | this.props.onSelect(key, e);
|
7674 | }
|
7675 |
|
7676 | if (this.state.activeKey === key) {
|
7677 | key = null;
|
7678 | }
|
7679 |
|
7680 | this.setState({ activeKey: key });
|
7681 | };
|
7682 |
|
7683 | PanelGroup.prototype.render = function render() {
|
7684 | var _this2 = this;
|
7685 |
|
7686 | var _props = this.props,
|
7687 | accordion = _props.accordion,
|
7688 | propsActiveKey = _props.activeKey,
|
7689 | className = _props.className,
|
7690 | children = _props.children,
|
7691 | defaultActiveKey = _props.defaultActiveKey,
|
7692 | onSelect = _props.onSelect,
|
7693 | style = _props.style,
|
7694 | clsPrefix = _props.clsPrefix,
|
7695 | others = _objectWithoutProperties(_props, ['accordion', 'activeKey', 'className', 'children', 'defaultActiveKey', 'onSelect', 'style', 'clsPrefix']);
|
7696 |
|
7697 | var activeKey = void 0;
|
7698 | if (accordion) {
|
7699 | activeKey = propsActiveKey != null ? propsActiveKey : this.state.activeKey;
|
7700 | others.role = others.role || 'tablist';
|
7701 | }
|
7702 |
|
7703 | var classes = {};
|
7704 | classes['' + clsPrefix] = true;
|
7705 |
|
7706 | return _react2["default"].createElement(
|
7707 | 'div',
|
7708 | _extends({}, others, {
|
7709 | className: (0, _classnames2["default"])(className, classes)
|
7710 | }),
|
7711 | _react2["default"].Children.map(children, function (child) {
|
7712 | if (!_react2["default"].isValidElement(child)) {
|
7713 | return child;
|
7714 | }
|
7715 | var childProps = {
|
7716 | style: child.props.style
|
7717 | };
|
7718 |
|
7719 | if (accordion) {
|
7720 | _extends(childProps, {
|
7721 | headerRole: 'tab',
|
7722 | panelRole: 'tabpanel',
|
7723 | collapsible: true,
|
7724 | expanded: child.props.eventKey === activeKey,
|
7725 | onSelect: (0, _tinperBeeCore.createChainedFunction)(_this2.handleSelect, child.props.onSelect)
|
7726 | });
|
7727 | }
|
7728 |
|
7729 | return (0, _react.cloneElement)(child, childProps);
|
7730 | })
|
7731 | );
|
7732 | };
|
7733 |
|
7734 | return PanelGroup;
|
7735 | }(_react2["default"].Component);
|
7736 |
|
7737 | PanelGroup.propTypes = propTypes;
|
7738 | PanelGroup.defaultProps = defaultProps;
|
7739 |
|
7740 | exports["default"] = PanelGroup;
|
7741 | module.exports = exports['default'];
|
7742 |
|
7743 | }),
|
7744 |
|
7745 | (function(module, exports, __webpack_require__) {
|
7746 |
|
7747 | 'use strict';
|
7748 |
|
7749 | Object.defineProperty(exports, "__esModule", {
|
7750 | value: true
|
7751 | });
|
7752 |
|
7753 | var _Button = __webpack_require__(83);
|
7754 |
|
7755 | var _Button2 = _interopRequireDefault(_Button);
|
7756 |
|
7757 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
7758 |
|
7759 | exports["default"] = _Button2["default"];
|
7760 | module.exports = exports['default'];
|
7761 |
|
7762 | }),
|
7763 |
|
7764 | (function(module, exports, __webpack_require__) {
|
7765 |
|
7766 | 'use strict';
|
7767 |
|
7768 | Object.defineProperty(exports, "__esModule", {
|
7769 | value: true
|
7770 | });
|
7771 |
|
7772 | 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; };
|
7773 |
|
7774 | var _react = __webpack_require__(4);
|
7775 |
|
7776 | var _react2 = _interopRequireDefault(_react);
|
7777 |
|
7778 | var _reactDom = __webpack_require__(12);
|
7779 |
|
7780 | var _reactDom2 = _interopRequireDefault(_reactDom);
|
7781 |
|
7782 | var _propTypes = __webpack_require__(5);
|
7783 |
|
7784 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
7785 |
|
7786 | var _classnames = __webpack_require__(3);
|
7787 |
|
7788 | var _classnames2 = _interopRequireDefault(_classnames);
|
7789 |
|
7790 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
7791 |
|
7792 | 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; }
|
7793 |
|
7794 | 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; }
|
7795 |
|
7796 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
7797 |
|
7798 | 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; }
|
7799 |
|
7800 | 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); }
|
7801 |
|
7802 | var propTypes = {
|
7803 | |
7804 |
|
7805 |
|
7806 | size: _propTypes2["default"].oneOf(['sm', 'xg', 'lg']),
|
7807 | |
7808 |
|
7809 |
|
7810 | style: _propTypes2["default"].object,
|
7811 | |
7812 |
|
7813 |
|
7814 | shape: _propTypes2["default"].oneOf(['block', 'round', 'border', 'squared', 'floating', 'pillRight', 'pillLeft', 'icon']),
|
7815 |
|
7816 | bordered: _propTypes2["default"].bool,
|
7817 | |
7818 |
|
7819 |
|
7820 | colors: _propTypes2["default"].oneOf(['primary', 'secondary', 'accent', 'success', 'info', 'warning', 'danger', 'dark', 'light', 'default']),
|
7821 | |
7822 |
|
7823 |
|
7824 |
|
7825 | disabled: _propTypes2["default"].bool,
|
7826 | |
7827 |
|
7828 |
|
7829 |
|
7830 | className: _propTypes2["default"].string,
|
7831 |
|
7832 | |
7833 |
|
7834 |
|
7835 |
|
7836 | htmlType: _propTypes2["default"].oneOf(['submit', 'button', 'reset']),
|
7837 | isSubmit: _propTypes2["default"].bool
|
7838 | };
|
7839 |
|
7840 | var defaultProps = {
|
7841 | disabled: false,
|
7842 | htmlType: 'button',
|
7843 | clsPrefix: 'u-button',
|
7844 | bordered: false,
|
7845 | isSubmit: false
|
7846 | };
|
7847 |
|
7848 | var sizeMap = {
|
7849 | sm: 'sm',
|
7850 | xg: 'xg',
|
7851 | lg: 'lg'
|
7852 | },
|
7853 | colorsMap = {
|
7854 | primary: 'primary',
|
7855 | secondary: 'secondary',
|
7856 | accent: 'accent',
|
7857 | success: 'success',
|
7858 | info: 'info',
|
7859 | warning: 'warning',
|
7860 | danger: 'danger',
|
7861 | dark: 'dark',
|
7862 | light: 'light'
|
7863 | },
|
7864 | shapeMap = {
|
7865 | block: 'block',
|
7866 | round: 'round',
|
7867 | border: 'border',
|
7868 | squared: 'squared',
|
7869 | floating: 'floating',
|
7870 | pillRight: 'pill-right',
|
7871 | pillLeft: 'pill-left',
|
7872 | icon: 'icon'
|
7873 | };
|
7874 |
|
7875 | var Button = function (_Component) {
|
7876 | _inherits(Button, _Component);
|
7877 |
|
7878 | function Button(props) {
|
7879 | _classCallCheck(this, Button);
|
7880 |
|
7881 | return _possibleConstructorReturn(this, _Component.call(this, props));
|
7882 | }
|
7883 |
|
7884 | Button.prototype.render = function render() {
|
7885 | var _props = this.props,
|
7886 | colors = _props.colors,
|
7887 | shape = _props.shape,
|
7888 | disabled = _props.disabled,
|
7889 | className = _props.className,
|
7890 | size = _props.size,
|
7891 | bordered = _props.bordered,
|
7892 | children = _props.children,
|
7893 | htmlType = _props.htmlType,
|
7894 | clsPrefix = _props.clsPrefix,
|
7895 | isSubmit = _props.isSubmit,
|
7896 | others = _objectWithoutProperties(_props, ['colors', 'shape', 'disabled', 'className', 'size', 'bordered', 'children', 'htmlType', 'clsPrefix', 'isSubmit']);
|
7897 |
|
7898 | var clsObj = {};
|
7899 | if (className) {
|
7900 | clsObj[className] = true;
|
7901 | }
|
7902 | if (sizeMap[size]) {
|
7903 | clsObj[clsPrefix + '-' + sizeMap[size]] = true;
|
7904 | }
|
7905 |
|
7906 | if (shapeMap[shape]) {
|
7907 | clsObj[clsPrefix + '-' + shapeMap[shape]] = true;
|
7908 | }
|
7909 | if (colorsMap[colors]) {
|
7910 | clsObj[clsPrefix + '-' + colorsMap[colors]] = true;
|
7911 | }
|
7912 |
|
7913 | var classes = (0, _classnames2["default"])(clsPrefix, clsObj);
|
7914 | return _react2["default"].createElement(
|
7915 | 'button',
|
7916 | _extends({
|
7917 | type: htmlType,
|
7918 | className: classes,
|
7919 | disabled: disabled
|
7920 | }, others),
|
7921 | this.props.children
|
7922 | );
|
7923 | };
|
7924 |
|
7925 | return Button;
|
7926 | }(_react.Component);
|
7927 |
|
7928 | Button.propTypes = propTypes;
|
7929 | Button.defaultProps = defaultProps;
|
7930 |
|
7931 | exports["default"] = Button;
|
7932 | module.exports = exports['default'];
|
7933 |
|
7934 | }),
|
7935 |
|
7936 | (function(module, exports, __webpack_require__) {
|
7937 |
|
7938 | 'use strict';
|
7939 |
|
7940 | Object.defineProperty(exports, "__esModule", {
|
7941 | value: true
|
7942 | });
|
7943 |
|
7944 | var _react = __webpack_require__(4);
|
7945 |
|
7946 | var _react2 = _interopRequireDefault(_react);
|
7947 |
|
7948 | var _src = __webpack_require__(85);
|
7949 |
|
7950 | var _src2 = _interopRequireDefault(_src);
|
7951 |
|
7952 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
7953 |
|
7954 | 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; }
|
7955 |
|
7956 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
7957 |
|
7958 | 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; }
|
7959 |
|
7960 | 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); } |
7961 |
|
7962 |
|
7963 |
|
7964 |
|
7965 | var SubMenu = _src2['default'].SubMenu;
|
7966 | var MenuItemGroup = _src2['default'].ItemGroup;
|
7967 |
|
7968 | var Demo1 = function (_Component) {
|
7969 | _inherits(Demo1, _Component);
|
7970 |
|
7971 | function Demo1(props, context) {
|
7972 | _classCallCheck(this, Demo1);
|
7973 |
|
7974 | var _this = _possibleConstructorReturn(this, _Component.call(this, props, context));
|
7975 |
|
7976 | _this.handleClick = function (e) {
|
7977 | _this.setState({
|
7978 | current: e.key
|
7979 | });
|
7980 | };
|
7981 |
|
7982 | _this.state = {
|
7983 | current: 'mail'
|
7984 | };
|
7985 | return _this;
|
7986 | }
|
7987 |
|
7988 | Demo1.prototype.render = function render() {
|
7989 | return _react2['default'].createElement(
|
7990 | _src2['default'],
|
7991 | { onClick: this.handleClick,
|
7992 | selectedKeys: [this.state.current],
|
7993 | mode: 'horizontal'
|
7994 | },
|
7995 | _react2['default'].createElement(
|
7996 | _src2['default'].Item,
|
7997 | { key: 'mail', attribute: { 'type': 'mail' } },
|
7998 | '\u7EC4\u7EC7 1'
|
7999 | ),
|
8000 | _react2['default'].createElement(
|
8001 | _src2['default'].Item,
|
8002 | { key: 'app', disabled: true },
|
8003 | '\u7EC4\u7EC7 2'
|
8004 | ),
|
8005 | _react2['default'].createElement(
|
8006 | SubMenu,
|
8007 | { title: _react2['default'].createElement(
|
8008 | 'span',
|
8009 | null,
|
8010 | '\u7EC4\u7EC7 1 - \u5B50'
|
8011 | ) },
|
8012 | _react2['default'].createElement(
|
8013 | MenuItemGroup,
|
8014 | { title: '\u7EC4 1' },
|
8015 | _react2['default'].createElement(
|
8016 | _src2['default'].Item,
|
8017 | { key: 'setting:1' },
|
8018 | '\u9009\u9879 1'
|
8019 | ),
|
8020 | _react2['default'].createElement(
|
8021 | _src2['default'].Item,
|
8022 | { key: 'setting:2' },
|
8023 | '\u9009\u9879 2'
|
8024 | )
|
8025 | ),
|
8026 | _react2['default'].createElement(
|
8027 | MenuItemGroup,
|
8028 | { title: '\u7EC4 2' },
|
8029 | _react2['default'].createElement(
|
8030 | _src2['default'].Item,
|
8031 | { key: 'setting:3' },
|
8032 | '\u9009\u9879 3'
|
8033 | ),
|
8034 | _react2['default'].createElement(
|
8035 | _src2['default'].Item,
|
8036 | { key: 'setting:4' },
|
8037 | '\u9009\u9879 4'
|
8038 | )
|
8039 | )
|
8040 | )
|
8041 | );
|
8042 | };
|
8043 |
|
8044 | return Demo1;
|
8045 | }(_react.Component);
|
8046 |
|
8047 | exports['default'] = Demo1;
|
8048 | module.exports = exports['default'];
|
8049 |
|
8050 | }),
|
8051 |
|
8052 | (function(module, exports, __webpack_require__) {
|
8053 |
|
8054 | 'use strict';
|
8055 |
|
8056 | Object.defineProperty(exports, "__esModule", {
|
8057 | value: true
|
8058 | });
|
8059 |
|
8060 | var _VerticalMenu = __webpack_require__(86);
|
8061 |
|
8062 | var _VerticalMenu2 = _interopRequireDefault(_VerticalMenu);
|
8063 |
|
8064 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
8065 |
|
8066 | exports['default'] = _VerticalMenu2['default'];
|
8067 | module.exports = exports['default'];
|
8068 |
|
8069 | }),
|
8070 |
|
8071 | (function(module, exports, __webpack_require__) {
|
8072 |
|
8073 | 'use strict';
|
8074 |
|
8075 | Object.defineProperty(exports, "__esModule", {
|
8076 | value: true
|
8077 | });
|
8078 |
|
8079 | 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; };
|
8080 |
|
8081 | var _react = __webpack_require__(4);
|
8082 |
|
8083 | var _react2 = _interopRequireDefault(_react);
|
8084 |
|
8085 | var _ExportMenu = __webpack_require__(87);
|
8086 |
|
8087 | var _ExportMenu2 = _interopRequireDefault(_ExportMenu);
|
8088 |
|
8089 | var _openAnimation = __webpack_require__(219);
|
8090 |
|
8091 | var _openAnimation2 = _interopRequireDefault(_openAnimation);
|
8092 |
|
8093 | var _warning = __webpack_require__(220);
|
8094 |
|
8095 | var _warning2 = _interopRequireDefault(_warning);
|
8096 |
|
8097 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
8098 |
|
8099 | 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; }
|
8100 |
|
8101 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
8102 |
|
8103 | 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; }
|
8104 |
|
8105 | 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); }
|
8106 |
|
8107 | var Menu = function (_React$Component) {
|
8108 | _inherits(Menu, _React$Component);
|
8109 |
|
8110 | function Menu(props) {
|
8111 | _classCallCheck(this, Menu);
|
8112 |
|
8113 | var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
|
8114 |
|
8115 | _this.handleClick = function (e) {
|
8116 | _this.setOpenKeys([]);
|
8117 |
|
8118 | var onClick = _this.props.onClick;
|
8119 | if (onClick) {
|
8120 | onClick(e);
|
8121 | }
|
8122 | };
|
8123 |
|
8124 | _this.handleOpenChange = function (openKeys) {
|
8125 | _this.setOpenKeys(openKeys);
|
8126 |
|
8127 | var onOpenChange = _this.props.onOpenChange;
|
8128 | if (onOpenChange) {
|
8129 | onOpenChange(openKeys);
|
8130 | }
|
8131 | };
|
8132 |
|
8133 | (0, _warning2['default'])(!('onOpen' in props || 'onClose' in props), '`onOpen` and `onClose` are removed, please use `onOpenChange` instead.');
|
8134 |
|
8135 | _this.state = {
|
8136 | openKeys: []
|
8137 | };
|
8138 | _this.rcMenu = {};
|
8139 | return _this;
|
8140 | }
|
8141 |
|
8142 | Menu.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
8143 | if (this.props.mode === 'inline' && nextProps.mode !== 'inline') {
|
8144 | this.switchModeFromInline = true;
|
8145 | }
|
8146 | if ('openKeys' in nextProps) {
|
8147 | this.setOpenKeys(nextProps.openKeys);
|
8148 | }
|
8149 | };
|
8150 |
|
8151 | Menu.prototype.setOpenKeys = function setOpenKeys(openKeys) {
|
8152 | if (!('openKeys' in this.props)) {
|
8153 | this.setState({ openKeys: openKeys });
|
8154 | }
|
8155 | };
|
8156 |
|
8157 | Menu.prototype.render = function render() {
|
8158 | var _this2 = this;
|
8159 |
|
8160 | var openAnimation = this.props.openAnimation || this.props.openTransitionName;
|
8161 | if (!openAnimation) {
|
8162 | switch (this.props.mode) {
|
8163 | case 'horizontal':
|
8164 | openAnimation = '';
|
8165 | break;
|
8166 | case 'vertical':
|
8167 |
|
8168 |
|
8169 | if (this.switchModeFromInline) {
|
8170 | openAnimation = _openAnimation2['default'];
|
8171 | this.switchModeFromInline = false;
|
8172 | } else {
|
8173 | openAnimation = 'zoom-big';
|
8174 | }
|
8175 | break;
|
8176 | case 'inline':
|
8177 | openAnimation = _openAnimation2['default'];
|
8178 | break;
|
8179 | default:
|
8180 | }
|
8181 | }
|
8182 |
|
8183 | var props = {};
|
8184 | var className = this.props.className + ' ' + this.props.prefixCls + '-' + this.props.theme;
|
8185 | if (this.props.mode !== 'inline') {
|
8186 |
|
8187 |
|
8188 |
|
8189 | props = {
|
8190 | openKeys: this.state.openKeys,
|
8191 | onClick: this.handleClick,
|
8192 | onOpenChange: this.handleOpenChange,
|
8193 | openTransitionName: openAnimation,
|
8194 | className: className
|
8195 | };
|
8196 | } else {
|
8197 | props = {
|
8198 | openAnimation: openAnimation,
|
8199 | className: className
|
8200 | };
|
8201 | }
|
8202 | return _react2['default'].createElement(_ExportMenu2['default'], _extends({ ref: function ref(el) {
|
8203 | return _this2.rcMenu = el;
|
8204 | } }, this.props, props));
|
8205 | };
|
8206 |
|
8207 | return Menu;
|
8208 | }(_react2['default'].Component);
|
8209 |
|
8210 | Menu.defaultProps = {
|
8211 | prefixCls: 'u-menu',
|
8212 | className: '',
|
8213 | theme: 'light'
|
8214 | };
|
8215 |
|
8216 | Menu.Divider = _ExportMenu.Divider;
|
8217 | Menu.Item = _ExportMenu.Item;
|
8218 | Menu.SubMenu = _ExportMenu.SubMenu;
|
8219 | Menu.ItemGroup = _ExportMenu.ItemGroup;
|
8220 | Menu.MenuToggle = _ExportMenu.MenuToggle;
|
8221 | Menu.SideContainer = _ExportMenu.SideContainer;
|
8222 | exports['default'] = Menu;
|
8223 | module.exports = exports['default'];
|
8224 |
|
8225 | }),
|
8226 |
|
8227 | (function(module, exports, __webpack_require__) {
|
8228 |
|
8229 | 'use strict';
|
8230 |
|
8231 | Object.defineProperty(exports, "__esModule", {
|
8232 | value: true
|
8233 | });
|
8234 | exports.MenuToggle = exports.SideContainer = exports.Divider = exports.ItemGroup = exports.MenuItemGroup = exports.MenuItem = exports.Item = exports.SubMenu = undefined;
|
8235 |
|
8236 | var _Menu = __webpack_require__(88);
|
8237 |
|
8238 | var _Menu2 = _interopRequireDefault(_Menu);
|
8239 |
|
8240 | var _SubMenu = __webpack_require__(102);
|
8241 |
|
8242 | var _SubMenu2 = _interopRequireDefault(_SubMenu);
|
8243 |
|
8244 | var _MenuItem = __webpack_require__(211);
|
8245 |
|
8246 | var _MenuItem2 = _interopRequireDefault(_MenuItem);
|
8247 |
|
8248 | var _MenuItemGroup = __webpack_require__(215);
|
8249 |
|
8250 | var _MenuItemGroup2 = _interopRequireDefault(_MenuItemGroup);
|
8251 |
|
8252 | var _Divider = __webpack_require__(216);
|
8253 |
|
8254 | var _Divider2 = _interopRequireDefault(_Divider);
|
8255 |
|
8256 | var _SideContainer = __webpack_require__(217);
|
8257 |
|
8258 | var _SideContainer2 = _interopRequireDefault(_SideContainer);
|
8259 |
|
8260 | var _MenuToggle = __webpack_require__(218);
|
8261 |
|
8262 | var _MenuToggle2 = _interopRequireDefault(_MenuToggle);
|
8263 |
|
8264 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
8265 |
|
8266 | exports.SubMenu = _SubMenu2['default'];
|
8267 | exports.Item = _MenuItem2['default'];
|
8268 | exports.MenuItem = _MenuItem2['default'];
|
8269 | exports.MenuItemGroup = _MenuItemGroup2['default'];
|
8270 | exports.ItemGroup = _MenuItemGroup2['default'];
|
8271 | exports.Divider = _Divider2['default'];
|
8272 | exports.SideContainer = _SideContainer2['default'];
|
8273 | exports.MenuToggle = _MenuToggle2['default'];
|
8274 | exports['default'] = _Menu2['default'];
|
8275 |
|
8276 | }),
|
8277 |
|
8278 | (function(module, exports, __webpack_require__) {
|
8279 |
|
8280 | 'use strict';
|
8281 |
|
8282 | Object.defineProperty(exports, "__esModule", {
|
8283 | value: true
|
8284 | });
|
8285 |
|
8286 | 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; };
|
8287 |
|
8288 | var _react = __webpack_require__(4);
|
8289 |
|
8290 | var _react2 = _interopRequireDefault(_react);
|
8291 |
|
8292 | var _reactDom = __webpack_require__(12);
|
8293 |
|
8294 | var _reactDom2 = _interopRequireDefault(_reactDom);
|
8295 |
|
8296 | var _propTypes = __webpack_require__(5);
|
8297 |
|
8298 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
8299 |
|
8300 | var _miniStore = __webpack_require__(89);
|
8301 |
|
8302 | var _SubPopupMenu = __webpack_require__(97);
|
8303 |
|
8304 | var _SubPopupMenu2 = _interopRequireDefault(_SubPopupMenu);
|
8305 |
|
8306 | var _util = __webpack_require__(99);
|
8307 |
|
8308 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
8309 |
|
8310 | 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; }
|
8311 |
|
8312 | 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; }
|
8313 |
|
8314 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
8315 |
|
8316 | 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; }
|
8317 |
|
8318 | 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); }
|
8319 |
|
8320 | var Menu = function (_React$Component) {
|
8321 | _inherits(Menu, _React$Component);
|
8322 |
|
8323 | function Menu(props) {
|
8324 | _classCallCheck(this, Menu);
|
8325 |
|
8326 | var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
|
8327 |
|
8328 | _initialiseProps.call(_this);
|
8329 |
|
8330 | _this.isRootMenu = true;
|
8331 |
|
8332 | var selectedKeys = props.defaultSelectedKeys;
|
8333 | var openKeys = props.defaultOpenKeys;
|
8334 | if ('selectedKeys' in props) {
|
8335 | selectedKeys = props.selectedKeys || [];
|
8336 | }
|
8337 | if ('openKeys' in props) {
|
8338 | openKeys = props.openKeys || [];
|
8339 | }
|
8340 |
|
8341 | _this.store = (0, _miniStore.create)({
|
8342 | selectedKeys: selectedKeys,
|
8343 | openKeys: openKeys,
|
8344 | activeKey: { '0-menu-': (0, _SubPopupMenu.getActiveKey)(props, props.activeKey) }
|
8345 | });
|
8346 | return _this;
|
8347 | }
|
8348 |
|
8349 | Menu.prototype.componentDidMount = function componentDidMount() {
|
8350 | this.updateMiniStore();
|
8351 | };
|
8352 |
|
8353 | Menu.prototype.componentDidUpdate = function componentDidUpdate() {
|
8354 | this.updateMiniStore();
|
8355 | };
|
8356 |
|
8357 |
|
8358 |
|
8359 |
|
8360 |
|
8361 |
|
8362 | Menu.prototype.updateMiniStore = function updateMiniStore() {
|
8363 | if ('selectedKeys' in this.props) {
|
8364 | this.store.setState({
|
8365 | selectedKeys: this.props.selectedKeys || [],
|
8366 | keyboard: this.props.keyboard || false
|
8367 | });
|
8368 | }
|
8369 | if ('openKeys' in this.props) {
|
8370 | this.store.setState({
|
8371 | openKeys: this.props.openKeys || [],
|
8372 | keyboard: this.props.keyboard || false
|
8373 | });
|
8374 | }
|
8375 | };
|
8376 |
|
8377 | Menu.prototype.render = function render() {
|
8378 | var _this2 = this;
|
8379 |
|
8380 | var props = _objectWithoutProperties(this.props, []);
|
8381 |
|
8382 | props.className += ' ' + props.prefixCls + '-root';
|
8383 | props = _extends({}, props, {
|
8384 | onClick: this.onClick,
|
8385 | onOpenChange: this.onOpenChange,
|
8386 | onDeselect: this.onDeselect,
|
8387 | onSelect: this.onSelect,
|
8388 | openTransitionName: this.getOpenTransitionName(),
|
8389 | parentMenu: this
|
8390 | });
|
8391 | return _react2['default'].createElement(
|
8392 | _miniStore.Provider,
|
8393 | { store: this.store },
|
8394 | _react2['default'].createElement(
|
8395 | _SubPopupMenu2['default'],
|
8396 | _extends({}, props, { tabIndex: '0', onFocus: this.focus, ref: function ref(c) {
|
8397 | return _this2.innerMenu = c;
|
8398 | } }),
|
8399 | this.props.children
|
8400 | )
|
8401 | );
|
8402 | };
|
8403 |
|
8404 | return Menu;
|
8405 | }(_react2['default'].Component);
|
8406 |
|
8407 | Menu.propTypes = {
|
8408 | defaultSelectedKeys: _propTypes2['default'].arrayOf(_propTypes2['default'].string),
|
8409 | defaultActiveFirst: _propTypes2['default'].bool,
|
8410 | selectedKeys: _propTypes2['default'].arrayOf(_propTypes2['default'].string),
|
8411 | defaultOpenKeys: _propTypes2['default'].arrayOf(_propTypes2['default'].string),
|
8412 | openKeys: _propTypes2['default'].arrayOf(_propTypes2['default'].string),
|
8413 | mode: _propTypes2['default'].oneOf(['horizontal', 'vertical', 'vertical-left', 'vertical-right', 'inline']),
|
8414 | getPopupContainer: _propTypes2['default'].func,
|
8415 | onClick: _propTypes2['default'].func,
|
8416 | onSelect: _propTypes2['default'].func,
|
8417 | onDeselect: _propTypes2['default'].func,
|
8418 | onDestroy: _propTypes2['default'].func,
|
8419 | openTransitionName: _propTypes2['default'].string,
|
8420 | openAnimation: _propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].object]),
|
8421 | subMenuOpenDelay: _propTypes2['default'].number,
|
8422 | subMenuCloseDelay: _propTypes2['default'].number,
|
8423 | forceSubMenuRender: _propTypes2['default'].bool,
|
8424 | triggerSubMenuAction: _propTypes2['default'].string,
|
8425 | level: _propTypes2['default'].number,
|
8426 | selectable: _propTypes2['default'].bool,
|
8427 | multiple: _propTypes2['default'].bool,
|
8428 | children: _propTypes2['default'].any,
|
8429 | className: _propTypes2['default'].string,
|
8430 | style: _propTypes2['default'].object,
|
8431 | activeKey: _propTypes2['default'].string,
|
8432 | prefixCls: _propTypes2['default'].string,
|
8433 | builtinPlacements: _propTypes2['default'].object,
|
8434 | itemIcon: _propTypes2['default'].oneOfType([_propTypes2['default'].func, _propTypes2['default'].node]),
|
8435 | expandIcon: _propTypes2['default'].oneOfType([_propTypes2['default'].func, _propTypes2['default'].node]),
|
8436 | overflowedIndicator: _propTypes2['default'].node,
|
8437 | keyboard: _propTypes2['default'].bool
|
8438 | };
|
8439 | Menu.defaultProps = {
|
8440 | selectable: true,
|
8441 | onClick: _util.noop,
|
8442 | onSelect: _util.noop,
|
8443 | onOpenChange: _util.noop,
|
8444 | onDeselect: _util.noop,
|
8445 | defaultSelectedKeys: [],
|
8446 | defaultOpenKeys: [],
|
8447 | subMenuOpenDelay: 0.1,
|
8448 | subMenuCloseDelay: 0.1,
|
8449 | triggerSubMenuAction: 'hover',
|
8450 | prefixCls: 'rc-menu',
|
8451 | className: '',
|
8452 | mode: 'vertical',
|
8453 | style: {},
|
8454 | builtinPlacements: {},
|
8455 | overflowedIndicator: _react2['default'].createElement(
|
8456 | 'span',
|
8457 | null,
|
8458 | '\xB7\xB7\xB7'
|
8459 | ),
|
8460 | keyboard: false
|
8461 | };
|
8462 |
|
8463 | var _initialiseProps = function _initialiseProps() {
|
8464 | var _this3 = this;
|
8465 |
|
8466 | this.onSelect = function (selectInfo) {
|
8467 | var props = _this3.props;
|
8468 | if (props.selectable) {
|
8469 |
|
8470 | var selectedKeys = _this3.store.getState().selectedKeys;
|
8471 | var selectedKey = selectInfo.key;
|
8472 | if (props.multiple) {
|
8473 | selectedKeys = selectedKeys.concat([selectedKey]);
|
8474 | } else {
|
8475 | selectedKeys = [selectedKey];
|
8476 | }
|
8477 | if (!('selectedKeys' in props)) {
|
8478 | _this3.store.setState({
|
8479 | selectedKeys: selectedKeys
|
8480 | });
|
8481 | }
|
8482 | props.onSelect(_extends({}, selectInfo, {
|
8483 | selectedKeys: selectedKeys
|
8484 | }));
|
8485 | }
|
8486 | };
|
8487 |
|
8488 | this.onClick = function (e) {
|
8489 | _this3.props.onClick(e);
|
8490 | };
|
8491 |
|
8492 | this.onKeyDown = function (e, callback) {
|
8493 | _this3.innerMenu.getWrappedInstance().onKeyDown(e, callback);
|
8494 | };
|
8495 |
|
8496 | this.onOpenChange = function (event) {
|
8497 | var props = _this3.props;
|
8498 | var openKeys = _this3.store.getState().openKeys.concat();
|
8499 | var changed = false;
|
8500 | var processSingle = function processSingle(e) {
|
8501 | var oneChanged = false;
|
8502 | if (e.open) {
|
8503 | oneChanged = openKeys.indexOf(e.key) === -1;
|
8504 | if (oneChanged) {
|
8505 | openKeys.push(e.key);
|
8506 | }
|
8507 | } else {
|
8508 | var index = openKeys.indexOf(e.key);
|
8509 | oneChanged = index !== -1;
|
8510 | if (oneChanged) {
|
8511 | openKeys.splice(index, 1);
|
8512 | }
|
8513 | }
|
8514 | changed = changed || oneChanged;
|
8515 | };
|
8516 | if (Array.isArray(event)) {
|
8517 |
|
8518 | event.forEach(processSingle);
|
8519 | } else {
|
8520 | processSingle(event);
|
8521 | }
|
8522 | if (changed) {
|
8523 | if (!('openKeys' in _this3.props)) {
|
8524 | _this3.store.setState({ openKeys: openKeys });
|
8525 | }
|
8526 | props.onOpenChange(openKeys);
|
8527 | }
|
8528 | };
|
8529 |
|
8530 | this.onDeselect = function (selectInfo) {
|
8531 | var props = _this3.props;
|
8532 | if (props.selectable) {
|
8533 | var selectedKeys = _this3.store.getState().selectedKeys.concat();
|
8534 | var selectedKey = selectInfo.key;
|
8535 | var index = selectedKeys.indexOf(selectedKey);
|
8536 | if (index !== -1) {
|
8537 | selectedKeys.splice(index, 1);
|
8538 | }
|
8539 | if (!('selectedKeys' in props)) {
|
8540 | _this3.store.setState({
|
8541 | selectedKeys: selectedKeys
|
8542 | });
|
8543 | }
|
8544 | props.onDeselect(_extends({}, selectInfo, {
|
8545 | selectedKeys: selectedKeys
|
8546 | }));
|
8547 | }
|
8548 | };
|
8549 |
|
8550 | this.getOpenTransitionName = function () {
|
8551 | var props = _this3.props;
|
8552 | var transitionName = props.openTransitionName;
|
8553 | var animationName = props.openAnimation;
|
8554 | if (!transitionName && typeof animationName === 'string') {
|
8555 | transitionName = props.prefixCls + '-open-' + animationName;
|
8556 | }
|
8557 | return transitionName;
|
8558 | };
|
8559 |
|
8560 | this.focus = function () {
|
8561 | (0, _util.fireKeyEvent)(_reactDom2['default'].findDOMNode(_this3.innerMenu), 'keydown', 40);
|
8562 | _this3.props.onFocus && _this3.props.onFocus();
|
8563 | };
|
8564 | };
|
8565 |
|
8566 | exports['default'] = Menu;
|
8567 | module.exports = exports['default'];
|
8568 |
|
8569 | }),
|
8570 |
|
8571 | (function(module, exports, __webpack_require__) {
|
8572 |
|
8573 | 'use strict';
|
8574 |
|
8575 | Object.defineProperty(exports, "__esModule", {
|
8576 | value: true
|
8577 | });
|
8578 | exports.create = exports.connect = exports.Provider = undefined;
|
8579 |
|
8580 | var _Provider2 = __webpack_require__(90);
|
8581 |
|
8582 | var _Provider3 = _interopRequireDefault(_Provider2);
|
8583 |
|
8584 | var _connect2 = __webpack_require__(92);
|
8585 |
|
8586 | var _connect3 = _interopRequireDefault(_connect2);
|
8587 |
|
8588 | var _create2 = __webpack_require__(96);
|
8589 |
|
8590 | var _create3 = _interopRequireDefault(_create2);
|
8591 |
|
8592 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
8593 |
|
8594 | exports.Provider = _Provider3.default;
|
8595 | exports.connect = _connect3.default;
|
8596 | exports.create = _create3.default;
|
8597 |
|
8598 | }),
|
8599 |
|
8600 | (function(module, exports, __webpack_require__) {
|
8601 |
|
8602 | 'use strict';
|
8603 |
|
8604 | Object.defineProperty(exports, "__esModule", {
|
8605 | value: true
|
8606 | });
|
8607 |
|
8608 | 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; }; }();
|
8609 |
|
8610 | var _react = __webpack_require__(4);
|
8611 |
|
8612 | var _react2 = _interopRequireDefault(_react);
|
8613 |
|
8614 | var _PropTypes = __webpack_require__(91);
|
8615 |
|
8616 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
8617 |
|
8618 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
8619 |
|
8620 | 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; }
|
8621 |
|
8622 | 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; }
|
8623 |
|
8624 | var Provider = function (_Component) {
|
8625 | _inherits(Provider, _Component);
|
8626 |
|
8627 | function Provider() {
|
8628 | _classCallCheck(this, Provider);
|
8629 |
|
8630 | return _possibleConstructorReturn(this, (Provider.__proto__ || Object.getPrototypeOf(Provider)).apply(this, arguments));
|
8631 | }
|
8632 |
|
8633 | _createClass(Provider, [{
|
8634 | key: 'getChildContext',
|
8635 | value: function getChildContext() {
|
8636 | return {
|
8637 | miniStore: this.props.store
|
8638 | };
|
8639 | }
|
8640 | }, {
|
8641 | key: 'render',
|
8642 | value: function render() {
|
8643 | return _react.Children.only(this.props.children);
|
8644 | }
|
8645 | }]);
|
8646 |
|
8647 | return Provider;
|
8648 | }(_react.Component);
|
8649 |
|
8650 | Provider.propTypes = {
|
8651 | store: _PropTypes.storeShape.isRequired
|
8652 | };
|
8653 | Provider.childContextTypes = {
|
8654 | miniStore: _PropTypes.storeShape.isRequired
|
8655 | };
|
8656 | exports.default = Provider;
|
8657 |
|
8658 | }),
|
8659 |
|
8660 | (function(module, exports, __webpack_require__) {
|
8661 |
|
8662 | 'use strict';
|
8663 |
|
8664 | Object.defineProperty(exports, "__esModule", {
|
8665 | value: true
|
8666 | });
|
8667 | exports.storeShape = undefined;
|
8668 |
|
8669 | var _propTypes = __webpack_require__(5);
|
8670 |
|
8671 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
8672 |
|
8673 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
8674 |
|
8675 | var storeShape = exports.storeShape = _propTypes2.default.shape({
|
8676 | subscribe: _propTypes2.default.func.isRequired,
|
8677 | setState: _propTypes2.default.func.isRequired,
|
8678 | getState: _propTypes2.default.func.isRequired
|
8679 | });
|
8680 |
|
8681 | }),
|
8682 |
|
8683 | (function(module, exports, __webpack_require__) {
|
8684 |
|
8685 | 'use strict';
|
8686 |
|
8687 | Object.defineProperty(exports, "__esModule", {
|
8688 | value: true
|
8689 | });
|
8690 |
|
8691 | 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; };
|
8692 |
|
8693 | 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; }; }();
|
8694 |
|
8695 | exports.default = connect;
|
8696 |
|
8697 | var _react = __webpack_require__(4);
|
8698 |
|
8699 | var _react2 = _interopRequireDefault(_react);
|
8700 |
|
8701 | var _shallowequal = __webpack_require__(93);
|
8702 |
|
8703 | var _shallowequal2 = _interopRequireDefault(_shallowequal);
|
8704 |
|
8705 | var _hoistNonReactStatics = __webpack_require__(94);
|
8706 |
|
8707 | var _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics);
|
8708 |
|
8709 | var _reactLifecyclesCompat = __webpack_require__(95);
|
8710 |
|
8711 | var _PropTypes = __webpack_require__(91);
|
8712 |
|
8713 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
8714 |
|
8715 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
8716 |
|
8717 | 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; }
|
8718 |
|
8719 | 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; }
|
8720 |
|
8721 | function getDisplayName(WrappedComponent) {
|
8722 | return WrappedComponent.displayName || WrappedComponent.name || 'Component';
|
8723 | }
|
8724 |
|
8725 | function isStateless(Component) {
|
8726 | return !Component.prototype.render;
|
8727 | }
|
8728 |
|
8729 | var defaultMapStateToProps = function defaultMapStateToProps() {
|
8730 | return {};
|
8731 | };
|
8732 |
|
8733 | function connect(mapStateToProps) {
|
8734 | var shouldSubscribe = !!mapStateToProps;
|
8735 | var finnalMapStateToProps = mapStateToProps || defaultMapStateToProps;
|
8736 |
|
8737 | return function wrapWithConnect(WrappedComponent) {
|
8738 | var Connect = function (_Component) {
|
8739 | _inherits(Connect, _Component);
|
8740 |
|
8741 | _createClass(Connect, null, [{
|
8742 | key: 'getDerivedStateFromProps',
|
8743 | value: function getDerivedStateFromProps(props, prevState) {
|
8744 |
|
8745 | if (mapStateToProps && mapStateToProps.length === 2 && props !== prevState.props) {
|
8746 | return {
|
8747 | subscribed: finnalMapStateToProps(prevState.store.getState(), props),
|
8748 | props: props
|
8749 | };
|
8750 | }
|
8751 | return { props: props };
|
8752 | }
|
8753 | }]);
|
8754 |
|
8755 | function Connect(props, context) {
|
8756 | _classCallCheck(this, Connect);
|
8757 |
|
8758 | var _this = _possibleConstructorReturn(this, (Connect.__proto__ || Object.getPrototypeOf(Connect)).call(this, props, context));
|
8759 |
|
8760 | _this.handleChange = function () {
|
8761 | if (!_this.unsubscribe) {
|
8762 | return;
|
8763 | }
|
8764 | var nextState = finnalMapStateToProps(_this.store.getState(), _this.props);
|
8765 | _this.setState({ subscribed: nextState });
|
8766 | };
|
8767 |
|
8768 | _this.store = context.miniStore;
|
8769 | _this.state = {
|
8770 | subscribed: finnalMapStateToProps(_this.store.getState(), props),
|
8771 | store: _this.store,
|
8772 | props: props
|
8773 | };
|
8774 | return _this;
|
8775 | }
|
8776 |
|
8777 | _createClass(Connect, [{
|
8778 | key: 'componentDidMount',
|
8779 | value: function componentDidMount() {
|
8780 | this.trySubscribe();
|
8781 | }
|
8782 | }, {
|
8783 | key: 'componentWillUnmount',
|
8784 | value: function componentWillUnmount() {
|
8785 | this.tryUnsubscribe();
|
8786 | }
|
8787 | }, {
|
8788 | key: 'shouldComponentUpdate',
|
8789 | value: function shouldComponentUpdate(nextProps, nextState) {
|
8790 | return !(0, _shallowequal2.default)(this.props, nextProps) || !(0, _shallowequal2.default)(this.state.subscribed, nextState.subscribed);
|
8791 | }
|
8792 | }, {
|
8793 | key: 'trySubscribe',
|
8794 | value: function trySubscribe() {
|
8795 | if (shouldSubscribe) {
|
8796 | this.unsubscribe = this.store.subscribe(this.handleChange);
|
8797 | this.handleChange();
|
8798 | }
|
8799 | }
|
8800 | }, {
|
8801 | key: 'tryUnsubscribe',
|
8802 | value: function tryUnsubscribe() {
|
8803 | if (this.unsubscribe) {
|
8804 | this.unsubscribe();
|
8805 | this.unsubscribe = null;
|
8806 | }
|
8807 | }
|
8808 | }, {
|
8809 | key: 'getWrappedInstance',
|
8810 | value: function getWrappedInstance() {
|
8811 | return this.wrappedInstance;
|
8812 | }
|
8813 | }, {
|
8814 | key: 'render',
|
8815 | value: function render() {
|
8816 | var _this2 = this;
|
8817 |
|
8818 | var props = _extends({}, this.props, this.state.subscribed, {
|
8819 | store: this.store
|
8820 | });
|
8821 |
|
8822 | if (!isStateless(WrappedComponent)) {
|
8823 | props = _extends({}, props, {
|
8824 | ref: function ref(c) {
|
8825 | return _this2.wrappedInstance = c;
|
8826 | }
|
8827 | });
|
8828 | }
|
8829 |
|
8830 | return _react2.default.createElement(WrappedComponent, props);
|
8831 | }
|
8832 | }]);
|
8833 |
|
8834 | return Connect;
|
8835 | }(_react.Component);
|
8836 |
|
8837 | Connect.displayName = 'Connect(' + getDisplayName(WrappedComponent) + ')';
|
8838 | Connect.contextTypes = {
|
8839 | miniStore: _PropTypes.storeShape.isRequired
|
8840 | };
|
8841 |
|
8842 |
|
8843 | (0, _reactLifecyclesCompat.polyfill)(Connect);
|
8844 |
|
8845 | return (0, _hoistNonReactStatics2.default)(Connect, WrappedComponent);
|
8846 | };
|
8847 | }
|
8848 |
|
8849 | }),
|
8850 |
|
8851 | (function(module, exports) {
|
8852 |
|
8853 |
|
8854 |
|
8855 | module.exports = function shallowEqual(objA, objB, compare, compareContext) {
|
8856 | var ret = compare ? compare.call(compareContext, objA, objB) : void 0;
|
8857 |
|
8858 | if (ret !== void 0) {
|
8859 | return !!ret;
|
8860 | }
|
8861 |
|
8862 | if (objA === objB) {
|
8863 | return true;
|
8864 | }
|
8865 |
|
8866 | if (typeof objA !== "object" || !objA || typeof objB !== "object" || !objB) {
|
8867 | return false;
|
8868 | }
|
8869 |
|
8870 | var keysA = Object.keys(objA);
|
8871 | var keysB = Object.keys(objB);
|
8872 |
|
8873 | if (keysA.length !== keysB.length) {
|
8874 | return false;
|
8875 | }
|
8876 |
|
8877 | var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);
|
8878 |
|
8879 |
|
8880 | for (var idx = 0; idx < keysA.length; idx++) {
|
8881 | var key = keysA[idx];
|
8882 |
|
8883 | if (!bHasOwnProperty(key)) {
|
8884 | return false;
|
8885 | }
|
8886 |
|
8887 | var valueA = objA[key];
|
8888 | var valueB = objB[key];
|
8889 |
|
8890 | ret = compare ? compare.call(compareContext, valueA, valueB, key) : void 0;
|
8891 |
|
8892 | if (ret === false || (ret === void 0 && valueA !== valueB)) {
|
8893 | return false;
|
8894 | }
|
8895 | }
|
8896 |
|
8897 | return true;
|
8898 | };
|
8899 |
|
8900 |
|
8901 | }),
|
8902 |
|
8903 | (function(module, exports) {
|
8904 |
|
8905 | 'use strict';
|
8906 |
|
8907 | |
8908 |
|
8909 |
|
8910 |
|
8911 | var REACT_STATICS = {
|
8912 | childContextTypes: true,
|
8913 | contextTypes: true,
|
8914 | defaultProps: true,
|
8915 | displayName: true,
|
8916 | getDefaultProps: true,
|
8917 | getDerivedStateFromProps: true,
|
8918 | mixins: true,
|
8919 | propTypes: true,
|
8920 | type: true
|
8921 | };
|
8922 |
|
8923 | var KNOWN_STATICS = {
|
8924 | name: true,
|
8925 | length: true,
|
8926 | prototype: true,
|
8927 | caller: true,
|
8928 | callee: true,
|
8929 | arguments: true,
|
8930 | arity: true
|
8931 | };
|
8932 |
|
8933 | var defineProperty = Object.defineProperty;
|
8934 | var getOwnPropertyNames = Object.getOwnPropertyNames;
|
8935 | var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
8936 | var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
8937 | var getPrototypeOf = Object.getPrototypeOf;
|
8938 | var objectPrototype = getPrototypeOf && getPrototypeOf(Object);
|
8939 |
|
8940 | function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
|
8941 | if (typeof sourceComponent !== 'string') {
|
8942 |
|
8943 | if (objectPrototype) {
|
8944 | var inheritedComponent = getPrototypeOf(sourceComponent);
|
8945 | if (inheritedComponent && inheritedComponent !== objectPrototype) {
|
8946 | hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
|
8947 | }
|
8948 | }
|
8949 |
|
8950 | var keys = getOwnPropertyNames(sourceComponent);
|
8951 |
|
8952 | if (getOwnPropertySymbols) {
|
8953 | keys = keys.concat(getOwnPropertySymbols(sourceComponent));
|
8954 | }
|
8955 |
|
8956 | for (var i = 0; i < keys.length; ++i) {
|
8957 | var key = keys[i];
|
8958 | if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) {
|
8959 | var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
|
8960 | try {
|
8961 | defineProperty(targetComponent, key, descriptor);
|
8962 | } catch (e) {}
|
8963 | }
|
8964 | }
|
8965 |
|
8966 | return targetComponent;
|
8967 | }
|
8968 |
|
8969 | return targetComponent;
|
8970 | }
|
8971 |
|
8972 | module.exports = hoistNonReactStatics;
|
8973 |
|
8974 |
|
8975 | }),
|
8976 |
|
8977 | (function(module, exports) {
|
8978 |
|
8979 | 'use strict';
|
8980 |
|
8981 | Object.defineProperty(exports, '__esModule', { value: true });
|
8982 |
|
8983 | |
8984 |
|
8985 |
|
8986 |
|
8987 |
|
8988 |
|
8989 |
|
8990 | function componentWillMount() {
|
8991 |
|
8992 | var state = this.constructor.getDerivedStateFromProps(this.props, this.state);
|
8993 | if (state !== null && state !== undefined) {
|
8994 | this.setState(state);
|
8995 | }
|
8996 | }
|
8997 |
|
8998 | function componentWillReceiveProps(nextProps) {
|
8999 |
|
9000 |
|
9001 | function updater(prevState) {
|
9002 | var state = this.constructor.getDerivedStateFromProps(nextProps, prevState);
|
9003 | return state !== null && state !== undefined ? state : null;
|
9004 | }
|
9005 |
|
9006 | this.setState(updater.bind(this));
|
9007 | }
|
9008 |
|
9009 | function componentWillUpdate(nextProps, nextState) {
|
9010 | try {
|
9011 | var prevProps = this.props;
|
9012 | var prevState = this.state;
|
9013 | this.props = nextProps;
|
9014 | this.state = nextState;
|
9015 | this.__reactInternalSnapshotFlag = true;
|
9016 | this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(
|
9017 | prevProps,
|
9018 | prevState
|
9019 | );
|
9020 | } finally {
|
9021 | this.props = prevProps;
|
9022 | this.state = prevState;
|
9023 | }
|
9024 | }
|
9025 |
|
9026 |
|
9027 |
|
9028 | componentWillMount.__suppressDeprecationWarning = true;
|
9029 | componentWillReceiveProps.__suppressDeprecationWarning = true;
|
9030 | componentWillUpdate.__suppressDeprecationWarning = true;
|
9031 |
|
9032 | function polyfill(Component) {
|
9033 | var prototype = Component.prototype;
|
9034 |
|
9035 | if (!prototype || !prototype.isReactComponent) {
|
9036 | throw new Error('Can only polyfill class components');
|
9037 | }
|
9038 |
|
9039 | if (
|
9040 | typeof Component.getDerivedStateFromProps !== 'function' &&
|
9041 | typeof prototype.getSnapshotBeforeUpdate !== 'function'
|
9042 | ) {
|
9043 | return Component;
|
9044 | }
|
9045 |
|
9046 |
|
9047 |
|
9048 |
|
9049 | var foundWillMountName = null;
|
9050 | var foundWillReceivePropsName = null;
|
9051 | var foundWillUpdateName = null;
|
9052 | if (typeof prototype.componentWillMount === 'function') {
|
9053 | foundWillMountName = 'componentWillMount';
|
9054 | } else if (typeof prototype.UNSAFE_componentWillMount === 'function') {
|
9055 | foundWillMountName = 'UNSAFE_componentWillMount';
|
9056 | }
|
9057 | if (typeof prototype.componentWillReceiveProps === 'function') {
|
9058 | foundWillReceivePropsName = 'componentWillReceiveProps';
|
9059 | } else if (typeof prototype.UNSAFE_componentWillReceiveProps === 'function') {
|
9060 | foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';
|
9061 | }
|
9062 | if (typeof prototype.componentWillUpdate === 'function') {
|
9063 | foundWillUpdateName = 'componentWillUpdate';
|
9064 | } else if (typeof prototype.UNSAFE_componentWillUpdate === 'function') {
|
9065 | foundWillUpdateName = 'UNSAFE_componentWillUpdate';
|
9066 | }
|
9067 | if (
|
9068 | foundWillMountName !== null ||
|
9069 | foundWillReceivePropsName !== null ||
|
9070 | foundWillUpdateName !== null
|
9071 | ) {
|
9072 | var componentName = Component.displayName || Component.name;
|
9073 | var newApiName =
|
9074 | typeof Component.getDerivedStateFromProps === 'function'
|
9075 | ? 'getDerivedStateFromProps()'
|
9076 | : 'getSnapshotBeforeUpdate()';
|
9077 |
|
9078 | throw Error(
|
9079 | 'Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' +
|
9080 | componentName +
|
9081 | ' uses ' +
|
9082 | newApiName +
|
9083 | ' but also contains the following legacy lifecycles:' +
|
9084 | (foundWillMountName !== null ? '\n ' + foundWillMountName : '') +
|
9085 | (foundWillReceivePropsName !== null
|
9086 | ? '\n ' + foundWillReceivePropsName
|
9087 | : '') +
|
9088 | (foundWillUpdateName !== null ? '\n ' + foundWillUpdateName : '') +
|
9089 | '\n\nThe above lifecycles should be removed. Learn more about this warning here:\n' +
|
9090 | 'https://fb.me/react-async-component-lifecycle-hooks'
|
9091 | );
|
9092 | }
|
9093 |
|
9094 |
|
9095 |
|
9096 |
|
9097 | if (typeof Component.getDerivedStateFromProps === 'function') {
|
9098 | prototype.componentWillMount = componentWillMount;
|
9099 | prototype.componentWillReceiveProps = componentWillReceiveProps;
|
9100 | }
|
9101 |
|
9102 |
|
9103 |
|
9104 |
|
9105 | if (typeof prototype.getSnapshotBeforeUpdate === 'function') {
|
9106 | if (typeof prototype.componentDidUpdate !== 'function') {
|
9107 | throw new Error(
|
9108 | 'Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype'
|
9109 | );
|
9110 | }
|
9111 |
|
9112 | prototype.componentWillUpdate = componentWillUpdate;
|
9113 |
|
9114 | var componentDidUpdate = prototype.componentDidUpdate;
|
9115 |
|
9116 | prototype.componentDidUpdate = function componentDidUpdatePolyfill(
|
9117 | prevProps,
|
9118 | prevState,
|
9119 | maybeSnapshot
|
9120 | ) {
|
9121 |
|
9122 |
|
9123 |
|
9124 |
|
9125 |
|
9126 |
|
9127 |
|
9128 |
|
9129 | var snapshot = this.__reactInternalSnapshotFlag
|
9130 | ? this.__reactInternalSnapshot
|
9131 | : maybeSnapshot;
|
9132 |
|
9133 | componentDidUpdate.call(this, prevProps, prevState, snapshot);
|
9134 | };
|
9135 | }
|
9136 |
|
9137 | return Component;
|
9138 | }
|
9139 |
|
9140 | exports.polyfill = polyfill;
|
9141 |
|
9142 |
|
9143 | }),
|
9144 |
|
9145 | (function(module, exports) {
|
9146 |
|
9147 | "use strict";
|
9148 |
|
9149 | Object.defineProperty(exports, "__esModule", {
|
9150 | value: true
|
9151 | });
|
9152 |
|
9153 | 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; };
|
9154 |
|
9155 | exports.default = create;
|
9156 | function create(initialState) {
|
9157 | var state = initialState;
|
9158 | var listeners = [];
|
9159 |
|
9160 | function setState(partial) {
|
9161 | state = _extends({}, state, partial);
|
9162 | for (var i = 0; i < listeners.length; i++) {
|
9163 | listeners[i]();
|
9164 | }
|
9165 | }
|
9166 |
|
9167 | function getState() {
|
9168 | return state;
|
9169 | }
|
9170 |
|
9171 | function subscribe(listener) {
|
9172 | listeners.push(listener);
|
9173 |
|
9174 | return function unsubscribe() {
|
9175 | var index = listeners.indexOf(listener);
|
9176 | listeners.splice(index, 1);
|
9177 | };
|
9178 | }
|
9179 |
|
9180 | return {
|
9181 | setState: setState,
|
9182 | getState: getState,
|
9183 | subscribe: subscribe
|
9184 | };
|
9185 | }
|
9186 |
|
9187 | }),
|
9188 |
|
9189 | (function(module, exports, __webpack_require__) {
|
9190 |
|
9191 | 'use strict';
|
9192 |
|
9193 | Object.defineProperty(exports, "__esModule", {
|
9194 | value: true
|
9195 | });
|
9196 | exports.SubPopupMenu = undefined;
|
9197 |
|
9198 | 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; };
|
9199 |
|
9200 | exports.getActiveKey = getActiveKey;
|
9201 | exports.saveRef = saveRef;
|
9202 |
|
9203 | var _react = __webpack_require__(4);
|
9204 |
|
9205 | var _react2 = _interopRequireDefault(_react);
|
9206 |
|
9207 | var _propTypes = __webpack_require__(5);
|
9208 |
|
9209 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
9210 |
|
9211 | var _miniStore = __webpack_require__(89);
|
9212 |
|
9213 | var _tinperBeeCore = __webpack_require__(27);
|
9214 |
|
9215 | var _createChainedFunction = __webpack_require__(98);
|
9216 |
|
9217 | var _createChainedFunction2 = _interopRequireDefault(_createChainedFunction);
|
9218 |
|
9219 | var _classnames = __webpack_require__(3);
|
9220 |
|
9221 | var _classnames2 = _interopRequireDefault(_classnames);
|
9222 |
|
9223 | var _util = __webpack_require__(99);
|
9224 |
|
9225 | var _DOMWrap = __webpack_require__(100);
|
9226 |
|
9227 | var _DOMWrap2 = _interopRequireDefault(_DOMWrap);
|
9228 |
|
9229 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
9230 |
|
9231 | 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; }
|
9232 |
|
9233 | 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; }
|
9234 |
|
9235 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
9236 |
|
9237 | 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; }
|
9238 |
|
9239 | 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); }
|
9240 |
|
9241 | 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; }
|
9242 |
|
9243 | function allDisabled(arr) {
|
9244 | if (!arr.length) {
|
9245 | return true;
|
9246 | }
|
9247 | return arr.every(function (c) {
|
9248 | return !!c.props.disabled;
|
9249 | });
|
9250 | }
|
9251 |
|
9252 | function updateActiveKey(store, menuId, activeKey) {
|
9253 | var state = store.getState();
|
9254 | store.setState({
|
9255 | activeKey: _extends({}, state.activeKey, _defineProperty({}, menuId, activeKey))
|
9256 | });
|
9257 | }
|
9258 |
|
9259 | function getEventKey(props) {
|
9260 |
|
9261 | return props.eventKey || '0-menu-';
|
9262 | }
|
9263 |
|
9264 | function getActiveKey(props, originalActiveKey) {
|
9265 | var activeKey = originalActiveKey;
|
9266 | var children = props.children,
|
9267 | eventKey = props.eventKey;
|
9268 |
|
9269 | if (activeKey) {
|
9270 | var found = void 0;
|
9271 | (0, _util.loopMenuItem)(children, function (c, i) {
|
9272 | if (c && !c.props.disabled && activeKey === (0, _util.getKeyFromChildrenIndex)(c, eventKey, i)) {
|
9273 | found = true;
|
9274 | }
|
9275 | });
|
9276 | if (found) {
|
9277 | return activeKey;
|
9278 | }
|
9279 | }
|
9280 | activeKey = null;
|
9281 | if (props.defaultActiveFirst) {
|
9282 | (0, _util.loopMenuItem)(children, function (c, i) {
|
9283 | if (!activeKey && c && !c.props.disabled) {
|
9284 | activeKey = (0, _util.getKeyFromChildrenIndex)(c, eventKey, i);
|
9285 | }
|
9286 | });
|
9287 | return activeKey;
|
9288 | }
|
9289 | return activeKey;
|
9290 | }
|
9291 |
|
9292 | function saveRef(c) {
|
9293 | if (c) {
|
9294 | var index = this.instanceArray.indexOf(c);
|
9295 | if (index !== -1) {
|
9296 |
|
9297 | this.instanceArray[index] = c;
|
9298 | } else {
|
9299 |
|
9300 | this.instanceArray.push(c);
|
9301 | }
|
9302 | }
|
9303 | }
|
9304 |
|
9305 | var SubPopupMenu = exports.SubPopupMenu = function (_React$Component) {
|
9306 | _inherits(SubPopupMenu, _React$Component);
|
9307 |
|
9308 | function SubPopupMenu(props) {
|
9309 | _classCallCheck(this, SubPopupMenu);
|
9310 |
|
9311 | var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
|
9312 |
|
9313 | _initialiseProps.call(_this);
|
9314 |
|
9315 | props.store.setState({
|
9316 | activeKey: _extends({}, props.store.getState().activeKey, _defineProperty({}, props.eventKey, getActiveKey(props, props.activeKey)))
|
9317 | });
|
9318 |
|
9319 | _this.instanceArray = [];
|
9320 | return _this;
|
9321 | }
|
9322 |
|
9323 | SubPopupMenu.prototype.componentDidMount = function componentDidMount() {
|
9324 |
|
9325 | if (this.props.manualRef) {
|
9326 | this.props.manualRef(this);
|
9327 | }
|
9328 | };
|
9329 |
|
9330 | SubPopupMenu.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
|
9331 | return this.props.visible || nextProps.visible;
|
9332 | };
|
9333 |
|
9334 | SubPopupMenu.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {
|
9335 | var props = this.props;
|
9336 | var originalActiveKey = 'activeKey' in props ? props.activeKey : props.store.getState().activeKey[getEventKey(props)];
|
9337 | var activeKey = getActiveKey(props, originalActiveKey);
|
9338 | if (activeKey !== originalActiveKey) {
|
9339 | updateActiveKey(props.store, getEventKey(props), activeKey);
|
9340 | } else if ('activeKey' in prevProps) {
|
9341 |
|
9342 |
|
9343 | var prevActiveKey = getActiveKey(prevProps, prevProps.activeKey);
|
9344 | if (activeKey !== prevActiveKey) {
|
9345 | updateActiveKey(props.store, getEventKey(props), activeKey);
|
9346 | }
|
9347 | }
|
9348 | };
|
9349 |
|
9350 |
|
9351 |
|
9352 |
|
9353 | SubPopupMenu.prototype.render = function render() {
|
9354 | var _this2 = this;
|
9355 |
|
9356 | var props = _objectWithoutProperties(this.props, []);
|
9357 |
|
9358 | this.instanceArray = [];
|
9359 | var className = (0, _classnames2['default'])(props.prefixCls, props.className, props.prefixCls + '-' + props.mode);
|
9360 | var domProps = {
|
9361 | className: className,
|
9362 |
|
9363 | role: props.role || 'menu'
|
9364 | };
|
9365 | if (props.id) {
|
9366 | domProps.id = props.id;
|
9367 | }
|
9368 | if (props.focusable) {
|
9369 | domProps.tabIndex = '0';
|
9370 | domProps.onKeyDown = this.onKeyDown;
|
9371 | }
|
9372 | var prefixCls = props.prefixCls,
|
9373 | eventKey = props.eventKey,
|
9374 | visible = props.visible,
|
9375 | level = props.level,
|
9376 | mode = props.mode,
|
9377 | overflowedIndicator = props.overflowedIndicator,
|
9378 | theme = props.theme;
|
9379 |
|
9380 | _util.menuAllProps.forEach(function (key) {
|
9381 | return delete props[key];
|
9382 | });
|
9383 |
|
9384 |
|
9385 | delete props.onClick;
|
9386 | delete props.keyboard;
|
9387 |
|
9388 | return (
|
9389 |
|
9390 |
|
9391 | _react2['default'].createElement(
|
9392 | _DOMWrap2['default'],
|
9393 | _extends({}, props, {
|
9394 | prefixCls: prefixCls,
|
9395 | mode: mode,
|
9396 | tag: 'ul',
|
9397 | level: level,
|
9398 | theme: theme,
|
9399 | hiddenClassName: prefixCls + '-hidden',
|
9400 | visible: visible,
|
9401 | overflowedIndicator: overflowedIndicator
|
9402 | }, domProps),
|
9403 | _react2['default'].Children.map(props.children, function (c, i) {
|
9404 | return _this2.renderMenuItem(c, i, eventKey || '0-menu-');
|
9405 | })
|
9406 | )
|
9407 |
|
9408 |
|
9409 | );
|
9410 | };
|
9411 |
|
9412 | return SubPopupMenu;
|
9413 | }(_react2['default'].Component);
|
9414 |
|
9415 | SubPopupMenu.propTypes = {
|
9416 | onSelect: _propTypes2['default'].func,
|
9417 | onClick: _propTypes2['default'].func,
|
9418 | onDeselect: _propTypes2['default'].func,
|
9419 | onOpenChange: _propTypes2['default'].func,
|
9420 | onDestroy: _propTypes2['default'].func,
|
9421 | openTransitionName: _propTypes2['default'].string,
|
9422 | openAnimation: _propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].object]),
|
9423 | openKeys: _propTypes2['default'].arrayOf(_propTypes2['default'].string),
|
9424 | visible: _propTypes2['default'].bool,
|
9425 | children: _propTypes2['default'].any,
|
9426 | parentMenu: _propTypes2['default'].object,
|
9427 | eventKey: _propTypes2['default'].string,
|
9428 | store: _propTypes2['default'].shape({
|
9429 | getState: _propTypes2['default'].func,
|
9430 | setState: _propTypes2['default'].func
|
9431 | }),
|
9432 |
|
9433 |
|
9434 | focusable: _propTypes2['default'].bool,
|
9435 | multiple: _propTypes2['default'].bool,
|
9436 | style: _propTypes2['default'].object,
|
9437 | defaultActiveFirst: _propTypes2['default'].bool,
|
9438 | activeKey: _propTypes2['default'].string,
|
9439 | selectedKeys: _propTypes2['default'].arrayOf(_propTypes2['default'].string),
|
9440 | defaultSelectedKeys: _propTypes2['default'].arrayOf(_propTypes2['default'].string),
|
9441 | defaultOpenKeys: _propTypes2['default'].arrayOf(_propTypes2['default'].string),
|
9442 | level: _propTypes2['default'].number,
|
9443 | mode: _propTypes2['default'].oneOf(['horizontal', 'vertical', 'vertical-left', 'vertical-right', 'inline']),
|
9444 | triggerSubMenuAction: _propTypes2['default'].oneOf(['click', 'hover']),
|
9445 | inlineIndent: _propTypes2['default'].oneOfType([_propTypes2['default'].number, _propTypes2['default'].string]),
|
9446 | manualRef: _propTypes2['default'].func,
|
9447 | itemIcon: _propTypes2['default'].oneOfType([_propTypes2['default'].func, _propTypes2['default'].node]),
|
9448 | expandIcon: _propTypes2['default'].oneOfType([_propTypes2['default'].func, _propTypes2['default'].node])
|
9449 | };
|
9450 | SubPopupMenu.defaultProps = {
|
9451 | prefixCls: 'rc-menu',
|
9452 | className: '',
|
9453 | mode: 'vertical',
|
9454 | level: 1,
|
9455 | inlineIndent: 24,
|
9456 | visible: true,
|
9457 | focusable: true,
|
9458 | style: {},
|
9459 | manualRef: _util.noop
|
9460 | };
|
9461 |
|
9462 | var _initialiseProps = function _initialiseProps() {
|
9463 | var _this3 = this;
|
9464 |
|
9465 | this.onKeyDown = function (e, callback) {
|
9466 | var keyCode = e.keyCode;
|
9467 | var handled = void 0;
|
9468 | _this3.getFlatInstanceArray().forEach(function (obj) {
|
9469 | if (obj && obj.props.active && obj.onKeyDown) {
|
9470 | handled = obj.onKeyDown(e);
|
9471 | }
|
9472 | });
|
9473 | if (handled) {
|
9474 | return 1;
|
9475 | }
|
9476 | var activeItem = null;
|
9477 | if (keyCode === _tinperBeeCore.KeyCode.UP || keyCode === _tinperBeeCore.KeyCode.DOWN) {
|
9478 | if (_this3.props.store.getState().keyboard) {
|
9479 |
|
9480 | activeItem = _this3.step(keyCode === _tinperBeeCore.KeyCode.UP ? -2 : 2);
|
9481 | }
|
9482 | }
|
9483 |
|
9484 | if (activeItem) {
|
9485 | e.preventDefault();
|
9486 | updateActiveKey(_this3.props.store, getEventKey(_this3.props), activeItem.props.eventKey);
|
9487 |
|
9488 | if (typeof callback === 'function') {
|
9489 | callback(activeItem);
|
9490 | }
|
9491 |
|
9492 | return 1;
|
9493 | }
|
9494 | };
|
9495 |
|
9496 | this.onItemHover = function (e) {
|
9497 | var key = e.key,
|
9498 | hover = e.hover;
|
9499 |
|
9500 | updateActiveKey(_this3.props.store, getEventKey(_this3.props), hover ? key : null);
|
9501 | };
|
9502 |
|
9503 | this.onDeselect = function (selectInfo) {
|
9504 | _this3.props.onDeselect(selectInfo);
|
9505 | };
|
9506 |
|
9507 | this.onSelect = function (selectInfo) {
|
9508 | _this3.props.onSelect(selectInfo);
|
9509 | };
|
9510 |
|
9511 | this.onClick = function (e) {
|
9512 | _this3.props.onClick(e);
|
9513 | };
|
9514 |
|
9515 | this.onOpenChange = function (e) {
|
9516 | _this3.props.onOpenChange(e);
|
9517 | };
|
9518 |
|
9519 | this.onDestroy = function (key) {
|
9520 |
|
9521 | _this3.props.onDestroy(key);
|
9522 | };
|
9523 |
|
9524 | this.getFlatInstanceArray = function () {
|
9525 | return _this3.instanceArray;
|
9526 | };
|
9527 |
|
9528 | this.getOpenTransitionName = function () {
|
9529 | return _this3.props.openTransitionName;
|
9530 | };
|
9531 |
|
9532 | this.step = function (direction) {
|
9533 | var children = _this3.getFlatInstanceArray();
|
9534 | var activeKey = _this3.props.store.getState().activeKey[getEventKey(_this3.props)];
|
9535 | var len = children.length;
|
9536 | if (!len) {
|
9537 | return null;
|
9538 | }
|
9539 | if (direction < 0) {
|
9540 | children = children.concat().reverse();
|
9541 | }
|
9542 |
|
9543 | var activeIndex = -1;
|
9544 | children.every(function (c, ci) {
|
9545 | if (c && c.props.eventKey === activeKey) {
|
9546 | activeIndex = ci;
|
9547 | return false;
|
9548 | }
|
9549 | return true;
|
9550 | });
|
9551 | if (!_this3.props.defaultActiveFirst && activeIndex !== -1 && allDisabled(children.slice(activeIndex, len - 1))) {
|
9552 | return undefined;
|
9553 | }
|
9554 | var start = (activeIndex + 1) % len;
|
9555 | var i = start;
|
9556 |
|
9557 | do {
|
9558 | var child = children[i];
|
9559 | if (!child || child.props.disabled) {
|
9560 | i = (i + 1) % len;
|
9561 | } else {
|
9562 | return child;
|
9563 | }
|
9564 | } while (i !== start);
|
9565 |
|
9566 | return null;
|
9567 | };
|
9568 |
|
9569 | this.renderCommonMenuItem = function (child, i, extraProps) {
|
9570 | var state = _this3.props.store.getState();
|
9571 | var props = _this3.props;
|
9572 | var key = (0, _util.getKeyFromChildrenIndex)(child, props.eventKey, i);
|
9573 | var childProps = child.props;
|
9574 | var isActive = key === state.activeKey;
|
9575 | var newChildProps = _extends({
|
9576 | mode: childProps.mode || props.mode,
|
9577 | level: props.level,
|
9578 | inlineIndent: props.inlineIndent,
|
9579 | renderMenuItem: _this3.renderMenuItem,
|
9580 | rootPrefixCls: props.prefixCls,
|
9581 | index: i,
|
9582 | parentMenu: props.parentMenu,
|
9583 |
|
9584 | manualRef: childProps.disabled ? undefined : (0, _createChainedFunction2['default'])(child.ref, saveRef.bind(_this3)),
|
9585 | eventKey: key,
|
9586 | active: !childProps.disabled && isActive,
|
9587 | multiple: props.multiple,
|
9588 | onClick: function onClick(e) {
|
9589 | (childProps.onClick || _util.noop)(e);
|
9590 | _this3.onClick(e);
|
9591 | },
|
9592 | onItemHover: _this3.onItemHover,
|
9593 | openTransitionName: _this3.getOpenTransitionName(),
|
9594 | openAnimation: props.openAnimation,
|
9595 | subMenuOpenDelay: props.subMenuOpenDelay,
|
9596 | subMenuCloseDelay: props.subMenuCloseDelay,
|
9597 | forceSubMenuRender: props.forceSubMenuRender,
|
9598 | onOpenChange: _this3.onOpenChange,
|
9599 | onDeselect: _this3.onDeselect,
|
9600 | onSelect: _this3.onSelect,
|
9601 | builtinPlacements: props.builtinPlacements,
|
9602 | itemIcon: childProps.itemIcon || _this3.props.itemIcon,
|
9603 | expandIcon: childProps.expandIcon || _this3.props.expandIcon
|
9604 | }, extraProps);
|
9605 | if (props.mode === 'inline') {
|
9606 | newChildProps.triggerSubMenuAction = 'click';
|
9607 | }
|
9608 | return _react2['default'].cloneElement(child, newChildProps);
|
9609 | };
|
9610 |
|
9611 | this.renderMenuItem = function (c, i, subMenuKey) {
|
9612 |
|
9613 |
|
9614 | if (!c) {
|
9615 | return null;
|
9616 | }
|
9617 | var state = _this3.props.store.getState();
|
9618 | var extraProps = {
|
9619 | openKeys: state.openKeys,
|
9620 | selectedKeys: state.selectedKeys,
|
9621 | triggerSubMenuAction: _this3.props.triggerSubMenuAction,
|
9622 | subMenuKey: subMenuKey
|
9623 | };
|
9624 | return _this3.renderCommonMenuItem(c, i, extraProps);
|
9625 | };
|
9626 | };
|
9627 |
|
9628 | var connected = (0, _miniStore.connect)()(SubPopupMenu);
|
9629 |
|
9630 | exports['default'] = connected;
|
9631 |
|
9632 | }),
|
9633 |
|
9634 | (function(module, exports) {
|
9635 |
|
9636 | "use strict";
|
9637 |
|
9638 | Object.defineProperty(exports, "__esModule", {
|
9639 | value: true
|
9640 | });
|
9641 | exports["default"] = createChainedFunction;
|
9642 | |
9643 |
|
9644 |
|
9645 |
|
9646 |
|
9647 |
|
9648 |
|
9649 |
|
9650 | function createChainedFunction() {
|
9651 | var args = [].slice.call(arguments, 0);
|
9652 | if (args.length === 1) {
|
9653 | return args[0];
|
9654 | }
|
9655 |
|
9656 | return function chainedFunction() {
|
9657 | for (var i = 0; i < args.length; i++) {
|
9658 | if (args[i] && args[i].apply) {
|
9659 | args[i].apply(this, arguments);
|
9660 | }
|
9661 | }
|
9662 | };
|
9663 | }
|
9664 | module.exports = exports['default'];
|
9665 |
|
9666 | }),
|
9667 |
|
9668 | (function(module, exports, __webpack_require__) {
|
9669 |
|
9670 | 'use strict';
|
9671 |
|
9672 | Object.defineProperty(exports, "__esModule", {
|
9673 | value: true
|
9674 | });
|
9675 | exports.setStyle = exports.getWidth = exports.menuAllProps = undefined;
|
9676 |
|
9677 | 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; };
|
9678 |
|
9679 | exports.noop = noop;
|
9680 | exports.getKeyFromChildrenIndex = getKeyFromChildrenIndex;
|
9681 | exports.getMenuIdFromSubMenuEventKey = getMenuIdFromSubMenuEventKey;
|
9682 | exports.loopMenuItem = loopMenuItem;
|
9683 | exports.loopMenuItemRecursively = loopMenuItemRecursively;
|
9684 | exports.fireKeyEvent = fireKeyEvent;
|
9685 |
|
9686 | var _react = __webpack_require__(4);
|
9687 |
|
9688 | var _react2 = _interopRequireDefault(_react);
|
9689 |
|
9690 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
9691 |
|
9692 | function noop() {}
|
9693 |
|
9694 | function getKeyFromChildrenIndex(child, menuEventKey, index) {
|
9695 | var prefix = menuEventKey || '';
|
9696 | return child.key || prefix + 'item_' + index;
|
9697 | }
|
9698 |
|
9699 | function getMenuIdFromSubMenuEventKey(eventKey) {
|
9700 | return eventKey + '-menu-';
|
9701 | }
|
9702 |
|
9703 | function loopMenuItem(children, cb) {
|
9704 | var index = -1;
|
9705 | _react2['default'].Children.forEach(children, function (c) {
|
9706 | index++;
|
9707 | if (c && c.type && c.type.isMenuItemGroup) {
|
9708 | _react2['default'].Children.forEach(c.props.children, function (c2) {
|
9709 | index++;
|
9710 | cb(c2, index);
|
9711 | });
|
9712 | } else {
|
9713 | cb(c, index);
|
9714 | }
|
9715 | });
|
9716 | }
|
9717 |
|
9718 | function loopMenuItemRecursively(children, keys, ret) {
|
9719 |
|
9720 | if (!children || ret.find) {
|
9721 | return;
|
9722 | }
|
9723 | _react2['default'].Children.forEach(children, function (c) {
|
9724 | if (c) {
|
9725 | var construct = c.type;
|
9726 | if (!construct || !(construct.isSubMenu || construct.isMenuItem || construct.isMenuItemGroup)) {
|
9727 | return;
|
9728 | }
|
9729 | if (keys.indexOf(c.key) !== -1) {
|
9730 | ret.find = true;
|
9731 | } else if (c.props.children) {
|
9732 | loopMenuItemRecursively(c.props.children, keys, ret);
|
9733 | }
|
9734 | }
|
9735 | });
|
9736 | }
|
9737 |
|
9738 | var menuAllProps = exports.menuAllProps = ['defaultSelectedKeys', 'selectedKeys', 'defaultOpenKeys', 'openKeys', 'mode', 'getPopupContainer', 'onSelect', 'onDeselect', 'onDestroy', 'openTransitionName', 'openAnimation', 'subMenuOpenDelay', 'subMenuCloseDelay', 'forceSubMenuRender', 'triggerSubMenuAction', 'level', 'selectable', 'multiple', 'onOpenChange', 'visible', 'focusable', 'defaultActiveFirst', 'prefixCls', 'inlineIndent', 'parentMenu', 'title', 'rootPrefixCls', 'eventKey', 'active', 'onItemHover', 'onTitleMouseEnter', 'onTitleMouseLeave', 'onTitleClick', 'popupAlign', 'popupOffset', 'isOpen', 'renderMenuItem', 'manualRef', 'subMenuKey', 'disabled', 'index', 'isSelected', 'store', 'activeKey', 'builtinPlacements', 'overflowedIndicator',
|
9739 |
|
9740 |
|
9741 | 'attribute', 'value', 'popupClassName', 'inlineCollapsed', 'menu', 'theme', 'itemIcon', 'expandIcon'];
|
9742 |
|
9743 | var getWidth = exports.getWidth = function getWidth(elem) {
|
9744 | return elem && typeof elem.getBoundingClientRect === 'function' && elem.getBoundingClientRect().width || 0;
|
9745 | };
|
9746 |
|
9747 | var setStyle = exports.setStyle = function setStyle(elem, styleProperty, value) {
|
9748 | if (elem && _typeof(elem.style) === 'object') {
|
9749 | elem.style[styleProperty] = value;
|
9750 | }
|
9751 | };
|
9752 |
|
9753 | function fireKeyEvent(el, evtType, keyCode) {
|
9754 | var evtObj;
|
9755 | if (document.createEvent) {
|
9756 | if (window.KeyEvent) {
|
9757 |
|
9758 | evtObj = document.createEvent('KeyEvents');
|
9759 | evtObj.initKeyEvent(evtType, true, true, window, true, false, false, false, keyCode, 0);
|
9760 | } else {
|
9761 |
|
9762 | evtObj = document.createEvent('UIEvents');
|
9763 | evtObj.initUIEvent(evtType, true, true, window, 1);
|
9764 |
|
9765 | delete evtObj.keyCode;
|
9766 | if (typeof evtObj.keyCode === "undefined") {
|
9767 |
|
9768 | Object.defineProperty(evtObj, "keyCode", { value: keyCode });
|
9769 | } else {
|
9770 | evtObj.key = String.fromCharCode(keyCode);
|
9771 | }
|
9772 |
|
9773 | if (typeof evtObj.ctrlKey === 'undefined') {
|
9774 |
|
9775 | Object.defineProperty(evtObj, "ctrlKey", { value: true });
|
9776 | } else {
|
9777 | evtObj.ctrlKey = true;
|
9778 | }
|
9779 | }
|
9780 | el.dispatchEvent(evtObj);
|
9781 | } else if (document.createEventObject) {
|
9782 |
|
9783 | evtObj = document.createEventObject();
|
9784 | evtObj.keyCode = keyCode;
|
9785 | el.fireEvent('on' + evtType, evtObj);
|
9786 | }
|
9787 | }
|
9788 |
|
9789 | }),
|
9790 |
|
9791 | (function(module, exports, __webpack_require__) {
|
9792 |
|
9793 | 'use strict';
|
9794 |
|
9795 | Object.defineProperty(exports, "__esModule", {
|
9796 | value: true
|
9797 | });
|
9798 |
|
9799 | 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; };
|
9800 |
|
9801 | var _react = __webpack_require__(4);
|
9802 |
|
9803 | var _react2 = _interopRequireDefault(_react);
|
9804 |
|
9805 | var _reactDom = __webpack_require__(12);
|
9806 |
|
9807 | var _reactDom2 = _interopRequireDefault(_reactDom);
|
9808 |
|
9809 | var _propTypes = __webpack_require__(5);
|
9810 |
|
9811 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
9812 |
|
9813 | var _resizeObserverPolyfill = __webpack_require__(101);
|
9814 |
|
9815 | var _resizeObserverPolyfill2 = _interopRequireDefault(_resizeObserverPolyfill);
|
9816 |
|
9817 | var _SubMenu = __webpack_require__(102);
|
9818 |
|
9819 | var _SubMenu2 = _interopRequireDefault(_SubMenu);
|
9820 |
|
9821 | var _util = __webpack_require__(99);
|
9822 |
|
9823 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
9824 |
|
9825 | 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; }
|
9826 |
|
9827 | function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
9828 |
|
9829 | 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; }
|
9830 |
|
9831 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
9832 |
|
9833 | 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; }
|
9834 |
|
9835 | 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); }
|
9836 |
|
9837 | var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
9838 |
|
9839 | var MENUITEM_OVERFLOWED_CLASSNAME = 'menuitem-overflowed';
|
9840 |
|
9841 |
|
9842 | if (canUseDOM) {
|
9843 | __webpack_require__(210);
|
9844 | }
|
9845 |
|
9846 | var DOMWrap = function (_React$Component) {
|
9847 | _inherits(DOMWrap, _React$Component);
|
9848 |
|
9849 | function DOMWrap() {
|
9850 | var _temp, _this, _ret;
|
9851 |
|
9852 | _classCallCheck(this, DOMWrap);
|
9853 |
|
9854 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
9855 | args[_key] = arguments[_key];
|
9856 | }
|
9857 |
|
9858 | return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {
|
9859 | lastVisibleIndex: undefined
|
9860 | }, _this.getMenuItemNodes = function () {
|
9861 | var prefixCls = _this.props.prefixCls;
|
9862 |
|
9863 | var ul = _reactDom2['default'].findDOMNode(_this);
|
9864 | if (!ul) {
|
9865 | return [];
|
9866 | }
|
9867 |
|
9868 |
|
9869 | return [].slice.call(ul.children).filter(function (node) {
|
9870 | return node.className.split(' ').indexOf(prefixCls + '-overflowed-submenu') < 0;
|
9871 | });
|
9872 | }, _this.getOverflowedSubMenuItem = function (keyPrefix, overflowedItems, renderPlaceholder) {
|
9873 | var _this$props = _this.props,
|
9874 | overflowedIndicator = _this$props.overflowedIndicator,
|
9875 | level = _this$props.level,
|
9876 | mode = _this$props.mode,
|
9877 | prefixCls = _this$props.prefixCls,
|
9878 | theme = _this$props.theme,
|
9879 | propStyle = _this$props.style;
|
9880 |
|
9881 | if (level !== 1 || mode !== 'horizontal') {
|
9882 | return null;
|
9883 | }
|
9884 |
|
9885 |
|
9886 | var copy = _this.props.children[0];
|
9887 |
|
9888 | var _copy$props = copy.props,
|
9889 | throwAway = _copy$props.children,
|
9890 | title = _copy$props.title,
|
9891 | eventKey = _copy$props.eventKey,
|
9892 | rest = _objectWithoutProperties(_copy$props, ['children', 'title', 'eventKey']);
|
9893 |
|
9894 | var style = _extends({}, propStyle);
|
9895 | var key = keyPrefix + '-overflowed-indicator';
|
9896 |
|
9897 | if (overflowedItems.length === 0 && renderPlaceholder !== true) {
|
9898 | style = _extends({}, style, {
|
9899 | display: 'none'
|
9900 | });
|
9901 | } else if (renderPlaceholder) {
|
9902 | style = _extends({}, style, {
|
9903 | visibility: 'hidden',
|
9904 |
|
9905 | position: 'absolute'
|
9906 | });
|
9907 | key = key + '-placeholder';
|
9908 | }
|
9909 |
|
9910 | var popupClassName = theme ? prefixCls + '-' + theme : '';
|
9911 | var props = {};
|
9912 | _util.menuAllProps.forEach(function (k) {
|
9913 | if (rest[k] !== undefined) {
|
9914 | props[k] = rest[k];
|
9915 | }
|
9916 | });
|
9917 |
|
9918 | return _react2['default'].createElement(
|
9919 | _SubMenu2['default'],
|
9920 | _extends({
|
9921 | title: overflowedIndicator,
|
9922 | className: prefixCls + '-overflowed-submenu',
|
9923 | popupClassName: popupClassName
|
9924 | }, props, {
|
9925 | key: key,
|
9926 | eventKey: keyPrefix + '-overflowed-indicator',
|
9927 | disabled: false,
|
9928 | style: style
|
9929 | }),
|
9930 | overflowedItems
|
9931 | );
|
9932 | }, _this.setChildrenWidthAndResize = function () {
|
9933 | if (_this.props.mode !== 'horizontal') {
|
9934 | return;
|
9935 | }
|
9936 | var ul = _reactDom2['default'].findDOMNode(_this);
|
9937 |
|
9938 | if (!ul) {
|
9939 | return;
|
9940 | }
|
9941 |
|
9942 | var ulChildrenNodes = ul.children;
|
9943 |
|
9944 | if (!ulChildrenNodes || ulChildrenNodes.length === 0) {
|
9945 | return;
|
9946 | }
|
9947 |
|
9948 | var lastOverflowedIndicatorPlaceholder = ul.children[ulChildrenNodes.length - 1];
|
9949 |
|
9950 |
|
9951 | (0, _util.setStyle)(lastOverflowedIndicatorPlaceholder, 'display', 'inline-block');
|
9952 |
|
9953 | var menuItemNodes = _this.getMenuItemNodes();
|
9954 |
|
9955 |
|
9956 |
|
9957 |
|
9958 | var overflowedItems = menuItemNodes.filter(function (c) {
|
9959 | return c.className.split(' ').indexOf(MENUITEM_OVERFLOWED_CLASSNAME) >= 0;
|
9960 | });
|
9961 |
|
9962 | overflowedItems.forEach(function (c) {
|
9963 | (0, _util.setStyle)(c, 'display', 'inline-block');
|
9964 | });
|
9965 |
|
9966 | _this.menuItemSizes = menuItemNodes.map(function (c) {
|
9967 | return (0, _util.getWidth)(c);
|
9968 | });
|
9969 |
|
9970 | overflowedItems.forEach(function (c) {
|
9971 | (0, _util.setStyle)(c, 'display', 'none');
|
9972 | });
|
9973 | _this.overflowedIndicatorWidth = (0, _util.getWidth)(ul.children[ul.children.length - 1]);
|
9974 | _this.originalTotalWidth = _this.menuItemSizes.reduce(function (acc, cur) {
|
9975 | return acc + cur;
|
9976 | }, 0);
|
9977 | _this.handleResize();
|
9978 |
|
9979 | (0, _util.setStyle)(lastOverflowedIndicatorPlaceholder, 'display', 'none');
|
9980 | }, _this.resizeObserver = null, _this.mutationObserver = null, _this.originalTotalWidth = 0, _this.overflowedItems = [], _this.menuItemSizes = [], _this.handleResize = function () {
|
9981 | if (_this.props.mode !== 'horizontal') {
|
9982 | return;
|
9983 | }
|
9984 |
|
9985 | var ul = _reactDom2['default'].findDOMNode(_this);
|
9986 | if (!ul) {
|
9987 | return;
|
9988 | }
|
9989 | var width = (0, _util.getWidth)(ul);
|
9990 |
|
9991 | _this.overflowedItems = [];
|
9992 | var currentSumWidth = 0;
|
9993 |
|
9994 |
|
9995 | var lastVisibleIndex = undefined;
|
9996 |
|
9997 | if (_this.originalTotalWidth > width) {
|
9998 | lastVisibleIndex = -1;
|
9999 |
|
10000 | _this.menuItemSizes.forEach(function (liWidth) {
|
10001 | currentSumWidth += liWidth;
|
10002 | if (currentSumWidth + _this.overflowedIndicatorWidth <= width) {
|
10003 | lastVisibleIndex++;
|
10004 | }
|
10005 | });
|
10006 | }
|
10007 |
|
10008 | _this.setState({ lastVisibleIndex: lastVisibleIndex });
|
10009 | }, _temp), _possibleConstructorReturn(_this, _ret);
|
10010 | }
|
10011 |
|
10012 | DOMWrap.prototype.componentDidMount = function componentDidMount() {
|
10013 | var _this2 = this;
|
10014 |
|
10015 | this.setChildrenWidthAndResize();
|
10016 | if (this.props.level === 1 && this.props.mode === 'horizontal') {
|
10017 | var menuUl = _reactDom2['default'].findDOMNode(this);
|
10018 | if (!menuUl) {
|
10019 | return;
|
10020 | }
|
10021 | this.resizeObserver = new _resizeObserverPolyfill2['default'](function (entries) {
|
10022 | entries.forEach(_this2.setChildrenWidthAndResize);
|
10023 | });
|
10024 |
|
10025 | [].slice.call(menuUl.children).concat(menuUl).forEach(function (el) {
|
10026 | _this2.resizeObserver.observe(el);
|
10027 | });
|
10028 |
|
10029 | if (typeof MutationObserver !== 'undefined') {
|
10030 | this.mutationObserver = new MutationObserver(function () {
|
10031 | _this2.resizeObserver.disconnect();
|
10032 | [].slice.call(menuUl.children).concat(menuUl).forEach(function (el) {
|
10033 | _this2.resizeObserver.observe(el);
|
10034 | });
|
10035 | _this2.setChildrenWidthAndResize();
|
10036 | });
|
10037 | this.mutationObserver.observe(menuUl, { attributes: false, childList: true, subTree: false });
|
10038 | }
|
10039 | }
|
10040 | };
|
10041 |
|
10042 | DOMWrap.prototype.componentWillUnmount = function componentWillUnmount() {
|
10043 | if (this.resizeObserver) {
|
10044 | this.resizeObserver.disconnect();
|
10045 | }
|
10046 | if (this.mutationObserver) {
|
10047 | this.resizeObserver.disconnect();
|
10048 | }
|
10049 | };
|
10050 |
|
10051 |
|
10052 |
|
10053 |
|
10054 |
|
10055 |
|
10056 |
|
10057 |
|
10058 |
|
10059 |
|
10060 |
|
10061 |
|
10062 |
|
10063 |
|
10064 |
|
10065 |
|
10066 | DOMWrap.prototype.renderChildren = function renderChildren(children) {
|
10067 | var _this3 = this;
|
10068 |
|
10069 |
|
10070 | var lastVisibleIndex = this.state.lastVisibleIndex;
|
10071 |
|
10072 | return (children || []).reduce(function (acc, childNode, index) {
|
10073 | var item = childNode;
|
10074 | if (_this3.props.mode === 'horizontal') {
|
10075 | var overflowed = _this3.getOverflowedSubMenuItem(childNode.props.eventKey, []);
|
10076 | if (lastVisibleIndex !== undefined && _this3.props.className.indexOf(_this3.props.prefixCls + '-root') !== -1) {
|
10077 | if (index > lastVisibleIndex) {
|
10078 | item = _react2['default'].cloneElement(childNode,
|
10079 |
|
10080 | {
|
10081 | style: { display: 'none' },
|
10082 | eventKey: childNode.props.eventKey + '-hidden',
|
10083 | className: childNode.className + ' ' + MENUITEM_OVERFLOWED_CLASSNAME
|
10084 | });
|
10085 | }
|
10086 | if (index === lastVisibleIndex + 1) {
|
10087 | _this3.overflowedItems = children.slice(lastVisibleIndex + 1).map(function (c) {
|
10088 | return _react2['default'].cloneElement(c,
|
10089 |
|
10090 |
|
10091 | { key: c.props.eventKey, mode: 'vertical-left' });
|
10092 | });
|
10093 |
|
10094 | overflowed = _this3.getOverflowedSubMenuItem(childNode.props.eventKey, _this3.overflowedItems);
|
10095 | }
|
10096 | }
|
10097 |
|
10098 |
|
10099 | var ret = [].concat(_toConsumableArray(acc), [item]);
|
10100 |
|
10101 | if (index === children.length - 1) {
|
10102 |
|
10103 | ret.push(_this3.getOverflowedSubMenuItem(childNode.props.eventKey, [], true));
|
10104 | }
|
10105 | return ret;
|
10106 | }
|
10107 | return [].concat(_toConsumableArray(acc), [item]);
|
10108 | }, []);
|
10109 | };
|
10110 |
|
10111 | DOMWrap.prototype.render = function render() {
|
10112 | var _props = this.props,
|
10113 | hiddenClassName = _props.hiddenClassName,
|
10114 | visible = _props.visible,
|
10115 | prefixCls = _props.prefixCls,
|
10116 | overflowedIndicator = _props.overflowedIndicator,
|
10117 | mode = _props.mode,
|
10118 | level = _props.level,
|
10119 | Tag = _props.tag,
|
10120 | children = _props.children,
|
10121 | theme = _props.theme,
|
10122 | rest = _objectWithoutProperties(_props, ['hiddenClassName', 'visible', 'prefixCls', 'overflowedIndicator', 'mode', 'level', 'tag', 'children', 'theme']);
|
10123 |
|
10124 | if (!visible) {
|
10125 | rest.className += ' ' + hiddenClassName;
|
10126 | }
|
10127 |
|
10128 | return _react2['default'].createElement(
|
10129 | Tag,
|
10130 | rest,
|
10131 | this.renderChildren(this.props.children)
|
10132 | );
|
10133 | };
|
10134 |
|
10135 | return DOMWrap;
|
10136 | }(_react2['default'].Component);
|
10137 |
|
10138 | DOMWrap.propTypes = {
|
10139 | className: _propTypes2['default'].string,
|
10140 | children: _propTypes2['default'].node,
|
10141 | mode: _propTypes2['default'].oneOf(['horizontal', 'vertical', 'vertical-left', 'vertical-right', 'inline']),
|
10142 | prefixCls: _propTypes2['default'].string,
|
10143 | level: _propTypes2['default'].number,
|
10144 | theme: _propTypes2['default'].string,
|
10145 | overflowedIndicator: _propTypes2['default'].node,
|
10146 | visible: _propTypes2['default'].bool,
|
10147 | hiddenClassName: _propTypes2['default'].string,
|
10148 | tag: _propTypes2['default'].string,
|
10149 | style: _propTypes2['default'].object
|
10150 | };
|
10151 |
|
10152 | DOMWrap.defaultProps = {
|
10153 | tag: 'div',
|
10154 | className: ''
|
10155 | };
|
10156 |
|
10157 | exports['default'] = DOMWrap;
|
10158 | module.exports = exports['default'];
|
10159 |
|
10160 | }),
|
10161 |
|
10162 | (function(module, exports, __webpack_require__) {
|
10163 |
|
10164 | (function(global) {(function (global, factory) {
|
10165 | true ? module.exports = factory() :
|
10166 | typeof define === 'function' && define.amd ? define(factory) :
|
10167 | (global.ResizeObserver = factory());
|
10168 | }(this, (function () { 'use strict';
|
10169 |
|
10170 | |
10171 |
|
10172 |
|
10173 |
|
10174 |
|
10175 |
|
10176 |
|
10177 | var MapShim = (function () {
|
10178 | if (typeof Map !== 'undefined') {
|
10179 | return Map;
|
10180 | }
|
10181 | |
10182 |
|
10183 |
|
10184 |
|
10185 |
|
10186 |
|
10187 |
|
10188 | function getIndex(arr, key) {
|
10189 | var result = -1;
|
10190 | arr.some(function (entry, index) {
|
10191 | if (entry[0] === key) {
|
10192 | result = index;
|
10193 | return true;
|
10194 | }
|
10195 | return false;
|
10196 | });
|
10197 | return result;
|
10198 | }
|
10199 | return (function () {
|
10200 | function class_1() {
|
10201 | this.__entries__ = [];
|
10202 | }
|
10203 | Object.defineProperty(class_1.prototype, "size", {
|
10204 | |
10205 |
|
10206 |
|
10207 | get: function () {
|
10208 | return this.__entries__.length;
|
10209 | },
|
10210 | enumerable: true,
|
10211 | configurable: true
|
10212 | });
|
10213 | |
10214 |
|
10215 |
|
10216 |
|
10217 | class_1.prototype.get = function (key) {
|
10218 | var index = getIndex(this.__entries__, key);
|
10219 | var entry = this.__entries__[index];
|
10220 | return entry && entry[1];
|
10221 | };
|
10222 | |
10223 |
|
10224 |
|
10225 |
|
10226 |
|
10227 | class_1.prototype.set = function (key, value) {
|
10228 | var index = getIndex(this.__entries__, key);
|
10229 | if (~index) {
|
10230 | this.__entries__[index][1] = value;
|
10231 | }
|
10232 | else {
|
10233 | this.__entries__.push([key, value]);
|
10234 | }
|
10235 | };
|
10236 | |
10237 |
|
10238 |
|
10239 |
|
10240 | class_1.prototype.delete = function (key) {
|
10241 | var entries = this.__entries__;
|
10242 | var index = getIndex(entries, key);
|
10243 | if (~index) {
|
10244 | entries.splice(index, 1);
|
10245 | }
|
10246 | };
|
10247 | |
10248 |
|
10249 |
|
10250 |
|
10251 | class_1.prototype.has = function (key) {
|
10252 | return !!~getIndex(this.__entries__, key);
|
10253 | };
|
10254 | |
10255 |
|
10256 |
|
10257 | class_1.prototype.clear = function () {
|
10258 | this.__entries__.splice(0);
|
10259 | };
|
10260 | |
10261 |
|
10262 |
|
10263 |
|
10264 |
|
10265 | class_1.prototype.forEach = function (callback, ctx) {
|
10266 | if (ctx === void 0) { ctx = null; }
|
10267 | for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {
|
10268 | var entry = _a[_i];
|
10269 | callback.call(ctx, entry[1], entry[0]);
|
10270 | }
|
10271 | };
|
10272 | return class_1;
|
10273 | }());
|
10274 | })();
|
10275 |
|
10276 | |
10277 |
|
10278 |
|
10279 | var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document;
|
10280 |
|
10281 |
|
10282 | var global$1 = (function () {
|
10283 | if (typeof global !== 'undefined' && global.Math === Math) {
|
10284 | return global;
|
10285 | }
|
10286 | if (typeof self !== 'undefined' && self.Math === Math) {
|
10287 | return self;
|
10288 | }
|
10289 | if (typeof window !== 'undefined' && window.Math === Math) {
|
10290 | return window;
|
10291 | }
|
10292 |
|
10293 | return Function('return this')();
|
10294 | })();
|
10295 |
|
10296 | |
10297 |
|
10298 |
|
10299 |
|
10300 |
|
10301 |
|
10302 | var requestAnimationFrame$1 = (function () {
|
10303 | if (typeof requestAnimationFrame === 'function') {
|
10304 |
|
10305 |
|
10306 |
|
10307 | return requestAnimationFrame.bind(global$1);
|
10308 | }
|
10309 | return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); };
|
10310 | })();
|
10311 |
|
10312 |
|
10313 | var trailingTimeout = 2;
|
10314 | |
10315 |
|
10316 |
|
10317 |
|
10318 |
|
10319 |
|
10320 |
|
10321 |
|
10322 | function throttle (callback, delay) {
|
10323 | var leadingCall = false, trailingCall = false, lastCallTime = 0;
|
10324 | |
10325 |
|
10326 |
|
10327 |
|
10328 |
|
10329 |
|
10330 | function resolvePending() {
|
10331 | if (leadingCall) {
|
10332 | leadingCall = false;
|
10333 | callback();
|
10334 | }
|
10335 | if (trailingCall) {
|
10336 | proxy();
|
10337 | }
|
10338 | }
|
10339 | |
10340 |
|
10341 |
|
10342 |
|
10343 |
|
10344 |
|
10345 |
|
10346 | function timeoutCallback() {
|
10347 | requestAnimationFrame$1(resolvePending);
|
10348 | }
|
10349 | |
10350 |
|
10351 |
|
10352 |
|
10353 |
|
10354 | function proxy() {
|
10355 | var timeStamp = Date.now();
|
10356 | if (leadingCall) {
|
10357 |
|
10358 | if (timeStamp - lastCallTime < trailingTimeout) {
|
10359 | return;
|
10360 | }
|
10361 |
|
10362 |
|
10363 |
|
10364 |
|
10365 | trailingCall = true;
|
10366 | }
|
10367 | else {
|
10368 | leadingCall = true;
|
10369 | trailingCall = false;
|
10370 | setTimeout(timeoutCallback, delay);
|
10371 | }
|
10372 | lastCallTime = timeStamp;
|
10373 | }
|
10374 | return proxy;
|
10375 | }
|
10376 |
|
10377 |
|
10378 | var REFRESH_DELAY = 20;
|
10379 |
|
10380 |
|
10381 | var transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight'];
|
10382 |
|
10383 | var mutationObserverSupported = typeof MutationObserver !== 'undefined';
|
10384 | |
10385 |
|
10386 |
|
10387 | var ResizeObserverController = (function () {
|
10388 | |
10389 |
|
10390 |
|
10391 |
|
10392 |
|
10393 | function ResizeObserverController() {
|
10394 | |
10395 |
|
10396 |
|
10397 |
|
10398 |
|
10399 | this.connected_ = false;
|
10400 | |
10401 |
|
10402 |
|
10403 |
|
10404 |
|
10405 | this.mutationEventsAdded_ = false;
|
10406 | |
10407 |
|
10408 |
|
10409 |
|
10410 |
|
10411 | this.mutationsObserver_ = null;
|
10412 | |
10413 |
|
10414 |
|
10415 |
|
10416 |
|
10417 | this.observers_ = [];
|
10418 | this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);
|
10419 | this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);
|
10420 | }
|
10421 | |
10422 |
|
10423 |
|
10424 |
|
10425 |
|
10426 |
|
10427 | ResizeObserverController.prototype.addObserver = function (observer) {
|
10428 | if (!~this.observers_.indexOf(observer)) {
|
10429 | this.observers_.push(observer);
|
10430 | }
|
10431 |
|
10432 | if (!this.connected_) {
|
10433 | this.connect_();
|
10434 | }
|
10435 | };
|
10436 | |
10437 |
|
10438 |
|
10439 |
|
10440 |
|
10441 |
|
10442 | ResizeObserverController.prototype.removeObserver = function (observer) {
|
10443 | var observers = this.observers_;
|
10444 | var index = observers.indexOf(observer);
|
10445 |
|
10446 | if (~index) {
|
10447 | observers.splice(index, 1);
|
10448 | }
|
10449 |
|
10450 | if (!observers.length && this.connected_) {
|
10451 | this.disconnect_();
|
10452 | }
|
10453 | };
|
10454 | |
10455 |
|
10456 |
|
10457 |
|
10458 |
|
10459 |
|
10460 | ResizeObserverController.prototype.refresh = function () {
|
10461 | var changesDetected = this.updateObservers_();
|
10462 |
|
10463 |
|
10464 | if (changesDetected) {
|
10465 | this.refresh();
|
10466 | }
|
10467 | };
|
10468 | |
10469 |
|
10470 |
|
10471 |
|
10472 |
|
10473 |
|
10474 |
|
10475 |
|
10476 | ResizeObserverController.prototype.updateObservers_ = function () {
|
10477 |
|
10478 | var activeObservers = this.observers_.filter(function (observer) {
|
10479 | return observer.gatherActive(), observer.hasActive();
|
10480 | });
|
10481 |
|
10482 |
|
10483 |
|
10484 |
|
10485 |
|
10486 | activeObservers.forEach(function (observer) { return observer.broadcastActive(); });
|
10487 | return activeObservers.length > 0;
|
10488 | };
|
10489 | |
10490 |
|
10491 |
|
10492 |
|
10493 |
|
10494 |
|
10495 | ResizeObserverController.prototype.connect_ = function () {
|
10496 |
|
10497 |
|
10498 | if (!isBrowser || this.connected_) {
|
10499 | return;
|
10500 | }
|
10501 |
|
10502 |
|
10503 |
|
10504 | document.addEventListener('transitionend', this.onTransitionEnd_);
|
10505 | window.addEventListener('resize', this.refresh);
|
10506 | if (mutationObserverSupported) {
|
10507 | this.mutationsObserver_ = new MutationObserver(this.refresh);
|
10508 | this.mutationsObserver_.observe(document, {
|
10509 | attributes: true,
|
10510 | childList: true,
|
10511 | characterData: true,
|
10512 | subtree: true
|
10513 | });
|
10514 | }
|
10515 | else {
|
10516 | document.addEventListener('DOMSubtreeModified', this.refresh);
|
10517 | this.mutationEventsAdded_ = true;
|
10518 | }
|
10519 | this.connected_ = true;
|
10520 | };
|
10521 | |
10522 |
|
10523 |
|
10524 |
|
10525 |
|
10526 |
|
10527 | ResizeObserverController.prototype.disconnect_ = function () {
|
10528 |
|
10529 |
|
10530 | if (!isBrowser || !this.connected_) {
|
10531 | return;
|
10532 | }
|
10533 | document.removeEventListener('transitionend', this.onTransitionEnd_);
|
10534 | window.removeEventListener('resize', this.refresh);
|
10535 | if (this.mutationsObserver_) {
|
10536 | this.mutationsObserver_.disconnect();
|
10537 | }
|
10538 | if (this.mutationEventsAdded_) {
|
10539 | document.removeEventListener('DOMSubtreeModified', this.refresh);
|
10540 | }
|
10541 | this.mutationsObserver_ = null;
|
10542 | this.mutationEventsAdded_ = false;
|
10543 | this.connected_ = false;
|
10544 | };
|
10545 | |
10546 |
|
10547 |
|
10548 |
|
10549 |
|
10550 |
|
10551 |
|
10552 | ResizeObserverController.prototype.onTransitionEnd_ = function (_a) {
|
10553 | var _b = _a.propertyName, propertyName = _b === void 0 ? '' : _b;
|
10554 |
|
10555 | var isReflowProperty = transitionKeys.some(function (key) {
|
10556 | return !!~propertyName.indexOf(key);
|
10557 | });
|
10558 | if (isReflowProperty) {
|
10559 | this.refresh();
|
10560 | }
|
10561 | };
|
10562 | |
10563 |
|
10564 |
|
10565 |
|
10566 |
|
10567 | ResizeObserverController.getInstance = function () {
|
10568 | if (!this.instance_) {
|
10569 | this.instance_ = new ResizeObserverController();
|
10570 | }
|
10571 | return this.instance_;
|
10572 | };
|
10573 | |
10574 |
|
10575 |
|
10576 |
|
10577 |
|
10578 | ResizeObserverController.instance_ = null;
|
10579 | return ResizeObserverController;
|
10580 | }());
|
10581 |
|
10582 | |
10583 |
|
10584 |
|
10585 |
|
10586 |
|
10587 |
|
10588 |
|
10589 | var defineConfigurable = (function (target, props) {
|
10590 | for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {
|
10591 | var key = _a[_i];
|
10592 | Object.defineProperty(target, key, {
|
10593 | value: props[key],
|
10594 | enumerable: false,
|
10595 | writable: false,
|
10596 | configurable: true
|
10597 | });
|
10598 | }
|
10599 | return target;
|
10600 | });
|
10601 |
|
10602 | |
10603 |
|
10604 |
|
10605 |
|
10606 |
|
10607 |
|
10608 | var getWindowOf = (function (target) {
|
10609 |
|
10610 |
|
10611 |
|
10612 | var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;
|
10613 |
|
10614 |
|
10615 | return ownerGlobal || global$1;
|
10616 | });
|
10617 |
|
10618 |
|
10619 | var emptyRect = createRectInit(0, 0, 0, 0);
|
10620 | |
10621 |
|
10622 |
|
10623 |
|
10624 |
|
10625 |
|
10626 | function toFloat(value) {
|
10627 | return parseFloat(value) || 0;
|
10628 | }
|
10629 | |
10630 |
|
10631 |
|
10632 |
|
10633 |
|
10634 |
|
10635 |
|
10636 | function getBordersSize(styles) {
|
10637 | var positions = [];
|
10638 | for (var _i = 1; _i < arguments.length; _i++) {
|
10639 | positions[_i - 1] = arguments[_i];
|
10640 | }
|
10641 | return positions.reduce(function (size, position) {
|
10642 | var value = styles['border-' + position + '-width'];
|
10643 | return size + toFloat(value);
|
10644 | }, 0);
|
10645 | }
|
10646 | |
10647 |
|
10648 |
|
10649 |
|
10650 |
|
10651 |
|
10652 | function getPaddings(styles) {
|
10653 | var positions = ['top', 'right', 'bottom', 'left'];
|
10654 | var paddings = {};
|
10655 | for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {
|
10656 | var position = positions_1[_i];
|
10657 | var value = styles['padding-' + position];
|
10658 | paddings[position] = toFloat(value);
|
10659 | }
|
10660 | return paddings;
|
10661 | }
|
10662 | |
10663 |
|
10664 |
|
10665 |
|
10666 |
|
10667 |
|
10668 |
|
10669 | function getSVGContentRect(target) {
|
10670 | var bbox = target.getBBox();
|
10671 | return createRectInit(0, 0, bbox.width, bbox.height);
|
10672 | }
|
10673 | |
10674 |
|
10675 |
|
10676 |
|
10677 |
|
10678 |
|
10679 | function getHTMLElementContentRect(target) {
|
10680 |
|
10681 |
|
10682 | var clientWidth = target.clientWidth, clientHeight = target.clientHeight;
|
10683 |
|
10684 |
|
10685 |
|
10686 |
|
10687 |
|
10688 |
|
10689 |
|
10690 |
|
10691 | if (!clientWidth && !clientHeight) {
|
10692 | return emptyRect;
|
10693 | }
|
10694 | var styles = getWindowOf(target).getComputedStyle(target);
|
10695 | var paddings = getPaddings(styles);
|
10696 | var horizPad = paddings.left + paddings.right;
|
10697 | var vertPad = paddings.top + paddings.bottom;
|
10698 |
|
10699 |
|
10700 |
|
10701 |
|
10702 | var width = toFloat(styles.width), height = toFloat(styles.height);
|
10703 |
|
10704 |
|
10705 | if (styles.boxSizing === 'border-box') {
|
10706 |
|
10707 |
|
10708 |
|
10709 |
|
10710 |
|
10711 |
|
10712 | if (Math.round(width + horizPad) !== clientWidth) {
|
10713 | width -= getBordersSize(styles, 'left', 'right') + horizPad;
|
10714 | }
|
10715 | if (Math.round(height + vertPad) !== clientHeight) {
|
10716 | height -= getBordersSize(styles, 'top', 'bottom') + vertPad;
|
10717 | }
|
10718 | }
|
10719 |
|
10720 |
|
10721 |
|
10722 |
|
10723 | if (!isDocumentElement(target)) {
|
10724 |
|
10725 |
|
10726 |
|
10727 |
|
10728 | var vertScrollbar = Math.round(width + horizPad) - clientWidth;
|
10729 | var horizScrollbar = Math.round(height + vertPad) - clientHeight;
|
10730 |
|
10731 |
|
10732 |
|
10733 |
|
10734 |
|
10735 | if (Math.abs(vertScrollbar) !== 1) {
|
10736 | width -= vertScrollbar;
|
10737 | }
|
10738 | if (Math.abs(horizScrollbar) !== 1) {
|
10739 | height -= horizScrollbar;
|
10740 | }
|
10741 | }
|
10742 | return createRectInit(paddings.left, paddings.top, width, height);
|
10743 | }
|
10744 | |
10745 |
|
10746 |
|
10747 |
|
10748 |
|
10749 |
|
10750 | var isSVGGraphicsElement = (function () {
|
10751 |
|
10752 |
|
10753 | if (typeof SVGGraphicsElement !== 'undefined') {
|
10754 | return function (target) { return target instanceof getWindowOf(target).SVGGraphicsElement; };
|
10755 | }
|
10756 |
|
10757 |
|
10758 |
|
10759 | return function (target) { return (target instanceof getWindowOf(target).SVGElement &&
|
10760 | typeof target.getBBox === 'function'); };
|
10761 | })();
|
10762 | |
10763 |
|
10764 |
|
10765 |
|
10766 |
|
10767 |
|
10768 | function isDocumentElement(target) {
|
10769 | return target === getWindowOf(target).document.documentElement;
|
10770 | }
|
10771 | |
10772 |
|
10773 |
|
10774 |
|
10775 |
|
10776 |
|
10777 | function getContentRect(target) {
|
10778 | if (!isBrowser) {
|
10779 | return emptyRect;
|
10780 | }
|
10781 | if (isSVGGraphicsElement(target)) {
|
10782 | return getSVGContentRect(target);
|
10783 | }
|
10784 | return getHTMLElementContentRect(target);
|
10785 | }
|
10786 | |
10787 |
|
10788 |
|
10789 |
|
10790 |
|
10791 |
|
10792 |
|
10793 | function createReadOnlyRect(_a) {
|
10794 | var x = _a.x, y = _a.y, width = _a.width, height = _a.height;
|
10795 |
|
10796 | var Constr = typeof DOMRectReadOnly !== 'undefined' ? DOMRectReadOnly : Object;
|
10797 | var rect = Object.create(Constr.prototype);
|
10798 |
|
10799 | defineConfigurable(rect, {
|
10800 | x: x, y: y, width: width, height: height,
|
10801 | top: y,
|
10802 | right: x + width,
|
10803 | bottom: height + y,
|
10804 | left: x
|
10805 | });
|
10806 | return rect;
|
10807 | }
|
10808 | |
10809 |
|
10810 |
|
10811 |
|
10812 |
|
10813 |
|
10814 |
|
10815 |
|
10816 |
|
10817 |
|
10818 | function createRectInit(x, y, width, height) {
|
10819 | return { x: x, y: y, width: width, height: height };
|
10820 | }
|
10821 |
|
10822 | |
10823 |
|
10824 |
|
10825 |
|
10826 | var ResizeObservation = (function () {
|
10827 | |
10828 |
|
10829 |
|
10830 |
|
10831 |
|
10832 | function ResizeObservation(target) {
|
10833 | |
10834 |
|
10835 |
|
10836 |
|
10837 |
|
10838 | this.broadcastWidth = 0;
|
10839 | |
10840 |
|
10841 |
|
10842 |
|
10843 |
|
10844 | this.broadcastHeight = 0;
|
10845 | |
10846 |
|
10847 |
|
10848 |
|
10849 |
|
10850 | this.contentRect_ = createRectInit(0, 0, 0, 0);
|
10851 | this.target = target;
|
10852 | }
|
10853 | |
10854 |
|
10855 |
|
10856 |
|
10857 |
|
10858 |
|
10859 | ResizeObservation.prototype.isActive = function () {
|
10860 | var rect = getContentRect(this.target);
|
10861 | this.contentRect_ = rect;
|
10862 | return (rect.width !== this.broadcastWidth ||
|
10863 | rect.height !== this.broadcastHeight);
|
10864 | };
|
10865 | |
10866 |
|
10867 |
|
10868 |
|
10869 |
|
10870 |
|
10871 | ResizeObservation.prototype.broadcastRect = function () {
|
10872 | var rect = this.contentRect_;
|
10873 | this.broadcastWidth = rect.width;
|
10874 | this.broadcastHeight = rect.height;
|
10875 | return rect;
|
10876 | };
|
10877 | return ResizeObservation;
|
10878 | }());
|
10879 |
|
10880 | var ResizeObserverEntry = (function () {
|
10881 | |
10882 |
|
10883 |
|
10884 |
|
10885 |
|
10886 |
|
10887 | function ResizeObserverEntry(target, rectInit) {
|
10888 | var contentRect = createReadOnlyRect(rectInit);
|
10889 |
|
10890 |
|
10891 |
|
10892 |
|
10893 |
|
10894 |
|
10895 | defineConfigurable(this, { target: target, contentRect: contentRect });
|
10896 | }
|
10897 | return ResizeObserverEntry;
|
10898 | }());
|
10899 |
|
10900 | var ResizeObserverSPI = (function () {
|
10901 | |
10902 |
|
10903 |
|
10904 |
|
10905 |
|
10906 |
|
10907 |
|
10908 |
|
10909 |
|
10910 |
|
10911 | function ResizeObserverSPI(callback, controller, callbackCtx) {
|
10912 | |
10913 |
|
10914 |
|
10915 |
|
10916 |
|
10917 |
|
10918 | this.activeObservations_ = [];
|
10919 | |
10920 |
|
10921 |
|
10922 |
|
10923 |
|
10924 | this.observations_ = new MapShim();
|
10925 | if (typeof callback !== 'function') {
|
10926 | throw new TypeError('The callback provided as parameter 1 is not a function.');
|
10927 | }
|
10928 | this.callback_ = callback;
|
10929 | this.controller_ = controller;
|
10930 | this.callbackCtx_ = callbackCtx;
|
10931 | }
|
10932 | |
10933 |
|
10934 |
|
10935 |
|
10936 |
|
10937 |
|
10938 | ResizeObserverSPI.prototype.observe = function (target) {
|
10939 | if (!arguments.length) {
|
10940 | throw new TypeError('1 argument required, but only 0 present.');
|
10941 | }
|
10942 |
|
10943 | if (typeof Element === 'undefined' || !(Element instanceof Object)) {
|
10944 | return;
|
10945 | }
|
10946 | if (!(target instanceof getWindowOf(target).Element)) {
|
10947 | throw new TypeError('parameter 1 is not of type "Element".');
|
10948 | }
|
10949 | var observations = this.observations_;
|
10950 |
|
10951 | if (observations.has(target)) {
|
10952 | return;
|
10953 | }
|
10954 | observations.set(target, new ResizeObservation(target));
|
10955 | this.controller_.addObserver(this);
|
10956 |
|
10957 | this.controller_.refresh();
|
10958 | };
|
10959 | |
10960 |
|
10961 |
|
10962 |
|
10963 |
|
10964 |
|
10965 | ResizeObserverSPI.prototype.unobserve = function (target) {
|
10966 | if (!arguments.length) {
|
10967 | throw new TypeError('1 argument required, but only 0 present.');
|
10968 | }
|
10969 |
|
10970 | if (typeof Element === 'undefined' || !(Element instanceof Object)) {
|
10971 | return;
|
10972 | }
|
10973 | if (!(target instanceof getWindowOf(target).Element)) {
|
10974 | throw new TypeError('parameter 1 is not of type "Element".');
|
10975 | }
|
10976 | var observations = this.observations_;
|
10977 |
|
10978 | if (!observations.has(target)) {
|
10979 | return;
|
10980 | }
|
10981 | observations.delete(target);
|
10982 | if (!observations.size) {
|
10983 | this.controller_.removeObserver(this);
|
10984 | }
|
10985 | };
|
10986 | |
10987 |
|
10988 |
|
10989 |
|
10990 |
|
10991 | ResizeObserverSPI.prototype.disconnect = function () {
|
10992 | this.clearActive();
|
10993 | this.observations_.clear();
|
10994 | this.controller_.removeObserver(this);
|
10995 | };
|
10996 | |
10997 |
|
10998 |
|
10999 |
|
11000 |
|
11001 |
|
11002 | ResizeObserverSPI.prototype.gatherActive = function () {
|
11003 | var _this = this;
|
11004 | this.clearActive();
|
11005 | this.observations_.forEach(function (observation) {
|
11006 | if (observation.isActive()) {
|
11007 | _this.activeObservations_.push(observation);
|
11008 | }
|
11009 | });
|
11010 | };
|
11011 | |
11012 |
|
11013 |
|
11014 |
|
11015 |
|
11016 |
|
11017 | ResizeObserverSPI.prototype.broadcastActive = function () {
|
11018 |
|
11019 | if (!this.hasActive()) {
|
11020 | return;
|
11021 | }
|
11022 | var ctx = this.callbackCtx_;
|
11023 |
|
11024 | var entries = this.activeObservations_.map(function (observation) {
|
11025 | return new ResizeObserverEntry(observation.target, observation.broadcastRect());
|
11026 | });
|
11027 | this.callback_.call(ctx, entries, ctx);
|
11028 | this.clearActive();
|
11029 | };
|
11030 | |
11031 |
|
11032 |
|
11033 |
|
11034 |
|
11035 | ResizeObserverSPI.prototype.clearActive = function () {
|
11036 | this.activeObservations_.splice(0);
|
11037 | };
|
11038 | |
11039 |
|
11040 |
|
11041 |
|
11042 |
|
11043 | ResizeObserverSPI.prototype.hasActive = function () {
|
11044 | return this.activeObservations_.length > 0;
|
11045 | };
|
11046 | return ResizeObserverSPI;
|
11047 | }());
|
11048 |
|
11049 |
|
11050 |
|
11051 |
|
11052 | var observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim();
|
11053 | |
11054 |
|
11055 |
|
11056 |
|
11057 | var ResizeObserver = (function () {
|
11058 | |
11059 |
|
11060 |
|
11061 |
|
11062 |
|
11063 |
|
11064 | function ResizeObserver(callback) {
|
11065 | if (!(this instanceof ResizeObserver)) {
|
11066 | throw new TypeError('Cannot call a class as a function.');
|
11067 | }
|
11068 | if (!arguments.length) {
|
11069 | throw new TypeError('1 argument required, but only 0 present.');
|
11070 | }
|
11071 | var controller = ResizeObserverController.getInstance();
|
11072 | var observer = new ResizeObserverSPI(callback, controller, this);
|
11073 | observers.set(this, observer);
|
11074 | }
|
11075 | return ResizeObserver;
|
11076 | }());
|
11077 |
|
11078 | [
|
11079 | 'observe',
|
11080 | 'unobserve',
|
11081 | 'disconnect'
|
11082 | ].forEach(function (method) {
|
11083 | ResizeObserver.prototype[method] = function () {
|
11084 | var _a;
|
11085 | return (_a = observers.get(this))[method].apply(_a, arguments);
|
11086 | };
|
11087 | });
|
11088 |
|
11089 | var index = (function () {
|
11090 |
|
11091 | if (typeof global$1.ResizeObserver !== 'undefined') {
|
11092 | return global$1.ResizeObserver;
|
11093 | }
|
11094 | return ResizeObserver;
|
11095 | })();
|
11096 |
|
11097 | return index;
|
11098 |
|
11099 | })));
|
11100 |
|
11101 | }.call(exports, (function() { return this; }())))
|
11102 |
|
11103 | }),
|
11104 |
|
11105 | (function(module, exports, __webpack_require__) {
|
11106 |
|
11107 | 'use strict';
|
11108 |
|
11109 | Object.defineProperty(exports, "__esModule", {
|
11110 | value: true
|
11111 | });
|
11112 | exports.SubMenu = undefined;
|
11113 |
|
11114 | 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; };
|
11115 |
|
11116 | 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; };
|
11117 |
|
11118 | var _react = __webpack_require__(4);
|
11119 |
|
11120 | var _react2 = _interopRequireDefault(_react);
|
11121 |
|
11122 | var _reactDom = __webpack_require__(12);
|
11123 |
|
11124 | var _reactDom2 = _interopRequireDefault(_reactDom);
|
11125 |
|
11126 | var _propTypes = __webpack_require__(5);
|
11127 |
|
11128 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
11129 |
|
11130 | var _rcTrigger = __webpack_require__(103);
|
11131 |
|
11132 | var _rcTrigger2 = _interopRequireDefault(_rcTrigger);
|
11133 |
|
11134 | var _tinperBeeCore = __webpack_require__(27);
|
11135 |
|
11136 | var _classnames = __webpack_require__(3);
|
11137 |
|
11138 | var _classnames2 = _interopRequireDefault(_classnames);
|
11139 |
|
11140 | var _miniStore = __webpack_require__(89);
|
11141 |
|
11142 | var _SubPopupMenu = __webpack_require__(97);
|
11143 |
|
11144 | var _SubPopupMenu2 = _interopRequireDefault(_SubPopupMenu);
|
11145 |
|
11146 | var _placements = __webpack_require__(209);
|
11147 |
|
11148 | var _placements2 = _interopRequireDefault(_placements);
|
11149 |
|
11150 | var _rcAnimate = __webpack_require__(199);
|
11151 |
|
11152 | var _rcAnimate2 = _interopRequireDefault(_rcAnimate);
|
11153 |
|
11154 | var _util = __webpack_require__(99);
|
11155 |
|
11156 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
11157 |
|
11158 | 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; }
|
11159 |
|
11160 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
11161 |
|
11162 | 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; }
|
11163 |
|
11164 | 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); }
|
11165 |
|
11166 | 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; }
|
11167 |
|
11168 | var guid = 0;
|
11169 |
|
11170 | var popupPlacementMap = {
|
11171 | horizontal: 'bottomLeft',
|
11172 | vertical: 'rightTop',
|
11173 | 'vertical-left': 'rightTop',
|
11174 | 'vertical-right': 'leftTop'
|
11175 | };
|
11176 |
|
11177 | var updateDefaultActiveFirst = function updateDefaultActiveFirst(store, eventKey, defaultActiveFirst) {
|
11178 | var menuId = (0, _util.getMenuIdFromSubMenuEventKey)(eventKey);
|
11179 | var state = store.getState();
|
11180 | store.setState({
|
11181 | defaultActiveFirst: _extends({}, state.defaultActiveFirst, _defineProperty({}, menuId, defaultActiveFirst))
|
11182 | });
|
11183 | };
|
11184 |
|
11185 | var SubMenu = exports.SubMenu = function (_React$Component) {
|
11186 | _inherits(SubMenu, _React$Component);
|
11187 |
|
11188 | function SubMenu(props) {
|
11189 | _classCallCheck(this, SubMenu);
|
11190 |
|
11191 | var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
|
11192 |
|
11193 | _initialiseProps.call(_this);
|
11194 |
|
11195 | var store = props.store;
|
11196 | var eventKey = props.eventKey;
|
11197 | var defaultActiveFirst = store.getState().defaultActiveFirst;
|
11198 |
|
11199 | _this.isRootMenu = false;
|
11200 |
|
11201 | var value = false;
|
11202 |
|
11203 | if (defaultActiveFirst) {
|
11204 | value = defaultActiveFirst[eventKey];
|
11205 | }
|
11206 |
|
11207 | updateDefaultActiveFirst(store, eventKey, value);
|
11208 | return _this;
|
11209 | }
|
11210 |
|
11211 | SubMenu.prototype.componentDidMount = function componentDidMount() {
|
11212 | this.componentDidUpdate();
|
11213 | };
|
11214 |
|
11215 | SubMenu.prototype.componentDidUpdate = function componentDidUpdate() {
|
11216 | var _this2 = this;
|
11217 |
|
11218 | var _props = this.props,
|
11219 | mode = _props.mode,
|
11220 | parentMenu = _props.parentMenu,
|
11221 | manualRef = _props.manualRef;
|
11222 |
|
11223 |
|
11224 |
|
11225 | if (manualRef) {
|
11226 | manualRef(this);
|
11227 | }
|
11228 |
|
11229 | if (mode !== 'horizontal' || !parentMenu.isRootMenu || !this.props.isOpen) {
|
11230 | return;
|
11231 | }
|
11232 |
|
11233 | this.minWidthTimeout = setTimeout(function () {
|
11234 | return _this2.adjustWidth();
|
11235 | }, 0);
|
11236 | };
|
11237 |
|
11238 | SubMenu.prototype.componentWillUnmount = function componentWillUnmount() {
|
11239 | var _props2 = this.props,
|
11240 | onDestroy = _props2.onDestroy,
|
11241 | eventKey = _props2.eventKey;
|
11242 |
|
11243 | if (onDestroy) {
|
11244 | onDestroy(eventKey);
|
11245 | }
|
11246 |
|
11247 |
|
11248 | if (this.minWidthTimeout) {
|
11249 | clearTimeout(this.minWidthTimeout);
|
11250 | }
|
11251 |
|
11252 |
|
11253 | if (this.mouseenterTimeout) {
|
11254 | clearTimeout(this.mouseenterTimeout);
|
11255 | }
|
11256 | };
|
11257 |
|
11258 | SubMenu.prototype.renderChildren = function renderChildren(children) {
|
11259 | var props = this.props;
|
11260 | var baseProps = {
|
11261 | mode: props.mode === 'horizontal' ? 'vertical' : props.mode,
|
11262 | visible: this.props.isOpen,
|
11263 | level: props.level + 1,
|
11264 | inlineIndent: props.inlineIndent,
|
11265 | focusable: false,
|
11266 | onClick: this.onSubMenuClick,
|
11267 | onSelect: this.onSelect,
|
11268 | onDeselect: this.onDeselect,
|
11269 | onDestroy: this.onDestroy,
|
11270 | selectedKeys: props.selectedKeys,
|
11271 | eventKey: props.eventKey + '-menu-',
|
11272 | openKeys: props.openKeys,
|
11273 | openTransitionName: props.openTransitionName,
|
11274 | openAnimation: props.openAnimation,
|
11275 | onOpenChange: this.onOpenChange,
|
11276 | subMenuOpenDelay: props.subMenuOpenDelay,
|
11277 | parentMenu: this,
|
11278 | subMenuCloseDelay: props.subMenuCloseDelay,
|
11279 | forceSubMenuRender: props.forceSubMenuRender,
|
11280 | triggerSubMenuAction: props.triggerSubMenuAction,
|
11281 | builtinPlacements: props.builtinPlacements,
|
11282 | defaultActiveFirst: props.store.getState().defaultActiveFirst[(0, _util.getMenuIdFromSubMenuEventKey)(props.eventKey)],
|
11283 | multiple: props.multiple,
|
11284 | prefixCls: props.rootPrefixCls,
|
11285 | id: this._menuId,
|
11286 | manualRef: this.saveMenuInstance,
|
11287 | itemIcon: props.itemIcon,
|
11288 | expandIcon: props.expandIcon
|
11289 | };
|
11290 |
|
11291 | var haveRendered = this.haveRendered;
|
11292 | this.haveRendered = true;
|
11293 |
|
11294 | this.haveOpened = this.haveOpened || baseProps.visible || baseProps.forceSubMenuRender;
|
11295 |
|
11296 | if (!this.haveOpened) {
|
11297 | return _react2['default'].createElement('div', null);
|
11298 | }
|
11299 |
|
11300 |
|
11301 |
|
11302 |
|
11303 | var transitionAppear = haveRendered || !baseProps.visible || !baseProps.mode === 'inline';
|
11304 |
|
11305 | baseProps.className = ' ' + baseProps.prefixCls + '-sub';
|
11306 | var animProps = {};
|
11307 |
|
11308 | if (baseProps.openTransitionName) {
|
11309 | animProps.transitionName = baseProps.openTransitionName;
|
11310 | } else if (_typeof(baseProps.openAnimation) === 'object') {
|
11311 | animProps.animation = _extends({}, baseProps.openAnimation);
|
11312 | if (!transitionAppear) {
|
11313 | delete animProps.animation.appear;
|
11314 | }
|
11315 | }
|
11316 |
|
11317 | return _react2['default'].createElement(
|
11318 | _rcAnimate2['default'],
|
11319 | _extends({}, animProps, {
|
11320 | showProp: 'visible',
|
11321 | component: '',
|
11322 | transitionAppear: transitionAppear
|
11323 | }),
|
11324 | _react2['default'].createElement(
|
11325 | _SubPopupMenu2['default'],
|
11326 | _extends({}, baseProps, { id: this._menuId }),
|
11327 | children
|
11328 | )
|
11329 | );
|
11330 | };
|
11331 |
|
11332 | SubMenu.prototype.render = function render() {
|
11333 | var _classNames;
|
11334 |
|
11335 | var props = _extends({}, this.props);
|
11336 | var isOpen = props.isOpen;
|
11337 | var prefixCls = this.getPrefixCls();
|
11338 | var isInlineMode = props.mode === 'inline';
|
11339 | var className = (0, _classnames2['default'])(prefixCls, prefixCls + '-' + props.mode, (_classNames = {}, _defineProperty(_classNames, props.className, !!props.className), _defineProperty(_classNames, this.getOpenClassName(), isOpen), _defineProperty(_classNames, this.getActiveClassName(), props.active || isOpen && !isInlineMode), _defineProperty(_classNames, this.getDisabledClassName(), props.disabled), _defineProperty(_classNames, this.getSelectedClassName(), this.isChildrenSelected()), _classNames));
|
11340 |
|
11341 | if (!this._menuId) {
|
11342 | if (props.eventKey) {
|
11343 | this._menuId = props.eventKey + '$Menu';
|
11344 | } else {
|
11345 | this._menuId = '$__$' + ++guid + '$Menu';
|
11346 | }
|
11347 | }
|
11348 |
|
11349 | var mouseEvents = {};
|
11350 | var titleClickEvents = {};
|
11351 | var titleMouseEvents = {};
|
11352 | if (!props.disabled) {
|
11353 | mouseEvents = {
|
11354 | onMouseLeave: this.onMouseLeave,
|
11355 | onMouseEnter: this.onMouseEnter
|
11356 | };
|
11357 |
|
11358 |
|
11359 | titleClickEvents = {
|
11360 | onClick: this.onTitleClick
|
11361 | };
|
11362 | titleMouseEvents = {
|
11363 | onMouseEnter: this.onTitleMouseEnter,
|
11364 | onMouseLeave: this.onTitleMouseLeave
|
11365 | };
|
11366 | }
|
11367 |
|
11368 | var style = {};
|
11369 | if (isInlineMode) {
|
11370 | style.paddingLeft = props.inlineIndent * props.level;
|
11371 | }
|
11372 |
|
11373 | var ariaOwns = {};
|
11374 |
|
11375 |
|
11376 |
|
11377 | if (this.props.isOpen) {
|
11378 | ariaOwns = {
|
11379 | 'aria-owns': this._menuId
|
11380 | };
|
11381 | }
|
11382 |
|
11383 |
|
11384 | var icon = null;
|
11385 | if (props.mode !== 'horizontal') {
|
11386 | icon = this.props.expandIcon;
|
11387 | if (typeof this.props.expandIcon === 'function') {
|
11388 | icon = _react2['default'].createElement(this.props.expandIcon, _extends({}, this.props));
|
11389 | }
|
11390 | }
|
11391 |
|
11392 | var title = _react2['default'].createElement(
|
11393 | 'div',
|
11394 | _extends({
|
11395 | ref: this.saveSubMenuTitle,
|
11396 | style: style,
|
11397 | className: prefixCls + '-title'
|
11398 | }, titleMouseEvents, titleClickEvents, {
|
11399 | 'aria-expanded': isOpen
|
11400 | }, ariaOwns, {
|
11401 | 'aria-haspopup': 'true',
|
11402 | title: typeof props.title === 'string' ? props.title : undefined
|
11403 | }),
|
11404 | props.title,
|
11405 | icon || _react2['default'].createElement('i', { className: prefixCls + '-arrow' })
|
11406 | );
|
11407 | var children = this.renderChildren(props.children);
|
11408 |
|
11409 | var getPopupContainer = function getPopupContainer(triggerNode) {
|
11410 | return triggerNode.parentNode;
|
11411 | };
|
11412 | var popupPlacement = popupPlacementMap[props.mode];
|
11413 | var popupAlign = props.popupOffset ? { offset: props.popupOffset } : {};
|
11414 | var popupClassName = props.mode === 'inline' ? '' : props.popupClassName;
|
11415 | var disabled = props.disabled,
|
11416 | triggerSubMenuAction = props.triggerSubMenuAction,
|
11417 | subMenuOpenDelay = props.subMenuOpenDelay,
|
11418 | forceSubMenuRender = props.forceSubMenuRender,
|
11419 | subMenuCloseDelay = props.subMenuCloseDelay,
|
11420 | builtinPlacements = props.builtinPlacements;
|
11421 |
|
11422 | _util.menuAllProps.forEach(function (key) {
|
11423 | return delete props[key];
|
11424 | });
|
11425 |
|
11426 | delete props.onClick;
|
11427 | return _react2['default'].createElement(
|
11428 | 'li',
|
11429 | _extends({}, props, mouseEvents, {
|
11430 | className: className,
|
11431 | role: 'menuitem'
|
11432 | }),
|
11433 | isInlineMode && title,
|
11434 | isInlineMode && children,
|
11435 | !isInlineMode && _react2['default'].createElement(
|
11436 | _rcTrigger2['default'],
|
11437 | {
|
11438 | prefixCls: prefixCls,
|
11439 | popupClassName: prefixCls + '-popup ' + popupClassName,
|
11440 | getPopupContainer: getPopupContainer,
|
11441 | builtinPlacements: _extends({}, _placements2['default'], builtinPlacements),
|
11442 | popupPlacement: popupPlacement,
|
11443 | popupVisible: isOpen,
|
11444 | popupAlign: popupAlign,
|
11445 | popup: children,
|
11446 | action: disabled ? [] : [triggerSubMenuAction],
|
11447 | mouseEnterDelay: subMenuOpenDelay,
|
11448 | mouseLeaveDelay: subMenuCloseDelay,
|
11449 | onPopupVisibleChange: this.onPopupVisibleChange,
|
11450 | forceRender: forceSubMenuRender
|
11451 | },
|
11452 | title
|
11453 | )
|
11454 | );
|
11455 | };
|
11456 |
|
11457 | return SubMenu;
|
11458 | }(_react2['default'].Component);
|
11459 |
|
11460 | SubMenu.propTypes = {
|
11461 | parentMenu: _propTypes2['default'].object,
|
11462 | title: _propTypes2['default'].node,
|
11463 | children: _propTypes2['default'].any,
|
11464 | selectedKeys: _propTypes2['default'].array,
|
11465 | openKeys: _propTypes2['default'].array,
|
11466 | onClick: _propTypes2['default'].func,
|
11467 | onOpenChange: _propTypes2['default'].func,
|
11468 | rootPrefixCls: _propTypes2['default'].string,
|
11469 | eventKey: _propTypes2['default'].string,
|
11470 | multiple: _propTypes2['default'].bool,
|
11471 | active: _propTypes2['default'].bool,
|
11472 | onItemHover: _propTypes2['default'].func,
|
11473 | onSelect: _propTypes2['default'].func,
|
11474 | triggerSubMenuAction: _propTypes2['default'].string,
|
11475 | onDeselect: _propTypes2['default'].func,
|
11476 | onDestroy: _propTypes2['default'].func,
|
11477 | onMouseEnter: _propTypes2['default'].func,
|
11478 | onMouseLeave: _propTypes2['default'].func,
|
11479 | onTitleMouseEnter: _propTypes2['default'].func,
|
11480 | onTitleMouseLeave: _propTypes2['default'].func,
|
11481 | onTitleClick: _propTypes2['default'].func,
|
11482 | popupOffset: _propTypes2['default'].array,
|
11483 | isOpen: _propTypes2['default'].bool,
|
11484 | store: _propTypes2['default'].object,
|
11485 | mode: _propTypes2['default'].oneOf(['horizontal', 'vertical', 'vertical-left', 'vertical-right', 'inline']),
|
11486 | manualRef: _propTypes2['default'].func,
|
11487 | itemIcon: _propTypes2['default'].oneOfType([_propTypes2['default'].func, _propTypes2['default'].node]),
|
11488 | expandIcon: _propTypes2['default'].oneOfType([_propTypes2['default'].func, _propTypes2['default'].node])
|
11489 | };
|
11490 | SubMenu.defaultProps = {
|
11491 | onMouseEnter: _util.noop,
|
11492 | onMouseLeave: _util.noop,
|
11493 | onTitleMouseEnter: _util.noop,
|
11494 | onTitleMouseLeave: _util.noop,
|
11495 | onTitleClick: _util.noop,
|
11496 | manualRef: _util.noop,
|
11497 | mode: 'vertical',
|
11498 | title: ''
|
11499 | };
|
11500 |
|
11501 | var _initialiseProps = function _initialiseProps() {
|
11502 | var _this3 = this;
|
11503 |
|
11504 | this.onDestroy = function (key) {
|
11505 | _this3.props.onDestroy(key);
|
11506 | };
|
11507 |
|
11508 | this.onKeyDown = function (e) {
|
11509 | var keyCode = e.keyCode;
|
11510 | var menu = _this3.menuInstance;
|
11511 | var _props3 = _this3.props,
|
11512 | isOpen = _props3.isOpen,
|
11513 | store = _props3.store;
|
11514 |
|
11515 | if (_this3.props.store.getState().keyboard) {
|
11516 |
|
11517 | if (keyCode === _tinperBeeCore.KeyCode.ENTER) {
|
11518 |
|
11519 | menu && menu.onKeyDown && menu.onKeyDown(e);
|
11520 | updateDefaultActiveFirst(store, _this3.props.eventKey, true);
|
11521 | return true;
|
11522 | }
|
11523 |
|
11524 | if (keyCode === _tinperBeeCore.KeyCode.RIGHT) {
|
11525 | if (isOpen) {
|
11526 | menu.onKeyDown(e);
|
11527 | } else {
|
11528 | _this3.triggerOpenChange(true);
|
11529 |
|
11530 | updateDefaultActiveFirst(store, _this3.props.eventKey, true);
|
11531 | }
|
11532 | return true;
|
11533 | }
|
11534 | if (keyCode === _tinperBeeCore.KeyCode.LEFT) {
|
11535 | var handled = void 0;
|
11536 | if (isOpen) {
|
11537 | handled = menu.onKeyDown(e);
|
11538 | } else {
|
11539 | return undefined;
|
11540 | }
|
11541 | if (!handled) {
|
11542 | _this3.triggerOpenChange(false);
|
11543 | handled = true;
|
11544 | }
|
11545 | return handled;
|
11546 | }
|
11547 | if (isOpen && (keyCode === _tinperBeeCore.KeyCode.UP || keyCode === _tinperBeeCore.KeyCode.DOWN)) {
|
11548 | return menu.onKeyDown(e);
|
11549 | }
|
11550 | }
|
11551 | };
|
11552 |
|
11553 | this.onOpenChange = function (e) {
|
11554 | _this3.props.onOpenChange(e);
|
11555 | };
|
11556 |
|
11557 | this.onPopupVisibleChange = function (visible) {
|
11558 | _this3.triggerOpenChange(visible, visible ? 'mouseenter' : 'mouseleave');
|
11559 | };
|
11560 |
|
11561 | this.onMouseEnter = function (e) {
|
11562 | var _props4 = _this3.props,
|
11563 | key = _props4.eventKey,
|
11564 | onMouseEnter = _props4.onMouseEnter,
|
11565 | store = _props4.store;
|
11566 |
|
11567 | updateDefaultActiveFirst(store, _this3.props.eventKey, false);
|
11568 | onMouseEnter({
|
11569 | key: key,
|
11570 | domEvent: e
|
11571 | });
|
11572 | };
|
11573 |
|
11574 | this.onMouseLeave = function (e) {
|
11575 | var _props5 = _this3.props,
|
11576 | parentMenu = _props5.parentMenu,
|
11577 | eventKey = _props5.eventKey,
|
11578 | onMouseLeave = _props5.onMouseLeave;
|
11579 |
|
11580 | parentMenu.subMenuInstance = _this3;
|
11581 | onMouseLeave({
|
11582 | key: eventKey,
|
11583 | domEvent: e
|
11584 | });
|
11585 | };
|
11586 |
|
11587 | this.onTitleMouseEnter = function (domEvent) {
|
11588 | var _props6 = _this3.props,
|
11589 | key = _props6.eventKey,
|
11590 | onItemHover = _props6.onItemHover,
|
11591 | onTitleMouseEnter = _props6.onTitleMouseEnter;
|
11592 |
|
11593 | onItemHover({
|
11594 | key: key,
|
11595 | hover: true
|
11596 | });
|
11597 | onTitleMouseEnter({
|
11598 | key: key,
|
11599 | domEvent: domEvent
|
11600 | });
|
11601 | };
|
11602 |
|
11603 | this.onTitleMouseLeave = function (e) {
|
11604 | var _props7 = _this3.props,
|
11605 | parentMenu = _props7.parentMenu,
|
11606 | eventKey = _props7.eventKey,
|
11607 | onItemHover = _props7.onItemHover,
|
11608 | onTitleMouseLeave = _props7.onTitleMouseLeave;
|
11609 |
|
11610 | parentMenu.subMenuInstance = _this3;
|
11611 | onItemHover({
|
11612 | key: eventKey,
|
11613 | hover: false
|
11614 | });
|
11615 | onTitleMouseLeave({
|
11616 | key: eventKey,
|
11617 | domEvent: e
|
11618 | });
|
11619 | };
|
11620 |
|
11621 | this.onTitleClick = function (e) {
|
11622 | var props = _this3.props;
|
11623 |
|
11624 | props.onTitleClick({
|
11625 | key: props.eventKey,
|
11626 | domEvent: e
|
11627 | });
|
11628 | if (props.triggerSubMenuAction === 'hover') {
|
11629 | return;
|
11630 | }
|
11631 | _this3.triggerOpenChange(!props.isOpen, 'click');
|
11632 | updateDefaultActiveFirst(props.store, _this3.props.eventKey, false);
|
11633 | };
|
11634 |
|
11635 | this.onSubMenuClick = function (info) {
|
11636 |
|
11637 |
|
11638 | if (typeof _this3.props.onClick === 'function') {
|
11639 | _this3.props.onClick(_this3.addKeyPath(info));
|
11640 | }
|
11641 | };
|
11642 |
|
11643 | this.onSelect = function (info) {
|
11644 | _this3.props.onSelect(info);
|
11645 | };
|
11646 |
|
11647 | this.onDeselect = function (info) {
|
11648 | _this3.props.onDeselect(info);
|
11649 | };
|
11650 |
|
11651 | this.getPrefixCls = function () {
|
11652 | return _this3.props.rootPrefixCls + '-submenu';
|
11653 | };
|
11654 |
|
11655 | this.getActiveClassName = function () {
|
11656 | return _this3.getPrefixCls() + '-active';
|
11657 | };
|
11658 |
|
11659 | this.getDisabledClassName = function () {
|
11660 | return _this3.getPrefixCls() + '-disabled';
|
11661 | };
|
11662 |
|
11663 | this.getSelectedClassName = function () {
|
11664 | return _this3.getPrefixCls() + '-selected';
|
11665 | };
|
11666 |
|
11667 | this.getOpenClassName = function () {
|
11668 | return _this3.props.rootPrefixCls + '-submenu-open';
|
11669 | };
|
11670 |
|
11671 | this.saveMenuInstance = function (c) {
|
11672 |
|
11673 | _this3.menuInstance = c;
|
11674 | };
|
11675 |
|
11676 | this.addKeyPath = function (info) {
|
11677 | return _extends({}, info, {
|
11678 | keyPath: (info.keyPath || []).concat(_this3.props.eventKey)
|
11679 | });
|
11680 | };
|
11681 |
|
11682 | this.triggerOpenChange = function (open, type) {
|
11683 | var key = _this3.props.eventKey;
|
11684 | var openChange = function openChange() {
|
11685 | _this3.onOpenChange({
|
11686 | key: key,
|
11687 | item: _this3,
|
11688 | trigger: type,
|
11689 | open: open
|
11690 | });
|
11691 | };
|
11692 | if (type === 'mouseenter') {
|
11693 |
|
11694 | _this3.mouseenterTimeout = setTimeout(function () {
|
11695 | openChange();
|
11696 | }, 0);
|
11697 | } else {
|
11698 | openChange();
|
11699 | }
|
11700 | };
|
11701 |
|
11702 | this.isChildrenSelected = function () {
|
11703 | var ret = { find: false };
|
11704 | (0, _util.loopMenuItemRecursively)(_this3.props.children, _this3.props.selectedKeys, ret);
|
11705 | return ret.find;
|
11706 | };
|
11707 |
|
11708 | this.isOpen = function () {
|
11709 | return _this3.props.openKeys.indexOf(_this3.props.eventKey) !== -1;
|
11710 | };
|
11711 |
|
11712 | this.adjustWidth = function () {
|
11713 |
|
11714 | if (!_this3.subMenuTitle || !_this3.menuInstance) {
|
11715 | return;
|
11716 | }
|
11717 | var popupMenu = _reactDom2['default'].findDOMNode(_this3.menuInstance);
|
11718 | if (popupMenu.offsetWidth >= _this3.subMenuTitle.offsetWidth) {
|
11719 | return;
|
11720 | }
|
11721 |
|
11722 |
|
11723 | popupMenu.style.minWidth = _this3.subMenuTitle.offsetWidth + 'px';
|
11724 | };
|
11725 |
|
11726 | this.saveSubMenuTitle = function (subMenuTitle) {
|
11727 | _this3.subMenuTitle = subMenuTitle;
|
11728 | };
|
11729 | };
|
11730 |
|
11731 | var connected = (0, _miniStore.connect)(function (_ref, _ref2) {
|
11732 | var openKeys = _ref.openKeys,
|
11733 | activeKey = _ref.activeKey,
|
11734 | selectedKeys = _ref.selectedKeys;
|
11735 | var eventKey = _ref2.eventKey,
|
11736 | subMenuKey = _ref2.subMenuKey;
|
11737 | return {
|
11738 | isOpen: openKeys.indexOf(eventKey) > -1,
|
11739 | active: activeKey[subMenuKey] === eventKey,
|
11740 | selectedKeys: selectedKeys
|
11741 | };
|
11742 | })(SubMenu);
|
11743 |
|
11744 | connected.isSubMenu = true;
|
11745 |
|
11746 | exports['default'] = connected;
|
11747 |
|
11748 | }),
|
11749 |
|
11750 | (function(module, exports, __webpack_require__) {
|
11751 |
|
11752 | 'use strict';
|
11753 |
|
11754 | exports.__esModule = true;
|
11755 |
|
11756 | var _extends2 = __webpack_require__(104);
|
11757 |
|
11758 | var _extends3 = _interopRequireDefault(_extends2);
|
11759 |
|
11760 | var _classCallCheck2 = __webpack_require__(143);
|
11761 |
|
11762 | var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
11763 |
|
11764 | var _possibleConstructorReturn2 = __webpack_require__(144);
|
11765 |
|
11766 | var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
11767 |
|
11768 | var _inherits2 = __webpack_require__(178);
|
11769 |
|
11770 | var _inherits3 = _interopRequireDefault(_inherits2);
|
11771 |
|
11772 | var _react = __webpack_require__(4);
|
11773 |
|
11774 | var _react2 = _interopRequireDefault(_react);
|
11775 |
|
11776 | var _propTypes = __webpack_require__(5);
|
11777 |
|
11778 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
11779 |
|
11780 | var _reactDom = __webpack_require__(12);
|
11781 |
|
11782 | var _contains = __webpack_require__(186);
|
11783 |
|
11784 | var _contains2 = _interopRequireDefault(_contains);
|
11785 |
|
11786 | var _addEventListener = __webpack_require__(187);
|
11787 |
|
11788 | var _addEventListener2 = _interopRequireDefault(_addEventListener);
|
11789 |
|
11790 | var _ContainerRender = __webpack_require__(188);
|
11791 |
|
11792 | var _ContainerRender2 = _interopRequireDefault(_ContainerRender);
|
11793 |
|
11794 | var _Portal = __webpack_require__(193);
|
11795 |
|
11796 | var _Portal2 = _interopRequireDefault(_Portal);
|
11797 |
|
11798 | var _classnames = __webpack_require__(3);
|
11799 |
|
11800 | var _classnames2 = _interopRequireDefault(_classnames);
|
11801 |
|
11802 | var _utils = __webpack_require__(194);
|
11803 |
|
11804 | var _Popup = __webpack_require__(195);
|
11805 |
|
11806 | var _Popup2 = _interopRequireDefault(_Popup);
|
11807 |
|
11808 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
11809 |
|
11810 | function noop() {}
|
11811 |
|
11812 | function returnEmptyString() {
|
11813 | return '';
|
11814 | }
|
11815 |
|
11816 | function returnDocument() {
|
11817 | return window.document;
|
11818 | }
|
11819 |
|
11820 | var ALL_HANDLERS = ['onClick', 'onMouseDown', 'onTouchStart', 'onMouseEnter', 'onMouseLeave', 'onFocus', 'onBlur', 'onContextMenu'];
|
11821 |
|
11822 | var IS_REACT_16 = !!_reactDom.createPortal;
|
11823 |
|
11824 | var contextTypes = {
|
11825 | rcTrigger: _propTypes2['default'].shape({
|
11826 | onPopupMouseDown: _propTypes2['default'].func
|
11827 | })
|
11828 | };
|
11829 |
|
11830 | var Trigger = function (_React$Component) {
|
11831 | (0, _inherits3['default'])(Trigger, _React$Component);
|
11832 |
|
11833 | function Trigger(props) {
|
11834 | (0, _classCallCheck3['default'])(this, Trigger);
|
11835 |
|
11836 | var _this = (0, _possibleConstructorReturn3['default'])(this, _React$Component.call(this, props));
|
11837 |
|
11838 | _initialiseProps.call(_this);
|
11839 |
|
11840 | var popupVisible = void 0;
|
11841 | if ('popupVisible' in props) {
|
11842 | popupVisible = !!props.popupVisible;
|
11843 | } else {
|
11844 | popupVisible = !!props.defaultPopupVisible;
|
11845 | }
|
11846 |
|
11847 | _this.prevPopupVisible = popupVisible;
|
11848 |
|
11849 | _this.state = {
|
11850 | popupVisible: popupVisible
|
11851 | };
|
11852 | return _this;
|
11853 | }
|
11854 |
|
11855 | Trigger.prototype.getChildContext = function getChildContext() {
|
11856 | return {
|
11857 | rcTrigger: {
|
11858 | onPopupMouseDown: this.onPopupMouseDown
|
11859 | }
|
11860 | };
|
11861 | };
|
11862 |
|
11863 | Trigger.prototype.componentWillMount = function componentWillMount() {
|
11864 | var _this2 = this;
|
11865 |
|
11866 | ALL_HANDLERS.forEach(function (h) {
|
11867 | _this2['fire' + h] = function (e) {
|
11868 | _this2.fireEvents(h, e);
|
11869 | };
|
11870 | });
|
11871 | };
|
11872 |
|
11873 | Trigger.prototype.componentDidMount = function componentDidMount() {
|
11874 | this.componentDidUpdate({}, {
|
11875 | popupVisible: this.state.popupVisible
|
11876 | });
|
11877 | };
|
11878 |
|
11879 | Trigger.prototype.componentWillReceiveProps = function componentWillReceiveProps(_ref) {
|
11880 | var popupVisible = _ref.popupVisible;
|
11881 |
|
11882 | if (popupVisible !== undefined) {
|
11883 | this.setState({
|
11884 | popupVisible: popupVisible
|
11885 | });
|
11886 | }
|
11887 | };
|
11888 |
|
11889 | Trigger.prototype.componentDidUpdate = function componentDidUpdate(_, prevState) {
|
11890 | var props = this.props;
|
11891 | var state = this.state;
|
11892 | var triggerAfterPopupVisibleChange = function triggerAfterPopupVisibleChange() {
|
11893 | if (prevState.popupVisible !== state.popupVisible) {
|
11894 | props.afterPopupVisibleChange(state.popupVisible);
|
11895 | }
|
11896 | };
|
11897 | if (!IS_REACT_16) {
|
11898 | this.renderComponent(null, triggerAfterPopupVisibleChange);
|
11899 | }
|
11900 |
|
11901 | this.prevPopupVisible = prevState.popupVisible;
|
11902 |
|
11903 |
|
11904 |
|
11905 |
|
11906 |
|
11907 | if (state.popupVisible) {
|
11908 | var currentDocument = void 0;
|
11909 | if (!this.clickOutsideHandler && (this.isClickToHide() || this.isContextMenuToShow())) {
|
11910 | currentDocument = props.getDocument();
|
11911 | this.clickOutsideHandler = (0, _addEventListener2['default'])(currentDocument, 'mousedown', this.onDocumentClick);
|
11912 | }
|
11913 |
|
11914 | if (!this.touchOutsideHandler) {
|
11915 | currentDocument = currentDocument || props.getDocument();
|
11916 | this.touchOutsideHandler = (0, _addEventListener2['default'])(currentDocument, 'touchstart', this.onDocumentClick);
|
11917 | }
|
11918 |
|
11919 | if (!this.contextMenuOutsideHandler1 && this.isContextMenuToShow()) {
|
11920 | currentDocument = currentDocument || props.getDocument();
|
11921 | this.contextMenuOutsideHandler1 = (0, _addEventListener2['default'])(currentDocument, 'scroll', this.onContextMenuClose);
|
11922 | }
|
11923 |
|
11924 | if (!this.contextMenuOutsideHandler2 && this.isContextMenuToShow()) {
|
11925 | this.contextMenuOutsideHandler2 = (0, _addEventListener2['default'])(window, 'blur', this.onContextMenuClose);
|
11926 | }
|
11927 | return;
|
11928 | }
|
11929 |
|
11930 | this.clearOutsideHandler();
|
11931 | };
|
11932 |
|
11933 | Trigger.prototype.componentWillUnmount = function componentWillUnmount() {
|
11934 | this.clearDelayTimer();
|
11935 | this.clearOutsideHandler();
|
11936 | clearTimeout(this.mouseDownTimeout);
|
11937 | };
|
11938 |
|
11939 | Trigger.prototype.getPopupDomNode = function getPopupDomNode() {
|
11940 |
|
11941 | if (this._component && this._component.getPopupDomNode) {
|
11942 | return this._component.getPopupDomNode();
|
11943 | }
|
11944 | return null;
|
11945 | };
|
11946 |
|
11947 | Trigger.prototype.getPopupAlign = function getPopupAlign() {
|
11948 | var props = this.props;
|
11949 | var popupPlacement = props.popupPlacement,
|
11950 | popupAlign = props.popupAlign,
|
11951 | builtinPlacements = props.builtinPlacements;
|
11952 |
|
11953 | if (popupPlacement && builtinPlacements) {
|
11954 | return (0, _utils.getAlignFromPlacement)(builtinPlacements, popupPlacement, popupAlign);
|
11955 | }
|
11956 | return popupAlign;
|
11957 | };
|
11958 |
|
11959 | |
11960 |
|
11961 |
|
11962 |
|
11963 | Trigger.prototype.setPopupVisible = function setPopupVisible(popupVisible, event) {
|
11964 | var alignPoint = this.props.alignPoint;
|
11965 |
|
11966 |
|
11967 | this.clearDelayTimer();
|
11968 |
|
11969 | if (this.state.popupVisible !== popupVisible) {
|
11970 | if (!('popupVisible' in this.props)) {
|
11971 | this.setState({ popupVisible: popupVisible });
|
11972 | }
|
11973 | this.props.onPopupVisibleChange(popupVisible);
|
11974 | }
|
11975 |
|
11976 |
|
11977 | if (alignPoint && event) {
|
11978 | this.setPoint(event);
|
11979 | }
|
11980 | };
|
11981 |
|
11982 | Trigger.prototype.delaySetPopupVisible = function delaySetPopupVisible(visible, delayS, event) {
|
11983 | var _this3 = this;
|
11984 |
|
11985 | var delay = delayS * 1000;
|
11986 | this.clearDelayTimer();
|
11987 | if (delay) {
|
11988 | var point = event ? { pageX: event.pageX, pageY: event.pageY } : null;
|
11989 | this.delayTimer = setTimeout(function () {
|
11990 | _this3.setPopupVisible(visible, point);
|
11991 | _this3.clearDelayTimer();
|
11992 | }, delay);
|
11993 | } else {
|
11994 | this.setPopupVisible(visible, event);
|
11995 | }
|
11996 | };
|
11997 |
|
11998 | Trigger.prototype.clearDelayTimer = function clearDelayTimer() {
|
11999 | if (this.delayTimer) {
|
12000 | clearTimeout(this.delayTimer);
|
12001 | this.delayTimer = null;
|
12002 | }
|
12003 | };
|
12004 |
|
12005 | Trigger.prototype.clearOutsideHandler = function clearOutsideHandler() {
|
12006 | if (this.clickOutsideHandler) {
|
12007 | this.clickOutsideHandler.remove();
|
12008 | this.clickOutsideHandler = null;
|
12009 | }
|
12010 |
|
12011 | if (this.contextMenuOutsideHandler1) {
|
12012 | this.contextMenuOutsideHandler1.remove();
|
12013 | this.contextMenuOutsideHandler1 = null;
|
12014 | }
|
12015 |
|
12016 | if (this.contextMenuOutsideHandler2) {
|
12017 | this.contextMenuOutsideHandler2.remove();
|
12018 | this.contextMenuOutsideHandler2 = null;
|
12019 | }
|
12020 |
|
12021 | if (this.touchOutsideHandler) {
|
12022 | this.touchOutsideHandler.remove();
|
12023 | this.touchOutsideHandler = null;
|
12024 | }
|
12025 | };
|
12026 |
|
12027 | Trigger.prototype.createTwoChains = function createTwoChains(event) {
|
12028 | var childPros = this.props.children.props;
|
12029 | var props = this.props;
|
12030 | if (childPros[event] && props[event]) {
|
12031 | return this['fire' + event];
|
12032 | }
|
12033 | return childPros[event] || props[event];
|
12034 | };
|
12035 |
|
12036 | Trigger.prototype.isClickToShow = function isClickToShow() {
|
12037 | var _props = this.props,
|
12038 | action = _props.action,
|
12039 | showAction = _props.showAction;
|
12040 |
|
12041 | return action.indexOf('click') !== -1 || showAction.indexOf('click') !== -1;
|
12042 | };
|
12043 |
|
12044 | Trigger.prototype.isContextMenuToShow = function isContextMenuToShow() {
|
12045 | var _props2 = this.props,
|
12046 | action = _props2.action,
|
12047 | showAction = _props2.showAction;
|
12048 |
|
12049 | return action.indexOf('contextMenu') !== -1 || showAction.indexOf('contextMenu') !== -1;
|
12050 | };
|
12051 |
|
12052 | Trigger.prototype.isClickToHide = function isClickToHide() {
|
12053 | var _props3 = this.props,
|
12054 | action = _props3.action,
|
12055 | hideAction = _props3.hideAction;
|
12056 |
|
12057 | return action.indexOf('click') !== -1 || hideAction.indexOf('click') !== -1;
|
12058 | };
|
12059 |
|
12060 | Trigger.prototype.isMouseEnterToShow = function isMouseEnterToShow() {
|
12061 | var _props4 = this.props,
|
12062 | action = _props4.action,
|
12063 | showAction = _props4.showAction;
|
12064 |
|
12065 | return action.indexOf('hover') !== -1 || showAction.indexOf('mouseEnter') !== -1;
|
12066 | };
|
12067 |
|
12068 | Trigger.prototype.isMouseLeaveToHide = function isMouseLeaveToHide() {
|
12069 | var _props5 = this.props,
|
12070 | action = _props5.action,
|
12071 | hideAction = _props5.hideAction;
|
12072 |
|
12073 | return action.indexOf('hover') !== -1 || hideAction.indexOf('mouseLeave') !== -1;
|
12074 | };
|
12075 |
|
12076 | Trigger.prototype.isFocusToShow = function isFocusToShow() {
|
12077 | var _props6 = this.props,
|
12078 | action = _props6.action,
|
12079 | showAction = _props6.showAction;
|
12080 |
|
12081 | return action.indexOf('focus') !== -1 || showAction.indexOf('focus') !== -1;
|
12082 | };
|
12083 |
|
12084 | Trigger.prototype.isBlurToHide = function isBlurToHide() {
|
12085 | var _props7 = this.props,
|
12086 | action = _props7.action,
|
12087 | hideAction = _props7.hideAction;
|
12088 |
|
12089 | return action.indexOf('focus') !== -1 || hideAction.indexOf('blur') !== -1;
|
12090 | };
|
12091 |
|
12092 | Trigger.prototype.forcePopupAlign = function forcePopupAlign() {
|
12093 | if (this.state.popupVisible && this._component && this._component.alignInstance) {
|
12094 | this._component.alignInstance.forceAlign();
|
12095 | }
|
12096 | };
|
12097 |
|
12098 | Trigger.prototype.fireEvents = function fireEvents(type, e) {
|
12099 | var childCallback = this.props.children.props[type];
|
12100 | if (childCallback) {
|
12101 | childCallback(e);
|
12102 | }
|
12103 | var callback = this.props[type];
|
12104 | if (callback) {
|
12105 | callback(e);
|
12106 | }
|
12107 | };
|
12108 |
|
12109 | Trigger.prototype.close = function close() {
|
12110 | this.setPopupVisible(false);
|
12111 | };
|
12112 |
|
12113 | Trigger.prototype.render = function render() {
|
12114 | var _this4 = this;
|
12115 |
|
12116 | var popupVisible = this.state.popupVisible;
|
12117 | var _props8 = this.props,
|
12118 | children = _props8.children,
|
12119 | forceRender = _props8.forceRender,
|
12120 | alignPoint = _props8.alignPoint,
|
12121 | className = _props8.className;
|
12122 |
|
12123 | var child = _react2['default'].Children.only(children);
|
12124 | var newChildProps = { key: 'trigger' };
|
12125 |
|
12126 | if (this.isContextMenuToShow()) {
|
12127 | newChildProps.onContextMenu = this.onContextMenu;
|
12128 | } else {
|
12129 | newChildProps.onContextMenu = this.createTwoChains('onContextMenu');
|
12130 | }
|
12131 |
|
12132 | if (this.isClickToHide() || this.isClickToShow()) {
|
12133 | newChildProps.onClick = this.onClick;
|
12134 | newChildProps.onMouseDown = this.onMouseDown;
|
12135 | newChildProps.onTouchStart = this.onTouchStart;
|
12136 | } else {
|
12137 | newChildProps.onClick = this.createTwoChains('onClick');
|
12138 | newChildProps.onMouseDown = this.createTwoChains('onMouseDown');
|
12139 | newChildProps.onTouchStart = this.createTwoChains('onTouchStart');
|
12140 | }
|
12141 | if (this.isMouseEnterToShow()) {
|
12142 | newChildProps.onMouseEnter = this.onMouseEnter;
|
12143 | if (alignPoint) {
|
12144 | newChildProps.onMouseMove = this.onMouseMove;
|
12145 | }
|
12146 | } else {
|
12147 | newChildProps.onMouseEnter = this.createTwoChains('onMouseEnter');
|
12148 | }
|
12149 | if (this.isMouseLeaveToHide()) {
|
12150 | newChildProps.onMouseLeave = this.onMouseLeave;
|
12151 | } else {
|
12152 | newChildProps.onMouseLeave = this.createTwoChains('onMouseLeave');
|
12153 | }
|
12154 | if (this.isFocusToShow() || this.isBlurToHide()) {
|
12155 | newChildProps.onFocus = this.onFocus;
|
12156 | newChildProps.onBlur = this.onBlur;
|
12157 | } else {
|
12158 | newChildProps.onFocus = this.createTwoChains('onFocus');
|
12159 | newChildProps.onBlur = this.createTwoChains('onBlur');
|
12160 | }
|
12161 |
|
12162 | var childrenClassName = (0, _classnames2['default'])(child && child.props && child.props.className, className);
|
12163 | if (childrenClassName) {
|
12164 | newChildProps.className = childrenClassName;
|
12165 | }
|
12166 | var trigger = _react2['default'].cloneElement(child, newChildProps);
|
12167 |
|
12168 | if (!IS_REACT_16) {
|
12169 | return _react2['default'].createElement(
|
12170 | _ContainerRender2['default'],
|
12171 | {
|
12172 | parent: this,
|
12173 | visible: popupVisible,
|
12174 | autoMount: false,
|
12175 | forceRender: forceRender,
|
12176 | getComponent: this.getComponent,
|
12177 | getContainer: this.getContainer
|
12178 | },
|
12179 | function (_ref2) {
|
12180 | var renderComponent = _ref2.renderComponent;
|
12181 |
|
12182 | _this4.renderComponent = renderComponent;
|
12183 | return trigger;
|
12184 | }
|
12185 | );
|
12186 | }
|
12187 |
|
12188 | var portal = void 0;
|
12189 |
|
12190 | if (popupVisible || this._component || forceRender) {
|
12191 | portal = _react2['default'].createElement(
|
12192 | _Portal2['default'],
|
12193 | {
|
12194 | key: 'portal',
|
12195 | getContainer: this.getContainer,
|
12196 | didUpdate: this.handlePortalUpdate
|
12197 | },
|
12198 | this.getComponent()
|
12199 | );
|
12200 | }
|
12201 |
|
12202 | return [trigger, portal];
|
12203 | };
|
12204 |
|
12205 | return Trigger;
|
12206 | }(_react2['default'].Component);
|
12207 |
|
12208 | Trigger.propTypes = {
|
12209 | children: _propTypes2['default'].any,
|
12210 | action: _propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].arrayOf(_propTypes2['default'].string)]),
|
12211 | showAction: _propTypes2['default'].any,
|
12212 | hideAction: _propTypes2['default'].any,
|
12213 | getPopupClassNameFromAlign: _propTypes2['default'].any,
|
12214 | onPopupVisibleChange: _propTypes2['default'].func,
|
12215 | afterPopupVisibleChange: _propTypes2['default'].func,
|
12216 | popup: _propTypes2['default'].oneOfType([_propTypes2['default'].node, _propTypes2['default'].func]).isRequired,
|
12217 | popupStyle: _propTypes2['default'].object,
|
12218 | prefixCls: _propTypes2['default'].string,
|
12219 | popupClassName: _propTypes2['default'].string,
|
12220 | className: _propTypes2['default'].string,
|
12221 | popupPlacement: _propTypes2['default'].string,
|
12222 | builtinPlacements: _propTypes2['default'].object,
|
12223 | popupTransitionName: _propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].object]),
|
12224 | popupAnimation: _propTypes2['default'].any,
|
12225 | mouseEnterDelay: _propTypes2['default'].number,
|
12226 | mouseLeaveDelay: _propTypes2['default'].number,
|
12227 | zIndex: _propTypes2['default'].number,
|
12228 | focusDelay: _propTypes2['default'].number,
|
12229 | blurDelay: _propTypes2['default'].number,
|
12230 | getPopupContainer: _propTypes2['default'].func,
|
12231 | getDocument: _propTypes2['default'].func,
|
12232 | forceRender: _propTypes2['default'].bool,
|
12233 | destroyPopupOnHide: _propTypes2['default'].bool,
|
12234 | mask: _propTypes2['default'].bool,
|
12235 | maskClosable: _propTypes2['default'].bool,
|
12236 | onPopupAlign: _propTypes2['default'].func,
|
12237 | popupAlign: _propTypes2['default'].object,
|
12238 | popupVisible: _propTypes2['default'].bool,
|
12239 | defaultPopupVisible: _propTypes2['default'].bool,
|
12240 | maskTransitionName: _propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].object]),
|
12241 | maskAnimation: _propTypes2['default'].string,
|
12242 | stretch: _propTypes2['default'].string,
|
12243 | alignPoint: _propTypes2['default'].bool
|
12244 | };
|
12245 | Trigger.contextTypes = contextTypes;
|
12246 | Trigger.childContextTypes = contextTypes;
|
12247 | Trigger.defaultProps = {
|
12248 | prefixCls: 'rc-trigger-popup',
|
12249 | getPopupClassNameFromAlign: returnEmptyString,
|
12250 | getDocument: returnDocument,
|
12251 | onPopupVisibleChange: noop,
|
12252 | afterPopupVisibleChange: noop,
|
12253 | onPopupAlign: noop,
|
12254 | popupClassName: '',
|
12255 | mouseEnterDelay: 0,
|
12256 | mouseLeaveDelay: 0.1,
|
12257 | focusDelay: 0,
|
12258 | blurDelay: 0.15,
|
12259 | popupStyle: {},
|
12260 | destroyPopupOnHide: false,
|
12261 | popupAlign: {},
|
12262 | defaultPopupVisible: false,
|
12263 | mask: false,
|
12264 | maskClosable: true,
|
12265 | action: [],
|
12266 | showAction: [],
|
12267 | hideAction: []
|
12268 | };
|
12269 |
|
12270 | var _initialiseProps = function _initialiseProps() {
|
12271 | var _this5 = this;
|
12272 |
|
12273 | this.onMouseEnter = function (e) {
|
12274 | var mouseEnterDelay = _this5.props.mouseEnterDelay;
|
12275 |
|
12276 | _this5.fireEvents('onMouseEnter', e);
|
12277 | _this5.delaySetPopupVisible(true, mouseEnterDelay, mouseEnterDelay ? null : e);
|
12278 | };
|
12279 |
|
12280 | this.onMouseMove = function (e) {
|
12281 | _this5.fireEvents('onMouseMove', e);
|
12282 | _this5.setPoint(e);
|
12283 | };
|
12284 |
|
12285 | this.onMouseLeave = function (e) {
|
12286 | _this5.fireEvents('onMouseLeave', e);
|
12287 | _this5.delaySetPopupVisible(false, _this5.props.mouseLeaveDelay);
|
12288 | };
|
12289 |
|
12290 | this.onPopupMouseEnter = function () {
|
12291 | _this5.clearDelayTimer();
|
12292 | };
|
12293 |
|
12294 | this.onPopupMouseLeave = function (e) {
|
12295 |
|
12296 |
|
12297 | if (e.relatedTarget && !e.relatedTarget.setTimeout && _this5._component && _this5._component.getPopupDomNode && (0, _contains2['default'])(_this5._component.getPopupDomNode(), e.relatedTarget)) {
|
12298 | return;
|
12299 | }
|
12300 | _this5.delaySetPopupVisible(false, _this5.props.mouseLeaveDelay);
|
12301 | };
|
12302 |
|
12303 | this.onFocus = function (e) {
|
12304 | _this5.fireEvents('onFocus', e);
|
12305 |
|
12306 | _this5.clearDelayTimer();
|
12307 | if (_this5.isFocusToShow()) {
|
12308 | _this5.focusTime = Date.now();
|
12309 | _this5.delaySetPopupVisible(true, _this5.props.focusDelay);
|
12310 | }
|
12311 | };
|
12312 |
|
12313 | this.onMouseDown = function (e) {
|
12314 | _this5.fireEvents('onMouseDown', e);
|
12315 | _this5.preClickTime = Date.now();
|
12316 | };
|
12317 |
|
12318 | this.onTouchStart = function (e) {
|
12319 | _this5.fireEvents('onTouchStart', e);
|
12320 | _this5.preTouchTime = Date.now();
|
12321 | };
|
12322 |
|
12323 | this.onBlur = function (e) {
|
12324 | _this5.fireEvents('onBlur', e);
|
12325 | _this5.clearDelayTimer();
|
12326 | if (_this5.isBlurToHide()) {
|
12327 | _this5.delaySetPopupVisible(false, _this5.props.blurDelay);
|
12328 | }
|
12329 | };
|
12330 |
|
12331 | this.onContextMenu = function (e) {
|
12332 | e.preventDefault();
|
12333 | _this5.fireEvents('onContextMenu', e);
|
12334 | _this5.setPopupVisible(true, e);
|
12335 | };
|
12336 |
|
12337 | this.onContextMenuClose = function () {
|
12338 | if (_this5.isContextMenuToShow()) {
|
12339 | _this5.close();
|
12340 | }
|
12341 | };
|
12342 |
|
12343 | this.onClick = function (event) {
|
12344 | _this5.fireEvents('onClick', event);
|
12345 |
|
12346 | if (_this5.focusTime) {
|
12347 | var preTime = void 0;
|
12348 | if (_this5.preClickTime && _this5.preTouchTime) {
|
12349 | preTime = Math.min(_this5.preClickTime, _this5.preTouchTime);
|
12350 | } else if (_this5.preClickTime) {
|
12351 | preTime = _this5.preClickTime;
|
12352 | } else if (_this5.preTouchTime) {
|
12353 | preTime = _this5.preTouchTime;
|
12354 | }
|
12355 | if (Math.abs(preTime - _this5.focusTime) < 20) {
|
12356 | return;
|
12357 | }
|
12358 | _this5.focusTime = 0;
|
12359 | }
|
12360 | _this5.preClickTime = 0;
|
12361 | _this5.preTouchTime = 0;
|
12362 | if (event && event.preventDefault) {
|
12363 | event.preventDefault();
|
12364 | }
|
12365 | var nextVisible = !_this5.state.popupVisible;
|
12366 | if (_this5.isClickToHide() && !nextVisible || nextVisible && _this5.isClickToShow()) {
|
12367 | _this5.setPopupVisible(!_this5.state.popupVisible, event);
|
12368 | }
|
12369 | };
|
12370 |
|
12371 | this.onPopupMouseDown = function () {
|
12372 | var _context$rcTrigger = _this5.context.rcTrigger,
|
12373 | rcTrigger = _context$rcTrigger === undefined ? {} : _context$rcTrigger;
|
12374 |
|
12375 | _this5.hasPopupMouseDown = true;
|
12376 |
|
12377 | clearTimeout(_this5.mouseDownTimeout);
|
12378 | _this5.mouseDownTimeout = setTimeout(function () {
|
12379 | _this5.hasPopupMouseDown = false;
|
12380 | }, 0);
|
12381 |
|
12382 | if (rcTrigger.onPopupMouseDown) {
|
12383 | rcTrigger.onPopupMouseDown.apply(rcTrigger, arguments);
|
12384 | }
|
12385 | };
|
12386 |
|
12387 | this.onDocumentClick = function (event) {
|
12388 | if (_this5.props.mask && !_this5.props.maskClosable) {
|
12389 | return;
|
12390 | }
|
12391 |
|
12392 | var target = event.target;
|
12393 | var root = (0, _reactDom.findDOMNode)(_this5);
|
12394 | if (!(0, _contains2['default'])(root, target) && !_this5.hasPopupMouseDown) {
|
12395 | _this5.close();
|
12396 | }
|
12397 | };
|
12398 |
|
12399 | this.getRootDomNode = function () {
|
12400 | return (0, _reactDom.findDOMNode)(_this5);
|
12401 | };
|
12402 |
|
12403 | this.getPopupClassNameFromAlign = function (align) {
|
12404 | var className = [];
|
12405 | var _props9 = _this5.props,
|
12406 | popupPlacement = _props9.popupPlacement,
|
12407 | builtinPlacements = _props9.builtinPlacements,
|
12408 | prefixCls = _props9.prefixCls,
|
12409 | alignPoint = _props9.alignPoint,
|
12410 | getPopupClassNameFromAlign = _props9.getPopupClassNameFromAlign;
|
12411 |
|
12412 | if (popupPlacement && builtinPlacements) {
|
12413 | className.push((0, _utils.getAlignPopupClassName)(builtinPlacements, prefixCls, align, alignPoint));
|
12414 | }
|
12415 | if (getPopupClassNameFromAlign) {
|
12416 | className.push(getPopupClassNameFromAlign(align));
|
12417 | }
|
12418 | return className.join(' ');
|
12419 | };
|
12420 |
|
12421 | this.getComponent = function () {
|
12422 | var _props10 = _this5.props,
|
12423 | prefixCls = _props10.prefixCls,
|
12424 | destroyPopupOnHide = _props10.destroyPopupOnHide,
|
12425 | popupClassName = _props10.popupClassName,
|
12426 | action = _props10.action,
|
12427 | onPopupAlign = _props10.onPopupAlign,
|
12428 | popupAnimation = _props10.popupAnimation,
|
12429 | popupTransitionName = _props10.popupTransitionName,
|
12430 | popupStyle = _props10.popupStyle,
|
12431 | mask = _props10.mask,
|
12432 | maskAnimation = _props10.maskAnimation,
|
12433 | maskTransitionName = _props10.maskTransitionName,
|
12434 | zIndex = _props10.zIndex,
|
12435 | popup = _props10.popup,
|
12436 | stretch = _props10.stretch,
|
12437 | alignPoint = _props10.alignPoint;
|
12438 | var _state = _this5.state,
|
12439 | popupVisible = _state.popupVisible,
|
12440 | point = _state.point;
|
12441 |
|
12442 |
|
12443 | var align = _this5.getPopupAlign();
|
12444 |
|
12445 | var mouseProps = {};
|
12446 | if (_this5.isMouseEnterToShow()) {
|
12447 | mouseProps.onMouseEnter = _this5.onPopupMouseEnter;
|
12448 | }
|
12449 | if (_this5.isMouseLeaveToHide()) {
|
12450 | mouseProps.onMouseLeave = _this5.onPopupMouseLeave;
|
12451 | }
|
12452 |
|
12453 | mouseProps.onMouseDown = _this5.onPopupMouseDown;
|
12454 | mouseProps.onTouchStart = _this5.onPopupMouseDown;
|
12455 |
|
12456 | return _react2['default'].createElement(
|
12457 | _Popup2['default'],
|
12458 | (0, _extends3['default'])({
|
12459 | prefixCls: prefixCls,
|
12460 | destroyPopupOnHide: destroyPopupOnHide,
|
12461 | visible: popupVisible,
|
12462 | point: alignPoint && point,
|
12463 | className: popupClassName,
|
12464 | action: action,
|
12465 | align: align,
|
12466 | onAlign: onPopupAlign,
|
12467 | animation: popupAnimation,
|
12468 | getClassNameFromAlign: _this5.getPopupClassNameFromAlign
|
12469 | }, mouseProps, {
|
12470 | stretch: stretch,
|
12471 | getRootDomNode: _this5.getRootDomNode,
|
12472 | style: popupStyle,
|
12473 | mask: mask,
|
12474 | zIndex: zIndex,
|
12475 | transitionName: popupTransitionName,
|
12476 | maskAnimation: maskAnimation,
|
12477 | maskTransitionName: maskTransitionName,
|
12478 | ref: _this5.savePopup
|
12479 | }),
|
12480 | typeof popup === 'function' ? popup() : popup
|
12481 | );
|
12482 | };
|
12483 |
|
12484 | this.getContainer = function () {
|
12485 | var props = _this5.props;
|
12486 |
|
12487 | var popupContainer = document.createElement('div');
|
12488 |
|
12489 |
|
12490 | popupContainer.style.position = 'absolute';
|
12491 | popupContainer.style.top = '0';
|
12492 | popupContainer.style.left = '0';
|
12493 | popupContainer.style.width = '100%';
|
12494 | var mountNode = props.getPopupContainer ? props.getPopupContainer((0, _reactDom.findDOMNode)(_this5)) : props.getDocument().body;
|
12495 | mountNode.appendChild(popupContainer);
|
12496 | return popupContainer;
|
12497 | };
|
12498 |
|
12499 | this.setPoint = function (point) {
|
12500 | var alignPoint = _this5.props.alignPoint;
|
12501 |
|
12502 | if (!alignPoint || !point) return;
|
12503 |
|
12504 | _this5.setState({
|
12505 | point: {
|
12506 | pageX: point.pageX,
|
12507 | pageY: point.pageY
|
12508 | }
|
12509 | });
|
12510 | };
|
12511 |
|
12512 | this.handlePortalUpdate = function () {
|
12513 | if (_this5.prevPopupVisible !== _this5.state.popupVisible) {
|
12514 | _this5.props.afterPopupVisibleChange(_this5.state.popupVisible);
|
12515 | }
|
12516 | };
|
12517 |
|
12518 | this.savePopup = function (node) {
|
12519 | _this5._component = node;
|
12520 | };
|
12521 | };
|
12522 |
|
12523 | exports['default'] = Trigger;
|
12524 | module.exports = exports['default'];
|
12525 |
|
12526 | }),
|
12527 |
|
12528 | (function(module, exports, __webpack_require__) {
|
12529 |
|
12530 | "use strict";
|
12531 |
|
12532 | exports.__esModule = true;
|
12533 |
|
12534 | var _assign = __webpack_require__(105);
|
12535 |
|
12536 | var _assign2 = _interopRequireDefault(_assign);
|
12537 |
|
12538 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
12539 |
|
12540 | exports.default = _assign2.default || function (target) {
|
12541 | for (var i = 1; i < arguments.length; i++) {
|
12542 | var source = arguments[i];
|
12543 |
|
12544 | for (var key in source) {
|
12545 | if (Object.prototype.hasOwnProperty.call(source, key)) {
|
12546 | target[key] = source[key];
|
12547 | }
|
12548 | }
|
12549 | }
|
12550 |
|
12551 | return target;
|
12552 | };
|
12553 |
|
12554 | }),
|
12555 |
|
12556 | (function(module, exports, __webpack_require__) {
|
12557 |
|
12558 | module.exports = { "default": __webpack_require__(106), __esModule: true };
|
12559 |
|
12560 | }),
|
12561 |
|
12562 | (function(module, exports, __webpack_require__) {
|
12563 |
|
12564 | __webpack_require__(107);
|
12565 | module.exports = __webpack_require__(110).Object.assign;
|
12566 |
|
12567 |
|
12568 | }),
|
12569 |
|
12570 | (function(module, exports, __webpack_require__) {
|
12571 |
|
12572 |
|
12573 | var $export = __webpack_require__(108);
|
12574 |
|
12575 | $export($export.S + $export.F, 'Object', { assign: __webpack_require__(124) });
|
12576 |
|
12577 |
|
12578 | }),
|
12579 |
|
12580 | (function(module, exports, __webpack_require__) {
|
12581 |
|
12582 | var global = __webpack_require__(109);
|
12583 | var core = __webpack_require__(110);
|
12584 | var ctx = __webpack_require__(111);
|
12585 | var hide = __webpack_require__(113);
|
12586 | var has = __webpack_require__(123);
|
12587 | var PROTOTYPE = 'prototype';
|
12588 |
|
12589 | var $export = function (type, name, source) {
|
12590 | var IS_FORCED = type & $export.F;
|
12591 | var IS_GLOBAL = type & $export.G;
|
12592 | var IS_STATIC = type & $export.S;
|
12593 | var IS_PROTO = type & $export.P;
|
12594 | var IS_BIND = type & $export.B;
|
12595 | var IS_WRAP = type & $export.W;
|
12596 | var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
|
12597 | var expProto = exports[PROTOTYPE];
|
12598 | var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];
|
12599 | var key, own, out;
|
12600 | if (IS_GLOBAL) source = name;
|
12601 | for (key in source) {
|
12602 |
|
12603 | own = !IS_FORCED && target && target[key] !== undefined;
|
12604 | if (own && has(exports, key)) continue;
|
12605 |
|
12606 | out = own ? target[key] : source[key];
|
12607 |
|
12608 | exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
|
12609 |
|
12610 | : IS_BIND && own ? ctx(out, global)
|
12611 |
|
12612 | : IS_WRAP && target[key] == out ? (function (C) {
|
12613 | var F = function (a, b, c) {
|
12614 | if (this instanceof C) {
|
12615 | switch (arguments.length) {
|
12616 | case 0: return new C();
|
12617 | case 1: return new C(a);
|
12618 | case 2: return new C(a, b);
|
12619 | } return new C(a, b, c);
|
12620 | } return C.apply(this, arguments);
|
12621 | };
|
12622 | F[PROTOTYPE] = C[PROTOTYPE];
|
12623 | return F;
|
12624 |
|
12625 | })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
|
12626 |
|
12627 | if (IS_PROTO) {
|
12628 | (exports.virtual || (exports.virtual = {}))[key] = out;
|
12629 |
|
12630 | if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);
|
12631 | }
|
12632 | }
|
12633 | };
|
12634 |
|
12635 | $export.F = 1;
|
12636 | $export.G = 2;
|
12637 | $export.S = 4;
|
12638 | $export.P = 8;
|
12639 | $export.B = 16;
|
12640 | $export.W = 32;
|
12641 | $export.U = 64;
|
12642 | $export.R = 128;
|
12643 | module.exports = $export;
|
12644 |
|
12645 |
|
12646 | }),
|
12647 |
|
12648 | (function(module, exports) {
|
12649 |
|
12650 |
|
12651 | var global = module.exports = typeof window != 'undefined' && window.Math == Math
|
12652 | ? window : typeof self != 'undefined' && self.Math == Math ? self
|
12653 |
|
12654 | : Function('return this')();
|
12655 | if (typeof __g == 'number') __g = global;
|
12656 |
|
12657 |
|
12658 | }),
|
12659 |
|
12660 | (function(module, exports) {
|
12661 |
|
12662 | var core = module.exports = { version: '2.6.3' };
|
12663 | if (typeof __e == 'number') __e = core;
|
12664 |
|
12665 |
|
12666 | }),
|
12667 |
|
12668 | (function(module, exports, __webpack_require__) {
|
12669 |
|
12670 |
|
12671 | var aFunction = __webpack_require__(112);
|
12672 | module.exports = function (fn, that, length) {
|
12673 | aFunction(fn);
|
12674 | if (that === undefined) return fn;
|
12675 | switch (length) {
|
12676 | case 1: return function (a) {
|
12677 | return fn.call(that, a);
|
12678 | };
|
12679 | case 2: return function (a, b) {
|
12680 | return fn.call(that, a, b);
|
12681 | };
|
12682 | case 3: return function (a, b, c) {
|
12683 | return fn.call(that, a, b, c);
|
12684 | };
|
12685 | }
|
12686 | return function (/* ...args */) {
|
12687 | return fn.apply(that, arguments);
|
12688 | };
|
12689 | };
|
12690 |
|
12691 |
|
12692 | }),
|
12693 |
|
12694 | (function(module, exports) {
|
12695 |
|
12696 | module.exports = function (it) {
|
12697 | if (typeof it != 'function') throw TypeError(it + ' is not a function!');
|
12698 | return it;
|
12699 | };
|
12700 |
|
12701 |
|
12702 | }),
|
12703 |
|
12704 | (function(module, exports, __webpack_require__) {
|
12705 |
|
12706 | var dP = __webpack_require__(114);
|
12707 | var createDesc = __webpack_require__(122);
|
12708 | module.exports = __webpack_require__(118) ? function (object, key, value) {
|
12709 | return dP.f(object, key, createDesc(1, value));
|
12710 | } : function (object, key, value) {
|
12711 | object[key] = value;
|
12712 | return object;
|
12713 | };
|
12714 |
|
12715 |
|
12716 | }),
|
12717 |
|
12718 | (function(module, exports, __webpack_require__) {
|
12719 |
|
12720 | var anObject = __webpack_require__(115);
|
12721 | var IE8_DOM_DEFINE = __webpack_require__(117);
|
12722 | var toPrimitive = __webpack_require__(121);
|
12723 | var dP = Object.defineProperty;
|
12724 |
|
12725 | exports.f = __webpack_require__(118) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
|
12726 | anObject(O);
|
12727 | P = toPrimitive(P, true);
|
12728 | anObject(Attributes);
|
12729 | if (IE8_DOM_DEFINE) try {
|
12730 | return dP(O, P, Attributes);
|
12731 | } catch (e) { }
|
12732 | if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
|
12733 | if ('value' in Attributes) O[P] = Attributes.value;
|
12734 | return O;
|
12735 | };
|
12736 |
|
12737 |
|
12738 | }),
|
12739 |
|
12740 | (function(module, exports, __webpack_require__) {
|
12741 |
|
12742 | var isObject = __webpack_require__(116);
|
12743 | module.exports = function (it) {
|
12744 | if (!isObject(it)) throw TypeError(it + ' is not an object!');
|
12745 | return it;
|
12746 | };
|
12747 |
|
12748 |
|
12749 | }),
|
12750 |
|
12751 | (function(module, exports) {
|
12752 |
|
12753 | module.exports = function (it) {
|
12754 | return typeof it === 'object' ? it !== null : typeof it === 'function';
|
12755 | };
|
12756 |
|
12757 |
|
12758 | }),
|
12759 |
|
12760 | (function(module, exports, __webpack_require__) {
|
12761 |
|
12762 | module.exports = !__webpack_require__(118) && !__webpack_require__(119)(function () {
|
12763 | return Object.defineProperty(__webpack_require__(120)('div'), 'a', { get: function () { return 7; } }).a != 7;
|
12764 | });
|
12765 |
|
12766 |
|
12767 | }),
|
12768 |
|
12769 | (function(module, exports, __webpack_require__) {
|
12770 |
|
12771 |
|
12772 | module.exports = !__webpack_require__(119)(function () {
|
12773 | return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
|
12774 | });
|
12775 |
|
12776 |
|
12777 | }),
|
12778 |
|
12779 | (function(module, exports) {
|
12780 |
|
12781 | module.exports = function (exec) {
|
12782 | try {
|
12783 | return !!exec();
|
12784 | } catch (e) {
|
12785 | return true;
|
12786 | }
|
12787 | };
|
12788 |
|
12789 |
|
12790 | }),
|
12791 |
|
12792 | (function(module, exports, __webpack_require__) {
|
12793 |
|
12794 | var isObject = __webpack_require__(116);
|
12795 | var document = __webpack_require__(109).document;
|
12796 |
|
12797 | var is = isObject(document) && isObject(document.createElement);
|
12798 | module.exports = function (it) {
|
12799 | return is ? document.createElement(it) : {};
|
12800 | };
|
12801 |
|
12802 |
|
12803 | }),
|
12804 |
|
12805 | (function(module, exports, __webpack_require__) {
|
12806 |
|
12807 |
|
12808 | var isObject = __webpack_require__(116);
|
12809 |
|
12810 |
|
12811 | module.exports = function (it, S) {
|
12812 | if (!isObject(it)) return it;
|
12813 | var fn, val;
|
12814 | if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
|
12815 | if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
|
12816 | if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
|
12817 | throw TypeError("Can't convert object to primitive value");
|
12818 | };
|
12819 |
|
12820 |
|
12821 | }),
|
12822 |
|
12823 | (function(module, exports) {
|
12824 |
|
12825 | module.exports = function (bitmap, value) {
|
12826 | return {
|
12827 | enumerable: !(bitmap & 1),
|
12828 | configurable: !(bitmap & 2),
|
12829 | writable: !(bitmap & 4),
|
12830 | value: value
|
12831 | };
|
12832 | };
|
12833 |
|
12834 |
|
12835 | }),
|
12836 |
|
12837 | (function(module, exports) {
|
12838 |
|
12839 | var hasOwnProperty = {}.hasOwnProperty;
|
12840 | module.exports = function (it, key) {
|
12841 | return hasOwnProperty.call(it, key);
|
12842 | };
|
12843 |
|
12844 |
|
12845 | }),
|
12846 |
|
12847 | (function(module, exports, __webpack_require__) {
|
12848 |
|
12849 | 'use strict';
|
12850 |
|
12851 | var getKeys = __webpack_require__(125);
|
12852 | var gOPS = __webpack_require__(140);
|
12853 | var pIE = __webpack_require__(141);
|
12854 | var toObject = __webpack_require__(142);
|
12855 | var IObject = __webpack_require__(128);
|
12856 | var $assign = Object.assign;
|
12857 |
|
12858 |
|
12859 | module.exports = !$assign || __webpack_require__(119)(function () {
|
12860 | var A = {};
|
12861 | var B = {};
|
12862 |
|
12863 | var S = Symbol();
|
12864 | var K = 'abcdefghijklmnopqrst';
|
12865 | A[S] = 7;
|
12866 | K.split('').forEach(function (k) { B[k] = k; });
|
12867 | return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
|
12868 | }) ? function assign(target, source) {
|
12869 | var T = toObject(target);
|
12870 | var aLen = arguments.length;
|
12871 | var index = 1;
|
12872 | var getSymbols = gOPS.f;
|
12873 | var isEnum = pIE.f;
|
12874 | while (aLen > index) {
|
12875 | var S = IObject(arguments[index++]);
|
12876 | var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);
|
12877 | var length = keys.length;
|
12878 | var j = 0;
|
12879 | var key;
|
12880 | while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];
|
12881 | } return T;
|
12882 | } : $assign;
|
12883 |
|
12884 |
|
12885 | }),
|
12886 |
|
12887 | (function(module, exports, __webpack_require__) {
|
12888 |
|
12889 |
|
12890 | var $keys = __webpack_require__(126);
|
12891 | var enumBugKeys = __webpack_require__(139);
|
12892 |
|
12893 | module.exports = Object.keys || function keys(O) {
|
12894 | return $keys(O, enumBugKeys);
|
12895 | };
|
12896 |
|
12897 |
|
12898 | }),
|
12899 |
|
12900 | (function(module, exports, __webpack_require__) {
|
12901 |
|
12902 | var has = __webpack_require__(123);
|
12903 | var toIObject = __webpack_require__(127);
|
12904 | var arrayIndexOf = __webpack_require__(131)(false);
|
12905 | var IE_PROTO = __webpack_require__(135)('IE_PROTO');
|
12906 |
|
12907 | module.exports = function (object, names) {
|
12908 | var O = toIObject(object);
|
12909 | var i = 0;
|
12910 | var result = [];
|
12911 | var key;
|
12912 | for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
|
12913 |
|
12914 | while (names.length > i) if (has(O, key = names[i++])) {
|
12915 | ~arrayIndexOf(result, key) || result.push(key);
|
12916 | }
|
12917 | return result;
|
12918 | };
|
12919 |
|
12920 |
|
12921 | }),
|
12922 |
|
12923 | (function(module, exports, __webpack_require__) {
|
12924 |
|
12925 |
|
12926 | var IObject = __webpack_require__(128);
|
12927 | var defined = __webpack_require__(130);
|
12928 | module.exports = function (it) {
|
12929 | return IObject(defined(it));
|
12930 | };
|
12931 |
|
12932 |
|
12933 | }),
|
12934 |
|
12935 | (function(module, exports, __webpack_require__) {
|
12936 |
|
12937 |
|
12938 | var cof = __webpack_require__(129);
|
12939 |
|
12940 | module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
|
12941 | return cof(it) == 'String' ? it.split('') : Object(it);
|
12942 | };
|
12943 |
|
12944 |
|
12945 | }),
|
12946 |
|
12947 | (function(module, exports) {
|
12948 |
|
12949 | var toString = {}.toString;
|
12950 |
|
12951 | module.exports = function (it) {
|
12952 | return toString.call(it).slice(8, -1);
|
12953 | };
|
12954 |
|
12955 |
|
12956 | }),
|
12957 |
|
12958 | (function(module, exports) {
|
12959 |
|
12960 |
|
12961 | module.exports = function (it) {
|
12962 | if (it == undefined) throw TypeError("Can't call method on " + it);
|
12963 | return it;
|
12964 | };
|
12965 |
|
12966 |
|
12967 | }),
|
12968 |
|
12969 | (function(module, exports, __webpack_require__) {
|
12970 |
|
12971 |
|
12972 |
|
12973 | var toIObject = __webpack_require__(127);
|
12974 | var toLength = __webpack_require__(132);
|
12975 | var toAbsoluteIndex = __webpack_require__(134);
|
12976 | module.exports = function (IS_INCLUDES) {
|
12977 | return function ($this, el, fromIndex) {
|
12978 | var O = toIObject($this);
|
12979 | var length = toLength(O.length);
|
12980 | var index = toAbsoluteIndex(fromIndex, length);
|
12981 | var value;
|
12982 |
|
12983 |
|
12984 | if (IS_INCLUDES && el != el) while (length > index) {
|
12985 | value = O[index++];
|
12986 |
|
12987 | if (value != value) return true;
|
12988 |
|
12989 | } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
|
12990 | if (O[index] === el) return IS_INCLUDES || index || 0;
|
12991 | } return !IS_INCLUDES && -1;
|
12992 | };
|
12993 | };
|
12994 |
|
12995 |
|
12996 | }),
|
12997 |
|
12998 | (function(module, exports, __webpack_require__) {
|
12999 |
|
13000 |
|
13001 | var toInteger = __webpack_require__(133);
|
13002 | var min = Math.min;
|
13003 | module.exports = function (it) {
|
13004 | return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0;
|
13005 | };
|
13006 |
|
13007 |
|
13008 | }),
|
13009 |
|
13010 | (function(module, exports) {
|
13011 |
|
13012 |
|
13013 | var ceil = Math.ceil;
|
13014 | var floor = Math.floor;
|
13015 | module.exports = function (it) {
|
13016 | return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
|
13017 | };
|
13018 |
|
13019 |
|
13020 | }),
|
13021 |
|
13022 | (function(module, exports, __webpack_require__) {
|
13023 |
|
13024 | var toInteger = __webpack_require__(133);
|
13025 | var max = Math.max;
|
13026 | var min = Math.min;
|
13027 | module.exports = function (index, length) {
|
13028 | index = toInteger(index);
|
13029 | return index < 0 ? max(index + length, 0) : min(index, length);
|
13030 | };
|
13031 |
|
13032 |
|
13033 | }),
|
13034 |
|
13035 | (function(module, exports, __webpack_require__) {
|
13036 |
|
13037 | var shared = __webpack_require__(136)('keys');
|
13038 | var uid = __webpack_require__(138);
|
13039 | module.exports = function (key) {
|
13040 | return shared[key] || (shared[key] = uid(key));
|
13041 | };
|
13042 |
|
13043 |
|
13044 | }),
|
13045 |
|
13046 | (function(module, exports, __webpack_require__) {
|
13047 |
|
13048 | var core = __webpack_require__(110);
|
13049 | var global = __webpack_require__(109);
|
13050 | var SHARED = '__core-js_shared__';
|
13051 | var store = global[SHARED] || (global[SHARED] = {});
|
13052 |
|
13053 | (module.exports = function (key, value) {
|
13054 | return store[key] || (store[key] = value !== undefined ? value : {});
|
13055 | })('versions', []).push({
|
13056 | version: core.version,
|
13057 | mode: __webpack_require__(137) ? 'pure' : 'global',
|
13058 | copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
|
13059 | });
|
13060 |
|
13061 |
|
13062 | }),
|
13063 |
|
13064 | (function(module, exports) {
|
13065 |
|
13066 | module.exports = true;
|
13067 |
|
13068 |
|
13069 | }),
|
13070 |
|
13071 | (function(module, exports) {
|
13072 |
|
13073 | var id = 0;
|
13074 | var px = Math.random();
|
13075 | module.exports = function (key) {
|
13076 | return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
|
13077 | };
|
13078 |
|
13079 |
|
13080 | }),
|
13081 |
|
13082 | (function(module, exports) {
|
13083 |
|
13084 |
|
13085 | module.exports = (
|
13086 | 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
|
13087 | ).split(',');
|
13088 |
|
13089 |
|
13090 | }),
|
13091 |
|
13092 | (function(module, exports) {
|
13093 |
|
13094 | exports.f = Object.getOwnPropertySymbols;
|
13095 |
|
13096 |
|
13097 | }),
|
13098 |
|
13099 | (function(module, exports) {
|
13100 |
|
13101 | exports.f = {}.propertyIsEnumerable;
|
13102 |
|
13103 |
|
13104 | }),
|
13105 |
|
13106 | (function(module, exports, __webpack_require__) {
|
13107 |
|
13108 |
|
13109 | var defined = __webpack_require__(130);
|
13110 | module.exports = function (it) {
|
13111 | return Object(defined(it));
|
13112 | };
|
13113 |
|
13114 |
|
13115 | }),
|
13116 |
|
13117 | (function(module, exports) {
|
13118 |
|
13119 | "use strict";
|
13120 |
|
13121 | exports.__esModule = true;
|
13122 |
|
13123 | exports.default = function (instance, Constructor) {
|
13124 | if (!(instance instanceof Constructor)) {
|
13125 | throw new TypeError("Cannot call a class as a function");
|
13126 | }
|
13127 | };
|
13128 |
|
13129 | }),
|
13130 |
|
13131 | (function(module, exports, __webpack_require__) {
|
13132 |
|
13133 | "use strict";
|
13134 |
|
13135 | exports.__esModule = true;
|
13136 |
|
13137 | var _typeof2 = __webpack_require__(145);
|
13138 |
|
13139 | var _typeof3 = _interopRequireDefault(_typeof2);
|
13140 |
|
13141 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13142 |
|
13143 | exports.default = function (self, call) {
|
13144 | if (!self) {
|
13145 | throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
13146 | }
|
13147 |
|
13148 | return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self;
|
13149 | };
|
13150 |
|
13151 | }),
|
13152 |
|
13153 | (function(module, exports, __webpack_require__) {
|
13154 |
|
13155 | "use strict";
|
13156 |
|
13157 | exports.__esModule = true;
|
13158 |
|
13159 | var _iterator = __webpack_require__(146);
|
13160 |
|
13161 | var _iterator2 = _interopRequireDefault(_iterator);
|
13162 |
|
13163 | var _symbol = __webpack_require__(165);
|
13164 |
|
13165 | var _symbol2 = _interopRequireDefault(_symbol);
|
13166 |
|
13167 | var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; };
|
13168 |
|
13169 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13170 |
|
13171 | exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) {
|
13172 | return typeof obj === "undefined" ? "undefined" : _typeof(obj);
|
13173 | } : function (obj) {
|
13174 | return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj);
|
13175 | };
|
13176 |
|
13177 | }),
|
13178 |
|
13179 | (function(module, exports, __webpack_require__) {
|
13180 |
|
13181 | module.exports = { "default": __webpack_require__(147), __esModule: true };
|
13182 |
|
13183 | }),
|
13184 |
|
13185 | (function(module, exports, __webpack_require__) {
|
13186 |
|
13187 | __webpack_require__(148);
|
13188 | __webpack_require__(160);
|
13189 | module.exports = __webpack_require__(164).f('iterator');
|
13190 |
|
13191 |
|
13192 | }),
|
13193 |
|
13194 | (function(module, exports, __webpack_require__) {
|
13195 |
|
13196 | 'use strict';
|
13197 | var $at = __webpack_require__(149)(true);
|
13198 |
|
13199 |
|
13200 | __webpack_require__(150)(String, 'String', function (iterated) {
|
13201 | this._t = String(iterated);
|
13202 | this._i = 0;
|
13203 |
|
13204 | }, function () {
|
13205 | var O = this._t;
|
13206 | var index = this._i;
|
13207 | var point;
|
13208 | if (index >= O.length) return { value: undefined, done: true };
|
13209 | point = $at(O, index);
|
13210 | this._i += point.length;
|
13211 | return { value: point, done: false };
|
13212 | });
|
13213 |
|
13214 |
|
13215 | }),
|
13216 |
|
13217 | (function(module, exports, __webpack_require__) {
|
13218 |
|
13219 | var toInteger = __webpack_require__(133);
|
13220 | var defined = __webpack_require__(130);
|
13221 |
|
13222 |
|
13223 | module.exports = function (TO_STRING) {
|
13224 | return function (that, pos) {
|
13225 | var s = String(defined(that));
|
13226 | var i = toInteger(pos);
|
13227 | var l = s.length;
|
13228 | var a, b;
|
13229 | if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
|
13230 | a = s.charCodeAt(i);
|
13231 | return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
|
13232 | ? TO_STRING ? s.charAt(i) : a
|
13233 | : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
|
13234 | };
|
13235 | };
|
13236 |
|
13237 |
|
13238 | }),
|
13239 |
|
13240 | (function(module, exports, __webpack_require__) {
|
13241 |
|
13242 | 'use strict';
|
13243 | var LIBRARY = __webpack_require__(137);
|
13244 | var $export = __webpack_require__(108);
|
13245 | var redefine = __webpack_require__(151);
|
13246 | var hide = __webpack_require__(113);
|
13247 | var Iterators = __webpack_require__(152);
|
13248 | var $iterCreate = __webpack_require__(153);
|
13249 | var setToStringTag = __webpack_require__(157);
|
13250 | var getPrototypeOf = __webpack_require__(159);
|
13251 | var ITERATOR = __webpack_require__(158)('iterator');
|
13252 | var BUGGY = !([].keys && 'next' in [].keys());
|
13253 | var FF_ITERATOR = '@@iterator';
|
13254 | var KEYS = 'keys';
|
13255 | var VALUES = 'values';
|
13256 |
|
13257 | var returnThis = function () { return this; };
|
13258 |
|
13259 | module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
|
13260 | $iterCreate(Constructor, NAME, next);
|
13261 | var getMethod = function (kind) {
|
13262 | if (!BUGGY && kind in proto) return proto[kind];
|
13263 | switch (kind) {
|
13264 | case KEYS: return function keys() { return new Constructor(this, kind); };
|
13265 | case VALUES: return function values() { return new Constructor(this, kind); };
|
13266 | } return function entries() { return new Constructor(this, kind); };
|
13267 | };
|
13268 | var TAG = NAME + ' Iterator';
|
13269 | var DEF_VALUES = DEFAULT == VALUES;
|
13270 | var VALUES_BUG = false;
|
13271 | var proto = Base.prototype;
|
13272 | var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
|
13273 | var $default = $native || getMethod(DEFAULT);
|
13274 | var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
|
13275 | var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
|
13276 | var methods, key, IteratorPrototype;
|
13277 |
|
13278 | if ($anyNative) {
|
13279 | IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
|
13280 | if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
|
13281 |
|
13282 | setToStringTag(IteratorPrototype, TAG, true);
|
13283 |
|
13284 | if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);
|
13285 | }
|
13286 | }
|
13287 |
|
13288 | if (DEF_VALUES && $native && $native.name !== VALUES) {
|
13289 | VALUES_BUG = true;
|
13290 | $default = function values() { return $native.call(this); };
|
13291 | }
|
13292 |
|
13293 | if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
|
13294 | hide(proto, ITERATOR, $default);
|
13295 | }
|
13296 |
|
13297 | Iterators[NAME] = $default;
|
13298 | Iterators[TAG] = returnThis;
|
13299 | if (DEFAULT) {
|
13300 | methods = {
|
13301 | values: DEF_VALUES ? $default : getMethod(VALUES),
|
13302 | keys: IS_SET ? $default : getMethod(KEYS),
|
13303 | entries: $entries
|
13304 | };
|
13305 | if (FORCED) for (key in methods) {
|
13306 | if (!(key in proto)) redefine(proto, key, methods[key]);
|
13307 | } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
|
13308 | }
|
13309 | return methods;
|
13310 | };
|
13311 |
|
13312 |
|
13313 | }),
|
13314 |
|
13315 | (function(module, exports, __webpack_require__) {
|
13316 |
|
13317 | module.exports = __webpack_require__(113);
|
13318 |
|
13319 |
|
13320 | }),
|
13321 |
|
13322 | (function(module, exports) {
|
13323 |
|
13324 | module.exports = {};
|
13325 |
|
13326 |
|
13327 | }),
|
13328 |
|
13329 | (function(module, exports, __webpack_require__) {
|
13330 |
|
13331 | 'use strict';
|
13332 | var create = __webpack_require__(154);
|
13333 | var descriptor = __webpack_require__(122);
|
13334 | var setToStringTag = __webpack_require__(157);
|
13335 | var IteratorPrototype = {};
|
13336 |
|
13337 |
|
13338 | __webpack_require__(113)(IteratorPrototype, __webpack_require__(158)('iterator'), function () { return this; });
|
13339 |
|
13340 | module.exports = function (Constructor, NAME, next) {
|
13341 | Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
|
13342 | setToStringTag(Constructor, NAME + ' Iterator');
|
13343 | };
|
13344 |
|
13345 |
|
13346 | }),
|
13347 |
|
13348 | (function(module, exports, __webpack_require__) {
|
13349 |
|
13350 |
|
13351 | var anObject = __webpack_require__(115);
|
13352 | var dPs = __webpack_require__(155);
|
13353 | var enumBugKeys = __webpack_require__(139);
|
13354 | var IE_PROTO = __webpack_require__(135)('IE_PROTO');
|
13355 | var Empty = function () { };
|
13356 | var PROTOTYPE = 'prototype';
|
13357 |
|
13358 |
|
13359 | var createDict = function () {
|
13360 |
|
13361 | var iframe = __webpack_require__(120)('iframe');
|
13362 | var i = enumBugKeys.length;
|
13363 | var lt = '<';
|
13364 | var gt = '>';
|
13365 | var iframeDocument;
|
13366 | iframe.style.display = 'none';
|
13367 | __webpack_require__(156).appendChild(iframe);
|
13368 | iframe.src = 'javascript:';
|
13369 |
|
13370 |
|
13371 | iframeDocument = iframe.contentWindow.document;
|
13372 | iframeDocument.open();
|
13373 | iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
|
13374 | iframeDocument.close();
|
13375 | createDict = iframeDocument.F;
|
13376 | while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
|
13377 | return createDict();
|
13378 | };
|
13379 |
|
13380 | module.exports = Object.create || function create(O, Properties) {
|
13381 | var result;
|
13382 | if (O !== null) {
|
13383 | Empty[PROTOTYPE] = anObject(O);
|
13384 | result = new Empty();
|
13385 | Empty[PROTOTYPE] = null;
|
13386 |
|
13387 | result[IE_PROTO] = O;
|
13388 | } else result = createDict();
|
13389 | return Properties === undefined ? result : dPs(result, Properties);
|
13390 | };
|
13391 |
|
13392 |
|
13393 | }),
|
13394 |
|
13395 | (function(module, exports, __webpack_require__) {
|
13396 |
|
13397 | var dP = __webpack_require__(114);
|
13398 | var anObject = __webpack_require__(115);
|
13399 | var getKeys = __webpack_require__(125);
|
13400 |
|
13401 | module.exports = __webpack_require__(118) ? Object.defineProperties : function defineProperties(O, Properties) {
|
13402 | anObject(O);
|
13403 | var keys = getKeys(Properties);
|
13404 | var length = keys.length;
|
13405 | var i = 0;
|
13406 | var P;
|
13407 | while (length > i) dP.f(O, P = keys[i++], Properties[P]);
|
13408 | return O;
|
13409 | };
|
13410 |
|
13411 |
|
13412 | }),
|
13413 |
|
13414 | (function(module, exports, __webpack_require__) {
|
13415 |
|
13416 | var document = __webpack_require__(109).document;
|
13417 | module.exports = document && document.documentElement;
|
13418 |
|
13419 |
|
13420 | }),
|
13421 |
|
13422 | (function(module, exports, __webpack_require__) {
|
13423 |
|
13424 | var def = __webpack_require__(114).f;
|
13425 | var has = __webpack_require__(123);
|
13426 | var TAG = __webpack_require__(158)('toStringTag');
|
13427 |
|
13428 | module.exports = function (it, tag, stat) {
|
13429 | if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
|
13430 | };
|
13431 |
|
13432 |
|
13433 | }),
|
13434 |
|
13435 | (function(module, exports, __webpack_require__) {
|
13436 |
|
13437 | var store = __webpack_require__(136)('wks');
|
13438 | var uid = __webpack_require__(138);
|
13439 | var Symbol = __webpack_require__(109).Symbol;
|
13440 | var USE_SYMBOL = typeof Symbol == 'function';
|
13441 |
|
13442 | var $exports = module.exports = function (name) {
|
13443 | return store[name] || (store[name] =
|
13444 | USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
|
13445 | };
|
13446 |
|
13447 | $exports.store = store;
|
13448 |
|
13449 |
|
13450 | }),
|
13451 |
|
13452 | (function(module, exports, __webpack_require__) {
|
13453 |
|
13454 |
|
13455 | var has = __webpack_require__(123);
|
13456 | var toObject = __webpack_require__(142);
|
13457 | var IE_PROTO = __webpack_require__(135)('IE_PROTO');
|
13458 | var ObjectProto = Object.prototype;
|
13459 |
|
13460 | module.exports = Object.getPrototypeOf || function (O) {
|
13461 | O = toObject(O);
|
13462 | if (has(O, IE_PROTO)) return O[IE_PROTO];
|
13463 | if (typeof O.constructor == 'function' && O instanceof O.constructor) {
|
13464 | return O.constructor.prototype;
|
13465 | } return O instanceof Object ? ObjectProto : null;
|
13466 | };
|
13467 |
|
13468 |
|
13469 | }),
|
13470 |
|
13471 | (function(module, exports, __webpack_require__) {
|
13472 |
|
13473 | __webpack_require__(161);
|
13474 | var global = __webpack_require__(109);
|
13475 | var hide = __webpack_require__(113);
|
13476 | var Iterators = __webpack_require__(152);
|
13477 | var TO_STRING_TAG = __webpack_require__(158)('toStringTag');
|
13478 |
|
13479 | var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' +
|
13480 | 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' +
|
13481 | 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' +
|
13482 | 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' +
|
13483 | 'TextTrackList,TouchList').split(',');
|
13484 |
|
13485 | for (var i = 0; i < DOMIterables.length; i++) {
|
13486 | var NAME = DOMIterables[i];
|
13487 | var Collection = global[NAME];
|
13488 | var proto = Collection && Collection.prototype;
|
13489 | if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
|
13490 | Iterators[NAME] = Iterators.Array;
|
13491 | }
|
13492 |
|
13493 |
|
13494 | }),
|
13495 |
|
13496 | (function(module, exports, __webpack_require__) {
|
13497 |
|
13498 | 'use strict';
|
13499 | var addToUnscopables = __webpack_require__(162);
|
13500 | var step = __webpack_require__(163);
|
13501 | var Iterators = __webpack_require__(152);
|
13502 | var toIObject = __webpack_require__(127);
|
13503 |
|
13504 |
|
13505 |
|
13506 |
|
13507 |
|
13508 | module.exports = __webpack_require__(150)(Array, 'Array', function (iterated, kind) {
|
13509 | this._t = toIObject(iterated);
|
13510 | this._i = 0;
|
13511 | this._k = kind;
|
13512 |
|
13513 | }, function () {
|
13514 | var O = this._t;
|
13515 | var kind = this._k;
|
13516 | var index = this._i++;
|
13517 | if (!O || index >= O.length) {
|
13518 | this._t = undefined;
|
13519 | return step(1);
|
13520 | }
|
13521 | if (kind == 'keys') return step(0, index);
|
13522 | if (kind == 'values') return step(0, O[index]);
|
13523 | return step(0, [index, O[index]]);
|
13524 | }, 'values');
|
13525 |
|
13526 |
|
13527 | Iterators.Arguments = Iterators.Array;
|
13528 |
|
13529 | addToUnscopables('keys');
|
13530 | addToUnscopables('values');
|
13531 | addToUnscopables('entries');
|
13532 |
|
13533 |
|
13534 | }),
|
13535 |
|
13536 | (function(module, exports) {
|
13537 |
|
13538 | module.exports = function () { };
|
13539 |
|
13540 |
|
13541 | }),
|
13542 |
|
13543 | (function(module, exports) {
|
13544 |
|
13545 | module.exports = function (done, value) {
|
13546 | return { value: value, done: !!done };
|
13547 | };
|
13548 |
|
13549 |
|
13550 | }),
|
13551 |
|
13552 | (function(module, exports, __webpack_require__) {
|
13553 |
|
13554 | exports.f = __webpack_require__(158);
|
13555 |
|
13556 |
|
13557 | }),
|
13558 |
|
13559 | (function(module, exports, __webpack_require__) {
|
13560 |
|
13561 | module.exports = { "default": __webpack_require__(166), __esModule: true };
|
13562 |
|
13563 | }),
|
13564 |
|
13565 | (function(module, exports, __webpack_require__) {
|
13566 |
|
13567 | __webpack_require__(167);
|
13568 | __webpack_require__(175);
|
13569 | __webpack_require__(176);
|
13570 | __webpack_require__(177);
|
13571 | module.exports = __webpack_require__(110).Symbol;
|
13572 |
|
13573 |
|
13574 | }),
|
13575 |
|
13576 | (function(module, exports, __webpack_require__) {
|
13577 |
|
13578 | 'use strict';
|
13579 |
|
13580 | var global = __webpack_require__(109);
|
13581 | var has = __webpack_require__(123);
|
13582 | var DESCRIPTORS = __webpack_require__(118);
|
13583 | var $export = __webpack_require__(108);
|
13584 | var redefine = __webpack_require__(151);
|
13585 | var META = __webpack_require__(168).KEY;
|
13586 | var $fails = __webpack_require__(119);
|
13587 | var shared = __webpack_require__(136);
|
13588 | var setToStringTag = __webpack_require__(157);
|
13589 | var uid = __webpack_require__(138);
|
13590 | var wks = __webpack_require__(158);
|
13591 | var wksExt = __webpack_require__(164);
|
13592 | var wksDefine = __webpack_require__(169);
|
13593 | var enumKeys = __webpack_require__(170);
|
13594 | var isArray = __webpack_require__(171);
|
13595 | var anObject = __webpack_require__(115);
|
13596 | var isObject = __webpack_require__(116);
|
13597 | var toIObject = __webpack_require__(127);
|
13598 | var toPrimitive = __webpack_require__(121);
|
13599 | var createDesc = __webpack_require__(122);
|
13600 | var _create = __webpack_require__(154);
|
13601 | var gOPNExt = __webpack_require__(172);
|
13602 | var $GOPD = __webpack_require__(174);
|
13603 | var $DP = __webpack_require__(114);
|
13604 | var $keys = __webpack_require__(125);
|
13605 | var gOPD = $GOPD.f;
|
13606 | var dP = $DP.f;
|
13607 | var gOPN = gOPNExt.f;
|
13608 | var $Symbol = global.Symbol;
|
13609 | var $JSON = global.JSON;
|
13610 | var _stringify = $JSON && $JSON.stringify;
|
13611 | var PROTOTYPE = 'prototype';
|
13612 | var HIDDEN = wks('_hidden');
|
13613 | var TO_PRIMITIVE = wks('toPrimitive');
|
13614 | var isEnum = {}.propertyIsEnumerable;
|
13615 | var SymbolRegistry = shared('symbol-registry');
|
13616 | var AllSymbols = shared('symbols');
|
13617 | var OPSymbols = shared('op-symbols');
|
13618 | var ObjectProto = Object[PROTOTYPE];
|
13619 | var USE_NATIVE = typeof $Symbol == 'function';
|
13620 | var QObject = global.QObject;
|
13621 |
|
13622 | var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
|
13623 |
|
13624 |
|
13625 | var setSymbolDesc = DESCRIPTORS && $fails(function () {
|
13626 | return _create(dP({}, 'a', {
|
13627 | get: function () { return dP(this, 'a', { value: 7 }).a; }
|
13628 | })).a != 7;
|
13629 | }) ? function (it, key, D) {
|
13630 | var protoDesc = gOPD(ObjectProto, key);
|
13631 | if (protoDesc) delete ObjectProto[key];
|
13632 | dP(it, key, D);
|
13633 | if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);
|
13634 | } : dP;
|
13635 |
|
13636 | var wrap = function (tag) {
|
13637 | var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
|
13638 | sym._k = tag;
|
13639 | return sym;
|
13640 | };
|
13641 |
|
13642 | var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {
|
13643 | return typeof it == 'symbol';
|
13644 | } : function (it) {
|
13645 | return it instanceof $Symbol;
|
13646 | };
|
13647 |
|
13648 | var $defineProperty = function defineProperty(it, key, D) {
|
13649 | if (it === ObjectProto) $defineProperty(OPSymbols, key, D);
|
13650 | anObject(it);
|
13651 | key = toPrimitive(key, true);
|
13652 | anObject(D);
|
13653 | if (has(AllSymbols, key)) {
|
13654 | if (!D.enumerable) {
|
13655 | if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));
|
13656 | it[HIDDEN][key] = true;
|
13657 | } else {
|
13658 | if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;
|
13659 | D = _create(D, { enumerable: createDesc(0, false) });
|
13660 | } return setSymbolDesc(it, key, D);
|
13661 | } return dP(it, key, D);
|
13662 | };
|
13663 | var $defineProperties = function defineProperties(it, P) {
|
13664 | anObject(it);
|
13665 | var keys = enumKeys(P = toIObject(P));
|
13666 | var i = 0;
|
13667 | var l = keys.length;
|
13668 | var key;
|
13669 | while (l > i) $defineProperty(it, key = keys[i++], P[key]);
|
13670 | return it;
|
13671 | };
|
13672 | var $create = function create(it, P) {
|
13673 | return P === undefined ? _create(it) : $defineProperties(_create(it), P);
|
13674 | };
|
13675 | var $propertyIsEnumerable = function propertyIsEnumerable(key) {
|
13676 | var E = isEnum.call(this, key = toPrimitive(key, true));
|
13677 | if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;
|
13678 | return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
|
13679 | };
|
13680 | var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
|
13681 | it = toIObject(it);
|
13682 | key = toPrimitive(key, true);
|
13683 | if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;
|
13684 | var D = gOPD(it, key);
|
13685 | if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;
|
13686 | return D;
|
13687 | };
|
13688 | var $getOwnPropertyNames = function getOwnPropertyNames(it) {
|
13689 | var names = gOPN(toIObject(it));
|
13690 | var result = [];
|
13691 | var i = 0;
|
13692 | var key;
|
13693 | while (names.length > i) {
|
13694 | if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);
|
13695 | } return result;
|
13696 | };
|
13697 | var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
|
13698 | var IS_OP = it === ObjectProto;
|
13699 | var names = gOPN(IS_OP ? OPSymbols : toIObject(it));
|
13700 | var result = [];
|
13701 | var i = 0;
|
13702 | var key;
|
13703 | while (names.length > i) {
|
13704 | if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);
|
13705 | } return result;
|
13706 | };
|
13707 |
|
13708 |
|
13709 | if (!USE_NATIVE) {
|
13710 | $Symbol = function Symbol() {
|
13711 | if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');
|
13712 | var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
|
13713 | var $set = function (value) {
|
13714 | if (this === ObjectProto) $set.call(OPSymbols, value);
|
13715 | if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
|
13716 | setSymbolDesc(this, tag, createDesc(1, value));
|
13717 | };
|
13718 | if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });
|
13719 | return wrap(tag);
|
13720 | };
|
13721 | redefine($Symbol[PROTOTYPE], 'toString', function toString() {
|
13722 | return this._k;
|
13723 | });
|
13724 |
|
13725 | $GOPD.f = $getOwnPropertyDescriptor;
|
13726 | $DP.f = $defineProperty;
|
13727 | __webpack_require__(173).f = gOPNExt.f = $getOwnPropertyNames;
|
13728 | __webpack_require__(141).f = $propertyIsEnumerable;
|
13729 | __webpack_require__(140).f = $getOwnPropertySymbols;
|
13730 |
|
13731 | if (DESCRIPTORS && !__webpack_require__(137)) {
|
13732 | redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
|
13733 | }
|
13734 |
|
13735 | wksExt.f = function (name) {
|
13736 | return wrap(wks(name));
|
13737 | };
|
13738 | }
|
13739 |
|
13740 | $export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });
|
13741 |
|
13742 | for (var es6Symbols = (
|
13743 |
|
13744 | 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
|
13745 | ).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);
|
13746 |
|
13747 | for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);
|
13748 |
|
13749 | $export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
|
13750 |
|
13751 | 'for': function (key) {
|
13752 | return has(SymbolRegistry, key += '')
|
13753 | ? SymbolRegistry[key]
|
13754 | : SymbolRegistry[key] = $Symbol(key);
|
13755 | },
|
13756 |
|
13757 | keyFor: function keyFor(sym) {
|
13758 | if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');
|
13759 | for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;
|
13760 | },
|
13761 | useSetter: function () { setter = true; },
|
13762 | useSimple: function () { setter = false; }
|
13763 | });
|
13764 |
|
13765 | $export($export.S + $export.F * !USE_NATIVE, 'Object', {
|
13766 |
|
13767 | create: $create,
|
13768 |
|
13769 | defineProperty: $defineProperty,
|
13770 |
|
13771 | defineProperties: $defineProperties,
|
13772 |
|
13773 | getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
|
13774 |
|
13775 | getOwnPropertyNames: $getOwnPropertyNames,
|
13776 |
|
13777 | getOwnPropertySymbols: $getOwnPropertySymbols
|
13778 | });
|
13779 |
|
13780 |
|
13781 | $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {
|
13782 | var S = $Symbol();
|
13783 |
|
13784 |
|
13785 |
|
13786 | return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';
|
13787 | })), 'JSON', {
|
13788 | stringify: function stringify(it) {
|
13789 | var args = [it];
|
13790 | var i = 1;
|
13791 | var replacer, $replacer;
|
13792 | while (arguments.length > i) args.push(arguments[i++]);
|
13793 | $replacer = replacer = args[1];
|
13794 | if (!isObject(replacer) && it === undefined || isSymbol(it)) return;
|
13795 | if (!isArray(replacer)) replacer = function (key, value) {
|
13796 | if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
|
13797 | if (!isSymbol(value)) return value;
|
13798 | };
|
13799 | args[1] = replacer;
|
13800 | return _stringify.apply($JSON, args);
|
13801 | }
|
13802 | });
|
13803 |
|
13804 |
|
13805 | $Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(113)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
|
13806 |
|
13807 | setToStringTag($Symbol, 'Symbol');
|
13808 |
|
13809 | setToStringTag(Math, 'Math', true);
|
13810 |
|
13811 | setToStringTag(global.JSON, 'JSON', true);
|
13812 |
|
13813 |
|
13814 | }),
|
13815 |
|
13816 | (function(module, exports, __webpack_require__) {
|
13817 |
|
13818 | var META = __webpack_require__(138)('meta');
|
13819 | var isObject = __webpack_require__(116);
|
13820 | var has = __webpack_require__(123);
|
13821 | var setDesc = __webpack_require__(114).f;
|
13822 | var id = 0;
|
13823 | var isExtensible = Object.isExtensible || function () {
|
13824 | return true;
|
13825 | };
|
13826 | var FREEZE = !__webpack_require__(119)(function () {
|
13827 | return isExtensible(Object.preventExtensions({}));
|
13828 | });
|
13829 | var setMeta = function (it) {
|
13830 | setDesc(it, META, { value: {
|
13831 | i: 'O' + ++id,
|
13832 | w: {}
|
13833 | } });
|
13834 | };
|
13835 | var fastKey = function (it, create) {
|
13836 |
|
13837 | if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
|
13838 | if (!has(it, META)) {
|
13839 |
|
13840 | if (!isExtensible(it)) return 'F';
|
13841 |
|
13842 | if (!create) return 'E';
|
13843 |
|
13844 | setMeta(it);
|
13845 |
|
13846 | } return it[META].i;
|
13847 | };
|
13848 | var getWeak = function (it, create) {
|
13849 | if (!has(it, META)) {
|
13850 |
|
13851 | if (!isExtensible(it)) return true;
|
13852 |
|
13853 | if (!create) return false;
|
13854 |
|
13855 | setMeta(it);
|
13856 |
|
13857 | } return it[META].w;
|
13858 | };
|
13859 |
|
13860 | var onFreeze = function (it) {
|
13861 | if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);
|
13862 | return it;
|
13863 | };
|
13864 | var meta = module.exports = {
|
13865 | KEY: META,
|
13866 | NEED: false,
|
13867 | fastKey: fastKey,
|
13868 | getWeak: getWeak,
|
13869 | onFreeze: onFreeze
|
13870 | };
|
13871 |
|
13872 |
|
13873 | }),
|
13874 |
|
13875 | (function(module, exports, __webpack_require__) {
|
13876 |
|
13877 | var global = __webpack_require__(109);
|
13878 | var core = __webpack_require__(110);
|
13879 | var LIBRARY = __webpack_require__(137);
|
13880 | var wksExt = __webpack_require__(164);
|
13881 | var defineProperty = __webpack_require__(114).f;
|
13882 | module.exports = function (name) {
|
13883 | var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
|
13884 | if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });
|
13885 | };
|
13886 |
|
13887 |
|
13888 | }),
|
13889 |
|
13890 | (function(module, exports, __webpack_require__) {
|
13891 |
|
13892 |
|
13893 | var getKeys = __webpack_require__(125);
|
13894 | var gOPS = __webpack_require__(140);
|
13895 | var pIE = __webpack_require__(141);
|
13896 | module.exports = function (it) {
|
13897 | var result = getKeys(it);
|
13898 | var getSymbols = gOPS.f;
|
13899 | if (getSymbols) {
|
13900 | var symbols = getSymbols(it);
|
13901 | var isEnum = pIE.f;
|
13902 | var i = 0;
|
13903 | var key;
|
13904 | while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);
|
13905 | } return result;
|
13906 | };
|
13907 |
|
13908 |
|
13909 | }),
|
13910 |
|
13911 | (function(module, exports, __webpack_require__) {
|
13912 |
|
13913 |
|
13914 | var cof = __webpack_require__(129);
|
13915 | module.exports = Array.isArray || function isArray(arg) {
|
13916 | return cof(arg) == 'Array';
|
13917 | };
|
13918 |
|
13919 |
|
13920 | }),
|
13921 |
|
13922 | (function(module, exports, __webpack_require__) {
|
13923 |
|
13924 |
|
13925 | var toIObject = __webpack_require__(127);
|
13926 | var gOPN = __webpack_require__(173).f;
|
13927 | var toString = {}.toString;
|
13928 |
|
13929 | var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
|
13930 | ? Object.getOwnPropertyNames(window) : [];
|
13931 |
|
13932 | var getWindowNames = function (it) {
|
13933 | try {
|
13934 | return gOPN(it);
|
13935 | } catch (e) {
|
13936 | return windowNames.slice();
|
13937 | }
|
13938 | };
|
13939 |
|
13940 | module.exports.f = function getOwnPropertyNames(it) {
|
13941 | return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
|
13942 | };
|
13943 |
|
13944 |
|
13945 | }),
|
13946 |
|
13947 | (function(module, exports, __webpack_require__) {
|
13948 |
|
13949 |
|
13950 | var $keys = __webpack_require__(126);
|
13951 | var hiddenKeys = __webpack_require__(139).concat('length', 'prototype');
|
13952 |
|
13953 | exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
13954 | return $keys(O, hiddenKeys);
|
13955 | };
|
13956 |
|
13957 |
|
13958 | }),
|
13959 |
|
13960 | (function(module, exports, __webpack_require__) {
|
13961 |
|
13962 | var pIE = __webpack_require__(141);
|
13963 | var createDesc = __webpack_require__(122);
|
13964 | var toIObject = __webpack_require__(127);
|
13965 | var toPrimitive = __webpack_require__(121);
|
13966 | var has = __webpack_require__(123);
|
13967 | var IE8_DOM_DEFINE = __webpack_require__(117);
|
13968 | var gOPD = Object.getOwnPropertyDescriptor;
|
13969 |
|
13970 | exports.f = __webpack_require__(118) ? gOPD : function getOwnPropertyDescriptor(O, P) {
|
13971 | O = toIObject(O);
|
13972 | P = toPrimitive(P, true);
|
13973 | if (IE8_DOM_DEFINE) try {
|
13974 | return gOPD(O, P);
|
13975 | } catch (e) { }
|
13976 | if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);
|
13977 | };
|
13978 |
|
13979 |
|
13980 | }),
|
13981 |
|
13982 | (function(module, exports) {
|
13983 |
|
13984 |
|
13985 |
|
13986 | }),
|
13987 |
|
13988 | (function(module, exports, __webpack_require__) {
|
13989 |
|
13990 | __webpack_require__(169)('asyncIterator');
|
13991 |
|
13992 |
|
13993 | }),
|
13994 |
|
13995 | (function(module, exports, __webpack_require__) {
|
13996 |
|
13997 | __webpack_require__(169)('observable');
|
13998 |
|
13999 |
|
14000 | }),
|
14001 |
|
14002 | (function(module, exports, __webpack_require__) {
|
14003 |
|
14004 | "use strict";
|
14005 |
|
14006 | exports.__esModule = true;
|
14007 |
|
14008 | var _setPrototypeOf = __webpack_require__(179);
|
14009 |
|
14010 | var _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf);
|
14011 |
|
14012 | var _create = __webpack_require__(183);
|
14013 |
|
14014 | var _create2 = _interopRequireDefault(_create);
|
14015 |
|
14016 | var _typeof2 = __webpack_require__(145);
|
14017 |
|
14018 | var _typeof3 = _interopRequireDefault(_typeof2);
|
14019 |
|
14020 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
14021 |
|
14022 | exports.default = function (subClass, superClass) {
|
14023 | if (typeof superClass !== "function" && superClass !== null) {
|
14024 | throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass)));
|
14025 | }
|
14026 |
|
14027 | subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, {
|
14028 | constructor: {
|
14029 | value: subClass,
|
14030 | enumerable: false,
|
14031 | writable: true,
|
14032 | configurable: true
|
14033 | }
|
14034 | });
|
14035 | if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass;
|
14036 | };
|
14037 |
|
14038 | }),
|
14039 |
|
14040 | (function(module, exports, __webpack_require__) {
|
14041 |
|
14042 | module.exports = { "default": __webpack_require__(180), __esModule: true };
|
14043 |
|
14044 | }),
|
14045 |
|
14046 | (function(module, exports, __webpack_require__) {
|
14047 |
|
14048 | __webpack_require__(181);
|
14049 | module.exports = __webpack_require__(110).Object.setPrototypeOf;
|
14050 |
|
14051 |
|
14052 | }),
|
14053 |
|
14054 | (function(module, exports, __webpack_require__) {
|
14055 |
|
14056 |
|
14057 | var $export = __webpack_require__(108);
|
14058 | $export($export.S, 'Object', { setPrototypeOf: __webpack_require__(182).set });
|
14059 |
|
14060 |
|
14061 | }),
|
14062 |
|
14063 | (function(module, exports, __webpack_require__) {
|
14064 |
|
14065 |
|
14066 |
|
14067 | var isObject = __webpack_require__(116);
|
14068 | var anObject = __webpack_require__(115);
|
14069 | var check = function (O, proto) {
|
14070 | anObject(O);
|
14071 | if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!");
|
14072 | };
|
14073 | module.exports = {
|
14074 | set: Object.setPrototypeOf || ('__proto__' in {} ?
|
14075 | function (test, buggy, set) {
|
14076 | try {
|
14077 | set = __webpack_require__(111)(Function.call, __webpack_require__(174).f(Object.prototype, '__proto__').set, 2);
|
14078 | set(test, []);
|
14079 | buggy = !(test instanceof Array);
|
14080 | } catch (e) { buggy = true; }
|
14081 | return function setPrototypeOf(O, proto) {
|
14082 | check(O, proto);
|
14083 | if (buggy) O.__proto__ = proto;
|
14084 | else set(O, proto);
|
14085 | return O;
|
14086 | };
|
14087 | }({}, false) : undefined),
|
14088 | check: check
|
14089 | };
|
14090 |
|
14091 |
|
14092 | }),
|
14093 |
|
14094 | (function(module, exports, __webpack_require__) {
|
14095 |
|
14096 | module.exports = { "default": __webpack_require__(184), __esModule: true };
|
14097 |
|
14098 | }),
|
14099 |
|
14100 | (function(module, exports, __webpack_require__) {
|
14101 |
|
14102 | __webpack_require__(185);
|
14103 | var $Object = __webpack_require__(110).Object;
|
14104 | module.exports = function create(P, D) {
|
14105 | return $Object.create(P, D);
|
14106 | };
|
14107 |
|
14108 |
|
14109 | }),
|
14110 |
|
14111 | (function(module, exports, __webpack_require__) {
|
14112 |
|
14113 | var $export = __webpack_require__(108);
|
14114 |
|
14115 | $export($export.S, 'Object', { create: __webpack_require__(154) });
|
14116 |
|
14117 |
|
14118 | }),
|
14119 |
|
14120 | (function(module, exports) {
|
14121 |
|
14122 | "use strict";
|
14123 |
|
14124 | Object.defineProperty(exports, "__esModule", {
|
14125 | value: true
|
14126 | });
|
14127 | exports["default"] = contains;
|
14128 | function contains(root, n) {
|
14129 | var node = n;
|
14130 | while (node) {
|
14131 | if (node === root) {
|
14132 | return true;
|
14133 | }
|
14134 | node = node.parentNode;
|
14135 | }
|
14136 |
|
14137 | return false;
|
14138 | }
|
14139 | module.exports = exports['default'];
|
14140 |
|
14141 | }),
|
14142 |
|
14143 | (function(module, exports, __webpack_require__) {
|
14144 |
|
14145 | 'use strict';
|
14146 |
|
14147 | Object.defineProperty(exports, "__esModule", {
|
14148 | value: true
|
14149 | });
|
14150 | exports['default'] = addEventListenerWrap;
|
14151 |
|
14152 | var _addDomEventListener = __webpack_require__(41);
|
14153 |
|
14154 | var _addDomEventListener2 = _interopRequireDefault(_addDomEventListener);
|
14155 |
|
14156 | var _reactDom = __webpack_require__(12);
|
14157 |
|
14158 | var _reactDom2 = _interopRequireDefault(_reactDom);
|
14159 |
|
14160 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
14161 |
|
14162 | function addEventListenerWrap(target, eventType, cb, option) {
|
14163 |
|
14164 | var callback = _reactDom2['default'].unstable_batchedUpdates ? function run(e) {
|
14165 | _reactDom2['default'].unstable_batchedUpdates(cb, e);
|
14166 | } : cb;
|
14167 | return (0, _addDomEventListener2['default'])(target, eventType, callback, option);
|
14168 | }
|
14169 | module.exports = exports['default'];
|
14170 |
|
14171 | }),
|
14172 |
|
14173 | (function(module, exports, __webpack_require__) {
|
14174 |
|
14175 | 'use strict';
|
14176 |
|
14177 | Object.defineProperty(exports, "__esModule", {
|
14178 | value: true
|
14179 | });
|
14180 |
|
14181 | var _classCallCheck2 = __webpack_require__(143);
|
14182 |
|
14183 | var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
14184 |
|
14185 | var _createClass2 = __webpack_require__(189);
|
14186 |
|
14187 | var _createClass3 = _interopRequireDefault(_createClass2);
|
14188 |
|
14189 | var _possibleConstructorReturn2 = __webpack_require__(144);
|
14190 |
|
14191 | var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
14192 |
|
14193 | var _inherits2 = __webpack_require__(178);
|
14194 |
|
14195 | var _inherits3 = _interopRequireDefault(_inherits2);
|
14196 |
|
14197 | var _react = __webpack_require__(4);
|
14198 |
|
14199 | var _react2 = _interopRequireDefault(_react);
|
14200 |
|
14201 | var _reactDom = __webpack_require__(12);
|
14202 |
|
14203 | var _reactDom2 = _interopRequireDefault(_reactDom);
|
14204 |
|
14205 | var _propTypes = __webpack_require__(5);
|
14206 |
|
14207 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
14208 |
|
14209 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
14210 |
|
14211 | var ContainerRender = function (_React$Component) {
|
14212 | (0, _inherits3['default'])(ContainerRender, _React$Component);
|
14213 |
|
14214 | function ContainerRender() {
|
14215 | var _ref;
|
14216 |
|
14217 | var _temp, _this, _ret;
|
14218 |
|
14219 | (0, _classCallCheck3['default'])(this, ContainerRender);
|
14220 |
|
14221 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
14222 | args[_key] = arguments[_key];
|
14223 | }
|
14224 |
|
14225 | return _ret = (_temp = (_this = (0, _possibleConstructorReturn3['default'])(this, (_ref = ContainerRender.__proto__ || Object.getPrototypeOf(ContainerRender)).call.apply(_ref, [this].concat(args))), _this), _this.removeContainer = function () {
|
14226 | if (_this.container) {
|
14227 | _reactDom2['default'].unmountComponentAtNode(_this.container);
|
14228 | _this.container.parentNode.removeChild(_this.container);
|
14229 | _this.container = null;
|
14230 | }
|
14231 | }, _this.renderComponent = function (props, ready) {
|
14232 | var _this$props = _this.props,
|
14233 | visible = _this$props.visible,
|
14234 | getComponent = _this$props.getComponent,
|
14235 | forceRender = _this$props.forceRender,
|
14236 | getContainer = _this$props.getContainer,
|
14237 | parent = _this$props.parent;
|
14238 |
|
14239 | if (visible || parent._component || forceRender) {
|
14240 | if (!_this.container) {
|
14241 | _this.container = getContainer();
|
14242 | }
|
14243 | _reactDom2['default'].unstable_renderSubtreeIntoContainer(parent, getComponent(props), _this.container, function callback() {
|
14244 | if (ready) {
|
14245 | ready.call(this);
|
14246 | }
|
14247 | });
|
14248 | }
|
14249 | }, _temp), (0, _possibleConstructorReturn3['default'])(_this, _ret);
|
14250 | }
|
14251 |
|
14252 | (0, _createClass3['default'])(ContainerRender, [{
|
14253 | key: 'componentDidMount',
|
14254 | value: function componentDidMount() {
|
14255 | if (this.props.autoMount) {
|
14256 | this.renderComponent();
|
14257 | }
|
14258 | }
|
14259 | }, {
|
14260 | key: 'componentDidUpdate',
|
14261 | value: function componentDidUpdate() {
|
14262 | if (this.props.autoMount) {
|
14263 | this.renderComponent();
|
14264 | }
|
14265 | }
|
14266 | }, {
|
14267 | key: 'componentWillUnmount',
|
14268 | value: function componentWillUnmount() {
|
14269 | if (this.props.autoDestroy) {
|
14270 | this.removeContainer();
|
14271 | }
|
14272 | }
|
14273 | }, {
|
14274 | key: 'render',
|
14275 | value: function render() {
|
14276 | return this.props.children({
|
14277 | renderComponent: this.renderComponent,
|
14278 | removeContainer: this.removeContainer
|
14279 | });
|
14280 | }
|
14281 | }]);
|
14282 | return ContainerRender;
|
14283 | }(_react2['default'].Component);
|
14284 |
|
14285 | ContainerRender.propTypes = {
|
14286 | autoMount: _propTypes2['default'].bool,
|
14287 | autoDestroy: _propTypes2['default'].bool,
|
14288 | visible: _propTypes2['default'].bool,
|
14289 | forceRender: _propTypes2['default'].bool,
|
14290 | parent: _propTypes2['default'].any,
|
14291 | getComponent: _propTypes2['default'].func.isRequired,
|
14292 | getContainer: _propTypes2['default'].func.isRequired,
|
14293 | children: _propTypes2['default'].func.isRequired
|
14294 | };
|
14295 | ContainerRender.defaultProps = {
|
14296 | autoMount: true,
|
14297 | autoDestroy: true,
|
14298 | forceRender: false
|
14299 | };
|
14300 | exports['default'] = ContainerRender;
|
14301 | module.exports = exports['default'];
|
14302 |
|
14303 | }),
|
14304 |
|
14305 | (function(module, exports, __webpack_require__) {
|
14306 |
|
14307 | "use strict";
|
14308 |
|
14309 | exports.__esModule = true;
|
14310 |
|
14311 | var _defineProperty = __webpack_require__(190);
|
14312 |
|
14313 | var _defineProperty2 = _interopRequireDefault(_defineProperty);
|
14314 |
|
14315 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
14316 |
|
14317 | exports.default = function () {
|
14318 | function defineProperties(target, props) {
|
14319 | for (var i = 0; i < props.length; i++) {
|
14320 | var descriptor = props[i];
|
14321 | descriptor.enumerable = descriptor.enumerable || false;
|
14322 | descriptor.configurable = true;
|
14323 | if ("value" in descriptor) descriptor.writable = true;
|
14324 | (0, _defineProperty2.default)(target, descriptor.key, descriptor);
|
14325 | }
|
14326 | }
|
14327 |
|
14328 | return function (Constructor, protoProps, staticProps) {
|
14329 | if (protoProps) defineProperties(Constructor.prototype, protoProps);
|
14330 | if (staticProps) defineProperties(Constructor, staticProps);
|
14331 | return Constructor;
|
14332 | };
|
14333 | }();
|
14334 |
|
14335 | }),
|
14336 |
|
14337 | (function(module, exports, __webpack_require__) {
|
14338 |
|
14339 | module.exports = { "default": __webpack_require__(191), __esModule: true };
|
14340 |
|
14341 | }),
|
14342 |
|
14343 | (function(module, exports, __webpack_require__) {
|
14344 |
|
14345 | __webpack_require__(192);
|
14346 | var $Object = __webpack_require__(110).Object;
|
14347 | module.exports = function defineProperty(it, key, desc) {
|
14348 | return $Object.defineProperty(it, key, desc);
|
14349 | };
|
14350 |
|
14351 |
|
14352 | }),
|
14353 |
|
14354 | (function(module, exports, __webpack_require__) {
|
14355 |
|
14356 | var $export = __webpack_require__(108);
|
14357 |
|
14358 | $export($export.S + $export.F * !__webpack_require__(118), 'Object', { defineProperty: __webpack_require__(114).f });
|
14359 |
|
14360 |
|
14361 | }),
|
14362 |
|
14363 | (function(module, exports, __webpack_require__) {
|
14364 |
|
14365 | 'use strict';
|
14366 |
|
14367 | Object.defineProperty(exports, "__esModule", {
|
14368 | value: true
|
14369 | });
|
14370 |
|
14371 | var _classCallCheck2 = __webpack_require__(143);
|
14372 |
|
14373 | var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
14374 |
|
14375 | var _createClass2 = __webpack_require__(189);
|
14376 |
|
14377 | var _createClass3 = _interopRequireDefault(_createClass2);
|
14378 |
|
14379 | var _possibleConstructorReturn2 = __webpack_require__(144);
|
14380 |
|
14381 | var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
14382 |
|
14383 | var _inherits2 = __webpack_require__(178);
|
14384 |
|
14385 | var _inherits3 = _interopRequireDefault(_inherits2);
|
14386 |
|
14387 | var _react = __webpack_require__(4);
|
14388 |
|
14389 | var _react2 = _interopRequireDefault(_react);
|
14390 |
|
14391 | var _reactDom = __webpack_require__(12);
|
14392 |
|
14393 | var _reactDom2 = _interopRequireDefault(_reactDom);
|
14394 |
|
14395 | var _propTypes = __webpack_require__(5);
|
14396 |
|
14397 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
14398 |
|
14399 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
14400 |
|
14401 | var Portal = function (_React$Component) {
|
14402 | (0, _inherits3['default'])(Portal, _React$Component);
|
14403 |
|
14404 | function Portal() {
|
14405 | (0, _classCallCheck3['default'])(this, Portal);
|
14406 | return (0, _possibleConstructorReturn3['default'])(this, (Portal.__proto__ || Object.getPrototypeOf(Portal)).apply(this, arguments));
|
14407 | }
|
14408 |
|
14409 | (0, _createClass3['default'])(Portal, [{
|
14410 | key: 'componentDidMount',
|
14411 | value: function componentDidMount() {
|
14412 | this.createContainer();
|
14413 | }
|
14414 | }, {
|
14415 | key: 'componentDidUpdate',
|
14416 | value: function componentDidUpdate(prevProps) {
|
14417 | var didUpdate = this.props.didUpdate;
|
14418 |
|
14419 | if (didUpdate) {
|
14420 | didUpdate(prevProps);
|
14421 | }
|
14422 | }
|
14423 | }, {
|
14424 | key: 'componentWillUnmount',
|
14425 | value: function componentWillUnmount() {
|
14426 | this.removeContainer();
|
14427 | }
|
14428 | }, {
|
14429 | key: 'createContainer',
|
14430 | value: function createContainer() {
|
14431 | this._container = this.props.getContainer();
|
14432 | this.forceUpdate();
|
14433 | }
|
14434 | }, {
|
14435 | key: 'removeContainer',
|
14436 | value: function removeContainer() {
|
14437 | if (this._container) {
|
14438 | this._container.parentNode.removeChild(this._container);
|
14439 | }
|
14440 | }
|
14441 | }, {
|
14442 | key: 'render',
|
14443 | value: function render() {
|
14444 | if (this._container) {
|
14445 | return _reactDom2['default'].createPortal(this.props.children, this._container);
|
14446 | }
|
14447 | return null;
|
14448 | }
|
14449 | }]);
|
14450 | return Portal;
|
14451 | }(_react2['default'].Component);
|
14452 |
|
14453 | Portal.propTypes = {
|
14454 | getContainer: _propTypes2['default'].func.isRequired,
|
14455 | children: _propTypes2['default'].node.isRequired,
|
14456 | didUpdate: _propTypes2['default'].func
|
14457 | };
|
14458 | exports['default'] = Portal;
|
14459 | module.exports = exports['default'];
|
14460 |
|
14461 | }),
|
14462 |
|
14463 | (function(module, exports, __webpack_require__) {
|
14464 |
|
14465 | 'use strict';
|
14466 |
|
14467 | exports.__esModule = true;
|
14468 |
|
14469 | var _extends2 = __webpack_require__(104);
|
14470 |
|
14471 | var _extends3 = _interopRequireDefault(_extends2);
|
14472 |
|
14473 | exports.getAlignFromPlacement = getAlignFromPlacement;
|
14474 | exports.getAlignPopupClassName = getAlignPopupClassName;
|
14475 | exports.saveRef = saveRef;
|
14476 |
|
14477 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
14478 |
|
14479 | function isPointsEq(a1, a2, isAlignPoint) {
|
14480 | if (isAlignPoint) {
|
14481 | return a1[0] === a2[0];
|
14482 | }
|
14483 | return a1[0] === a2[0] && a1[1] === a2[1];
|
14484 | }
|
14485 |
|
14486 | function getAlignFromPlacement(builtinPlacements, placementStr, align) {
|
14487 | var baseAlign = builtinPlacements[placementStr] || {};
|
14488 | return (0, _extends3['default'])({}, baseAlign, align);
|
14489 | }
|
14490 |
|
14491 | function getAlignPopupClassName(builtinPlacements, prefixCls, align, isAlignPoint) {
|
14492 | var points = align.points;
|
14493 | for (var placement in builtinPlacements) {
|
14494 | if (builtinPlacements.hasOwnProperty(placement)) {
|
14495 | if (isPointsEq(builtinPlacements[placement].points, points, isAlignPoint)) {
|
14496 | return prefixCls + '-placement-' + placement;
|
14497 | }
|
14498 | }
|
14499 | }
|
14500 | return '';
|
14501 | }
|
14502 |
|
14503 | function saveRef(name, component) {
|
14504 | this[name] = component;
|
14505 | }
|
14506 |
|
14507 | }),
|
14508 |
|
14509 | (function(module, exports, __webpack_require__) {
|
14510 |
|
14511 | 'use strict';
|
14512 |
|
14513 | exports.__esModule = true;
|
14514 |
|
14515 | var _extends2 = __webpack_require__(104);
|
14516 |
|
14517 | var _extends3 = _interopRequireDefault(_extends2);
|
14518 |
|
14519 | var _classCallCheck2 = __webpack_require__(143);
|
14520 |
|
14521 | var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
14522 |
|
14523 | var _possibleConstructorReturn2 = __webpack_require__(144);
|
14524 |
|
14525 | var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
14526 |
|
14527 | var _inherits2 = __webpack_require__(178);
|
14528 |
|
14529 | var _inherits3 = _interopRequireDefault(_inherits2);
|
14530 |
|
14531 | var _react = __webpack_require__(4);
|
14532 |
|
14533 | var _react2 = _interopRequireDefault(_react);
|
14534 |
|
14535 | var _propTypes = __webpack_require__(5);
|
14536 |
|
14537 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
14538 |
|
14539 | var _reactDom = __webpack_require__(12);
|
14540 |
|
14541 | var _reactDom2 = _interopRequireDefault(_reactDom);
|
14542 |
|
14543 | var _rcAlign = __webpack_require__(196);
|
14544 |
|
14545 | var _rcAlign2 = _interopRequireDefault(_rcAlign);
|
14546 |
|
14547 | var _rcAnimate = __webpack_require__(199);
|
14548 |
|
14549 | var _rcAnimate2 = _interopRequireDefault(_rcAnimate);
|
14550 |
|
14551 | var _PopupInner = __webpack_require__(206);
|
14552 |
|
14553 | var _PopupInner2 = _interopRequireDefault(_PopupInner);
|
14554 |
|
14555 | var _LazyRenderBox = __webpack_require__(207);
|
14556 |
|
14557 | var _LazyRenderBox2 = _interopRequireDefault(_LazyRenderBox);
|
14558 |
|
14559 | var _utils = __webpack_require__(194);
|
14560 |
|
14561 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
14562 |
|
14563 | var Popup = function (_Component) {
|
14564 | (0, _inherits3['default'])(Popup, _Component);
|
14565 |
|
14566 | function Popup(props) {
|
14567 | (0, _classCallCheck3['default'])(this, Popup);
|
14568 |
|
14569 | var _this = (0, _possibleConstructorReturn3['default'])(this, _Component.call(this, props));
|
14570 |
|
14571 | _initialiseProps.call(_this);
|
14572 |
|
14573 | _this.state = {
|
14574 |
|
14575 | stretchChecked: false,
|
14576 | targetWidth: undefined,
|
14577 | targetHeight: undefined
|
14578 | };
|
14579 |
|
14580 | _this.savePopupRef = _utils.saveRef.bind(_this, 'popupInstance');
|
14581 | _this.saveAlignRef = _utils.saveRef.bind(_this, 'alignInstance');
|
14582 | return _this;
|
14583 | }
|
14584 |
|
14585 | Popup.prototype.componentDidMount = function componentDidMount() {
|
14586 | this.rootNode = this.getPopupDomNode();
|
14587 | this.setStretchSize();
|
14588 | };
|
14589 |
|
14590 | Popup.prototype.componentDidUpdate = function componentDidUpdate() {
|
14591 | this.setStretchSize();
|
14592 | };
|
14593 |
|
14594 |
|
14595 |
|
14596 |
|
14597 | Popup.prototype.getPopupDomNode = function getPopupDomNode() {
|
14598 | return _reactDom2['default'].findDOMNode(this.popupInstance);
|
14599 | };
|
14600 |
|
14601 |
|
14602 |
|
14603 |
|
14604 |
|
14605 | Popup.prototype.getMaskTransitionName = function getMaskTransitionName() {
|
14606 | var props = this.props;
|
14607 | var transitionName = props.maskTransitionName;
|
14608 | var animation = props.maskAnimation;
|
14609 | if (!transitionName && animation) {
|
14610 | transitionName = props.prefixCls + '-' + animation;
|
14611 | }
|
14612 | return transitionName;
|
14613 | };
|
14614 |
|
14615 | Popup.prototype.getTransitionName = function getTransitionName() {
|
14616 | var props = this.props;
|
14617 | var transitionName = props.transitionName;
|
14618 | if (!transitionName && props.animation) {
|
14619 | transitionName = props.prefixCls + '-' + props.animation;
|
14620 | }
|
14621 | return transitionName;
|
14622 | };
|
14623 |
|
14624 | Popup.prototype.getClassName = function getClassName(currentAlignClassName) {
|
14625 | return this.props.prefixCls + ' ' + this.props.className + ' ' + currentAlignClassName;
|
14626 | };
|
14627 |
|
14628 | Popup.prototype.getPopupElement = function getPopupElement() {
|
14629 | var _this2 = this;
|
14630 |
|
14631 | var savePopupRef = this.savePopupRef;
|
14632 | var _state = this.state,
|
14633 | stretchChecked = _state.stretchChecked,
|
14634 | targetHeight = _state.targetHeight,
|
14635 | targetWidth = _state.targetWidth;
|
14636 | var _props = this.props,
|
14637 | align = _props.align,
|
14638 | visible = _props.visible,
|
14639 | prefixCls = _props.prefixCls,
|
14640 | style = _props.style,
|
14641 | getClassNameFromAlign = _props.getClassNameFromAlign,
|
14642 | destroyPopupOnHide = _props.destroyPopupOnHide,
|
14643 | stretch = _props.stretch,
|
14644 | children = _props.children,
|
14645 | onMouseEnter = _props.onMouseEnter,
|
14646 | onMouseLeave = _props.onMouseLeave,
|
14647 | onMouseDown = _props.onMouseDown,
|
14648 | onTouchStart = _props.onTouchStart;
|
14649 |
|
14650 | var className = this.getClassName(this.currentAlignClassName || getClassNameFromAlign(align));
|
14651 | var hiddenClassName = prefixCls + '-hidden';
|
14652 |
|
14653 | if (!visible) {
|
14654 | this.currentAlignClassName = null;
|
14655 | }
|
14656 |
|
14657 | var sizeStyle = {};
|
14658 | if (stretch) {
|
14659 |
|
14660 | if (stretch.indexOf('height') !== -1) {
|
14661 | sizeStyle.height = targetHeight;
|
14662 | } else if (stretch.indexOf('minHeight') !== -1) {
|
14663 | sizeStyle.minHeight = targetHeight;
|
14664 | }
|
14665 | if (stretch.indexOf('width') !== -1) {
|
14666 | sizeStyle.width = targetWidth;
|
14667 | } else if (stretch.indexOf('minWidth') !== -1) {
|
14668 | sizeStyle.minWidth = targetWidth;
|
14669 | }
|
14670 |
|
14671 |
|
14672 | if (!stretchChecked) {
|
14673 | sizeStyle.visibility = 'hidden';
|
14674 | setTimeout(function () {
|
14675 | if (_this2.alignInstance) {
|
14676 | _this2.alignInstance.forceAlign();
|
14677 | }
|
14678 | }, 0);
|
14679 | }
|
14680 | }
|
14681 |
|
14682 | var newStyle = (0, _extends3['default'])({}, sizeStyle, style, this.getZIndexStyle());
|
14683 |
|
14684 | var popupInnerProps = {
|
14685 | className: className,
|
14686 | prefixCls: prefixCls,
|
14687 | ref: savePopupRef,
|
14688 | onMouseEnter: onMouseEnter,
|
14689 | onMouseLeave: onMouseLeave,
|
14690 | onMouseDown: onMouseDown,
|
14691 | onTouchStart: onTouchStart,
|
14692 | style: newStyle
|
14693 | };
|
14694 | if (destroyPopupOnHide) {
|
14695 | return _react2['default'].createElement(
|
14696 | _rcAnimate2['default'],
|
14697 | {
|
14698 | component: '',
|
14699 | exclusive: true,
|
14700 | transitionAppear: true,
|
14701 | transitionName: this.getTransitionName()
|
14702 | },
|
14703 | visible ? _react2['default'].createElement(
|
14704 | _rcAlign2['default'],
|
14705 | {
|
14706 | target: this.getAlignTarget(),
|
14707 | key: 'popup',
|
14708 | ref: this.saveAlignRef,
|
14709 | monitorWindowResize: true,
|
14710 | align: align,
|
14711 | onAlign: this.onAlign
|
14712 | },
|
14713 | _react2['default'].createElement(
|
14714 | _PopupInner2['default'],
|
14715 | (0, _extends3['default'])({
|
14716 | visible: true
|
14717 | }, popupInnerProps),
|
14718 | children
|
14719 | )
|
14720 | ) : null
|
14721 | );
|
14722 | }
|
14723 |
|
14724 | return _react2['default'].createElement(
|
14725 | _rcAnimate2['default'],
|
14726 | {
|
14727 | component: '',
|
14728 | exclusive: true,
|
14729 | transitionAppear: true,
|
14730 | transitionName: this.getTransitionName(),
|
14731 | showProp: 'xVisible'
|
14732 | },
|
14733 | _react2['default'].createElement(
|
14734 | _rcAlign2['default'],
|
14735 | {
|
14736 | target: this.getAlignTarget(),
|
14737 | key: 'popup',
|
14738 | ref: this.saveAlignRef,
|
14739 | monitorWindowResize: true,
|
14740 | xVisible: visible,
|
14741 | childrenProps: { visible: 'xVisible' },
|
14742 | disabled: !visible,
|
14743 | align: align,
|
14744 | onAlign: this.onAlign
|
14745 | },
|
14746 | _react2['default'].createElement(
|
14747 | _PopupInner2['default'],
|
14748 | (0, _extends3['default'])({
|
14749 | hiddenClassName: hiddenClassName
|
14750 | }, popupInnerProps),
|
14751 | children
|
14752 | )
|
14753 | )
|
14754 | );
|
14755 | };
|
14756 |
|
14757 | Popup.prototype.getZIndexStyle = function getZIndexStyle() {
|
14758 | var style = {};
|
14759 | var props = this.props;
|
14760 | if (props.zIndex !== undefined) {
|
14761 | style.zIndex = props.zIndex;
|
14762 | }
|
14763 | return style;
|
14764 | };
|
14765 |
|
14766 | Popup.prototype.getMaskElement = function getMaskElement() {
|
14767 | var props = this.props;
|
14768 | var maskElement = void 0;
|
14769 | if (props.mask) {
|
14770 | var maskTransition = this.getMaskTransitionName();
|
14771 | maskElement = _react2['default'].createElement(_LazyRenderBox2['default'], {
|
14772 | style: this.getZIndexStyle(),
|
14773 | key: 'mask',
|
14774 | className: props.prefixCls + '-mask',
|
14775 | hiddenClassName: props.prefixCls + '-mask-hidden',
|
14776 | visible: props.visible
|
14777 | });
|
14778 | if (maskTransition) {
|
14779 | maskElement = _react2['default'].createElement(
|
14780 | _rcAnimate2['default'],
|
14781 | {
|
14782 | key: 'mask',
|
14783 | showProp: 'visible',
|
14784 | transitionAppear: true,
|
14785 | component: '',
|
14786 | transitionName: maskTransition
|
14787 | },
|
14788 | maskElement
|
14789 | );
|
14790 | }
|
14791 | }
|
14792 | return maskElement;
|
14793 | };
|
14794 |
|
14795 | Popup.prototype.render = function render() {
|
14796 | return _react2['default'].createElement(
|
14797 | 'div',
|
14798 | null,
|
14799 | this.getMaskElement(),
|
14800 | this.getPopupElement()
|
14801 | );
|
14802 | };
|
14803 |
|
14804 | return Popup;
|
14805 | }(_react.Component);
|
14806 |
|
14807 | Popup.propTypes = {
|
14808 | visible: _propTypes2['default'].bool,
|
14809 | style: _propTypes2['default'].object,
|
14810 | getClassNameFromAlign: _propTypes2['default'].func,
|
14811 | onAlign: _propTypes2['default'].func,
|
14812 | getRootDomNode: _propTypes2['default'].func,
|
14813 | align: _propTypes2['default'].any,
|
14814 | destroyPopupOnHide: _propTypes2['default'].bool,
|
14815 | className: _propTypes2['default'].string,
|
14816 | prefixCls: _propTypes2['default'].string,
|
14817 | onMouseEnter: _propTypes2['default'].func,
|
14818 | onMouseLeave: _propTypes2['default'].func,
|
14819 | onMouseDown: _propTypes2['default'].func,
|
14820 | onTouchStart: _propTypes2['default'].func,
|
14821 | stretch: _propTypes2['default'].string,
|
14822 | children: _propTypes2['default'].node,
|
14823 | point: _propTypes2['default'].shape({
|
14824 | pageX: _propTypes2['default'].number,
|
14825 | pageY: _propTypes2['default'].number
|
14826 | })
|
14827 | };
|
14828 |
|
14829 | var _initialiseProps = function _initialiseProps() {
|
14830 | var _this3 = this;
|
14831 |
|
14832 | this.onAlign = function (popupDomNode, align) {
|
14833 | var props = _this3.props;
|
14834 | var currentAlignClassName = props.getClassNameFromAlign(align);
|
14835 |
|
14836 |
|
14837 | if (_this3.currentAlignClassName !== currentAlignClassName) {
|
14838 | _this3.currentAlignClassName = currentAlignClassName;
|
14839 | popupDomNode.className = _this3.getClassName(currentAlignClassName);
|
14840 | }
|
14841 | props.onAlign(popupDomNode, align);
|
14842 | };
|
14843 |
|
14844 | this.setStretchSize = function () {
|
14845 | var _props2 = _this3.props,
|
14846 | stretch = _props2.stretch,
|
14847 | getRootDomNode = _props2.getRootDomNode,
|
14848 | visible = _props2.visible;
|
14849 | var _state2 = _this3.state,
|
14850 | stretchChecked = _state2.stretchChecked,
|
14851 | targetHeight = _state2.targetHeight,
|
14852 | targetWidth = _state2.targetWidth;
|
14853 |
|
14854 |
|
14855 | if (!stretch || !visible) {
|
14856 | if (stretchChecked) {
|
14857 | _this3.setState({ stretchChecked: false });
|
14858 | }
|
14859 | return;
|
14860 | }
|
14861 |
|
14862 | var $ele = getRootDomNode();
|
14863 | if (!$ele) return;
|
14864 |
|
14865 | var height = $ele.offsetHeight;
|
14866 | var width = $ele.offsetWidth;
|
14867 |
|
14868 | if (targetHeight !== height || targetWidth !== width || !stretchChecked) {
|
14869 | _this3.setState({
|
14870 | stretchChecked: true,
|
14871 | targetHeight: height,
|
14872 | targetWidth: width
|
14873 | });
|
14874 | }
|
14875 | };
|
14876 |
|
14877 | this.getTargetElement = function () {
|
14878 | return _this3.props.getRootDomNode();
|
14879 | };
|
14880 |
|
14881 | this.getAlignTarget = function () {
|
14882 | var point = _this3.props.point;
|
14883 |
|
14884 | if (point) {
|
14885 | return point;
|
14886 | }
|
14887 | return _this3.getTargetElement;
|
14888 | };
|
14889 | };
|
14890 |
|
14891 | exports['default'] = Popup;
|
14892 | module.exports = exports['default'];
|
14893 |
|
14894 | }),
|
14895 |
|
14896 | (function(module, exports, __webpack_require__) {
|
14897 |
|
14898 | 'use strict';
|
14899 |
|
14900 | exports.__esModule = true;
|
14901 |
|
14902 | var _Align = __webpack_require__(197);
|
14903 |
|
14904 | var _Align2 = _interopRequireDefault(_Align);
|
14905 |
|
14906 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
14907 |
|
14908 | exports['default'] = _Align2['default'];
|
14909 |
|
14910 | module.exports = exports['default'];
|
14911 |
|
14912 | }),
|
14913 |
|
14914 | (function(module, exports, __webpack_require__) {
|
14915 |
|
14916 | 'use strict';
|
14917 |
|
14918 | exports.__esModule = true;
|
14919 |
|
14920 | var _classCallCheck2 = __webpack_require__(143);
|
14921 |
|
14922 | var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
14923 |
|
14924 | var _possibleConstructorReturn2 = __webpack_require__(144);
|
14925 |
|
14926 | var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
14927 |
|
14928 | var _inherits2 = __webpack_require__(178);
|
14929 |
|
14930 | var _inherits3 = _interopRequireDefault(_inherits2);
|
14931 |
|
14932 | var _react = __webpack_require__(4);
|
14933 |
|
14934 | var _react2 = _interopRequireDefault(_react);
|
14935 |
|
14936 | var _propTypes = __webpack_require__(5);
|
14937 |
|
14938 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
14939 |
|
14940 | var _reactDom = __webpack_require__(12);
|
14941 |
|
14942 | var _reactDom2 = _interopRequireDefault(_reactDom);
|
14943 |
|
14944 | var _domAlign = __webpack_require__(51);
|
14945 |
|
14946 | var _addEventListener = __webpack_require__(187);
|
14947 |
|
14948 | var _addEventListener2 = _interopRequireDefault(_addEventListener);
|
14949 |
|
14950 | var _util = __webpack_require__(198);
|
14951 |
|
14952 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
14953 |
|
14954 | function getElement(func) {
|
14955 | if (typeof func !== 'function' || !func) return null;
|
14956 | return func();
|
14957 | }
|
14958 |
|
14959 | function getPoint(point) {
|
14960 | if (typeof point !== 'object' || !point) return null;
|
14961 | return point;
|
14962 | }
|
14963 |
|
14964 | var Align = function (_Component) {
|
14965 | (0, _inherits3['default'])(Align, _Component);
|
14966 |
|
14967 | function Align() {
|
14968 | var _temp, _this, _ret;
|
14969 |
|
14970 | (0, _classCallCheck3['default'])(this, Align);
|
14971 |
|
14972 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
14973 | args[_key] = arguments[_key];
|
14974 | }
|
14975 |
|
14976 | return _ret = (_temp = (_this = (0, _possibleConstructorReturn3['default'])(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.forceAlign = function () {
|
14977 | var _this$props = _this.props,
|
14978 | disabled = _this$props.disabled,
|
14979 | target = _this$props.target,
|
14980 | align = _this$props.align,
|
14981 | onAlign = _this$props.onAlign;
|
14982 |
|
14983 | if (!disabled && target) {
|
14984 | var source = _reactDom2['default'].findDOMNode(_this);
|
14985 |
|
14986 | var result = void 0;
|
14987 | var element = getElement(target);
|
14988 | var point = getPoint(target);
|
14989 |
|
14990 | if (element) {
|
14991 | result = (0, _domAlign.alignElement)(source, element, align);
|
14992 | } else if (point) {
|
14993 | result = (0, _domAlign.alignPoint)(source, point, align);
|
14994 | }
|
14995 |
|
14996 | if (onAlign) {
|
14997 | onAlign(source, result);
|
14998 | }
|
14999 | }
|
15000 | }, _temp), (0, _possibleConstructorReturn3['default'])(_this, _ret);
|
15001 | }
|
15002 |
|
15003 | Align.prototype.componentDidMount = function componentDidMount() {
|
15004 | var props = this.props;
|
15005 |
|
15006 | this.forceAlign();
|
15007 | if (!props.disabled && props.monitorWindowResize) {
|
15008 | this.startMonitorWindowResize();
|
15009 | }
|
15010 | };
|
15011 |
|
15012 | Align.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {
|
15013 | var reAlign = false;
|
15014 | var props = this.props;
|
15015 |
|
15016 | if (!props.disabled) {
|
15017 | var source = _reactDom2['default'].findDOMNode(this);
|
15018 | var sourceRect = source ? source.getBoundingClientRect() : null;
|
15019 |
|
15020 | if (prevProps.disabled) {
|
15021 | reAlign = true;
|
15022 | } else {
|
15023 | var lastElement = getElement(prevProps.target);
|
15024 | var currentElement = getElement(props.target);
|
15025 | var lastPoint = getPoint(prevProps.target);
|
15026 | var currentPoint = getPoint(props.target);
|
15027 |
|
15028 | if ((0, _util.isWindow)(lastElement) && (0, _util.isWindow)(currentElement)) {
|
15029 |
|
15030 | reAlign = false;
|
15031 | } else if (lastElement !== currentElement ||
|
15032 | lastElement && !currentElement && currentPoint ||
|
15033 | lastPoint && currentPoint && currentElement ||
|
15034 | currentPoint && !(0, _util.isSamePoint)(lastPoint, currentPoint)) {
|
15035 | reAlign = true;
|
15036 | }
|
15037 |
|
15038 |
|
15039 | var preRect = this.sourceRect || {};
|
15040 | if (!reAlign && source && (preRect.width !== sourceRect.width || preRect.height !== sourceRect.height)) {
|
15041 | reAlign = true;
|
15042 | }
|
15043 | }
|
15044 |
|
15045 | this.sourceRect = sourceRect;
|
15046 | }
|
15047 |
|
15048 | if (reAlign) {
|
15049 | this.forceAlign();
|
15050 | }
|
15051 |
|
15052 | if (props.monitorWindowResize && !props.disabled) {
|
15053 | this.startMonitorWindowResize();
|
15054 | } else {
|
15055 | this.stopMonitorWindowResize();
|
15056 | }
|
15057 | };
|
15058 |
|
15059 | Align.prototype.componentWillUnmount = function componentWillUnmount() {
|
15060 | this.stopMonitorWindowResize();
|
15061 | };
|
15062 |
|
15063 | Align.prototype.startMonitorWindowResize = function startMonitorWindowResize() {
|
15064 | if (!this.resizeHandler) {
|
15065 | this.bufferMonitor = (0, _util.buffer)(this.forceAlign, this.props.monitorBufferTime);
|
15066 | this.resizeHandler = (0, _addEventListener2['default'])(window, 'resize', this.bufferMonitor);
|
15067 | }
|
15068 | };
|
15069 |
|
15070 | Align.prototype.stopMonitorWindowResize = function stopMonitorWindowResize() {
|
15071 | if (this.resizeHandler) {
|
15072 | this.bufferMonitor.clear();
|
15073 | this.resizeHandler.remove();
|
15074 | this.resizeHandler = null;
|
15075 | }
|
15076 | };
|
15077 |
|
15078 | Align.prototype.render = function render() {
|
15079 | var _this2 = this;
|
15080 |
|
15081 | var _props = this.props,
|
15082 | childrenProps = _props.childrenProps,
|
15083 | children = _props.children;
|
15084 |
|
15085 | var child = _react2['default'].Children.only(children);
|
15086 | if (childrenProps) {
|
15087 | var newProps = {};
|
15088 | var propList = Object.keys(childrenProps);
|
15089 | propList.forEach(function (prop) {
|
15090 | newProps[prop] = _this2.props[childrenProps[prop]];
|
15091 | });
|
15092 |
|
15093 | return _react2['default'].cloneElement(child, newProps);
|
15094 | }
|
15095 | return child;
|
15096 | };
|
15097 |
|
15098 | return Align;
|
15099 | }(_react.Component);
|
15100 |
|
15101 | Align.propTypes = {
|
15102 | childrenProps: _propTypes2['default'].object,
|
15103 | align: _propTypes2['default'].object.isRequired,
|
15104 | target: _propTypes2['default'].oneOfType([_propTypes2['default'].func, _propTypes2['default'].shape({
|
15105 | clientX: _propTypes2['default'].number,
|
15106 | clientY: _propTypes2['default'].number,
|
15107 | pageX: _propTypes2['default'].number,
|
15108 | pageY: _propTypes2['default'].number
|
15109 | })]),
|
15110 | onAlign: _propTypes2['default'].func,
|
15111 | monitorBufferTime: _propTypes2['default'].number,
|
15112 | monitorWindowResize: _propTypes2['default'].bool,
|
15113 | disabled: _propTypes2['default'].bool,
|
15114 | children: _propTypes2['default'].any
|
15115 | };
|
15116 | Align.defaultProps = {
|
15117 | target: function target() {
|
15118 | return window;
|
15119 | },
|
15120 | monitorBufferTime: 50,
|
15121 | monitorWindowResize: false,
|
15122 | disabled: false
|
15123 | };
|
15124 | exports['default'] = Align;
|
15125 | module.exports = exports['default'];
|
15126 |
|
15127 | }),
|
15128 |
|
15129 | (function(module, exports) {
|
15130 |
|
15131 | 'use strict';
|
15132 |
|
15133 | exports.__esModule = true;
|
15134 | exports.buffer = buffer;
|
15135 | exports.isSamePoint = isSamePoint;
|
15136 | exports.isWindow = isWindow;
|
15137 | function buffer(fn, ms) {
|
15138 | var timer = void 0;
|
15139 |
|
15140 | function clear() {
|
15141 | if (timer) {
|
15142 | clearTimeout(timer);
|
15143 | timer = null;
|
15144 | }
|
15145 | }
|
15146 |
|
15147 | function bufferFn() {
|
15148 | clear();
|
15149 | timer = setTimeout(fn, ms);
|
15150 | }
|
15151 |
|
15152 | bufferFn.clear = clear;
|
15153 |
|
15154 | return bufferFn;
|
15155 | }
|
15156 |
|
15157 | function isSamePoint(prev, next) {
|
15158 | if (prev === next) return true;
|
15159 | if (!prev || !next) return false;
|
15160 |
|
15161 | if ('pageX' in next && 'pageY' in next) {
|
15162 | return prev.pageX === next.pageX && prev.pageY === next.pageY;
|
15163 | }
|
15164 |
|
15165 | if ('clientX' in next && 'clientY' in next) {
|
15166 | return prev.clientX === next.clientX && prev.clientY === next.clientY;
|
15167 | }
|
15168 |
|
15169 | return false;
|
15170 | }
|
15171 |
|
15172 | function isWindow(obj) {
|
15173 | return obj && typeof obj === 'object' && obj.window === obj;
|
15174 | }
|
15175 |
|
15176 | }),
|
15177 |
|
15178 | (function(module, exports, __webpack_require__) {
|
15179 |
|
15180 | 'use strict';
|
15181 |
|
15182 | Object.defineProperty(exports, "__esModule", {
|
15183 | value: true
|
15184 | });
|
15185 |
|
15186 | var _extends2 = __webpack_require__(104);
|
15187 |
|
15188 | var _extends3 = _interopRequireDefault(_extends2);
|
15189 |
|
15190 | var _defineProperty2 = __webpack_require__(200);
|
15191 |
|
15192 | var _defineProperty3 = _interopRequireDefault(_defineProperty2);
|
15193 |
|
15194 | var _classCallCheck2 = __webpack_require__(143);
|
15195 |
|
15196 | var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
15197 |
|
15198 | var _createClass2 = __webpack_require__(189);
|
15199 |
|
15200 | var _createClass3 = _interopRequireDefault(_createClass2);
|
15201 |
|
15202 | var _possibleConstructorReturn2 = __webpack_require__(144);
|
15203 |
|
15204 | var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
15205 |
|
15206 | var _inherits2 = __webpack_require__(178);
|
15207 |
|
15208 | var _inherits3 = _interopRequireDefault(_inherits2);
|
15209 |
|
15210 | var _react = __webpack_require__(4);
|
15211 |
|
15212 | var _react2 = _interopRequireDefault(_react);
|
15213 |
|
15214 | var _propTypes = __webpack_require__(5);
|
15215 |
|
15216 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
15217 |
|
15218 | var _ChildrenUtils = __webpack_require__(201);
|
15219 |
|
15220 | var _AnimateChild = __webpack_require__(202);
|
15221 |
|
15222 | var _AnimateChild2 = _interopRequireDefault(_AnimateChild);
|
15223 |
|
15224 | var _animate = __webpack_require__(205);
|
15225 |
|
15226 | var _animate2 = _interopRequireDefault(_animate);
|
15227 |
|
15228 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
15229 |
|
15230 | var defaultKey = 'rc_animate_' + Date.now();
|
15231 |
|
15232 | function getChildrenFromProps(props) {
|
15233 | var children = props.children;
|
15234 | if (_react2['default'].isValidElement(children)) {
|
15235 | if (!children.key) {
|
15236 | return _react2['default'].cloneElement(children, {
|
15237 | key: defaultKey
|
15238 | });
|
15239 | }
|
15240 | }
|
15241 | return children;
|
15242 | }
|
15243 |
|
15244 | function noop() {}
|
15245 |
|
15246 | var Animate = function (_React$Component) {
|
15247 | (0, _inherits3['default'])(Animate, _React$Component);
|
15248 |
|
15249 |
|
15250 |
|
15251 | function Animate(props) {
|
15252 | (0, _classCallCheck3['default'])(this, Animate);
|
15253 |
|
15254 | var _this = (0, _possibleConstructorReturn3['default'])(this, (Animate.__proto__ || Object.getPrototypeOf(Animate)).call(this, props));
|
15255 |
|
15256 | _initialiseProps.call(_this);
|
15257 |
|
15258 | _this.currentlyAnimatingKeys = {};
|
15259 | _this.keysToEnter = [];
|
15260 | _this.keysToLeave = [];
|
15261 |
|
15262 | _this.state = {
|
15263 | children: (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(props))
|
15264 | };
|
15265 |
|
15266 | _this.childrenRefs = {};
|
15267 | return _this;
|
15268 | }
|
15269 |
|
15270 | (0, _createClass3['default'])(Animate, [{
|
15271 | key: 'componentDidMount',
|
15272 | value: function componentDidMount() {
|
15273 | var _this2 = this;
|
15274 |
|
15275 | var showProp = this.props.showProp;
|
15276 | var children = this.state.children;
|
15277 | if (showProp) {
|
15278 | children = children.filter(function (child) {
|
15279 | return !!child.props[showProp];
|
15280 | });
|
15281 | }
|
15282 | children.forEach(function (child) {
|
15283 | if (child) {
|
15284 | _this2.performAppear(child.key);
|
15285 | }
|
15286 | });
|
15287 | }
|
15288 | }, {
|
15289 | key: 'componentWillReceiveProps',
|
15290 | value: function componentWillReceiveProps(nextProps) {
|
15291 | var _this3 = this;
|
15292 |
|
15293 | this.nextProps = nextProps;
|
15294 | var nextChildren = (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(nextProps));
|
15295 | var props = this.props;
|
15296 |
|
15297 | if (props.exclusive) {
|
15298 | Object.keys(this.currentlyAnimatingKeys).forEach(function (key) {
|
15299 | _this3.stop(key);
|
15300 | });
|
15301 | }
|
15302 | var showProp = props.showProp;
|
15303 | var currentlyAnimatingKeys = this.currentlyAnimatingKeys;
|
15304 |
|
15305 | var currentChildren = props.exclusive ? (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(props)) : this.state.children;
|
15306 |
|
15307 | var newChildren = [];
|
15308 | if (showProp) {
|
15309 | currentChildren.forEach(function (currentChild) {
|
15310 | var nextChild = currentChild && (0, _ChildrenUtils.findChildInChildrenByKey)(nextChildren, currentChild.key);
|
15311 | var newChild = void 0;
|
15312 | if ((!nextChild || !nextChild.props[showProp]) && currentChild.props[showProp]) {
|
15313 | newChild = _react2['default'].cloneElement(nextChild || currentChild, (0, _defineProperty3['default'])({}, showProp, true));
|
15314 | } else {
|
15315 | newChild = nextChild;
|
15316 | }
|
15317 | if (newChild) {
|
15318 | newChildren.push(newChild);
|
15319 | }
|
15320 | });
|
15321 | nextChildren.forEach(function (nextChild) {
|
15322 | if (!nextChild || !(0, _ChildrenUtils.findChildInChildrenByKey)(currentChildren, nextChild.key)) {
|
15323 | newChildren.push(nextChild);
|
15324 | }
|
15325 | });
|
15326 | } else {
|
15327 | newChildren = (0, _ChildrenUtils.mergeChildren)(currentChildren, nextChildren);
|
15328 | }
|
15329 |
|
15330 |
|
15331 | this.setState({
|
15332 | children: newChildren
|
15333 | });
|
15334 |
|
15335 | nextChildren.forEach(function (child) {
|
15336 | var key = child && child.key;
|
15337 | if (child && currentlyAnimatingKeys[key]) {
|
15338 | return;
|
15339 | }
|
15340 | var hasPrev = child && (0, _ChildrenUtils.findChildInChildrenByKey)(currentChildren, key);
|
15341 | if (showProp) {
|
15342 | var showInNext = child.props[showProp];
|
15343 | if (hasPrev) {
|
15344 | var showInNow = (0, _ChildrenUtils.findShownChildInChildrenByKey)(currentChildren, key, showProp);
|
15345 | if (!showInNow && showInNext) {
|
15346 | _this3.keysToEnter.push(key);
|
15347 | }
|
15348 | } else if (showInNext) {
|
15349 | _this3.keysToEnter.push(key);
|
15350 | }
|
15351 | } else if (!hasPrev) {
|
15352 | _this3.keysToEnter.push(key);
|
15353 | }
|
15354 | });
|
15355 |
|
15356 | currentChildren.forEach(function (child) {
|
15357 | var key = child && child.key;
|
15358 | if (child && currentlyAnimatingKeys[key]) {
|
15359 | return;
|
15360 | }
|
15361 | var hasNext = child && (0, _ChildrenUtils.findChildInChildrenByKey)(nextChildren, key);
|
15362 | if (showProp) {
|
15363 | var showInNow = child.props[showProp];
|
15364 | if (hasNext) {
|
15365 | var showInNext = (0, _ChildrenUtils.findShownChildInChildrenByKey)(nextChildren, key, showProp);
|
15366 | if (!showInNext && showInNow) {
|
15367 | _this3.keysToLeave.push(key);
|
15368 | }
|
15369 | } else if (showInNow) {
|
15370 | _this3.keysToLeave.push(key);
|
15371 | }
|
15372 | } else if (!hasNext) {
|
15373 | _this3.keysToLeave.push(key);
|
15374 | }
|
15375 | });
|
15376 | }
|
15377 | }, {
|
15378 | key: 'componentDidUpdate',
|
15379 | value: function componentDidUpdate() {
|
15380 | var keysToEnter = this.keysToEnter;
|
15381 | this.keysToEnter = [];
|
15382 | keysToEnter.forEach(this.performEnter);
|
15383 | var keysToLeave = this.keysToLeave;
|
15384 | this.keysToLeave = [];
|
15385 | keysToLeave.forEach(this.performLeave);
|
15386 | }
|
15387 | }, {
|
15388 | key: 'isValidChildByKey',
|
15389 | value: function isValidChildByKey(currentChildren, key) {
|
15390 | var showProp = this.props.showProp;
|
15391 | if (showProp) {
|
15392 | return (0, _ChildrenUtils.findShownChildInChildrenByKey)(currentChildren, key, showProp);
|
15393 | }
|
15394 | return (0, _ChildrenUtils.findChildInChildrenByKey)(currentChildren, key);
|
15395 | }
|
15396 | }, {
|
15397 | key: 'stop',
|
15398 | value: function stop(key) {
|
15399 | delete this.currentlyAnimatingKeys[key];
|
15400 | var component = this.childrenRefs[key];
|
15401 | if (component) {
|
15402 | component.stop();
|
15403 | }
|
15404 | }
|
15405 | }, {
|
15406 | key: 'render',
|
15407 | value: function render() {
|
15408 | var _this4 = this;
|
15409 |
|
15410 | var props = this.props;
|
15411 | this.nextProps = props;
|
15412 | var stateChildren = this.state.children;
|
15413 | var children = null;
|
15414 | if (stateChildren) {
|
15415 | children = stateChildren.map(function (child) {
|
15416 | if (child === null || child === undefined) {
|
15417 | return child;
|
15418 | }
|
15419 | if (!child.key) {
|
15420 | throw new Error('must set key for <rc-animate> children');
|
15421 | }
|
15422 | return _react2['default'].createElement(
|
15423 | _AnimateChild2['default'],
|
15424 | {
|
15425 | key: child.key,
|
15426 | ref: function ref(node) {
|
15427 | _this4.childrenRefs[child.key] = node;
|
15428 | },
|
15429 | animation: props.animation,
|
15430 | transitionName: props.transitionName,
|
15431 | transitionEnter: props.transitionEnter,
|
15432 | transitionAppear: props.transitionAppear,
|
15433 | transitionLeave: props.transitionLeave
|
15434 | },
|
15435 | child
|
15436 | );
|
15437 | });
|
15438 | }
|
15439 | var Component = props.component;
|
15440 | if (Component) {
|
15441 | var passedProps = props;
|
15442 | if (typeof Component === 'string') {
|
15443 | passedProps = (0, _extends3['default'])({
|
15444 | className: props.className,
|
15445 | style: props.style
|
15446 | }, props.componentProps);
|
15447 | }
|
15448 | return _react2['default'].createElement(
|
15449 | Component,
|
15450 | passedProps,
|
15451 | children
|
15452 | );
|
15453 | }
|
15454 | return children[0] || null;
|
15455 | }
|
15456 | }]);
|
15457 | return Animate;
|
15458 | }(_react2['default'].Component);
|
15459 |
|
15460 | Animate.isAnimate = true;
|
15461 | Animate.propTypes = {
|
15462 | component: _propTypes2['default'].any,
|
15463 | componentProps: _propTypes2['default'].object,
|
15464 | animation: _propTypes2['default'].object,
|
15465 | transitionName: _propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].object]),
|
15466 | transitionEnter: _propTypes2['default'].bool,
|
15467 | transitionAppear: _propTypes2['default'].bool,
|
15468 | exclusive: _propTypes2['default'].bool,
|
15469 | transitionLeave: _propTypes2['default'].bool,
|
15470 | onEnd: _propTypes2['default'].func,
|
15471 | onEnter: _propTypes2['default'].func,
|
15472 | onLeave: _propTypes2['default'].func,
|
15473 | onAppear: _propTypes2['default'].func,
|
15474 | showProp: _propTypes2['default'].string,
|
15475 | children: _propTypes2['default'].node
|
15476 | };
|
15477 | Animate.defaultProps = {
|
15478 | animation: {},
|
15479 | component: 'span',
|
15480 | componentProps: {},
|
15481 | transitionEnter: true,
|
15482 | transitionLeave: true,
|
15483 | transitionAppear: false,
|
15484 | onEnd: noop,
|
15485 | onEnter: noop,
|
15486 | onLeave: noop,
|
15487 | onAppear: noop
|
15488 | };
|
15489 |
|
15490 | var _initialiseProps = function _initialiseProps() {
|
15491 | var _this5 = this;
|
15492 |
|
15493 | this.performEnter = function (key) {
|
15494 |
|
15495 | if (_this5.childrenRefs[key]) {
|
15496 | _this5.currentlyAnimatingKeys[key] = true;
|
15497 | _this5.childrenRefs[key].componentWillEnter(_this5.handleDoneAdding.bind(_this5, key, 'enter'));
|
15498 | }
|
15499 | };
|
15500 |
|
15501 | this.performAppear = function (key) {
|
15502 | if (_this5.childrenRefs[key]) {
|
15503 | _this5.currentlyAnimatingKeys[key] = true;
|
15504 | _this5.childrenRefs[key].componentWillAppear(_this5.handleDoneAdding.bind(_this5, key, 'appear'));
|
15505 | }
|
15506 | };
|
15507 |
|
15508 | this.handleDoneAdding = function (key, type) {
|
15509 | var props = _this5.props;
|
15510 | delete _this5.currentlyAnimatingKeys[key];
|
15511 |
|
15512 | if (props.exclusive && props !== _this5.nextProps) {
|
15513 | return;
|
15514 | }
|
15515 | var currentChildren = (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(props));
|
15516 | if (!_this5.isValidChildByKey(currentChildren, key)) {
|
15517 |
|
15518 | _this5.performLeave(key);
|
15519 | } else if (type === 'appear') {
|
15520 | if (_animate2['default'].allowAppearCallback(props)) {
|
15521 | props.onAppear(key);
|
15522 | props.onEnd(key, true);
|
15523 | }
|
15524 | } else if (_animate2['default'].allowEnterCallback(props)) {
|
15525 | props.onEnter(key);
|
15526 | props.onEnd(key, true);
|
15527 | }
|
15528 | };
|
15529 |
|
15530 | this.performLeave = function (key) {
|
15531 |
|
15532 | if (_this5.childrenRefs[key]) {
|
15533 | _this5.currentlyAnimatingKeys[key] = true;
|
15534 | _this5.childrenRefs[key].componentWillLeave(_this5.handleDoneLeaving.bind(_this5, key));
|
15535 | }
|
15536 | };
|
15537 |
|
15538 | this.handleDoneLeaving = function (key) {
|
15539 | var props = _this5.props;
|
15540 | delete _this5.currentlyAnimatingKeys[key];
|
15541 |
|
15542 | if (props.exclusive && props !== _this5.nextProps) {
|
15543 | return;
|
15544 | }
|
15545 | var currentChildren = (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(props));
|
15546 |
|
15547 | if (_this5.isValidChildByKey(currentChildren, key)) {
|
15548 | _this5.performEnter(key);
|
15549 | } else {
|
15550 | var end = function end() {
|
15551 | if (_animate2['default'].allowLeaveCallback(props)) {
|
15552 | props.onLeave(key);
|
15553 | props.onEnd(key, false);
|
15554 | }
|
15555 | };
|
15556 | if (!(0, _ChildrenUtils.isSameChildren)(_this5.state.children, currentChildren, props.showProp)) {
|
15557 | _this5.setState({
|
15558 | children: currentChildren
|
15559 | }, end);
|
15560 | } else {
|
15561 | end();
|
15562 | }
|
15563 | }
|
15564 | };
|
15565 | };
|
15566 |
|
15567 | exports['default'] = Animate;
|
15568 | module.exports = exports['default'];
|
15569 |
|
15570 | }),
|
15571 |
|
15572 | (function(module, exports, __webpack_require__) {
|
15573 |
|
15574 | "use strict";
|
15575 |
|
15576 | exports.__esModule = true;
|
15577 |
|
15578 | var _defineProperty = __webpack_require__(190);
|
15579 |
|
15580 | var _defineProperty2 = _interopRequireDefault(_defineProperty);
|
15581 |
|
15582 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
15583 |
|
15584 | exports.default = function (obj, key, value) {
|
15585 | if (key in obj) {
|
15586 | (0, _defineProperty2.default)(obj, key, {
|
15587 | value: value,
|
15588 | enumerable: true,
|
15589 | configurable: true,
|
15590 | writable: true
|
15591 | });
|
15592 | } else {
|
15593 | obj[key] = value;
|
15594 | }
|
15595 |
|
15596 | return obj;
|
15597 | };
|
15598 |
|
15599 | }),
|
15600 |
|
15601 | (function(module, exports, __webpack_require__) {
|
15602 |
|
15603 | 'use strict';
|
15604 |
|
15605 | Object.defineProperty(exports, "__esModule", {
|
15606 | value: true
|
15607 | });
|
15608 | exports.toArrayChildren = toArrayChildren;
|
15609 | exports.findChildInChildrenByKey = findChildInChildrenByKey;
|
15610 | exports.findShownChildInChildrenByKey = findShownChildInChildrenByKey;
|
15611 | exports.findHiddenChildInChildrenByKey = findHiddenChildInChildrenByKey;
|
15612 | exports.isSameChildren = isSameChildren;
|
15613 | exports.mergeChildren = mergeChildren;
|
15614 |
|
15615 | var _react = __webpack_require__(4);
|
15616 |
|
15617 | var _react2 = _interopRequireDefault(_react);
|
15618 |
|
15619 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
15620 |
|
15621 | function toArrayChildren(children) {
|
15622 | var ret = [];
|
15623 | _react2['default'].Children.forEach(children, function (child) {
|
15624 | ret.push(child);
|
15625 | });
|
15626 | return ret;
|
15627 | }
|
15628 |
|
15629 | function findChildInChildrenByKey(children, key) {
|
15630 | var ret = null;
|
15631 | if (children) {
|
15632 | children.forEach(function (child) {
|
15633 | if (ret) {
|
15634 | return;
|
15635 | }
|
15636 | if (child && child.key === key) {
|
15637 | ret = child;
|
15638 | }
|
15639 | });
|
15640 | }
|
15641 | return ret;
|
15642 | }
|
15643 |
|
15644 | function findShownChildInChildrenByKey(children, key, showProp) {
|
15645 | var ret = null;
|
15646 | if (children) {
|
15647 | children.forEach(function (child) {
|
15648 | if (child && child.key === key && child.props[showProp]) {
|
15649 | if (ret) {
|
15650 | throw new Error('two child with same key for <rc-animate> children');
|
15651 | }
|
15652 | ret = child;
|
15653 | }
|
15654 | });
|
15655 | }
|
15656 | return ret;
|
15657 | }
|
15658 |
|
15659 | function findHiddenChildInChildrenByKey(children, key, showProp) {
|
15660 | var found = 0;
|
15661 | if (children) {
|
15662 | children.forEach(function (child) {
|
15663 | if (found) {
|
15664 | return;
|
15665 | }
|
15666 | found = child && child.key === key && !child.props[showProp];
|
15667 | });
|
15668 | }
|
15669 | return found;
|
15670 | }
|
15671 |
|
15672 | function isSameChildren(c1, c2, showProp) {
|
15673 | var same = c1.length === c2.length;
|
15674 | if (same) {
|
15675 | c1.forEach(function (child, index) {
|
15676 | var child2 = c2[index];
|
15677 | if (child && child2) {
|
15678 | if (child && !child2 || !child && child2) {
|
15679 | same = false;
|
15680 | } else if (child.key !== child2.key) {
|
15681 | same = false;
|
15682 | } else if (showProp && child.props[showProp] !== child2.props[showProp]) {
|
15683 | same = false;
|
15684 | }
|
15685 | }
|
15686 | });
|
15687 | }
|
15688 | return same;
|
15689 | }
|
15690 |
|
15691 | function mergeChildren(prev, next) {
|
15692 | var ret = [];
|
15693 |
|
15694 |
|
15695 |
|
15696 | var nextChildrenPending = {};
|
15697 | var pendingChildren = [];
|
15698 | prev.forEach(function (child) {
|
15699 | if (child && findChildInChildrenByKey(next, child.key)) {
|
15700 | if (pendingChildren.length) {
|
15701 | nextChildrenPending[child.key] = pendingChildren;
|
15702 | pendingChildren = [];
|
15703 | }
|
15704 | } else {
|
15705 | pendingChildren.push(child);
|
15706 | }
|
15707 | });
|
15708 |
|
15709 | next.forEach(function (child) {
|
15710 | if (child && Object.prototype.hasOwnProperty.call(nextChildrenPending, child.key)) {
|
15711 | ret = ret.concat(nextChildrenPending[child.key]);
|
15712 | }
|
15713 | ret.push(child);
|
15714 | });
|
15715 |
|
15716 | ret = ret.concat(pendingChildren);
|
15717 |
|
15718 | return ret;
|
15719 | }
|
15720 |
|
15721 | }),
|
15722 |
|
15723 | (function(module, exports, __webpack_require__) {
|
15724 |
|
15725 | 'use strict';
|
15726 |
|
15727 | Object.defineProperty(exports, "__esModule", {
|
15728 | value: true
|
15729 | });
|
15730 |
|
15731 | var _classCallCheck2 = __webpack_require__(143);
|
15732 |
|
15733 | var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
15734 |
|
15735 | var _createClass2 = __webpack_require__(189);
|
15736 |
|
15737 | var _createClass3 = _interopRequireDefault(_createClass2);
|
15738 |
|
15739 | var _possibleConstructorReturn2 = __webpack_require__(144);
|
15740 |
|
15741 | var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
15742 |
|
15743 | var _inherits2 = __webpack_require__(178);
|
15744 |
|
15745 | var _inherits3 = _interopRequireDefault(_inherits2);
|
15746 |
|
15747 | var _react = __webpack_require__(4);
|
15748 |
|
15749 | var _react2 = _interopRequireDefault(_react);
|
15750 |
|
15751 | var _reactDom = __webpack_require__(12);
|
15752 |
|
15753 | var _reactDom2 = _interopRequireDefault(_reactDom);
|
15754 |
|
15755 | var _propTypes = __webpack_require__(5);
|
15756 |
|
15757 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
15758 |
|
15759 | var _cssAnimation = __webpack_require__(203);
|
15760 |
|
15761 | var _cssAnimation2 = _interopRequireDefault(_cssAnimation);
|
15762 |
|
15763 | var _animate = __webpack_require__(205);
|
15764 |
|
15765 | var _animate2 = _interopRequireDefault(_animate);
|
15766 |
|
15767 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
15768 |
|
15769 | var transitionMap = {
|
15770 | enter: 'transitionEnter',
|
15771 | appear: 'transitionAppear',
|
15772 | leave: 'transitionLeave'
|
15773 | };
|
15774 |
|
15775 | var AnimateChild = function (_React$Component) {
|
15776 | (0, _inherits3['default'])(AnimateChild, _React$Component);
|
15777 |
|
15778 | function AnimateChild() {
|
15779 | (0, _classCallCheck3['default'])(this, AnimateChild);
|
15780 | return (0, _possibleConstructorReturn3['default'])(this, (AnimateChild.__proto__ || Object.getPrototypeOf(AnimateChild)).apply(this, arguments));
|
15781 | }
|
15782 |
|
15783 | (0, _createClass3['default'])(AnimateChild, [{
|
15784 | key: 'componentWillUnmount',
|
15785 | value: function componentWillUnmount() {
|
15786 | this.stop();
|
15787 | }
|
15788 | }, {
|
15789 | key: 'componentWillEnter',
|
15790 | value: function componentWillEnter(done) {
|
15791 | if (_animate2['default'].isEnterSupported(this.props)) {
|
15792 | this.transition('enter', done);
|
15793 | } else {
|
15794 | done();
|
15795 | }
|
15796 | }
|
15797 | }, {
|
15798 | key: 'componentWillAppear',
|
15799 | value: function componentWillAppear(done) {
|
15800 | if (_animate2['default'].isAppearSupported(this.props)) {
|
15801 | this.transition('appear', done);
|
15802 | } else {
|
15803 | done();
|
15804 | }
|
15805 | }
|
15806 | }, {
|
15807 | key: 'componentWillLeave',
|
15808 | value: function componentWillLeave(done) {
|
15809 | if (_animate2['default'].isLeaveSupported(this.props)) {
|
15810 | this.transition('leave', done);
|
15811 | } else {
|
15812 |
|
15813 |
|
15814 |
|
15815 | done();
|
15816 | }
|
15817 | }
|
15818 | }, {
|
15819 | key: 'transition',
|
15820 | value: function transition(animationType, finishCallback) {
|
15821 | var _this2 = this;
|
15822 |
|
15823 | var node = _reactDom2['default'].findDOMNode(this);
|
15824 | var props = this.props;
|
15825 | var transitionName = props.transitionName;
|
15826 | var nameIsObj = typeof transitionName === 'object';
|
15827 | this.stop();
|
15828 | var end = function end() {
|
15829 | _this2.stopper = null;
|
15830 | finishCallback();
|
15831 | };
|
15832 | if ((_cssAnimation.isCssAnimationSupported || !props.animation[animationType]) && transitionName && props[transitionMap[animationType]]) {
|
15833 | var name = nameIsObj ? transitionName[animationType] : transitionName + '-' + animationType;
|
15834 | var activeName = name + '-active';
|
15835 | if (nameIsObj && transitionName[animationType + 'Active']) {
|
15836 | activeName = transitionName[animationType + 'Active'];
|
15837 | }
|
15838 | this.stopper = (0, _cssAnimation2['default'])(node, {
|
15839 | name: name,
|
15840 | active: activeName
|
15841 | }, end);
|
15842 | } else {
|
15843 | this.stopper = props.animation[animationType](node, end);
|
15844 | }
|
15845 | }
|
15846 | }, {
|
15847 | key: 'stop',
|
15848 | value: function stop() {
|
15849 | var stopper = this.stopper;
|
15850 | if (stopper) {
|
15851 | this.stopper = null;
|
15852 | stopper.stop();
|
15853 | }
|
15854 | }
|
15855 | }, {
|
15856 | key: 'render',
|
15857 | value: function render() {
|
15858 | return this.props.children;
|
15859 | }
|
15860 | }]);
|
15861 | return AnimateChild;
|
15862 | }(_react2['default'].Component);
|
15863 |
|
15864 | AnimateChild.propTypes = {
|
15865 | children: _propTypes2['default'].any
|
15866 | };
|
15867 | exports['default'] = AnimateChild;
|
15868 | module.exports = exports['default'];
|
15869 |
|
15870 | }),
|
15871 |
|
15872 | (function(module, exports, __webpack_require__) {
|
15873 |
|
15874 | 'use strict';
|
15875 |
|
15876 | Object.defineProperty(exports, "__esModule", {
|
15877 | value: true
|
15878 | });
|
15879 | exports.isCssAnimationSupported = undefined;
|
15880 |
|
15881 | var _typeof2 = __webpack_require__(145);
|
15882 |
|
15883 | var _typeof3 = _interopRequireDefault(_typeof2);
|
15884 |
|
15885 | var _Event = __webpack_require__(204);
|
15886 |
|
15887 | var _Event2 = _interopRequireDefault(_Event);
|
15888 |
|
15889 | var _componentClasses = __webpack_require__(47);
|
15890 |
|
15891 | var _componentClasses2 = _interopRequireDefault(_componentClasses);
|
15892 |
|
15893 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
15894 |
|
15895 | var isCssAnimationSupported = _Event2['default'].endEvents.length !== 0;
|
15896 | var capitalPrefixes = ['Webkit', 'Moz', 'O',
|
15897 |
|
15898 | 'ms'];
|
15899 | var prefixes = ['-webkit-', '-moz-', '-o-', 'ms-', ''];
|
15900 |
|
15901 | function getStyleProperty(node, name) {
|
15902 |
|
15903 | var style = window.getComputedStyle(node, null);
|
15904 | var ret = '';
|
15905 | for (var i = 0; i < prefixes.length; i++) {
|
15906 | ret = style.getPropertyValue(prefixes[i] + name);
|
15907 | if (ret) {
|
15908 | break;
|
15909 | }
|
15910 | }
|
15911 | return ret;
|
15912 | }
|
15913 |
|
15914 | function fixBrowserByTimeout(node) {
|
15915 | if (isCssAnimationSupported) {
|
15916 | var transitionDelay = parseFloat(getStyleProperty(node, 'transition-delay')) || 0;
|
15917 | var transitionDuration = parseFloat(getStyleProperty(node, 'transition-duration')) || 0;
|
15918 | var animationDelay = parseFloat(getStyleProperty(node, 'animation-delay')) || 0;
|
15919 | var animationDuration = parseFloat(getStyleProperty(node, 'animation-duration')) || 0;
|
15920 | var time = Math.max(transitionDuration + transitionDelay, animationDuration + animationDelay);
|
15921 |
|
15922 | node.rcEndAnimTimeout = setTimeout(function () {
|
15923 | node.rcEndAnimTimeout = null;
|
15924 | if (node.rcEndListener) {
|
15925 | node.rcEndListener();
|
15926 | }
|
15927 | }, time * 1000 + 200);
|
15928 | }
|
15929 | }
|
15930 |
|
15931 | function clearBrowserBugTimeout(node) {
|
15932 | if (node.rcEndAnimTimeout) {
|
15933 | clearTimeout(node.rcEndAnimTimeout);
|
15934 | node.rcEndAnimTimeout = null;
|
15935 | }
|
15936 | }
|
15937 |
|
15938 | var cssAnimation = function cssAnimation(node, transitionName, endCallback) {
|
15939 | var nameIsObj = (typeof transitionName === 'undefined' ? 'undefined' : (0, _typeof3['default'])(transitionName)) === 'object';
|
15940 | var className = nameIsObj ? transitionName.name : transitionName;
|
15941 | var activeClassName = nameIsObj ? transitionName.active : transitionName + '-active';
|
15942 | var end = endCallback;
|
15943 | var start = void 0;
|
15944 | var active = void 0;
|
15945 | var nodeClasses = (0, _componentClasses2['default'])(node);
|
15946 |
|
15947 | if (endCallback && Object.prototype.toString.call(endCallback) === '[object Object]') {
|
15948 | end = endCallback.end;
|
15949 | start = endCallback.start;
|
15950 | active = endCallback.active;
|
15951 | }
|
15952 |
|
15953 | if (node.rcEndListener) {
|
15954 | node.rcEndListener();
|
15955 | }
|
15956 |
|
15957 | node.rcEndListener = function (e) {
|
15958 | if (e && e.target !== node) {
|
15959 | return;
|
15960 | }
|
15961 |
|
15962 | if (node.rcAnimTimeout) {
|
15963 | clearTimeout(node.rcAnimTimeout);
|
15964 | node.rcAnimTimeout = null;
|
15965 | }
|
15966 |
|
15967 | clearBrowserBugTimeout(node);
|
15968 |
|
15969 | nodeClasses.remove(className);
|
15970 | nodeClasses.remove(activeClassName);
|
15971 |
|
15972 | _Event2['default'].removeEndEventListener(node, node.rcEndListener);
|
15973 | node.rcEndListener = null;
|
15974 |
|
15975 |
|
15976 |
|
15977 | if (end) {
|
15978 | end();
|
15979 | }
|
15980 | };
|
15981 |
|
15982 | _Event2['default'].addEndEventListener(node, node.rcEndListener);
|
15983 |
|
15984 | if (start) {
|
15985 | start();
|
15986 | }
|
15987 | nodeClasses.add(className);
|
15988 |
|
15989 | node.rcAnimTimeout = setTimeout(function () {
|
15990 | node.rcAnimTimeout = null;
|
15991 | nodeClasses.add(activeClassName);
|
15992 | if (active) {
|
15993 | setTimeout(active, 0);
|
15994 | }
|
15995 | fixBrowserByTimeout(node);
|
15996 |
|
15997 | }, 30);
|
15998 |
|
15999 | return {
|
16000 | stop: function stop() {
|
16001 | if (node.rcEndListener) {
|
16002 | node.rcEndListener();
|
16003 | }
|
16004 | }
|
16005 | };
|
16006 | };
|
16007 |
|
16008 | cssAnimation.style = function (node, style, callback) {
|
16009 | if (node.rcEndListener) {
|
16010 | node.rcEndListener();
|
16011 | }
|
16012 |
|
16013 | node.rcEndListener = function (e) {
|
16014 | if (e && e.target !== node) {
|
16015 | return;
|
16016 | }
|
16017 |
|
16018 | if (node.rcAnimTimeout) {
|
16019 | clearTimeout(node.rcAnimTimeout);
|
16020 | node.rcAnimTimeout = null;
|
16021 | }
|
16022 |
|
16023 | clearBrowserBugTimeout(node);
|
16024 |
|
16025 | _Event2['default'].removeEndEventListener(node, node.rcEndListener);
|
16026 | node.rcEndListener = null;
|
16027 |
|
16028 |
|
16029 |
|
16030 | if (callback) {
|
16031 | callback();
|
16032 | }
|
16033 | };
|
16034 |
|
16035 | _Event2['default'].addEndEventListener(node, node.rcEndListener);
|
16036 |
|
16037 | node.rcAnimTimeout = setTimeout(function () {
|
16038 | for (var s in style) {
|
16039 | if (style.hasOwnProperty(s)) {
|
16040 | node.style[s] = style[s];
|
16041 | }
|
16042 | }
|
16043 | node.rcAnimTimeout = null;
|
16044 | fixBrowserByTimeout(node);
|
16045 | }, 0);
|
16046 | };
|
16047 |
|
16048 | cssAnimation.setTransition = function (node, p, value) {
|
16049 | var property = p;
|
16050 | var v = value;
|
16051 | if (value === undefined) {
|
16052 | v = property;
|
16053 | property = '';
|
16054 | }
|
16055 | property = property || '';
|
16056 | capitalPrefixes.forEach(function (prefix) {
|
16057 | node.style[prefix + 'Transition' + property] = v;
|
16058 | });
|
16059 | };
|
16060 |
|
16061 | cssAnimation.isCssAnimationSupported = isCssAnimationSupported;
|
16062 |
|
16063 | exports.isCssAnimationSupported = isCssAnimationSupported;
|
16064 | exports['default'] = cssAnimation;
|
16065 |
|
16066 | }),
|
16067 |
|
16068 | (function(module, exports) {
|
16069 |
|
16070 | 'use strict';
|
16071 |
|
16072 | Object.defineProperty(exports, "__esModule", {
|
16073 | value: true
|
16074 | });
|
16075 | var START_EVENT_NAME_MAP = {
|
16076 | transitionstart: {
|
16077 | transition: 'transitionstart',
|
16078 | WebkitTransition: 'webkitTransitionStart',
|
16079 | MozTransition: 'mozTransitionStart',
|
16080 | OTransition: 'oTransitionStart',
|
16081 | msTransition: 'MSTransitionStart'
|
16082 | },
|
16083 |
|
16084 | animationstart: {
|
16085 | animation: 'animationstart',
|
16086 | WebkitAnimation: 'webkitAnimationStart',
|
16087 | MozAnimation: 'mozAnimationStart',
|
16088 | OAnimation: 'oAnimationStart',
|
16089 | msAnimation: 'MSAnimationStart'
|
16090 | }
|
16091 | };
|
16092 |
|
16093 | var END_EVENT_NAME_MAP = {
|
16094 | transitionend: {
|
16095 | transition: 'transitionend',
|
16096 | WebkitTransition: 'webkitTransitionEnd',
|
16097 | MozTransition: 'mozTransitionEnd',
|
16098 | OTransition: 'oTransitionEnd',
|
16099 | msTransition: 'MSTransitionEnd'
|
16100 | },
|
16101 |
|
16102 | animationend: {
|
16103 | animation: 'animationend',
|
16104 | WebkitAnimation: 'webkitAnimationEnd',
|
16105 | MozAnimation: 'mozAnimationEnd',
|
16106 | OAnimation: 'oAnimationEnd',
|
16107 | msAnimation: 'MSAnimationEnd'
|
16108 | }
|
16109 | };
|
16110 |
|
16111 | var startEvents = [];
|
16112 | var endEvents = [];
|
16113 |
|
16114 | function detectEvents() {
|
16115 | var testEl = document.createElement('div');
|
16116 | var style = testEl.style;
|
16117 |
|
16118 | if (!('AnimationEvent' in window)) {
|
16119 | delete START_EVENT_NAME_MAP.animationstart.animation;
|
16120 | delete END_EVENT_NAME_MAP.animationend.animation;
|
16121 | }
|
16122 |
|
16123 | if (!('TransitionEvent' in window)) {
|
16124 | delete START_EVENT_NAME_MAP.transitionstart.transition;
|
16125 | delete END_EVENT_NAME_MAP.transitionend.transition;
|
16126 | }
|
16127 |
|
16128 | function process(EVENT_NAME_MAP, events) {
|
16129 | for (var baseEventName in EVENT_NAME_MAP) {
|
16130 | if (EVENT_NAME_MAP.hasOwnProperty(baseEventName)) {
|
16131 | var baseEvents = EVENT_NAME_MAP[baseEventName];
|
16132 | for (var styleName in baseEvents) {
|
16133 | if (styleName in style) {
|
16134 | events.push(baseEvents[styleName]);
|
16135 | break;
|
16136 | }
|
16137 | }
|
16138 | }
|
16139 | }
|
16140 | }
|
16141 |
|
16142 | process(START_EVENT_NAME_MAP, startEvents);
|
16143 | process(END_EVENT_NAME_MAP, endEvents);
|
16144 | }
|
16145 |
|
16146 | if (typeof window !== 'undefined' && typeof document !== 'undefined') {
|
16147 | detectEvents();
|
16148 | }
|
16149 |
|
16150 | function addEventListener(node, eventName, eventListener) {
|
16151 | node.addEventListener(eventName, eventListener, false);
|
16152 | }
|
16153 |
|
16154 | function removeEventListener(node, eventName, eventListener) {
|
16155 | node.removeEventListener(eventName, eventListener, false);
|
16156 | }
|
16157 |
|
16158 | var TransitionEvents = {
|
16159 |
|
16160 | startEvents: startEvents,
|
16161 |
|
16162 | addStartEventListener: function addStartEventListener(node, eventListener) {
|
16163 | if (startEvents.length === 0) {
|
16164 | window.setTimeout(eventListener, 0);
|
16165 | return;
|
16166 | }
|
16167 | startEvents.forEach(function (startEvent) {
|
16168 | addEventListener(node, startEvent, eventListener);
|
16169 | });
|
16170 | },
|
16171 | removeStartEventListener: function removeStartEventListener(node, eventListener) {
|
16172 | if (startEvents.length === 0) {
|
16173 | return;
|
16174 | }
|
16175 | startEvents.forEach(function (startEvent) {
|
16176 | removeEventListener(node, startEvent, eventListener);
|
16177 | });
|
16178 | },
|
16179 |
|
16180 |
|
16181 |
|
16182 | endEvents: endEvents,
|
16183 |
|
16184 | addEndEventListener: function addEndEventListener(node, eventListener) {
|
16185 | if (endEvents.length === 0) {
|
16186 | window.setTimeout(eventListener, 0);
|
16187 | return;
|
16188 | }
|
16189 | endEvents.forEach(function (endEvent) {
|
16190 | addEventListener(node, endEvent, eventListener);
|
16191 | });
|
16192 | },
|
16193 | removeEndEventListener: function removeEndEventListener(node, eventListener) {
|
16194 | if (endEvents.length === 0) {
|
16195 | return;
|
16196 | }
|
16197 | endEvents.forEach(function (endEvent) {
|
16198 | removeEventListener(node, endEvent, eventListener);
|
16199 | });
|
16200 | }
|
16201 | };
|
16202 |
|
16203 | exports['default'] = TransitionEvents;
|
16204 | module.exports = exports['default'];
|
16205 |
|
16206 | }),
|
16207 |
|
16208 | (function(module, exports) {
|
16209 |
|
16210 | "use strict";
|
16211 |
|
16212 | Object.defineProperty(exports, "__esModule", {
|
16213 | value: true
|
16214 | });
|
16215 | var util = {
|
16216 | isAppearSupported: function isAppearSupported(props) {
|
16217 | return props.transitionName && props.transitionAppear || props.animation.appear;
|
16218 | },
|
16219 | isEnterSupported: function isEnterSupported(props) {
|
16220 | return props.transitionName && props.transitionEnter || props.animation.enter;
|
16221 | },
|
16222 | isLeaveSupported: function isLeaveSupported(props) {
|
16223 | return props.transitionName && props.transitionLeave || props.animation.leave;
|
16224 | },
|
16225 | allowAppearCallback: function allowAppearCallback(props) {
|
16226 | return props.transitionAppear || props.animation.appear;
|
16227 | },
|
16228 | allowEnterCallback: function allowEnterCallback(props) {
|
16229 | return props.transitionEnter || props.animation.enter;
|
16230 | },
|
16231 | allowLeaveCallback: function allowLeaveCallback(props) {
|
16232 | return props.transitionLeave || props.animation.leave;
|
16233 | }
|
16234 | };
|
16235 | exports["default"] = util;
|
16236 | module.exports = exports['default'];
|
16237 |
|
16238 | }),
|
16239 |
|
16240 | (function(module, exports, __webpack_require__) {
|
16241 |
|
16242 | 'use strict';
|
16243 |
|
16244 | exports.__esModule = true;
|
16245 |
|
16246 | var _classCallCheck2 = __webpack_require__(143);
|
16247 |
|
16248 | var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
16249 |
|
16250 | var _possibleConstructorReturn2 = __webpack_require__(144);
|
16251 |
|
16252 | var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
16253 |
|
16254 | var _inherits2 = __webpack_require__(178);
|
16255 |
|
16256 | var _inherits3 = _interopRequireDefault(_inherits2);
|
16257 |
|
16258 | var _react = __webpack_require__(4);
|
16259 |
|
16260 | var _react2 = _interopRequireDefault(_react);
|
16261 |
|
16262 | var _propTypes = __webpack_require__(5);
|
16263 |
|
16264 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
16265 |
|
16266 | var _LazyRenderBox = __webpack_require__(207);
|
16267 |
|
16268 | var _LazyRenderBox2 = _interopRequireDefault(_LazyRenderBox);
|
16269 |
|
16270 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
16271 |
|
16272 | var PopupInner = function (_Component) {
|
16273 | (0, _inherits3['default'])(PopupInner, _Component);
|
16274 |
|
16275 | function PopupInner() {
|
16276 | (0, _classCallCheck3['default'])(this, PopupInner);
|
16277 | return (0, _possibleConstructorReturn3['default'])(this, _Component.apply(this, arguments));
|
16278 | }
|
16279 |
|
16280 | PopupInner.prototype.render = function render() {
|
16281 | var props = this.props;
|
16282 | var className = props.className;
|
16283 | if (!props.visible) {
|
16284 | className += ' ' + props.hiddenClassName;
|
16285 | }
|
16286 | return _react2['default'].createElement(
|
16287 | 'div',
|
16288 | {
|
16289 | className: className,
|
16290 | onMouseEnter: props.onMouseEnter,
|
16291 | onMouseLeave: props.onMouseLeave,
|
16292 | onMouseDown: props.onMouseDown,
|
16293 | onTouchStart: props.onTouchStart,
|
16294 | style: props.style
|
16295 | },
|
16296 | _react2['default'].createElement(
|
16297 | _LazyRenderBox2['default'],
|
16298 | { className: props.prefixCls + '-content', visible: props.visible },
|
16299 | props.children
|
16300 | )
|
16301 | );
|
16302 | };
|
16303 |
|
16304 | return PopupInner;
|
16305 | }(_react.Component);
|
16306 |
|
16307 | PopupInner.propTypes = {
|
16308 | hiddenClassName: _propTypes2['default'].string,
|
16309 | className: _propTypes2['default'].string,
|
16310 | prefixCls: _propTypes2['default'].string,
|
16311 | onMouseEnter: _propTypes2['default'].func,
|
16312 | onMouseLeave: _propTypes2['default'].func,
|
16313 | onMouseDown: _propTypes2['default'].func,
|
16314 | onTouchStart: _propTypes2['default'].func,
|
16315 | children: _propTypes2['default'].any
|
16316 | };
|
16317 | exports['default'] = PopupInner;
|
16318 | module.exports = exports['default'];
|
16319 |
|
16320 | }),
|
16321 |
|
16322 | (function(module, exports, __webpack_require__) {
|
16323 |
|
16324 | 'use strict';
|
16325 |
|
16326 | exports.__esModule = true;
|
16327 |
|
16328 | var _objectWithoutProperties2 = __webpack_require__(208);
|
16329 |
|
16330 | var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
|
16331 |
|
16332 | var _classCallCheck2 = __webpack_require__(143);
|
16333 |
|
16334 | var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
16335 |
|
16336 | var _possibleConstructorReturn2 = __webpack_require__(144);
|
16337 |
|
16338 | var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
16339 |
|
16340 | var _inherits2 = __webpack_require__(178);
|
16341 |
|
16342 | var _inherits3 = _interopRequireDefault(_inherits2);
|
16343 |
|
16344 | var _react = __webpack_require__(4);
|
16345 |
|
16346 | var _react2 = _interopRequireDefault(_react);
|
16347 |
|
16348 | var _propTypes = __webpack_require__(5);
|
16349 |
|
16350 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
16351 |
|
16352 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
16353 |
|
16354 | var LazyRenderBox = function (_Component) {
|
16355 | (0, _inherits3['default'])(LazyRenderBox, _Component);
|
16356 |
|
16357 | function LazyRenderBox() {
|
16358 | (0, _classCallCheck3['default'])(this, LazyRenderBox);
|
16359 | return (0, _possibleConstructorReturn3['default'])(this, _Component.apply(this, arguments));
|
16360 | }
|
16361 |
|
16362 | LazyRenderBox.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
|
16363 | return nextProps.hiddenClassName || nextProps.visible;
|
16364 | };
|
16365 |
|
16366 | LazyRenderBox.prototype.render = function render() {
|
16367 | var _props = this.props,
|
16368 | hiddenClassName = _props.hiddenClassName,
|
16369 | visible = _props.visible,
|
16370 | props = (0, _objectWithoutProperties3['default'])(_props, ['hiddenClassName', 'visible']);
|
16371 |
|
16372 |
|
16373 | if (hiddenClassName || _react2['default'].Children.count(props.children) > 1) {
|
16374 | if (!visible && hiddenClassName) {
|
16375 | props.className += ' ' + hiddenClassName;
|
16376 | }
|
16377 | return _react2['default'].createElement('div', props);
|
16378 | }
|
16379 |
|
16380 | return _react2['default'].Children.only(props.children);
|
16381 | };
|
16382 |
|
16383 | return LazyRenderBox;
|
16384 | }(_react.Component);
|
16385 |
|
16386 | LazyRenderBox.propTypes = {
|
16387 | children: _propTypes2['default'].any,
|
16388 | className: _propTypes2['default'].string,
|
16389 | visible: _propTypes2['default'].bool,
|
16390 | hiddenClassName: _propTypes2['default'].string
|
16391 | };
|
16392 | exports['default'] = LazyRenderBox;
|
16393 | module.exports = exports['default'];
|
16394 |
|
16395 | }),
|
16396 |
|
16397 | (function(module, exports) {
|
16398 |
|
16399 | "use strict";
|
16400 |
|
16401 | exports.__esModule = true;
|
16402 |
|
16403 | exports.default = function (obj, keys) {
|
16404 | var target = {};
|
16405 |
|
16406 | for (var i in obj) {
|
16407 | if (keys.indexOf(i) >= 0) continue;
|
16408 | if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
|
16409 | target[i] = obj[i];
|
16410 | }
|
16411 |
|
16412 | return target;
|
16413 | };
|
16414 |
|
16415 | }),
|
16416 |
|
16417 | (function(module, exports) {
|
16418 |
|
16419 | 'use strict';
|
16420 |
|
16421 | Object.defineProperty(exports, "__esModule", {
|
16422 | value: true
|
16423 | });
|
16424 | var autoAdjustOverflow = {
|
16425 | adjustX: 1,
|
16426 | adjustY: 1
|
16427 | };
|
16428 |
|
16429 | var placements = exports.placements = {
|
16430 | topLeft: {
|
16431 | points: ['bl', 'tl'],
|
16432 | overflow: autoAdjustOverflow,
|
16433 | offset: [0, -7]
|
16434 | },
|
16435 | bottomLeft: {
|
16436 | points: ['tl', 'bl'],
|
16437 | overflow: autoAdjustOverflow,
|
16438 | offset: [0, 7]
|
16439 | },
|
16440 | leftTop: {
|
16441 | points: ['tr', 'tl'],
|
16442 | overflow: autoAdjustOverflow,
|
16443 | offset: [-4, 0]
|
16444 | },
|
16445 | rightTop: {
|
16446 | points: ['tl', 'tr'],
|
16447 | overflow: autoAdjustOverflow,
|
16448 | offset: [4, 0]
|
16449 | }
|
16450 | };
|
16451 |
|
16452 | exports['default'] = placements;
|
16453 |
|
16454 | }),
|
16455 |
|
16456 | (function(module, exports) {
|
16457 |
|
16458 |
|
16459 |
|
16460 | window.MutationObserver=window.MutationObserver||function(w){function v(a){this.i=[];this.m=a}function I(a){(function c(){var d=a.takeRecords();d.length&&a.m(d,a);a.h=setTimeout(c,v._period)})()}function p(a){var b={type:null,target:null,addedNodes:[],removedNodes:[],previousSibling:null,nextSibling:null,attributeName:null,attributeNamespace:null,oldValue:null},c;for(c in a)b[c]!==w&&a[c]!==w&&(b[c]=a[c]);return b}function J(a,b){var c=C(a,b);return function(d){var f=d.length,n;b.a&&3===a.nodeType&&
|
16461 | a.nodeValue!==c.a&&d.push(new p({type:"characterData",target:a,oldValue:c.a}));b.b&&c.b&&A(d,a,c.b,b.f);if(b.c||b.g)n=K(d,a,c,b);if(n||d.length!==f)c=C(a,b)}}function L(a,b){return b.value}function M(a,b){return"style"!==b.name?b.value:a.style.cssText}function A(a,b,c,d){for(var f={},n=b.attributes,k,g,x=n.length;x--;)k=n[x],g=k.name,d&&d[g]===w||(D(b,k)!==c[g]&&a.push(p({type:"attributes",target:b,attributeName:g,oldValue:c[g],attributeNamespace:k.namespaceURI})),f[g]=!0);for(g in c)f[g]||a.push(p({target:b,
|
16462 | type:"attributes",attributeName:g,oldValue:c[g]}))}function K(a,b,c,d){function f(b,c,f,k,y){var g=b.length-1;y=-~((g-y)/2);for(var h,l,e;e=b.pop();)h=f[e.j],l=k[e.l],d.c&&y&&Math.abs(e.j-e.l)>=g&&(a.push(p({type:"childList",target:c,addedNodes:[h],removedNodes:[h],nextSibling:h.nextSibling,previousSibling:h.previousSibling})),y--),d.b&&l.b&&A(a,h,l.b,d.f),d.a&&3===h.nodeType&&h.nodeValue!==l.a&&a.push(p({type:"characterData",target:h,oldValue:l.a})),d.g&&n(h,l)}function n(b,c){for(var g=b.childNodes,
|
16463 | q=c.c,x=g.length,v=q?q.length:0,h,l,e,m,t,z=0,u=0,r=0;u<x||r<v;)m=g[u],t=(e=q[r])&&e.node,m===t?(d.b&&e.b&&A(a,m,e.b,d.f),d.a&&e.a!==w&&m.nodeValue!==e.a&&a.push(p({type:"characterData",target:m,oldValue:e.a})),l&&f(l,b,g,q,z),d.g&&(m.childNodes.length||e.c&&e.c.length)&&n(m,e),u++,r++):(k=!0,h||(h={},l=[]),m&&(h[e=E(m)]||(h[e]=!0,-1===(e=F(q,m,r,"node"))?d.c&&(a.push(p({type:"childList",target:b,addedNodes:[m],nextSibling:m.nextSibling,previousSibling:m.previousSibling})),z++):l.push({j:u,l:e})),
|
16464 | u++),t&&t!==g[u]&&(h[e=E(t)]||(h[e]=!0,-1===(e=F(g,t,u))?d.c&&(a.push(p({type:"childList",target:c.node,removedNodes:[t],nextSibling:q[r+1],previousSibling:q[r-1]})),z--):l.push({j:e,l:r})),r++));l&&f(l,b,g,q,z)}var k;n(b,c);return k}function C(a,b){var c=!0;return function f(a){var k={node:a};!b.a||3!==a.nodeType&&8!==a.nodeType?(b.b&&c&&1===a.nodeType&&(k.b=G(a.attributes,function(c,f){if(!b.f||b.f[f.name])c[f.name]=D(a,f);return c})),c&&(b.c||b.a||b.b&&b.g)&&(k.c=N(a.childNodes,f)),c=b.g):k.a=
|
16465 | a.nodeValue;return k}(a)}function E(a){try{return a.id||(a.mo_id=a.mo_id||H++)}catch(b){try{return a.nodeValue}catch(c){return H++}}}function N(a,b){for(var c=[],d=0;d<a.length;d++)c[d]=b(a[d],d,a);return c}function G(a,b){for(var c={},d=0;d<a.length;d++)c=b(c,a[d],d,a);return c}function F(a,b,c,d){for(;c<a.length;c++)if((d?a[c][d]:a[c])===b)return c;return-1}v._period=30;v.prototype={observe:function(a,b){for(var c={b:!!(b.attributes||b.attributeFilter||b.attributeOldValue),c:!!b.childList,g:!!b.subtree,
|
16466 | a:!(!b.characterData&&!b.characterDataOldValue)},d=this.i,f=0;f<d.length;f++)d[f].s===a&&d.splice(f,1);b.attributeFilter&&(c.f=G(b.attributeFilter,function(a,b){a[b]=!0;return a}));d.push({s:a,o:J(a,c)});this.h||I(this)},takeRecords:function(){for(var a=[],b=this.i,c=0;c<b.length;c++)b[c].o(a);return a},disconnect:function(){this.i=[];clearTimeout(this.h);this.h=null}};var B=document.createElement("i");B.style.top=0;var D=(B="null"!=B.attributes.style.value)?L:M,H=1;return v}(void 0);
|
16467 |
|
16468 |
|
16469 | }),
|
16470 |
|
16471 | (function(module, exports, __webpack_require__) {
|
16472 |
|
16473 | 'use strict';
|
16474 |
|
16475 | Object.defineProperty(exports, "__esModule", {
|
16476 | value: true
|
16477 | });
|
16478 | exports.MenuItem = undefined;
|
16479 |
|
16480 | 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; };
|
16481 |
|
16482 | var _react = __webpack_require__(4);
|
16483 |
|
16484 | var _react2 = _interopRequireDefault(_react);
|
16485 |
|
16486 | var _reactDom = __webpack_require__(12);
|
16487 |
|
16488 | var _reactDom2 = _interopRequireDefault(_reactDom);
|
16489 |
|
16490 | var _propTypes = __webpack_require__(5);
|
16491 |
|
16492 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
16493 |
|
16494 | var _tinperBeeCore = __webpack_require__(27);
|
16495 |
|
16496 | var _classnames = __webpack_require__(3);
|
16497 |
|
16498 | var _classnames2 = _interopRequireDefault(_classnames);
|
16499 |
|
16500 | var _domScrollIntoView = __webpack_require__(212);
|
16501 |
|
16502 | var _domScrollIntoView2 = _interopRequireDefault(_domScrollIntoView);
|
16503 |
|
16504 | var _miniStore = __webpack_require__(89);
|
16505 |
|
16506 | var _util = __webpack_require__(99);
|
16507 |
|
16508 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
16509 |
|
16510 | 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; }
|
16511 |
|
16512 | 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; }
|
16513 |
|
16514 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
16515 |
|
16516 | 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; }
|
16517 |
|
16518 | 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); }
|
16519 |
|
16520 |
|
16521 |
|
16522 | var MenuItem = exports.MenuItem = function (_React$Component) {
|
16523 | _inherits(MenuItem, _React$Component);
|
16524 |
|
16525 | function MenuItem(props) {
|
16526 | _classCallCheck(this, MenuItem);
|
16527 |
|
16528 | var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
|
16529 |
|
16530 | _this.onKeyDown = function (e) {
|
16531 | var keyCode = e.keyCode;
|
16532 | if (keyCode === _tinperBeeCore.KeyCode.ENTER) {
|
16533 | _this.onClick(e);
|
16534 | return true;
|
16535 | }
|
16536 | };
|
16537 |
|
16538 | _this.onMouseLeave = function (e) {
|
16539 | var _this$props = _this.props,
|
16540 | eventKey = _this$props.eventKey,
|
16541 | onItemHover = _this$props.onItemHover,
|
16542 | onMouseLeave = _this$props.onMouseLeave;
|
16543 |
|
16544 | onItemHover({
|
16545 | key: eventKey,
|
16546 | hover: false
|
16547 | });
|
16548 | onMouseLeave({
|
16549 | key: eventKey,
|
16550 | domEvent: e
|
16551 | });
|
16552 | };
|
16553 |
|
16554 | _this.onMouseEnter = function (e) {
|
16555 | var _this$props2 = _this.props,
|
16556 | eventKey = _this$props2.eventKey,
|
16557 | onItemHover = _this$props2.onItemHover,
|
16558 | onMouseEnter = _this$props2.onMouseEnter;
|
16559 |
|
16560 | onItemHover({
|
16561 | key: eventKey,
|
16562 | hover: true
|
16563 | });
|
16564 | onMouseEnter({
|
16565 | key: eventKey,
|
16566 | domEvent: e
|
16567 | });
|
16568 | };
|
16569 |
|
16570 | _this.onClick = function (e) {
|
16571 | var _this$props3 = _this.props,
|
16572 | eventKey = _this$props3.eventKey,
|
16573 | multiple = _this$props3.multiple,
|
16574 | onClick = _this$props3.onClick,
|
16575 | onSelect = _this$props3.onSelect,
|
16576 | onDeselect = _this$props3.onDeselect,
|
16577 | isSelected = _this$props3.isSelected;
|
16578 |
|
16579 | var info = {
|
16580 | key: eventKey,
|
16581 | keyPath: [eventKey],
|
16582 | item: _this,
|
16583 | domEvent: e
|
16584 | };
|
16585 | onClick(info);
|
16586 | if (multiple) {
|
16587 | if (isSelected) {
|
16588 | onDeselect(info);
|
16589 | } else {
|
16590 | onSelect(info);
|
16591 | }
|
16592 | } else if (!isSelected) {
|
16593 | onSelect(info);
|
16594 | }
|
16595 | };
|
16596 |
|
16597 | return _this;
|
16598 | }
|
16599 |
|
16600 | MenuItem.prototype.componentDidMount = function componentDidMount() {
|
16601 |
|
16602 | this.callRef();
|
16603 | };
|
16604 |
|
16605 | MenuItem.prototype.componentDidUpdate = function componentDidUpdate() {
|
16606 | if (this.props.active) {
|
16607 | (0, _domScrollIntoView2['default'])(_reactDom2['default'].findDOMNode(this), _reactDom2['default'].findDOMNode(this.props.parentMenu), {
|
16608 | onlyScrollIfNeeded: true
|
16609 | });
|
16610 | }
|
16611 | this.callRef();
|
16612 | };
|
16613 |
|
16614 | MenuItem.prototype.componentWillUnmount = function componentWillUnmount() {
|
16615 | var props = this.props;
|
16616 | if (props.onDestroy) {
|
16617 | props.onDestroy(props.eventKey);
|
16618 | }
|
16619 | };
|
16620 |
|
16621 | MenuItem.prototype.getPrefixCls = function getPrefixCls() {
|
16622 | return this.props.rootPrefixCls + '-item';
|
16623 | };
|
16624 |
|
16625 | MenuItem.prototype.getActiveClassName = function getActiveClassName() {
|
16626 | return this.getPrefixCls() + '-active';
|
16627 | };
|
16628 |
|
16629 | MenuItem.prototype.getSelectedClassName = function getSelectedClassName() {
|
16630 | return this.getPrefixCls() + '-selected';
|
16631 | };
|
16632 |
|
16633 | MenuItem.prototype.getDisabledClassName = function getDisabledClassName() {
|
16634 | return this.getPrefixCls() + '-disabled';
|
16635 | };
|
16636 |
|
16637 | MenuItem.prototype.callRef = function callRef() {
|
16638 | if (this.props.manualRef) {
|
16639 | this.props.manualRef(this);
|
16640 | }
|
16641 | };
|
16642 |
|
16643 | MenuItem.prototype.render = function render() {
|
16644 | var _classNames;
|
16645 |
|
16646 | var props = _extends({}, this.props);
|
16647 | var className = (0, _classnames2['default'])(this.getPrefixCls(), props.className, (_classNames = {}, _defineProperty(_classNames, this.getActiveClassName(), !props.disabled && props.active), _defineProperty(_classNames, this.getSelectedClassName(), props.isSelected), _defineProperty(_classNames, this.getDisabledClassName(), props.disabled), _classNames));
|
16648 | var attrs = _extends({}, props.attribute, {
|
16649 | title: props.title,
|
16650 | className: className,
|
16651 |
|
16652 | role: props.role || 'menuitem',
|
16653 | 'aria-disabled': props.disabled
|
16654 | });
|
16655 |
|
16656 | if (props.role === 'option') {
|
16657 |
|
16658 | attrs = _extends({}, attrs, {
|
16659 | role: 'option',
|
16660 | 'aria-selected': props.isSelected
|
16661 | });
|
16662 | } else if (props.role === null || props.role === 'none') {
|
16663 |
|
16664 |
|
16665 |
|
16666 |
|
16667 |
|
16668 | attrs.role = 'none';
|
16669 | }
|
16670 |
|
16671 | var mouseEvent = {
|
16672 | onClick: props.disabled ? null : this.onClick,
|
16673 | onMouseLeave: props.disabled ? null : this.onMouseLeave,
|
16674 | onMouseEnter: props.disabled ? null : this.onMouseEnter
|
16675 | };
|
16676 | var style = _extends({}, props.style);
|
16677 | if (props.mode === 'inline') {
|
16678 | style.paddingLeft = props.inlineIndent * props.level;
|
16679 | }
|
16680 | _util.menuAllProps.forEach(function (key) {
|
16681 | return delete props[key];
|
16682 | });
|
16683 | var icon = this.props.itemIcon;
|
16684 | if (typeof this.props.itemIcon === 'function') {
|
16685 | icon = _react2['default'].createElement(this.props.itemIcon, this.props);
|
16686 | }
|
16687 | return _react2['default'].createElement(
|
16688 | 'li',
|
16689 | _extends({}, props, attrs, mouseEvent, {
|
16690 | style: style
|
16691 | }),
|
16692 | props.children,
|
16693 | icon
|
16694 | );
|
16695 | };
|
16696 |
|
16697 | return MenuItem;
|
16698 | }(_react2['default'].Component);
|
16699 |
|
16700 | MenuItem.propTypes = {
|
16701 | attribute: _propTypes2['default'].object,
|
16702 | rootPrefixCls: _propTypes2['default'].string,
|
16703 | eventKey: _propTypes2['default'].string,
|
16704 | active: _propTypes2['default'].bool,
|
16705 | children: _propTypes2['default'].any,
|
16706 | selectedKeys: _propTypes2['default'].array,
|
16707 | disabled: _propTypes2['default'].bool,
|
16708 | title: _propTypes2['default'].string,
|
16709 | onItemHover: _propTypes2['default'].func,
|
16710 | onSelect: _propTypes2['default'].func,
|
16711 | onClick: _propTypes2['default'].func,
|
16712 | onDeselect: _propTypes2['default'].func,
|
16713 | parentMenu: _propTypes2['default'].object,
|
16714 | onDestroy: _propTypes2['default'].func,
|
16715 | onMouseEnter: _propTypes2['default'].func,
|
16716 | onMouseLeave: _propTypes2['default'].func,
|
16717 | multiple: _propTypes2['default'].bool,
|
16718 | isSelected: _propTypes2['default'].bool,
|
16719 | manualRef: _propTypes2['default'].func,
|
16720 | itemIcon: _propTypes2['default'].oneOfType([_propTypes2['default'].func, _propTypes2['default'].node])
|
16721 | };
|
16722 | MenuItem.defaultProps = {
|
16723 | onSelect: _util.noop,
|
16724 | onMouseEnter: _util.noop,
|
16725 | onMouseLeave: _util.noop,
|
16726 | manualRef: _util.noop
|
16727 | };
|
16728 |
|
16729 |
|
16730 | MenuItem.isMenuItem = true;
|
16731 |
|
16732 | var connected = (0, _miniStore.connect)(function (_ref, _ref2) {
|
16733 | var activeKey = _ref.activeKey,
|
16734 | selectedKeys = _ref.selectedKeys;
|
16735 | var eventKey = _ref2.eventKey,
|
16736 | subMenuKey = _ref2.subMenuKey;
|
16737 | return {
|
16738 | active: activeKey[subMenuKey] === eventKey,
|
16739 | isSelected: selectedKeys.indexOf(eventKey) !== -1
|
16740 | };
|
16741 | })(MenuItem);
|
16742 |
|
16743 | exports['default'] = connected;
|
16744 |
|
16745 | }),
|
16746 |
|
16747 | (function(module, exports, __webpack_require__) {
|
16748 |
|
16749 | 'use strict';
|
16750 |
|
16751 | module.exports = __webpack_require__(213);
|
16752 |
|
16753 | }),
|
16754 |
|
16755 | (function(module, exports, __webpack_require__) {
|
16756 |
|
16757 | 'use strict';
|
16758 |
|
16759 | var util = __webpack_require__(214);
|
16760 |
|
16761 | function scrollIntoView(elem, container, config) {
|
16762 | config = config || {};
|
16763 |
|
16764 | if (container.nodeType === 9) {
|
16765 | container = util.getWindow(container);
|
16766 | }
|
16767 |
|
16768 | var allowHorizontalScroll = config.allowHorizontalScroll;
|
16769 | var onlyScrollIfNeeded = config.onlyScrollIfNeeded;
|
16770 | var alignWithTop = config.alignWithTop;
|
16771 | var alignWithLeft = config.alignWithLeft;
|
16772 | var offsetTop = config.offsetTop || 0;
|
16773 | var offsetLeft = config.offsetLeft || 0;
|
16774 | var offsetBottom = config.offsetBottom || 0;
|
16775 | var offsetRight = config.offsetRight || 0;
|
16776 |
|
16777 | allowHorizontalScroll = allowHorizontalScroll === undefined ? true : allowHorizontalScroll;
|
16778 |
|
16779 | var isWin = util.isWindow(container);
|
16780 | var elemOffset = util.offset(elem);
|
16781 | var eh = util.outerHeight(elem);
|
16782 | var ew = util.outerWidth(elem);
|
16783 | var containerOffset = undefined;
|
16784 | var ch = undefined;
|
16785 | var cw = undefined;
|
16786 | var containerScroll = undefined;
|
16787 | var diffTop = undefined;
|
16788 | var diffBottom = undefined;
|
16789 | var win = undefined;
|
16790 | var winScroll = undefined;
|
16791 | var ww = undefined;
|
16792 | var wh = undefined;
|
16793 |
|
16794 | if (isWin) {
|
16795 | win = container;
|
16796 | wh = util.height(win);
|
16797 | ww = util.width(win);
|
16798 | winScroll = {
|
16799 | left: util.scrollLeft(win),
|
16800 | top: util.scrollTop(win)
|
16801 | };
|
16802 |
|
16803 | diffTop = {
|
16804 | left: elemOffset.left - winScroll.left - offsetLeft,
|
16805 | top: elemOffset.top - winScroll.top - offsetTop
|
16806 | };
|
16807 | diffBottom = {
|
16808 | left: elemOffset.left + ew - (winScroll.left + ww) + offsetRight,
|
16809 | top: elemOffset.top + eh - (winScroll.top + wh) + offsetBottom
|
16810 | };
|
16811 | containerScroll = winScroll;
|
16812 | } else {
|
16813 | containerOffset = util.offset(container);
|
16814 | ch = container.clientHeight;
|
16815 | cw = container.clientWidth;
|
16816 | containerScroll = {
|
16817 | left: container.scrollLeft,
|
16818 | top: container.scrollTop
|
16819 | };
|
16820 |
|
16821 |
|
16822 | diffTop = {
|
16823 | left: elemOffset.left - (containerOffset.left + (parseFloat(util.css(container, 'borderLeftWidth')) || 0)) - offsetLeft,
|
16824 | top: elemOffset.top - (containerOffset.top + (parseFloat(util.css(container, 'borderTopWidth')) || 0)) - offsetTop
|
16825 | };
|
16826 | diffBottom = {
|
16827 | left: elemOffset.left + ew - (containerOffset.left + cw + (parseFloat(util.css(container, 'borderRightWidth')) || 0)) + offsetRight,
|
16828 | top: elemOffset.top + eh - (containerOffset.top + ch + (parseFloat(util.css(container, 'borderBottomWidth')) || 0)) + offsetBottom
|
16829 | };
|
16830 | }
|
16831 |
|
16832 | if (diffTop.top < 0 || diffBottom.top > 0) {
|
16833 |
|
16834 | if (alignWithTop === true) {
|
16835 | util.scrollTop(container, containerScroll.top + diffTop.top);
|
16836 | } else if (alignWithTop === false) {
|
16837 | util.scrollTop(container, containerScroll.top + diffBottom.top);
|
16838 | } else {
|
16839 |
|
16840 | if (diffTop.top < 0) {
|
16841 | util.scrollTop(container, containerScroll.top + diffTop.top);
|
16842 | } else {
|
16843 | util.scrollTop(container, containerScroll.top + diffBottom.top);
|
16844 | }
|
16845 | }
|
16846 | } else {
|
16847 | if (!onlyScrollIfNeeded) {
|
16848 | alignWithTop = alignWithTop === undefined ? true : !!alignWithTop;
|
16849 | if (alignWithTop) {
|
16850 | util.scrollTop(container, containerScroll.top + diffTop.top);
|
16851 | } else {
|
16852 | util.scrollTop(container, containerScroll.top + diffBottom.top);
|
16853 | }
|
16854 | }
|
16855 | }
|
16856 |
|
16857 | if (allowHorizontalScroll) {
|
16858 | if (diffTop.left < 0 || diffBottom.left > 0) {
|
16859 |
|
16860 | if (alignWithLeft === true) {
|
16861 | util.scrollLeft(container, containerScroll.left + diffTop.left);
|
16862 | } else if (alignWithLeft === false) {
|
16863 | util.scrollLeft(container, containerScroll.left + diffBottom.left);
|
16864 | } else {
|
16865 |
|
16866 | if (diffTop.left < 0) {
|
16867 | util.scrollLeft(container, containerScroll.left + diffTop.left);
|
16868 | } else {
|
16869 | util.scrollLeft(container, containerScroll.left + diffBottom.left);
|
16870 | }
|
16871 | }
|
16872 | } else {
|
16873 | if (!onlyScrollIfNeeded) {
|
16874 | alignWithLeft = alignWithLeft === undefined ? true : !!alignWithLeft;
|
16875 | if (alignWithLeft) {
|
16876 | util.scrollLeft(container, containerScroll.left + diffTop.left);
|
16877 | } else {
|
16878 | util.scrollLeft(container, containerScroll.left + diffBottom.left);
|
16879 | }
|
16880 | }
|
16881 | }
|
16882 | }
|
16883 | }
|
16884 |
|
16885 | module.exports = scrollIntoView;
|
16886 |
|
16887 | }),
|
16888 |
|
16889 | (function(module, exports) {
|
16890 |
|
16891 | 'use strict';
|
16892 |
|
16893 | 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; };
|
16894 |
|
16895 | var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
|
16896 |
|
16897 | var RE_NUM = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source;
|
16898 |
|
16899 | function getClientPosition(elem) {
|
16900 | var box = undefined;
|
16901 | var x = undefined;
|
16902 | var y = undefined;
|
16903 | var doc = elem.ownerDocument;
|
16904 | var body = doc.body;
|
16905 | var docElem = doc && doc.documentElement;
|
16906 |
|
16907 | box = elem.getBoundingClientRect();
|
16908 |
|
16909 |
|
16910 |
|
16911 |
|
16912 |
|
16913 | x = box.left;
|
16914 | y = box.top;
|
16915 |
|
16916 |
|
16917 |
|
16918 |
|
16919 |
|
16920 |
|
16921 |
|
16922 |
|
16923 |
|
16924 |
|
16925 |
|
16926 |
|
16927 |
|
16928 |
|
16929 |
|
16930 |
|
16931 |
|
16932 |
|
16933 |
|
16934 |
|
16935 |
|
16936 | x -= docElem.clientLeft || body.clientLeft || 0;
|
16937 | y -= docElem.clientTop || body.clientTop || 0;
|
16938 |
|
16939 | return {
|
16940 | left: x,
|
16941 | top: y
|
16942 | };
|
16943 | }
|
16944 |
|
16945 | function getScroll(w, top) {
|
16946 | var ret = w['page' + (top ? 'Y' : 'X') + 'Offset'];
|
16947 | var method = 'scroll' + (top ? 'Top' : 'Left');
|
16948 | if (typeof ret !== 'number') {
|
16949 | var d = w.document;
|
16950 |
|
16951 | ret = d.documentElement[method];
|
16952 | if (typeof ret !== 'number') {
|
16953 |
|
16954 | ret = d.body[method];
|
16955 | }
|
16956 | }
|
16957 | return ret;
|
16958 | }
|
16959 |
|
16960 | function getScrollLeft(w) {
|
16961 | return getScroll(w);
|
16962 | }
|
16963 |
|
16964 | function getScrollTop(w) {
|
16965 | return getScroll(w, true);
|
16966 | }
|
16967 |
|
16968 | function getOffset(el) {
|
16969 | var pos = getClientPosition(el);
|
16970 | var doc = el.ownerDocument;
|
16971 | var w = doc.defaultView || doc.parentWindow;
|
16972 | pos.left += getScrollLeft(w);
|
16973 | pos.top += getScrollTop(w);
|
16974 | return pos;
|
16975 | }
|
16976 | function _getComputedStyle(elem, name, computedStyle_) {
|
16977 | var val = '';
|
16978 | var d = elem.ownerDocument;
|
16979 | var computedStyle = computedStyle_ || d.defaultView.getComputedStyle(elem, null);
|
16980 |
|
16981 |
|
16982 | if (computedStyle) {
|
16983 | val = computedStyle.getPropertyValue(name) || computedStyle[name];
|
16984 | }
|
16985 |
|
16986 | return val;
|
16987 | }
|
16988 |
|
16989 | var _RE_NUM_NO_PX = new RegExp('^(' + RE_NUM + ')(?!px)[a-z%]+$', 'i');
|
16990 | var RE_POS = /^(top|right|bottom|left)$/;
|
16991 | var CURRENT_STYLE = 'currentStyle';
|
16992 | var RUNTIME_STYLE = 'runtimeStyle';
|
16993 | var LEFT = 'left';
|
16994 | var PX = 'px';
|
16995 |
|
16996 | function _getComputedStyleIE(elem, name) {
|
16997 |
|
16998 |
|
16999 | var ret = elem[CURRENT_STYLE] && elem[CURRENT_STYLE][name];
|
17000 |
|
17001 |
|
17002 |
|
17003 |
|
17004 |
|
17005 |
|
17006 |
|
17007 |
|
17008 |
|
17009 |
|
17010 |
|
17011 | if (_RE_NUM_NO_PX.test(ret) && !RE_POS.test(name)) {
|
17012 |
|
17013 | var style = elem.style;
|
17014 | var left = style[LEFT];
|
17015 | var rsLeft = elem[RUNTIME_STYLE][LEFT];
|
17016 |
|
17017 |
|
17018 | elem[RUNTIME_STYLE][LEFT] = elem[CURRENT_STYLE][LEFT];
|
17019 |
|
17020 |
|
17021 | style[LEFT] = name === 'fontSize' ? '1em' : ret || 0;
|
17022 | ret = style.pixelLeft + PX;
|
17023 |
|
17024 |
|
17025 | style[LEFT] = left;
|
17026 |
|
17027 | elem[RUNTIME_STYLE][LEFT] = rsLeft;
|
17028 | }
|
17029 | return ret === '' ? 'auto' : ret;
|
17030 | }
|
17031 |
|
17032 | var getComputedStyleX = undefined;
|
17033 | if (typeof window !== 'undefined') {
|
17034 | getComputedStyleX = window.getComputedStyle ? _getComputedStyle : _getComputedStyleIE;
|
17035 | }
|
17036 |
|
17037 | function each(arr, fn) {
|
17038 | for (var i = 0; i < arr.length; i++) {
|
17039 | fn(arr[i]);
|
17040 | }
|
17041 | }
|
17042 |
|
17043 | function isBorderBoxFn(elem) {
|
17044 | return getComputedStyleX(elem, 'boxSizing') === 'border-box';
|
17045 | }
|
17046 |
|
17047 | var BOX_MODELS = ['margin', 'border', 'padding'];
|
17048 | var CONTENT_INDEX = -1;
|
17049 | var PADDING_INDEX = 2;
|
17050 | var BORDER_INDEX = 1;
|
17051 | var MARGIN_INDEX = 0;
|
17052 |
|
17053 | function swap(elem, options, callback) {
|
17054 | var old = {};
|
17055 | var style = elem.style;
|
17056 | var name = undefined;
|
17057 |
|
17058 |
|
17059 | for (name in options) {
|
17060 | if (options.hasOwnProperty(name)) {
|
17061 | old[name] = style[name];
|
17062 | style[name] = options[name];
|
17063 | }
|
17064 | }
|
17065 |
|
17066 | callback.call(elem);
|
17067 |
|
17068 |
|
17069 | for (name in options) {
|
17070 | if (options.hasOwnProperty(name)) {
|
17071 | style[name] = old[name];
|
17072 | }
|
17073 | }
|
17074 | }
|
17075 |
|
17076 | function getPBMWidth(elem, props, which) {
|
17077 | var value = 0;
|
17078 | var prop = undefined;
|
17079 | var j = undefined;
|
17080 | var i = undefined;
|
17081 | for (j = 0; j < props.length; j++) {
|
17082 | prop = props[j];
|
17083 | if (prop) {
|
17084 | for (i = 0; i < which.length; i++) {
|
17085 | var cssProp = undefined;
|
17086 | if (prop === 'border') {
|
17087 | cssProp = prop + which[i] + 'Width';
|
17088 | } else {
|
17089 | cssProp = prop + which[i];
|
17090 | }
|
17091 | value += parseFloat(getComputedStyleX(elem, cssProp)) || 0;
|
17092 | }
|
17093 | }
|
17094 | }
|
17095 | return value;
|
17096 | }
|
17097 |
|
17098 | |
17099 |
|
17100 |
|
17101 |
|
17102 | function isWindow(obj) {
|
17103 |
|
17104 |
|
17105 | return obj != null && obj == obj.window;
|
17106 | }
|
17107 |
|
17108 | var domUtils = {};
|
17109 |
|
17110 | each(['Width', 'Height'], function (name) {
|
17111 | domUtils['doc' + name] = function (refWin) {
|
17112 | var d = refWin.document;
|
17113 | return Math.max(
|
17114 |
|
17115 |
|
17116 | d.documentElement['scroll' + name],
|
17117 |
|
17118 | d.body['scroll' + name], domUtils['viewport' + name](d));
|
17119 | };
|
17120 |
|
17121 | domUtils['viewport' + name] = function (win) {
|
17122 |
|
17123 | var prop = 'client' + name;
|
17124 | var doc = win.document;
|
17125 | var body = doc.body;
|
17126 | var documentElement = doc.documentElement;
|
17127 | var documentElementProp = documentElement[prop];
|
17128 |
|
17129 |
|
17130 | return doc.compatMode === 'CSS1Compat' && documentElementProp || body && body[prop] || documentElementProp;
|
17131 | };
|
17132 | });
|
17133 |
|
17134 | |
17135 |
|
17136 |
|
17137 |
|
17138 |
|
17139 |
|
17140 |
|
17141 |
|
17142 | function getWH(elem, name, extra) {
|
17143 | if (isWindow(elem)) {
|
17144 | return name === 'width' ? domUtils.viewportWidth(elem) : domUtils.viewportHeight(elem);
|
17145 | } else if (elem.nodeType === 9) {
|
17146 | return name === 'width' ? domUtils.docWidth(elem) : domUtils.docHeight(elem);
|
17147 | }
|
17148 | var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];
|
17149 | var borderBoxValue = name === 'width' ? elem.offsetWidth : elem.offsetHeight;
|
17150 | var computedStyle = getComputedStyleX(elem);
|
17151 | var isBorderBox = isBorderBoxFn(elem, computedStyle);
|
17152 | var cssBoxValue = 0;
|
17153 | if (borderBoxValue == null || borderBoxValue <= 0) {
|
17154 | borderBoxValue = undefined;
|
17155 |
|
17156 | cssBoxValue = getComputedStyleX(elem, name);
|
17157 | if (cssBoxValue == null || Number(cssBoxValue) < 0) {
|
17158 | cssBoxValue = elem.style[name] || 0;
|
17159 | }
|
17160 |
|
17161 | cssBoxValue = parseFloat(cssBoxValue) || 0;
|
17162 | }
|
17163 | if (extra === undefined) {
|
17164 | extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX;
|
17165 | }
|
17166 | var borderBoxValueOrIsBorderBox = borderBoxValue !== undefined || isBorderBox;
|
17167 | var val = borderBoxValue || cssBoxValue;
|
17168 | if (extra === CONTENT_INDEX) {
|
17169 | if (borderBoxValueOrIsBorderBox) {
|
17170 | return val - getPBMWidth(elem, ['border', 'padding'], which, computedStyle);
|
17171 | }
|
17172 | return cssBoxValue;
|
17173 | }
|
17174 | if (borderBoxValueOrIsBorderBox) {
|
17175 | var padding = extra === PADDING_INDEX ? -getPBMWidth(elem, ['border'], which, computedStyle) : getPBMWidth(elem, ['margin'], which, computedStyle);
|
17176 | return val + (extra === BORDER_INDEX ? 0 : padding);
|
17177 | }
|
17178 | return cssBoxValue + getPBMWidth(elem, BOX_MODELS.slice(extra), which, computedStyle);
|
17179 | }
|
17180 |
|
17181 | var cssShow = {
|
17182 | position: 'absolute',
|
17183 | visibility: 'hidden',
|
17184 | display: 'block'
|
17185 | };
|
17186 |
|
17187 |
|
17188 | function getWHIgnoreDisplay(elem) {
|
17189 | var val = undefined;
|
17190 | var args = arguments;
|
17191 |
|
17192 |
|
17193 | if (elem.offsetWidth !== 0) {
|
17194 | val = getWH.apply(undefined, args);
|
17195 | } else {
|
17196 | swap(elem, cssShow, function () {
|
17197 | val = getWH.apply(undefined, args);
|
17198 | });
|
17199 | }
|
17200 | return val;
|
17201 | }
|
17202 |
|
17203 | function css(el, name, v) {
|
17204 | var value = v;
|
17205 | if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {
|
17206 | for (var i in name) {
|
17207 | if (name.hasOwnProperty(i)) {
|
17208 | css(el, i, name[i]);
|
17209 | }
|
17210 | }
|
17211 | return undefined;
|
17212 | }
|
17213 | if (typeof value !== 'undefined') {
|
17214 | if (typeof value === 'number') {
|
17215 | value += 'px';
|
17216 | }
|
17217 | el.style[name] = value;
|
17218 | return undefined;
|
17219 | }
|
17220 | return getComputedStyleX(el, name);
|
17221 | }
|
17222 |
|
17223 | each(['width', 'height'], function (name) {
|
17224 | var first = name.charAt(0).toUpperCase() + name.slice(1);
|
17225 | domUtils['outer' + first] = function (el, includeMargin) {
|
17226 | return el && getWHIgnoreDisplay(el, name, includeMargin ? MARGIN_INDEX : BORDER_INDEX);
|
17227 | };
|
17228 | var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];
|
17229 |
|
17230 | domUtils[name] = function (elem, val) {
|
17231 | if (val !== undefined) {
|
17232 | if (elem) {
|
17233 | var computedStyle = getComputedStyleX(elem);
|
17234 | var isBorderBox = isBorderBoxFn(elem);
|
17235 | if (isBorderBox) {
|
17236 | val += getPBMWidth(elem, ['padding', 'border'], which, computedStyle);
|
17237 | }
|
17238 | return css(elem, name, val);
|
17239 | }
|
17240 | return undefined;
|
17241 | }
|
17242 | return elem && getWHIgnoreDisplay(elem, name, CONTENT_INDEX);
|
17243 | };
|
17244 | });
|
17245 |
|
17246 |
|
17247 | function setOffset(elem, offset) {
|
17248 |
|
17249 | if (css(elem, 'position') === 'static') {
|
17250 | elem.style.position = 'relative';
|
17251 | }
|
17252 |
|
17253 | var old = getOffset(elem);
|
17254 | var ret = {};
|
17255 | var current = undefined;
|
17256 | var key = undefined;
|
17257 |
|
17258 | for (key in offset) {
|
17259 | if (offset.hasOwnProperty(key)) {
|
17260 | current = parseFloat(css(elem, key)) || 0;
|
17261 | ret[key] = current + offset[key] - old[key];
|
17262 | }
|
17263 | }
|
17264 | css(elem, ret);
|
17265 | }
|
17266 |
|
17267 | module.exports = _extends({
|
17268 | getWindow: function getWindow(node) {
|
17269 | var doc = node.ownerDocument || node;
|
17270 | return doc.defaultView || doc.parentWindow;
|
17271 | },
|
17272 | offset: function offset(el, value) {
|
17273 | if (typeof value !== 'undefined') {
|
17274 | setOffset(el, value);
|
17275 | } else {
|
17276 | return getOffset(el);
|
17277 | }
|
17278 | },
|
17279 |
|
17280 | isWindow: isWindow,
|
17281 | each: each,
|
17282 | css: css,
|
17283 | clone: function clone(obj) {
|
17284 | var ret = {};
|
17285 | for (var i in obj) {
|
17286 | if (obj.hasOwnProperty(i)) {
|
17287 | ret[i] = obj[i];
|
17288 | }
|
17289 | }
|
17290 | var overflow = obj.overflow;
|
17291 | if (overflow) {
|
17292 | for (var i in obj) {
|
17293 | if (obj.hasOwnProperty(i)) {
|
17294 | ret.overflow[i] = obj.overflow[i];
|
17295 | }
|
17296 | }
|
17297 | }
|
17298 | return ret;
|
17299 | },
|
17300 | scrollLeft: function scrollLeft(w, v) {
|
17301 | if (isWindow(w)) {
|
17302 | if (v === undefined) {
|
17303 | return getScrollLeft(w);
|
17304 | }
|
17305 | window.scrollTo(v, getScrollTop(w));
|
17306 | } else {
|
17307 | if (v === undefined) {
|
17308 | return w.scrollLeft;
|
17309 | }
|
17310 | w.scrollLeft = v;
|
17311 | }
|
17312 | },
|
17313 | scrollTop: function scrollTop(w, v) {
|
17314 | if (isWindow(w)) {
|
17315 | if (v === undefined) {
|
17316 | return getScrollTop(w);
|
17317 | }
|
17318 | window.scrollTo(getScrollLeft(w), v);
|
17319 | } else {
|
17320 | if (v === undefined) {
|
17321 | return w.scrollTop;
|
17322 | }
|
17323 | w.scrollTop = v;
|
17324 | }
|
17325 | },
|
17326 |
|
17327 | viewportWidth: 0,
|
17328 | viewportHeight: 0
|
17329 | }, domUtils);
|
17330 |
|
17331 | }),
|
17332 |
|
17333 | (function(module, exports, __webpack_require__) {
|
17334 |
|
17335 | 'use strict';
|
17336 |
|
17337 | Object.defineProperty(exports, "__esModule", {
|
17338 | value: true
|
17339 | });
|
17340 |
|
17341 | 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; };
|
17342 |
|
17343 | var _react = __webpack_require__(4);
|
17344 |
|
17345 | var _react2 = _interopRequireDefault(_react);
|
17346 |
|
17347 | var _propTypes = __webpack_require__(5);
|
17348 |
|
17349 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
17350 |
|
17351 | var _util = __webpack_require__(99);
|
17352 |
|
17353 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
17354 |
|
17355 | 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; }
|
17356 |
|
17357 | 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; }
|
17358 |
|
17359 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
17360 |
|
17361 | 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; }
|
17362 |
|
17363 | 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); }
|
17364 |
|
17365 | var MenuItemGroup = function (_React$Component) {
|
17366 | _inherits(MenuItemGroup, _React$Component);
|
17367 |
|
17368 | function MenuItemGroup() {
|
17369 | var _temp, _this, _ret;
|
17370 |
|
17371 | _classCallCheck(this, MenuItemGroup);
|
17372 |
|
17373 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
17374 | args[_key] = arguments[_key];
|
17375 | }
|
17376 |
|
17377 | return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.renderInnerMenuItem = function (item) {
|
17378 | var _this$props = _this.props,
|
17379 | renderMenuItem = _this$props.renderMenuItem,
|
17380 | index = _this$props.index;
|
17381 |
|
17382 | return renderMenuItem(item, index, _this.props.subMenuKey);
|
17383 | }, _temp), _possibleConstructorReturn(_this, _ret);
|
17384 | }
|
17385 |
|
17386 | MenuItemGroup.prototype.render = function render() {
|
17387 | var props = _objectWithoutProperties(this.props, []);
|
17388 |
|
17389 | var _props$className = props.className,
|
17390 | className = _props$className === undefined ? '' : _props$className,
|
17391 | rootPrefixCls = props.rootPrefixCls;
|
17392 |
|
17393 | var titleClassName = rootPrefixCls + '-item-group-title';
|
17394 | var listClassName = rootPrefixCls + '-item-group-list';
|
17395 | var title = props.title,
|
17396 | children = props.children;
|
17397 |
|
17398 | _util.menuAllProps.forEach(function (key) {
|
17399 | return delete props[key];
|
17400 | });
|
17401 |
|
17402 |
|
17403 | delete props.onClick;
|
17404 |
|
17405 | return _react2['default'].createElement(
|
17406 | 'li',
|
17407 | _extends({}, props, { className: className + ' ' + rootPrefixCls + '-item-group' }),
|
17408 | _react2['default'].createElement(
|
17409 | 'div',
|
17410 | {
|
17411 | className: titleClassName,
|
17412 | title: typeof title === 'string' ? title : undefined
|
17413 | },
|
17414 | title
|
17415 | ),
|
17416 | _react2['default'].createElement(
|
17417 | 'ul',
|
17418 | { className: listClassName },
|
17419 | _react2['default'].Children.map(children, this.renderInnerMenuItem)
|
17420 | )
|
17421 | );
|
17422 | };
|
17423 |
|
17424 | return MenuItemGroup;
|
17425 | }(_react2['default'].Component);
|
17426 |
|
17427 | MenuItemGroup.propTypes = {
|
17428 | renderMenuItem: _propTypes2['default'].func,
|
17429 | index: _propTypes2['default'].number,
|
17430 | className: _propTypes2['default'].string,
|
17431 | subMenuKey: _propTypes2['default'].string,
|
17432 | rootPrefixCls: _propTypes2['default'].string
|
17433 | };
|
17434 | MenuItemGroup.defaultProps = {
|
17435 | disabled: true
|
17436 | };
|
17437 |
|
17438 |
|
17439 | MenuItemGroup.isMenuItemGroup = true;
|
17440 |
|
17441 | exports['default'] = MenuItemGroup;
|
17442 | module.exports = exports['default'];
|
17443 |
|
17444 | }),
|
17445 |
|
17446 | (function(module, exports, __webpack_require__) {
|
17447 |
|
17448 | 'use strict';
|
17449 |
|
17450 | Object.defineProperty(exports, "__esModule", {
|
17451 | value: true
|
17452 | });
|
17453 |
|
17454 | var _react = __webpack_require__(4);
|
17455 |
|
17456 | var _react2 = _interopRequireDefault(_react);
|
17457 |
|
17458 | var _propTypes = __webpack_require__(5);
|
17459 |
|
17460 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
17461 |
|
17462 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
17463 |
|
17464 | 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; }
|
17465 |
|
17466 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
17467 |
|
17468 | 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; }
|
17469 |
|
17470 | 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); }
|
17471 |
|
17472 | var Divider = function (_React$Component) {
|
17473 | _inherits(Divider, _React$Component);
|
17474 |
|
17475 | function Divider() {
|
17476 | _classCallCheck(this, Divider);
|
17477 |
|
17478 | return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
17479 | }
|
17480 |
|
17481 | Divider.prototype.render = function render() {
|
17482 | var _props = this.props,
|
17483 | className = _props.className,
|
17484 | rootPrefixCls = _props.rootPrefixCls,
|
17485 | style = _props.style;
|
17486 |
|
17487 | return _react2['default'].createElement('li', {
|
17488 | className: className + ' ' + rootPrefixCls + '-item-divider',
|
17489 | style: style
|
17490 | });
|
17491 | };
|
17492 |
|
17493 | return Divider;
|
17494 | }(_react2['default'].Component);
|
17495 |
|
17496 | Divider.propTypes = {
|
17497 | className: _propTypes2['default'].string,
|
17498 | rootPrefixCls: _propTypes2['default'].string,
|
17499 | style: _propTypes2['default'].object
|
17500 | };
|
17501 | Divider.defaultProps = {
|
17502 |
|
17503 | disabled: true,
|
17504 | className: '',
|
17505 | style: {}
|
17506 | };
|
17507 | exports['default'] = Divider;
|
17508 | module.exports = exports['default'];
|
17509 |
|
17510 | }),
|
17511 |
|
17512 | (function(module, exports, __webpack_require__) {
|
17513 |
|
17514 | 'use strict';
|
17515 |
|
17516 | Object.defineProperty(exports, "__esModule", {
|
17517 | value: true
|
17518 | });
|
17519 |
|
17520 | var _classnames = __webpack_require__(3);
|
17521 |
|
17522 | var _classnames2 = _interopRequireDefault(_classnames);
|
17523 |
|
17524 | var _react = __webpack_require__(4);
|
17525 |
|
17526 | var _react2 = _interopRequireDefault(_react);
|
17527 |
|
17528 | var _propTypes = __webpack_require__(5);
|
17529 |
|
17530 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
17531 |
|
17532 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
17533 |
|
17534 | 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; }
|
17535 |
|
17536 | 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; }
|
17537 |
|
17538 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
17539 |
|
17540 | 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; }
|
17541 |
|
17542 | 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); }
|
17543 |
|
17544 | var defaultProps = {
|
17545 | clsPrefix: "u-navbar-side-container",
|
17546 | sideActive: false
|
17547 | };
|
17548 |
|
17549 | var NavSideContainer = function (_React$Component) {
|
17550 | _inherits(NavSideContainer, _React$Component);
|
17551 |
|
17552 | function NavSideContainer() {
|
17553 | _classCallCheck(this, NavSideContainer);
|
17554 |
|
17555 | return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
17556 | }
|
17557 |
|
17558 | NavSideContainer.prototype.render = function render() {
|
17559 | var _props = this.props,
|
17560 | className = _props.className,
|
17561 | children = _props.children,
|
17562 | clsPrefix = _props.clsPrefix,
|
17563 | sideActive = _props.sideActive,
|
17564 | expanded = _props.expanded,
|
17565 | props = _objectWithoutProperties(_props, ['className', 'children', 'clsPrefix', 'sideActive', 'expanded']);
|
17566 |
|
17567 |
|
17568 |
|
17569 | return _react2['default'].createElement(
|
17570 | 'div',
|
17571 | { className: (0, _classnames2['default'])(className, clsPrefix, expanded && 'expanded') },
|
17572 | children
|
17573 | );
|
17574 | };
|
17575 |
|
17576 | return NavSideContainer;
|
17577 | }(_react2['default'].Component);
|
17578 |
|
17579 | NavSideContainer.defaultProps = defaultProps;
|
17580 |
|
17581 | exports['default'] = NavSideContainer;
|
17582 | module.exports = exports['default'];
|
17583 |
|
17584 | }),
|
17585 |
|
17586 | (function(module, exports, __webpack_require__) {
|
17587 |
|
17588 | 'use strict';
|
17589 |
|
17590 | Object.defineProperty(exports, "__esModule", {
|
17591 | value: true
|
17592 | });
|
17593 |
|
17594 | 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; };
|
17595 |
|
17596 | var _classnames = __webpack_require__(3);
|
17597 |
|
17598 | var _classnames2 = _interopRequireDefault(_classnames);
|
17599 |
|
17600 | var _react = __webpack_require__(4);
|
17601 |
|
17602 | var _react2 = _interopRequireDefault(_react);
|
17603 |
|
17604 | var _propTypes = __webpack_require__(5);
|
17605 |
|
17606 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
17607 |
|
17608 | var _createChainedFunction = __webpack_require__(37);
|
17609 |
|
17610 | var _createChainedFunction2 = _interopRequireDefault(_createChainedFunction);
|
17611 |
|
17612 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
17613 |
|
17614 | 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; }
|
17615 |
|
17616 | 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; }
|
17617 |
|
17618 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
17619 |
|
17620 | 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; }
|
17621 |
|
17622 | 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); }
|
17623 |
|
17624 | var propTypes = {
|
17625 | onClick: _propTypes2['default'].func,
|
17626 | |
17627 |
|
17628 |
|
17629 | show: _propTypes2['default'].bool,
|
17630 | children: _propTypes2['default'].node
|
17631 | };
|
17632 |
|
17633 | var contextTypes = {
|
17634 | u_navbar: _propTypes2['default'].shape({
|
17635 | expanded: _propTypes2['default'].bool,
|
17636 | onToggle: _propTypes2['default'].func
|
17637 | })
|
17638 | };
|
17639 |
|
17640 | var defaultProps = {
|
17641 | clsPrefix: 'u-navbar-toggle',
|
17642 | show: false
|
17643 | };
|
17644 |
|
17645 | var MenuToggle = function (_React$Component) {
|
17646 | _inherits(MenuToggle, _React$Component);
|
17647 |
|
17648 | function MenuToggle(props) {
|
17649 | _classCallCheck(this, MenuToggle);
|
17650 |
|
17651 | var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
|
17652 |
|
17653 | _this.state = {
|
17654 | toggleState: false
|
17655 |
|
17656 | };return _this;
|
17657 | }
|
17658 |
|
17659 | MenuToggle.prototype.handleClick = function handleClick() {
|
17660 | var _context$u_navbar = this.context.u_navbar,
|
17661 | expanded = _context$u_navbar.expanded,
|
17662 | onToggle = _context$u_navbar.onToggle;
|
17663 |
|
17664 | this.setState({ toggleState: !this.state.toggleState });
|
17665 | if (onToggle) {
|
17666 | onToggle(!expanded);
|
17667 | }
|
17668 | };
|
17669 |
|
17670 | MenuToggle.prototype.render = function render() {
|
17671 | var _props = this.props,
|
17672 | onClick = _props.onClick,
|
17673 | className = _props.className,
|
17674 | children = _props.children,
|
17675 | clsPrefix = _props.clsPrefix,
|
17676 | show = _props.show,
|
17677 | props = _objectWithoutProperties(_props, ['onClick', 'className', 'children', 'clsPrefix', 'show']);
|
17678 |
|
17679 |
|
17680 |
|
17681 | var buttonProps = _extends({
|
17682 | type: 'button'
|
17683 | }, props, {
|
17684 | onClick: (0, _createChainedFunction2['default'])(onClick, this.handleClick.bind(this)),
|
17685 | className: (0, _classnames2['default'])(className, clsPrefix, show && 'show')
|
17686 |
|
17687 | });
|
17688 |
|
17689 | if (children) {
|
17690 | return _react2['default'].createElement(
|
17691 | 'button',
|
17692 | buttonProps,
|
17693 | children
|
17694 | );
|
17695 | }
|
17696 |
|
17697 | return _react2['default'].createElement(
|
17698 | 'div',
|
17699 | null,
|
17700 | show && this.state.toggleState && _react2['default'].createElement(
|
17701 | 'button',
|
17702 | buttonProps,
|
17703 | _react2['default'].createElement(
|
17704 | 'span',
|
17705 | { className: 'sr-only' },
|
17706 | 'Toggle navigation'
|
17707 | ),
|
17708 | _react2['default'].createElement('span', { className: 'icon-bar' }),
|
17709 | _react2['default'].createElement('span', { className: 'icon-bar' }),
|
17710 | _react2['default'].createElement('span', { className: 'icon-bar' })
|
17711 | ),
|
17712 | show && !this.state.toggleState && _react2['default'].createElement(
|
17713 | 'button',
|
17714 | buttonProps,
|
17715 | _react2['default'].createElement('span', { className: 'uf uf-arrow-left' })
|
17716 | ),
|
17717 | !show && !this.state.toggleState && _react2['default'].createElement(
|
17718 | 'button',
|
17719 | buttonProps,
|
17720 | _react2['default'].createElement(
|
17721 | 'span',
|
17722 | { className: 'sr-only' },
|
17723 | 'Toggle navigation'
|
17724 | ),
|
17725 | _react2['default'].createElement('span', { className: 'icon-bar' }),
|
17726 | _react2['default'].createElement('span', { className: 'icon-bar' }),
|
17727 | _react2['default'].createElement('span', { className: 'icon-bar' })
|
17728 | )
|
17729 | );
|
17730 | };
|
17731 |
|
17732 | return MenuToggle;
|
17733 | }(_react2['default'].Component);
|
17734 |
|
17735 | MenuToggle.propTypes = propTypes;
|
17736 | MenuToggle.defaultProps = defaultProps;
|
17737 | MenuToggle.contextTypes = contextTypes;
|
17738 |
|
17739 | exports['default'] = MenuToggle;
|
17740 | module.exports = exports['default'];
|
17741 |
|
17742 | }),
|
17743 |
|
17744 | (function(module, exports, __webpack_require__) {
|
17745 |
|
17746 | 'use strict';
|
17747 |
|
17748 | Object.defineProperty(exports, "__esModule", {
|
17749 | value: true
|
17750 | });
|
17751 |
|
17752 | var _tinperBeeCore = __webpack_require__(27);
|
17753 |
|
17754 | function animate(node, show, done) {
|
17755 | var height = void 0;
|
17756 | return (0, _tinperBeeCore.cssAnimation)(node, 'u-motion-collapse', {
|
17757 | start: function start() {
|
17758 | if (!show) {
|
17759 | node.style.height = node.offsetHeight + 'px';
|
17760 | } else {
|
17761 | height = node.offsetHeight;
|
17762 | node.style.height = 0;
|
17763 | }
|
17764 | },
|
17765 | active: function active() {
|
17766 | node.style.height = (show ? height : 0) + 'px';
|
17767 | },
|
17768 | end: function end() {
|
17769 | node.style.height = '';
|
17770 | done();
|
17771 | }
|
17772 | });
|
17773 | }
|
17774 |
|
17775 | var animation = {
|
17776 | enter: function enter(node, done) {
|
17777 | return animate(node, true, done);
|
17778 | },
|
17779 | leave: function leave(node, done) {
|
17780 | return animate(node, false, done);
|
17781 | },
|
17782 | appear: function appear(node, done) {
|
17783 | return animate(node, true, done);
|
17784 | }
|
17785 | };
|
17786 |
|
17787 | exports['default'] = animation;
|
17788 | module.exports = exports['default'];
|
17789 |
|
17790 | }),
|
17791 |
|
17792 | (function(module, exports, __webpack_require__) {
|
17793 |
|
17794 | 'use strict';
|
17795 |
|
17796 | Object.defineProperty(exports, "__esModule", {
|
17797 | value: true
|
17798 | });
|
17799 |
|
17800 | var _warning = __webpack_require__(32);
|
17801 |
|
17802 | var _warning2 = _interopRequireDefault(_warning);
|
17803 |
|
17804 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
17805 |
|
17806 | var warned = {};
|
17807 |
|
17808 | exports['default'] = function (valid, message) {
|
17809 | if (!valid && !warned[message]) {
|
17810 | (0, _warning2['default'])(false, message);
|
17811 | warned[message] = true;
|
17812 | }
|
17813 | };
|
17814 |
|
17815 | module.exports = exports['default'];
|
17816 |
|
17817 | }),
|
17818 |
|
17819 | (function(module, exports, __webpack_require__) {
|
17820 |
|
17821 | 'use strict';
|
17822 |
|
17823 | Object.defineProperty(exports, "__esModule", {
|
17824 | value: true
|
17825 | });
|
17826 |
|
17827 | var _react = __webpack_require__(4);
|
17828 |
|
17829 | var _react2 = _interopRequireDefault(_react);
|
17830 |
|
17831 | var _src = __webpack_require__(85);
|
17832 |
|
17833 | var _src2 = _interopRequireDefault(_src);
|
17834 |
|
17835 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
17836 |
|
17837 | 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; }
|
17838 |
|
17839 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
17840 |
|
17841 | 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; }
|
17842 |
|
17843 | 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); } |
17844 |
|
17845 |
|
17846 |
|
17847 |
|
17848 | var SubMenu = _src2['default'].SubMenu;
|
17849 | var MenuItemGroup = _src2['default'].ItemGroup;
|
17850 |
|
17851 | var Demo2 = function (_Component) {
|
17852 | _inherits(Demo2, _Component);
|
17853 |
|
17854 | function Demo2(props, context) {
|
17855 | _classCallCheck(this, Demo2);
|
17856 |
|
17857 | var _this = _possibleConstructorReturn(this, _Component.call(this, props, context));
|
17858 |
|
17859 | _this.handleClick = function (e) {
|
17860 |
|
17861 | _this.setState({
|
17862 | current: e.key
|
17863 | });
|
17864 | };
|
17865 |
|
17866 | _this.state = {
|
17867 | current: 1
|
17868 | };
|
17869 | return _this;
|
17870 | }
|
17871 |
|
17872 | Demo2.prototype.render = function render() {
|
17873 | return _react2['default'].createElement(
|
17874 | _src2['default'],
|
17875 | { theme: 'dark', onClick: this.handleClick, style: { width: 240 }, defaultOpenKeys: ['demo3sub1'], selectedKeys: [this.state.current], mode: 'inline' },
|
17876 | _react2['default'].createElement(
|
17877 | SubMenu,
|
17878 | { key: 'demo3sub1', title: _react2['default'].createElement(
|
17879 | 'span',
|
17880 | null,
|
17881 | _react2['default'].createElement(
|
17882 | 'span',
|
17883 | null,
|
17884 | '\u7EC4\u7EC7 1'
|
17885 | )
|
17886 | ) },
|
17887 | _react2['default'].createElement(
|
17888 | MenuItemGroup,
|
17889 | { title: '\u7EC4 1' },
|
17890 | _react2['default'].createElement(
|
17891 | _src2['default'].Item,
|
17892 | { key: '1' },
|
17893 | '\u9009\u9879 1'
|
17894 | ),
|
17895 | _react2['default'].createElement(
|
17896 | _src2['default'].Item,
|
17897 | { key: '2' },
|
17898 | '\u9009\u9879 2'
|
17899 | )
|
17900 | ),
|
17901 | _react2['default'].createElement(
|
17902 | MenuItemGroup,
|
17903 | { title: '\u7EC4 2' },
|
17904 | _react2['default'].createElement(
|
17905 | _src2['default'].Item,
|
17906 | { key: '3' },
|
17907 | '\u9009\u9879 3'
|
17908 | ),
|
17909 | _react2['default'].createElement(
|
17910 | _src2['default'].Item,
|
17911 | { key: '4' },
|
17912 | '\u9009\u9879 4'
|
17913 | )
|
17914 | )
|
17915 | ),
|
17916 | _react2['default'].createElement(
|
17917 | SubMenu,
|
17918 | { key: 'demo3sub2', title: _react2['default'].createElement(
|
17919 | 'span',
|
17920 | null,
|
17921 | _react2['default'].createElement(
|
17922 | 'span',
|
17923 | null,
|
17924 | '\u7EC4\u7EC7 2'
|
17925 | )
|
17926 | ) },
|
17927 | _react2['default'].createElement(
|
17928 | _src2['default'].Item,
|
17929 | { key: '5' },
|
17930 | '\u9009\u9879 5'
|
17931 | ),
|
17932 | _react2['default'].createElement(
|
17933 | _src2['default'].Item,
|
17934 | { key: '6' },
|
17935 | '\u9009\u9879 6'
|
17936 | ),
|
17937 | _react2['default'].createElement(
|
17938 | SubMenu,
|
17939 | { key: 'demo3sub3', title: '\u5B50\u9879' },
|
17940 | _react2['default'].createElement(
|
17941 | _src2['default'].Item,
|
17942 | { key: '7' },
|
17943 | '\u9009\u9879 7'
|
17944 | ),
|
17945 | _react2['default'].createElement(
|
17946 | _src2['default'].Item,
|
17947 | { key: '8' },
|
17948 | '\u9009\u9879 8'
|
17949 | )
|
17950 | )
|
17951 | ),
|
17952 | _react2['default'].createElement(
|
17953 | SubMenu,
|
17954 | { key: 'demo3sub4', title: _react2['default'].createElement(
|
17955 | 'span',
|
17956 | null,
|
17957 | _react2['default'].createElement(
|
17958 | 'span',
|
17959 | null,
|
17960 | '\u7EC4\u7EC7 3'
|
17961 | )
|
17962 | ) },
|
17963 | _react2['default'].createElement(
|
17964 | _src2['default'].Item,
|
17965 | { key: '9' },
|
17966 | '\u9009\u9879 9'
|
17967 | ),
|
17968 | _react2['default'].createElement(
|
17969 | _src2['default'].Item,
|
17970 | { key: '10' },
|
17971 | '\u9009\u9879 10'
|
17972 | ),
|
17973 | _react2['default'].createElement(
|
17974 | _src2['default'].Item,
|
17975 | { key: '11' },
|
17976 | '\u9009\u9879 11'
|
17977 | ),
|
17978 | _react2['default'].createElement(
|
17979 | _src2['default'].Item,
|
17980 | { key: '12' },
|
17981 | '\u9009\u9879 12'
|
17982 | )
|
17983 | )
|
17984 | );
|
17985 | };
|
17986 |
|
17987 | return Demo2;
|
17988 | }(_react.Component);
|
17989 |
|
17990 | exports['default'] = Demo2;
|
17991 | module.exports = exports['default'];
|
17992 |
|
17993 | }),
|
17994 |
|
17995 | (function(module, exports, __webpack_require__) {
|
17996 |
|
17997 | 'use strict';
|
17998 |
|
17999 | Object.defineProperty(exports, "__esModule", {
|
18000 | value: true
|
18001 | });
|
18002 |
|
18003 | var _react = __webpack_require__(4);
|
18004 |
|
18005 | var _react2 = _interopRequireDefault(_react);
|
18006 |
|
18007 | var _src = __webpack_require__(85);
|
18008 |
|
18009 | var _src2 = _interopRequireDefault(_src);
|
18010 |
|
18011 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
18012 |
|
18013 | 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; }
|
18014 |
|
18015 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
18016 |
|
18017 | 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; }
|
18018 |
|
18019 | 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); } |
18020 |
|
18021 |
|
18022 |
|
18023 |
|
18024 | var SubMenu = _src2['default'].SubMenu;
|
18025 |
|
18026 | var Demo3 = function (_Component) {
|
18027 | _inherits(Demo3, _Component);
|
18028 |
|
18029 | function Demo3(props, context) {
|
18030 | _classCallCheck(this, Demo3);
|
18031 |
|
18032 | var _this = _possibleConstructorReturn(this, _Component.call(this, props, context));
|
18033 |
|
18034 | _this.handleClick = function (e) {
|
18035 | console.log('Clicked: ', e);
|
18036 | _this.setState({ current: e.key });
|
18037 | };
|
18038 |
|
18039 | _this.onOpenChange = function (openKeys) {
|
18040 | var state = _this.state;
|
18041 |
|
18042 | var latestOpenKey = _this.myfilter(openKeys, state.openKeys);
|
18043 | var latestCloseKey = _this.myfilter(state.openKeys, openKeys);
|
18044 |
|
18045 | var nextOpenKeys = [];
|
18046 | if (latestOpenKey) {
|
18047 | nextOpenKeys = _this.getAncestorKeys(latestOpenKey).concat(latestOpenKey);
|
18048 | }
|
18049 | if (latestCloseKey) {
|
18050 | nextOpenKeys = _this.getAncestorKeys(latestCloseKey);
|
18051 | }
|
18052 | _this.setState({ openKeys: nextOpenKeys });
|
18053 | };
|
18054 |
|
18055 | _this.myfilter = function (arr1, arr2) {
|
18056 | if (arr2.length === 0 || !arr2) {
|
18057 | return arr1[0];
|
18058 | }
|
18059 |
|
18060 | for (var i = 0; i < arr1.length; i++) {
|
18061 | if (arr2.indexOf(arr1[i].toString()) === -1) {
|
18062 | return arr1[i];
|
18063 | }
|
18064 | }
|
18065 | return false;
|
18066 | };
|
18067 |
|
18068 | _this.getAncestorKeys = function (key) {
|
18069 | var map = {
|
18070 | sub3: ['sub2']
|
18071 | };
|
18072 | return map[key] || [];
|
18073 | };
|
18074 |
|
18075 | _this.state = {
|
18076 | current: '1',
|
18077 | openKeys: []
|
18078 | };
|
18079 | return _this;
|
18080 | }
|
18081 |
|
18082 |
|
18083 |
|
18084 |
|
18085 | Demo3.prototype.render = function render() {
|
18086 | return _react2['default'].createElement(
|
18087 | _src2['default'],
|
18088 | {
|
18089 | mode: 'inline',
|
18090 | openKeys: this.state.openKeys,
|
18091 | selectedKeys: [this.state.current],
|
18092 | style: { width: 240 },
|
18093 | onOpenChange: this.onOpenChange,
|
18094 | onClick: this.handleClick },
|
18095 | _react2['default'].createElement(
|
18096 | SubMenu,
|
18097 | { key: 'sub1', title: _react2['default'].createElement(
|
18098 | 'span',
|
18099 | null,
|
18100 | _react2['default'].createElement(
|
18101 | 'span',
|
18102 | null,
|
18103 | '\u7EC4\u7EC7 1'
|
18104 | )
|
18105 | ) },
|
18106 | _react2['default'].createElement(
|
18107 | _src2['default'].Item,
|
18108 | { key: '1' },
|
18109 | '\u9009\u9879 1'
|
18110 | ),
|
18111 | _react2['default'].createElement(
|
18112 | _src2['default'].Item,
|
18113 | { key: '2' },
|
18114 | '\u9009\u9879 2'
|
18115 | ),
|
18116 | _react2['default'].createElement(
|
18117 | _src2['default'].Item,
|
18118 | { key: '3' },
|
18119 | '\u9009\u9879 3'
|
18120 | ),
|
18121 | _react2['default'].createElement(
|
18122 | _src2['default'].Item,
|
18123 | { key: '4' },
|
18124 | '\u9009\u9879 4'
|
18125 | )
|
18126 | ),
|
18127 | _react2['default'].createElement(
|
18128 | SubMenu,
|
18129 | { key: 'sub2', title: _react2['default'].createElement(
|
18130 | 'span',
|
18131 | null,
|
18132 | _react2['default'].createElement(
|
18133 | 'span',
|
18134 | null,
|
18135 | '\u7EC4\u7EC7 2'
|
18136 | )
|
18137 | ) },
|
18138 | _react2['default'].createElement(
|
18139 | _src2['default'].Item,
|
18140 | { key: '5' },
|
18141 | '\u9009\u9879 5'
|
18142 | ),
|
18143 | _react2['default'].createElement(
|
18144 | _src2['default'].Item,
|
18145 | { key: '6' },
|
18146 | '\u9009\u9879 6'
|
18147 | ),
|
18148 | _react2['default'].createElement(
|
18149 | SubMenu,
|
18150 | { key: 'sub3', title: '\u5B50\u9879' },
|
18151 | _react2['default'].createElement(
|
18152 | _src2['default'].Item,
|
18153 | { key: '7' },
|
18154 | '\u9009\u9879 7'
|
18155 | ),
|
18156 | _react2['default'].createElement(
|
18157 | _src2['default'].Item,
|
18158 | { key: '8' },
|
18159 | '\u9009\u9879 8'
|
18160 | )
|
18161 | )
|
18162 | ),
|
18163 | _react2['default'].createElement(
|
18164 | SubMenu,
|
18165 | { key: 'sub4', title: _react2['default'].createElement(
|
18166 | 'span',
|
18167 | null,
|
18168 | _react2['default'].createElement(
|
18169 | 'span',
|
18170 | null,
|
18171 | '\u7EC4\u7EC7 3'
|
18172 | )
|
18173 | ) },
|
18174 | _react2['default'].createElement(
|
18175 | _src2['default'].Item,
|
18176 | { key: '9' },
|
18177 | '\u9009\u9879 9'
|
18178 | ),
|
18179 | _react2['default'].createElement(
|
18180 | _src2['default'].Item,
|
18181 | { key: '10' },
|
18182 | '\u9009\u9879 10'
|
18183 | ),
|
18184 | _react2['default'].createElement(
|
18185 | _src2['default'].Item,
|
18186 | { key: '11' },
|
18187 | '\u9009\u9879 11'
|
18188 | ),
|
18189 | _react2['default'].createElement(
|
18190 | _src2['default'].Item,
|
18191 | { key: '12' },
|
18192 | '\u9009\u9879 12'
|
18193 | )
|
18194 | )
|
18195 | );
|
18196 | };
|
18197 |
|
18198 | return Demo3;
|
18199 | }(_react.Component);
|
18200 |
|
18201 | exports['default'] = Demo3;
|
18202 | module.exports = exports['default'];
|
18203 |
|
18204 | }),
|
18205 |
|
18206 | (function(module, exports, __webpack_require__) {
|
18207 |
|
18208 | 'use strict';
|
18209 |
|
18210 | Object.defineProperty(exports, "__esModule", {
|
18211 | value: true
|
18212 | });
|
18213 |
|
18214 | var _react = __webpack_require__(4);
|
18215 |
|
18216 | var _react2 = _interopRequireDefault(_react);
|
18217 |
|
18218 | var _src = __webpack_require__(85);
|
18219 |
|
18220 | var _src2 = _interopRequireDefault(_src);
|
18221 |
|
18222 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
18223 |
|
18224 | 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; }
|
18225 |
|
18226 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
18227 |
|
18228 | 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; }
|
18229 |
|
18230 | 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); } |
18231 |
|
18232 |
|
18233 |
|
18234 |
|
18235 | var SubMenu = _src2['default'].SubMenu;
|
18236 | var MenuItemGroup = _src2['default'].ItemGroup;
|
18237 |
|
18238 | var Demo4 = function (_Component) {
|
18239 | _inherits(Demo4, _Component);
|
18240 |
|
18241 | function Demo4() {
|
18242 | var _temp, _this, _ret;
|
18243 |
|
18244 | _classCallCheck(this, Demo4);
|
18245 |
|
18246 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
18247 | args[_key] = arguments[_key];
|
18248 | }
|
18249 |
|
18250 | return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.handleClick = function (e) {
|
18251 | console.log('click', e);
|
18252 | }, _temp), _possibleConstructorReturn(_this, _ret);
|
18253 | }
|
18254 |
|
18255 | Demo4.prototype.render = function render() {
|
18256 | return _react2['default'].createElement(
|
18257 | _src2['default'],
|
18258 | { onClick: this.handleClick, style: { width: 240 }, mode: 'vertical' },
|
18259 | _react2['default'].createElement(
|
18260 | SubMenu,
|
18261 | { key: 'sub1', title: _react2['default'].createElement(
|
18262 | 'span',
|
18263 | null,
|
18264 | _react2['default'].createElement(
|
18265 | 'span',
|
18266 | null,
|
18267 | '\u7EC4\u7EC7 1'
|
18268 | )
|
18269 | ) },
|
18270 | _react2['default'].createElement(
|
18271 | MenuItemGroup,
|
18272 | { title: 'Item 1' },
|
18273 | _react2['default'].createElement(
|
18274 | _src2['default'].Item,
|
18275 | { key: '1' },
|
18276 | '\u9009\u9879 1'
|
18277 | ),
|
18278 | _react2['default'].createElement(
|
18279 | _src2['default'].Item,
|
18280 | { key: '2' },
|
18281 | '\u9009\u9879 2'
|
18282 | )
|
18283 | ),
|
18284 | _react2['default'].createElement(
|
18285 | MenuItemGroup,
|
18286 | { title: 'Iteom 2' },
|
18287 | _react2['default'].createElement(
|
18288 | _src2['default'].Item,
|
18289 | { key: '3' },
|
18290 | '\u9009\u9879 3'
|
18291 | ),
|
18292 | _react2['default'].createElement(
|
18293 | _src2['default'].Item,
|
18294 | { key: '4' },
|
18295 | '\u9009\u9879 4'
|
18296 | )
|
18297 | )
|
18298 | ),
|
18299 | _react2['default'].createElement(
|
18300 | SubMenu,
|
18301 | { key: 'sub2', title: _react2['default'].createElement(
|
18302 | 'span',
|
18303 | null,
|
18304 | _react2['default'].createElement(
|
18305 | 'span',
|
18306 | null,
|
18307 | '\u7EC4\u7EC7 2'
|
18308 | )
|
18309 | ) },
|
18310 | _react2['default'].createElement(
|
18311 | _src2['default'].Item,
|
18312 | { key: '5' },
|
18313 | '\u9009\u9879 5'
|
18314 | ),
|
18315 | _react2['default'].createElement(
|
18316 | _src2['default'].Item,
|
18317 | { key: '6' },
|
18318 | '\u9009\u9879 6'
|
18319 | ),
|
18320 | _react2['default'].createElement(
|
18321 | SubMenu,
|
18322 | { key: 'sub3', title: 'Submenu' },
|
18323 | _react2['default'].createElement(
|
18324 | _src2['default'].Item,
|
18325 | { key: '7' },
|
18326 | '\u9009\u9879 7'
|
18327 | ),
|
18328 | _react2['default'].createElement(
|
18329 | _src2['default'].Item,
|
18330 | { key: '8' },
|
18331 | '\u9009\u9879 8'
|
18332 | )
|
18333 | )
|
18334 | ),
|
18335 | _react2['default'].createElement(
|
18336 | SubMenu,
|
18337 | { key: 'sub4', title: _react2['default'].createElement(
|
18338 | 'span',
|
18339 | null,
|
18340 | _react2['default'].createElement(
|
18341 | 'span',
|
18342 | null,
|
18343 | '\u7EC4\u7EC7 3'
|
18344 | )
|
18345 | ) },
|
18346 | _react2['default'].createElement(
|
18347 | _src2['default'].Item,
|
18348 | { key: '9' },
|
18349 | '\u9009\u9879 9'
|
18350 | ),
|
18351 | _react2['default'].createElement(
|
18352 | _src2['default'].Item,
|
18353 | { key: '10' },
|
18354 | '\u9009\u9879 10'
|
18355 | ),
|
18356 | _react2['default'].createElement(
|
18357 | _src2['default'].Item,
|
18358 | { key: '11' },
|
18359 | '\u9009\u9879 11'
|
18360 | ),
|
18361 | _react2['default'].createElement(
|
18362 | _src2['default'].Item,
|
18363 | { key: '12' },
|
18364 | '\u9009\u9879 12'
|
18365 | )
|
18366 | )
|
18367 | );
|
18368 | };
|
18369 |
|
18370 | return Demo4;
|
18371 | }(_react.Component);
|
18372 |
|
18373 | exports['default'] = Demo4;
|
18374 | module.exports = exports['default'];
|
18375 |
|
18376 | }),
|
18377 |
|
18378 | (function(module, exports, __webpack_require__) {
|
18379 |
|
18380 | 'use strict';
|
18381 |
|
18382 | Object.defineProperty(exports, "__esModule", {
|
18383 | value: true
|
18384 | });
|
18385 |
|
18386 | var _react = __webpack_require__(4);
|
18387 |
|
18388 | var _react2 = _interopRequireDefault(_react);
|
18389 |
|
18390 | var _src = __webpack_require__(85);
|
18391 |
|
18392 | var _src2 = _interopRequireDefault(_src);
|
18393 |
|
18394 | var _beeFormControl = __webpack_require__(225);
|
18395 |
|
18396 | var _beeFormControl2 = _interopRequireDefault(_beeFormControl);
|
18397 |
|
18398 | var _beeBadge = __webpack_require__(229);
|
18399 |
|
18400 | var _beeBadge2 = _interopRequireDefault(_beeBadge);
|
18401 |
|
18402 | var _beeIcon = __webpack_require__(227);
|
18403 |
|
18404 | var _beeIcon2 = _interopRequireDefault(_beeIcon);
|
18405 |
|
18406 | var _beeNavbar = __webpack_require__(231);
|
18407 |
|
18408 | var _beeNavbar2 = _interopRequireDefault(_beeNavbar);
|
18409 |
|
18410 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
18411 |
|
18412 | 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; }
|
18413 |
|
18414 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
18415 |
|
18416 | 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; }
|
18417 |
|
18418 | 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); } |
18419 |
|
18420 |
|
18421 |
|
18422 |
|
18423 |
|
18424 | var SubMenu = _src2['default'].SubMenu;
|
18425 | var MenuItemGroup = _src2['default'].ItemGroup;
|
18426 | var MenuToggle = _src2['default'].MenuToggle;
|
18427 | var SideContainer = _src2['default'].SideContainer;
|
18428 |
|
18429 | var NavItem = _beeNavbar2['default'].NavItem;
|
18430 | var Header = _beeNavbar2['default'].Header;
|
18431 | var Brand = _beeNavbar2['default'].Brand;
|
18432 | var Nav = _beeNavbar2['default'].Nav;
|
18433 |
|
18434 | var Demo5 = function (_Component) {
|
18435 | _inherits(Demo5, _Component);
|
18436 |
|
18437 | function Demo5(props, context) {
|
18438 | _classCallCheck(this, Demo5);
|
18439 |
|
18440 | var _this = _possibleConstructorReturn(this, _Component.call(this, props, context));
|
18441 |
|
18442 | _this.onToggle = function (value) {
|
18443 | _this.setState({ expanded: value });
|
18444 | };
|
18445 |
|
18446 | _this.handleClick = function (e) {
|
18447 | console.log('click ', e);
|
18448 | _this.setState({
|
18449 | current: e.key
|
18450 | });
|
18451 | };
|
18452 |
|
18453 | _this.onChange = function (e) {
|
18454 | _this.setState({ searchValue: e });
|
18455 | };
|
18456 |
|
18457 | _this.state = {
|
18458 | expanded: false,
|
18459 | current: 1,
|
18460 | searchValue: "Search"
|
18461 | };
|
18462 | return _this;
|
18463 | }
|
18464 |
|
18465 | Demo5.prototype.render = function render() {
|
18466 | return _react2['default'].createElement(
|
18467 | 'div',
|
18468 | { id: 'demo5' },
|
18469 | _react2['default'].createElement(
|
18470 | _beeNavbar2['default'],
|
18471 | { expanded: this.state.expanded, onToggle: this.onToggle },
|
18472 | _react2['default'].createElement(MenuToggle, { show: true }),
|
18473 | _react2['default'].createElement(
|
18474 | Header,
|
18475 | null,
|
18476 | _react2['default'].createElement(
|
18477 | Brand,
|
18478 | null,
|
18479 | _react2['default'].createElement(
|
18480 | 'a',
|
18481 | { href: '#' },
|
18482 | _react2['default'].createElement('img', { style: { width: 140 }, src: 'http://design.yyuap.com/logos/logox.png' })
|
18483 | )
|
18484 | )
|
18485 | ),
|
18486 | _react2['default'].createElement(
|
18487 | Nav,
|
18488 | { pullRight: true },
|
18489 | _react2['default'].createElement(
|
18490 | NavItem,
|
18491 | { eventKey: 1 },
|
18492 | _react2['default'].createElement(_beeFormControl2['default'], {
|
18493 | type: 'text',
|
18494 | placeholder: 'Search',
|
18495 | onChange: this.onChange,
|
18496 | value: this.state.searchValue
|
18497 | })
|
18498 | ),
|
18499 | _react2['default'].createElement(
|
18500 | NavItem,
|
18501 | { eventKey: 2 },
|
18502 | _react2['default'].createElement(
|
18503 | _beeBadge2['default'],
|
18504 | { dataBadge: '4', colors: 'warning' },
|
18505 | _react2['default'].createElement(_beeIcon2['default'], {
|
18506 | type: 'uf-bell'
|
18507 | })
|
18508 | )
|
18509 | ),
|
18510 | _react2['default'].createElement(
|
18511 | NavItem,
|
18512 | { eventKey: 3 },
|
18513 | _react2['default'].createElement(_beeIcon2['default'], { type: 'uf-bubble-o' })
|
18514 | ),
|
18515 | _react2['default'].createElement(
|
18516 | _src2['default'],
|
18517 | { mode: 'horizontal', className: 'dropdown' },
|
18518 | _react2['default'].createElement(
|
18519 | SubMenu,
|
18520 | { title: _react2['default'].createElement(
|
18521 | 'span',
|
18522 | null,
|
18523 | '\u5218\u8BA4\u534E',
|
18524 | _react2['default'].createElement(_beeIcon2['default'], { type: 'uf-triangle-down' })
|
18525 | ) },
|
18526 | _react2['default'].createElement(
|
18527 | _src2['default'].Item,
|
18528 | { key: 'setting:1' },
|
18529 | '\u9009\u9879 1'
|
18530 | ),
|
18531 | _react2['default'].createElement(
|
18532 | _src2['default'].Item,
|
18533 | { key: 'setting:2' },
|
18534 | '\u9009\u9879 2'
|
18535 | ),
|
18536 | _react2['default'].createElement(
|
18537 | _src2['default'].Item,
|
18538 | { key: 'setting:3' },
|
18539 | '\u9009\u9879 3'
|
18540 | ),
|
18541 | _react2['default'].createElement(
|
18542 | _src2['default'].Item,
|
18543 | { key: 'setting:4' },
|
18544 | '\u9009\u9879 4'
|
18545 | )
|
18546 | )
|
18547 | )
|
18548 | )
|
18549 | ),
|
18550 | _react2['default'].createElement(
|
18551 | SideContainer,
|
18552 | {
|
18553 | onToggle: this.onToggle,
|
18554 | expanded: this.state.expanded },
|
18555 | _react2['default'].createElement(
|
18556 | _src2['default'],
|
18557 | { onClick: this.handleClick,
|
18558 | style: { width: 240 },
|
18559 | defaultOpenKeys: ['demo3sub1'],
|
18560 | selectedKeys: [this.state.current],
|
18561 | mode: 'inline'
|
18562 | },
|
18563 | _react2['default'].createElement(
|
18564 | SubMenu,
|
18565 | { key: 'demo3sub1', title: _react2['default'].createElement(
|
18566 | 'span',
|
18567 | null,
|
18568 | _react2['default'].createElement(
|
18569 | 'span',
|
18570 | null,
|
18571 | '\u7EC4\u7EC7 1'
|
18572 | )
|
18573 | ) },
|
18574 | _react2['default'].createElement(
|
18575 | MenuItemGroup,
|
18576 | { title: '\u7EC4 1' },
|
18577 | _react2['default'].createElement(
|
18578 | _src2['default'].Item,
|
18579 | { key: '1' },
|
18580 | '\u9009\u9879 1'
|
18581 | ),
|
18582 | _react2['default'].createElement(
|
18583 | _src2['default'].Item,
|
18584 | { key: '2' },
|
18585 | '\u9009\u9879 2'
|
18586 | )
|
18587 | ),
|
18588 | _react2['default'].createElement(
|
18589 | MenuItemGroup,
|
18590 | { title: '\u7EC4 2' },
|
18591 | _react2['default'].createElement(
|
18592 | _src2['default'].Item,
|
18593 | { key: '3' },
|
18594 | '\u9009\u9879 3'
|
18595 | ),
|
18596 | _react2['default'].createElement(
|
18597 | _src2['default'].Item,
|
18598 | { key: '4' },
|
18599 | '\u9009\u9879 4'
|
18600 | )
|
18601 | )
|
18602 | ),
|
18603 | _react2['default'].createElement(
|
18604 | SubMenu,
|
18605 | { key: 'demo3sub2', title: _react2['default'].createElement(
|
18606 | 'span',
|
18607 | null,
|
18608 | _react2['default'].createElement(
|
18609 | 'span',
|
18610 | null,
|
18611 | '\u7EC4\u7EC7 2'
|
18612 | )
|
18613 | ) },
|
18614 | _react2['default'].createElement(
|
18615 | _src2['default'].Item,
|
18616 | { key: '5' },
|
18617 | '\u9009\u9879 5'
|
18618 | ),
|
18619 | _react2['default'].createElement(
|
18620 | _src2['default'].Item,
|
18621 | { key: '6' },
|
18622 | '\u9009\u9879 6'
|
18623 | ),
|
18624 | _react2['default'].createElement(
|
18625 | SubMenu,
|
18626 | { key: 'demo3sub3', title: '\u5B50\u9879' },
|
18627 | _react2['default'].createElement(
|
18628 | _src2['default'].Item,
|
18629 | { key: '7' },
|
18630 | '\u9009\u9879 7'
|
18631 | ),
|
18632 | _react2['default'].createElement(
|
18633 | _src2['default'].Item,
|
18634 | { key: '8' },
|
18635 | '\u9009\u9879 8'
|
18636 | )
|
18637 | )
|
18638 | ),
|
18639 | _react2['default'].createElement(
|
18640 | SubMenu,
|
18641 | { key: 'demo3sub4', title: _react2['default'].createElement(
|
18642 | 'span',
|
18643 | null,
|
18644 | _react2['default'].createElement(
|
18645 | 'span',
|
18646 | null,
|
18647 | '\u7EC4\u7EC7 3'
|
18648 | )
|
18649 | ) },
|
18650 | _react2['default'].createElement(
|
18651 | _src2['default'].Item,
|
18652 | { key: '9' },
|
18653 | '\u9009\u9879 9'
|
18654 | ),
|
18655 | _react2['default'].createElement(
|
18656 | _src2['default'].Item,
|
18657 | { key: '10' },
|
18658 | '\u9009\u9879 10'
|
18659 | ),
|
18660 | _react2['default'].createElement(
|
18661 | _src2['default'].Item,
|
18662 | { key: '11' },
|
18663 | '\u9009\u9879 11'
|
18664 | ),
|
18665 | _react2['default'].createElement(
|
18666 | _src2['default'].Item,
|
18667 | { key: '12' },
|
18668 | '\u9009\u9879 12'
|
18669 | )
|
18670 | )
|
18671 | )
|
18672 | )
|
18673 | );
|
18674 | };
|
18675 |
|
18676 | return Demo5;
|
18677 | }(_react.Component);
|
18678 |
|
18679 | exports['default'] = Demo5;
|
18680 | module.exports = exports['default'];
|
18681 |
|
18682 | }),
|
18683 |
|
18684 | (function(module, exports, __webpack_require__) {
|
18685 |
|
18686 | 'use strict';
|
18687 |
|
18688 | Object.defineProperty(exports, "__esModule", {
|
18689 | value: true
|
18690 | });
|
18691 |
|
18692 | var _FormControl = __webpack_require__(226);
|
18693 |
|
18694 | var _FormControl2 = _interopRequireDefault(_FormControl);
|
18695 |
|
18696 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
18697 |
|
18698 | exports["default"] = _FormControl2["default"];
|
18699 | module.exports = exports['default'];
|
18700 |
|
18701 | }),
|
18702 |
|
18703 | (function(module, exports, __webpack_require__) {
|
18704 |
|
18705 | 'use strict';
|
18706 |
|
18707 | Object.defineProperty(exports, "__esModule", {
|
18708 | value: true
|
18709 | });
|
18710 |
|
18711 | 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; };
|
18712 |
|
18713 | var _react = __webpack_require__(4);
|
18714 |
|
18715 | var _react2 = _interopRequireDefault(_react);
|
18716 |
|
18717 | var _classnames = __webpack_require__(3);
|
18718 |
|
18719 | var _classnames2 = _interopRequireDefault(_classnames);
|
18720 |
|
18721 | var _beeIcon = __webpack_require__(227);
|
18722 |
|
18723 | var _beeIcon2 = _interopRequireDefault(_beeIcon);
|
18724 |
|
18725 | var _propTypes = __webpack_require__(5);
|
18726 |
|
18727 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
18728 |
|
18729 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
18730 |
|
18731 | 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; }
|
18732 |
|
18733 | 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; }
|
18734 |
|
18735 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
18736 |
|
18737 | 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; }
|
18738 |
|
18739 | 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); }
|
18740 |
|
18741 | var propTypes = {
|
18742 | componentClass: _propTypes2["default"].oneOfType([_propTypes2["default"].element, _propTypes2["default"].string]),
|
18743 | type: _propTypes2["default"].string,
|
18744 | size: _propTypes2["default"].oneOf(['sm', 'md', 'lg']),
|
18745 | onSearch: _propTypes2["default"].func,
|
18746 | onChange: _propTypes2["default"].func,
|
18747 | onBlur: _propTypes2["default"].func,
|
18748 | showClose: _propTypes2["default"].bool,
|
18749 | focusSelect: _propTypes2["default"].bool
|
18750 | };
|
18751 |
|
18752 | var defaultProps = {
|
18753 | componentClass: 'input',
|
18754 | clsPrefix: 'u-form-control',
|
18755 | type: 'text',
|
18756 | size: 'md'
|
18757 | };
|
18758 |
|
18759 | var FormControl = function (_React$Component) {
|
18760 | _inherits(FormControl, _React$Component);
|
18761 |
|
18762 | function FormControl(props) {
|
18763 | _classCallCheck(this, FormControl);
|
18764 |
|
18765 | var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
|
18766 |
|
18767 | _this.handleSearchChange = function (e) {
|
18768 | var onChange = _this.props.onChange;
|
18769 |
|
18770 | var value = _this.input.value;
|
18771 | _this.setState({
|
18772 | value: value,
|
18773 | showSearch: value == null || value === ""
|
18774 | });
|
18775 | if (onChange) {
|
18776 | onChange(value, e);
|
18777 | }
|
18778 | };
|
18779 |
|
18780 | _this.handleChange = function (e) {
|
18781 | var onChange = _this.props.onChange;
|
18782 |
|
18783 | var value = _this.input.value;
|
18784 | _this.setState({
|
18785 | showClose: true
|
18786 | });
|
18787 | if (onChange) {
|
18788 | onChange(value, e);
|
18789 | }
|
18790 | };
|
18791 |
|
18792 | _this.clearValue = function () {
|
18793 | var onChange = _this.props.onChange;
|
18794 |
|
18795 | _this.setState({
|
18796 | showSearch: true,
|
18797 | value: "",
|
18798 | showClose: false
|
18799 | });
|
18800 | if (onChange) {
|
18801 | onChange("");
|
18802 | }
|
18803 | _this.input.focus();
|
18804 | };
|
18805 |
|
18806 | _this.handleKeyDown = function (e) {
|
18807 | var _this$props = _this.props,
|
18808 | onSearch = _this$props.onSearch,
|
18809 | type = _this$props.type;
|
18810 |
|
18811 | if (e.keyCode === 13 && type === "search") {
|
18812 | if (onSearch) {
|
18813 | onSearch(_this.input.value);
|
18814 | }
|
18815 | }
|
18816 | };
|
18817 |
|
18818 | _this.handleSearch = function (e) {
|
18819 | var onSearch = _this.props.onSearch;
|
18820 |
|
18821 | if (onSearch) onSearch(_this.input.value);
|
18822 | };
|
18823 |
|
18824 | _this.handleBlur = function (e) {
|
18825 | var value = _this.state.value;
|
18826 | var onBlur = _this.props.onBlur;
|
18827 |
|
18828 |
|
18829 | if (onBlur) {
|
18830 | onBlur(value, e);
|
18831 | }
|
18832 | };
|
18833 |
|
18834 | _this.handleFocus = function (e) {
|
18835 | var value = _this.state.value;
|
18836 | var onFocus = _this.props.onFocus;
|
18837 |
|
18838 | if (_this.props.focusSelect) {
|
18839 | _this.input.select();
|
18840 | }
|
18841 | if (onFocus) {
|
18842 | onFocus(value, e);
|
18843 | }
|
18844 | };
|
18845 |
|
18846 | _this.renderInput = function () {
|
18847 | var _this$props2 = _this.props,
|
18848 | Component = _this$props2.componentClass,
|
18849 | type = _this$props2.type,
|
18850 | className = _this$props2.className,
|
18851 | size = _this$props2.size,
|
18852 | clsPrefix = _this$props2.clsPrefix,
|
18853 | value = _this$props2.value,
|
18854 | onChange = _this$props2.onChange,
|
18855 | onSearch = _this$props2.onSearch,
|
18856 | onBlur = _this$props2.onBlur,
|
18857 | showClose = _this$props2.showClose,
|
18858 | focusSelect = _this$props2.focusSelect,
|
18859 | others = _objectWithoutProperties(_this$props2, ['componentClass', 'type', 'className', 'size', 'clsPrefix', 'value', 'onChange', 'onSearch', 'onBlur', 'showClose', 'focusSelect']);
|
18860 |
|
18861 |
|
18862 |
|
18863 | var classes = {};
|
18864 | if (size) {
|
18865 | classes['' + size] = true;
|
18866 | }
|
18867 |
|
18868 | var classNames = void 0;
|
18869 | if (type !== 'file') {
|
18870 | classNames = (0, _classnames2["default"])(clsPrefix, classes);
|
18871 | }
|
18872 |
|
18873 | return showClose ? _react2["default"].createElement(
|
18874 | 'div',
|
18875 | { className: (0, _classnames2["default"])(clsPrefix + '-close', clsPrefix + '-affix-wrapper', className) },
|
18876 | _react2["default"].createElement(Component, _extends({}, others, {
|
18877 | type: type,
|
18878 | ref: function ref(el) {
|
18879 | return _this.input = el;
|
18880 | },
|
18881 | value: value,
|
18882 | onChange: _this.handleChange,
|
18883 | onBlur: _this.handleBlur,
|
18884 | onFocus: _this.handleFocus,
|
18885 | className: (0, _classnames2["default"])(className, classNames)
|
18886 | })),
|
18887 | _react2["default"].createElement(
|
18888 | 'div',
|
18889 | { className: clsPrefix + '-suffix' },
|
18890 | _this.state.showClose ? _react2["default"].createElement(_beeIcon2["default"], { onClick: _this.clearValue, type: 'uf-close-c' }) : ''
|
18891 | )
|
18892 | ) : _react2["default"].createElement(Component, _extends({}, others, {
|
18893 | type: type,
|
18894 | ref: function ref(el) {
|
18895 | return _this.input = el;
|
18896 | },
|
18897 | value: value,
|
18898 | onChange: _this.handleChange,
|
18899 | onBlur: _this.handleBlur,
|
18900 | onFocus: _this.handleFocus,
|
18901 | className: (0, _classnames2["default"])(className, classNames)
|
18902 | }));
|
18903 | };
|
18904 |
|
18905 | _this.renderSearch = function () {
|
18906 | var _this$props3 = _this.props,
|
18907 | Component = _this$props3.componentClass,
|
18908 | type = _this$props3.type,
|
18909 | className = _this$props3.className,
|
18910 | size = _this$props3.size,
|
18911 | clsPrefix = _this$props3.clsPrefix,
|
18912 | value = _this$props3.value,
|
18913 | onChange = _this$props3.onChange,
|
18914 | onSearch = _this$props3.onSearch,
|
18915 | onBlur = _this$props3.onBlur,
|
18916 | others = _objectWithoutProperties(_this$props3, ['componentClass', 'type', 'className', 'size', 'clsPrefix', 'value', 'onChange', 'onSearch', 'onBlur']);
|
18917 |
|
18918 |
|
18919 |
|
18920 | var classes = {};
|
18921 | if (size) {
|
18922 | classes['' + size] = true;
|
18923 | }
|
18924 | classes[clsPrefix + '-search'] = true;
|
18925 |
|
18926 | if (type === "search") {
|
18927 | return _react2["default"].createElement(
|
18928 | 'div',
|
18929 | { className: (0, _classnames2["default"])(clsPrefix + '-search', clsPrefix + '-affix-wrapper', className) },
|
18930 | _react2["default"].createElement(Component, _extends({}, others, {
|
18931 | type: type,
|
18932 | ref: function ref(el) {
|
18933 | return _this.input = el;
|
18934 | },
|
18935 | onChange: _this.handleSearchChange,
|
18936 | value: value,
|
18937 | onKeyDown: _this.handleKeyDown,
|
18938 | onBlur: _this.handleBlur,
|
18939 | onFocus: _this.handleFocus,
|
18940 | className: (0, _classnames2["default"])(className, clsPrefix, classes)
|
18941 | })),
|
18942 | _react2["default"].createElement(
|
18943 | 'div',
|
18944 | { className: clsPrefix + '-suffix' },
|
18945 | _react2["default"].createElement(_beeIcon2["default"], { type: 'uf-search', onClick: _this.handleSearch })
|
18946 | )
|
18947 | );
|
18948 | }
|
18949 | };
|
18950 |
|
18951 | _this.state = {
|
18952 | showSearch: !props.value,
|
18953 | value: props.value == null ? "" : props.value,
|
18954 | showClose: false
|
18955 | };
|
18956 | _this.input = {};
|
18957 | return _this;
|
18958 | }
|
18959 |
|
18960 | FormControl.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProp) {
|
18961 | if (nextProp.value !== this.state.value) {
|
18962 | this.setState({ value: nextProp.value });
|
18963 | }
|
18964 | };
|
18965 |
|
18966 | FormControl.prototype.render = function render() {
|
18967 |
|
18968 | if (this.props.type === "search") {
|
18969 | return this.renderSearch();
|
18970 | }
|
18971 |
|
18972 | return this.renderInput();
|
18973 | };
|
18974 |
|
18975 | return FormControl;
|
18976 | }(_react2["default"].Component);
|
18977 |
|
18978 | FormControl.propTypes = propTypes;
|
18979 | FormControl.defaultProps = defaultProps;
|
18980 |
|
18981 | exports["default"] = FormControl;
|
18982 | module.exports = exports['default'];
|
18983 |
|
18984 | }),
|
18985 |
|
18986 | (function(module, exports, __webpack_require__) {
|
18987 |
|
18988 | 'use strict';
|
18989 |
|
18990 | Object.defineProperty(exports, "__esModule", {
|
18991 | value: true
|
18992 | });
|
18993 |
|
18994 | var _Icon = __webpack_require__(228);
|
18995 |
|
18996 | var _Icon2 = _interopRequireDefault(_Icon);
|
18997 |
|
18998 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
18999 |
|
19000 | exports["default"] = _Icon2["default"];
|
19001 | module.exports = exports['default'];
|
19002 |
|
19003 | }),
|
19004 |
|
19005 | (function(module, exports, __webpack_require__) {
|
19006 |
|
19007 | 'use strict';
|
19008 |
|
19009 | Object.defineProperty(exports, "__esModule", {
|
19010 | value: true
|
19011 | });
|
19012 |
|
19013 | 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; };
|
19014 |
|
19015 | var _react = __webpack_require__(4);
|
19016 |
|
19017 | var _react2 = _interopRequireDefault(_react);
|
19018 |
|
19019 | var _classnames = __webpack_require__(3);
|
19020 |
|
19021 | var _classnames2 = _interopRequireDefault(_classnames);
|
19022 |
|
19023 | var _propTypes = __webpack_require__(5);
|
19024 |
|
19025 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
19026 |
|
19027 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
19028 |
|
19029 | 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; }
|
19030 |
|
19031 | 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; }
|
19032 |
|
19033 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
19034 |
|
19035 | 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; }
|
19036 |
|
19037 | 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); }
|
19038 |
|
19039 | var propTypes = {
|
19040 | type: _propTypes2["default"].string
|
19041 |
|
19042 | };
|
19043 | |
19044 |
|
19045 |
|
19046 | var defaultProps = {
|
19047 | clsPrefix: 'uf'
|
19048 | };
|
19049 |
|
19050 | var Icon = function (_Component) {
|
19051 | _inherits(Icon, _Component);
|
19052 |
|
19053 | function Icon(props) {
|
19054 | _classCallCheck(this, Icon);
|
19055 |
|
19056 | return _possibleConstructorReturn(this, _Component.call(this, props));
|
19057 | }
|
19058 |
|
19059 | Icon.prototype.render = function render() {
|
19060 | var _props = this.props,
|
19061 | type = _props.type,
|
19062 | className = _props.className,
|
19063 | clsPrefix = _props.clsPrefix,
|
19064 | others = _objectWithoutProperties(_props, ['type', 'className', 'clsPrefix']);
|
19065 |
|
19066 | var clsObj = {};
|
19067 |
|
19068 | var classNames = (0, _classnames2["default"])(clsPrefix, type);
|
19069 |
|
19070 | return _react2["default"].createElement('i', _extends({}, others, { className: (0, _classnames2["default"])(classNames, className) }));
|
19071 | };
|
19072 |
|
19073 | return Icon;
|
19074 | }(_react.Component);
|
19075 |
|
19076 | Icon.defaultProps = defaultProps;
|
19077 | Icon.propTypes = propTypes;
|
19078 |
|
19079 | exports["default"] = Icon;
|
19080 | module.exports = exports['default'];
|
19081 |
|
19082 | }),
|
19083 |
|
19084 | (function(module, exports, __webpack_require__) {
|
19085 |
|
19086 | 'use strict';
|
19087 |
|
19088 | Object.defineProperty(exports, "__esModule", {
|
19089 | value: true
|
19090 | });
|
19091 |
|
19092 | var _Badge = __webpack_require__(230);
|
19093 |
|
19094 | var _Badge2 = _interopRequireDefault(_Badge);
|
19095 |
|
19096 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
19097 |
|
19098 | exports["default"] = _Badge2["default"];
|
19099 | module.exports = exports['default'];
|
19100 |
|
19101 | }),
|
19102 |
|
19103 | (function(module, exports, __webpack_require__) {
|
19104 |
|
19105 | 'use strict';
|
19106 |
|
19107 | Object.defineProperty(exports, "__esModule", {
|
19108 | value: true
|
19109 | });
|
19110 |
|
19111 | 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; };
|
19112 |
|
19113 | var _react = __webpack_require__(4);
|
19114 |
|
19115 | var _react2 = _interopRequireDefault(_react);
|
19116 |
|
19117 | var _classnames = __webpack_require__(3);
|
19118 |
|
19119 | var _classnames2 = _interopRequireDefault(_classnames);
|
19120 |
|
19121 | var _propTypes = __webpack_require__(5);
|
19122 |
|
19123 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
19124 |
|
19125 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
19126 |
|
19127 | 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; }
|
19128 |
|
19129 | 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; }
|
19130 |
|
19131 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
19132 |
|
19133 | 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; }
|
19134 |
|
19135 | 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); }
|
19136 |
|
19137 | |
19138 |
|
19139 |
|
19140 |
|
19141 | var propTypes = {
|
19142 | |
19143 |
|
19144 |
|
19145 | colors: _propTypes2["default"].oneOf(['primary', 'accent', 'success', 'info', 'warning', 'danger', 'default']),
|
19146 | |
19147 |
|
19148 |
|
19149 | dataBadge: _propTypes2["default"].oneOfType([_propTypes2["default"].node, _propTypes2["default"].string, _propTypes2["default"].object]),
|
19150 | dataBadgePlacement: _propTypes2["default"].oneOf(['topbottom'])
|
19151 | };
|
19152 |
|
19153 | var defaultProps = {
|
19154 | clsPrefix: 'u-badge'
|
19155 | };
|
19156 |
|
19157 | var Badge = function (_React$Component) {
|
19158 | _inherits(Badge, _React$Component);
|
19159 |
|
19160 | function Badge(props) {
|
19161 | _classCallCheck(this, Badge);
|
19162 |
|
19163 | return _possibleConstructorReturn(this, _React$Component.call(this, props));
|
19164 | }
|
19165 |
|
19166 | Badge.prototype.render = function render() {
|
19167 | var _props = this.props,
|
19168 | colors = _props.colors,
|
19169 | className = _props.className,
|
19170 | children = _props.children,
|
19171 | clsPrefix = _props.clsPrefix,
|
19172 | dataBadge = _props.dataBadge,
|
19173 | dataBadgePlacement = _props.dataBadgePlacement,
|
19174 | others = _objectWithoutProperties(_props, ['colors', 'className', 'children', 'clsPrefix', 'dataBadge', 'dataBadgePlacement']);
|
19175 |
|
19176 | var clsObj = {};
|
19177 | if (className) {
|
19178 | clsObj[className] = true;
|
19179 | }
|
19180 | |
19181 |
|
19182 |
|
19183 | if (colors) {
|
19184 | clsObj[clsPrefix + '-' + colors] = true;
|
19185 | }
|
19186 | if (dataBadge) {
|
19187 | clsObj['data-badge'] = true;
|
19188 | }
|
19189 | if (dataBadgePlacement) {
|
19190 | clsObj['data-badge-' + dataBadgePlacement] = true;
|
19191 | }
|
19192 | var classNames = (0, _classnames2["default"])(clsPrefix, clsObj);
|
19193 |
|
19194 | return _react2["default"].createElement(
|
19195 | 'span',
|
19196 | _extends({ className: classNames }, others),
|
19197 | dataBadge && _react2["default"].createElement(
|
19198 | 'span',
|
19199 | null,
|
19200 | children,
|
19201 | _react2["default"].createElement(
|
19202 | 'span',
|
19203 | { className: 'data-icon' },
|
19204 | dataBadge
|
19205 | )
|
19206 | ),
|
19207 | !dataBadge && _react2["default"].createElement(
|
19208 | 'span',
|
19209 | { className: 'badge-single' },
|
19210 | children
|
19211 | )
|
19212 | );
|
19213 | };
|
19214 |
|
19215 | return Badge;
|
19216 | }(_react2["default"].Component);
|
19217 |
|
19218 | Badge.defaultProps = defaultProps;
|
19219 |
|
19220 | exports["default"] = Badge;
|
19221 | module.exports = exports['default'];
|
19222 |
|
19223 | }),
|
19224 |
|
19225 | (function(module, exports, __webpack_require__) {
|
19226 |
|
19227 | 'use strict';
|
19228 |
|
19229 | Object.defineProperty(exports, "__esModule", {
|
19230 | value: true
|
19231 | });
|
19232 |
|
19233 | var _Navbar = __webpack_require__(232);
|
19234 |
|
19235 | var _Navbar2 = _interopRequireDefault(_Navbar);
|
19236 |
|
19237 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
19238 |
|
19239 | exports["default"] = _Navbar2["default"];
|
19240 | module.exports = exports['default'];
|
19241 |
|
19242 | }),
|
19243 |
|
19244 | (function(module, exports, __webpack_require__) {
|
19245 |
|
19246 | 'use strict';
|
19247 |
|
19248 | Object.defineProperty(exports, "__esModule", {
|
19249 | value: true
|
19250 | });
|
19251 |
|
19252 | 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; };
|
19253 |
|
19254 | var _classnames = __webpack_require__(3);
|
19255 |
|
19256 | var _classnames2 = _interopRequireDefault(_classnames);
|
19257 |
|
19258 | var _react = __webpack_require__(4);
|
19259 |
|
19260 | var _react2 = _interopRequireDefault(_react);
|
19261 |
|
19262 | var _propTypes = __webpack_require__(5);
|
19263 |
|
19264 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
19265 |
|
19266 | var _elementType = __webpack_require__(34);
|
19267 |
|
19268 | var _elementType2 = _interopRequireDefault(_elementType);
|
19269 |
|
19270 | var _Layout = __webpack_require__(7);
|
19271 |
|
19272 | var _Layout2 = _interopRequireDefault(_Layout);
|
19273 |
|
19274 | var _NavbarBrand = __webpack_require__(233);
|
19275 |
|
19276 | var _NavbarBrand2 = _interopRequireDefault(_NavbarBrand);
|
19277 |
|
19278 | var _NavbarCollapse = __webpack_require__(234);
|
19279 |
|
19280 | var _NavbarCollapse2 = _interopRequireDefault(_NavbarCollapse);
|
19281 |
|
19282 | var _NavbarHeader = __webpack_require__(235);
|
19283 |
|
19284 | var _NavbarHeader2 = _interopRequireDefault(_NavbarHeader);
|
19285 |
|
19286 | var _NavbarToggle = __webpack_require__(236);
|
19287 |
|
19288 | var _NavbarToggle2 = _interopRequireDefault(_NavbarToggle);
|
19289 |
|
19290 | var _Nav = __webpack_require__(237);
|
19291 |
|
19292 | var _Nav2 = _interopRequireDefault(_Nav);
|
19293 |
|
19294 | var _NavItem = __webpack_require__(238);
|
19295 |
|
19296 | var _NavItem2 = _interopRequireDefault(_NavItem);
|
19297 |
|
19298 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
19299 |
|
19300 | 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; }
|
19301 |
|
19302 | 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; }
|
19303 |
|
19304 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
19305 |
|
19306 | 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; }
|
19307 |
|
19308 | 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); }
|
19309 |
|
19310 |
|
19311 |
|
19312 | var propTypes = {
|
19313 | |
19314 |
|
19315 |
|
19316 |
|
19317 | fixedTop: _propTypes2["default"].bool,
|
19318 | |
19319 |
|
19320 |
|
19321 |
|
19322 | fixedBottom: _propTypes2["default"].bool,
|
19323 | |
19324 |
|
19325 |
|
19326 | staticTop: _propTypes2["default"].bool,
|
19327 | |
19328 |
|
19329 |
|
19330 | inverse: _propTypes2["default"].bool,
|
19331 | |
19332 |
|
19333 |
|
19334 |
|
19335 | fluid: _propTypes2["default"].bool,
|
19336 |
|
19337 | |
19338 |
|
19339 |
|
19340 | componentClass: _elementType2["default"],
|
19341 | |
19342 |
|
19343 |
|
19344 |
|
19345 |
|
19346 |
|
19347 |
|
19348 | onToggle: _propTypes2["default"].func,
|
19349 |
|
19350 | |
19351 |
|
19352 |
|
19353 |
|
19354 |
|
19355 | expanded: _propTypes2["default"].bool,
|
19356 |
|
19357 | role: _propTypes2["default"].string
|
19358 | };
|
19359 |
|
19360 | var defaultProps = {
|
19361 | componentClass: 'nav',
|
19362 | fixedTop: false,
|
19363 | fixedBottom: false,
|
19364 | staticTop: false,
|
19365 | inverse: false,
|
19366 | fluid: false,
|
19367 | clsPrefix: 'u-navbar'
|
19368 | };
|
19369 |
|
19370 | var childContextTypes = {
|
19371 | u_navbar: _propTypes2["default"].shape({
|
19372 | expanded: _propTypes2["default"].bool,
|
19373 | onToggle: _propTypes2["default"].func
|
19374 | })
|
19375 | };
|
19376 |
|
19377 | var Navbar = function (_React$Component) {
|
19378 | _inherits(Navbar, _React$Component);
|
19379 |
|
19380 | function Navbar(props, context) {
|
19381 | _classCallCheck(this, Navbar);
|
19382 |
|
19383 | return _possibleConstructorReturn(this, _React$Component.call(this, props, context));
|
19384 |
|
19385 |
|
19386 | }
|
19387 |
|
19388 | Navbar.prototype.getChildContext = function getChildContext() {
|
19389 | var _props = this.props,
|
19390 | expanded = _props.expanded,
|
19391 | onToggle = _props.onToggle;
|
19392 |
|
19393 |
|
19394 | return {
|
19395 | u_navbar: {
|
19396 | expanded: expanded,
|
19397 |
|
19398 | onToggle: onToggle
|
19399 | }
|
19400 | };
|
19401 | };
|
19402 |
|
19403 |
|
19404 |
|
19405 |
|
19406 |
|
19407 |
|
19408 |
|
19409 |
|
19410 | Navbar.prototype.render = function render() {
|
19411 | var _props2 = this.props,
|
19412 | Component = _props2.componentClass,
|
19413 | fixedTop = _props2.fixedTop,
|
19414 | fixedBottom = _props2.fixedBottom,
|
19415 | staticTop = _props2.staticTop,
|
19416 | inverse = _props2.inverse,
|
19417 | fluid = _props2.fluid,
|
19418 | className = _props2.className,
|
19419 | children = _props2.children,
|
19420 | clsPrefix = _props2.clsPrefix,
|
19421 | expanded = _props2.expanded,
|
19422 | onToggle = _props2.onToggle,
|
19423 | others = _objectWithoutProperties(_props2, ['componentClass', 'fixedTop', 'fixedBottom', 'staticTop', 'inverse', 'fluid', 'className', 'children', 'clsPrefix', 'expanded', 'onToggle']);
|
19424 |
|
19425 |
|
19426 |
|
19427 |
|
19428 |
|
19429 | var classes = {};
|
19430 |
|
19431 | if (inverse) {
|
19432 | classes[clsPrefix + '-inverse'] = true;
|
19433 | } else {
|
19434 | classes[clsPrefix + '-default'] = true;
|
19435 | }
|
19436 | if (fixedTop) {
|
19437 | classes[clsPrefix + '-fixed-top'] = true;
|
19438 | }
|
19439 | if (fixedBottom) {
|
19440 | classes[clsPrefix + '-fixed-bottom'] = true;
|
19441 | }
|
19442 | if (staticTop) {
|
19443 | classes[clsPrefix + '-static-top'] = true;
|
19444 | }
|
19445 |
|
19446 | var classNames = (0, _classnames2["default"])(clsPrefix, classes);
|
19447 | return _react2["default"].createElement(
|
19448 | Component,
|
19449 | _extends({}, others, {
|
19450 | className: (0, _classnames2["default"])(className, classNames)
|
19451 | }),
|
19452 | _react2["default"].createElement(
|
19453 | _Layout2["default"],
|
19454 | { fluid: fluid },
|
19455 | children
|
19456 | )
|
19457 | );
|
19458 | };
|
19459 |
|
19460 | return Navbar;
|
19461 | }(_react2["default"].Component);
|
19462 |
|
19463 | Navbar.propTypes = propTypes;
|
19464 | Navbar.defaultProps = defaultProps;
|
19465 | Navbar.childContextTypes = childContextTypes;
|
19466 |
|
19467 |
|
19468 |
|
19469 | function createSimpleWrapper(tag, suffix, displayName) {
|
19470 | var Wrapper = function Wrapper(_ref, _ref2) {
|
19471 | var _ref2$u_navbar = _ref2.u_navbar,
|
19472 | navbarProps = _ref2$u_navbar === undefined ? { preClass: 'navbar' } : _ref2$u_navbar;
|
19473 |
|
19474 | var Component = _ref.componentClass,
|
19475 | className = _ref.className,
|
19476 | pullRight = _ref.pullRight,
|
19477 | pullLeft = _ref.pullLeft,
|
19478 | props = _objectWithoutProperties(_ref, ['componentClass', 'className', 'pullRight', 'pullLeft']);
|
19479 |
|
19480 | return _react2["default"].createElement(Component, _extends({}, props, {
|
19481 | className: (0, _classnames2["default"])(className,
|
19482 |
|
19483 | 'u-navbar-' + suffix, pullRight && 'u-navbar-right', pullLeft && 'u-navbar-left')
|
19484 | }));
|
19485 | };
|
19486 |
|
19487 | Wrapper.displayName = displayName;
|
19488 |
|
19489 | Wrapper.propTypes = {
|
19490 | componentClass: _elementType2["default"],
|
19491 | pullRight: _propTypes2["default"].bool,
|
19492 | pullLeft: _propTypes2["default"].bool
|
19493 | };
|
19494 |
|
19495 | Wrapper.defaultProps = {
|
19496 | componentClass: tag,
|
19497 | pullRight: false,
|
19498 | pullLeft: false
|
19499 | };
|
19500 |
|
19501 | Wrapper.contextTypes = {
|
19502 | u_navbar: _propTypes2["default"].shape({})
|
19503 | };
|
19504 |
|
19505 | return Wrapper;
|
19506 | }
|
19507 |
|
19508 | Navbar.Brand = _NavbarBrand2["default"];
|
19509 | Navbar.Header = _NavbarHeader2["default"];
|
19510 | Navbar.Toggle = _NavbarToggle2["default"];
|
19511 | Navbar.Collapse = _NavbarCollapse2["default"];
|
19512 | Navbar.Nav = _Nav2["default"];
|
19513 |
|
19514 | Navbar.NavItem = _NavItem2["default"];
|
19515 |
|
19516 | Navbar.Form = createSimpleWrapper('div', 'form', 'NavbarForm');
|
19517 | Navbar.Text = createSimpleWrapper('p', 'text', 'NavbarText');
|
19518 | Navbar.Link = createSimpleWrapper('a', 'link', 'NavbarLink');
|
19519 |
|
19520 | exports["default"] = Navbar;
|
19521 | module.exports = exports['default'];
|
19522 |
|
19523 | }),
|
19524 |
|
19525 | (function(module, exports, __webpack_require__) {
|
19526 |
|
19527 | 'use strict';
|
19528 |
|
19529 | Object.defineProperty(exports, "__esModule", {
|
19530 | value: true
|
19531 | });
|
19532 |
|
19533 | 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; };
|
19534 |
|
19535 | var _react = __webpack_require__(4);
|
19536 |
|
19537 | var _react2 = _interopRequireDefault(_react);
|
19538 |
|
19539 | var _classnames = __webpack_require__(3);
|
19540 |
|
19541 | var _classnames2 = _interopRequireDefault(_classnames);
|
19542 |
|
19543 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
19544 |
|
19545 | 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; }
|
19546 |
|
19547 | 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; }
|
19548 |
|
19549 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
19550 |
|
19551 | 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; }
|
19552 |
|
19553 | 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); }
|
19554 |
|
19555 | var defaultProps = {
|
19556 | clsPrefix: "u-navbar-brand"
|
19557 | };
|
19558 |
|
19559 | var NavbarBrand = function (_React$Component) {
|
19560 | _inherits(NavbarBrand, _React$Component);
|
19561 |
|
19562 | function NavbarBrand() {
|
19563 | _classCallCheck(this, NavbarBrand);
|
19564 |
|
19565 | return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
19566 | }
|
19567 |
|
19568 | NavbarBrand.prototype.render = function render() {
|
19569 | var _props = this.props,
|
19570 | className = _props.className,
|
19571 | children = _props.children,
|
19572 | clsPrefix = _props.clsPrefix,
|
19573 | props = _objectWithoutProperties(_props, ['className', 'children', 'clsPrefix']);
|
19574 |
|
19575 | if (_react2["default"].isValidElement(children)) {
|
19576 | return _react2["default"].cloneElement(children, {
|
19577 | className: (0, _classnames2["default"])(children.props.className, className, clsPrefix)
|
19578 | });
|
19579 | }
|
19580 |
|
19581 | return _react2["default"].createElement(
|
19582 | 'span',
|
19583 | _extends({}, props, { className: (0, _classnames2["default"])(className, clsPrefix) }),
|
19584 | children
|
19585 | );
|
19586 | };
|
19587 |
|
19588 | return NavbarBrand;
|
19589 | }(_react2["default"].Component);
|
19590 |
|
19591 | NavbarBrand.defaultProps = defaultProps;
|
19592 |
|
19593 | exports["default"] = NavbarBrand;
|
19594 | module.exports = exports['default'];
|
19595 |
|
19596 | }),
|
19597 |
|
19598 | (function(module, exports, __webpack_require__) {
|
19599 |
|
19600 | 'use strict';
|
19601 |
|
19602 | Object.defineProperty(exports, "__esModule", {
|
19603 | value: true
|
19604 | });
|
19605 |
|
19606 | 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; };
|
19607 |
|
19608 | var _react = __webpack_require__(4);
|
19609 |
|
19610 | var _react2 = _interopRequireDefault(_react);
|
19611 |
|
19612 | var _propTypes = __webpack_require__(5);
|
19613 |
|
19614 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
19615 |
|
19616 | var _Collapse = __webpack_require__(17);
|
19617 |
|
19618 | var _Collapse2 = _interopRequireDefault(_Collapse);
|
19619 |
|
19620 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
19621 |
|
19622 | 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; }
|
19623 |
|
19624 | 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; }
|
19625 |
|
19626 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
19627 |
|
19628 | 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; }
|
19629 |
|
19630 | 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); }
|
19631 |
|
19632 | var contextTypes = {
|
19633 | u_navbar: _propTypes2["default"].shape({
|
19634 | expanded: _propTypes2["default"].bool
|
19635 | })
|
19636 | };
|
19637 |
|
19638 | var defaultProps = {
|
19639 | clsPrefix: 'u-navbar-collapse'
|
19640 | };
|
19641 |
|
19642 | var NavbarCollapse = function (_React$Component) {
|
19643 | _inherits(NavbarCollapse, _React$Component);
|
19644 |
|
19645 | function NavbarCollapse() {
|
19646 | _classCallCheck(this, NavbarCollapse);
|
19647 |
|
19648 | return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
19649 | }
|
19650 |
|
19651 | NavbarCollapse.prototype.render = function render() {
|
19652 | var _props = this.props,
|
19653 | children = _props.children,
|
19654 | clsPrefix = _props.clsPrefix,
|
19655 | props = _objectWithoutProperties(_props, ['children', 'clsPrefix']);
|
19656 |
|
19657 | var navbarProps = this.context.u_navbar;
|
19658 |
|
19659 | return _react2["default"].createElement(
|
19660 | _Collapse2["default"],
|
19661 | _extends({ 'in': navbarProps.expanded }, props),
|
19662 | _react2["default"].createElement(
|
19663 | 'div',
|
19664 | { className: clsPrefix },
|
19665 | children
|
19666 | )
|
19667 | );
|
19668 | };
|
19669 |
|
19670 | return NavbarCollapse;
|
19671 | }(_react2["default"].Component);
|
19672 |
|
19673 | NavbarCollapse.contextTypes = contextTypes;
|
19674 | NavbarCollapse.defaultProps = defaultProps;
|
19675 |
|
19676 | exports["default"] = NavbarCollapse;
|
19677 | module.exports = exports['default'];
|
19678 |
|
19679 | }),
|
19680 |
|
19681 | (function(module, exports, __webpack_require__) {
|
19682 |
|
19683 | 'use strict';
|
19684 |
|
19685 | Object.defineProperty(exports, "__esModule", {
|
19686 | value: true
|
19687 | });
|
19688 |
|
19689 | 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; };
|
19690 |
|
19691 | var _classnames = __webpack_require__(3);
|
19692 |
|
19693 | var _classnames2 = _interopRequireDefault(_classnames);
|
19694 |
|
19695 | var _react = __webpack_require__(4);
|
19696 |
|
19697 | var _react2 = _interopRequireDefault(_react);
|
19698 |
|
19699 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
19700 |
|
19701 | 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; }
|
19702 |
|
19703 | 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; }
|
19704 |
|
19705 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
19706 |
|
19707 | 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; }
|
19708 |
|
19709 | 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); }
|
19710 |
|
19711 | var defaultProps = {
|
19712 | clsPrefix: 'u-navbar-header'
|
19713 | };
|
19714 |
|
19715 | var NavbarHeader = function (_React$Component) {
|
19716 | _inherits(NavbarHeader, _React$Component);
|
19717 |
|
19718 | function NavbarHeader() {
|
19719 | _classCallCheck(this, NavbarHeader);
|
19720 |
|
19721 | return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
19722 | }
|
19723 |
|
19724 | NavbarHeader.prototype.render = function render() {
|
19725 | var _props = this.props,
|
19726 | className = _props.className,
|
19727 | clsPrefix = _props.clsPrefix,
|
19728 | props = _objectWithoutProperties(_props, ['className', 'clsPrefix']);
|
19729 |
|
19730 | return _react2["default"].createElement('div', _extends({}, props, { className: (0, _classnames2["default"])(className, clsPrefix) }));
|
19731 | };
|
19732 |
|
19733 | return NavbarHeader;
|
19734 | }(_react2["default"].Component);
|
19735 |
|
19736 | NavbarHeader.defaultProps = defaultProps;
|
19737 |
|
19738 | exports["default"] = NavbarHeader;
|
19739 | module.exports = exports['default'];
|
19740 |
|
19741 | }),
|
19742 |
|
19743 | (function(module, exports, __webpack_require__) {
|
19744 |
|
19745 | 'use strict';
|
19746 |
|
19747 | Object.defineProperty(exports, "__esModule", {
|
19748 | value: true
|
19749 | });
|
19750 |
|
19751 | 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; };
|
19752 |
|
19753 | var _classnames = __webpack_require__(3);
|
19754 |
|
19755 | var _classnames2 = _interopRequireDefault(_classnames);
|
19756 |
|
19757 | var _react = __webpack_require__(4);
|
19758 |
|
19759 | var _react2 = _interopRequireDefault(_react);
|
19760 |
|
19761 | var _propTypes = __webpack_require__(5);
|
19762 |
|
19763 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
19764 |
|
19765 | var _createChainedFunction = __webpack_require__(37);
|
19766 |
|
19767 | var _createChainedFunction2 = _interopRequireDefault(_createChainedFunction);
|
19768 |
|
19769 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
19770 |
|
19771 | 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; }
|
19772 |
|
19773 | 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; }
|
19774 |
|
19775 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
19776 |
|
19777 | 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; }
|
19778 |
|
19779 | 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); }
|
19780 |
|
19781 | var propTypes = {
|
19782 | onClick: _propTypes2["default"].func,
|
19783 | |
19784 |
|
19785 |
|
19786 | show: _propTypes2["default"].bool,
|
19787 | children: _propTypes2["default"].node
|
19788 | };
|
19789 |
|
19790 | var contextTypes = {
|
19791 | u_navbar: _propTypes2["default"].shape({
|
19792 | expanded: _propTypes2["default"].bool,
|
19793 | onToggle: _propTypes2["default"].func
|
19794 | })
|
19795 | };
|
19796 |
|
19797 | var defaultProps = {
|
19798 | clsPrefix: 'u-navbar-toggle',
|
19799 | show: false
|
19800 | };
|
19801 |
|
19802 | var NavbarToggle = function (_React$Component) {
|
19803 | _inherits(NavbarToggle, _React$Component);
|
19804 |
|
19805 | function NavbarToggle(props) {
|
19806 | _classCallCheck(this, NavbarToggle);
|
19807 |
|
19808 | var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
|
19809 |
|
19810 | _this.state = {
|
19811 | toggleState: false
|
19812 |
|
19813 | };return _this;
|
19814 | }
|
19815 |
|
19816 | NavbarToggle.prototype.handleClick = function handleClick() {
|
19817 | var _context$u_navbar = this.context.u_navbar,
|
19818 | expanded = _context$u_navbar.expanded,
|
19819 | onToggle = _context$u_navbar.onToggle;
|
19820 |
|
19821 | this.setState({ toggleState: !this.state.toggleState });
|
19822 | if (onToggle) {
|
19823 | onToggle(!expanded);
|
19824 | }
|
19825 | };
|
19826 |
|
19827 | NavbarToggle.prototype.render = function render() {
|
19828 | var _props = this.props,
|
19829 | onClick = _props.onClick,
|
19830 | className = _props.className,
|
19831 | children = _props.children,
|
19832 | clsPrefix = _props.clsPrefix,
|
19833 | show = _props.show,
|
19834 | props = _objectWithoutProperties(_props, ['onClick', 'className', 'children', 'clsPrefix', 'show']);
|
19835 |
|
19836 |
|
19837 |
|
19838 | var buttonProps = _extends({
|
19839 | type: 'button'
|
19840 | }, props, {
|
19841 | onClick: (0, _createChainedFunction2["default"])(onClick, this.handleClick.bind(this)),
|
19842 | className: (0, _classnames2["default"])(className, clsPrefix, show && 'show')
|
19843 | });
|
19844 |
|
19845 | if (children) {
|
19846 | return _react2["default"].createElement(
|
19847 | 'button',
|
19848 | buttonProps,
|
19849 | children
|
19850 | );
|
19851 | }
|
19852 |
|
19853 | return _react2["default"].createElement(
|
19854 | 'div',
|
19855 | null,
|
19856 | !show && _react2["default"].createElement(
|
19857 | 'button',
|
19858 | buttonProps,
|
19859 | _react2["default"].createElement(
|
19860 | 'span',
|
19861 | { className: 'sr-only' },
|
19862 | 'Toggle navigation'
|
19863 | ),
|
19864 | _react2["default"].createElement('span', { className: 'icon-bar' }),
|
19865 | _react2["default"].createElement('span', { className: 'icon-bar' }),
|
19866 | _react2["default"].createElement('span', { className: 'icon-bar' })
|
19867 | )
|
19868 | );
|
19869 | };
|
19870 |
|
19871 | return NavbarToggle;
|
19872 | }(_react2["default"].Component);
|
19873 |
|
19874 | NavbarToggle.propTypes = propTypes;
|
19875 | NavbarToggle.defaultProps = defaultProps;
|
19876 | NavbarToggle.contextTypes = contextTypes;
|
19877 |
|
19878 | exports["default"] = NavbarToggle;
|
19879 | module.exports = exports['default'];
|
19880 |
|
19881 | }),
|
19882 |
|
19883 | (function(module, exports, __webpack_require__) {
|
19884 |
|
19885 | 'use strict';
|
19886 |
|
19887 | Object.defineProperty(exports, "__esModule", {
|
19888 | value: true
|
19889 | });
|
19890 |
|
19891 | 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; };
|
19892 |
|
19893 | var _classnames = __webpack_require__(3);
|
19894 |
|
19895 | var _classnames2 = _interopRequireDefault(_classnames);
|
19896 |
|
19897 | var _react = __webpack_require__(4);
|
19898 |
|
19899 | var _react2 = _interopRequireDefault(_react);
|
19900 |
|
19901 | var _propTypes = __webpack_require__(5);
|
19902 |
|
19903 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
19904 |
|
19905 | var _all = __webpack_require__(28);
|
19906 |
|
19907 | var _all2 = _interopRequireDefault(_all);
|
19908 |
|
19909 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
19910 |
|
19911 | 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; }
|
19912 |
|
19913 | 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; }
|
19914 |
|
19915 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
19916 |
|
19917 | 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; }
|
19918 |
|
19919 | 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); }
|
19920 |
|
19921 |
|
19922 |
|
19923 |
|
19924 |
|
19925 |
|
19926 |
|
19927 |
|
19928 | var propTypes = {
|
19929 | |
19930 |
|
19931 |
|
19932 |
|
19933 | activeKey: _propTypes2["default"].any,
|
19934 |
|
19935 | |
19936 |
|
19937 |
|
19938 | activeHref: _propTypes2["default"].string,
|
19939 |
|
19940 | |
19941 |
|
19942 |
|
19943 | stacked: _propTypes2["default"].bool,
|
19944 |
|
19945 | justified: (0, _all2["default"])(_propTypes2["default"].bool, function (_ref) {
|
19946 | var justified = _ref.justified,
|
19947 | navbar = _ref.navbar;
|
19948 | return justified && navbar ? Error('justified navbar `Nav`s are not supported') : null;
|
19949 | }),
|
19950 |
|
19951 | |
19952 |
|
19953 |
|
19954 |
|
19955 |
|
19956 |
|
19957 |
|
19958 |
|
19959 |
|
19960 |
|
19961 | onSelect: _propTypes2["default"].func,
|
19962 |
|
19963 | |
19964 |
|
19965 |
|
19966 |
|
19967 | navbar: _propTypes2["default"].bool,
|
19968 |
|
19969 | |
19970 |
|
19971 |
|
19972 |
|
19973 | pullRight: _propTypes2["default"].bool,
|
19974 |
|
19975 | |
19976 |
|
19977 |
|
19978 |
|
19979 | pullLeft: _propTypes2["default"].bool
|
19980 | };
|
19981 |
|
19982 | var defaultProps = {
|
19983 | pullRight: false,
|
19984 | pullLeft: false,
|
19985 | clsPrefix: 'u-navbar'
|
19986 | };
|
19987 |
|
19988 | var childContextTypes = {
|
19989 | u_nav: _propTypes2["default"].object
|
19990 | };
|
19991 |
|
19992 | var Nav = function (_React$Component) {
|
19993 | _inherits(Nav, _React$Component);
|
19994 |
|
19995 | function Nav() {
|
19996 | _classCallCheck(this, Nav);
|
19997 |
|
19998 | return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
19999 | }
|
20000 |
|
20001 | Nav.prototype.getChildContext = function getChildContext() {
|
20002 | var _props = this.props,
|
20003 | selectedkey = _props.selectedkey,
|
20004 | onSelect = _props.onSelect;
|
20005 |
|
20006 | return {
|
20007 | u_nav: {
|
20008 | selectedkey: selectedkey, onSelect: onSelect
|
20009 | }
|
20010 | };
|
20011 | };
|
20012 |
|
20013 | Nav.prototype.render = function render() {
|
20014 | var _props2 = this.props,
|
20015 | onSelect = _props2.onSelect,
|
20016 | selectedkey = _props2.selectedkey,
|
20017 | propsRole = _props2.role,
|
20018 | pullRight = _props2.pullRight,
|
20019 | pullLeft = _props2.pullLeft,
|
20020 | className = _props2.className,
|
20021 | children = _props2.children,
|
20022 | clsPrefix = _props2.clsPrefix,
|
20023 | props = _objectWithoutProperties(_props2, ['onSelect', 'selectedkey', 'role', 'pullRight', 'pullLeft', 'className', 'children', 'clsPrefix']);
|
20024 |
|
20025 |
|
20026 |
|
20027 |
|
20028 |
|
20029 |
|
20030 |
|
20031 | delete props.activeKey;
|
20032 | delete props.activeHref;
|
20033 |
|
20034 |
|
20035 | var classes = { 'u-nav': true, 'u-navbar-nav': true };
|
20036 |
|
20037 | if (pullRight) {
|
20038 | classes[clsPrefix + '-right'] = true;
|
20039 | }
|
20040 | if (pullLeft) {
|
20041 | classes[clsPrefix + '-left'] = true;
|
20042 | }
|
20043 |
|
20044 |
|
20045 |
|
20046 | return _react2["default"].createElement(
|
20047 | 'ul',
|
20048 | _extends({}, props, {
|
20049 | className: (0, _classnames2["default"])(className, classes)
|
20050 | }),
|
20051 | children
|
20052 | );
|
20053 | };
|
20054 |
|
20055 | return Nav;
|
20056 | }(_react2["default"].Component);
|
20057 |
|
20058 | Nav.propTypes = propTypes;
|
20059 | Nav.defaultProps = defaultProps;
|
20060 | Nav.childContextTypes = childContextTypes;
|
20061 |
|
20062 | exports["default"] = Nav;
|
20063 | module.exports = exports['default'];
|
20064 |
|
20065 | }),
|
20066 |
|
20067 | (function(module, exports, __webpack_require__) {
|
20068 |
|
20069 | 'use strict';
|
20070 |
|
20071 | Object.defineProperty(exports, "__esModule", {
|
20072 | value: true
|
20073 | });
|
20074 |
|
20075 | 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; };
|
20076 |
|
20077 | var _classnames = __webpack_require__(3);
|
20078 |
|
20079 | var _classnames2 = _interopRequireDefault(_classnames);
|
20080 |
|
20081 | var _react = __webpack_require__(4);
|
20082 |
|
20083 | var _react2 = _interopRequireDefault(_react);
|
20084 |
|
20085 | var _propTypes = __webpack_require__(5);
|
20086 |
|
20087 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
20088 |
|
20089 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
20090 |
|
20091 | 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; }
|
20092 |
|
20093 | 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; }
|
20094 |
|
20095 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
20096 |
|
20097 | 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; }
|
20098 |
|
20099 | 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); }
|
20100 |
|
20101 | var propTypes = {
|
20102 | active: _propTypes2["default"].bool,
|
20103 | disabled: _propTypes2["default"].bool,
|
20104 | role: _propTypes2["default"].string,
|
20105 | href: _propTypes2["default"].string,
|
20106 | skey: _propTypes2["default"].oneOfType([_propTypes2["default"].element, _propTypes2["default"].string, _propTypes2["default"].number]),
|
20107 | onClick: _propTypes2["default"].func,
|
20108 | eventKey: _propTypes2["default"].any,
|
20109 | children: _propTypes2["default"].oneOfType([_propTypes2["default"].element, _propTypes2["default"].string, _propTypes2["default"].node])
|
20110 | };
|
20111 |
|
20112 | var defaultProps = {
|
20113 | active: false,
|
20114 | disabled: false
|
20115 | };
|
20116 |
|
20117 | var contextTypes = {
|
20118 | u_nav: _propTypes2["default"].object
|
20119 | };
|
20120 |
|
20121 | var NavItem = function (_React$Component) {
|
20122 | _inherits(NavItem, _React$Component);
|
20123 |
|
20124 | function NavItem(props, context) {
|
20125 | _classCallCheck(this, NavItem);
|
20126 |
|
20127 | var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context));
|
20128 |
|
20129 | _this.handleClick = _this.handleClick.bind(_this);
|
20130 | return _this;
|
20131 | }
|
20132 |
|
20133 | NavItem.prototype.handleClick = function handleClick(e) {
|
20134 | var _context$u_nav = this.context.u_nav,
|
20135 | onSelect = _context$u_nav.onSelect,
|
20136 | selectedkey = _context$u_nav.selectedkey;
|
20137 |
|
20138 |
|
20139 | if (this.props.disabled) {
|
20140 | return;
|
20141 | }
|
20142 |
|
20143 | if (onSelect) {
|
20144 | onSelect(this.props.eventKey);
|
20145 | }
|
20146 | };
|
20147 |
|
20148 | NavItem.prototype.render = function render() {
|
20149 | var _props = this.props,
|
20150 | active = _props.active,
|
20151 | eventKey = _props.eventKey,
|
20152 | disabled = _props.disabled,
|
20153 | skey = _props.skey,
|
20154 | className = _props.className,
|
20155 | style = _props.style,
|
20156 | children = _props.children,
|
20157 | props = _objectWithoutProperties(_props, ['active', 'eventKey', 'disabled', 'skey', 'className', 'style', 'children']);
|
20158 |
|
20159 | var selectedkey = this.context.u_nav.selectedkey;
|
20160 |
|
20161 |
|
20162 | var activeItem = this.props.eventKey === selectedkey;
|
20163 |
|
20164 | var classes = { 'active': activeItem, 'disabled': disabled };
|
20165 |
|
20166 | var dom = props.href ? _react2["default"].createElement(
|
20167 | 'li',
|
20168 | {
|
20169 | role: 'presentation',
|
20170 | className: (0, _classnames2["default"])(className, classes),
|
20171 | style: style,
|
20172 | onClick: this.handleClick
|
20173 | },
|
20174 | _react2["default"].createElement(
|
20175 | 'a',
|
20176 | _extends({}, props, {
|
20177 | disabled: disabled
|
20178 | }),
|
20179 | children
|
20180 | )
|
20181 | ) : _react2["default"].createElement(
|
20182 | 'li',
|
20183 | {
|
20184 | role: 'presentation',
|
20185 | className: (0, _classnames2["default"])(className, classes),
|
20186 | style: style,
|
20187 | key: skey,
|
20188 | onClick: this.handleClick
|
20189 | },
|
20190 | children
|
20191 | );
|
20192 | return dom;
|
20193 | };
|
20194 |
|
20195 | return NavItem;
|
20196 | }(_react2["default"].Component);
|
20197 |
|
20198 | NavItem.contextTypes = contextTypes;
|
20199 | NavItem.propTypes = propTypes;
|
20200 | NavItem.defaultProps = defaultProps;
|
20201 |
|
20202 | exports["default"] = NavItem;
|
20203 | module.exports = exports['default'];
|
20204 |
|
20205 | }),
|
20206 |
|
20207 | (function(module, exports, __webpack_require__) {
|
20208 |
|
20209 | 'use strict';
|
20210 |
|
20211 | Object.defineProperty(exports, "__esModule", {
|
20212 | value: true
|
20213 | });
|
20214 |
|
20215 | var _react = __webpack_require__(4);
|
20216 |
|
20217 | var _react2 = _interopRequireDefault(_react);
|
20218 |
|
20219 | var _src = __webpack_require__(85);
|
20220 |
|
20221 | var _src2 = _interopRequireDefault(_src);
|
20222 |
|
20223 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
20224 |
|
20225 | 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; }
|
20226 |
|
20227 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
20228 |
|
20229 | 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; }
|
20230 |
|
20231 | 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); } |
20232 |
|
20233 |
|
20234 |
|
20235 |
|
20236 |
|
20237 |
|
20238 | var SubMenu = _src2['default'].SubMenu;
|
20239 | var MenuItemGroup = _src2['default'].ItemGroup;
|
20240 |
|
20241 | var Demo6 = function (_Component) {
|
20242 | _inherits(Demo6, _Component);
|
20243 |
|
20244 | function Demo6(props, context) {
|
20245 | _classCallCheck(this, Demo6);
|
20246 |
|
20247 | var _this = _possibleConstructorReturn(this, _Component.call(this, props, context));
|
20248 |
|
20249 | _this.handleClick = function (e) {
|
20250 |
|
20251 | _this.setState({
|
20252 | current: e.key
|
20253 | });
|
20254 | };
|
20255 |
|
20256 | _this.state = {
|
20257 | current: 1
|
20258 | };
|
20259 | return _this;
|
20260 | }
|
20261 |
|
20262 | |
20263 |
|
20264 |
|
20265 |
|
20266 | Demo6.prototype.onSelect = function onSelect(_ref) {
|
20267 | var item = _ref.item,
|
20268 | key = _ref.key,
|
20269 | selectedKeys = _ref.selectedKeys;
|
20270 |
|
20271 | console.log(key + ' selected');
|
20272 | var currentObject = {};
|
20273 | currentObject.value = item.props.children;
|
20274 | currentObject.key = item.props.eventKey;
|
20275 | console.log(currentObject);
|
20276 | };
|
20277 |
|
20278 | Demo6.prototype.render = function render() {
|
20279 | return _react2['default'].createElement(
|
20280 | _src2['default'],
|
20281 | { theme: 'dark', onClick: this.handleClick, style: { width: 240 }, defaultOpenKeys: ['demo3sub1'], selectedKeys: [this.state.current], mode: 'inline', onSelect: this.onSelect.bind(this) },
|
20282 | _react2['default'].createElement(
|
20283 | SubMenu,
|
20284 | { key: 'demo3sub1', title: _react2['default'].createElement(
|
20285 | 'span',
|
20286 | null,
|
20287 | _react2['default'].createElement(
|
20288 | 'span',
|
20289 | null,
|
20290 | '\u7EC4\u7EC7 1'
|
20291 | )
|
20292 | ) },
|
20293 | _react2['default'].createElement(
|
20294 | MenuItemGroup,
|
20295 | { title: '\u7EC4 1' },
|
20296 | _react2['default'].createElement(
|
20297 | _src2['default'].Item,
|
20298 | { key: '1' },
|
20299 | '\u9009\u9879 1'
|
20300 | ),
|
20301 | _react2['default'].createElement(
|
20302 | _src2['default'].Item,
|
20303 | { key: '2' },
|
20304 | '\u9009\u9879 2'
|
20305 | )
|
20306 | ),
|
20307 | _react2['default'].createElement(
|
20308 | MenuItemGroup,
|
20309 | { title: '\u7EC4 2' },
|
20310 | _react2['default'].createElement(
|
20311 | _src2['default'].Item,
|
20312 | { key: '3' },
|
20313 | '\u9009\u9879 3'
|
20314 | ),
|
20315 | _react2['default'].createElement(
|
20316 | _src2['default'].Item,
|
20317 | { key: '4' },
|
20318 | '\u9009\u9879 4'
|
20319 | )
|
20320 | )
|
20321 | ),
|
20322 | _react2['default'].createElement(
|
20323 | SubMenu,
|
20324 | { key: 'demo3sub2', title: _react2['default'].createElement(
|
20325 | 'span',
|
20326 | null,
|
20327 | _react2['default'].createElement(
|
20328 | 'span',
|
20329 | null,
|
20330 | '\u7EC4\u7EC7 2'
|
20331 | )
|
20332 | ) },
|
20333 | _react2['default'].createElement(
|
20334 | _src2['default'].Item,
|
20335 | { key: '5' },
|
20336 | '\u9009\u9879 5'
|
20337 | ),
|
20338 | _react2['default'].createElement(
|
20339 | _src2['default'].Item,
|
20340 | { key: '6' },
|
20341 | '\u9009\u9879 6'
|
20342 | ),
|
20343 | _react2['default'].createElement(
|
20344 | SubMenu,
|
20345 | { key: 'demo3sub3', title: '\u5B50\u9879' },
|
20346 | _react2['default'].createElement(
|
20347 | _src2['default'].Item,
|
20348 | { key: '7' },
|
20349 | '\u9009\u9879 7'
|
20350 | ),
|
20351 | _react2['default'].createElement(
|
20352 | _src2['default'].Item,
|
20353 | { key: '8' },
|
20354 | '\u9009\u9879 8'
|
20355 | )
|
20356 | )
|
20357 | ),
|
20358 | _react2['default'].createElement(
|
20359 | SubMenu,
|
20360 | { key: 'demo3sub4', title: _react2['default'].createElement(
|
20361 | 'span',
|
20362 | null,
|
20363 | _react2['default'].createElement(
|
20364 | 'span',
|
20365 | null,
|
20366 | '\u7EC4\u7EC7 3'
|
20367 | )
|
20368 | ) },
|
20369 | _react2['default'].createElement(
|
20370 | _src2['default'].Item,
|
20371 | { key: '9' },
|
20372 | '\u9009\u9879 9'
|
20373 | ),
|
20374 | _react2['default'].createElement(
|
20375 | _src2['default'].Item,
|
20376 | { key: '10' },
|
20377 | '\u9009\u9879 10'
|
20378 | ),
|
20379 | _react2['default'].createElement(
|
20380 | _src2['default'].Item,
|
20381 | { key: '11' },
|
20382 | '\u9009\u9879 11'
|
20383 | ),
|
20384 | _react2['default'].createElement(
|
20385 | _src2['default'].Item,
|
20386 | { key: '12' },
|
20387 | '\u9009\u9879 12'
|
20388 | )
|
20389 | )
|
20390 | );
|
20391 | };
|
20392 |
|
20393 | return Demo6;
|
20394 | }(_react.Component);
|
20395 |
|
20396 | exports['default'] = Demo6;
|
20397 | module.exports = exports['default'];
|
20398 |
|
20399 | }),
|
20400 |
|
20401 | (function(module, exports, __webpack_require__) {
|
20402 |
|
20403 | 'use strict';
|
20404 |
|
20405 | Object.defineProperty(exports, "__esModule", {
|
20406 | value: true
|
20407 | });
|
20408 |
|
20409 | var _react = __webpack_require__(4);
|
20410 |
|
20411 | var _react2 = _interopRequireDefault(_react);
|
20412 |
|
20413 | var _src = __webpack_require__(85);
|
20414 |
|
20415 | var _src2 = _interopRequireDefault(_src);
|
20416 |
|
20417 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
20418 |
|
20419 | 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; }
|
20420 |
|
20421 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
20422 |
|
20423 | 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; }
|
20424 |
|
20425 | 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); } |
20426 |
|
20427 |
|
20428 |
|
20429 |
|
20430 | var SubMenu = _src2['default'].SubMenu;
|
20431 | var MenuItemGroup = _src2['default'].ItemGroup;
|
20432 |
|
20433 | var Demo4 = function (_Component) {
|
20434 | _inherits(Demo4, _Component);
|
20435 |
|
20436 | function Demo4() {
|
20437 | var _temp, _this, _ret;
|
20438 |
|
20439 | _classCallCheck(this, Demo4);
|
20440 |
|
20441 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
20442 | args[_key] = arguments[_key];
|
20443 | }
|
20444 |
|
20445 | return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.handleClick = function (e) {
|
20446 | console.log('click', e);
|
20447 | }, _temp), _possibleConstructorReturn(_this, _ret);
|
20448 | }
|
20449 |
|
20450 | Demo4.prototype.render = function render() {
|
20451 | return _react2['default'].createElement(
|
20452 | 'div',
|
20453 | null,
|
20454 | _react2['default'].createElement('input', { style: { 'marginBottom': '10px' }, placeholder: '\u6211\u662F\u4E3A\u4E86\u83B7\u5F97\u7126\u70B9' }),
|
20455 | _react2['default'].createElement(
|
20456 | _src2['default'],
|
20457 | { onClick: this.handleClick, keyboard: true, style: { width: 240 }, mode: 'vertical' },
|
20458 | _react2['default'].createElement(
|
20459 | SubMenu,
|
20460 | { key: 'sub1', title: _react2['default'].createElement(
|
20461 | 'span',
|
20462 | null,
|
20463 | _react2['default'].createElement(
|
20464 | 'span',
|
20465 | null,
|
20466 | '\u7EC4\u7EC7 1'
|
20467 | )
|
20468 | ) },
|
20469 | _react2['default'].createElement(
|
20470 | MenuItemGroup,
|
20471 | { title: 'Item 1' },
|
20472 | _react2['default'].createElement(
|
20473 | _src2['default'].Item,
|
20474 | { key: '1' },
|
20475 | '\u9009\u9879 1'
|
20476 | ),
|
20477 | _react2['default'].createElement(
|
20478 | _src2['default'].Item,
|
20479 | { key: '2' },
|
20480 | '\u9009\u9879 2'
|
20481 | )
|
20482 | ),
|
20483 | _react2['default'].createElement(
|
20484 | MenuItemGroup,
|
20485 | { title: 'Iteom 2' },
|
20486 | _react2['default'].createElement(
|
20487 | _src2['default'].Item,
|
20488 | { key: '3' },
|
20489 | '\u9009\u9879 3'
|
20490 | ),
|
20491 | _react2['default'].createElement(
|
20492 | _src2['default'].Item,
|
20493 | { key: '4' },
|
20494 | '\u9009\u9879 4'
|
20495 | )
|
20496 | )
|
20497 | ),
|
20498 | _react2['default'].createElement(
|
20499 | SubMenu,
|
20500 | { key: 'sub2', title: _react2['default'].createElement(
|
20501 | 'span',
|
20502 | null,
|
20503 | _react2['default'].createElement(
|
20504 | 'span',
|
20505 | null,
|
20506 | '\u7EC4\u7EC7 2'
|
20507 | )
|
20508 | ) },
|
20509 | _react2['default'].createElement(
|
20510 | _src2['default'].Item,
|
20511 | { key: '5' },
|
20512 | '\u9009\u9879 5'
|
20513 | ),
|
20514 | _react2['default'].createElement(
|
20515 | _src2['default'].Item,
|
20516 | { key: '6' },
|
20517 | '\u9009\u9879 6'
|
20518 | ),
|
20519 | _react2['default'].createElement(
|
20520 | SubMenu,
|
20521 | { key: 'sub3', title: 'Submenu' },
|
20522 | _react2['default'].createElement(
|
20523 | _src2['default'].Item,
|
20524 | { key: '7' },
|
20525 | '\u9009\u9879 7'
|
20526 | ),
|
20527 | _react2['default'].createElement(
|
20528 | _src2['default'].Item,
|
20529 | { key: '8' },
|
20530 | '\u9009\u9879 8'
|
20531 | )
|
20532 | )
|
20533 | ),
|
20534 | _react2['default'].createElement(
|
20535 | SubMenu,
|
20536 | { key: 'sub4', title: _react2['default'].createElement(
|
20537 | 'span',
|
20538 | null,
|
20539 | _react2['default'].createElement(
|
20540 | 'span',
|
20541 | null,
|
20542 | '\u7EC4\u7EC7 3'
|
20543 | )
|
20544 | ) },
|
20545 | _react2['default'].createElement(
|
20546 | _src2['default'].Item,
|
20547 | { key: '9' },
|
20548 | '\u9009\u9879 9'
|
20549 | ),
|
20550 | _react2['default'].createElement(
|
20551 | _src2['default'].Item,
|
20552 | { key: '10' },
|
20553 | '\u9009\u9879 10'
|
20554 | ),
|
20555 | _react2['default'].createElement(
|
20556 | _src2['default'].Item,
|
20557 | { key: '11' },
|
20558 | '\u9009\u9879 11'
|
20559 | ),
|
20560 | _react2['default'].createElement(
|
20561 | _src2['default'].Item,
|
20562 | { key: '12' },
|
20563 | '\u9009\u9879 12'
|
20564 | )
|
20565 | )
|
20566 | )
|
20567 | );
|
20568 | };
|
20569 |
|
20570 | return Demo4;
|
20571 | }(_react.Component);
|
20572 |
|
20573 | exports['default'] = Demo4;
|
20574 | module.exports = exports['default'];
|
20575 |
|
20576 | }),
|
20577 |
|
20578 | (function(module, exports, __webpack_require__) {
|
20579 |
|
20580 | 'use strict';
|
20581 |
|
20582 | Object.defineProperty(exports, "__esModule", {
|
20583 | value: true
|
20584 | });
|
20585 |
|
20586 | var _react = __webpack_require__(4);
|
20587 |
|
20588 | var _react2 = _interopRequireDefault(_react);
|
20589 |
|
20590 | var _src = __webpack_require__(85);
|
20591 |
|
20592 | var _src2 = _interopRequireDefault(_src);
|
20593 |
|
20594 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
20595 |
|
20596 | 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; }
|
20597 |
|
20598 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
20599 |
|
20600 | 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; }
|
20601 |
|
20602 | 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); } |
20603 |
|
20604 |
|
20605 |
|
20606 |
|
20607 | var SubMenu = _src2['default'].SubMenu;
|
20608 |
|
20609 | var Demo3 = function (_Component) {
|
20610 | _inherits(Demo3, _Component);
|
20611 |
|
20612 | function Demo3(props, context) {
|
20613 | _classCallCheck(this, Demo3);
|
20614 |
|
20615 | var _this = _possibleConstructorReturn(this, _Component.call(this, props, context));
|
20616 |
|
20617 | _this.handleClick = function (e) {
|
20618 | console.log('Clicked: ', e);
|
20619 | _this.setState({ current: e.key });
|
20620 | };
|
20621 |
|
20622 | _this.onOpenChange = function (openKeys) {
|
20623 | var state = _this.state;
|
20624 |
|
20625 | var latestOpenKey = _this.myfilter(openKeys, state.openKeys);
|
20626 | var latestCloseKey = _this.myfilter(state.openKeys, openKeys);
|
20627 |
|
20628 | var nextOpenKeys = [];
|
20629 | if (latestOpenKey) {
|
20630 | nextOpenKeys = _this.getAncestorKeys(latestOpenKey).concat(latestOpenKey);
|
20631 | }
|
20632 | if (latestCloseKey) {
|
20633 | nextOpenKeys = _this.getAncestorKeys(latestCloseKey);
|
20634 | }
|
20635 | _this.setState({ openKeys: nextOpenKeys });
|
20636 | };
|
20637 |
|
20638 | _this.myfilter = function (arr1, arr2) {
|
20639 | if (arr2.length === 0 || !arr2) {
|
20640 | return arr1[0];
|
20641 | }
|
20642 |
|
20643 | for (var i = 0; i < arr1.length; i++) {
|
20644 | if (arr2.indexOf(arr1[i].toString()) === -1) {
|
20645 | return arr1[i];
|
20646 | }
|
20647 | }
|
20648 | return false;
|
20649 | };
|
20650 |
|
20651 | _this.getAncestorKeys = function (key) {
|
20652 | var map = {
|
20653 | sub3: ['sub2']
|
20654 | };
|
20655 | return map[key] || [];
|
20656 | };
|
20657 |
|
20658 | _this.state = {
|
20659 | current: '1',
|
20660 | openKeys: []
|
20661 | };
|
20662 | return _this;
|
20663 | }
|
20664 |
|
20665 |
|
20666 |
|
20667 |
|
20668 | Demo3.prototype.render = function render() {
|
20669 | return _react2['default'].createElement(
|
20670 | 'div',
|
20671 | null,
|
20672 | _react2['default'].createElement('input', { style: { 'marginBottom': '10px' }, placeholder: '\u6211\u662F\u4E3A\u4E86\u83B7\u5F97\u7126\u70B9' }),
|
20673 | _react2['default'].createElement(
|
20674 | _src2['default'],
|
20675 | {
|
20676 | mode: 'inline', keyboard: true,
|
20677 | openKeys: this.state.openKeys,
|
20678 | selectedKeys: [this.state.current],
|
20679 | style: { width: 240 },
|
20680 | onOpenChange: this.onOpenChange,
|
20681 | onClick: this.handleClick },
|
20682 | _react2['default'].createElement(
|
20683 | SubMenu,
|
20684 | { key: 'sub1', title: _react2['default'].createElement(
|
20685 | 'span',
|
20686 | null,
|
20687 | _react2['default'].createElement(
|
20688 | 'span',
|
20689 | null,
|
20690 | '\u7EC4\u7EC7 1'
|
20691 | )
|
20692 | ) },
|
20693 | _react2['default'].createElement(
|
20694 | _src2['default'].Item,
|
20695 | { key: '1' },
|
20696 | '\u9009\u9879 1'
|
20697 | ),
|
20698 | _react2['default'].createElement(
|
20699 | _src2['default'].Item,
|
20700 | { key: '2' },
|
20701 | '\u9009\u9879 2'
|
20702 | ),
|
20703 | _react2['default'].createElement(
|
20704 | _src2['default'].Item,
|
20705 | { key: '3' },
|
20706 | '\u9009\u9879 3'
|
20707 | ),
|
20708 | _react2['default'].createElement(
|
20709 | _src2['default'].Item,
|
20710 | { key: '4' },
|
20711 | '\u9009\u9879 4'
|
20712 | )
|
20713 | ),
|
20714 | _react2['default'].createElement(
|
20715 | SubMenu,
|
20716 | { key: 'sub2', title: _react2['default'].createElement(
|
20717 | 'span',
|
20718 | null,
|
20719 | _react2['default'].createElement(
|
20720 | 'span',
|
20721 | null,
|
20722 | '\u7EC4\u7EC7 2'
|
20723 | )
|
20724 | ) },
|
20725 | _react2['default'].createElement(
|
20726 | _src2['default'].Item,
|
20727 | { key: '5' },
|
20728 | '\u9009\u9879 5'
|
20729 | ),
|
20730 | _react2['default'].createElement(
|
20731 | _src2['default'].Item,
|
20732 | { key: '6' },
|
20733 | '\u9009\u9879 6'
|
20734 | ),
|
20735 | _react2['default'].createElement(
|
20736 | SubMenu,
|
20737 | { key: 'sub3', title: '\u5B50\u9879' },
|
20738 | _react2['default'].createElement(
|
20739 | _src2['default'].Item,
|
20740 | { key: '7' },
|
20741 | '\u9009\u9879 7'
|
20742 | ),
|
20743 | _react2['default'].createElement(
|
20744 | _src2['default'].Item,
|
20745 | { key: '8' },
|
20746 | '\u9009\u9879 8'
|
20747 | )
|
20748 | )
|
20749 | ),
|
20750 | _react2['default'].createElement(
|
20751 | SubMenu,
|
20752 | { key: 'sub4', title: _react2['default'].createElement(
|
20753 | 'span',
|
20754 | null,
|
20755 | _react2['default'].createElement(
|
20756 | 'span',
|
20757 | null,
|
20758 | '\u7EC4\u7EC7 3'
|
20759 | )
|
20760 | ) },
|
20761 | _react2['default'].createElement(
|
20762 | _src2['default'].Item,
|
20763 | { key: '9' },
|
20764 | '\u9009\u9879 9'
|
20765 | ),
|
20766 | _react2['default'].createElement(
|
20767 | _src2['default'].Item,
|
20768 | { key: '10' },
|
20769 | '\u9009\u9879 10'
|
20770 | ),
|
20771 | _react2['default'].createElement(
|
20772 | _src2['default'].Item,
|
20773 | { key: '11' },
|
20774 | '\u9009\u9879 11'
|
20775 | ),
|
20776 | _react2['default'].createElement(
|
20777 | _src2['default'].Item,
|
20778 | { key: '12' },
|
20779 | '\u9009\u9879 12'
|
20780 | )
|
20781 | )
|
20782 | )
|
20783 | );
|
20784 | };
|
20785 |
|
20786 | return Demo3;
|
20787 | }(_react.Component);
|
20788 |
|
20789 | exports['default'] = Demo3;
|
20790 | module.exports = exports['default'];
|
20791 |
|
20792 | })
|
20793 | ]);
|
20794 |
|
\ | No newline at end of file |