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__(62);
|
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__(64);var Demo2 = __webpack_require__(75);var DemoArray = [{ "example": _react2['default'].createElement(Demo1, null), "title": " 不同颜色的消息提醒", "code": "/**\n *\n * @title 不同颜色的消息提醒\n * @description 提供10种颜色,包括黑色白色及四个语义色及四个浅语义色\n *\n */\n\nimport React, { Component } from 'react';\nimport { Message, Button, Panel , Con, Row, Col } from 'tinper-bee';\n\n const info = function () {\n let aa = Message.create({content: 'This is a Info message', color: 'info', duration: null});\n\n };\n const danger = function () {\n Message.create({content: 'This is a danger message', color: 'danger'});\n };\n const success = function () {\n Message.create({content: 'This is a success message', color: 'success'});\n };\n const warning = function () {\n Message.create({content: 'This is a warning message', color: 'warning'});\n };\n const loading = function () {\n Message.create({content: 'This is a dark message', color: 'dark'});\n };\n const light = function () {\n Message.create({content: 'This is a light message', color: 'light'});\n };\nclass Demo1 extends Component {\n constructor(props){\n super(props);\n }\n render () {\n return (\n <div className=\"paddingDemo\">\n <Button\n colors=\"info\"\n onClick={info}>\n info\n </Button>\n <Button\n colors=\"danger\"\n onClick={danger}>\n danger\n </Button>\n <Button\n colors=\"warning\"\n onClick={warning}>\n warning\n </Button>\n <Button\n colors=\"success\"\n onClick={success}>\n success\n </Button>\n <Button\n colors=\"primary\"\n onClick={loading}>\n dark\n </Button>\n <Button\n shape=\"border\"\n onClick={light}>\n light\n </Button>\n </div>\n )\n }\n}\n\n\n\n", "desc": " 提供10种颜色,包括黑色白色及四个语义色及四个浅语义色", "scss_code": ".paddingDemo{\n button{\n margin: 10px;\n }\n}" }, { "example": _react2['default'].createElement(Demo2, null), "title": " 不同显示位置的消息提醒", "code": "/**\n *\n * @title 不同显示位置的消息提醒\n * @description 一个页面的message只能设置一中显示位置,提供六种位置选择,查看每种示例,需每次刷新\n *\n */\n\nimport React, { Component } from 'react';\nimport { Message, Button, Panel , Con, Row, Col } from 'tinper-bee';\n\n const top = function () {\n Message.create({content: 'This is a Info message', position: 'top'});\n };\n const bottom = function () {\n Message.create({content: 'This is a Info message', position: 'bottom'});\n };\n const topRight = function () {\n Message.create({content: 'This is a Info message', position: 'topRight'});\n };\n const topLeft = function () {\n Message.create({content: 'This is a Info message', position: 'topLeft'});\n };\n const bottomRight = function () {\n Message.create({content: 'This is a Info message', position: 'bottomRight'});\n };\n const bottomLeft = function () {\n Message.create({content: 'This is a Info message', position: 'bottomLeft'});\n };\nclass Demo2 extends Component {\n constructor(props){\n super(props);\n }\n render () {\n return (\n <div className=\"paddingDemo\">\n <Button\n colors=\"info\"\n onClick={top}>\n top\n </Button>\n <Button\n colors=\"info\"\n onClick={bottom}>\n bottom\n </Button>\n <Button\n colors=\"info\"\n onClick={topRight}>\n topRight\n </Button>\n <Button\n colors=\"info\"\n onClick={topLeft}>\n topLeft\n </Button>\n <Button\n colors=\"info\"\n onClick={bottomRight}>\n bottomRight\n </Button>\n <Button\n colors=\"info\"\n onClick={bottomLeft}>\n bottomLeft\n </Button>\n </div>\n )\n }\n}\n\n\n", "desc": " 一个页面的message只能设置一中显示位置,提供六种位置选择,查看每种示例,需每次刷新", "scss_code": ".paddingDemo{\n button{\n margin: 10px;\n }\n}" }];
|
80 |
|
81 | var Demo = function (_Component) {
|
82 | _inherits(Demo, _Component);
|
83 |
|
84 | function Demo(props) {
|
85 | _classCallCheck(this, Demo);
|
86 |
|
87 | var _this = _possibleConstructorReturn(this, _Component.call(this, props));
|
88 |
|
89 | _this.state = {
|
90 | open: false
|
91 | };
|
92 | _this.handleClick = _this.handleClick.bind(_this);
|
93 | return _this;
|
94 | }
|
95 |
|
96 | Demo.prototype.handleClick = function handleClick() {
|
97 | this.setState({ open: !this.state.open });
|
98 | };
|
99 |
|
100 | Demo.prototype.render = function render() {
|
101 | var _props = this.props,
|
102 | title = _props.title,
|
103 | example = _props.example,
|
104 | code = _props.code,
|
105 | desc = _props.desc,
|
106 | scss_code = _props.scss_code;
|
107 |
|
108 | var caret = this.state.open ? CARETUP : CARET;
|
109 | var text = this.state.open ? "隐藏代码" : "查看代码";
|
110 |
|
111 | var header = _react2['default'].createElement(
|
112 | 'div',
|
113 | null,
|
114 | example,
|
115 | _react2['default'].createElement(
|
116 | _beeButton2['default'],
|
117 | { style: { "marginTop": "10px" }, shape: 'block', onClick: this.handleClick },
|
118 | caret,
|
119 | text
|
120 | )
|
121 | );
|
122 | return _react2['default'].createElement(
|
123 | _beeLayout.Col,
|
124 | { md: 12 },
|
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, footerStyle: { padding: 0 } },
|
138 | _react2['default'].createElement(
|
139 | 'pre',
|
140 | null,
|
141 | _react2['default'].createElement(
|
142 | 'code',
|
143 | { className: 'hljs javascript' },
|
144 | code
|
145 | )
|
146 | ),
|
147 | !!scss_code ? _react2['default'].createElement(
|
148 | 'pre',
|
149 | null,
|
150 | _react2['default'].createElement(
|
151 | 'code',
|
152 | { className: 'hljs css' },
|
153 | scss_code
|
154 | )
|
155 | ) : null
|
156 | )
|
157 | );
|
158 | };
|
159 |
|
160 | return Demo;
|
161 | }(_react.Component);
|
162 |
|
163 | var DemoGroup = function (_Component2) {
|
164 | _inherits(DemoGroup, _Component2);
|
165 |
|
166 | function DemoGroup(props) {
|
167 | _classCallCheck(this, DemoGroup);
|
168 |
|
169 | return _possibleConstructorReturn(this, _Component2.call(this, props));
|
170 | }
|
171 |
|
172 | DemoGroup.prototype.render = function render() {
|
173 | return _react2['default'].createElement(
|
174 | _beeLayout.Row,
|
175 | null,
|
176 | DemoArray.map(function (child, index) {
|
177 |
|
178 | return _react2['default'].createElement(Demo, { example: child.example, title: child.title, code: child.code, scss_code: child.scss_code, desc: child.desc, key: index });
|
179 | })
|
180 | );
|
181 | };
|
182 |
|
183 | return DemoGroup;
|
184 | }(_react.Component);
|
185 |
|
186 | _reactDom2['default'].render(_react2['default'].createElement(DemoGroup, null), document.getElementById('tinperBeeDemo'));
|
187 |
|
188 | }),
|
189 |
|
190 | (function(module, exports, __webpack_require__) {
|
191 |
|
192 | 'use strict';
|
193 |
|
194 | Object.defineProperty(exports, "__esModule", {
|
195 | value: true
|
196 | });
|
197 | exports.Con = exports.Row = exports.Col = undefined;
|
198 |
|
199 | var _Col2 = __webpack_require__(2);
|
200 |
|
201 | var _Col3 = _interopRequireDefault(_Col2);
|
202 |
|
203 | var _Row2 = __webpack_require__(6);
|
204 |
|
205 | var _Row3 = _interopRequireDefault(_Row2);
|
206 |
|
207 | var _Layout = __webpack_require__(7);
|
208 |
|
209 | var _Layout2 = _interopRequireDefault(_Layout);
|
210 |
|
211 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
212 |
|
213 | exports.Col = _Col3["default"];
|
214 | exports.Row = _Row3["default"];
|
215 | exports.Con = _Layout2["default"];
|
216 |
|
217 | }),
|
218 |
|
219 | (function(module, exports, __webpack_require__) {
|
220 |
|
221 | 'use strict';
|
222 |
|
223 | Object.defineProperty(exports, "__esModule", {
|
224 | value: true
|
225 | });
|
226 |
|
227 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
228 |
|
229 | var _classnames = __webpack_require__(3);
|
230 |
|
231 | var _classnames2 = _interopRequireDefault(_classnames);
|
232 |
|
233 | var _react = __webpack_require__(4);
|
234 |
|
235 | var _react2 = _interopRequireDefault(_react);
|
236 |
|
237 | var _propTypes = __webpack_require__(5);
|
238 |
|
239 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
240 |
|
241 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
242 |
|
243 | function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
|
244 |
|
245 | function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
246 |
|
247 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
248 |
|
249 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
250 |
|
251 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
|
252 |
|
253 | var propTypes = {
|
254 | componentClass: _propTypes2["default"].oneOfType([_propTypes2["default"].element, _propTypes2["default"].string]),
|
255 |
|
256 | |
257 |
|
258 |
|
259 | xs: _propTypes2["default"].number,
|
260 | |
261 |
|
262 |
|
263 | sm: _propTypes2["default"].number,
|
264 | |
265 |
|
266 |
|
267 | md: _propTypes2["default"].number,
|
268 | |
269 |
|
270 |
|
271 | lg: _propTypes2["default"].number,
|
272 | |
273 |
|
274 |
|
275 | xsOffset: _propTypes2["default"].number,
|
276 | |
277 |
|
278 |
|
279 | smOffset: _propTypes2["default"].number,
|
280 | |
281 |
|
282 |
|
283 | mdOffset: _propTypes2["default"].number,
|
284 | |
285 |
|
286 |
|
287 | lgOffset: _propTypes2["default"].number,
|
288 | |
289 |
|
290 |
|
291 | xsPush: _propTypes2["default"].number,
|
292 | |
293 |
|
294 |
|
295 | smPush: _propTypes2["default"].number,
|
296 | |
297 |
|
298 |
|
299 | mdPush: _propTypes2["default"].number,
|
300 | |
301 |
|
302 |
|
303 | lgPush: _propTypes2["default"].number,
|
304 | |
305 |
|
306 |
|
307 | xsPull: _propTypes2["default"].number,
|
308 | |
309 |
|
310 |
|
311 | smPull: _propTypes2["default"].number,
|
312 | |
313 |
|
314 |
|
315 | mdPull: _propTypes2["default"].number,
|
316 | |
317 |
|
318 |
|
319 | lgPull: _propTypes2["default"].number
|
320 | };
|
321 |
|
322 | var defaultProps = {
|
323 | componentClass: 'div',
|
324 | clsPrefix: 'u-col'
|
325 | };
|
326 |
|
327 | var DEVICE_SIZES = ['lg', 'md', 'sm', 'xs'];
|
328 |
|
329 | var Col = function (_Component) {
|
330 | _inherits(Col, _Component);
|
331 |
|
332 | function Col() {
|
333 | _classCallCheck(this, Col);
|
334 |
|
335 | return _possibleConstructorReturn(this, _Component.apply(this, arguments));
|
336 | }
|
337 |
|
338 | Col.prototype.render = function render() {
|
339 | var _props = this.props,
|
340 | Component = _props.componentClass,
|
341 | className = _props.className,
|
342 | clsPrefix = _props.clsPrefix,
|
343 | others = _objectWithoutProperties(_props, ['componentClass', 'className', 'clsPrefix']);
|
344 |
|
345 | var tbClass = [];
|
346 | |
347 |
|
348 |
|
349 |
|
350 | DEVICE_SIZES.forEach(function (size) {
|
351 | function popProp(propSuffix, modifier) {
|
352 | var propName = '' + size + propSuffix;
|
353 | var propValue = others[propName];
|
354 |
|
355 | if (propValue != undefined && propValue != null) {
|
356 | tbClass.push(clsPrefix + '-' + size + modifier + '-' + propValue);
|
357 | }
|
358 |
|
359 | delete others[propName];
|
360 | }
|
361 |
|
362 | popProp('', '');
|
363 | popProp('Offset', '-offset');
|
364 | popProp('Push', '-push');
|
365 | popProp('Pull', '-pull');
|
366 | });
|
367 |
|
368 | return _react2["default"].createElement(
|
369 | Component,
|
370 | _extends({
|
371 | className: (0, _classnames2["default"])(tbClass, className)
|
372 | }, others),
|
373 | this.props.children
|
374 | );
|
375 | };
|
376 |
|
377 | return Col;
|
378 | }(_react.Component);
|
379 |
|
380 | Col.defaultProps = defaultProps;
|
381 | Col.propTypes = propTypes;
|
382 |
|
383 | exports["default"] = Col;
|
384 | module.exports = exports['default'];
|
385 |
|
386 | }),
|
387 |
|
388 | (function(module, exports, __webpack_require__) {
|
389 |
|
390 | var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; |
391 |
|
392 |
|
393 |
|
394 |
|
395 |
|
396 |
|
397 | (function () {
|
398 | 'use strict';
|
399 |
|
400 | var hasOwn = {}.hasOwnProperty;
|
401 |
|
402 | function classNames () {
|
403 | var classes = [];
|
404 |
|
405 | for (var i = 0; i < arguments.length; i++) {
|
406 | var arg = arguments[i];
|
407 | if (!arg) continue;
|
408 |
|
409 | var argType = typeof arg;
|
410 |
|
411 | if (argType === 'string' || argType === 'number') {
|
412 | classes.push(arg);
|
413 | } else if (Array.isArray(arg)) {
|
414 | classes.push(classNames.apply(null, arg));
|
415 | } else if (argType === 'object') {
|
416 | for (var key in arg) {
|
417 | if (hasOwn.call(arg, key) && arg[key]) {
|
418 | classes.push(key);
|
419 | }
|
420 | }
|
421 | }
|
422 | }
|
423 |
|
424 | return classes.join(' ');
|
425 | }
|
426 |
|
427 | if (typeof module !== 'undefined' && module.exports) {
|
428 | module.exports = classNames;
|
429 | } else if (true) {
|
430 |
|
431 | !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () {
|
432 | return classNames;
|
433 | }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
434 | } else {
|
435 | window.classNames = classNames;
|
436 | }
|
437 | }());
|
438 |
|
439 |
|
440 | }),
|
441 |
|
442 | (function(module, exports) {
|
443 |
|
444 | module.exports = React;
|
445 |
|
446 | }),
|
447 |
|
448 | (function(module, exports) {
|
449 |
|
450 | module.exports = PropTypes;
|
451 |
|
452 | }),
|
453 |
|
454 | (function(module, exports, __webpack_require__) {
|
455 |
|
456 | 'use strict';
|
457 |
|
458 | Object.defineProperty(exports, "__esModule", {
|
459 | value: true
|
460 | });
|
461 |
|
462 | 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; };
|
463 |
|
464 | var _classnames = __webpack_require__(3);
|
465 |
|
466 | var _classnames2 = _interopRequireDefault(_classnames);
|
467 |
|
468 | var _react = __webpack_require__(4);
|
469 |
|
470 | var _react2 = _interopRequireDefault(_react);
|
471 |
|
472 | var _propTypes = __webpack_require__(5);
|
473 |
|
474 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
475 |
|
476 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
477 |
|
478 | 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; }
|
479 |
|
480 | 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; }
|
481 |
|
482 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
483 |
|
484 | 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; }
|
485 |
|
486 | 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); }
|
487 |
|
488 | var propTypes = {
|
489 | componentClass: _propTypes2["default"].oneOfType([_propTypes2["default"].element, _propTypes2["default"].string])
|
490 | };
|
491 |
|
492 | var defaultProps = {
|
493 | componentClass: 'div',
|
494 | clsPrefix: 'u-row'
|
495 | };
|
496 |
|
497 | var Row = function (_Component) {
|
498 | _inherits(Row, _Component);
|
499 |
|
500 | function Row() {
|
501 | _classCallCheck(this, Row);
|
502 |
|
503 | return _possibleConstructorReturn(this, _Component.apply(this, arguments));
|
504 | }
|
505 |
|
506 | Row.prototype.render = function render() {
|
507 | var _props = this.props,
|
508 | Component = _props.componentClass,
|
509 | clsPrefix = _props.clsPrefix,
|
510 | className = _props.className,
|
511 | others = _objectWithoutProperties(_props, ['componentClass', 'clsPrefix', 'className']);
|
512 |
|
513 | var bsclass = '' + clsPrefix;
|
514 |
|
515 | return _react2["default"].createElement(
|
516 | Component,
|
517 | _extends({}, others, {
|
518 | className: (0, _classnames2["default"])(bsclass, className)
|
519 | }),
|
520 | this.props.children
|
521 | );
|
522 | };
|
523 |
|
524 | return Row;
|
525 | }(_react.Component);
|
526 |
|
527 | Row.propTypes = propTypes;
|
528 | Row.defaultProps = defaultProps;
|
529 |
|
530 | exports["default"] = Row;
|
531 | module.exports = exports['default'];
|
532 |
|
533 | }),
|
534 |
|
535 | (function(module, exports, __webpack_require__) {
|
536 |
|
537 | 'use strict';
|
538 |
|
539 | Object.defineProperty(exports, "__esModule", {
|
540 | value: true
|
541 | });
|
542 |
|
543 | 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; };
|
544 |
|
545 | var _classnames = __webpack_require__(3);
|
546 |
|
547 | var _classnames2 = _interopRequireDefault(_classnames);
|
548 |
|
549 | var _react = __webpack_require__(4);
|
550 |
|
551 | var _react2 = _interopRequireDefault(_react);
|
552 |
|
553 | var _propTypes = __webpack_require__(5);
|
554 |
|
555 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
556 |
|
557 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
558 |
|
559 | 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; }
|
560 |
|
561 | 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; }
|
562 |
|
563 | 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; }
|
564 |
|
565 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
566 |
|
567 | 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; }
|
568 |
|
569 | 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); }
|
570 |
|
571 | var propTypes = {
|
572 | |
573 |
|
574 |
|
575 | fluid: _propTypes2["default"].bool,
|
576 | |
577 |
|
578 |
|
579 | componentClass: _propTypes2["default"].oneOfType([_propTypes2["default"].element, _propTypes2["default"].string])
|
580 | };
|
581 |
|
582 | var defaultProps = {
|
583 | componentClass: 'div',
|
584 | fluid: false,
|
585 | clsPrefix: 'u-container'
|
586 | };
|
587 |
|
588 | var Con = function (_React$Component) {
|
589 | _inherits(Con, _React$Component);
|
590 |
|
591 | function Con() {
|
592 | _classCallCheck(this, Con);
|
593 |
|
594 | return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
595 | }
|
596 |
|
597 | Con.prototype.render = function render() {
|
598 | var _tbclass;
|
599 |
|
600 | var _props = this.props,
|
601 | fluid = _props.fluid,
|
602 | Component = _props.componentClass,
|
603 | clsPrefix = _props.clsPrefix,
|
604 | className = _props.className,
|
605 | others = _objectWithoutProperties(_props, ['fluid', 'componentClass', 'clsPrefix', 'className']);
|
606 |
|
607 | var tbclass = (_tbclass = {}, _defineProperty(_tbclass, '' + clsPrefix, !fluid), _defineProperty(_tbclass, clsPrefix + '-fluid', fluid), _tbclass);
|
608 |
|
609 | return _react2["default"].createElement(
|
610 | Component,
|
611 | _extends({}, others, {
|
612 | className: (0, _classnames2["default"])(tbclass, className)
|
613 | }),
|
614 | this.props.children
|
615 | );
|
616 | };
|
617 |
|
618 | return Con;
|
619 | }(_react2["default"].Component);
|
620 |
|
621 | Con.propTypes = propTypes;
|
622 | Con.defaultProps = defaultProps;
|
623 |
|
624 | exports["default"] = Con;
|
625 | module.exports = exports['default'];
|
626 |
|
627 | }),
|
628 |
|
629 | (function(module, exports, __webpack_require__) {
|
630 |
|
631 | 'use strict';
|
632 |
|
633 | Object.defineProperty(exports, "__esModule", {
|
634 | value: true
|
635 | });
|
636 | exports.PanelGroup = exports.Panel = undefined;
|
637 |
|
638 | var _Panel2 = __webpack_require__(9);
|
639 |
|
640 | var _Panel3 = _interopRequireDefault(_Panel2);
|
641 |
|
642 | var _PanelGroup2 = __webpack_require__(61);
|
643 |
|
644 | var _PanelGroup3 = _interopRequireDefault(_PanelGroup2);
|
645 |
|
646 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
647 |
|
648 | exports.Panel = _Panel3["default"];
|
649 | exports.PanelGroup = _PanelGroup3["default"];
|
650 |
|
651 | }),
|
652 |
|
653 | (function(module, exports, __webpack_require__) {
|
654 |
|
655 | 'use strict';
|
656 |
|
657 | Object.defineProperty(exports, "__esModule", {
|
658 | value: true
|
659 | });
|
660 |
|
661 | 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; };
|
662 |
|
663 | var _classnames = __webpack_require__(3);
|
664 |
|
665 | var _classnames2 = _interopRequireDefault(_classnames);
|
666 |
|
667 | var _react = __webpack_require__(4);
|
668 |
|
669 | var _react2 = _interopRequireDefault(_react);
|
670 |
|
671 | var _beeTransition = __webpack_require__(10);
|
672 |
|
673 | var _propTypes = __webpack_require__(5);
|
674 |
|
675 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
676 |
|
677 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
678 |
|
679 | 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; }
|
680 |
|
681 | 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; }
|
682 |
|
683 | 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; }
|
684 |
|
685 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
686 |
|
687 | 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; }
|
688 |
|
689 | 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); }
|
690 |
|
691 | var propTypes = {
|
692 |
|
693 | collapsible: _propTypes2["default"].bool,
|
694 | onSelect: _propTypes2["default"].func,
|
695 |
|
696 | header: _propTypes2["default"].node,
|
697 | headerStyle: _propTypes2["default"].object,
|
698 | id: _propTypes2["default"].oneOfType([_propTypes2["default"].string, _propTypes2["default"].number]),
|
699 | headerContent: _propTypes2["default"].bool,
|
700 |
|
701 | footer: _propTypes2["default"].node,
|
702 | footerStyle: _propTypes2["default"].object,
|
703 |
|
704 | defaultExpanded: _propTypes2["default"].bool,
|
705 |
|
706 | expanded: _propTypes2["default"].bool,
|
707 |
|
708 | eventKey: _propTypes2["default"].any,
|
709 | headerRole: _propTypes2["default"].string,
|
710 | panelRole: _propTypes2["default"].string,
|
711 |
|
712 | colors: _propTypes2["default"].oneOf(['primary', 'accent', 'success', 'info', 'warning', 'danger', 'default', 'bordered']),
|
713 |
|
714 |
|
715 | onEnter: _propTypes2["default"].func,
|
716 | onEntering: _propTypes2["default"].func,
|
717 | onEntered: _propTypes2["default"].func,
|
718 | onExit: _propTypes2["default"].func,
|
719 | onExiting: _propTypes2["default"].func,
|
720 | onExited: _propTypes2["default"].func
|
721 | };
|
722 |
|
723 | var defaultProps = {
|
724 | defaultExpanded: false,
|
725 | clsPrefix: "u-panel",
|
726 | colors: "default"
|
727 | };
|
728 |
|
729 | var Panel = function (_React$Component) {
|
730 | _inherits(Panel, _React$Component);
|
731 |
|
732 | function Panel(props, context) {
|
733 | _classCallCheck(this, Panel);
|
734 |
|
735 | var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context));
|
736 |
|
737 | _this.handleClickTitle = _this.handleClickTitle.bind(_this);
|
738 |
|
739 | _this.state = {
|
740 | expanded: _this.props.defaultExpanded
|
741 | };
|
742 | return _this;
|
743 | }
|
744 |
|
745 |
|
746 |
|
747 |
|
748 | Panel.prototype.handleClickTitle = function handleClickTitle(e) {
|
749 |
|
750 | e.persist();
|
751 | e.selected = true;
|
752 |
|
753 | if (this.props.onSelect) {
|
754 | this.props.onSelect(this.props.eventKey, e);
|
755 | } else {
|
756 | e.preventDefault();
|
757 | }
|
758 |
|
759 | if (e.selected) {
|
760 | this.setState({ expanded: !this.state.expanded });
|
761 | }
|
762 | };
|
763 |
|
764 |
|
765 |
|
766 |
|
767 | Panel.prototype.renderHeader = function renderHeader(collapsible, header, id, role, expanded, clsPrefix) {
|
768 | var titleClassName = clsPrefix + '-title';
|
769 |
|
770 | if (!collapsible) {
|
771 | if (!_react2["default"].isValidElement(header)) {
|
772 | return header;
|
773 | }
|
774 |
|
775 | return (0, _react.cloneElement)(header, {
|
776 | className: (0, _classnames2["default"])(header.props.className, titleClassName)
|
777 | });
|
778 | }
|
779 |
|
780 | if (!_react2["default"].isValidElement(header)) {
|
781 | return _react2["default"].createElement(
|
782 | 'h4',
|
783 | { role: 'presentation', className: titleClassName },
|
784 | this.renderAnchor(header, id, role, expanded)
|
785 | );
|
786 | }
|
787 | if (this.props.headerContent) {
|
788 | return (0, _react.cloneElement)(header, {
|
789 | className: (0, _classnames2["default"])(header.props.className, titleClassName)
|
790 | });
|
791 | }
|
792 |
|
793 | return (0, _react.cloneElement)(header, {
|
794 | className: (0, _classnames2["default"])(header.props.className, titleClassName),
|
795 | children: this.renderAnchor(header.props.children, id, role, expanded)
|
796 | });
|
797 | };
|
798 |
|
799 |
|
800 |
|
801 |
|
802 | Panel.prototype.renderAnchor = function renderAnchor(header, id, role, expanded) {
|
803 | return _react2["default"].createElement(
|
804 | 'a',
|
805 | {
|
806 | role: role,
|
807 | href: id && '#' + id,
|
808 | 'aria-controls': id,
|
809 | 'aria-expanded': expanded,
|
810 | 'aria-selected': expanded,
|
811 | className: expanded ? null : 'collapsed'
|
812 | },
|
813 | header
|
814 | );
|
815 | };
|
816 |
|
817 |
|
818 |
|
819 |
|
820 | Panel.prototype.renderCollapsibleBody = function renderCollapsibleBody(id, expanded, role, children, clsPrefix, animationHooks) {
|
821 | return _react2["default"].createElement(
|
822 | _beeTransition.Collapse,
|
823 | _extends({ 'in': expanded }, animationHooks),
|
824 | _react2["default"].createElement(
|
825 | 'div',
|
826 | {
|
827 | id: id,
|
828 | role: role,
|
829 | className: clsPrefix + '-collapse',
|
830 | 'aria-hidden': !expanded
|
831 | },
|
832 | this.renderBody(children, clsPrefix)
|
833 | )
|
834 | );
|
835 | };
|
836 |
|
837 |
|
838 |
|
839 |
|
840 | Panel.prototype.renderBody = function renderBody(rawChildren, clsPrefix) {
|
841 | var children = [];
|
842 | var bodyChildren = [];
|
843 |
|
844 | var bodyClassName = clsPrefix + '-body';
|
845 |
|
846 |
|
847 | function maybeAddBody() {
|
848 | if (!bodyChildren.length) {
|
849 | return;
|
850 | }
|
851 |
|
852 |
|
853 | children.push(_react2["default"].createElement(
|
854 | 'div',
|
855 | { key: children.length, className: bodyClassName },
|
856 | bodyChildren
|
857 | ));
|
858 |
|
859 | bodyChildren = [];
|
860 | }
|
861 |
|
862 |
|
863 | _react2["default"].Children.toArray(rawChildren).forEach(function (child) {
|
864 | if (_react2["default"].isValidElement(child) && child.props.fill) {
|
865 | maybeAddBody();
|
866 |
|
867 |
|
868 | children.push((0, _react.cloneElement)(child, { fill: undefined }));
|
869 |
|
870 | return;
|
871 | }
|
872 |
|
873 | bodyChildren.push(child);
|
874 | });
|
875 |
|
876 | maybeAddBody();
|
877 |
|
878 | return children;
|
879 | };
|
880 |
|
881 | Panel.prototype.render = function render() {
|
882 | var _props = this.props,
|
883 | collapsible = _props.collapsible,
|
884 | header = _props.header,
|
885 | id = _props.id,
|
886 | footer = _props.footer,
|
887 | propsExpanded = _props.expanded,
|
888 | footerStyle = _props.footerStyle,
|
889 | headerStyle = _props.headerStyle,
|
890 | headerRole = _props.headerRole,
|
891 | panelRole = _props.panelRole,
|
892 | className = _props.className,
|
893 | colors = _props.colors,
|
894 | children = _props.children,
|
895 | onEnter = _props.onEnter,
|
896 | onEntering = _props.onEntering,
|
897 | onEntered = _props.onEntered,
|
898 | clsPrefix = _props.clsPrefix,
|
899 | onExit = _props.onExit,
|
900 | headerContent = _props.headerContent,
|
901 | onExiting = _props.onExiting,
|
902 | onExited = _props.onExited,
|
903 | defaultExpanded = _props.defaultExpanded,
|
904 | eventKey = _props.eventKey,
|
905 | onSelect = _props.onSelect,
|
906 | 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']);
|
907 |
|
908 | var expanded = propsExpanded != null ? propsExpanded : this.state.expanded;
|
909 |
|
910 | var classes = {};
|
911 | classes['' + clsPrefix] = true;
|
912 | classes[clsPrefix + '-' + colors] = true;
|
913 |
|
914 | var headerClass = _defineProperty({}, clsPrefix + '-heading', true);
|
915 |
|
916 | return _react2["default"].createElement(
|
917 | 'div',
|
918 | _extends({}, props, {
|
919 | className: (0, _classnames2["default"])(className, classes),
|
920 | id: collapsible ? null : id
|
921 | }),
|
922 | header && _react2["default"].createElement(
|
923 | 'div',
|
924 | { className: (0, _classnames2["default"])(headerClass), style: headerStyle, onClick: this.handleClickTitle },
|
925 | this.renderHeader(collapsible, header, id, headerRole, expanded, clsPrefix)
|
926 | ),
|
927 | collapsible ? this.renderCollapsibleBody(id, expanded, panelRole, children, clsPrefix, { onEnter: onEnter, onEntering: onEntering, onEntered: onEntered, onExit: onExit, onExiting: onExiting, onExited: onExited }) : this.renderBody(children, clsPrefix),
|
928 | footer && _react2["default"].createElement(
|
929 | 'div',
|
930 | { className: clsPrefix + '-footer', style: footerStyle },
|
931 | footer
|
932 | )
|
933 | );
|
934 | };
|
935 |
|
936 | return Panel;
|
937 | }(_react2["default"].Component);
|
938 |
|
939 | Panel.propTypes = propTypes;
|
940 | Panel.defaultProps = defaultProps;
|
941 |
|
942 | exports["default"] = Panel;
|
943 | module.exports = exports['default'];
|
944 |
|
945 | }),
|
946 |
|
947 | (function(module, exports, __webpack_require__) {
|
948 |
|
949 | 'use strict';
|
950 |
|
951 | Object.defineProperty(exports, "__esModule", {
|
952 | value: true
|
953 | });
|
954 | exports.Fade = exports.Collapse = exports.Transition = undefined;
|
955 |
|
956 | var _Transition2 = __webpack_require__(11);
|
957 |
|
958 | var _Transition3 = _interopRequireDefault(_Transition2);
|
959 |
|
960 | var _Collapse2 = __webpack_require__(16);
|
961 |
|
962 | var _Collapse3 = _interopRequireDefault(_Collapse2);
|
963 |
|
964 | var _Fade2 = __webpack_require__(60);
|
965 |
|
966 | var _Fade3 = _interopRequireDefault(_Fade2);
|
967 |
|
968 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
969 |
|
970 | exports.Transition = _Transition3["default"];
|
971 | exports.Collapse = _Collapse3["default"];
|
972 | exports.Fade = _Fade3["default"];
|
973 |
|
974 | }),
|
975 |
|
976 | (function(module, exports, __webpack_require__) {
|
977 |
|
978 | 'use strict';
|
979 |
|
980 | Object.defineProperty(exports, "__esModule", {
|
981 | value: true
|
982 | });
|
983 | exports.EXITING = exports.ENTERED = exports.ENTERING = exports.EXITED = exports.UNMOUNTED = undefined;
|
984 |
|
985 | 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; };
|
986 |
|
987 | var _react = __webpack_require__(4);
|
988 |
|
989 | var _react2 = _interopRequireDefault(_react);
|
990 |
|
991 | var _reactDom = __webpack_require__(12);
|
992 |
|
993 | var _reactDom2 = _interopRequireDefault(_reactDom);
|
994 |
|
995 | var _properties = __webpack_require__(13);
|
996 |
|
997 | var _properties2 = _interopRequireDefault(_properties);
|
998 |
|
999 | var _on = __webpack_require__(15);
|
1000 |
|
1001 | var _on2 = _interopRequireDefault(_on);
|
1002 |
|
1003 | var _classnames = __webpack_require__(3);
|
1004 |
|
1005 | var _classnames2 = _interopRequireDefault(_classnames);
|
1006 |
|
1007 | var _propTypes = __webpack_require__(5);
|
1008 |
|
1009 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
1010 |
|
1011 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
1012 |
|
1013 | 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; }
|
1014 |
|
1015 | 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; }
|
1016 |
|
1017 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
1018 |
|
1019 | 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; }
|
1020 |
|
1021 | 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); }
|
1022 |
|
1023 | var transitionEndEvent = _properties2["default"].end;
|
1024 |
|
1025 |
|
1026 | var UNMOUNTED = exports.UNMOUNTED = 0;
|
1027 | var EXITED = exports.EXITED = 1;
|
1028 | var ENTERING = exports.ENTERING = 2;
|
1029 | var ENTERED = exports.ENTERED = 3;
|
1030 | var EXITING = exports.EXITING = 4;
|
1031 |
|
1032 | var propTypes = {
|
1033 | |
1034 |
|
1035 |
|
1036 | "in": _propTypes2["default"].bool,
|
1037 |
|
1038 | |
1039 |
|
1040 |
|
1041 | unmountOnExit: _propTypes2["default"].bool,
|
1042 |
|
1043 | |
1044 |
|
1045 |
|
1046 | transitionAppear: _propTypes2["default"].bool,
|
1047 |
|
1048 | |
1049 |
|
1050 |
|
1051 | timeout: _propTypes2["default"].number,
|
1052 |
|
1053 | |
1054 |
|
1055 |
|
1056 | exitedClassName: _propTypes2["default"].string,
|
1057 | |
1058 |
|
1059 |
|
1060 | exitingClassName: _propTypes2["default"].string,
|
1061 | |
1062 |
|
1063 |
|
1064 | enteredClassName: _propTypes2["default"].string,
|
1065 | |
1066 |
|
1067 |
|
1068 | enteringClassName: _propTypes2["default"].string,
|
1069 |
|
1070 | |
1071 |
|
1072 |
|
1073 | onEnter: _propTypes2["default"].func,
|
1074 | |
1075 |
|
1076 |
|
1077 | onEntering: _propTypes2["default"].func,
|
1078 | |
1079 |
|
1080 |
|
1081 | onEntered: _propTypes2["default"].func,
|
1082 | |
1083 |
|
1084 |
|
1085 | onExit: _propTypes2["default"].func,
|
1086 | |
1087 |
|
1088 |
|
1089 | onExiting: _propTypes2["default"].func,
|
1090 | |
1091 |
|
1092 |
|
1093 | onExited: _propTypes2["default"].func
|
1094 | };
|
1095 |
|
1096 | function noop() {}
|
1097 |
|
1098 | var defaultProps = {
|
1099 | "in": false,
|
1100 | unmountOnExit: false,
|
1101 | transitionAppear: false,
|
1102 | timeout: 5000,
|
1103 | onEnter: noop,
|
1104 | onEntering: noop,
|
1105 | onEntered: noop,
|
1106 | onExit: noop,
|
1107 | onExiting: noop,
|
1108 | onExited: noop
|
1109 | };
|
1110 |
|
1111 | |
1112 |
|
1113 |
|
1114 |
|
1115 | var Transition = function (_Component) {
|
1116 | _inherits(Transition, _Component);
|
1117 |
|
1118 | function Transition(props, context) {
|
1119 | _classCallCheck(this, Transition);
|
1120 |
|
1121 | var _this = _possibleConstructorReturn(this, _Component.call(this, props, context));
|
1122 |
|
1123 | var initialStatus = void 0;
|
1124 | if (props["in"]) {
|
1125 |
|
1126 | initialStatus = props.transitionAppear ? EXITED : ENTERED;
|
1127 | } else {
|
1128 | initialStatus = props.unmountOnExit ? UNMOUNTED : EXITED;
|
1129 | }
|
1130 | _this.state = { status: initialStatus };
|
1131 |
|
1132 | _this.nextCallback = null;
|
1133 | return _this;
|
1134 | }
|
1135 |
|
1136 | Transition.prototype.componentDidMount = function componentDidMount() {
|
1137 | if (this.props.transitionAppear && this.props["in"]) {
|
1138 | this.performEnter(this.props);
|
1139 | }
|
1140 | };
|
1141 |
|
1142 | Transition.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
1143 | if (nextProps["in"] && this.props.unmountOnExit) {
|
1144 | if (this.state.status === UNMOUNTED) {
|
1145 |
|
1146 | this.setState({ status: EXITED });
|
1147 | }
|
1148 | } else {
|
1149 | this._needsUpdate = true;
|
1150 | }
|
1151 | };
|
1152 |
|
1153 | Transition.prototype.componentDidUpdate = function componentDidUpdate() {
|
1154 | var status = this.state.status;
|
1155 |
|
1156 | if (this.props.unmountOnExit && status === EXITED) {
|
1157 |
|
1158 | if (this.props["in"]) {
|
1159 | this.performEnter(this.props);
|
1160 | } else {
|
1161 | this.setState({ status: UNMOUNTED });
|
1162 | }
|
1163 |
|
1164 | return;
|
1165 | }
|
1166 |
|
1167 |
|
1168 | if (this._needsUpdate) {
|
1169 | this._needsUpdate = false;
|
1170 |
|
1171 | if (this.props["in"]) {
|
1172 | if (status === EXITING) {
|
1173 | this.performEnter(this.props);
|
1174 | } else if (status === EXITED) {
|
1175 | this.performEnter(this.props);
|
1176 | }
|
1177 |
|
1178 | } else {
|
1179 | if (status === ENTERING || status === ENTERED) {
|
1180 | this.performExit(this.props);
|
1181 | }
|
1182 |
|
1183 | }
|
1184 | }
|
1185 | };
|
1186 |
|
1187 | Transition.prototype.componentWillUnmount = function componentWillUnmount() {
|
1188 | this.cancelNextCallback();
|
1189 | };
|
1190 |
|
1191 | Transition.prototype.performEnter = function performEnter(props) {
|
1192 | var _this2 = this;
|
1193 |
|
1194 | this.cancelNextCallback();
|
1195 | var node = _reactDom2["default"].findDOMNode(this);
|
1196 |
|
1197 |
|
1198 | props.onEnter(node);
|
1199 |
|
1200 | this.safeSetState({ status: ENTERING }, function () {
|
1201 | _this2.props.onEntering(node);
|
1202 |
|
1203 | _this2.onTransitionEnd(node, function () {
|
1204 | _this2.safeSetState({ status: ENTERED }, function () {
|
1205 | _this2.props.onEntered(node);
|
1206 | });
|
1207 | });
|
1208 | });
|
1209 | };
|
1210 |
|
1211 | Transition.prototype.performExit = function performExit(props) {
|
1212 | var _this3 = this;
|
1213 |
|
1214 | this.cancelNextCallback();
|
1215 | var node = _reactDom2["default"].findDOMNode(this);
|
1216 |
|
1217 | props.onExit(node);
|
1218 |
|
1219 | this.safeSetState({ status: EXITING }, function () {
|
1220 | _this3.props.onExiting(node);
|
1221 |
|
1222 | _this3.onTransitionEnd(node, function () {
|
1223 | _this3.safeSetState({ status: EXITED }, function () {
|
1224 | _this3.props.onExited(node);
|
1225 | });
|
1226 | });
|
1227 | });
|
1228 | };
|
1229 |
|
1230 | Transition.prototype.cancelNextCallback = function cancelNextCallback() {
|
1231 | if (this.nextCallback !== null) {
|
1232 | this.nextCallback.cancel();
|
1233 | this.nextCallback = null;
|
1234 | }
|
1235 | };
|
1236 |
|
1237 | Transition.prototype.safeSetState = function safeSetState(nextState, callback) {
|
1238 |
|
1239 | this.setState(nextState, this.setNextCallback(callback));
|
1240 | };
|
1241 |
|
1242 | Transition.prototype.setNextCallback = function setNextCallback(callback) {
|
1243 | var _this4 = this;
|
1244 |
|
1245 | var active = true;
|
1246 |
|
1247 | this.nextCallback = function (event) {
|
1248 | if (active) {
|
1249 | active = false;
|
1250 | _this4.nextCallback = null;
|
1251 |
|
1252 | callback(event);
|
1253 | }
|
1254 | };
|
1255 |
|
1256 | this.nextCallback.cancel = function () {
|
1257 | active = false;
|
1258 | };
|
1259 |
|
1260 | return this.nextCallback;
|
1261 | };
|
1262 |
|
1263 | Transition.prototype.onTransitionEnd = function onTransitionEnd(node, handler) {
|
1264 | this.setNextCallback(handler);
|
1265 |
|
1266 | if (node) {
|
1267 | if (transitionEndEvent == undefined) {
|
1268 | this.nextCallback();
|
1269 | } else {
|
1270 | (0, _on2["default"])(node, transitionEndEvent, this.nextCallback);
|
1271 | }
|
1272 | setTimeout(this.nextCallback, this.props.timeout);
|
1273 | } else {
|
1274 | setTimeout(this.nextCallback, 0);
|
1275 | }
|
1276 | };
|
1277 |
|
1278 | Transition.prototype.render = function render() {
|
1279 | var status = this.state.status;
|
1280 | if (status === UNMOUNTED) {
|
1281 | return null;
|
1282 | }
|
1283 |
|
1284 | var _props = this.props,
|
1285 | children = _props.children,
|
1286 | className = _props.className,
|
1287 | childProps = _objectWithoutProperties(_props, ['children', 'className']);
|
1288 |
|
1289 | Object.keys(Transition.propTypes).forEach(function (key) {
|
1290 | return delete childProps[key];
|
1291 | });
|
1292 |
|
1293 | var transitionClassName = void 0;
|
1294 | if (status === EXITED) {
|
1295 | transitionClassName = this.props.exitedClassName;
|
1296 | } else if (status === ENTERING) {
|
1297 | transitionClassName = this.props.enteringClassName;
|
1298 | } else if (status === ENTERED) {
|
1299 | transitionClassName = this.props.enteredClassName;
|
1300 | } else if (status === EXITING) {
|
1301 | transitionClassName = this.props.exitingClassName;
|
1302 | }
|
1303 |
|
1304 | var child = _react2["default"].Children.only(children);
|
1305 | return _react2["default"].cloneElement(child, _extends({}, childProps, {
|
1306 | className: (0, _classnames2["default"])(child.props.className, className, transitionClassName)
|
1307 | }));
|
1308 | };
|
1309 |
|
1310 | return Transition;
|
1311 | }(_react.Component);
|
1312 |
|
1313 | Transition.propTypes = propTypes;
|
1314 |
|
1315 | Transition.defaultProps = defaultProps;
|
1316 |
|
1317 | exports["default"] = Transition;
|
1318 |
|
1319 | }),
|
1320 |
|
1321 | (function(module, exports) {
|
1322 |
|
1323 | module.exports = ReactDOM;
|
1324 |
|
1325 | }),
|
1326 |
|
1327 | (function(module, exports, __webpack_require__) {
|
1328 |
|
1329 | 'use strict';
|
1330 |
|
1331 | Object.defineProperty(exports, "__esModule", {
|
1332 | value: true
|
1333 | });
|
1334 | exports.animationEnd = exports.animationDelay = exports.animationTiming = exports.animationDuration = exports.animationName = exports.transitionEnd = exports.transitionDuration = exports.transitionDelay = exports.transitionTiming = exports.transitionProperty = exports.transform = undefined;
|
1335 |
|
1336 | var _inDOM = __webpack_require__(14);
|
1337 |
|
1338 | var _inDOM2 = _interopRequireDefault(_inDOM);
|
1339 |
|
1340 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
1341 |
|
1342 | var transform = 'transform';
|
1343 | var prefix = void 0,
|
1344 | transitionEnd = void 0,
|
1345 | animationEnd = void 0;
|
1346 | var transitionProperty = void 0,
|
1347 | transitionDuration = void 0,
|
1348 | transitionTiming = void 0,
|
1349 | transitionDelay = void 0;
|
1350 | var animationName = void 0,
|
1351 | animationDuration = void 0,
|
1352 | animationTiming = void 0,
|
1353 | animationDelay = void 0;
|
1354 |
|
1355 | if (_inDOM2.default) {
|
1356 | var _getTransitionPropert = getTransitionProperties();
|
1357 |
|
1358 | prefix = _getTransitionPropert.prefix;
|
1359 | exports.transitionEnd = transitionEnd = _getTransitionPropert.transitionEnd;
|
1360 | exports.animationEnd = animationEnd = _getTransitionPropert.animationEnd;
|
1361 |
|
1362 |
|
1363 | exports.transform = transform = prefix + '-' + transform;
|
1364 | exports.transitionProperty = transitionProperty = prefix + '-transition-property';
|
1365 | exports.transitionDuration = transitionDuration = prefix + '-transition-duration';
|
1366 | exports.transitionDelay = transitionDelay = prefix + '-transition-delay';
|
1367 | exports.transitionTiming = transitionTiming = prefix + '-transition-timing-function';
|
1368 |
|
1369 | exports.animationName = animationName = prefix + '-animation-name';
|
1370 | exports.animationDuration = animationDuration = prefix + '-animation-duration';
|
1371 | exports.animationTiming = animationTiming = prefix + '-animation-delay';
|
1372 | exports.animationDelay = animationDelay = prefix + '-animation-timing-function';
|
1373 | }
|
1374 |
|
1375 | exports.transform = transform;
|
1376 | exports.transitionProperty = transitionProperty;
|
1377 | exports.transitionTiming = transitionTiming;
|
1378 | exports.transitionDelay = transitionDelay;
|
1379 | exports.transitionDuration = transitionDuration;
|
1380 | exports.transitionEnd = transitionEnd;
|
1381 | exports.animationName = animationName;
|
1382 | exports.animationDuration = animationDuration;
|
1383 | exports.animationTiming = animationTiming;
|
1384 | exports.animationDelay = animationDelay;
|
1385 | exports.animationEnd = animationEnd;
|
1386 | exports.default = {
|
1387 | transform: transform,
|
1388 | end: transitionEnd,
|
1389 | property: transitionProperty,
|
1390 | timing: transitionTiming,
|
1391 | delay: transitionDelay,
|
1392 | duration: transitionDuration
|
1393 | };
|
1394 |
|
1395 |
|
1396 | function getTransitionProperties() {
|
1397 | var style = document.createElement('div').style;
|
1398 |
|
1399 | var vendorMap = {
|
1400 | O: function O(e) {
|
1401 | return 'o' + e.toLowerCase();
|
1402 | },
|
1403 | Moz: function Moz(e) {
|
1404 | return e.toLowerCase();
|
1405 | },
|
1406 | Webkit: function Webkit(e) {
|
1407 | return 'webkit' + e;
|
1408 | },
|
1409 | ms: function ms(e) {
|
1410 | return 'MS' + e;
|
1411 | }
|
1412 | };
|
1413 |
|
1414 | var vendors = Object.keys(vendorMap);
|
1415 |
|
1416 | var transitionEnd = void 0,
|
1417 | animationEnd = void 0;
|
1418 | var prefix = '';
|
1419 |
|
1420 | for (var i = 0; i < vendors.length; i++) {
|
1421 | var vendor = vendors[i];
|
1422 |
|
1423 | if (vendor + 'TransitionProperty' in style) {
|
1424 | prefix = '-' + vendor.toLowerCase();
|
1425 | transitionEnd = vendorMap[vendor]('TransitionEnd');
|
1426 | animationEnd = vendorMap[vendor]('AnimationEnd');
|
1427 | break;
|
1428 | }
|
1429 | }
|
1430 |
|
1431 | if (!transitionEnd && 'transitionProperty' in style) transitionEnd = 'transitionend';
|
1432 |
|
1433 | if (!animationEnd && 'animationName' in style) animationEnd = 'animationend';
|
1434 |
|
1435 | style = null;
|
1436 |
|
1437 | return { animationEnd: animationEnd, transitionEnd: transitionEnd, prefix: prefix };
|
1438 | }
|
1439 |
|
1440 | }),
|
1441 |
|
1442 | (function(module, exports) {
|
1443 |
|
1444 | 'use strict';
|
1445 |
|
1446 | Object.defineProperty(exports, "__esModule", {
|
1447 | value: true
|
1448 | });
|
1449 | exports.default = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
1450 | module.exports = exports['default'];
|
1451 |
|
1452 | }),
|
1453 |
|
1454 | (function(module, exports, __webpack_require__) {
|
1455 |
|
1456 | 'use strict';
|
1457 |
|
1458 | Object.defineProperty(exports, "__esModule", {
|
1459 | value: true
|
1460 | });
|
1461 |
|
1462 | var _inDOM = __webpack_require__(14);
|
1463 |
|
1464 | var _inDOM2 = _interopRequireDefault(_inDOM);
|
1465 |
|
1466 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
1467 |
|
1468 | var on = function on() {};
|
1469 | if (_inDOM2.default) {
|
1470 | on = function () {
|
1471 |
|
1472 | if (document.addEventListener) return function (node, eventName, handler, capture) {
|
1473 | return node.addEventListener(eventName, handler, capture || false);
|
1474 | };else if (document.attachEvent) return function (node, eventName, handler) {
|
1475 | return node.attachEvent('on' + eventName, function (e) {
|
1476 | e = e || window.event;
|
1477 | e.target = e.target || e.srcElement;
|
1478 | e.currentTarget = node;
|
1479 | handler.call(node, e);
|
1480 | });
|
1481 | };
|
1482 | }();
|
1483 | }
|
1484 |
|
1485 | exports.default = on;
|
1486 | module.exports = exports['default'];
|
1487 |
|
1488 | }),
|
1489 |
|
1490 | (function(module, exports, __webpack_require__) {
|
1491 |
|
1492 | 'use strict';
|
1493 |
|
1494 | Object.defineProperty(exports, "__esModule", {
|
1495 | value: true
|
1496 | });
|
1497 |
|
1498 | 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; };
|
1499 |
|
1500 | var _classnames = __webpack_require__(3);
|
1501 |
|
1502 | var _classnames2 = _interopRequireDefault(_classnames);
|
1503 |
|
1504 | var _style = __webpack_require__(17);
|
1505 |
|
1506 | var _style2 = _interopRequireDefault(_style);
|
1507 |
|
1508 | var _react = __webpack_require__(4);
|
1509 |
|
1510 | var _react2 = _interopRequireDefault(_react);
|
1511 |
|
1512 | var _propTypes = __webpack_require__(5);
|
1513 |
|
1514 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
1515 |
|
1516 | var _Transition = __webpack_require__(11);
|
1517 |
|
1518 | var _Transition2 = _interopRequireDefault(_Transition);
|
1519 |
|
1520 | var _capitalize = __webpack_require__(25);
|
1521 |
|
1522 | var _capitalize2 = _interopRequireDefault(_capitalize);
|
1523 |
|
1524 | var _tinperBeeCore = __webpack_require__(26);
|
1525 |
|
1526 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
1527 |
|
1528 | 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; }
|
1529 |
|
1530 | 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; }
|
1531 |
|
1532 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
1533 |
|
1534 | 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; }
|
1535 |
|
1536 | 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); }
|
1537 |
|
1538 | var MARGINS = {
|
1539 | height: ['marginTop', 'marginBottom'],
|
1540 | width: ['marginLeft', 'marginRight']
|
1541 | };
|
1542 |
|
1543 |
|
1544 |
|
1545 | function triggerBrowserReflow(node) {
|
1546 | node.offsetHeight;
|
1547 | }
|
1548 |
|
1549 | function getDimensionValue(dimension, elem) {
|
1550 | var value = elem['offset' + (0, _capitalize2["default"])(dimension)];
|
1551 | var margins = MARGINS[dimension];
|
1552 |
|
1553 | return value + parseInt((0, _style2["default"])(elem, margins[0]), 10) + parseInt((0, _style2["default"])(elem, margins[1]), 10);
|
1554 | }
|
1555 |
|
1556 | var propTypes = {
|
1557 | |
1558 |
|
1559 |
|
1560 | "in": _propTypes2["default"].bool,
|
1561 |
|
1562 | |
1563 |
|
1564 |
|
1565 | unmountOnExit: _propTypes2["default"].bool,
|
1566 |
|
1567 | |
1568 |
|
1569 |
|
1570 |
|
1571 | transitionAppear: _propTypes2["default"].bool,
|
1572 |
|
1573 | |
1574 |
|
1575 |
|
1576 |
|
1577 |
|
1578 | timeout: _propTypes2["default"].number,
|
1579 |
|
1580 | |
1581 |
|
1582 |
|
1583 | onEnter: _propTypes2["default"].func,
|
1584 | |
1585 |
|
1586 |
|
1587 | onEntering: _propTypes2["default"].func,
|
1588 | |
1589 |
|
1590 |
|
1591 | onEntered: _propTypes2["default"].func,
|
1592 | |
1593 |
|
1594 |
|
1595 | onExit: _propTypes2["default"].func,
|
1596 | |
1597 |
|
1598 |
|
1599 | onExiting: _propTypes2["default"].func,
|
1600 | |
1601 |
|
1602 |
|
1603 | onExited: _propTypes2["default"].func,
|
1604 |
|
1605 | |
1606 |
|
1607 |
|
1608 |
|
1609 |
|
1610 |
|
1611 |
|
1612 | dimension: _propTypes2["default"].oneOfType([_propTypes2["default"].oneOf(['height', 'width']), _propTypes2["default"].func]),
|
1613 |
|
1614 | |
1615 |
|
1616 |
|
1617 |
|
1618 |
|
1619 |
|
1620 |
|
1621 | getDimensionValue: _propTypes2["default"].func,
|
1622 |
|
1623 | |
1624 |
|
1625 |
|
1626 | role: _propTypes2["default"].string
|
1627 | };
|
1628 |
|
1629 | var defaultProps = {
|
1630 | "in": false,
|
1631 | timeout: 300,
|
1632 | unmountOnExit: false,
|
1633 | transitionAppear: false,
|
1634 |
|
1635 | dimension: 'height',
|
1636 | getDimensionValue: getDimensionValue
|
1637 | };
|
1638 |
|
1639 | var Collapse = function (_React$Component) {
|
1640 | _inherits(Collapse, _React$Component);
|
1641 |
|
1642 | function Collapse(props, context) {
|
1643 | _classCallCheck(this, Collapse);
|
1644 |
|
1645 | var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context));
|
1646 |
|
1647 | _this.handleEnter = _this.handleEnter.bind(_this);
|
1648 | _this.handleEntering = _this.handleEntering.bind(_this);
|
1649 | _this.handleEntered = _this.handleEntered.bind(_this);
|
1650 | _this.handleExit = _this.handleExit.bind(_this);
|
1651 | _this.handleExiting = _this.handleExiting.bind(_this);
|
1652 | return _this;
|
1653 | }
|
1654 |
|
1655 |
|
1656 |
|
1657 |
|
1658 | Collapse.prototype.handleEnter = function handleEnter(elem) {
|
1659 | var dimension = this._dimension();
|
1660 | elem.style[dimension] = '0';
|
1661 | };
|
1662 |
|
1663 | Collapse.prototype.handleEntering = function handleEntering(elem) {
|
1664 | var dimension = this._dimension();
|
1665 | elem.style[dimension] = this._getScrollDimensionValue(elem, dimension);
|
1666 | };
|
1667 |
|
1668 | Collapse.prototype.handleEntered = function handleEntered(elem) {
|
1669 | var dimension = this._dimension();
|
1670 | elem.style[dimension] = null;
|
1671 | };
|
1672 |
|
1673 |
|
1674 |
|
1675 |
|
1676 | Collapse.prototype.handleExit = function handleExit(elem) {
|
1677 | var dimension = this._dimension();
|
1678 | elem.style[dimension] = this.props.getDimensionValue(dimension, elem) + 'px';
|
1679 | triggerBrowserReflow(elem);
|
1680 | };
|
1681 |
|
1682 | Collapse.prototype.handleExiting = function handleExiting(elem) {
|
1683 | var dimension = this._dimension();
|
1684 | elem.style[dimension] = '0';
|
1685 | };
|
1686 |
|
1687 | Collapse.prototype._dimension = function _dimension() {
|
1688 | return typeof this.props.dimension === 'function' ? this.props.dimension() : this.props.dimension;
|
1689 | };
|
1690 |
|
1691 |
|
1692 |
|
1693 |
|
1694 | Collapse.prototype._getScrollDimensionValue = function _getScrollDimensionValue(elem, dimension) {
|
1695 | return elem['scroll' + (0, _capitalize2["default"])(dimension)] + 'px';
|
1696 | };
|
1697 |
|
1698 | Collapse.prototype.render = function render() {
|
1699 | var _props = this.props,
|
1700 | onEnter = _props.onEnter,
|
1701 | onEntering = _props.onEntering,
|
1702 | onEntered = _props.onEntered,
|
1703 | onExit = _props.onExit,
|
1704 | onExiting = _props.onExiting,
|
1705 | className = _props.className,
|
1706 | props = _objectWithoutProperties(_props, ['onEnter', 'onEntering', 'onEntered', 'onExit', 'onExiting', 'className']);
|
1707 |
|
1708 | delete props.dimension;
|
1709 | delete props.getDimensionValue;
|
1710 |
|
1711 | var handleEnter = (0, _tinperBeeCore.createChainedFunction)(this.handleEnter, onEnter);
|
1712 | var handleEntering = (0, _tinperBeeCore.createChainedFunction)(this.handleEntering, onEntering);
|
1713 | var handleEntered = (0, _tinperBeeCore.createChainedFunction)(this.handleEntered, onEntered);
|
1714 | var handleExit = (0, _tinperBeeCore.createChainedFunction)(this.handleExit, onExit);
|
1715 | var handleExiting = (0, _tinperBeeCore.createChainedFunction)(this.handleExiting, onExiting);
|
1716 |
|
1717 | var classes = {
|
1718 | width: this._dimension() === 'width'
|
1719 | };
|
1720 |
|
1721 | return _react2["default"].createElement(_Transition2["default"], _extends({}, props, {
|
1722 | 'aria-expanded': props.role ? props["in"] : null,
|
1723 | className: (0, _classnames2["default"])(className, classes),
|
1724 | exitedClassName: 'collapse',
|
1725 | exitingClassName: 'collapsing',
|
1726 | enteredClassName: 'collapse in',
|
1727 | enteringClassName: 'collapsing',
|
1728 | onEnter: handleEnter,
|
1729 | onEntering: handleEntering,
|
1730 | onEntered: handleEntered,
|
1731 | onExit: handleExit,
|
1732 | onExiting: handleExiting
|
1733 | }));
|
1734 | };
|
1735 |
|
1736 | return Collapse;
|
1737 | }(_react2["default"].Component);
|
1738 |
|
1739 | Collapse.propTypes = propTypes;
|
1740 | Collapse.defaultProps = defaultProps;
|
1741 |
|
1742 | exports["default"] = Collapse;
|
1743 | module.exports = exports['default'];
|
1744 |
|
1745 | }),
|
1746 |
|
1747 | (function(module, exports, __webpack_require__) {
|
1748 |
|
1749 | 'use strict';
|
1750 |
|
1751 | Object.defineProperty(exports, "__esModule", {
|
1752 | value: true
|
1753 | });
|
1754 | exports.default = style;
|
1755 |
|
1756 | var _camelizeStyle = __webpack_require__(18);
|
1757 |
|
1758 | var _camelizeStyle2 = _interopRequireDefault(_camelizeStyle);
|
1759 |
|
1760 | var _hyphenateStyle = __webpack_require__(20);
|
1761 |
|
1762 | var _hyphenateStyle2 = _interopRequireDefault(_hyphenateStyle);
|
1763 |
|
1764 | var _getComputedStyle2 = __webpack_require__(22);
|
1765 |
|
1766 | var _getComputedStyle3 = _interopRequireDefault(_getComputedStyle2);
|
1767 |
|
1768 | var _removeStyle = __webpack_require__(23);
|
1769 |
|
1770 | var _removeStyle2 = _interopRequireDefault(_removeStyle);
|
1771 |
|
1772 | var _properties = __webpack_require__(13);
|
1773 |
|
1774 | var _isTransform = __webpack_require__(24);
|
1775 |
|
1776 | var _isTransform2 = _interopRequireDefault(_isTransform);
|
1777 |
|
1778 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
1779 |
|
1780 | function style(node, property, value) {
|
1781 | var css = '';
|
1782 | var transforms = '';
|
1783 | var props = property;
|
1784 |
|
1785 | if (typeof property === 'string') {
|
1786 | if (value === undefined) {
|
1787 | return node.style[(0, _camelizeStyle2.default)(property)] || (0, _getComputedStyle3.default)(node).getPropertyValue((0, _hyphenateStyle2.default)(property));
|
1788 | } else {
|
1789 | (props = {})[property] = value;
|
1790 | }
|
1791 | }
|
1792 |
|
1793 | Object.keys(props).forEach(function (key) {
|
1794 | var value = props[key];
|
1795 | if (!value && value !== 0) {
|
1796 | (0, _removeStyle2.default)(node, (0, _hyphenateStyle2.default)(key));
|
1797 | } else if ((0, _isTransform2.default)(key)) {
|
1798 | transforms += key + '(' + value + ') ';
|
1799 | } else {
|
1800 | css += (0, _hyphenateStyle2.default)(key) + ': ' + value + ';';
|
1801 | }
|
1802 | });
|
1803 |
|
1804 | if (transforms) {
|
1805 | css += _properties.transform + ': ' + transforms + ';';
|
1806 | }
|
1807 |
|
1808 | node.style.cssText += ';' + css;
|
1809 | }
|
1810 | module.exports = exports['default'];
|
1811 |
|
1812 | }),
|
1813 |
|
1814 | (function(module, exports, __webpack_require__) {
|
1815 |
|
1816 | 'use strict';
|
1817 |
|
1818 | Object.defineProperty(exports, "__esModule", {
|
1819 | value: true
|
1820 | });
|
1821 | exports.default = camelizeStyleName;
|
1822 |
|
1823 | var _camelize = __webpack_require__(19);
|
1824 |
|
1825 | var _camelize2 = _interopRequireDefault(_camelize);
|
1826 |
|
1827 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
1828 |
|
1829 | var msPattern = /^-ms-/; |
1830 |
|
1831 |
|
1832 |
|
1833 |
|
1834 | function camelizeStyleName(string) {
|
1835 | return (0, _camelize2.default)(string.replace(msPattern, 'ms-'));
|
1836 | }
|
1837 | module.exports = exports['default'];
|
1838 |
|
1839 | }),
|
1840 |
|
1841 | (function(module, exports) {
|
1842 |
|
1843 | "use strict";
|
1844 |
|
1845 | Object.defineProperty(exports, "__esModule", {
|
1846 | value: true
|
1847 | });
|
1848 | exports.default = camelize;
|
1849 | var rHyphen = /-(.)/g;
|
1850 |
|
1851 | function camelize(string) {
|
1852 | return string.replace(rHyphen, function (_, chr) {
|
1853 | return chr.toUpperCase();
|
1854 | });
|
1855 | }
|
1856 | module.exports = exports["default"];
|
1857 |
|
1858 | }),
|
1859 |
|
1860 | (function(module, exports, __webpack_require__) {
|
1861 |
|
1862 | 'use strict';
|
1863 |
|
1864 | Object.defineProperty(exports, "__esModule", {
|
1865 | value: true
|
1866 | });
|
1867 | exports.default = hyphenateStyleName;
|
1868 |
|
1869 | var _hyphenate = __webpack_require__(21);
|
1870 |
|
1871 | var _hyphenate2 = _interopRequireDefault(_hyphenate);
|
1872 |
|
1873 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
1874 |
|
1875 | var msPattern = /^ms-/; |
1876 |
|
1877 |
|
1878 |
|
1879 |
|
1880 |
|
1881 | function hyphenateStyleName(string) {
|
1882 | return (0, _hyphenate2.default)(string).replace(msPattern, '-ms-');
|
1883 | }
|
1884 | module.exports = exports['default'];
|
1885 |
|
1886 | }),
|
1887 |
|
1888 | (function(module, exports) {
|
1889 |
|
1890 | 'use strict';
|
1891 |
|
1892 | Object.defineProperty(exports, "__esModule", {
|
1893 | value: true
|
1894 | });
|
1895 | exports.default = hyphenate;
|
1896 |
|
1897 | var rUpper = /([A-Z])/g;
|
1898 |
|
1899 | function hyphenate(string) {
|
1900 | return string.replace(rUpper, '-$1').toLowerCase();
|
1901 | }
|
1902 | module.exports = exports['default'];
|
1903 |
|
1904 | }),
|
1905 |
|
1906 | (function(module, exports, __webpack_require__) {
|
1907 |
|
1908 | 'use strict';
|
1909 |
|
1910 | Object.defineProperty(exports, "__esModule", {
|
1911 | value: true
|
1912 | });
|
1913 | exports.default = _getComputedStyle;
|
1914 |
|
1915 | var _camelizeStyle = __webpack_require__(18);
|
1916 |
|
1917 | var _camelizeStyle2 = _interopRequireDefault(_camelizeStyle);
|
1918 |
|
1919 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
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 |
|
1928 | return 'defaultView' in doc ? doc.defaultView.opener ? node.ownerDocument.defaultView.getComputedStyle(node, null) : window.getComputedStyle(node, null) : {
|
1929 |
|
1930 | getPropertyValue: function getPropertyValue(prop) {
|
1931 | var style = node.style;
|
1932 |
|
1933 | prop = (0, _camelizeStyle2.default)(prop);
|
1934 |
|
1935 | if (prop == 'float') prop = 'styleFloat';
|
1936 |
|
1937 | var current = node.currentStyle[prop] || null;
|
1938 |
|
1939 | if (current == null && style && style[prop]) current = style[prop];
|
1940 |
|
1941 | if (rnumnonpx.test(current) && !rposition.test(prop)) {
|
1942 |
|
1943 | var left = style.left;
|
1944 | var runStyle = node.runtimeStyle;
|
1945 | var rsLeft = runStyle && runStyle.left;
|
1946 |
|
1947 |
|
1948 | if (rsLeft) runStyle.left = node.currentStyle.left;
|
1949 |
|
1950 | style.left = prop === 'fontSize' ? '1em' : current;
|
1951 | current = style.pixelLeft + 'px';
|
1952 |
|
1953 |
|
1954 | style.left = left;
|
1955 | if (rsLeft) runStyle.left = rsLeft;
|
1956 | }
|
1957 |
|
1958 | return current;
|
1959 | }
|
1960 | };
|
1961 | }
|
1962 | module.exports = exports['default'];
|
1963 |
|
1964 | }),
|
1965 |
|
1966 | (function(module, exports) {
|
1967 |
|
1968 | 'use strict';
|
1969 |
|
1970 | Object.defineProperty(exports, "__esModule", {
|
1971 | value: true
|
1972 | });
|
1973 | exports.default = removeStyle;
|
1974 | function removeStyle(node, key) {
|
1975 | return 'removeProperty' in node.style ? node.style.removeProperty(key) : node.style.removeAttribute(key);
|
1976 | }
|
1977 | module.exports = exports['default'];
|
1978 |
|
1979 | }),
|
1980 |
|
1981 | (function(module, exports) {
|
1982 |
|
1983 | "use strict";
|
1984 |
|
1985 | Object.defineProperty(exports, "__esModule", {
|
1986 | value: true
|
1987 | });
|
1988 | exports.default = isTransform;
|
1989 | var supportedTransforms = /^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;
|
1990 |
|
1991 | function isTransform(property) {
|
1992 | return !!(property && supportedTransforms.test(property));
|
1993 | }
|
1994 | module.exports = exports["default"];
|
1995 |
|
1996 | }),
|
1997 |
|
1998 | (function(module, exports) {
|
1999 |
|
2000 | "use strict";
|
2001 |
|
2002 | Object.defineProperty(exports, "__esModule", {
|
2003 | value: true
|
2004 | });
|
2005 | exports["default"] = capitalize;
|
2006 | function capitalize(string) {
|
2007 | return "" + string.charAt(0).toUpperCase() + string.slice(1);
|
2008 | }
|
2009 | module.exports = exports["default"];
|
2010 |
|
2011 | }),
|
2012 |
|
2013 | (function(module, exports, __webpack_require__) {
|
2014 |
|
2015 | 'use strict';
|
2016 |
|
2017 | exports.__esModule = true;
|
2018 | 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;
|
2019 |
|
2020 | var _all2 = __webpack_require__(27);
|
2021 |
|
2022 | var _all3 = _interopRequireDefault(_all2);
|
2023 |
|
2024 | var _componentOrElement2 = __webpack_require__(29);
|
2025 |
|
2026 | var _componentOrElement3 = _interopRequireDefault(_componentOrElement2);
|
2027 |
|
2028 | var _deprecated2 = __webpack_require__(30);
|
2029 |
|
2030 | var _deprecated3 = _interopRequireDefault(_deprecated2);
|
2031 |
|
2032 | var _elementType2 = __webpack_require__(33);
|
2033 |
|
2034 | var _elementType3 = _interopRequireDefault(_elementType2);
|
2035 |
|
2036 | var _isRequiredForA11y2 = __webpack_require__(34);
|
2037 |
|
2038 | var _isRequiredForA11y3 = _interopRequireDefault(_isRequiredForA11y2);
|
2039 |
|
2040 | var _splitComponent2 = __webpack_require__(35);
|
2041 |
|
2042 | var _splitComponent3 = _interopRequireDefault(_splitComponent2);
|
2043 |
|
2044 | var _createChainedFunction2 = __webpack_require__(36);
|
2045 |
|
2046 | var _createChainedFunction3 = _interopRequireDefault(_createChainedFunction2);
|
2047 |
|
2048 | var _keyCode = __webpack_require__(37);
|
2049 |
|
2050 | var _keyCode2 = _interopRequireDefault(_keyCode);
|
2051 |
|
2052 | var _contains2 = __webpack_require__(38);
|
2053 |
|
2054 | var _contains3 = _interopRequireDefault(_contains2);
|
2055 |
|
2056 | var _addEventListener2 = __webpack_require__(39);
|
2057 |
|
2058 | var _addEventListener3 = _interopRequireDefault(_addEventListener2);
|
2059 |
|
2060 | var _cssAnimation2 = __webpack_require__(44);
|
2061 |
|
2062 | var _cssAnimation3 = _interopRequireDefault(_cssAnimation2);
|
2063 |
|
2064 | var _toArray2 = __webpack_require__(48);
|
2065 |
|
2066 | var _toArray3 = _interopRequireDefault(_toArray2);
|
2067 |
|
2068 | var _Align2 = __webpack_require__(49);
|
2069 |
|
2070 | var _Align3 = _interopRequireDefault(_Align2);
|
2071 |
|
2072 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
2073 |
|
2074 | exports.all = _all3.default;
|
2075 | exports.componentOrElement = _componentOrElement3.default;
|
2076 | exports.deprecated = _deprecated3.default;
|
2077 | exports.elementType = _elementType3.default;
|
2078 | exports.isRequiredForA11y = _isRequiredForA11y3.default;
|
2079 | exports.splitComponent = _splitComponent3.default;
|
2080 | exports.createChainedFunction = _createChainedFunction3.default;
|
2081 | exports.KeyCode = _keyCode2.default;
|
2082 | exports.contains = _contains3.default;
|
2083 | exports.addEventListener = _addEventListener3.default;
|
2084 | exports.cssAnimation = _cssAnimation3.default;
|
2085 | exports.toArray = _toArray3.default;
|
2086 |
|
2087 |
|
2088 | exports.Align = _Align3.default;
|
2089 |
|
2090 | }),
|
2091 |
|
2092 | (function(module, exports, __webpack_require__) {
|
2093 |
|
2094 | 'use strict';
|
2095 |
|
2096 | exports.__esModule = true;
|
2097 | exports.default = all;
|
2098 |
|
2099 | var _createChainableTypeChecker = __webpack_require__(28);
|
2100 |
|
2101 | var _createChainableTypeChecker2 = _interopRequireDefault(_createChainableTypeChecker);
|
2102 |
|
2103 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
2104 |
|
2105 | function all() {
|
2106 | for (var _len = arguments.length, validators = Array(_len), _key = 0; _key < _len; _key++) {
|
2107 | validators[_key] = arguments[_key];
|
2108 | }
|
2109 |
|
2110 | function allPropTypes() {
|
2111 | for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
2112 | args[_key2] = arguments[_key2];
|
2113 | }
|
2114 |
|
2115 | var error = null;
|
2116 |
|
2117 | validators.forEach(function (validator) {
|
2118 | if (error != null) {
|
2119 | return;
|
2120 | }
|
2121 |
|
2122 | var result = validator.apply(undefined, args);
|
2123 | if (result != null) {
|
2124 | error = result;
|
2125 | }
|
2126 | });
|
2127 |
|
2128 | return error;
|
2129 | }
|
2130 |
|
2131 | return (0, _createChainableTypeChecker2.default)(allPropTypes);
|
2132 | }
|
2133 |
|
2134 | }),
|
2135 |
|
2136 | (function(module, exports) {
|
2137 |
|
2138 | 'use strict';
|
2139 |
|
2140 | exports.__esModule = true;
|
2141 | exports.default = createChainableTypeChecker;
|
2142 | |
2143 |
|
2144 |
|
2145 |
|
2146 |
|
2147 |
|
2148 |
|
2149 |
|
2150 |
|
2151 |
|
2152 |
|
2153 | function createChainableTypeChecker(validate) {
|
2154 | function checkType(isRequired, props, propName, componentName, location, propFullName) {
|
2155 | var componentNameSafe = componentName || '<<anonymous>>';
|
2156 | var propFullNameSafe = propFullName || propName;
|
2157 |
|
2158 | if (props[propName] == null) {
|
2159 | if (isRequired) {
|
2160 | return new Error('Required ' + location + ' `' + propFullNameSafe + '` was not specified ' + ('in `' + componentNameSafe + '`.'));
|
2161 | }
|
2162 |
|
2163 | return null;
|
2164 | }
|
2165 |
|
2166 | for (var _len = arguments.length, args = Array(_len > 6 ? _len - 6 : 0), _key = 6; _key < _len; _key++) {
|
2167 | args[_key - 6] = arguments[_key];
|
2168 | }
|
2169 |
|
2170 | return validate.apply(undefined, [props, propName, componentNameSafe, location, propFullNameSafe].concat(args));
|
2171 | }
|
2172 |
|
2173 | var chainedCheckType = checkType.bind(null, false);
|
2174 | chainedCheckType.isRequired = checkType.bind(null, true);
|
2175 |
|
2176 | return chainedCheckType;
|
2177 | }
|
2178 |
|
2179 | }),
|
2180 |
|
2181 | (function(module, exports, __webpack_require__) {
|
2182 |
|
2183 | 'use strict';
|
2184 |
|
2185 | exports.__esModule = true;
|
2186 |
|
2187 | 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; };
|
2188 |
|
2189 | var _react = __webpack_require__(4);
|
2190 |
|
2191 | var _react2 = _interopRequireDefault(_react);
|
2192 |
|
2193 | var _createChainableTypeChecker = __webpack_require__(28);
|
2194 |
|
2195 | var _createChainableTypeChecker2 = _interopRequireDefault(_createChainableTypeChecker);
|
2196 |
|
2197 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
2198 |
|
2199 | function validate(props, propName, componentName, location, propFullName) {
|
2200 | var propValue = props[propName];
|
2201 | var propType = typeof propValue === 'undefined' ? 'undefined' : _typeof(propValue);
|
2202 |
|
2203 | if (_react2.default.isValidElement(propValue)) {
|
2204 | 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.');
|
2205 | }
|
2206 |
|
2207 | if ((propType !== 'object' || typeof propValue.render !== 'function') && propValue.nodeType !== 1) {
|
2208 | return new Error('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected a ReactComponent or a ') + 'DOMElement.');
|
2209 | }
|
2210 |
|
2211 | return null;
|
2212 | }
|
2213 |
|
2214 | exports.default = (0, _createChainableTypeChecker2.default)(validate);
|
2215 |
|
2216 | }),
|
2217 |
|
2218 | (function(module, exports, __webpack_require__) {
|
2219 |
|
2220 | 'use strict';
|
2221 |
|
2222 | exports.__esModule = true;
|
2223 | exports.default = deprecated;
|
2224 |
|
2225 | var _warning = __webpack_require__(31);
|
2226 |
|
2227 | var _warning2 = _interopRequireDefault(_warning);
|
2228 |
|
2229 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
2230 |
|
2231 | var warned = {};
|
2232 |
|
2233 | function deprecated(validator, reason) {
|
2234 | return function validate(props, propName, componentName, location, propFullName) {
|
2235 | var componentNameSafe = componentName || '<<anonymous>>';
|
2236 | var propFullNameSafe = propFullName || propName;
|
2237 |
|
2238 | if (props[propName] != null) {
|
2239 | var messageKey = componentName + '.' + propName;
|
2240 |
|
2241 | (0, _warning2.default)(warned[messageKey], 'The ' + location + ' `' + propFullNameSafe + '` of ' + ('`' + componentNameSafe + '` is deprecated. ' + reason + '.'));
|
2242 |
|
2243 | warned[messageKey] = true;
|
2244 | }
|
2245 |
|
2246 | for (var _len = arguments.length, args = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) {
|
2247 | args[_key - 5] = arguments[_key];
|
2248 | }
|
2249 |
|
2250 | return validator.apply(undefined, [props, propName, componentName, location, propFullName].concat(args));
|
2251 | };
|
2252 | }
|
2253 |
|
2254 |
|
2255 | function _resetWarned() {
|
2256 | warned = {};
|
2257 | }
|
2258 |
|
2259 | deprecated._resetWarned = _resetWarned;
|
2260 |
|
2261 |
|
2262 | }),
|
2263 |
|
2264 | (function(module, exports, __webpack_require__) {
|
2265 |
|
2266 | (function(process) { |
2267 |
|
2268 |
|
2269 |
|
2270 |
|
2271 |
|
2272 |
|
2273 |
|
2274 |
|
2275 | 'use strict';
|
2276 |
|
2277 | |
2278 |
|
2279 |
|
2280 |
|
2281 |
|
2282 |
|
2283 |
|
2284 | var warning = function() {};
|
2285 |
|
2286 | if (process.env.NODE_ENV !== 'production') {
|
2287 | warning = function(condition, format, args) {
|
2288 | var len = arguments.length;
|
2289 | args = new Array(len > 2 ? len - 2 : 0);
|
2290 | for (var key = 2; key < len; key++) {
|
2291 | args[key - 2] = arguments[key];
|
2292 | }
|
2293 | if (format === undefined) {
|
2294 | throw new Error(
|
2295 | '`warning(condition, format, ...args)` requires a warning ' +
|
2296 | 'message argument'
|
2297 | );
|
2298 | }
|
2299 |
|
2300 | if (format.length < 10 || (/^[s\W]*$/).test(format)) {
|
2301 | throw new Error(
|
2302 | 'The warning format should be able to uniquely identify this ' +
|
2303 | 'warning. Please, use a more descriptive format than: ' + format
|
2304 | );
|
2305 | }
|
2306 |
|
2307 | if (!condition) {
|
2308 | var argIndex = 0;
|
2309 | var message = 'Warning: ' +
|
2310 | format.replace(/%s/g, function() {
|
2311 | return args[argIndex++];
|
2312 | });
|
2313 | if (typeof console !== 'undefined') {
|
2314 | console.error(message);
|
2315 | }
|
2316 | try {
|
2317 |
|
2318 |
|
2319 | throw new Error(message);
|
2320 | } catch(x) {}
|
2321 | }
|
2322 | };
|
2323 | }
|
2324 |
|
2325 | module.exports = warning;
|
2326 |
|
2327 | }.call(exports, __webpack_require__(32)))
|
2328 |
|
2329 | }),
|
2330 |
|
2331 | (function(module, exports) {
|
2332 |
|
2333 |
|
2334 | var process = module.exports = {};
|
2335 |
|
2336 |
|
2337 |
|
2338 |
|
2339 |
|
2340 |
|
2341 | var cachedSetTimeout;
|
2342 | var cachedClearTimeout;
|
2343 |
|
2344 | function defaultSetTimout() {
|
2345 | throw new Error('setTimeout has not been defined');
|
2346 | }
|
2347 | function defaultClearTimeout () {
|
2348 | throw new Error('clearTimeout has not been defined');
|
2349 | }
|
2350 | (function () {
|
2351 | try {
|
2352 | if (typeof setTimeout === 'function') {
|
2353 | cachedSetTimeout = setTimeout;
|
2354 | } else {
|
2355 | cachedSetTimeout = defaultSetTimout;
|
2356 | }
|
2357 | } catch (e) {
|
2358 | cachedSetTimeout = defaultSetTimout;
|
2359 | }
|
2360 | try {
|
2361 | if (typeof clearTimeout === 'function') {
|
2362 | cachedClearTimeout = clearTimeout;
|
2363 | } else {
|
2364 | cachedClearTimeout = defaultClearTimeout;
|
2365 | }
|
2366 | } catch (e) {
|
2367 | cachedClearTimeout = defaultClearTimeout;
|
2368 | }
|
2369 | } ())
|
2370 | function runTimeout(fun) {
|
2371 | if (cachedSetTimeout === setTimeout) {
|
2372 |
|
2373 | return setTimeout(fun, 0);
|
2374 | }
|
2375 |
|
2376 | if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
|
2377 | cachedSetTimeout = setTimeout;
|
2378 | return setTimeout(fun, 0);
|
2379 | }
|
2380 | try {
|
2381 |
|
2382 | return cachedSetTimeout(fun, 0);
|
2383 | } catch(e){
|
2384 | try {
|
2385 |
|
2386 | return cachedSetTimeout.call(null, fun, 0);
|
2387 | } catch(e){
|
2388 |
|
2389 | return cachedSetTimeout.call(this, fun, 0);
|
2390 | }
|
2391 | }
|
2392 |
|
2393 |
|
2394 | }
|
2395 | function runClearTimeout(marker) {
|
2396 | if (cachedClearTimeout === clearTimeout) {
|
2397 |
|
2398 | return clearTimeout(marker);
|
2399 | }
|
2400 |
|
2401 | if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
|
2402 | cachedClearTimeout = clearTimeout;
|
2403 | return clearTimeout(marker);
|
2404 | }
|
2405 | try {
|
2406 |
|
2407 | return cachedClearTimeout(marker);
|
2408 | } catch (e){
|
2409 | try {
|
2410 |
|
2411 | return cachedClearTimeout.call(null, marker);
|
2412 | } catch (e){
|
2413 |
|
2414 |
|
2415 | return cachedClearTimeout.call(this, marker);
|
2416 | }
|
2417 | }
|
2418 |
|
2419 |
|
2420 |
|
2421 | }
|
2422 | var queue = [];
|
2423 | var draining = false;
|
2424 | var currentQueue;
|
2425 | var queueIndex = -1;
|
2426 |
|
2427 | function cleanUpNextTick() {
|
2428 | if (!draining || !currentQueue) {
|
2429 | return;
|
2430 | }
|
2431 | draining = false;
|
2432 | if (currentQueue.length) {
|
2433 | queue = currentQueue.concat(queue);
|
2434 | } else {
|
2435 | queueIndex = -1;
|
2436 | }
|
2437 | if (queue.length) {
|
2438 | drainQueue();
|
2439 | }
|
2440 | }
|
2441 |
|
2442 | function drainQueue() {
|
2443 | if (draining) {
|
2444 | return;
|
2445 | }
|
2446 | var timeout = runTimeout(cleanUpNextTick);
|
2447 | draining = true;
|
2448 |
|
2449 | var len = queue.length;
|
2450 | while(len) {
|
2451 | currentQueue = queue;
|
2452 | queue = [];
|
2453 | while (++queueIndex < len) {
|
2454 | if (currentQueue) {
|
2455 | currentQueue[queueIndex].run();
|
2456 | }
|
2457 | }
|
2458 | queueIndex = -1;
|
2459 | len = queue.length;
|
2460 | }
|
2461 | currentQueue = null;
|
2462 | draining = false;
|
2463 | runClearTimeout(timeout);
|
2464 | }
|
2465 |
|
2466 | process.nextTick = function (fun) {
|
2467 | var args = new Array(arguments.length - 1);
|
2468 | if (arguments.length > 1) {
|
2469 | for (var i = 1; i < arguments.length; i++) {
|
2470 | args[i - 1] = arguments[i];
|
2471 | }
|
2472 | }
|
2473 | queue.push(new Item(fun, args));
|
2474 | if (queue.length === 1 && !draining) {
|
2475 | runTimeout(drainQueue);
|
2476 | }
|
2477 | };
|
2478 |
|
2479 |
|
2480 | function Item(fun, array) {
|
2481 | this.fun = fun;
|
2482 | this.array = array;
|
2483 | }
|
2484 | Item.prototype.run = function () {
|
2485 | this.fun.apply(null, this.array);
|
2486 | };
|
2487 | process.title = 'browser';
|
2488 | process.browser = true;
|
2489 | process.env = {};
|
2490 | process.argv = [];
|
2491 | process.version = '';
|
2492 | process.versions = {};
|
2493 |
|
2494 | function noop() {}
|
2495 |
|
2496 | process.on = noop;
|
2497 | process.addListener = noop;
|
2498 | process.once = noop;
|
2499 | process.off = noop;
|
2500 | process.removeListener = noop;
|
2501 | process.removeAllListeners = noop;
|
2502 | process.emit = noop;
|
2503 | process.prependListener = noop;
|
2504 | process.prependOnceListener = noop;
|
2505 |
|
2506 | process.listeners = function (name) { return [] }
|
2507 |
|
2508 | process.binding = function (name) {
|
2509 | throw new Error('process.binding is not supported');
|
2510 | };
|
2511 |
|
2512 | process.cwd = function () { return '/' };
|
2513 | process.chdir = function (dir) {
|
2514 | throw new Error('process.chdir is not supported');
|
2515 | };
|
2516 | process.umask = function() { return 0; };
|
2517 |
|
2518 |
|
2519 | }),
|
2520 |
|
2521 | (function(module, exports, __webpack_require__) {
|
2522 |
|
2523 | 'use strict';
|
2524 |
|
2525 | exports.__esModule = true;
|
2526 |
|
2527 | 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; };
|
2528 |
|
2529 | var _react = __webpack_require__(4);
|
2530 |
|
2531 | var _react2 = _interopRequireDefault(_react);
|
2532 |
|
2533 | var _createChainableTypeChecker = __webpack_require__(28);
|
2534 |
|
2535 | var _createChainableTypeChecker2 = _interopRequireDefault(_createChainableTypeChecker);
|
2536 |
|
2537 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
2538 |
|
2539 | function elementType(props, propName, componentName, location, propFullName) {
|
2540 | var propValue = props[propName];
|
2541 | var propType = typeof propValue === 'undefined' ? 'undefined' : _typeof(propValue);
|
2542 |
|
2543 | if (_react2.default.isValidElement(propValue)) {
|
2544 | return new Error('Invalid ' + location + ' `' + propFullName + '` of type ReactElement ' + ('supplied to `' + componentName + '`, expected an element type (a string ') + 'or a ReactClass).');
|
2545 | }
|
2546 |
|
2547 | if (propType !== 'function' && propType !== 'string') {
|
2548 | return new Error('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected an element type (a string ') + 'or a ReactClass).');
|
2549 | }
|
2550 |
|
2551 | return null;
|
2552 | }
|
2553 |
|
2554 | exports.default = (0, _createChainableTypeChecker2.default)(elementType);
|
2555 |
|
2556 | }),
|
2557 |
|
2558 | (function(module, exports) {
|
2559 |
|
2560 | 'use strict';
|
2561 |
|
2562 | exports.__esModule = true;
|
2563 | exports.default = isRequiredForA11y;
|
2564 | function isRequiredForA11y(validator) {
|
2565 | return function validate(props, propName, componentName, location, propFullName) {
|
2566 | var componentNameSafe = componentName || '<<anonymous>>';
|
2567 | var propFullNameSafe = propFullName || propName;
|
2568 |
|
2569 | if (props[propName] == null) {
|
2570 | return new Error('The ' + location + ' `' + propFullNameSafe + '` is required to make ' + ('`' + componentNameSafe + '` accessible for users of assistive ') + 'technologies such as screen readers.');
|
2571 | }
|
2572 |
|
2573 | for (var _len = arguments.length, args = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) {
|
2574 | args[_key - 5] = arguments[_key];
|
2575 | }
|
2576 |
|
2577 | return validator.apply(undefined, [props, propName, componentName, location, propFullName].concat(args));
|
2578 | };
|
2579 | }
|
2580 |
|
2581 | }),
|
2582 |
|
2583 | (function(module, exports) {
|
2584 |
|
2585 | "use strict";
|
2586 |
|
2587 | exports.__esModule = true;
|
2588 | exports.default = splitComponentProps;
|
2589 | function _objectEntries(obj) {
|
2590 | var entries = [];
|
2591 | var keys = Object.keys(obj);
|
2592 |
|
2593 | for (var k = 0; k < keys.length; ++k) {
|
2594 | entries.push([keys[k], obj[keys[k]]]);
|
2595 | }return entries;
|
2596 | }
|
2597 |
|
2598 | |
2599 |
|
2600 |
|
2601 |
|
2602 |
|
2603 |
|
2604 | function splitComponentProps(props, Component) {
|
2605 | var componentPropTypes = Component.propTypes;
|
2606 |
|
2607 | var parentProps = {};
|
2608 | var childProps = {};
|
2609 |
|
2610 | _objectEntries(props).forEach(function (_ref) {
|
2611 | var propName = _ref[0],
|
2612 | propValue = _ref[1];
|
2613 |
|
2614 | if (componentPropTypes[propName]) {
|
2615 | parentProps[propName] = propValue;
|
2616 | } else {
|
2617 | childProps[propName] = propValue;
|
2618 | }
|
2619 | });
|
2620 |
|
2621 | return [parentProps, childProps];
|
2622 | }
|
2623 |
|
2624 | }),
|
2625 |
|
2626 | (function(module, exports) {
|
2627 |
|
2628 | 'use strict';
|
2629 |
|
2630 | exports.__esModule = true;
|
2631 | function createChainedFunction() {
|
2632 | for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {
|
2633 | funcs[_key] = arguments[_key];
|
2634 | }
|
2635 |
|
2636 | return funcs.filter(function (f) {
|
2637 | return f != null;
|
2638 | }).reduce(function (acc, f) {
|
2639 | if (typeof f !== 'function') {
|
2640 | throw new Error('Invalid Argument Type, must only provide functions, undefined, or null.');
|
2641 | }
|
2642 |
|
2643 | if (acc === null) {
|
2644 | return f;
|
2645 | }
|
2646 |
|
2647 | return function chainedFunction() {
|
2648 | for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
2649 | args[_key2] = arguments[_key2];
|
2650 | }
|
2651 |
|
2652 | acc.apply(this, args);
|
2653 | f.apply(this, args);
|
2654 | };
|
2655 | }, null);
|
2656 | }
|
2657 | exports.default = createChainedFunction;
|
2658 |
|
2659 | }),
|
2660 |
|
2661 | (function(module, exports) {
|
2662 |
|
2663 | 'use strict';
|
2664 |
|
2665 | |
2666 |
|
2667 |
|
2668 |
|
2669 |
|
2670 |
|
2671 | var KeyCode = {
|
2672 | |
2673 |
|
2674 |
|
2675 | MAC_ENTER: 3,
|
2676 | |
2677 |
|
2678 |
|
2679 | BACKSPACE: 8,
|
2680 | |
2681 |
|
2682 |
|
2683 | TAB: 9,
|
2684 | |
2685 |
|
2686 |
|
2687 | NUM_CENTER: 12,
|
2688 | |
2689 |
|
2690 |
|
2691 | ENTER: 13,
|
2692 | |
2693 |
|
2694 |
|
2695 | SHIFT: 16,
|
2696 | |
2697 |
|
2698 |
|
2699 | CTRL: 17,
|
2700 | |
2701 |
|
2702 |
|
2703 | ALT: 18,
|
2704 | |
2705 |
|
2706 |
|
2707 | PAUSE: 19,
|
2708 | |
2709 |
|
2710 |
|
2711 | CAPS_LOCK: 20,
|
2712 | |
2713 |
|
2714 |
|
2715 | ESC: 27,
|
2716 | |
2717 |
|
2718 |
|
2719 | SPACE: 32,
|
2720 | |
2721 |
|
2722 |
|
2723 | PAGE_UP: 33,
|
2724 | |
2725 |
|
2726 |
|
2727 | PAGE_DOWN: 34,
|
2728 | |
2729 |
|
2730 |
|
2731 | END: 35,
|
2732 | |
2733 |
|
2734 |
|
2735 | HOME: 36,
|
2736 | |
2737 |
|
2738 |
|
2739 | LEFT: 37,
|
2740 | |
2741 |
|
2742 |
|
2743 | UP: 38,
|
2744 | |
2745 |
|
2746 |
|
2747 | RIGHT: 39,
|
2748 | |
2749 |
|
2750 |
|
2751 | DOWN: 40,
|
2752 | |
2753 |
|
2754 |
|
2755 | PRINT_SCREEN: 44,
|
2756 | |
2757 |
|
2758 |
|
2759 | INSERT: 45,
|
2760 | |
2761 |
|
2762 |
|
2763 | DELETE: 46,
|
2764 | |
2765 |
|
2766 |
|
2767 | ZERO: 48,
|
2768 | |
2769 |
|
2770 |
|
2771 | ONE: 49,
|
2772 | |
2773 |
|
2774 |
|
2775 | TWO: 50,
|
2776 | |
2777 |
|
2778 |
|
2779 | THREE: 51,
|
2780 | |
2781 |
|
2782 |
|
2783 | FOUR: 52,
|
2784 | |
2785 |
|
2786 |
|
2787 | FIVE: 53,
|
2788 | |
2789 |
|
2790 |
|
2791 | SIX: 54,
|
2792 | |
2793 |
|
2794 |
|
2795 | SEVEN: 55,
|
2796 | |
2797 |
|
2798 |
|
2799 | EIGHT: 56,
|
2800 | |
2801 |
|
2802 |
|
2803 | NINE: 57,
|
2804 | |
2805 |
|
2806 |
|
2807 | QUESTION_MARK: 63,
|
2808 | |
2809 |
|
2810 |
|
2811 | A: 65,
|
2812 | |
2813 |
|
2814 |
|
2815 | B: 66,
|
2816 | |
2817 |
|
2818 |
|
2819 | C: 67,
|
2820 | |
2821 |
|
2822 |
|
2823 | D: 68,
|
2824 | |
2825 |
|
2826 |
|
2827 | E: 69,
|
2828 | |
2829 |
|
2830 |
|
2831 | F: 70,
|
2832 | |
2833 |
|
2834 |
|
2835 | G: 71,
|
2836 | |
2837 |
|
2838 |
|
2839 | H: 72,
|
2840 | |
2841 |
|
2842 |
|
2843 | I: 73,
|
2844 | |
2845 |
|
2846 |
|
2847 | J: 74,
|
2848 | |
2849 |
|
2850 |
|
2851 | K: 75,
|
2852 | |
2853 |
|
2854 |
|
2855 | L: 76,
|
2856 | |
2857 |
|
2858 |
|
2859 | M: 77,
|
2860 | |
2861 |
|
2862 |
|
2863 | N: 78,
|
2864 | |
2865 |
|
2866 |
|
2867 | O: 79,
|
2868 | |
2869 |
|
2870 |
|
2871 | P: 80,
|
2872 | |
2873 |
|
2874 |
|
2875 | Q: 81,
|
2876 | |
2877 |
|
2878 |
|
2879 | R: 82,
|
2880 | |
2881 |
|
2882 |
|
2883 | S: 83,
|
2884 | |
2885 |
|
2886 |
|
2887 | T: 84,
|
2888 | |
2889 |
|
2890 |
|
2891 | U: 85,
|
2892 | |
2893 |
|
2894 |
|
2895 | V: 86,
|
2896 | |
2897 |
|
2898 |
|
2899 | W: 87,
|
2900 | |
2901 |
|
2902 |
|
2903 | X: 88,
|
2904 | |
2905 |
|
2906 |
|
2907 | Y: 89,
|
2908 | |
2909 |
|
2910 |
|
2911 | Z: 90,
|
2912 | |
2913 |
|
2914 |
|
2915 | META: 91,
|
2916 | |
2917 |
|
2918 |
|
2919 | WIN_KEY_RIGHT: 92,
|
2920 | |
2921 |
|
2922 |
|
2923 | CONTEXT_MENU: 93,
|
2924 | |
2925 |
|
2926 |
|
2927 | NUM_ZERO: 96,
|
2928 | |
2929 |
|
2930 |
|
2931 | NUM_ONE: 97,
|
2932 | |
2933 |
|
2934 |
|
2935 | NUM_TWO: 98,
|
2936 | |
2937 |
|
2938 |
|
2939 | NUM_THREE: 99,
|
2940 | |
2941 |
|
2942 |
|
2943 | NUM_FOUR: 100,
|
2944 | |
2945 |
|
2946 |
|
2947 | NUM_FIVE: 101,
|
2948 | |
2949 |
|
2950 |
|
2951 | NUM_SIX: 102,
|
2952 | |
2953 |
|
2954 |
|
2955 | NUM_SEVEN: 103,
|
2956 | |
2957 |
|
2958 |
|
2959 | NUM_EIGHT: 104,
|
2960 | |
2961 |
|
2962 |
|
2963 | NUM_NINE: 105,
|
2964 | |
2965 |
|
2966 |
|
2967 | NUM_MULTIPLY: 106,
|
2968 | |
2969 |
|
2970 |
|
2971 | NUM_PLUS: 107,
|
2972 | |
2973 |
|
2974 |
|
2975 | NUM_MINUS: 109,
|
2976 | |
2977 |
|
2978 |
|
2979 | NUM_PERIOD: 110,
|
2980 | |
2981 |
|
2982 |
|
2983 | NUM_DIVISION: 111,
|
2984 | |
2985 |
|
2986 |
|
2987 | F1: 112,
|
2988 | |
2989 |
|
2990 |
|
2991 | F2: 113,
|
2992 | |
2993 |
|
2994 |
|
2995 | F3: 114,
|
2996 | |
2997 |
|
2998 |
|
2999 | F4: 115,
|
3000 | |
3001 |
|
3002 |
|
3003 | F5: 116,
|
3004 | |
3005 |
|
3006 |
|
3007 | F6: 117,
|
3008 | |
3009 |
|
3010 |
|
3011 | F7: 118,
|
3012 | |
3013 |
|
3014 |
|
3015 | F8: 119,
|
3016 | |
3017 |
|
3018 |
|
3019 | F9: 120,
|
3020 | |
3021 |
|
3022 |
|
3023 | F10: 121,
|
3024 | |
3025 |
|
3026 |
|
3027 | F11: 122,
|
3028 | |
3029 |
|
3030 |
|
3031 | F12: 123,
|
3032 | |
3033 |
|
3034 |
|
3035 | NUMLOCK: 144,
|
3036 | |
3037 |
|
3038 |
|
3039 | SEMICOLON: 186,
|
3040 | |
3041 |
|
3042 |
|
3043 | DASH: 189,
|
3044 | |
3045 |
|
3046 |
|
3047 | EQUALS: 187,
|
3048 | |
3049 |
|
3050 |
|
3051 | COMMA: 188,
|
3052 | |
3053 |
|
3054 |
|
3055 | PERIOD: 190,
|
3056 | |
3057 |
|
3058 |
|
3059 | SLASH: 191,
|
3060 | |
3061 |
|
3062 |
|
3063 | APOSTROPHE: 192,
|
3064 | |
3065 |
|
3066 |
|
3067 | SINGLE_QUOTE: 222,
|
3068 | |
3069 |
|
3070 |
|
3071 | OPEN_SQUARE_BRACKET: 219,
|
3072 | |
3073 |
|
3074 |
|
3075 | BACKSLASH: 220,
|
3076 | |
3077 |
|
3078 |
|
3079 | CLOSE_SQUARE_BRACKET: 221,
|
3080 | |
3081 |
|
3082 |
|
3083 | WIN_KEY: 224,
|
3084 | |
3085 |
|
3086 |
|
3087 | MAC_FF_META: 224,
|
3088 | |
3089 |
|
3090 |
|
3091 | WIN_IME: 229
|
3092 | };
|
3093 |
|
3094 | |
3095 |
|
3096 |
|
3097 | KeyCode.isTextModifyingKeyEvent = function isTextModifyingKeyEvent(e) {
|
3098 | var keyCode = e.keyCode;
|
3099 | if (e.altKey && !e.ctrlKey || e.metaKey ||
|
3100 |
|
3101 | keyCode >= KeyCode.F1 && keyCode <= KeyCode.F12) {
|
3102 | return false;
|
3103 | }
|
3104 |
|
3105 |
|
3106 |
|
3107 | switch (keyCode) {
|
3108 | case KeyCode.ALT:
|
3109 | case KeyCode.CAPS_LOCK:
|
3110 | case KeyCode.CONTEXT_MENU:
|
3111 | case KeyCode.CTRL:
|
3112 | case KeyCode.DOWN:
|
3113 | case KeyCode.END:
|
3114 | case KeyCode.ESC:
|
3115 | case KeyCode.HOME:
|
3116 | case KeyCode.INSERT:
|
3117 | case KeyCode.LEFT:
|
3118 | case KeyCode.MAC_FF_META:
|
3119 | case KeyCode.META:
|
3120 | case KeyCode.NUMLOCK:
|
3121 | case KeyCode.NUM_CENTER:
|
3122 | case KeyCode.PAGE_DOWN:
|
3123 | case KeyCode.PAGE_UP:
|
3124 | case KeyCode.PAUSE:
|
3125 | case KeyCode.PRINT_SCREEN:
|
3126 | case KeyCode.RIGHT:
|
3127 | case KeyCode.SHIFT:
|
3128 | case KeyCode.UP:
|
3129 | case KeyCode.WIN_KEY:
|
3130 | case KeyCode.WIN_KEY_RIGHT:
|
3131 | return false;
|
3132 | default:
|
3133 | return true;
|
3134 | }
|
3135 | };
|
3136 |
|
3137 | |
3138 |
|
3139 |
|
3140 | KeyCode.isCharacterKey = function isCharacterKey(keyCode) {
|
3141 | if (keyCode >= KeyCode.ZERO && keyCode <= KeyCode.NINE) {
|
3142 | return true;
|
3143 | }
|
3144 |
|
3145 | if (keyCode >= KeyCode.NUM_ZERO && keyCode <= KeyCode.NUM_MULTIPLY) {
|
3146 | return true;
|
3147 | }
|
3148 |
|
3149 | if (keyCode >= KeyCode.A && keyCode <= KeyCode.Z) {
|
3150 | return true;
|
3151 | }
|
3152 |
|
3153 |
|
3154 | if (window.navigation.userAgent.indexOf('WebKit') !== -1 && keyCode === 0) {
|
3155 | return true;
|
3156 | }
|
3157 |
|
3158 | switch (keyCode) {
|
3159 | case KeyCode.SPACE:
|
3160 | case KeyCode.QUESTION_MARK:
|
3161 | case KeyCode.NUM_PLUS:
|
3162 | case KeyCode.NUM_MINUS:
|
3163 | case KeyCode.NUM_PERIOD:
|
3164 | case KeyCode.NUM_DIVISION:
|
3165 | case KeyCode.SEMICOLON:
|
3166 | case KeyCode.DASH:
|
3167 | case KeyCode.EQUALS:
|
3168 | case KeyCode.COMMA:
|
3169 | case KeyCode.PERIOD:
|
3170 | case KeyCode.SLASH:
|
3171 | case KeyCode.APOSTROPHE:
|
3172 | case KeyCode.SINGLE_QUOTE:
|
3173 | case KeyCode.OPEN_SQUARE_BRACKET:
|
3174 | case KeyCode.BACKSLASH:
|
3175 | case KeyCode.CLOSE_SQUARE_BRACKET:
|
3176 | return true;
|
3177 | default:
|
3178 | return false;
|
3179 | }
|
3180 | };
|
3181 |
|
3182 | module.exports = KeyCode;
|
3183 |
|
3184 | }),
|
3185 |
|
3186 | (function(module, exports) {
|
3187 |
|
3188 | "use strict";
|
3189 |
|
3190 | exports.__esModule = true;
|
3191 | exports.default = contains;
|
3192 | function contains(root, n) {
|
3193 | var node = n;
|
3194 | while (node) {
|
3195 | if (node === root) {
|
3196 | return true;
|
3197 | }
|
3198 | node = node.parentNode;
|
3199 | }
|
3200 |
|
3201 | return false;
|
3202 | }
|
3203 |
|
3204 | }),
|
3205 |
|
3206 | (function(module, exports, __webpack_require__) {
|
3207 |
|
3208 | 'use strict';
|
3209 |
|
3210 | exports.__esModule = true;
|
3211 | exports.default = addEventListenerWrap;
|
3212 |
|
3213 | var _addDomEventListener = __webpack_require__(40);
|
3214 |
|
3215 | var _addDomEventListener2 = _interopRequireDefault(_addDomEventListener);
|
3216 |
|
3217 | var _reactDom = __webpack_require__(12);
|
3218 |
|
3219 | var _reactDom2 = _interopRequireDefault(_reactDom);
|
3220 |
|
3221 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
3222 |
|
3223 | function addEventListenerWrap(target, eventType, cb) {
|
3224 |
|
3225 | var callback = _reactDom2.default.unstable_batchedUpdates ? function run(e) {
|
3226 | _reactDom2.default.unstable_batchedUpdates(cb, e);
|
3227 | } : cb;
|
3228 | return (0, _addDomEventListener2.default)(target, eventType, callback);
|
3229 | }
|
3230 |
|
3231 | }),
|
3232 |
|
3233 | (function(module, exports, __webpack_require__) {
|
3234 |
|
3235 | 'use strict';
|
3236 |
|
3237 | Object.defineProperty(exports, "__esModule", {
|
3238 | value: true
|
3239 | });
|
3240 | exports["default"] = addEventListener;
|
3241 |
|
3242 | var _EventObject = __webpack_require__(41);
|
3243 |
|
3244 | var _EventObject2 = _interopRequireDefault(_EventObject);
|
3245 |
|
3246 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
3247 |
|
3248 | function addEventListener(target, eventType, callback) {
|
3249 | function wrapCallback(e) {
|
3250 | var ne = new _EventObject2["default"](e);
|
3251 | callback.call(target, ne);
|
3252 | }
|
3253 |
|
3254 | if (target.addEventListener) {
|
3255 | target.addEventListener(eventType, wrapCallback, false);
|
3256 | return {
|
3257 | remove: function remove() {
|
3258 | target.removeEventListener(eventType, wrapCallback, false);
|
3259 | }
|
3260 | };
|
3261 | } else if (target.attachEvent) {
|
3262 | target.attachEvent('on' + eventType, wrapCallback);
|
3263 | return {
|
3264 | remove: function remove() {
|
3265 | target.detachEvent('on' + eventType, wrapCallback);
|
3266 | }
|
3267 | };
|
3268 | }
|
3269 | }
|
3270 | module.exports = exports['default'];
|
3271 |
|
3272 | }),
|
3273 |
|
3274 | (function(module, exports, __webpack_require__) {
|
3275 |
|
3276 | 'use strict';
|
3277 |
|
3278 | Object.defineProperty(exports, "__esModule", {
|
3279 | value: true
|
3280 | });
|
3281 |
|
3282 | var _EventBaseObject = __webpack_require__(42);
|
3283 |
|
3284 | var _EventBaseObject2 = _interopRequireDefault(_EventBaseObject);
|
3285 |
|
3286 | var _objectAssign = __webpack_require__(43);
|
3287 |
|
3288 | var _objectAssign2 = _interopRequireDefault(_objectAssign);
|
3289 |
|
3290 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
3291 |
|
3292 | |
3293 |
|
3294 |
|
3295 |
|
3296 |
|
3297 |
|
3298 | var TRUE = true;
|
3299 | var FALSE = false;
|
3300 | var commonProps = ['altKey', 'bubbles', 'cancelable', 'ctrlKey', 'currentTarget', 'eventPhase', 'metaKey', 'shiftKey', 'target', 'timeStamp', 'view', 'type'];
|
3301 |
|
3302 | function isNullOrUndefined(w) {
|
3303 | return w === null || w === undefined;
|
3304 | }
|
3305 |
|
3306 | var eventNormalizers = [{
|
3307 | reg: /^key/,
|
3308 | props: ['char', 'charCode', 'key', 'keyCode', 'which'],
|
3309 | fix: function fix(event, nativeEvent) {
|
3310 | if (isNullOrUndefined(event.which)) {
|
3311 | event.which = !isNullOrUndefined(nativeEvent.charCode) ? nativeEvent.charCode : nativeEvent.keyCode;
|
3312 | }
|
3313 |
|
3314 |
|
3315 | if (event.metaKey === undefined) {
|
3316 | event.metaKey = event.ctrlKey;
|
3317 | }
|
3318 | }
|
3319 | }, {
|
3320 | reg: /^touch/,
|
3321 | props: ['touches', 'changedTouches', 'targetTouches']
|
3322 | }, {
|
3323 | reg: /^hashchange$/,
|
3324 | props: ['newURL', 'oldURL']
|
3325 | }, {
|
3326 | reg: /^gesturechange$/i,
|
3327 | props: ['rotation', 'scale']
|
3328 | }, {
|
3329 | reg: /^(mousewheel|DOMMouseScroll)$/,
|
3330 | props: [],
|
3331 | fix: function fix(event, nativeEvent) {
|
3332 | var deltaX = void 0;
|
3333 | var deltaY = void 0;
|
3334 | var delta = void 0;
|
3335 | var wheelDelta = nativeEvent.wheelDelta;
|
3336 | var axis = nativeEvent.axis;
|
3337 | var wheelDeltaY = nativeEvent.wheelDeltaY;
|
3338 | var wheelDeltaX = nativeEvent.wheelDeltaX;
|
3339 | var detail = nativeEvent.detail;
|
3340 |
|
3341 |
|
3342 | if (wheelDelta) {
|
3343 | delta = wheelDelta / 120;
|
3344 | }
|
3345 |
|
3346 |
|
3347 | if (detail) {
|
3348 |
|
3349 | delta = 0 - (detail % 3 === 0 ? detail / 3 : detail);
|
3350 | }
|
3351 |
|
3352 |
|
3353 | if (axis !== undefined) {
|
3354 | if (axis === event.HORIZONTAL_AXIS) {
|
3355 | deltaY = 0;
|
3356 | deltaX = 0 - delta;
|
3357 | } else if (axis === event.VERTICAL_AXIS) {
|
3358 | deltaX = 0;
|
3359 | deltaY = delta;
|
3360 | }
|
3361 | }
|
3362 |
|
3363 |
|
3364 | if (wheelDeltaY !== undefined) {
|
3365 | deltaY = wheelDeltaY / 120;
|
3366 | }
|
3367 | if (wheelDeltaX !== undefined) {
|
3368 | deltaX = -1 * wheelDeltaX / 120;
|
3369 | }
|
3370 |
|
3371 |
|
3372 | if (!deltaX && !deltaY) {
|
3373 | deltaY = delta;
|
3374 | }
|
3375 |
|
3376 | if (deltaX !== undefined) {
|
3377 | |
3378 |
|
3379 |
|
3380 |
|
3381 |
|
3382 | event.deltaX = deltaX;
|
3383 | }
|
3384 |
|
3385 | if (deltaY !== undefined) {
|
3386 | |
3387 |
|
3388 |
|
3389 |
|
3390 |
|
3391 | event.deltaY = deltaY;
|
3392 | }
|
3393 |
|
3394 | if (delta !== undefined) {
|
3395 | |
3396 |
|
3397 |
|
3398 |
|
3399 |
|
3400 | event.delta = delta;
|
3401 | }
|
3402 | }
|
3403 | }, {
|
3404 | reg: /^mouse|contextmenu|click|mspointer|(^DOMMouseScroll$)/i,
|
3405 | props: ['buttons', 'clientX', 'clientY', 'button', 'offsetX', 'relatedTarget', 'which', 'fromElement', 'toElement', 'offsetY', 'pageX', 'pageY', 'screenX', 'screenY'],
|
3406 | fix: function fix(event, nativeEvent) {
|
3407 | var eventDoc = void 0;
|
3408 | var doc = void 0;
|
3409 | var body = void 0;
|
3410 | var target = event.target;
|
3411 | var button = nativeEvent.button;
|
3412 |
|
3413 |
|
3414 | if (target && isNullOrUndefined(event.pageX) && !isNullOrUndefined(nativeEvent.clientX)) {
|
3415 | eventDoc = target.ownerDocument || document;
|
3416 | doc = eventDoc.documentElement;
|
3417 | body = eventDoc.body;
|
3418 | event.pageX = nativeEvent.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
|
3419 | event.pageY = nativeEvent.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
|
3420 | }
|
3421 |
|
3422 |
|
3423 |
|
3424 | if (!event.which && button !== undefined) {
|
3425 | if (button & 1) {
|
3426 | event.which = 1;
|
3427 | } else if (button & 2) {
|
3428 | event.which = 3;
|
3429 | } else if (button & 4) {
|
3430 | event.which = 2;
|
3431 | } else {
|
3432 | event.which = 0;
|
3433 | }
|
3434 | }
|
3435 |
|
3436 |
|
3437 | if (!event.relatedTarget && event.fromElement) {
|
3438 | event.relatedTarget = event.fromElement === target ? event.toElement : event.fromElement;
|
3439 | }
|
3440 |
|
3441 | return event;
|
3442 | }
|
3443 | }];
|
3444 |
|
3445 | function retTrue() {
|
3446 | return TRUE;
|
3447 | }
|
3448 |
|
3449 | function retFalse() {
|
3450 | return FALSE;
|
3451 | }
|
3452 |
|
3453 | function DomEventObject(nativeEvent) {
|
3454 | var type = nativeEvent.type;
|
3455 |
|
3456 | var isNative = typeof nativeEvent.stopPropagation === 'function' || typeof nativeEvent.cancelBubble === 'boolean';
|
3457 |
|
3458 | _EventBaseObject2["default"].call(this);
|
3459 |
|
3460 | this.nativeEvent = nativeEvent;
|
3461 |
|
3462 |
|
3463 | var isDefaultPrevented = retFalse;
|
3464 | if ('defaultPrevented' in nativeEvent) {
|
3465 | isDefaultPrevented = nativeEvent.defaultPrevented ? retTrue : retFalse;
|
3466 | } else if ('getPreventDefault' in nativeEvent) {
|
3467 |
|
3468 | isDefaultPrevented = nativeEvent.getPreventDefault() ? retTrue : retFalse;
|
3469 | } else if ('returnValue' in nativeEvent) {
|
3470 | isDefaultPrevented = nativeEvent.returnValue === FALSE ? retTrue : retFalse;
|
3471 | }
|
3472 |
|
3473 | this.isDefaultPrevented = isDefaultPrevented;
|
3474 |
|
3475 | var fixFns = [];
|
3476 | var fixFn = void 0;
|
3477 | var l = void 0;
|
3478 | var prop = void 0;
|
3479 | var props = commonProps.concat();
|
3480 |
|
3481 | eventNormalizers.forEach(function (normalizer) {
|
3482 | if (type.match(normalizer.reg)) {
|
3483 | props = props.concat(normalizer.props);
|
3484 | if (normalizer.fix) {
|
3485 | fixFns.push(normalizer.fix);
|
3486 | }
|
3487 | }
|
3488 | });
|
3489 |
|
3490 | l = props.length;
|
3491 |
|
3492 |
|
3493 | while (l) {
|
3494 | prop = props[--l];
|
3495 | this[prop] = nativeEvent[prop];
|
3496 | }
|
3497 |
|
3498 |
|
3499 | if (!this.target && isNative) {
|
3500 | this.target = nativeEvent.srcElement || document;
|
3501 | }
|
3502 |
|
3503 |
|
3504 | if (this.target && this.target.nodeType === 3) {
|
3505 | this.target = this.target.parentNode;
|
3506 | }
|
3507 |
|
3508 | l = fixFns.length;
|
3509 |
|
3510 | while (l) {
|
3511 | fixFn = fixFns[--l];
|
3512 | fixFn(this, nativeEvent);
|
3513 | }
|
3514 |
|
3515 | this.timeStamp = nativeEvent.timeStamp || Date.now();
|
3516 | }
|
3517 |
|
3518 | var EventBaseObjectProto = _EventBaseObject2["default"].prototype;
|
3519 |
|
3520 | (0, _objectAssign2["default"])(DomEventObject.prototype, EventBaseObjectProto, {
|
3521 | constructor: DomEventObject,
|
3522 |
|
3523 | preventDefault: function preventDefault() {
|
3524 | var e = this.nativeEvent;
|
3525 |
|
3526 |
|
3527 | if (e.preventDefault) {
|
3528 | e.preventDefault();
|
3529 | } else {
|
3530 |
|
3531 | e.returnValue = FALSE;
|
3532 | }
|
3533 |
|
3534 | EventBaseObjectProto.preventDefault.call(this);
|
3535 | },
|
3536 | stopPropagation: function stopPropagation() {
|
3537 | var e = this.nativeEvent;
|
3538 |
|
3539 |
|
3540 | if (e.stopPropagation) {
|
3541 | e.stopPropagation();
|
3542 | } else {
|
3543 |
|
3544 | e.cancelBubble = TRUE;
|
3545 | }
|
3546 |
|
3547 | EventBaseObjectProto.stopPropagation.call(this);
|
3548 | }
|
3549 | });
|
3550 |
|
3551 | exports["default"] = DomEventObject;
|
3552 | module.exports = exports['default'];
|
3553 |
|
3554 | }),
|
3555 |
|
3556 | (function(module, exports) {
|
3557 |
|
3558 | "use strict";
|
3559 |
|
3560 | Object.defineProperty(exports, "__esModule", {
|
3561 | value: true
|
3562 | });
|
3563 | |
3564 |
|
3565 |
|
3566 |
|
3567 |
|
3568 |
|
3569 | function returnFalse() {
|
3570 | return false;
|
3571 | }
|
3572 |
|
3573 | function returnTrue() {
|
3574 | return true;
|
3575 | }
|
3576 |
|
3577 | function EventBaseObject() {
|
3578 | this.timeStamp = Date.now();
|
3579 | this.target = undefined;
|
3580 | this.currentTarget = undefined;
|
3581 | }
|
3582 |
|
3583 | EventBaseObject.prototype = {
|
3584 | isEventObject: 1,
|
3585 |
|
3586 | constructor: EventBaseObject,
|
3587 |
|
3588 | isDefaultPrevented: returnFalse,
|
3589 |
|
3590 | isPropagationStopped: returnFalse,
|
3591 |
|
3592 | isImmediatePropagationStopped: returnFalse,
|
3593 |
|
3594 | preventDefault: function preventDefault() {
|
3595 | this.isDefaultPrevented = returnTrue;
|
3596 | },
|
3597 | stopPropagation: function stopPropagation() {
|
3598 | this.isPropagationStopped = returnTrue;
|
3599 | },
|
3600 | stopImmediatePropagation: function stopImmediatePropagation() {
|
3601 | this.isImmediatePropagationStopped = returnTrue;
|
3602 |
|
3603 |
|
3604 | this.stopPropagation();
|
3605 | },
|
3606 | halt: function halt(immediate) {
|
3607 | if (immediate) {
|
3608 | this.stopImmediatePropagation();
|
3609 | } else {
|
3610 | this.stopPropagation();
|
3611 | }
|
3612 | this.preventDefault();
|
3613 | }
|
3614 | };
|
3615 |
|
3616 | exports["default"] = EventBaseObject;
|
3617 | module.exports = exports['default'];
|
3618 |
|
3619 | }),
|
3620 |
|
3621 | (function(module, exports) {
|
3622 |
|
3623 | |
3624 |
|
3625 |
|
3626 |
|
3627 |
|
3628 |
|
3629 | 'use strict';
|
3630 |
|
3631 | var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
3632 | var hasOwnProperty = Object.prototype.hasOwnProperty;
|
3633 | var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
3634 |
|
3635 | function toObject(val) {
|
3636 | if (val === null || val === undefined) {
|
3637 | throw new TypeError('Object.assign cannot be called with null or undefined');
|
3638 | }
|
3639 |
|
3640 | return Object(val);
|
3641 | }
|
3642 |
|
3643 | function shouldUseNative() {
|
3644 | try {
|
3645 | if (!Object.assign) {
|
3646 | return false;
|
3647 | }
|
3648 |
|
3649 |
|
3650 |
|
3651 |
|
3652 | var test1 = new String('abc');
|
3653 | test1[5] = 'de';
|
3654 | if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
3655 | return false;
|
3656 | }
|
3657 |
|
3658 |
|
3659 | var test2 = {};
|
3660 | for (var i = 0; i < 10; i++) {
|
3661 | test2['_' + String.fromCharCode(i)] = i;
|
3662 | }
|
3663 | var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
3664 | return test2[n];
|
3665 | });
|
3666 | if (order2.join('') !== '0123456789') {
|
3667 | return false;
|
3668 | }
|
3669 |
|
3670 |
|
3671 | var test3 = {};
|
3672 | 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
3673 | test3[letter] = letter;
|
3674 | });
|
3675 | if (Object.keys(Object.assign({}, test3)).join('') !==
|
3676 | 'abcdefghijklmnopqrst') {
|
3677 | return false;
|
3678 | }
|
3679 |
|
3680 | return true;
|
3681 | } catch (err) {
|
3682 |
|
3683 | return false;
|
3684 | }
|
3685 | }
|
3686 |
|
3687 | module.exports = shouldUseNative() ? Object.assign : function (target, source) {
|
3688 | var from;
|
3689 | var to = toObject(target);
|
3690 | var symbols;
|
3691 |
|
3692 | for (var s = 1; s < arguments.length; s++) {
|
3693 | from = Object(arguments[s]);
|
3694 |
|
3695 | for (var key in from) {
|
3696 | if (hasOwnProperty.call(from, key)) {
|
3697 | to[key] = from[key];
|
3698 | }
|
3699 | }
|
3700 |
|
3701 | if (getOwnPropertySymbols) {
|
3702 | symbols = getOwnPropertySymbols(from);
|
3703 | for (var i = 0; i < symbols.length; i++) {
|
3704 | if (propIsEnumerable.call(from, symbols[i])) {
|
3705 | to[symbols[i]] = from[symbols[i]];
|
3706 | }
|
3707 | }
|
3708 | }
|
3709 | }
|
3710 |
|
3711 | return to;
|
3712 | };
|
3713 |
|
3714 |
|
3715 | }),
|
3716 |
|
3717 | (function(module, exports, __webpack_require__) {
|
3718 |
|
3719 | 'use strict';
|
3720 |
|
3721 | exports.__esModule = true;
|
3722 |
|
3723 | 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; };
|
3724 |
|
3725 | var _Event = __webpack_require__(45);
|
3726 |
|
3727 | var _Event2 = _interopRequireDefault(_Event);
|
3728 |
|
3729 | var _componentClasses = __webpack_require__(46);
|
3730 |
|
3731 | var _componentClasses2 = _interopRequireDefault(_componentClasses);
|
3732 |
|
3733 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
3734 |
|
3735 | var isCssAnimationSupported = _Event2.default.endEvents.length !== 0;
|
3736 |
|
3737 |
|
3738 | var capitalPrefixes = ['Webkit', 'Moz', 'O',
|
3739 |
|
3740 | 'ms'];
|
3741 | var prefixes = ['-webkit-', '-moz-', '-o-', 'ms-', ''];
|
3742 |
|
3743 | function getStyleProperty(node, name) {
|
3744 | var style = window.getComputedStyle(node);
|
3745 |
|
3746 | var ret = '';
|
3747 | for (var i = 0; i < prefixes.length; i++) {
|
3748 | ret = style.getPropertyValue(prefixes[i] + name);
|
3749 | if (ret) {
|
3750 | break;
|
3751 | }
|
3752 | }
|
3753 | return ret;
|
3754 | }
|
3755 |
|
3756 | function fixBrowserByTimeout(node) {
|
3757 | if (isCssAnimationSupported) {
|
3758 | var transitionDelay = parseFloat(getStyleProperty(node, 'transition-delay')) || 0;
|
3759 | var transitionDuration = parseFloat(getStyleProperty(node, 'transition-duration')) || 0;
|
3760 | var animationDelay = parseFloat(getStyleProperty(node, 'animation-delay')) || 0;
|
3761 | var animationDuration = parseFloat(getStyleProperty(node, 'animation-duration')) || 0;
|
3762 | var time = Math.max(transitionDuration + transitionDelay, animationDuration + animationDelay);
|
3763 |
|
3764 | node.rcEndAnimTimeout = setTimeout(function () {
|
3765 | node.rcEndAnimTimeout = null;
|
3766 | if (node.rcEndListener) {
|
3767 | node.rcEndListener();
|
3768 | }
|
3769 | }, time * 1000 + 200);
|
3770 | }
|
3771 | }
|
3772 |
|
3773 | function clearBrowserBugTimeout(node) {
|
3774 | if (node.rcEndAnimTimeout) {
|
3775 | clearTimeout(node.rcEndAnimTimeout);
|
3776 | node.rcEndAnimTimeout = null;
|
3777 | }
|
3778 | }
|
3779 |
|
3780 | var cssAnimation = function cssAnimation(node, transitionName, endCallback) {
|
3781 | var nameIsObj = (typeof transitionName === 'undefined' ? 'undefined' : _typeof(transitionName)) === 'object';
|
3782 | var className = nameIsObj ? transitionName.name : transitionName;
|
3783 | var activeClassName = nameIsObj ? transitionName.active : transitionName + '-active';
|
3784 | var end = endCallback;
|
3785 | var start = void 0;
|
3786 | var active = void 0;
|
3787 | var nodeClasses = (0, _componentClasses2.default)(node);
|
3788 |
|
3789 | if (endCallback && Object.prototype.toString.call(endCallback) === '[object Object]') {
|
3790 | end = endCallback.end;
|
3791 | start = endCallback.start;
|
3792 | active = endCallback.active;
|
3793 | }
|
3794 |
|
3795 | if (node.rcEndListener) {
|
3796 | node.rcEndListener();
|
3797 | }
|
3798 |
|
3799 | node.rcEndListener = function (e) {
|
3800 | if (e && e.target !== node) {
|
3801 | return;
|
3802 | }
|
3803 |
|
3804 | if (node.rcAnimTimeout) {
|
3805 | clearTimeout(node.rcAnimTimeout);
|
3806 | node.rcAnimTimeout = null;
|
3807 | }
|
3808 |
|
3809 | clearBrowserBugTimeout(node);
|
3810 |
|
3811 | nodeClasses.remove(className);
|
3812 | nodeClasses.remove(activeClassName);
|
3813 |
|
3814 | _Event2.default.removeEndEventListener(node, node.rcEndListener);
|
3815 | node.rcEndListener = null;
|
3816 |
|
3817 |
|
3818 |
|
3819 | if (end) {
|
3820 | end();
|
3821 | }
|
3822 | };
|
3823 |
|
3824 | _Event2.default.addEndEventListener(node, node.rcEndListener);
|
3825 |
|
3826 | if (start) {
|
3827 | start();
|
3828 | }
|
3829 | nodeClasses.add(className);
|
3830 |
|
3831 | node.rcAnimTimeout = setTimeout(function () {
|
3832 | node.rcAnimTimeout = null;
|
3833 | nodeClasses.add(activeClassName);
|
3834 | if (active) {
|
3835 | setTimeout(active, 0);
|
3836 | }
|
3837 | fixBrowserByTimeout(node);
|
3838 |
|
3839 | }, 30);
|
3840 |
|
3841 | return {
|
3842 | stop: function stop() {
|
3843 | if (node.rcEndListener) {
|
3844 | node.rcEndListener();
|
3845 | }
|
3846 | }
|
3847 | };
|
3848 | };
|
3849 |
|
3850 | cssAnimation.style = function (node, style, callback) {
|
3851 | if (node.rcEndListener) {
|
3852 | node.rcEndListener();
|
3853 | }
|
3854 |
|
3855 | node.rcEndListener = function (e) {
|
3856 | if (e && e.target !== node) {
|
3857 | return;
|
3858 | }
|
3859 |
|
3860 | if (node.rcAnimTimeout) {
|
3861 | clearTimeout(node.rcAnimTimeout);
|
3862 | node.rcAnimTimeout = null;
|
3863 | }
|
3864 |
|
3865 | clearBrowserBugTimeout(node);
|
3866 |
|
3867 | _Event2.default.removeEndEventListener(node, node.rcEndListener);
|
3868 | node.rcEndListener = null;
|
3869 |
|
3870 |
|
3871 |
|
3872 | if (callback) {
|
3873 | callback();
|
3874 | }
|
3875 | };
|
3876 |
|
3877 | _Event2.default.addEndEventListener(node, node.rcEndListener);
|
3878 |
|
3879 | node.rcAnimTimeout = setTimeout(function () {
|
3880 | for (var s in style) {
|
3881 | if (style.hasOwnProperty(s)) {
|
3882 | node.style[s] = style[s];
|
3883 | }
|
3884 | }
|
3885 | node.rcAnimTimeout = null;
|
3886 | fixBrowserByTimeout(node);
|
3887 | }, 0);
|
3888 | };
|
3889 |
|
3890 | cssAnimation.setTransition = function (node, p, value) {
|
3891 | var property = p;
|
3892 | var v = value;
|
3893 | if (value === undefined) {
|
3894 | v = property;
|
3895 | property = '';
|
3896 | }
|
3897 | property = property || '';
|
3898 | capitalPrefixes.forEach(function (prefix) {
|
3899 | node.style[prefix + 'Transition' + property] = v;
|
3900 | });
|
3901 | };
|
3902 |
|
3903 | cssAnimation.isCssAnimationSupported = isCssAnimationSupported;
|
3904 |
|
3905 | exports.default = cssAnimation;
|
3906 |
|
3907 | }),
|
3908 |
|
3909 | (function(module, exports) {
|
3910 |
|
3911 | 'use strict';
|
3912 |
|
3913 | exports.__esModule = true;
|
3914 | var EVENT_NAME_MAP = {
|
3915 | transitionend: {
|
3916 | transition: 'transitionend',
|
3917 | WebkitTransition: 'webkitTransitionEnd',
|
3918 | MozTransition: 'mozTransitionEnd',
|
3919 | OTransition: 'oTransitionEnd',
|
3920 | msTransition: 'MSTransitionEnd'
|
3921 | },
|
3922 |
|
3923 | animationend: {
|
3924 | animation: 'animationend',
|
3925 | WebkitAnimation: 'webkitAnimationEnd',
|
3926 | MozAnimation: 'mozAnimationEnd',
|
3927 | OAnimation: 'oAnimationEnd',
|
3928 | msAnimation: 'MSAnimationEnd'
|
3929 | }
|
3930 | };
|
3931 |
|
3932 | var endEvents = [];
|
3933 |
|
3934 | function detectEvents() {
|
3935 | var testEl = document.createElement('div');
|
3936 | var style = testEl.style;
|
3937 |
|
3938 | if (!('AnimationEvent' in window)) {
|
3939 | delete EVENT_NAME_MAP.animationend.animation;
|
3940 | }
|
3941 |
|
3942 | if (!('TransitionEvent' in window)) {
|
3943 | delete EVENT_NAME_MAP.transitionend.transition;
|
3944 | }
|
3945 |
|
3946 | for (var baseEventName in EVENT_NAME_MAP) {
|
3947 | if (EVENT_NAME_MAP.hasOwnProperty(baseEventName)) {
|
3948 | var baseEvents = EVENT_NAME_MAP[baseEventName];
|
3949 | for (var styleName in baseEvents) {
|
3950 | if (styleName in style) {
|
3951 | endEvents.push(baseEvents[styleName]);
|
3952 | break;
|
3953 | }
|
3954 | }
|
3955 | }
|
3956 | }
|
3957 | }
|
3958 |
|
3959 | if (typeof window !== 'undefined' && typeof document !== 'undefined') {
|
3960 | detectEvents();
|
3961 | }
|
3962 |
|
3963 | function addEventListener(node, eventName, eventListener) {
|
3964 | node.addEventListener(eventName, eventListener, false);
|
3965 | }
|
3966 |
|
3967 | function removeEventListener(node, eventName, eventListener) {
|
3968 | node.removeEventListener(eventName, eventListener, false);
|
3969 | }
|
3970 |
|
3971 | var TransitionEvents = {
|
3972 | addEndEventListener: function addEndEventListener(node, eventListener) {
|
3973 | if (endEvents.length === 0) {
|
3974 | window.setTimeout(eventListener, 0);
|
3975 | return;
|
3976 | }
|
3977 | endEvents.forEach(function (endEvent) {
|
3978 | addEventListener(node, endEvent, eventListener);
|
3979 | });
|
3980 | },
|
3981 |
|
3982 |
|
3983 | endEvents: endEvents,
|
3984 |
|
3985 | removeEndEventListener: function removeEndEventListener(node, eventListener) {
|
3986 | if (endEvents.length === 0) {
|
3987 | return;
|
3988 | }
|
3989 | endEvents.forEach(function (endEvent) {
|
3990 | removeEventListener(node, endEvent, eventListener);
|
3991 | });
|
3992 | }
|
3993 | };
|
3994 |
|
3995 | exports.default = TransitionEvents;
|
3996 |
|
3997 | }),
|
3998 |
|
3999 | (function(module, exports, __webpack_require__) {
|
4000 |
|
4001 | |
4002 |
|
4003 |
|
4004 |
|
4005 | try {
|
4006 | var index = __webpack_require__(47);
|
4007 | } catch (err) {
|
4008 | var index = __webpack_require__(47);
|
4009 | }
|
4010 |
|
4011 | |
4012 |
|
4013 |
|
4014 |
|
4015 | var re = /\s+/;
|
4016 |
|
4017 | |
4018 |
|
4019 |
|
4020 |
|
4021 | var toString = Object.prototype.toString;
|
4022 |
|
4023 | |
4024 |
|
4025 |
|
4026 |
|
4027 |
|
4028 |
|
4029 |
|
4030 |
|
4031 | module.exports = function(el){
|
4032 | return new ClassList(el);
|
4033 | };
|
4034 |
|
4035 | |
4036 |
|
4037 |
|
4038 |
|
4039 |
|
4040 |
|
4041 |
|
4042 | function ClassList(el) {
|
4043 | if (!el || !el.nodeType) {
|
4044 | throw new Error('A DOM element reference is required');
|
4045 | }
|
4046 | this.el = el;
|
4047 | this.list = el.classList;
|
4048 | }
|
4049 |
|
4050 | |
4051 |
|
4052 |
|
4053 |
|
4054 |
|
4055 |
|
4056 |
|
4057 |
|
4058 | ClassList.prototype.add = function(name){
|
4059 |
|
4060 | if (this.list) {
|
4061 | this.list.add(name);
|
4062 | return this;
|
4063 | }
|
4064 |
|
4065 |
|
4066 | var arr = this.array();
|
4067 | var i = index(arr, name);
|
4068 | if (!~i) arr.push(name);
|
4069 | this.el.className = arr.join(' ');
|
4070 | return this;
|
4071 | };
|
4072 |
|
4073 | |
4074 |
|
4075 |
|
4076 |
|
4077 |
|
4078 |
|
4079 |
|
4080 |
|
4081 |
|
4082 |
|
4083 | ClassList.prototype.remove = function(name){
|
4084 | if ('[object RegExp]' == toString.call(name)) {
|
4085 | return this.removeMatching(name);
|
4086 | }
|
4087 |
|
4088 |
|
4089 | if (this.list) {
|
4090 | this.list.remove(name);
|
4091 | return this;
|
4092 | }
|
4093 |
|
4094 |
|
4095 | var arr = this.array();
|
4096 | var i = index(arr, name);
|
4097 | if (~i) arr.splice(i, 1);
|
4098 | this.el.className = arr.join(' ');
|
4099 | return this;
|
4100 | };
|
4101 |
|
4102 | |
4103 |
|
4104 |
|
4105 |
|
4106 |
|
4107 |
|
4108 |
|
4109 |
|
4110 | ClassList.prototype.removeMatching = function(re){
|
4111 | var arr = this.array();
|
4112 | for (var i = 0; i < arr.length; i++) {
|
4113 | if (re.test(arr[i])) {
|
4114 | this.remove(arr[i]);
|
4115 | }
|
4116 | }
|
4117 | return this;
|
4118 | };
|
4119 |
|
4120 | |
4121 |
|
4122 |
|
4123 |
|
4124 |
|
4125 |
|
4126 |
|
4127 |
|
4128 |
|
4129 |
|
4130 |
|
4131 |
|
4132 | ClassList.prototype.toggle = function(name, force){
|
4133 |
|
4134 | if (this.list) {
|
4135 | if ("undefined" !== typeof force) {
|
4136 | if (force !== this.list.toggle(name, force)) {
|
4137 | this.list.toggle(name);
|
4138 | }
|
4139 | } else {
|
4140 | this.list.toggle(name);
|
4141 | }
|
4142 | return this;
|
4143 | }
|
4144 |
|
4145 |
|
4146 | if ("undefined" !== typeof force) {
|
4147 | if (!force) {
|
4148 | this.remove(name);
|
4149 | } else {
|
4150 | this.add(name);
|
4151 | }
|
4152 | } else {
|
4153 | if (this.has(name)) {
|
4154 | this.remove(name);
|
4155 | } else {
|
4156 | this.add(name);
|
4157 | }
|
4158 | }
|
4159 |
|
4160 | return this;
|
4161 | };
|
4162 |
|
4163 | |
4164 |
|
4165 |
|
4166 |
|
4167 |
|
4168 |
|
4169 |
|
4170 | ClassList.prototype.array = function(){
|
4171 | var className = this.el.getAttribute('class') || '';
|
4172 | var str = className.replace(/^\s+|\s+$/g, '');
|
4173 | var arr = str.split(re);
|
4174 | if ('' === arr[0]) arr.shift();
|
4175 | return arr;
|
4176 | };
|
4177 |
|
4178 | |
4179 |
|
4180 |
|
4181 |
|
4182 |
|
4183 |
|
4184 |
|
4185 |
|
4186 | ClassList.prototype.has =
|
4187 | ClassList.prototype.contains = function(name){
|
4188 | return this.list
|
4189 | ? this.list.contains(name)
|
4190 | : !! ~index(this.array(), name);
|
4191 | };
|
4192 |
|
4193 |
|
4194 | }),
|
4195 |
|
4196 | (function(module, exports) {
|
4197 |
|
4198 | module.exports = function(arr, obj){
|
4199 | if (arr.indexOf) return arr.indexOf(obj);
|
4200 | for (var i = 0; i < arr.length; ++i) {
|
4201 | if (arr[i] === obj) return i;
|
4202 | }
|
4203 | return -1;
|
4204 | };
|
4205 |
|
4206 | }),
|
4207 |
|
4208 | (function(module, exports, __webpack_require__) {
|
4209 |
|
4210 | 'use strict';
|
4211 |
|
4212 | exports.__esModule = true;
|
4213 | exports.default = toArray;
|
4214 |
|
4215 | var _react = __webpack_require__(4);
|
4216 |
|
4217 | var _react2 = _interopRequireDefault(_react);
|
4218 |
|
4219 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
4220 |
|
4221 | function toArray(children) {
|
4222 | var ret = [];
|
4223 | _react2.default.Children.forEach(children, function (c) {
|
4224 | ret.push(c);
|
4225 | });
|
4226 | return ret;
|
4227 | }
|
4228 |
|
4229 | }),
|
4230 |
|
4231 | (function(module, exports, __webpack_require__) {
|
4232 |
|
4233 | 'use strict';
|
4234 |
|
4235 | exports.__esModule = true;
|
4236 |
|
4237 | var _react = __webpack_require__(4);
|
4238 |
|
4239 | var _react2 = _interopRequireDefault(_react);
|
4240 |
|
4241 | var _propTypes = __webpack_require__(5);
|
4242 |
|
4243 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
4244 |
|
4245 | var _reactDom = __webpack_require__(12);
|
4246 |
|
4247 | var _reactDom2 = _interopRequireDefault(_reactDom);
|
4248 |
|
4249 | var _domAlign = __webpack_require__(50);
|
4250 |
|
4251 | var _domAlign2 = _interopRequireDefault(_domAlign);
|
4252 |
|
4253 | var _addEventListener = __webpack_require__(39);
|
4254 |
|
4255 | var _addEventListener2 = _interopRequireDefault(_addEventListener);
|
4256 |
|
4257 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
4258 |
|
4259 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
4260 |
|
4261 | 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; }
|
4262 |
|
4263 | 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; }
|
4264 |
|
4265 |
|
4266 |
|
4267 | function isWindow(obj) {
|
4268 |
|
4269 |
|
4270 | return obj != null && obj == obj.window;
|
4271 | }
|
4272 |
|
4273 | function buffer(fn, ms) {
|
4274 | var timer = void 0;
|
4275 |
|
4276 | function clear() {
|
4277 | if (timer) {
|
4278 | clearTimeout(timer);
|
4279 | timer = null;
|
4280 | }
|
4281 | }
|
4282 |
|
4283 | function bufferFn() {
|
4284 | clear();
|
4285 | timer = setTimeout(fn, ms);
|
4286 | }
|
4287 |
|
4288 | bufferFn.clear = clear;
|
4289 |
|
4290 | return bufferFn;
|
4291 | }
|
4292 |
|
4293 | var propTypes = {
|
4294 | childrenProps: _propTypes2.default.object,
|
4295 | align: _propTypes2.default.object.isRequired,
|
4296 | target: _propTypes2.default.func,
|
4297 | onAlign: _propTypes2.default.func,
|
4298 | monitorBufferTime: _propTypes2.default.number,
|
4299 | monitorWindowResize: _propTypes2.default.bool,
|
4300 | disabled: _propTypes2.default.bool,
|
4301 | children: _propTypes2.default.any
|
4302 | };
|
4303 |
|
4304 | var defaultProps = {
|
4305 | target: function target() {
|
4306 | return window;
|
4307 | },
|
4308 | onAlign: function onAlign() {},
|
4309 |
|
4310 | monitorBufferTime: 50,
|
4311 | monitorWindowResize: false,
|
4312 | disabled: false
|
4313 | };
|
4314 |
|
4315 | var Align = function (_React$Component) {
|
4316 | _inherits(Align, _React$Component);
|
4317 |
|
4318 | function Align(props) {
|
4319 | _classCallCheck(this, Align);
|
4320 |
|
4321 | var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
|
4322 |
|
4323 | _initialiseProps.call(_this);
|
4324 |
|
4325 | return _this;
|
4326 | }
|
4327 |
|
4328 | Align.prototype.componentDidMount = function componentDidMount() {
|
4329 | var props = this.props;
|
4330 |
|
4331 | this.forceAlign();
|
4332 | if (!props.disabled && props.monitorWindowResize) {
|
4333 | this.startMonitorWindowResize();
|
4334 | }
|
4335 | };
|
4336 |
|
4337 | Align.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {
|
4338 | var reAlign = false;
|
4339 | var props = this.props;
|
4340 |
|
4341 | if (!props.disabled) {
|
4342 | if (prevProps.disabled || prevProps.align !== props.align) {
|
4343 | reAlign = true;
|
4344 | } else {
|
4345 | var lastTarget = prevProps.target();
|
4346 | var currentTarget = props.target();
|
4347 | if (isWindow(lastTarget) && isWindow(currentTarget)) {
|
4348 | reAlign = false;
|
4349 | } else if (lastTarget !== currentTarget) {
|
4350 | reAlign = true;
|
4351 | }
|
4352 | }
|
4353 | }
|
4354 |
|
4355 | if (reAlign) {
|
4356 | this.forceAlign();
|
4357 | }
|
4358 |
|
4359 | if (props.monitorWindowResize && !props.disabled) {
|
4360 | this.startMonitorWindowResize();
|
4361 | } else {
|
4362 | this.stopMonitorWindowResize();
|
4363 | }
|
4364 | };
|
4365 |
|
4366 | Align.prototype.componentWillUnmount = function componentWillUnmount() {
|
4367 | this.stopMonitorWindowResize();
|
4368 | };
|
4369 |
|
4370 | Align.prototype.render = function render() {
|
4371 | var _props = this.props,
|
4372 | childrenProps = _props.childrenProps,
|
4373 | children = _props.children;
|
4374 |
|
4375 | var child = _react2.default.Children.only(children);
|
4376 | if (childrenProps) {
|
4377 | var newProps = {};
|
4378 | for (var prop in childrenProps) {
|
4379 | if (childrenProps.hasOwnProperty(prop)) {
|
4380 | newProps[prop] = this.props[childrenProps[prop]];
|
4381 | }
|
4382 | }
|
4383 | return _react2.default.cloneElement(child, newProps);
|
4384 | }
|
4385 | return child;
|
4386 | };
|
4387 |
|
4388 | return Align;
|
4389 | }(_react2.default.Component);
|
4390 |
|
4391 | var _initialiseProps = function _initialiseProps() {
|
4392 | var _this2 = this;
|
4393 |
|
4394 | this.startMonitorWindowResize = function () {
|
4395 | if (!_this2.resizeHandler) {
|
4396 | _this2.bufferMonitor = buffer(_this2.forceAlign, _this2.props.monitorBufferTime);
|
4397 | _this2.resizeHandler = (0, _addEventListener2.default)(window, 'resize', _this2.bufferMonitor);
|
4398 | }
|
4399 | };
|
4400 |
|
4401 | this.stopMonitorWindowResize = function () {
|
4402 | if (_this2.resizeHandler) {
|
4403 | _this2.bufferMonitor.clear();
|
4404 | _this2.resizeHandler.remove();
|
4405 | _this2.resizeHandler = null;
|
4406 | }
|
4407 | };
|
4408 |
|
4409 | this.forceAlign = function () {
|
4410 | var props = _this2.props;
|
4411 | if (!props.disabled) {
|
4412 | var source = _reactDom2.default.findDOMNode(_this2);
|
4413 | props.onAlign(source, (0, _domAlign2.default)(source, props.target(), props.align));
|
4414 | }
|
4415 | };
|
4416 | };
|
4417 |
|
4418 | ;
|
4419 |
|
4420 | Align.defaultProps = defaultProps;
|
4421 | Align.propTypes = propTypes;
|
4422 |
|
4423 | exports.default = Align;
|
4424 |
|
4425 | }),
|
4426 |
|
4427 | (function(module, exports, __webpack_require__) {
|
4428 |
|
4429 | 'use strict';
|
4430 |
|
4431 | Object.defineProperty(exports, "__esModule", {
|
4432 | value: true
|
4433 | });
|
4434 |
|
4435 | var _utils = __webpack_require__(51);
|
4436 |
|
4437 | var _utils2 = _interopRequireDefault(_utils);
|
4438 |
|
4439 | var _getOffsetParent = __webpack_require__(53);
|
4440 |
|
4441 | var _getOffsetParent2 = _interopRequireDefault(_getOffsetParent);
|
4442 |
|
4443 | var _getVisibleRectForElement = __webpack_require__(54);
|
4444 |
|
4445 | var _getVisibleRectForElement2 = _interopRequireDefault(_getVisibleRectForElement);
|
4446 |
|
4447 | var _adjustForViewport = __webpack_require__(56);
|
4448 |
|
4449 | var _adjustForViewport2 = _interopRequireDefault(_adjustForViewport);
|
4450 |
|
4451 | var _getRegion = __webpack_require__(57);
|
4452 |
|
4453 | var _getRegion2 = _interopRequireDefault(_getRegion);
|
4454 |
|
4455 | var _getElFuturePos = __webpack_require__(58);
|
4456 |
|
4457 | var _getElFuturePos2 = _interopRequireDefault(_getElFuturePos);
|
4458 |
|
4459 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
4460 |
|
4461 |
|
4462 |
|
4463 | |
4464 |
|
4465 |
|
4466 |
|
4467 |
|
4468 | function isFailX(elFuturePos, elRegion, visibleRect) {
|
4469 | return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;
|
4470 | }
|
4471 |
|
4472 | function isFailY(elFuturePos, elRegion, visibleRect) {
|
4473 | return elFuturePos.top < visibleRect.top || elFuturePos.top + elRegion.height > visibleRect.bottom;
|
4474 | }
|
4475 |
|
4476 | function isCompleteFailX(elFuturePos, elRegion, visibleRect) {
|
4477 | return elFuturePos.left > visibleRect.right || elFuturePos.left + elRegion.width < visibleRect.left;
|
4478 | }
|
4479 |
|
4480 | function isCompleteFailY(elFuturePos, elRegion, visibleRect) {
|
4481 | return elFuturePos.top > visibleRect.bottom || elFuturePos.top + elRegion.height < visibleRect.top;
|
4482 | }
|
4483 |
|
4484 | function isOutOfVisibleRect(target) {
|
4485 | var visibleRect = (0, _getVisibleRectForElement2['default'])(target);
|
4486 | var targetRegion = (0, _getRegion2['default'])(target);
|
4487 |
|
4488 | return !visibleRect || targetRegion.left + targetRegion.width <= visibleRect.left || targetRegion.top + targetRegion.height <= visibleRect.top || targetRegion.left >= visibleRect.right || targetRegion.top >= visibleRect.bottom;
|
4489 | }
|
4490 |
|
4491 | function flip(points, reg, map) {
|
4492 | var ret = [];
|
4493 | _utils2['default'].each(points, function (p) {
|
4494 | ret.push(p.replace(reg, function (m) {
|
4495 | return map[m];
|
4496 | }));
|
4497 | });
|
4498 | return ret;
|
4499 | }
|
4500 |
|
4501 | function flipOffset(offset, index) {
|
4502 | offset[index] = -offset[index];
|
4503 | return offset;
|
4504 | }
|
4505 |
|
4506 | function convertOffset(str, offsetLen) {
|
4507 | var n = void 0;
|
4508 | if (/%$/.test(str)) {
|
4509 | n = parseInt(str.substring(0, str.length - 1), 10) / 100 * offsetLen;
|
4510 | } else {
|
4511 | n = parseInt(str, 10);
|
4512 | }
|
4513 | return n || 0;
|
4514 | }
|
4515 |
|
4516 | function normalizeOffset(offset, el) {
|
4517 | offset[0] = convertOffset(offset[0], el.width);
|
4518 | offset[1] = convertOffset(offset[1], el.height);
|
4519 | }
|
4520 |
|
4521 | function domAlign(el, refNode, align) {
|
4522 | var points = align.points;
|
4523 | var offset = align.offset || [0, 0];
|
4524 | var targetOffset = align.targetOffset || [0, 0];
|
4525 | var overflow = align.overflow;
|
4526 | var target = align.target || refNode;
|
4527 | var source = align.source || el;
|
4528 | offset = [].concat(offset);
|
4529 | targetOffset = [].concat(targetOffset);
|
4530 | overflow = overflow || {};
|
4531 | var newOverflowCfg = {};
|
4532 | var fail = 0;
|
4533 |
|
4534 | var visibleRect = (0, _getVisibleRectForElement2['default'])(source);
|
4535 |
|
4536 | var elRegion = (0, _getRegion2['default'])(source);
|
4537 |
|
4538 | var refNodeRegion = (0, _getRegion2['default'])(target);
|
4539 |
|
4540 | normalizeOffset(offset, elRegion);
|
4541 | normalizeOffset(targetOffset, refNodeRegion);
|
4542 |
|
4543 | var elFuturePos = (0, _getElFuturePos2['default'])(elRegion, refNodeRegion, points, offset, targetOffset);
|
4544 |
|
4545 | var newElRegion = _utils2['default'].merge(elRegion, elFuturePos);
|
4546 |
|
4547 | var isTargetNotOutOfVisible = !isOutOfVisibleRect(target);
|
4548 |
|
4549 |
|
4550 | if (visibleRect && (overflow.adjustX || overflow.adjustY) && isTargetNotOutOfVisible) {
|
4551 | if (overflow.adjustX) {
|
4552 |
|
4553 | if (isFailX(elFuturePos, elRegion, visibleRect)) {
|
4554 |
|
4555 | var newPoints = flip(points, /[lr]/ig, {
|
4556 | l: 'r',
|
4557 | r: 'l'
|
4558 | });
|
4559 |
|
4560 | var newOffset = flipOffset(offset, 0);
|
4561 | var newTargetOffset = flipOffset(targetOffset, 0);
|
4562 | var newElFuturePos = (0, _getElFuturePos2['default'])(elRegion, refNodeRegion, newPoints, newOffset, newTargetOffset);
|
4563 |
|
4564 | if (!isCompleteFailX(newElFuturePos, elRegion, visibleRect)) {
|
4565 | fail = 1;
|
4566 | points = newPoints;
|
4567 | offset = newOffset;
|
4568 | targetOffset = newTargetOffset;
|
4569 | }
|
4570 | }
|
4571 | }
|
4572 |
|
4573 | if (overflow.adjustY) {
|
4574 |
|
4575 | if (isFailY(elFuturePos, elRegion, visibleRect)) {
|
4576 |
|
4577 | var _newPoints = flip(points, /[tb]/ig, {
|
4578 | t: 'b',
|
4579 | b: 't'
|
4580 | });
|
4581 |
|
4582 | var _newOffset = flipOffset(offset, 1);
|
4583 | var _newTargetOffset = flipOffset(targetOffset, 1);
|
4584 | var _newElFuturePos = (0, _getElFuturePos2['default'])(elRegion, refNodeRegion, _newPoints, _newOffset, _newTargetOffset);
|
4585 |
|
4586 | if (!isCompleteFailY(_newElFuturePos, elRegion, visibleRect)) {
|
4587 | fail = 1;
|
4588 | points = _newPoints;
|
4589 | offset = _newOffset;
|
4590 | targetOffset = _newTargetOffset;
|
4591 | }
|
4592 | }
|
4593 | }
|
4594 |
|
4595 |
|
4596 | if (fail) {
|
4597 | elFuturePos = (0, _getElFuturePos2['default'])(elRegion, refNodeRegion, points, offset, targetOffset);
|
4598 | _utils2['default'].mix(newElRegion, elFuturePos);
|
4599 | }
|
4600 | var isStillFailX = isFailX(elFuturePos, elRegion, visibleRect);
|
4601 | var isStillFailY = isFailY(elFuturePos, elRegion, visibleRect);
|
4602 |
|
4603 |
|
4604 | if (isStillFailX || isStillFailY) {
|
4605 | points = align.points;
|
4606 | offset = align.offset || [0, 0];
|
4607 | targetOffset = align.targetOffset || [0, 0];
|
4608 | }
|
4609 |
|
4610 | newOverflowCfg.adjustX = overflow.adjustX && isStillFailX;
|
4611 | newOverflowCfg.adjustY = overflow.adjustY && isStillFailY;
|
4612 |
|
4613 |
|
4614 | if (newOverflowCfg.adjustX || newOverflowCfg.adjustY) {
|
4615 | newElRegion = (0, _adjustForViewport2['default'])(elFuturePos, elRegion, visibleRect, newOverflowCfg);
|
4616 | }
|
4617 | }
|
4618 |
|
4619 |
|
4620 | if (newElRegion.width !== elRegion.width) {
|
4621 | _utils2['default'].css(source, 'width', _utils2['default'].width(source) + newElRegion.width - elRegion.width);
|
4622 | }
|
4623 |
|
4624 | if (newElRegion.height !== elRegion.height) {
|
4625 | _utils2['default'].css(source, 'height', _utils2['default'].height(source) + newElRegion.height - elRegion.height);
|
4626 | }
|
4627 |
|
4628 |
|
4629 |
|
4630 |
|
4631 | _utils2['default'].offset(source, {
|
4632 | left: newElRegion.left,
|
4633 | top: newElRegion.top
|
4634 | }, {
|
4635 | useCssRight: align.useCssRight,
|
4636 | useCssBottom: align.useCssBottom,
|
4637 | useCssTransform: align.useCssTransform
|
4638 | });
|
4639 |
|
4640 | return {
|
4641 | points: points,
|
4642 | offset: offset,
|
4643 | targetOffset: targetOffset,
|
4644 | overflow: newOverflowCfg
|
4645 | };
|
4646 | }
|
4647 |
|
4648 | domAlign.__getOffsetParent = _getOffsetParent2['default'];
|
4649 |
|
4650 | domAlign.__getVisibleRectForElement = _getVisibleRectForElement2['default'];
|
4651 |
|
4652 | exports['default'] = domAlign;
|
4653 | |
4654 |
|
4655 |
|
4656 |
|
4657 |
|
4658 |
|
4659 |
|
4660 |
|
4661 |
|
4662 | module.exports = exports['default'];
|
4663 |
|
4664 | }),
|
4665 |
|
4666 | (function(module, exports, __webpack_require__) {
|
4667 |
|
4668 | 'use strict';
|
4669 |
|
4670 | Object.defineProperty(exports, "__esModule", {
|
4671 | value: true
|
4672 | });
|
4673 |
|
4674 | 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; };
|
4675 |
|
4676 | var _propertyUtils = __webpack_require__(52);
|
4677 |
|
4678 | var RE_NUM = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source;
|
4679 |
|
4680 | var getComputedStyleX = void 0;
|
4681 |
|
4682 |
|
4683 | function forceRelayout(elem) {
|
4684 | var originalStyle = elem.style.display;
|
4685 | elem.style.display = 'none';
|
4686 | elem.offsetHeight;
|
4687 | elem.style.display = originalStyle;
|
4688 | }
|
4689 |
|
4690 | function css(el, name, v) {
|
4691 | var value = v;
|
4692 | if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {
|
4693 | for (var i in name) {
|
4694 | if (name.hasOwnProperty(i)) {
|
4695 | css(el, i, name[i]);
|
4696 | }
|
4697 | }
|
4698 | return undefined;
|
4699 | }
|
4700 | if (typeof value !== 'undefined') {
|
4701 | if (typeof value === 'number') {
|
4702 | value = value + 'px';
|
4703 | }
|
4704 | el.style[name] = value;
|
4705 | return undefined;
|
4706 | }
|
4707 | return getComputedStyleX(el, name);
|
4708 | }
|
4709 |
|
4710 | function getClientPosition(elem) {
|
4711 | var box = void 0;
|
4712 | var x = void 0;
|
4713 | var y = void 0;
|
4714 | var doc = elem.ownerDocument;
|
4715 | var body = doc.body;
|
4716 | var docElem = doc && doc.documentElement;
|
4717 |
|
4718 | box = elem.getBoundingClientRect();
|
4719 |
|
4720 |
|
4721 |
|
4722 |
|
4723 |
|
4724 | x = box.left;
|
4725 | y = box.top;
|
4726 |
|
4727 |
|
4728 |
|
4729 |
|
4730 |
|
4731 |
|
4732 |
|
4733 |
|
4734 |
|
4735 |
|
4736 |
|
4737 |
|
4738 |
|
4739 |
|
4740 |
|
4741 |
|
4742 |
|
4743 |
|
4744 |
|
4745 |
|
4746 |
|
4747 | x -= docElem.clientLeft || body.clientLeft || 0;
|
4748 | y -= docElem.clientTop || body.clientTop || 0;
|
4749 |
|
4750 | return {
|
4751 | left: x,
|
4752 | top: y
|
4753 | };
|
4754 | }
|
4755 |
|
4756 | function getScroll(w, top) {
|
4757 | var ret = w['page' + (top ? 'Y' : 'X') + 'Offset'];
|
4758 | var method = 'scroll' + (top ? 'Top' : 'Left');
|
4759 | if (typeof ret !== 'number') {
|
4760 | var d = w.document;
|
4761 |
|
4762 | ret = d.documentElement[method];
|
4763 | if (typeof ret !== 'number') {
|
4764 |
|
4765 | ret = d.body[method];
|
4766 | }
|
4767 | }
|
4768 | return ret;
|
4769 | }
|
4770 |
|
4771 | function getScrollLeft(w) {
|
4772 | return getScroll(w);
|
4773 | }
|
4774 |
|
4775 | function getScrollTop(w) {
|
4776 | return getScroll(w, true);
|
4777 | }
|
4778 |
|
4779 | function getOffset(el) {
|
4780 | var pos = getClientPosition(el);
|
4781 | var doc = el.ownerDocument;
|
4782 | var w = doc.defaultView || doc.parentWindow;
|
4783 | pos.left += getScrollLeft(w);
|
4784 | pos.top += getScrollTop(w);
|
4785 | return pos;
|
4786 | }
|
4787 |
|
4788 | |
4789 |
|
4790 |
|
4791 |
|
4792 | function isWindow(obj) {
|
4793 |
|
4794 |
|
4795 | return obj !== null && obj !== undefined && obj == obj.window;
|
4796 | }
|
4797 |
|
4798 | function getDocument(node) {
|
4799 | if (isWindow(node)) {
|
4800 | return node.document;
|
4801 | }
|
4802 | if (node.nodeType === 9) {
|
4803 | return node;
|
4804 | }
|
4805 | return node.ownerDocument;
|
4806 | }
|
4807 |
|
4808 | function _getComputedStyle(elem, name, cs) {
|
4809 | var computedStyle = cs;
|
4810 | var val = '';
|
4811 | var d = getDocument(elem);
|
4812 | computedStyle = computedStyle || d.defaultView.getComputedStyle(elem, null);
|
4813 |
|
4814 |
|
4815 | if (computedStyle) {
|
4816 | val = computedStyle.getPropertyValue(name) || computedStyle[name];
|
4817 | }
|
4818 |
|
4819 | return val;
|
4820 | }
|
4821 |
|
4822 | var _RE_NUM_NO_PX = new RegExp('^(' + RE_NUM + ')(?!px)[a-z%]+$', 'i');
|
4823 | var RE_POS = /^(top|right|bottom|left)$/;
|
4824 | var CURRENT_STYLE = 'currentStyle';
|
4825 | var RUNTIME_STYLE = 'runtimeStyle';
|
4826 | var LEFT = 'left';
|
4827 | var PX = 'px';
|
4828 |
|
4829 | function _getComputedStyleIE(elem, name) {
|
4830 |
|
4831 |
|
4832 | var ret = elem[CURRENT_STYLE] && elem[CURRENT_STYLE][name];
|
4833 |
|
4834 |
|
4835 |
|
4836 |
|
4837 |
|
4838 |
|
4839 |
|
4840 |
|
4841 |
|
4842 |
|
4843 |
|
4844 | if (_RE_NUM_NO_PX.test(ret) && !RE_POS.test(name)) {
|
4845 |
|
4846 | var style = elem.style;
|
4847 | var left = style[LEFT];
|
4848 | var rsLeft = elem[RUNTIME_STYLE][LEFT];
|
4849 |
|
4850 |
|
4851 | elem[RUNTIME_STYLE][LEFT] = elem[CURRENT_STYLE][LEFT];
|
4852 |
|
4853 |
|
4854 | style[LEFT] = name === 'fontSize' ? '1em' : ret || 0;
|
4855 | ret = style.pixelLeft + PX;
|
4856 |
|
4857 |
|
4858 | style[LEFT] = left;
|
4859 |
|
4860 | elem[RUNTIME_STYLE][LEFT] = rsLeft;
|
4861 | }
|
4862 | return ret === '' ? 'auto' : ret;
|
4863 | }
|
4864 |
|
4865 | if (typeof window !== 'undefined') {
|
4866 | getComputedStyleX = window.getComputedStyle ? _getComputedStyle : _getComputedStyleIE;
|
4867 | }
|
4868 |
|
4869 | function getOffsetDirection(dir, option) {
|
4870 | if (dir === 'left') {
|
4871 | return option.useCssRight ? 'right' : dir;
|
4872 | }
|
4873 | return option.useCssBottom ? 'bottom' : dir;
|
4874 | }
|
4875 |
|
4876 | function oppositeOffsetDirection(dir) {
|
4877 | if (dir === 'left') {
|
4878 | return 'right';
|
4879 | } else if (dir === 'right') {
|
4880 | return 'left';
|
4881 | } else if (dir === 'top') {
|
4882 | return 'bottom';
|
4883 | } else if (dir === 'bottom') {
|
4884 | return 'top';
|
4885 | }
|
4886 | }
|
4887 |
|
4888 |
|
4889 | function setLeftTop(elem, offset, option) {
|
4890 |
|
4891 | if (css(elem, 'position') === 'static') {
|
4892 | elem.style.position = 'relative';
|
4893 | }
|
4894 | var presetH = -999;
|
4895 | var presetV = -999;
|
4896 | var horizontalProperty = getOffsetDirection('left', option);
|
4897 | var verticalProperty = getOffsetDirection('top', option);
|
4898 | var oppositeHorizontalProperty = oppositeOffsetDirection(horizontalProperty);
|
4899 | var oppositeVerticalProperty = oppositeOffsetDirection(verticalProperty);
|
4900 |
|
4901 | if (horizontalProperty !== 'left') {
|
4902 | presetH = 999;
|
4903 | }
|
4904 |
|
4905 | if (verticalProperty !== 'top') {
|
4906 | presetV = 999;
|
4907 | }
|
4908 | var originalTransition = '';
|
4909 | var originalOffset = getOffset(elem);
|
4910 | if ('left' in offset || 'top' in offset) {
|
4911 | originalTransition = (0, _propertyUtils.getTransitionProperty)(elem) || '';
|
4912 | (0, _propertyUtils.setTransitionProperty)(elem, 'none');
|
4913 | }
|
4914 | if ('left' in offset) {
|
4915 | elem.style[oppositeHorizontalProperty] = '';
|
4916 | elem.style[horizontalProperty] = presetH + 'px';
|
4917 | }
|
4918 | if ('top' in offset) {
|
4919 | elem.style[oppositeVerticalProperty] = '';
|
4920 | elem.style[verticalProperty] = presetV + 'px';
|
4921 | }
|
4922 |
|
4923 | forceRelayout(elem);
|
4924 | var old = getOffset(elem);
|
4925 | var originalStyle = {};
|
4926 | for (var key in offset) {
|
4927 | if (offset.hasOwnProperty(key)) {
|
4928 | var dir = getOffsetDirection(key, option);
|
4929 | var preset = key === 'left' ? presetH : presetV;
|
4930 | var off = originalOffset[key] - old[key];
|
4931 | if (dir === key) {
|
4932 | originalStyle[dir] = preset + off;
|
4933 | } else {
|
4934 | originalStyle[dir] = preset - off;
|
4935 | }
|
4936 | }
|
4937 | }
|
4938 | css(elem, originalStyle);
|
4939 |
|
4940 | forceRelayout(elem);
|
4941 | if ('left' in offset || 'top' in offset) {
|
4942 | (0, _propertyUtils.setTransitionProperty)(elem, originalTransition);
|
4943 | }
|
4944 | var ret = {};
|
4945 | for (var _key in offset) {
|
4946 | if (offset.hasOwnProperty(_key)) {
|
4947 | var _dir = getOffsetDirection(_key, option);
|
4948 | var _off = offset[_key] - originalOffset[_key];
|
4949 | if (_key === _dir) {
|
4950 | ret[_dir] = originalStyle[_dir] + _off;
|
4951 | } else {
|
4952 | ret[_dir] = originalStyle[_dir] - _off;
|
4953 | }
|
4954 | }
|
4955 | }
|
4956 | css(elem, ret);
|
4957 | }
|
4958 |
|
4959 | function setTransform(elem, offset) {
|
4960 | var originalOffset = getOffset(elem);
|
4961 | var originalXY = (0, _propertyUtils.getTransformXY)(elem);
|
4962 | var resultXY = { x: originalXY.x, y: originalXY.y };
|
4963 | if ('left' in offset) {
|
4964 | resultXY.x = originalXY.x + offset.left - originalOffset.left;
|
4965 | }
|
4966 | if ('top' in offset) {
|
4967 | resultXY.y = originalXY.y + offset.top - originalOffset.top;
|
4968 | }
|
4969 | (0, _propertyUtils.setTransformXY)(elem, resultXY);
|
4970 | }
|
4971 |
|
4972 | function setOffset(elem, offset, option) {
|
4973 | if (option.useCssRight || option.useCssBottom) {
|
4974 | setLeftTop(elem, offset, option);
|
4975 | } else if (option.useCssTransform && (0, _propertyUtils.getTransformName)() in document.body.style) {
|
4976 | setTransform(elem, offset, option);
|
4977 | } else {
|
4978 | setLeftTop(elem, offset, option);
|
4979 | }
|
4980 | }
|
4981 |
|
4982 | function each(arr, fn) {
|
4983 | for (var i = 0; i < arr.length; i++) {
|
4984 | fn(arr[i]);
|
4985 | }
|
4986 | }
|
4987 |
|
4988 | function isBorderBoxFn(elem) {
|
4989 | return getComputedStyleX(elem, 'boxSizing') === 'border-box';
|
4990 | }
|
4991 |
|
4992 | var BOX_MODELS = ['margin', 'border', 'padding'];
|
4993 | var CONTENT_INDEX = -1;
|
4994 | var PADDING_INDEX = 2;
|
4995 | var BORDER_INDEX = 1;
|
4996 | var MARGIN_INDEX = 0;
|
4997 |
|
4998 | function swap(elem, options, callback) {
|
4999 | var old = {};
|
5000 | var style = elem.style;
|
5001 | var name = void 0;
|
5002 |
|
5003 |
|
5004 | for (name in options) {
|
5005 | if (options.hasOwnProperty(name)) {
|
5006 | old[name] = style[name];
|
5007 | style[name] = options[name];
|
5008 | }
|
5009 | }
|
5010 |
|
5011 | callback.call(elem);
|
5012 |
|
5013 |
|
5014 | for (name in options) {
|
5015 | if (options.hasOwnProperty(name)) {
|
5016 | style[name] = old[name];
|
5017 | }
|
5018 | }
|
5019 | }
|
5020 |
|
5021 | function getPBMWidth(elem, props, which) {
|
5022 | var value = 0;
|
5023 | var prop = void 0;
|
5024 | var j = void 0;
|
5025 | var i = void 0;
|
5026 | for (j = 0; j < props.length; j++) {
|
5027 | prop = props[j];
|
5028 | if (prop) {
|
5029 | for (i = 0; i < which.length; i++) {
|
5030 | var cssProp = void 0;
|
5031 | if (prop === 'border') {
|
5032 | cssProp = '' + prop + which[i] + 'Width';
|
5033 | } else {
|
5034 | cssProp = prop + which[i];
|
5035 | }
|
5036 | value += parseFloat(getComputedStyleX(elem, cssProp)) || 0;
|
5037 | }
|
5038 | }
|
5039 | }
|
5040 | return value;
|
5041 | }
|
5042 |
|
5043 | var domUtils = {};
|
5044 |
|
5045 | each(['Width', 'Height'], function (name) {
|
5046 | domUtils['doc' + name] = function (refWin) {
|
5047 | var d = refWin.document;
|
5048 | return Math.max(
|
5049 |
|
5050 |
|
5051 | d.documentElement['scroll' + name],
|
5052 |
|
5053 | d.body['scroll' + name], domUtils['viewport' + name](d));
|
5054 | };
|
5055 |
|
5056 | domUtils['viewport' + name] = function (win) {
|
5057 |
|
5058 | var prop = 'client' + name;
|
5059 | var doc = win.document;
|
5060 | var body = doc.body;
|
5061 | var documentElement = doc.documentElement;
|
5062 | var documentElementProp = documentElement[prop];
|
5063 |
|
5064 |
|
5065 | return doc.compatMode === 'CSS1Compat' && documentElementProp || body && body[prop] || documentElementProp;
|
5066 | };
|
5067 | });
|
5068 |
|
5069 | |
5070 |
|
5071 |
|
5072 |
|
5073 |
|
5074 |
|
5075 |
|
5076 |
|
5077 | function getWH(elem, name, ex) {
|
5078 | var extra = ex;
|
5079 | if (isWindow(elem)) {
|
5080 | return name === 'width' ? domUtils.viewportWidth(elem) : domUtils.viewportHeight(elem);
|
5081 | } else if (elem.nodeType === 9) {
|
5082 | return name === 'width' ? domUtils.docWidth(elem) : domUtils.docHeight(elem);
|
5083 | }
|
5084 | var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];
|
5085 | var borderBoxValue = name === 'width' ? elem.getBoundingClientRect().width : elem.getBoundingClientRect().height;
|
5086 | var computedStyle = getComputedStyleX(elem);
|
5087 | var isBorderBox = isBorderBoxFn(elem, computedStyle);
|
5088 | var cssBoxValue = 0;
|
5089 | if (borderBoxValue === null || borderBoxValue === undefined || borderBoxValue <= 0) {
|
5090 | borderBoxValue = undefined;
|
5091 |
|
5092 | cssBoxValue = getComputedStyleX(elem, name);
|
5093 | if (cssBoxValue === null || cssBoxValue === undefined || Number(cssBoxValue) < 0) {
|
5094 | cssBoxValue = elem.style[name] || 0;
|
5095 | }
|
5096 |
|
5097 | cssBoxValue = parseFloat(cssBoxValue) || 0;
|
5098 | }
|
5099 | if (extra === undefined) {
|
5100 | extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX;
|
5101 | }
|
5102 | var borderBoxValueOrIsBorderBox = borderBoxValue !== undefined || isBorderBox;
|
5103 | var val = borderBoxValue || cssBoxValue;
|
5104 | if (extra === CONTENT_INDEX) {
|
5105 | if (borderBoxValueOrIsBorderBox) {
|
5106 | return val - getPBMWidth(elem, ['border', 'padding'], which, computedStyle);
|
5107 | }
|
5108 | return cssBoxValue;
|
5109 | } else if (borderBoxValueOrIsBorderBox) {
|
5110 | if (extra === BORDER_INDEX) {
|
5111 | return val;
|
5112 | }
|
5113 | return val + (extra === PADDING_INDEX ? -getPBMWidth(elem, ['border'], which, computedStyle) : getPBMWidth(elem, ['margin'], which, computedStyle));
|
5114 | }
|
5115 | return cssBoxValue + getPBMWidth(elem, BOX_MODELS.slice(extra), which, computedStyle);
|
5116 | }
|
5117 |
|
5118 | var cssShow = {
|
5119 | position: 'absolute',
|
5120 | visibility: 'hidden',
|
5121 | display: 'block'
|
5122 | };
|
5123 |
|
5124 |
|
5125 | function getWHIgnoreDisplay() {
|
5126 | for (var _len = arguments.length, args = Array(_len), _key2 = 0; _key2 < _len; _key2++) {
|
5127 | args[_key2] = arguments[_key2];
|
5128 | }
|
5129 |
|
5130 | var val = void 0;
|
5131 | var elem = args[0];
|
5132 |
|
5133 |
|
5134 | if (elem.offsetWidth !== 0) {
|
5135 | val = getWH.apply(undefined, args);
|
5136 | } else {
|
5137 | swap(elem, cssShow, function () {
|
5138 | val = getWH.apply(undefined, args);
|
5139 | });
|
5140 | }
|
5141 | return val;
|
5142 | }
|
5143 |
|
5144 | each(['width', 'height'], function (name) {
|
5145 | var first = name.charAt(0).toUpperCase() + name.slice(1);
|
5146 | domUtils['outer' + first] = function (el, includeMargin) {
|
5147 | return el && getWHIgnoreDisplay(el, name, includeMargin ? MARGIN_INDEX : BORDER_INDEX);
|
5148 | };
|
5149 | var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];
|
5150 |
|
5151 | domUtils[name] = function (elem, v) {
|
5152 | var val = v;
|
5153 | if (val !== undefined) {
|
5154 | if (elem) {
|
5155 | var computedStyle = getComputedStyleX(elem);
|
5156 | var isBorderBox = isBorderBoxFn(elem);
|
5157 | if (isBorderBox) {
|
5158 | val += getPBMWidth(elem, ['padding', 'border'], which, computedStyle);
|
5159 | }
|
5160 | return css(elem, name, val);
|
5161 | }
|
5162 | return undefined;
|
5163 | }
|
5164 | return elem && getWHIgnoreDisplay(elem, name, CONTENT_INDEX);
|
5165 | };
|
5166 | });
|
5167 |
|
5168 | function mix(to, from) {
|
5169 | for (var i in from) {
|
5170 | if (from.hasOwnProperty(i)) {
|
5171 | to[i] = from[i];
|
5172 | }
|
5173 | }
|
5174 | return to;
|
5175 | }
|
5176 |
|
5177 | var utils = {
|
5178 | getWindow: function getWindow(node) {
|
5179 | if (node && node.document && node.setTimeout) {
|
5180 | return node;
|
5181 | }
|
5182 | var doc = node.ownerDocument || node;
|
5183 | return doc.defaultView || doc.parentWindow;
|
5184 | },
|
5185 |
|
5186 | getDocument: getDocument,
|
5187 | offset: function offset(el, value, option) {
|
5188 | if (typeof value !== 'undefined') {
|
5189 | setOffset(el, value, option || {});
|
5190 | } else {
|
5191 | return getOffset(el);
|
5192 | }
|
5193 | },
|
5194 |
|
5195 | isWindow: isWindow,
|
5196 | each: each,
|
5197 | css: css,
|
5198 | clone: function clone(obj) {
|
5199 | var i = void 0;
|
5200 | var ret = {};
|
5201 | for (i in obj) {
|
5202 | if (obj.hasOwnProperty(i)) {
|
5203 | ret[i] = obj[i];
|
5204 | }
|
5205 | }
|
5206 | var overflow = obj.overflow;
|
5207 | if (overflow) {
|
5208 | for (i in obj) {
|
5209 | if (obj.hasOwnProperty(i)) {
|
5210 | ret.overflow[i] = obj.overflow[i];
|
5211 | }
|
5212 | }
|
5213 | }
|
5214 | return ret;
|
5215 | },
|
5216 |
|
5217 | mix: mix,
|
5218 | getWindowScrollLeft: function getWindowScrollLeft(w) {
|
5219 | return getScrollLeft(w);
|
5220 | },
|
5221 | getWindowScrollTop: function getWindowScrollTop(w) {
|
5222 | return getScrollTop(w);
|
5223 | },
|
5224 | merge: function merge() {
|
5225 | var ret = {};
|
5226 |
|
5227 | for (var _len2 = arguments.length, args = Array(_len2), _key3 = 0; _key3 < _len2; _key3++) {
|
5228 | args[_key3] = arguments[_key3];
|
5229 | }
|
5230 |
|
5231 | for (var i = 0; i < args.length; i++) {
|
5232 | utils.mix(ret, args[i]);
|
5233 | }
|
5234 | return ret;
|
5235 | },
|
5236 |
|
5237 | viewportWidth: 0,
|
5238 | viewportHeight: 0
|
5239 | };
|
5240 |
|
5241 | mix(utils, domUtils);
|
5242 |
|
5243 | exports['default'] = utils;
|
5244 | module.exports = exports['default'];
|
5245 |
|
5246 | }),
|
5247 |
|
5248 | (function(module, exports) {
|
5249 |
|
5250 | 'use strict';
|
5251 |
|
5252 | Object.defineProperty(exports, "__esModule", {
|
5253 | value: true
|
5254 | });
|
5255 | exports.getTransformName = getTransformName;
|
5256 | exports.setTransitionProperty = setTransitionProperty;
|
5257 | exports.getTransitionProperty = getTransitionProperty;
|
5258 | exports.getTransformXY = getTransformXY;
|
5259 | exports.setTransformXY = setTransformXY;
|
5260 | var vendorPrefix = void 0;
|
5261 |
|
5262 | var jsCssMap = {
|
5263 | Webkit: '-webkit-',
|
5264 | Moz: '-moz-',
|
5265 |
|
5266 | ms: '-ms-',
|
5267 | O: '-o-'
|
5268 | };
|
5269 |
|
5270 | function getVendorPrefix() {
|
5271 | if (vendorPrefix !== undefined) {
|
5272 | return vendorPrefix;
|
5273 | }
|
5274 | vendorPrefix = '';
|
5275 | var style = document.createElement('p').style;
|
5276 | var testProp = 'Transform';
|
5277 | for (var key in jsCssMap) {
|
5278 | if (key + testProp in style) {
|
5279 | vendorPrefix = key;
|
5280 | }
|
5281 | }
|
5282 | return vendorPrefix;
|
5283 | }
|
5284 |
|
5285 | function getTransitionName() {
|
5286 | return getVendorPrefix() ? getVendorPrefix() + 'TransitionProperty' : 'transitionProperty';
|
5287 | }
|
5288 |
|
5289 | function getTransformName() {
|
5290 | return getVendorPrefix() ? getVendorPrefix() + 'Transform' : 'transform';
|
5291 | }
|
5292 |
|
5293 | function setTransitionProperty(node, value) {
|
5294 | var name = getTransitionName();
|
5295 | if (name) {
|
5296 | node.style[name] = value;
|
5297 | if (name !== 'transitionProperty') {
|
5298 | node.style.transitionProperty = value;
|
5299 | }
|
5300 | }
|
5301 | }
|
5302 |
|
5303 | function setTransform(node, value) {
|
5304 | var name = getTransformName();
|
5305 | if (name) {
|
5306 | node.style[name] = value;
|
5307 | if (name !== 'transform') {
|
5308 | node.style.transform = value;
|
5309 | }
|
5310 | }
|
5311 | }
|
5312 |
|
5313 | function getTransitionProperty(node) {
|
5314 | return node.style.transitionProperty || node.style[getTransitionName()];
|
5315 | }
|
5316 |
|
5317 | function getTransformXY(node) {
|
5318 | var style = window.getComputedStyle(node, null);
|
5319 | var transform = style.getPropertyValue('transform') || style.getPropertyValue(getTransformName());
|
5320 | if (transform && transform !== 'none') {
|
5321 | var matrix = transform.replace(/[^0-9\-.,]/g, '').split(',');
|
5322 | return { x: parseFloat(matrix[12] || matrix[4], 0), y: parseFloat(matrix[13] || matrix[5], 0) };
|
5323 | }
|
5324 | return {
|
5325 | x: 0,
|
5326 | y: 0
|
5327 | };
|
5328 | }
|
5329 |
|
5330 | var matrix2d = /matrix\((.*)\)/;
|
5331 | var matrix3d = /matrix3d\((.*)\)/;
|
5332 |
|
5333 | function setTransformXY(node, xy) {
|
5334 | var style = window.getComputedStyle(node, null);
|
5335 | var transform = style.getPropertyValue('transform') || style.getPropertyValue(getTransformName());
|
5336 | if (transform && transform !== 'none') {
|
5337 | var arr = void 0;
|
5338 | var match2d = transform.match(matrix2d);
|
5339 | if (match2d) {
|
5340 | match2d = match2d[1];
|
5341 | arr = match2d.split(',').map(function (item) {
|
5342 | return parseFloat(item, 10);
|
5343 | });
|
5344 | arr[4] = xy.x;
|
5345 | arr[5] = xy.y;
|
5346 | setTransform(node, 'matrix(' + arr.join(',') + ')');
|
5347 | } else {
|
5348 | var match3d = transform.match(matrix3d)[1];
|
5349 | arr = match3d.split(',').map(function (item) {
|
5350 | return parseFloat(item, 10);
|
5351 | });
|
5352 | arr[12] = xy.x;
|
5353 | arr[13] = xy.y;
|
5354 | setTransform(node, 'matrix3d(' + arr.join(',') + ')');
|
5355 | }
|
5356 | } else {
|
5357 | setTransform(node, 'translateX(' + xy.x + 'px) translateY(' + xy.y + 'px) translateZ(0)');
|
5358 | }
|
5359 | }
|
5360 |
|
5361 | }),
|
5362 |
|
5363 | (function(module, exports, __webpack_require__) {
|
5364 |
|
5365 | 'use strict';
|
5366 |
|
5367 | Object.defineProperty(exports, "__esModule", {
|
5368 | value: true
|
5369 | });
|
5370 |
|
5371 | var _utils = __webpack_require__(51);
|
5372 |
|
5373 | var _utils2 = _interopRequireDefault(_utils);
|
5374 |
|
5375 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
5376 |
|
5377 | |
5378 |
|
5379 |
|
5380 |
|
5381 | function getOffsetParent(element) {
|
5382 | if (_utils2['default'].isWindow(element) || element.nodeType === 9) {
|
5383 | return null;
|
5384 | }
|
5385 |
|
5386 | |
5387 |
|
5388 |
|
5389 |
|
5390 |
|
5391 |
|
5392 |
|
5393 |
|
5394 |
|
5395 |
|
5396 |
|
5397 |
|
5398 |
|
5399 |
|
5400 | var doc = _utils2['default'].getDocument(element);
|
5401 | var body = doc.body;
|
5402 | var parent = void 0;
|
5403 | var positionStyle = _utils2['default'].css(element, 'position');
|
5404 | var skipStatic = positionStyle === 'fixed' || positionStyle === 'absolute';
|
5405 |
|
5406 | if (!skipStatic) {
|
5407 | return element.nodeName.toLowerCase() === 'html' ? null : element.parentNode;
|
5408 | }
|
5409 |
|
5410 | for (parent = element.parentNode; parent && parent !== body; parent = parent.parentNode) {
|
5411 | positionStyle = _utils2['default'].css(parent, 'position');
|
5412 | if (positionStyle !== 'static') {
|
5413 | return parent;
|
5414 | }
|
5415 | }
|
5416 | return null;
|
5417 | }
|
5418 |
|
5419 | exports['default'] = getOffsetParent;
|
5420 | module.exports = exports['default'];
|
5421 |
|
5422 | }),
|
5423 |
|
5424 | (function(module, exports, __webpack_require__) {
|
5425 |
|
5426 | 'use strict';
|
5427 |
|
5428 | Object.defineProperty(exports, "__esModule", {
|
5429 | value: true
|
5430 | });
|
5431 |
|
5432 | var _utils = __webpack_require__(51);
|
5433 |
|
5434 | var _utils2 = _interopRequireDefault(_utils);
|
5435 |
|
5436 | var _getOffsetParent = __webpack_require__(53);
|
5437 |
|
5438 | var _getOffsetParent2 = _interopRequireDefault(_getOffsetParent);
|
5439 |
|
5440 | var _isAncestorFixed = __webpack_require__(55);
|
5441 |
|
5442 | var _isAncestorFixed2 = _interopRequireDefault(_isAncestorFixed);
|
5443 |
|
5444 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
5445 |
|
5446 | |
5447 |
|
5448 |
|
5449 | function getVisibleRectForElement(element) {
|
5450 | var visibleRect = {
|
5451 | left: 0,
|
5452 | right: Infinity,
|
5453 | top: 0,
|
5454 | bottom: Infinity
|
5455 | };
|
5456 | var el = (0, _getOffsetParent2['default'])(element);
|
5457 | var doc = _utils2['default'].getDocument(element);
|
5458 | var win = doc.defaultView || doc.parentWindow;
|
5459 | var body = doc.body;
|
5460 | var documentElement = doc.documentElement;
|
5461 |
|
5462 |
|
5463 |
|
5464 | while (el) {
|
5465 |
|
5466 | if ((navigator.userAgent.indexOf('MSIE') === -1 || el.clientWidth !== 0) &&
|
5467 |
|
5468 |
|
5469 |
|
5470 | el !== body && el !== documentElement && _utils2['default'].css(el, 'overflow') !== 'visible') {
|
5471 | var pos = _utils2['default'].offset(el);
|
5472 |
|
5473 | pos.left += el.clientLeft;
|
5474 | pos.top += el.clientTop;
|
5475 | visibleRect.top = Math.max(visibleRect.top, pos.top);
|
5476 | visibleRect.right = Math.min(visibleRect.right,
|
5477 |
|
5478 | pos.left + el.clientWidth);
|
5479 | visibleRect.bottom = Math.min(visibleRect.bottom, pos.top + el.clientHeight);
|
5480 | visibleRect.left = Math.max(visibleRect.left, pos.left);
|
5481 | } else if (el === body || el === documentElement) {
|
5482 | break;
|
5483 | }
|
5484 | el = (0, _getOffsetParent2['default'])(el);
|
5485 | }
|
5486 |
|
5487 |
|
5488 |
|
5489 |
|
5490 | var originalPosition = null;
|
5491 | if (!_utils2['default'].isWindow(element) && element.nodeType !== 9) {
|
5492 | originalPosition = element.style.position;
|
5493 | var position = _utils2['default'].css(element, 'position');
|
5494 | if (position === 'absolute') {
|
5495 | element.style.position = 'fixed';
|
5496 | }
|
5497 | }
|
5498 |
|
5499 | var scrollX = _utils2['default'].getWindowScrollLeft(win);
|
5500 | var scrollY = _utils2['default'].getWindowScrollTop(win);
|
5501 | var viewportWidth = _utils2['default'].viewportWidth(win);
|
5502 | var viewportHeight = _utils2['default'].viewportHeight(win);
|
5503 | var documentWidth = documentElement.scrollWidth;
|
5504 | var documentHeight = documentElement.scrollHeight;
|
5505 |
|
5506 |
|
5507 | if (element.style) {
|
5508 | element.style.position = originalPosition;
|
5509 | }
|
5510 |
|
5511 | if ((0, _isAncestorFixed2['default'])(element)) {
|
5512 |
|
5513 | visibleRect.left = Math.max(visibleRect.left, scrollX);
|
5514 | visibleRect.top = Math.max(visibleRect.top, scrollY);
|
5515 | visibleRect.right = Math.min(visibleRect.right, scrollX + viewportWidth);
|
5516 | visibleRect.bottom = Math.min(visibleRect.bottom, scrollY + viewportHeight);
|
5517 | } else {
|
5518 |
|
5519 | var maxVisibleWidth = Math.max(documentWidth, scrollX + viewportWidth);
|
5520 | visibleRect.right = Math.min(visibleRect.right, maxVisibleWidth);
|
5521 |
|
5522 | var maxVisibleHeight = Math.max(documentHeight, scrollY + viewportHeight);
|
5523 | visibleRect.bottom = Math.min(visibleRect.bottom, maxVisibleHeight);
|
5524 | }
|
5525 |
|
5526 | return visibleRect.top >= 0 && visibleRect.left >= 0 && visibleRect.bottom > visibleRect.top && visibleRect.right > visibleRect.left ? visibleRect : null;
|
5527 | }
|
5528 |
|
5529 | exports['default'] = getVisibleRectForElement;
|
5530 | module.exports = exports['default'];
|
5531 |
|
5532 | }),
|
5533 |
|
5534 | (function(module, exports, __webpack_require__) {
|
5535 |
|
5536 | 'use strict';
|
5537 |
|
5538 | Object.defineProperty(exports, "__esModule", {
|
5539 | value: true
|
5540 | });
|
5541 | exports['default'] = isAncestorFixed;
|
5542 |
|
5543 | var _utils = __webpack_require__(51);
|
5544 |
|
5545 | var _utils2 = _interopRequireDefault(_utils);
|
5546 |
|
5547 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
5548 |
|
5549 | function isAncestorFixed(element) {
|
5550 | if (_utils2['default'].isWindow(element) || element.nodeType === 9) {
|
5551 | return false;
|
5552 | }
|
5553 |
|
5554 | var doc = _utils2['default'].getDocument(element);
|
5555 | var body = doc.body;
|
5556 | var parent = null;
|
5557 | for (parent = element.parentNode; parent && parent !== body; parent = parent.parentNode) {
|
5558 | var positionStyle = _utils2['default'].css(parent, 'position');
|
5559 | if (positionStyle === 'fixed') {
|
5560 | return true;
|
5561 | }
|
5562 | }
|
5563 | return false;
|
5564 | }
|
5565 | module.exports = exports['default'];
|
5566 |
|
5567 | }),
|
5568 |
|
5569 | (function(module, exports, __webpack_require__) {
|
5570 |
|
5571 | 'use strict';
|
5572 |
|
5573 | Object.defineProperty(exports, "__esModule", {
|
5574 | value: true
|
5575 | });
|
5576 |
|
5577 | var _utils = __webpack_require__(51);
|
5578 |
|
5579 | var _utils2 = _interopRequireDefault(_utils);
|
5580 |
|
5581 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
5582 |
|
5583 | function adjustForViewport(elFuturePos, elRegion, visibleRect, overflow) {
|
5584 | var pos = _utils2['default'].clone(elFuturePos);
|
5585 | var size = {
|
5586 | width: elRegion.width,
|
5587 | height: elRegion.height
|
5588 | };
|
5589 |
|
5590 | if (overflow.adjustX && pos.left < visibleRect.left) {
|
5591 | pos.left = visibleRect.left;
|
5592 | }
|
5593 |
|
5594 |
|
5595 | if (overflow.resizeWidth && pos.left >= visibleRect.left && pos.left + size.width > visibleRect.right) {
|
5596 | size.width -= pos.left + size.width - visibleRect.right;
|
5597 | }
|
5598 |
|
5599 |
|
5600 | if (overflow.adjustX && pos.left + size.width > visibleRect.right) {
|
5601 |
|
5602 | pos.left = Math.max(visibleRect.right - size.width, visibleRect.left);
|
5603 | }
|
5604 |
|
5605 |
|
5606 | if (overflow.adjustY && pos.top < visibleRect.top) {
|
5607 | pos.top = visibleRect.top;
|
5608 | }
|
5609 |
|
5610 |
|
5611 | if (overflow.resizeHeight && pos.top >= visibleRect.top && pos.top + size.height > visibleRect.bottom) {
|
5612 | size.height -= pos.top + size.height - visibleRect.bottom;
|
5613 | }
|
5614 |
|
5615 |
|
5616 | if (overflow.adjustY && pos.top + size.height > visibleRect.bottom) {
|
5617 |
|
5618 | pos.top = Math.max(visibleRect.bottom - size.height, visibleRect.top);
|
5619 | }
|
5620 |
|
5621 | return _utils2['default'].mix(pos, size);
|
5622 | }
|
5623 |
|
5624 | exports['default'] = adjustForViewport;
|
5625 | module.exports = exports['default'];
|
5626 |
|
5627 | }),
|
5628 |
|
5629 | (function(module, exports, __webpack_require__) {
|
5630 |
|
5631 | 'use strict';
|
5632 |
|
5633 | Object.defineProperty(exports, "__esModule", {
|
5634 | value: true
|
5635 | });
|
5636 |
|
5637 | var _utils = __webpack_require__(51);
|
5638 |
|
5639 | var _utils2 = _interopRequireDefault(_utils);
|
5640 |
|
5641 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
5642 |
|
5643 | function getRegion(node) {
|
5644 | var offset = void 0;
|
5645 | var w = void 0;
|
5646 | var h = void 0;
|
5647 | if (!_utils2['default'].isWindow(node) && node.nodeType !== 9) {
|
5648 | offset = _utils2['default'].offset(node);
|
5649 | w = _utils2['default'].outerWidth(node);
|
5650 | h = _utils2['default'].outerHeight(node);
|
5651 | } else {
|
5652 | var win = _utils2['default'].getWindow(node);
|
5653 | offset = {
|
5654 | left: _utils2['default'].getWindowScrollLeft(win),
|
5655 | top: _utils2['default'].getWindowScrollTop(win)
|
5656 | };
|
5657 | w = _utils2['default'].viewportWidth(win);
|
5658 | h = _utils2['default'].viewportHeight(win);
|
5659 | }
|
5660 | offset.width = w;
|
5661 | offset.height = h;
|
5662 | return offset;
|
5663 | }
|
5664 |
|
5665 | exports['default'] = getRegion;
|
5666 | module.exports = exports['default'];
|
5667 |
|
5668 | }),
|
5669 |
|
5670 | (function(module, exports, __webpack_require__) {
|
5671 |
|
5672 | 'use strict';
|
5673 |
|
5674 | Object.defineProperty(exports, "__esModule", {
|
5675 | value: true
|
5676 | });
|
5677 |
|
5678 | var _getAlignOffset = __webpack_require__(59);
|
5679 |
|
5680 | var _getAlignOffset2 = _interopRequireDefault(_getAlignOffset);
|
5681 |
|
5682 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
5683 |
|
5684 | function getElFuturePos(elRegion, refNodeRegion, points, offset, targetOffset) {
|
5685 | var p1 = (0, _getAlignOffset2['default'])(refNodeRegion, points[1]);
|
5686 | var p2 = (0, _getAlignOffset2['default'])(elRegion, points[0]);
|
5687 | var diff = [p2.left - p1.left, p2.top - p1.top];
|
5688 |
|
5689 | return {
|
5690 | left: elRegion.left - diff[0] + offset[0] - targetOffset[0],
|
5691 | top: elRegion.top - diff[1] + offset[1] - targetOffset[1]
|
5692 | };
|
5693 | }
|
5694 |
|
5695 | exports['default'] = getElFuturePos;
|
5696 | module.exports = exports['default'];
|
5697 |
|
5698 | }),
|
5699 |
|
5700 | (function(module, exports) {
|
5701 |
|
5702 | 'use strict';
|
5703 |
|
5704 | Object.defineProperty(exports, "__esModule", {
|
5705 | value: true
|
5706 | });
|
5707 | |
5708 |
|
5709 |
|
5710 |
|
5711 | function getAlignOffset(region, align) {
|
5712 | var V = align.charAt(0);
|
5713 | var H = align.charAt(1);
|
5714 | var w = region.width;
|
5715 | var h = region.height;
|
5716 |
|
5717 | var x = region.left;
|
5718 | var y = region.top;
|
5719 |
|
5720 | if (V === 'c') {
|
5721 | y += h / 2;
|
5722 | } else if (V === 'b') {
|
5723 | y += h;
|
5724 | }
|
5725 |
|
5726 | if (H === 'c') {
|
5727 | x += w / 2;
|
5728 | } else if (H === 'r') {
|
5729 | x += w;
|
5730 | }
|
5731 |
|
5732 | return {
|
5733 | left: x,
|
5734 | top: y
|
5735 | };
|
5736 | }
|
5737 |
|
5738 | exports['default'] = getAlignOffset;
|
5739 | module.exports = exports['default'];
|
5740 |
|
5741 | }),
|
5742 |
|
5743 | (function(module, exports, __webpack_require__) {
|
5744 |
|
5745 | 'use strict';
|
5746 |
|
5747 | Object.defineProperty(exports, "__esModule", {
|
5748 | value: true
|
5749 | });
|
5750 |
|
5751 | 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; };
|
5752 |
|
5753 | var _classnames = __webpack_require__(3);
|
5754 |
|
5755 | var _classnames2 = _interopRequireDefault(_classnames);
|
5756 |
|
5757 | var _react = __webpack_require__(4);
|
5758 |
|
5759 | var _react2 = _interopRequireDefault(_react);
|
5760 |
|
5761 | var _propTypes = __webpack_require__(5);
|
5762 |
|
5763 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
5764 |
|
5765 | var _Transition = __webpack_require__(11);
|
5766 |
|
5767 | var _Transition2 = _interopRequireDefault(_Transition);
|
5768 |
|
5769 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
5770 |
|
5771 | 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; }
|
5772 |
|
5773 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
5774 |
|
5775 | 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; }
|
5776 |
|
5777 | 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); }
|
5778 |
|
5779 | var propTypes = {
|
5780 | |
5781 |
|
5782 |
|
5783 | "in": _propTypes2["default"].bool,
|
5784 |
|
5785 | |
5786 |
|
5787 |
|
5788 | unmountOnExit: _propTypes2["default"].bool,
|
5789 |
|
5790 | |
5791 |
|
5792 |
|
5793 |
|
5794 | transitionAppear: _propTypes2["default"].bool,
|
5795 |
|
5796 | |
5797 |
|
5798 |
|
5799 |
|
5800 |
|
5801 | timeout: _propTypes2["default"].number,
|
5802 |
|
5803 | |
5804 |
|
5805 |
|
5806 | onEnter: _propTypes2["default"].func,
|
5807 | |
5808 |
|
5809 |
|
5810 | onEntering: _propTypes2["default"].func,
|
5811 | |
5812 |
|
5813 |
|
5814 | onEntered: _propTypes2["default"].func,
|
5815 | |
5816 |
|
5817 |
|
5818 | onExit: _propTypes2["default"].func,
|
5819 | |
5820 |
|
5821 |
|
5822 | onExiting: _propTypes2["default"].func,
|
5823 | |
5824 |
|
5825 |
|
5826 | onExited: _propTypes2["default"].func
|
5827 | };
|
5828 |
|
5829 | var defaultProps = {
|
5830 | "in": false,
|
5831 | timeout: 300,
|
5832 | unmountOnExit: false,
|
5833 | transitionAppear: false
|
5834 | };
|
5835 |
|
5836 | var Fade = function (_React$Component) {
|
5837 | _inherits(Fade, _React$Component);
|
5838 |
|
5839 | function Fade() {
|
5840 | _classCallCheck(this, Fade);
|
5841 |
|
5842 | return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
5843 | }
|
5844 |
|
5845 | Fade.prototype.render = function render() {
|
5846 | return _react2["default"].createElement(_Transition2["default"], _extends({}, this.props, {
|
5847 | className: (0, _classnames2["default"])(this.props.className, 'fade'),
|
5848 | enteredClassName: 'in',
|
5849 | enteringClassName: 'in'
|
5850 | }));
|
5851 | };
|
5852 |
|
5853 | return Fade;
|
5854 | }(_react2["default"].Component);
|
5855 |
|
5856 | Fade.propTypes = propTypes;
|
5857 | Fade.defaultProps = defaultProps;
|
5858 |
|
5859 | exports["default"] = Fade;
|
5860 | module.exports = exports['default'];
|
5861 |
|
5862 | }),
|
5863 |
|
5864 | (function(module, exports, __webpack_require__) {
|
5865 |
|
5866 | 'use strict';
|
5867 |
|
5868 | Object.defineProperty(exports, "__esModule", {
|
5869 | value: true
|
5870 | });
|
5871 |
|
5872 | 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; };
|
5873 |
|
5874 | var _classnames = __webpack_require__(3);
|
5875 |
|
5876 | var _classnames2 = _interopRequireDefault(_classnames);
|
5877 |
|
5878 | var _react = __webpack_require__(4);
|
5879 |
|
5880 | var _react2 = _interopRequireDefault(_react);
|
5881 |
|
5882 | var _propTypes = __webpack_require__(5);
|
5883 |
|
5884 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
5885 |
|
5886 | var _tinperBeeCore = __webpack_require__(26);
|
5887 |
|
5888 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
5889 |
|
5890 | 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; }
|
5891 |
|
5892 | 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; }
|
5893 |
|
5894 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
5895 |
|
5896 | 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; }
|
5897 |
|
5898 | 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); }
|
5899 |
|
5900 | var propTypes = {
|
5901 |
|
5902 | accordion: _propTypes2["default"].bool,
|
5903 |
|
5904 | activeKey: _propTypes2["default"].any,
|
5905 |
|
5906 | defaultActiveKey: _propTypes2["default"].any,
|
5907 |
|
5908 | onSelect: _propTypes2["default"].func,
|
5909 | role: _propTypes2["default"].string
|
5910 | };
|
5911 |
|
5912 | var defaultProps = {
|
5913 | accordion: false,
|
5914 | clsPrefix: 'u-panel-group'
|
5915 | };
|
5916 |
|
5917 |
|
5918 |
|
5919 | var PanelGroup = function (_React$Component) {
|
5920 | _inherits(PanelGroup, _React$Component);
|
5921 |
|
5922 | function PanelGroup(props, context) {
|
5923 | _classCallCheck(this, PanelGroup);
|
5924 |
|
5925 | var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context));
|
5926 |
|
5927 | _this.handleSelect = _this.handleSelect.bind(_this);
|
5928 |
|
5929 | _this.state = {
|
5930 | activeKey: props.defaultActiveKey
|
5931 | };
|
5932 | return _this;
|
5933 | }
|
5934 |
|
5935 | PanelGroup.prototype.handleSelect = function handleSelect(key, e) {
|
5936 | e.preventDefault();
|
5937 |
|
5938 | if (this.props.onSelect) {
|
5939 | this.props.onSelect(key, e);
|
5940 | }
|
5941 |
|
5942 | if (this.state.activeKey === key) {
|
5943 | key = null;
|
5944 | }
|
5945 |
|
5946 | this.setState({ activeKey: key });
|
5947 | };
|
5948 |
|
5949 | PanelGroup.prototype.render = function render() {
|
5950 | var _this2 = this;
|
5951 |
|
5952 | var _props = this.props,
|
5953 | accordion = _props.accordion,
|
5954 | propsActiveKey = _props.activeKey,
|
5955 | className = _props.className,
|
5956 | children = _props.children,
|
5957 | defaultActiveKey = _props.defaultActiveKey,
|
5958 | onSelect = _props.onSelect,
|
5959 | style = _props.style,
|
5960 | clsPrefix = _props.clsPrefix,
|
5961 | others = _objectWithoutProperties(_props, ['accordion', 'activeKey', 'className', 'children', 'defaultActiveKey', 'onSelect', 'style', 'clsPrefix']);
|
5962 |
|
5963 | var activeKey = void 0;
|
5964 | if (accordion) {
|
5965 | activeKey = propsActiveKey != null ? propsActiveKey : this.state.activeKey;
|
5966 | others.role = others.role || 'tablist';
|
5967 | }
|
5968 |
|
5969 | var classes = {};
|
5970 | classes['' + clsPrefix] = true;
|
5971 |
|
5972 | return _react2["default"].createElement(
|
5973 | 'div',
|
5974 | _extends({}, others, {
|
5975 | className: (0, _classnames2["default"])(className, classes)
|
5976 | }),
|
5977 | _react2["default"].Children.map(children, function (child) {
|
5978 | if (!_react2["default"].isValidElement(child)) {
|
5979 | return child;
|
5980 | }
|
5981 | var childProps = {
|
5982 | style: child.props.style
|
5983 | };
|
5984 |
|
5985 | if (accordion) {
|
5986 | _extends(childProps, {
|
5987 | headerRole: 'tab',
|
5988 | panelRole: 'tabpanel',
|
5989 | collapsible: true,
|
5990 | expanded: child.props.eventKey === activeKey,
|
5991 | onSelect: (0, _tinperBeeCore.createChainedFunction)(_this2.handleSelect, child.props.onSelect)
|
5992 | });
|
5993 | }
|
5994 |
|
5995 | return (0, _react.cloneElement)(child, childProps);
|
5996 | })
|
5997 | );
|
5998 | };
|
5999 |
|
6000 | return PanelGroup;
|
6001 | }(_react2["default"].Component);
|
6002 |
|
6003 | PanelGroup.propTypes = propTypes;
|
6004 | PanelGroup.defaultProps = defaultProps;
|
6005 |
|
6006 | exports["default"] = PanelGroup;
|
6007 | module.exports = exports['default'];
|
6008 |
|
6009 | }),
|
6010 |
|
6011 | (function(module, exports, __webpack_require__) {
|
6012 |
|
6013 | 'use strict';
|
6014 |
|
6015 | Object.defineProperty(exports, "__esModule", {
|
6016 | value: true
|
6017 | });
|
6018 |
|
6019 | var _Button = __webpack_require__(63);
|
6020 |
|
6021 | var _Button2 = _interopRequireDefault(_Button);
|
6022 |
|
6023 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
6024 |
|
6025 | exports["default"] = _Button2["default"];
|
6026 | module.exports = exports['default'];
|
6027 |
|
6028 | }),
|
6029 |
|
6030 | (function(module, exports, __webpack_require__) {
|
6031 |
|
6032 | 'use strict';
|
6033 |
|
6034 | Object.defineProperty(exports, "__esModule", {
|
6035 | value: true
|
6036 | });
|
6037 |
|
6038 | 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; };
|
6039 |
|
6040 | var _react = __webpack_require__(4);
|
6041 |
|
6042 | var _react2 = _interopRequireDefault(_react);
|
6043 |
|
6044 | var _reactDom = __webpack_require__(12);
|
6045 |
|
6046 | var _reactDom2 = _interopRequireDefault(_reactDom);
|
6047 |
|
6048 | var _propTypes = __webpack_require__(5);
|
6049 |
|
6050 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
6051 |
|
6052 | var _classnames = __webpack_require__(3);
|
6053 |
|
6054 | var _classnames2 = _interopRequireDefault(_classnames);
|
6055 |
|
6056 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
6057 |
|
6058 | 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; }
|
6059 |
|
6060 | 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; }
|
6061 |
|
6062 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
6063 |
|
6064 | 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; }
|
6065 |
|
6066 | 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); }
|
6067 |
|
6068 | var propTypes = {
|
6069 | |
6070 |
|
6071 |
|
6072 | size: _propTypes2["default"].oneOf(['sm', 'xg', 'lg']),
|
6073 | |
6074 |
|
6075 |
|
6076 | style: _propTypes2["default"].object,
|
6077 | |
6078 |
|
6079 |
|
6080 | shape: _propTypes2["default"].oneOf(['block', 'round', 'border', 'squared', 'floating', 'pillRight', 'pillLeft', 'icon']),
|
6081 |
|
6082 | bordered: _propTypes2["default"].bool,
|
6083 | |
6084 |
|
6085 |
|
6086 | colors: _propTypes2["default"].oneOf(['primary', 'accent', 'success', 'info', 'warning', 'danger', 'default']),
|
6087 | |
6088 |
|
6089 |
|
6090 |
|
6091 | disabled: _propTypes2["default"].bool,
|
6092 | |
6093 |
|
6094 |
|
6095 |
|
6096 | className: _propTypes2["default"].string,
|
6097 |
|
6098 | |
6099 |
|
6100 |
|
6101 |
|
6102 | htmlType: _propTypes2["default"].oneOf(['submit', 'button', 'reset']),
|
6103 | isSubmit: _propTypes2["default"].bool
|
6104 | };
|
6105 |
|
6106 | var defaultProps = {
|
6107 | disabled: false,
|
6108 | htmlType: 'button',
|
6109 | clsPrefix: 'u-button',
|
6110 | bordered: false,
|
6111 | isSubmit: false
|
6112 | };
|
6113 |
|
6114 | var sizeMap = {
|
6115 | sm: 'sm',
|
6116 | xg: 'xg',
|
6117 | lg: 'lg'
|
6118 | },
|
6119 | colorsMap = {
|
6120 | primary: 'primary',
|
6121 | accent: 'accent',
|
6122 | success: 'success',
|
6123 | info: 'info',
|
6124 | warning: 'warning',
|
6125 | danger: 'danger'
|
6126 | },
|
6127 | shapeMap = {
|
6128 | block: 'block',
|
6129 | round: 'round',
|
6130 | border: 'border',
|
6131 | squared: 'squared',
|
6132 | floating: 'floating',
|
6133 | pillRight: 'pill-right',
|
6134 | pillLeft: 'pill-left',
|
6135 | icon: 'icon'
|
6136 | };
|
6137 |
|
6138 | var Button = function (_Component) {
|
6139 | _inherits(Button, _Component);
|
6140 |
|
6141 | function Button(props) {
|
6142 | _classCallCheck(this, Button);
|
6143 |
|
6144 | return _possibleConstructorReturn(this, _Component.call(this, props));
|
6145 | }
|
6146 |
|
6147 | Button.prototype.render = function render() {
|
6148 | var _props = this.props,
|
6149 | colors = _props.colors,
|
6150 | shape = _props.shape,
|
6151 | disabled = _props.disabled,
|
6152 | className = _props.className,
|
6153 | size = _props.size,
|
6154 | bordered = _props.bordered,
|
6155 | children = _props.children,
|
6156 | htmlType = _props.htmlType,
|
6157 | clsPrefix = _props.clsPrefix,
|
6158 | isSubmit = _props.isSubmit,
|
6159 | others = _objectWithoutProperties(_props, ['colors', 'shape', 'disabled', 'className', 'size', 'bordered', 'children', 'htmlType', 'clsPrefix', 'isSubmit']);
|
6160 |
|
6161 | var clsObj = {};
|
6162 | if (className) {
|
6163 | clsObj[className] = true;
|
6164 | }
|
6165 | if (sizeMap[size]) {
|
6166 | clsObj[clsPrefix + '-' + sizeMap[size]] = true;
|
6167 | }
|
6168 |
|
6169 | if (shapeMap[shape]) {
|
6170 | clsObj[clsPrefix + '-' + shapeMap[shape]] = true;
|
6171 | }
|
6172 | if (colorsMap[colors]) {
|
6173 | clsObj[clsPrefix + '-' + colorsMap[colors]] = true;
|
6174 | }
|
6175 |
|
6176 | var classes = (0, _classnames2["default"])(clsPrefix, clsObj);
|
6177 | return _react2["default"].createElement(
|
6178 | 'button',
|
6179 | _extends({
|
6180 | type: htmlType,
|
6181 | className: classes,
|
6182 | disabled: disabled
|
6183 | }, others),
|
6184 | this.props.children
|
6185 | );
|
6186 | };
|
6187 |
|
6188 | return Button;
|
6189 | }(_react.Component);
|
6190 |
|
6191 | Button.propTypes = propTypes;
|
6192 | Button.defaultProps = defaultProps;
|
6193 |
|
6194 | exports["default"] = Button;
|
6195 | module.exports = exports['default'];
|
6196 |
|
6197 | }),
|
6198 |
|
6199 | (function(module, exports, __webpack_require__) {
|
6200 |
|
6201 | 'use strict';
|
6202 |
|
6203 | Object.defineProperty(exports, "__esModule", {
|
6204 | value: true
|
6205 | });
|
6206 |
|
6207 | var _beeLayout = __webpack_require__(1);
|
6208 |
|
6209 | var _beePanel = __webpack_require__(8);
|
6210 |
|
6211 | var _react = __webpack_require__(4);
|
6212 |
|
6213 | var _react2 = _interopRequireDefault(_react);
|
6214 |
|
6215 | var _beeButton = __webpack_require__(62);
|
6216 |
|
6217 | var _beeButton2 = _interopRequireDefault(_beeButton);
|
6218 |
|
6219 | var _src = __webpack_require__(65);
|
6220 |
|
6221 | var _src2 = _interopRequireDefault(_src);
|
6222 |
|
6223 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
6224 |
|
6225 | 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; }
|
6226 |
|
6227 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
6228 |
|
6229 | 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; }
|
6230 |
|
6231 | 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); } |
6232 |
|
6233 |
|
6234 |
|
6235 |
|
6236 |
|
6237 |
|
6238 | var info = function info() {
|
6239 | var aa = _src2['default'].create({ content: 'This is a Info message', color: 'info', duration: null });
|
6240 | };
|
6241 | var danger = function danger() {
|
6242 | _src2['default'].create({ content: 'This is a danger message', color: 'danger' });
|
6243 | };
|
6244 | var success = function success() {
|
6245 | _src2['default'].create({ content: 'This is a success message', color: 'success' });
|
6246 | };
|
6247 | var warning = function warning() {
|
6248 | _src2['default'].create({ content: 'This is a warning message', color: 'warning' });
|
6249 | };
|
6250 | var loading = function loading() {
|
6251 | _src2['default'].create({ content: 'This is a dark message', color: 'dark' });
|
6252 | };
|
6253 | var light = function light() {
|
6254 | _src2['default'].create({ content: 'This is a light message', color: 'light' });
|
6255 | };
|
6256 |
|
6257 | var Demo1 = function (_Component) {
|
6258 | _inherits(Demo1, _Component);
|
6259 |
|
6260 | function Demo1(props) {
|
6261 | _classCallCheck(this, Demo1);
|
6262 |
|
6263 | return _possibleConstructorReturn(this, _Component.call(this, props));
|
6264 | }
|
6265 |
|
6266 | Demo1.prototype.render = function render() {
|
6267 | return _react2['default'].createElement(
|
6268 | 'div',
|
6269 | { className: 'paddingDemo' },
|
6270 | _react2['default'].createElement(
|
6271 | _beeButton2['default'],
|
6272 | {
|
6273 | colors: 'info',
|
6274 | onClick: info },
|
6275 | 'info'
|
6276 | ),
|
6277 | _react2['default'].createElement(
|
6278 | _beeButton2['default'],
|
6279 | {
|
6280 | colors: 'danger',
|
6281 | onClick: danger },
|
6282 | 'danger'
|
6283 | ),
|
6284 | _react2['default'].createElement(
|
6285 | _beeButton2['default'],
|
6286 | {
|
6287 | colors: 'warning',
|
6288 | onClick: warning },
|
6289 | 'warning'
|
6290 | ),
|
6291 | _react2['default'].createElement(
|
6292 | _beeButton2['default'],
|
6293 | {
|
6294 | colors: 'success',
|
6295 | onClick: success },
|
6296 | 'success'
|
6297 | ),
|
6298 | _react2['default'].createElement(
|
6299 | _beeButton2['default'],
|
6300 | {
|
6301 | colors: 'primary',
|
6302 | onClick: loading },
|
6303 | 'dark'
|
6304 | ),
|
6305 | _react2['default'].createElement(
|
6306 | _beeButton2['default'],
|
6307 | {
|
6308 | shape: 'border',
|
6309 | onClick: light },
|
6310 | 'light'
|
6311 | )
|
6312 | );
|
6313 | };
|
6314 |
|
6315 | return Demo1;
|
6316 | }(_react.Component);
|
6317 |
|
6318 | exports['default'] = Demo1;
|
6319 | module.exports = exports['default'];
|
6320 |
|
6321 | }),
|
6322 |
|
6323 | (function(module, exports, __webpack_require__) {
|
6324 |
|
6325 | 'use strict';
|
6326 |
|
6327 | Object.defineProperty(exports, "__esModule", {
|
6328 | value: true
|
6329 | });
|
6330 |
|
6331 | var _Message = __webpack_require__(66);
|
6332 |
|
6333 | var _Message2 = _interopRequireDefault(_Message);
|
6334 |
|
6335 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
6336 |
|
6337 | exports['default'] = _Message2['default'];
|
6338 | module.exports = exports['default'];
|
6339 |
|
6340 | }),
|
6341 |
|
6342 | (function(module, exports, __webpack_require__) {
|
6343 |
|
6344 | 'use strict';
|
6345 |
|
6346 | Object.defineProperty(exports, "__esModule", {
|
6347 | value: true
|
6348 | });
|
6349 |
|
6350 | 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; };
|
6351 |
|
6352 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
6353 |
|
6354 | var _react = __webpack_require__(4);
|
6355 |
|
6356 | var _react2 = _interopRequireDefault(_react);
|
6357 |
|
6358 | var _beeNotification = __webpack_require__(67);
|
6359 |
|
6360 | var _beeNotification2 = _interopRequireDefault(_beeNotification);
|
6361 |
|
6362 | var _classnames = __webpack_require__(3);
|
6363 |
|
6364 | var _classnames2 = _interopRequireDefault(_classnames);
|
6365 |
|
6366 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
6367 |
|
6368 | var defaultDuration = 1.5;
|
6369 | var defaultTop = 0;
|
6370 | var defaultBottom = 48;
|
6371 | var bottom = 90;
|
6372 | var padding = 30;
|
6373 | var width = 200;
|
6374 | var messageInstance = void 0;
|
6375 | var key = 1;
|
6376 | var clsPrefix = 'u-message';
|
6377 | var noop = function noop() {};
|
6378 |
|
6379 | var positionObj = {
|
6380 | "top": {
|
6381 | messageStyle: {
|
6382 | width: "100%"
|
6383 | },
|
6384 | notificationStyle: {
|
6385 | top: defaultTop,
|
6386 | width: "100%"
|
6387 | },
|
6388 | transitionName: 'top'
|
6389 | },
|
6390 | "bottom": {
|
6391 | messageStyle: {
|
6392 | width: "100%"
|
6393 | },
|
6394 | notificationStyle: {
|
6395 | bottom: defaultBottom,
|
6396 | width: "100%"
|
6397 | },
|
6398 | transitionName: 'bottom'
|
6399 | },
|
6400 | "topRight": {
|
6401 | messageStyle: {
|
6402 | width: width
|
6403 | },
|
6404 | notificationStyle: {
|
6405 | top: padding,
|
6406 | right: padding,
|
6407 | width: width
|
6408 | },
|
6409 | transitionName: 'right'
|
6410 | },
|
6411 | "bottomRight": {
|
6412 | messageStyle: {
|
6413 | width: width
|
6414 | },
|
6415 | notificationStyle: {
|
6416 | bottom: bottom,
|
6417 | right: padding,
|
6418 | width: width
|
6419 | },
|
6420 | transitionName: 'right'
|
6421 | },
|
6422 | "topLeft": {
|
6423 | messageStyle: {
|
6424 | width: width
|
6425 | },
|
6426 | notificationStyle: {
|
6427 | top: padding,
|
6428 | left: padding,
|
6429 | width: width
|
6430 | },
|
6431 | transitionName: 'left'
|
6432 | },
|
6433 | "bottomLeft": {
|
6434 | messageStyle: {
|
6435 | width: width
|
6436 | },
|
6437 | notificationStyle: {
|
6438 | bottom: bottom,
|
6439 | left: padding,
|
6440 | width: width
|
6441 | },
|
6442 | transitionName: 'left'
|
6443 | }
|
6444 | };
|
6445 |
|
6446 | function getMessageInstance() {
|
6447 | var position = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'top';
|
6448 |
|
6449 | var style = positionObj[position].notificationStyle;
|
6450 | messageInstance = messageInstance || _beeNotification2['default'].newInstance({
|
6451 | clsPrefix: clsPrefix,
|
6452 | transitionName: clsPrefix + '-' + positionObj[position].transitionName,
|
6453 | style: style,
|
6454 | position: ''
|
6455 | });
|
6456 | return messageInstance;
|
6457 | }
|
6458 |
|
6459 | function notice(content, duration, type, onClose, position, style) {
|
6460 | var iconType = {
|
6461 | info: 'uf uf-i-c-2',
|
6462 | success: 'uf uf-correct',
|
6463 | danger: 'uf uf-close-c',
|
6464 | warning: 'uf uf-exc-t',
|
6465 | light: 'uf uf-notification',
|
6466 | dark: 'uf uf-bubble',
|
6467 | news: 'uf uf-bell',
|
6468 | infolight: 'uf uf-i-c-2',
|
6469 | successlight: 'uf uf-correct',
|
6470 | dangerlight: 'uf uf-close-c',
|
6471 | warninglight: 'uf uf-exc-t'
|
6472 | }[type];
|
6473 |
|
6474 | var positionStyle = positionObj[position].messageStyle;
|
6475 |
|
6476 | var instance = getMessageInstance(position);
|
6477 |
|
6478 | instance.notice({
|
6479 | key: key,
|
6480 | duration: duration,
|
6481 | color: type,
|
6482 | style: _extends({}, positionStyle, style),
|
6483 | content: _react2['default'].createElement(
|
6484 | 'div',
|
6485 | null,
|
6486 | _react2['default'].createElement(
|
6487 | 'div',
|
6488 | { className: clsPrefix + '-notice-description-icon' },
|
6489 | _react2['default'].createElement('i', { className: (0, _classnames2['default'])(iconType) })
|
6490 | ),
|
6491 | _react2['default'].createElement(
|
6492 | 'div',
|
6493 | { className: clsPrefix + '-notice-description-content' },
|
6494 | content
|
6495 | )
|
6496 | ),
|
6497 | onClose: onClose
|
6498 | });
|
6499 | return function () {
|
6500 | var target = key++;
|
6501 | return function () {
|
6502 | instance.removeNotice(target);
|
6503 | };
|
6504 | }();
|
6505 | }
|
6506 |
|
6507 | exports['default'] = {
|
6508 | create: function create(obj) {
|
6509 | var content = obj.content || '';
|
6510 | var duration = _typeof(obj.duration) == undefined ? defaultDuration : obj.duration;
|
6511 | var color = obj.color || 'dark';
|
6512 | var onClose = obj.onClose || noop;
|
6513 | var position = obj.position || "top";
|
6514 | var style = obj.style || {};
|
6515 | return notice(content, duration, color, onClose, position, style);
|
6516 | },
|
6517 | config: function config(options) {
|
6518 | if (options.top !== undefined) {
|
6519 | defaultTop = options.top;
|
6520 | }
|
6521 | if (options.duration !== undefined) {
|
6522 | defaultDuration = options.duration;
|
6523 | }
|
6524 | if (options.clsPrefix !== undefined) {
|
6525 | clsPrefix = options.clsPrefix;
|
6526 | }
|
6527 | if (options.defaultBottom !== undefined) {
|
6528 | defaultBottom = options.defaultBottom;
|
6529 | }
|
6530 | if (options.bottom !== undefined) {
|
6531 | bottom = options.bottom;
|
6532 | }
|
6533 | if (options.width !== undefined) {
|
6534 | bottom = options.width;
|
6535 | }
|
6536 | },
|
6537 | destroy: function destroy() {
|
6538 | if (messageInstance) {
|
6539 | messageInstance.destroy();
|
6540 | messageInstance = null;
|
6541 | }
|
6542 | }
|
6543 | };
|
6544 | module.exports = exports['default'];
|
6545 |
|
6546 | }),
|
6547 |
|
6548 | (function(module, exports, __webpack_require__) {
|
6549 |
|
6550 | 'use strict';
|
6551 |
|
6552 | Object.defineProperty(exports, "__esModule", {
|
6553 | value: true
|
6554 | });
|
6555 |
|
6556 | var _Notification = __webpack_require__(68);
|
6557 |
|
6558 | var _Notification2 = _interopRequireDefault(_Notification);
|
6559 |
|
6560 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
6561 |
|
6562 | exports["default"] = _Notification2["default"];
|
6563 | module.exports = exports['default'];
|
6564 |
|
6565 | }),
|
6566 |
|
6567 | (function(module, exports, __webpack_require__) {
|
6568 |
|
6569 | 'use strict';
|
6570 |
|
6571 | Object.defineProperty(exports, "__esModule", {
|
6572 | value: true
|
6573 | });
|
6574 |
|
6575 | 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; };
|
6576 |
|
6577 | var _react = __webpack_require__(4);
|
6578 |
|
6579 | var _react2 = _interopRequireDefault(_react);
|
6580 |
|
6581 | var _propTypes = __webpack_require__(5);
|
6582 |
|
6583 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
6584 |
|
6585 | var _reactDom = __webpack_require__(12);
|
6586 |
|
6587 | var _reactDom2 = _interopRequireDefault(_reactDom);
|
6588 |
|
6589 | var _beeAnimate = __webpack_require__(69);
|
6590 |
|
6591 | var _beeAnimate2 = _interopRequireDefault(_beeAnimate);
|
6592 |
|
6593 | var _createChainedFunction = __webpack_require__(36);
|
6594 |
|
6595 | var _createChainedFunction2 = _interopRequireDefault(_createChainedFunction);
|
6596 |
|
6597 | var _classnames = __webpack_require__(3);
|
6598 |
|
6599 | var _classnames2 = _interopRequireDefault(_classnames);
|
6600 |
|
6601 | var _Notice = __webpack_require__(74);
|
6602 |
|
6603 | var _Notice2 = _interopRequireDefault(_Notice);
|
6604 |
|
6605 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
6606 |
|
6607 | 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; }
|
6608 |
|
6609 | 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; }
|
6610 |
|
6611 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
6612 |
|
6613 | 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; }
|
6614 |
|
6615 | 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); }
|
6616 |
|
6617 | var seed = 0;
|
6618 | var now = Date.now();
|
6619 |
|
6620 | function getUuid() {
|
6621 | return 'uNotification_' + now + '_' + seed++;
|
6622 | }
|
6623 |
|
6624 | var propTypes = {
|
6625 | show: _propTypes2["default"].bool,
|
6626 | clsPrefix: _propTypes2["default"].string,
|
6627 | style: _propTypes2["default"].object,
|
6628 | position: _propTypes2["default"].oneOf(['topRight', 'bottomRight', '']),
|
6629 | transitionName: _propTypes2["default"].string,
|
6630 | animation: _propTypes2["default"].oneOfType([_propTypes2["default"].string, _propTypes2["default"].object])
|
6631 | };
|
6632 |
|
6633 | var defaultProps = {
|
6634 | clsPrefix: 'u-notification',
|
6635 | animation: 'fade',
|
6636 | position: 'topRight'
|
6637 | };
|
6638 |
|
6639 | var Notification = function (_Component) {
|
6640 | _inherits(Notification, _Component);
|
6641 |
|
6642 | function Notification(props) {
|
6643 | _classCallCheck(this, Notification);
|
6644 |
|
6645 | var _this = _possibleConstructorReturn(this, _Component.call(this, props));
|
6646 |
|
6647 | _this.state = {
|
6648 | notices: []
|
6649 | };
|
6650 | _this.add = _this.add.bind(_this);
|
6651 | _this.remove = _this.remove.bind(_this);
|
6652 |
|
6653 | return _this;
|
6654 | }
|
6655 |
|
6656 | Notification.prototype.getTransitionName = function getTransitionName() {
|
6657 | var props = this.props;
|
6658 | var transitionName = props.transitionName;
|
6659 | if (!transitionName && props.animation) {
|
6660 | transitionName = props.clsPrefix + '-' + props.animation;
|
6661 | }
|
6662 | return transitionName;
|
6663 | };
|
6664 |
|
6665 | Notification.prototype.add = function add(notice) {
|
6666 | var key = notice.key = notice.key || getUuid();
|
6667 | this.setState(function (previousState) {
|
6668 | var notices = previousState.notices;
|
6669 | if (!notices.filter(function (v) {
|
6670 | return v.key === key;
|
6671 | }).length) {
|
6672 | return {
|
6673 | notices: notices.concat(notice)
|
6674 | };
|
6675 | }
|
6676 | });
|
6677 | };
|
6678 |
|
6679 | Notification.prototype.remove = function remove(key) {
|
6680 | this.setState(function (previousState) {
|
6681 | return {
|
6682 | notices: previousState.notices.filter(function (notice) {
|
6683 | return notice.key !== key;
|
6684 | })
|
6685 | };
|
6686 | });
|
6687 | };
|
6688 |
|
6689 | Notification.prototype.render = function render() {
|
6690 | var _this2 = this,
|
6691 | _classes;
|
6692 |
|
6693 | var _props = this.props,
|
6694 | clsPrefix = _props.clsPrefix,
|
6695 | className = _props.className,
|
6696 | position = _props.position,
|
6697 | style = _props.style;
|
6698 |
|
6699 | var noticeNodes = this.state.notices.map(function (notice) {
|
6700 | var onClose = (0, _createChainedFunction2["default"])(_this2.remove.bind(_this2, notice.key), notice.onClose);
|
6701 | return _react2["default"].createElement(
|
6702 | _Notice2["default"],
|
6703 | _extends({
|
6704 | clsPrefix: clsPrefix
|
6705 | }, notice, {
|
6706 | onClose: onClose
|
6707 | }),
|
6708 | notice.content
|
6709 | );
|
6710 | });
|
6711 | var classes = (_classes = {}, _defineProperty(_classes, clsPrefix, 1), _defineProperty(_classes, className, !!className), _classes);
|
6712 | if (position) {
|
6713 | classes[clsPrefix + '-' + position] = !!position;
|
6714 | }
|
6715 |
|
6716 | return _react2["default"].createElement(
|
6717 | 'div',
|
6718 | { className: (0, _classnames2["default"])(className, classes), style: style },
|
6719 | _react2["default"].createElement(
|
6720 | _beeAnimate2["default"],
|
6721 | { transitionName: this.getTransitionName() },
|
6722 | noticeNodes
|
6723 | )
|
6724 | );
|
6725 | };
|
6726 |
|
6727 | return Notification;
|
6728 | }(_react.Component);
|
6729 |
|
6730 | ;
|
6731 |
|
6732 | Notification.propTypes = propTypes;
|
6733 | Notification.defaultProps = defaultProps;
|
6734 |
|
6735 | Notification.newInstance = function newNotificationInstance(properties) {
|
6736 | var props = properties || {};
|
6737 | var div = document.createElement('div');
|
6738 | document.body.appendChild(div);
|
6739 | var notification = _reactDom2["default"].render(_react2["default"].createElement(Notification, props), div);
|
6740 | return {
|
6741 | notice: function notice(noticeProps) {
|
6742 | notification.add(noticeProps);
|
6743 | },
|
6744 | removeNotice: function removeNotice(key) {
|
6745 | notification.remove(key);
|
6746 | },
|
6747 |
|
6748 | component: notification,
|
6749 | destroy: function destroy() {
|
6750 | _reactDom2["default"].unmountComponentAtNode(div);
|
6751 | document.body.removeChild(div);
|
6752 | }
|
6753 | };
|
6754 | };
|
6755 |
|
6756 | exports["default"] = Notification;
|
6757 | module.exports = exports['default'];
|
6758 |
|
6759 | }),
|
6760 |
|
6761 | (function(module, exports, __webpack_require__) {
|
6762 |
|
6763 | 'use strict';
|
6764 |
|
6765 | Object.defineProperty(exports, "__esModule", {
|
6766 | value: true
|
6767 | });
|
6768 |
|
6769 | var _Animate = __webpack_require__(70);
|
6770 |
|
6771 | var _Animate2 = _interopRequireDefault(_Animate);
|
6772 |
|
6773 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
6774 |
|
6775 | exports["default"] = _Animate2["default"];
|
6776 | module.exports = exports['default'];
|
6777 |
|
6778 | }),
|
6779 |
|
6780 | (function(module, exports, __webpack_require__) {
|
6781 |
|
6782 | 'use strict';
|
6783 |
|
6784 | Object.defineProperty(exports, "__esModule", {
|
6785 | value: true
|
6786 | });
|
6787 |
|
6788 | var _react = __webpack_require__(4);
|
6789 |
|
6790 | var _react2 = _interopRequireDefault(_react);
|
6791 |
|
6792 | var _propTypes = __webpack_require__(5);
|
6793 |
|
6794 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
6795 |
|
6796 | var _ChildrenUtils = __webpack_require__(71);
|
6797 |
|
6798 | var _AnimateChild = __webpack_require__(72);
|
6799 |
|
6800 | var _AnimateChild2 = _interopRequireDefault(_AnimateChild);
|
6801 |
|
6802 | var _util = __webpack_require__(73);
|
6803 |
|
6804 | var _util2 = _interopRequireDefault(_util);
|
6805 |
|
6806 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
6807 |
|
6808 | 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; }
|
6809 |
|
6810 | 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; }
|
6811 |
|
6812 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
6813 |
|
6814 | 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; }
|
6815 |
|
6816 | 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); }
|
6817 |
|
6818 | var defaultKey = 'u_animate_' + Date.now();
|
6819 |
|
6820 |
|
6821 | function getChildrenFromProps(props) {
|
6822 | var children = props.children;
|
6823 | if (_react2["default"].isValidElement(children)) {
|
6824 | if (!children.key) {
|
6825 | return _react2["default"].cloneElement(children, {
|
6826 | key: defaultKey
|
6827 | });
|
6828 | }
|
6829 | }
|
6830 | return children;
|
6831 | }
|
6832 |
|
6833 | function noop() {}
|
6834 |
|
6835 | var propTypes = {
|
6836 | component: _propTypes2["default"].any,
|
6837 | animation: _propTypes2["default"].object,
|
6838 | transitionName: _propTypes2["default"].oneOfType([_propTypes2["default"].string, _propTypes2["default"].object]),
|
6839 | transitionEnter: _propTypes2["default"].bool,
|
6840 | transitionAppear: _propTypes2["default"].bool,
|
6841 | exclusive: _propTypes2["default"].bool,
|
6842 | transitionLeave: _propTypes2["default"].bool,
|
6843 | onEnd: _propTypes2["default"].func,
|
6844 | onEnter: _propTypes2["default"].func,
|
6845 | onLeave: _propTypes2["default"].func,
|
6846 | onAppear: _propTypes2["default"].func,
|
6847 | showProp: _propTypes2["default"].string
|
6848 | };
|
6849 |
|
6850 | var defaultProps = {
|
6851 | animation: {},
|
6852 | component: 'span',
|
6853 | transitionEnter: true,
|
6854 | transitionLeave: true,
|
6855 | transitionAppear: false,
|
6856 | onEnd: noop,
|
6857 | onEnter: noop,
|
6858 | onLeave: noop,
|
6859 | onAppear: noop
|
6860 | };
|
6861 |
|
6862 | var Animate = function (_Component) {
|
6863 | _inherits(Animate, _Component);
|
6864 |
|
6865 | function Animate(props) {
|
6866 | _classCallCheck(this, Animate);
|
6867 |
|
6868 | var _this = _possibleConstructorReturn(this, _Component.call(this, props));
|
6869 |
|
6870 | _this.currentlyAnimatingKeys = {};
|
6871 | _this.keysToEnter = [];
|
6872 | _this.keysToLeave = [];
|
6873 | _this.state = {
|
6874 | children: (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(_this.props))
|
6875 | };
|
6876 |
|
6877 | _this.performEnter = _this.performEnter.bind(_this);
|
6878 | _this.performAppear = _this.performAppear.bind(_this);
|
6879 | _this.handleDoneAdding = _this.handleDoneAdding.bind(_this);
|
6880 | _this.performLeave = _this.performLeave.bind(_this);
|
6881 |
|
6882 | _this.performLeave = _this.performLeave.bind(_this);
|
6883 | _this.handleDoneLeaving = _this.handleDoneLeaving.bind(_this);
|
6884 | _this.isValidChildByKey = _this.isValidChildByKey.bind(_this);
|
6885 | _this.stop = _this.stop.bind(_this);
|
6886 | return _this;
|
6887 | }
|
6888 |
|
6889 | Animate.prototype.componentDidMount = function componentDidMount() {
|
6890 | var _this2 = this;
|
6891 |
|
6892 | this.mounted = true;
|
6893 | var showProp = this.props.showProp;
|
6894 | var children = this.state.children;
|
6895 | if (showProp) {
|
6896 | children = children.filter(function (child) {
|
6897 | return !!child.props[showProp];
|
6898 | });
|
6899 | }
|
6900 | children.forEach(function (child) {
|
6901 | if (child) {
|
6902 | _this2.performAppear(child.key);
|
6903 | }
|
6904 | });
|
6905 | };
|
6906 |
|
6907 | Animate.prototype.componentWillUnmount = function componentWillUnmount() {
|
6908 | this.mounted = false;
|
6909 | };
|
6910 |
|
6911 | Animate.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
6912 | var _this3 = this;
|
6913 |
|
6914 | this.nextProps = nextProps;
|
6915 | var nextChildren = (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(nextProps));
|
6916 | var props = this.props;
|
6917 |
|
6918 | if (props.exclusive) {
|
6919 | Object.keys(this.currentlyAnimatingKeys).forEach(function (key) {
|
6920 | _this3.stop(key);
|
6921 | });
|
6922 | }
|
6923 | var showProp = props.showProp;
|
6924 | var currentlyAnimatingKeys = this.currentlyAnimatingKeys;
|
6925 |
|
6926 | var currentChildren = props.exclusive ? (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(props)) : this.state.children;
|
6927 |
|
6928 | var newChildren = [];
|
6929 | if (showProp) {
|
6930 | currentChildren.forEach(function (currentChild) {
|
6931 | var nextChild = currentChild && (0, _ChildrenUtils.findChildInChildrenByKey)(nextChildren, currentChild.key);
|
6932 | var newChild = void 0;
|
6933 | if ((!nextChild || !nextChild.props[showProp]) && currentChild.props[showProp]) {
|
6934 | newChild = _react2["default"].cloneElement(nextChild || currentChild, _defineProperty({}, showProp, true));
|
6935 | } else {
|
6936 | newChild = nextChild;
|
6937 | }
|
6938 | if (newChild) {
|
6939 | newChildren.push(newChild);
|
6940 | }
|
6941 | });
|
6942 | nextChildren.forEach(function (nextChild) {
|
6943 | if (!nextChild || !(0, _ChildrenUtils.findChildInChildrenByKey)(currentChildren, nextChild.key)) {
|
6944 | newChildren.push(nextChild);
|
6945 | }
|
6946 | });
|
6947 | } else {
|
6948 | newChildren = (0, _ChildrenUtils.mergeChildren)(currentChildren, nextChildren);
|
6949 | }
|
6950 |
|
6951 |
|
6952 | this.setState({
|
6953 | children: newChildren
|
6954 | });
|
6955 |
|
6956 | nextChildren.forEach(function (child) {
|
6957 | var key = child && child.key;
|
6958 | if (child && currentlyAnimatingKeys[key]) {
|
6959 | return;
|
6960 | }
|
6961 | var hasPrev = child && (0, _ChildrenUtils.findChildInChildrenByKey)(currentChildren, key);
|
6962 | if (showProp) {
|
6963 | var showInNext = child.props[showProp];
|
6964 | if (hasPrev) {
|
6965 | var showInNow = (0, _ChildrenUtils.findShownChildInChildrenByKey)(currentChildren, key, showProp);
|
6966 | if (!showInNow && showInNext) {
|
6967 | _this3.keysToEnter.push(key);
|
6968 | }
|
6969 | } else if (showInNext) {
|
6970 | _this3.keysToEnter.push(key);
|
6971 | }
|
6972 | } else if (!hasPrev) {
|
6973 | _this3.keysToEnter.push(key);
|
6974 | }
|
6975 | });
|
6976 |
|
6977 | currentChildren.forEach(function (child) {
|
6978 | var key = child && child.key;
|
6979 | if (child && currentlyAnimatingKeys[key]) {
|
6980 | return;
|
6981 | }
|
6982 | var hasNext = child && (0, _ChildrenUtils.findChildInChildrenByKey)(nextChildren, key);
|
6983 | if (showProp) {
|
6984 | var showInNow = child.props[showProp];
|
6985 | if (hasNext) {
|
6986 | var showInNext = (0, _ChildrenUtils.findShownChildInChildrenByKey)(nextChildren, key, showProp);
|
6987 | if (!showInNext && showInNow) {
|
6988 | _this3.keysToLeave.push(key);
|
6989 | }
|
6990 | } else if (showInNow) {
|
6991 | _this3.keysToLeave.push(key);
|
6992 | }
|
6993 | } else if (!hasNext) {
|
6994 | _this3.keysToLeave.push(key);
|
6995 | }
|
6996 | });
|
6997 | };
|
6998 |
|
6999 | Animate.prototype.componentDidUpdate = function componentDidUpdate() {
|
7000 | var keysToEnter = this.keysToEnter;
|
7001 | this.keysToEnter = [];
|
7002 | keysToEnter.forEach(this.performEnter);
|
7003 | var keysToLeave = this.keysToLeave;
|
7004 | this.keysToLeave = [];
|
7005 | keysToLeave.forEach(this.performLeave);
|
7006 | };
|
7007 |
|
7008 | Animate.prototype.performEnter = function performEnter(key) {
|
7009 |
|
7010 | if (this.refs[key]) {
|
7011 | this.currentlyAnimatingKeys[key] = true;
|
7012 | this.refs[key].componentWillEnter(this.handleDoneAdding.bind(this, key, 'enter'));
|
7013 | }
|
7014 | };
|
7015 |
|
7016 | Animate.prototype.performAppear = function performAppear(key) {
|
7017 | if (this.refs[key]) {
|
7018 | this.currentlyAnimatingKeys[key] = true;
|
7019 | this.refs[key].componentWillAppear(this.handleDoneAdding.bind(this, key, 'appear'));
|
7020 | }
|
7021 | };
|
7022 |
|
7023 | Animate.prototype.handleDoneAdding = function handleDoneAdding(key, type) {
|
7024 | var props = this.props;
|
7025 | delete this.currentlyAnimatingKeys[key];
|
7026 |
|
7027 | if (props.exclusive && props !== this.nextProps) {
|
7028 | return;
|
7029 | }
|
7030 | var currentChildren = (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(props));
|
7031 | if (!this.isValidChildByKey(currentChildren, key)) {
|
7032 |
|
7033 | this.performLeave(key);
|
7034 | } else {
|
7035 | if (type === 'appear') {
|
7036 | if (_util2["default"].allowAppearCallback(props)) {
|
7037 | props.onAppear(key);
|
7038 | props.onEnd(key, true);
|
7039 | }
|
7040 | } else {
|
7041 | if (_util2["default"].allowEnterCallback(props)) {
|
7042 | props.onEnter(key);
|
7043 | props.onEnd(key, true);
|
7044 | }
|
7045 | }
|
7046 | }
|
7047 | };
|
7048 |
|
7049 | Animate.prototype.performLeave = function performLeave(key) {
|
7050 |
|
7051 | if (this.refs[key]) {
|
7052 | this.currentlyAnimatingKeys[key] = true;
|
7053 | this.refs[key].componentWillLeave(this.handleDoneLeaving.bind(this, key));
|
7054 | }
|
7055 | };
|
7056 |
|
7057 | Animate.prototype.handleDoneLeaving = function handleDoneLeaving(key) {
|
7058 | var props = this.props;
|
7059 | delete this.currentlyAnimatingKeys[key];
|
7060 |
|
7061 | if (props.exclusive && props !== this.nextProps) {
|
7062 | return;
|
7063 | }
|
7064 | var currentChildren = (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(props));
|
7065 |
|
7066 | if (this.isValidChildByKey(currentChildren, key)) {
|
7067 | this.performEnter(key);
|
7068 | } else {
|
7069 | var end = function end() {
|
7070 | if (_util2["default"].allowLeaveCallback(props)) {
|
7071 | props.onLeave(key);
|
7072 | props.onEnd(key, false);
|
7073 | }
|
7074 | };
|
7075 |
|
7076 | if (this.mounted && !(0, _ChildrenUtils.isSameChildren)(this.state.children, currentChildren, props.showProp)) {
|
7077 | this.setState({
|
7078 | children: currentChildren
|
7079 | }, end);
|
7080 | } else {
|
7081 | end();
|
7082 | }
|
7083 | }
|
7084 | };
|
7085 |
|
7086 | Animate.prototype.isValidChildByKey = function isValidChildByKey(currentChildren, key) {
|
7087 | var showProp = this.props.showProp;
|
7088 | if (showProp) {
|
7089 | return (0, _ChildrenUtils.findShownChildInChildrenByKey)(currentChildren, key, showProp);
|
7090 | }
|
7091 | return (0, _ChildrenUtils.findChildInChildrenByKey)(currentChildren, key);
|
7092 | };
|
7093 |
|
7094 | Animate.prototype.stop = function stop(key) {
|
7095 | delete this.currentlyAnimatingKeys[key];
|
7096 | var component = this.refs[key];
|
7097 | if (component) {
|
7098 | component.stop();
|
7099 | }
|
7100 | };
|
7101 |
|
7102 | Animate.prototype.render = function render() {
|
7103 | var props = this.props;
|
7104 | this.nextProps = props;
|
7105 | var stateChildren = this.state.children;
|
7106 | var children = null;
|
7107 | if (stateChildren) {
|
7108 | children = stateChildren.map(function (child) {
|
7109 | if (child === null || child === undefined) {
|
7110 | return child;
|
7111 | }
|
7112 | if (!child.key) {
|
7113 | throw new Error('must set key for <rc-animate> children');
|
7114 | }
|
7115 | return _react2["default"].createElement(
|
7116 | _AnimateChild2["default"],
|
7117 | {
|
7118 | key: child.key,
|
7119 | ref: child.key,
|
7120 | animation: props.animation,
|
7121 | transitionName: props.transitionName,
|
7122 | transitionEnter: props.transitionEnter,
|
7123 | transitionAppear: props.transitionAppear,
|
7124 | transitionLeave: props.transitionLeave
|
7125 | },
|
7126 | child
|
7127 | );
|
7128 | });
|
7129 | }
|
7130 | var Component = props.component;
|
7131 | if (Component) {
|
7132 | var passedProps = props;
|
7133 | if (typeof Component === 'string') {
|
7134 | passedProps = {
|
7135 | className: props.className,
|
7136 | style: props.style
|
7137 | };
|
7138 | }
|
7139 | return _react2["default"].createElement(
|
7140 | Component,
|
7141 | passedProps,
|
7142 | children
|
7143 | );
|
7144 | }
|
7145 | return children[0] || null;
|
7146 | };
|
7147 |
|
7148 | return Animate;
|
7149 | }(_react.Component);
|
7150 |
|
7151 | ;
|
7152 | Animate.defaultProps = defaultProps;
|
7153 | Animate.propTypes = Animate.propTypes;
|
7154 |
|
7155 | exports["default"] = Animate;
|
7156 | module.exports = exports['default'];
|
7157 |
|
7158 | }),
|
7159 |
|
7160 | (function(module, exports, __webpack_require__) {
|
7161 |
|
7162 | 'use strict';
|
7163 |
|
7164 | Object.defineProperty(exports, "__esModule", {
|
7165 | value: true
|
7166 | });
|
7167 | exports.toArrayChildren = toArrayChildren;
|
7168 | exports.findChildInChildrenByKey = findChildInChildrenByKey;
|
7169 | exports.findShownChildInChildrenByKey = findShownChildInChildrenByKey;
|
7170 | exports.findHiddenChildInChildrenByKey = findHiddenChildInChildrenByKey;
|
7171 | exports.isSameChildren = isSameChildren;
|
7172 | exports.mergeChildren = mergeChildren;
|
7173 |
|
7174 | var _react = __webpack_require__(4);
|
7175 |
|
7176 | var _react2 = _interopRequireDefault(_react);
|
7177 |
|
7178 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
7179 |
|
7180 | function toArrayChildren(children) {
|
7181 | var ret = [];
|
7182 | _react2["default"].Children.forEach(children, function (child) {
|
7183 | ret.push(child);
|
7184 | });
|
7185 | return ret;
|
7186 | }
|
7187 |
|
7188 | function findChildInChildrenByKey(children, key) {
|
7189 | var ret = null;
|
7190 | if (children) {
|
7191 | children.forEach(function (child) {
|
7192 | if (ret) {
|
7193 | return;
|
7194 | }
|
7195 | if (child && child.key === key) {
|
7196 | ret = child;
|
7197 | }
|
7198 | });
|
7199 | }
|
7200 | return ret;
|
7201 | }
|
7202 |
|
7203 | function findShownChildInChildrenByKey(children, key, showProp) {
|
7204 | var ret = null;
|
7205 | if (children) {
|
7206 | children.forEach(function (child) {
|
7207 | if (child && child.key === key && child.props[showProp]) {
|
7208 | if (ret) {
|
7209 | throw new Error('two child with same key for <rc-animate> children');
|
7210 | }
|
7211 | ret = child;
|
7212 | }
|
7213 | });
|
7214 | }
|
7215 | return ret;
|
7216 | }
|
7217 |
|
7218 | function findHiddenChildInChildrenByKey(children, key, showProp) {
|
7219 | var found = 0;
|
7220 | if (children) {
|
7221 | children.forEach(function (child) {
|
7222 | if (found) {
|
7223 | return;
|
7224 | }
|
7225 | found = child && child.key === key && !child.props[showProp];
|
7226 | });
|
7227 | }
|
7228 | return found;
|
7229 | }
|
7230 |
|
7231 | function isSameChildren(c1, c2, showProp) {
|
7232 | var same = c1.length === c2.length;
|
7233 | if (same) {
|
7234 | c1.forEach(function (child, index) {
|
7235 | var child2 = c2[index];
|
7236 | if (child && child2) {
|
7237 | if (child && !child2 || !child && child2) {
|
7238 | same = false;
|
7239 | } else if (child.key !== child2.key) {
|
7240 | same = false;
|
7241 | } else if (showProp && child.props[showProp] !== child2.props[showProp]) {
|
7242 | same = false;
|
7243 | }
|
7244 | }
|
7245 | });
|
7246 | }
|
7247 | return same;
|
7248 | }
|
7249 |
|
7250 | function mergeChildren(prev, next) {
|
7251 | var ret = [];
|
7252 |
|
7253 |
|
7254 |
|
7255 | var nextChildrenPending = {};
|
7256 | var pendingChildren = [];
|
7257 | prev.forEach(function (child) {
|
7258 | if (child && findChildInChildrenByKey(next, child.key)) {
|
7259 | if (pendingChildren.length) {
|
7260 | nextChildrenPending[child.key] = pendingChildren;
|
7261 | pendingChildren = [];
|
7262 | }
|
7263 | } else {
|
7264 | pendingChildren.push(child);
|
7265 | }
|
7266 | });
|
7267 |
|
7268 | next.forEach(function (child) {
|
7269 | if (child && nextChildrenPending.hasOwnProperty(child.key)) {
|
7270 | ret = ret.concat(nextChildrenPending[child.key]);
|
7271 | }
|
7272 | ret.push(child);
|
7273 | });
|
7274 |
|
7275 | ret = ret.concat(pendingChildren);
|
7276 |
|
7277 | return ret;
|
7278 | }
|
7279 |
|
7280 | }),
|
7281 |
|
7282 | (function(module, exports, __webpack_require__) {
|
7283 |
|
7284 | 'use strict';
|
7285 |
|
7286 | Object.defineProperty(exports, "__esModule", {
|
7287 | value: true
|
7288 | });
|
7289 |
|
7290 | 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; };
|
7291 |
|
7292 | var _react = __webpack_require__(4);
|
7293 |
|
7294 | var _react2 = _interopRequireDefault(_react);
|
7295 |
|
7296 | var _propTypes = __webpack_require__(5);
|
7297 |
|
7298 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
7299 |
|
7300 | var _reactDom = __webpack_require__(12);
|
7301 |
|
7302 | var _reactDom2 = _interopRequireDefault(_reactDom);
|
7303 |
|
7304 | var _tinperBeeCore = __webpack_require__(26);
|
7305 |
|
7306 | var _util = __webpack_require__(73);
|
7307 |
|
7308 | var _util2 = _interopRequireDefault(_util);
|
7309 |
|
7310 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
7311 |
|
7312 | 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; }
|
7313 |
|
7314 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
7315 |
|
7316 | 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; }
|
7317 |
|
7318 | 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); }
|
7319 |
|
7320 | var transitionMap = {
|
7321 | enter: 'transitionEnter',
|
7322 | appear: 'transitionAppear',
|
7323 | leave: 'transitionLeave'
|
7324 | };
|
7325 |
|
7326 | var propTypes = {
|
7327 | children: _propTypes2["default"].any
|
7328 | };
|
7329 |
|
7330 | var AnimateChild = function (_Component) {
|
7331 | _inherits(AnimateChild, _Component);
|
7332 |
|
7333 | function AnimateChild(props) {
|
7334 | _classCallCheck(this, AnimateChild);
|
7335 |
|
7336 | var _this = _possibleConstructorReturn(this, _Component.call(this, props));
|
7337 |
|
7338 | _this.transition = _this.transition.bind(_this);
|
7339 | _this.stop = _this.stop.bind(_this);
|
7340 | return _this;
|
7341 | }
|
7342 |
|
7343 | AnimateChild.prototype.componentWillUnmount = function componentWillUnmount() {
|
7344 | this.stop();
|
7345 | };
|
7346 |
|
7347 | AnimateChild.prototype.componentWillEnter = function componentWillEnter(done) {
|
7348 | if (_util2["default"].isEnterSupported(this.props)) {
|
7349 | this.transition('enter', done);
|
7350 | } else {
|
7351 | done();
|
7352 | }
|
7353 | };
|
7354 |
|
7355 | AnimateChild.prototype.componentWillAppear = function componentWillAppear(done) {
|
7356 | if (_util2["default"].isAppearSupported(this.props)) {
|
7357 | this.transition('appear', done);
|
7358 | } else {
|
7359 | done();
|
7360 | }
|
7361 | };
|
7362 |
|
7363 | AnimateChild.prototype.componentWillLeave = function componentWillLeave(done) {
|
7364 | if (_util2["default"].isLeaveSupported(this.props)) {
|
7365 | this.transition('leave', done);
|
7366 | } else {
|
7367 |
|
7368 |
|
7369 |
|
7370 | done();
|
7371 | }
|
7372 | };
|
7373 |
|
7374 | AnimateChild.prototype.transition = function transition(animationType, finishCallback) {
|
7375 | var _this2 = this;
|
7376 |
|
7377 | var node = _reactDom2["default"].findDOMNode(this);
|
7378 | var props = this.props;
|
7379 | var transitionName = props.transitionName;
|
7380 | var nameIsObj = (typeof transitionName === 'undefined' ? 'undefined' : _typeof(transitionName)) === 'object';
|
7381 | this.stop();
|
7382 | var end = function end() {
|
7383 | _this2.stopper = null;
|
7384 | finishCallback();
|
7385 | };
|
7386 | if ((_tinperBeeCore.cssAnimation.isCssAnimationSupported || !props.animation[animationType]) && transitionName && props[transitionMap[animationType]]) {
|
7387 | var name = nameIsObj ? transitionName[animationType] : transitionName + '-' + animationType;
|
7388 | var activeName = name + '-active';
|
7389 | if (nameIsObj && transitionName[animationType + 'Active']) {
|
7390 | activeName = transitionName[animationType + 'Active'];
|
7391 | }
|
7392 | this.stopper = (0, _tinperBeeCore.cssAnimation)(node, {
|
7393 | name: name,
|
7394 | active: activeName
|
7395 | }, end);
|
7396 | } else {
|
7397 | this.stopper = props.animation[animationType](node, end);
|
7398 | }
|
7399 | };
|
7400 |
|
7401 | AnimateChild.prototype.stop = function stop() {
|
7402 | var stopper = this.stopper;
|
7403 | if (stopper) {
|
7404 | this.stopper = null;
|
7405 | stopper.stop();
|
7406 | }
|
7407 | };
|
7408 |
|
7409 | AnimateChild.prototype.render = function render() {
|
7410 | return this.props.children;
|
7411 | };
|
7412 |
|
7413 | return AnimateChild;
|
7414 | }(_react.Component);
|
7415 |
|
7416 | ;
|
7417 |
|
7418 | AnimateChild.propTypes = propTypes;
|
7419 |
|
7420 | exports["default"] = AnimateChild;
|
7421 | module.exports = exports['default'];
|
7422 |
|
7423 | }),
|
7424 |
|
7425 | (function(module, exports) {
|
7426 |
|
7427 | "use strict";
|
7428 |
|
7429 | Object.defineProperty(exports, "__esModule", {
|
7430 | value: true
|
7431 | });
|
7432 | var util = {
|
7433 | isAppearSupported: function isAppearSupported(props) {
|
7434 | return props.transitionName && props.transitionAppear || props.animation.appear;
|
7435 | },
|
7436 | isEnterSupported: function isEnterSupported(props) {
|
7437 | return props.transitionName && props.transitionEnter || props.animation.enter;
|
7438 | },
|
7439 | isLeaveSupported: function isLeaveSupported(props) {
|
7440 | return props.transitionName && props.transitionLeave || props.animation.leave;
|
7441 | },
|
7442 | allowAppearCallback: function allowAppearCallback(props) {
|
7443 | return props.transitionAppear || props.animation.appear;
|
7444 | },
|
7445 | allowEnterCallback: function allowEnterCallback(props) {
|
7446 | return props.transitionEnter || props.animation.enter;
|
7447 | },
|
7448 | allowLeaveCallback: function allowLeaveCallback(props) {
|
7449 | return props.transitionLeave || props.animation.leave;
|
7450 | }
|
7451 | };
|
7452 | exports["default"] = util;
|
7453 | module.exports = exports["default"];
|
7454 |
|
7455 | }),
|
7456 |
|
7457 | (function(module, exports, __webpack_require__) {
|
7458 |
|
7459 | 'use strict';
|
7460 |
|
7461 | Object.defineProperty(exports, "__esModule", {
|
7462 | value: true
|
7463 | });
|
7464 |
|
7465 | var _react = __webpack_require__(4);
|
7466 |
|
7467 | var _react2 = _interopRequireDefault(_react);
|
7468 |
|
7469 | var _classnames = __webpack_require__(3);
|
7470 |
|
7471 | var _classnames2 = _interopRequireDefault(_classnames);
|
7472 |
|
7473 | var _propTypes = __webpack_require__(5);
|
7474 |
|
7475 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
7476 |
|
7477 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
7478 |
|
7479 | 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; }
|
7480 |
|
7481 | 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; }
|
7482 |
|
7483 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
7484 |
|
7485 | 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; }
|
7486 |
|
7487 | 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); }
|
7488 |
|
7489 | var propTypes = {
|
7490 | duration: _propTypes2["default"].number,
|
7491 | onClose: _propTypes2["default"].func,
|
7492 | children: _propTypes2["default"].any,
|
7493 | color: _propTypes2["default"].oneOf(['light']),
|
7494 | title: _propTypes2["default"].any
|
7495 | };
|
7496 |
|
7497 | function noop() {}
|
7498 |
|
7499 | var defaultProps = {
|
7500 | onEnd: noop,
|
7501 | onClose: noop,
|
7502 | duration: 4.5,
|
7503 | closable: true
|
7504 | };
|
7505 |
|
7506 | var Notice = function (_React$Component) {
|
7507 | _inherits(Notice, _React$Component);
|
7508 |
|
7509 | function Notice(props) {
|
7510 | _classCallCheck(this, Notice);
|
7511 |
|
7512 | var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
|
7513 |
|
7514 | _this.clearCloseTimer = _this.clearCloseTimer.bind(_this);
|
7515 | _this.close = _this.close.bind(_this);
|
7516 | return _this;
|
7517 | }
|
7518 |
|
7519 | Notice.prototype.componentDidMount = function componentDidMount() {
|
7520 | var _this2 = this;
|
7521 |
|
7522 | if (this.props.duration) {
|
7523 | this.closeTimer = setTimeout(function () {
|
7524 | _this2.close();
|
7525 | }, this.props.duration * 1000);
|
7526 | }
|
7527 | };
|
7528 |
|
7529 | Notice.prototype.componentWillUnmount = function componentWillUnmount() {
|
7530 | this.clearCloseTimer();
|
7531 | };
|
7532 |
|
7533 | Notice.prototype.clearCloseTimer = function clearCloseTimer() {
|
7534 | if (this.closeTimer) {
|
7535 | clearTimeout(this.closeTimer);
|
7536 | this.closeTimer = null;
|
7537 | }
|
7538 | };
|
7539 |
|
7540 | Notice.prototype.close = function close() {
|
7541 | this.clearCloseTimer();
|
7542 | this.props.onClose();
|
7543 | };
|
7544 |
|
7545 | Notice.prototype.render = function render() {
|
7546 | var _classes;
|
7547 |
|
7548 | var _props = this.props,
|
7549 | closable = _props.closable,
|
7550 | clsPrefix = _props.clsPrefix,
|
7551 | className = _props.className,
|
7552 | style = _props.style,
|
7553 | children = _props.children,
|
7554 | color = _props.color,
|
7555 | title = _props.title;
|
7556 |
|
7557 | var componentClass = clsPrefix + '-notice';
|
7558 | var classes = (_classes = {}, _defineProperty(_classes, '' + componentClass, 1), _defineProperty(_classes, componentClass + '-closable', closable), _defineProperty(_classes, className, !!className), _classes);
|
7559 | if (color) {
|
7560 | classes[componentClass + '-' + color] = true;
|
7561 | }
|
7562 | return _react2["default"].createElement(
|
7563 | 'div',
|
7564 | { className: (0, _classnames2["default"])(classes), style: style, onClick: this.close },
|
7565 | _react2["default"].createElement(
|
7566 | 'div',
|
7567 | { className: componentClass + '-content' },
|
7568 | title && _react2["default"].createElement(
|
7569 | 'div',
|
7570 | { className: componentClass + '-title' },
|
7571 | title
|
7572 | ),
|
7573 | _react2["default"].createElement(
|
7574 | 'div',
|
7575 | { className: componentClass + '-description' },
|
7576 | children
|
7577 | )
|
7578 | ),
|
7579 | closable ? _react2["default"].createElement(
|
7580 | 'a',
|
7581 | { tabIndex: '0', onClick: this.close, className: componentClass + '-close' },
|
7582 | _react2["default"].createElement('span', { className: componentClass + '-close-x' })
|
7583 | ) : null
|
7584 | );
|
7585 | };
|
7586 |
|
7587 | return Notice;
|
7588 | }(_react2["default"].Component);
|
7589 |
|
7590 | ;
|
7591 |
|
7592 | Notice.PropTypes = _propTypes2["default"];
|
7593 | Notice.defaultProps = defaultProps;
|
7594 |
|
7595 | exports["default"] = Notice;
|
7596 | module.exports = exports['default'];
|
7597 |
|
7598 | }),
|
7599 |
|
7600 | (function(module, exports, __webpack_require__) {
|
7601 |
|
7602 | 'use strict';
|
7603 |
|
7604 | Object.defineProperty(exports, "__esModule", {
|
7605 | value: true
|
7606 | });
|
7607 |
|
7608 | var _beeLayout = __webpack_require__(1);
|
7609 |
|
7610 | var _beePanel = __webpack_require__(8);
|
7611 |
|
7612 | var _react = __webpack_require__(4);
|
7613 |
|
7614 | var _react2 = _interopRequireDefault(_react);
|
7615 |
|
7616 | var _beeButton = __webpack_require__(62);
|
7617 |
|
7618 | var _beeButton2 = _interopRequireDefault(_beeButton);
|
7619 |
|
7620 | var _src = __webpack_require__(65);
|
7621 |
|
7622 | var _src2 = _interopRequireDefault(_src);
|
7623 |
|
7624 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
7625 |
|
7626 | 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; }
|
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 |
|
7635 |
|
7636 |
|
7637 |
|
7638 |
|
7639 | var top = function top() {
|
7640 | _src2['default'].create({ content: 'This is a Info message', position: 'top' });
|
7641 | };
|
7642 | var bottom = function bottom() {
|
7643 | _src2['default'].create({ content: 'This is a Info message', position: 'bottom' });
|
7644 | };
|
7645 | var topRight = function topRight() {
|
7646 | _src2['default'].create({ content: 'This is a Info message', position: 'topRight' });
|
7647 | };
|
7648 | var topLeft = function topLeft() {
|
7649 | _src2['default'].create({ content: 'This is a Info message', position: 'topLeft' });
|
7650 | };
|
7651 | var bottomRight = function bottomRight() {
|
7652 | _src2['default'].create({ content: 'This is a Info message', position: 'bottomRight' });
|
7653 | };
|
7654 | var bottomLeft = function bottomLeft() {
|
7655 | _src2['default'].create({ content: 'This is a Info message', position: 'bottomLeft' });
|
7656 | };
|
7657 |
|
7658 | var Demo2 = function (_Component) {
|
7659 | _inherits(Demo2, _Component);
|
7660 |
|
7661 | function Demo2(props) {
|
7662 | _classCallCheck(this, Demo2);
|
7663 |
|
7664 | return _possibleConstructorReturn(this, _Component.call(this, props));
|
7665 | }
|
7666 |
|
7667 | Demo2.prototype.render = function render() {
|
7668 | return _react2['default'].createElement(
|
7669 | 'div',
|
7670 | { className: 'paddingDemo' },
|
7671 | _react2['default'].createElement(
|
7672 | _beeButton2['default'],
|
7673 | {
|
7674 | colors: 'info',
|
7675 | onClick: top },
|
7676 | 'top'
|
7677 | ),
|
7678 | _react2['default'].createElement(
|
7679 | _beeButton2['default'],
|
7680 | {
|
7681 | colors: 'info',
|
7682 | onClick: bottom },
|
7683 | 'bottom'
|
7684 | ),
|
7685 | _react2['default'].createElement(
|
7686 | _beeButton2['default'],
|
7687 | {
|
7688 | colors: 'info',
|
7689 | onClick: topRight },
|
7690 | 'topRight'
|
7691 | ),
|
7692 | _react2['default'].createElement(
|
7693 | _beeButton2['default'],
|
7694 | {
|
7695 | colors: 'info',
|
7696 | onClick: topLeft },
|
7697 | 'topLeft'
|
7698 | ),
|
7699 | _react2['default'].createElement(
|
7700 | _beeButton2['default'],
|
7701 | {
|
7702 | colors: 'info',
|
7703 | onClick: bottomRight },
|
7704 | 'bottomRight'
|
7705 | ),
|
7706 | _react2['default'].createElement(
|
7707 | _beeButton2['default'],
|
7708 | {
|
7709 | colors: 'info',
|
7710 | onClick: bottomLeft },
|
7711 | 'bottomLeft'
|
7712 | )
|
7713 | );
|
7714 | };
|
7715 |
|
7716 | return Demo2;
|
7717 | }(_react.Component);
|
7718 |
|
7719 | exports['default'] = Demo2;
|
7720 | module.exports = exports['default'];
|
7721 |
|
7722 | })
|
7723 | ]);
|
7724 |
|
\ | No newline at end of file |