1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 |
|
7 | 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; };
|
8 |
|
9 | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
10 |
|
11 | var _react = require('react');
|
12 |
|
13 | var _react2 = _interopRequireDefault(_react);
|
14 |
|
15 | var _SortMethod2 = require('./SortMethod');
|
16 |
|
17 | var _SortMethod3 = _interopRequireDefault(_SortMethod2);
|
18 |
|
19 | var _reactSortableHoc = require('react-sortable-hoc');
|
20 |
|
21 | var _TabList = require('./TabList');
|
22 |
|
23 | var _TabList2 = _interopRequireDefault(_TabList);
|
24 |
|
25 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
26 |
|
27 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
28 |
|
29 | 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; }
|
30 |
|
31 | 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; }
|
32 |
|
33 | 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; }
|
34 |
|
35 | var DragTabContainer = (0, _reactSortableHoc.SortableContainer)(function (_ref) {
|
36 | var children = _ref.children,
|
37 | props = _objectWithoutProperties(_ref, ['children']);
|
38 |
|
39 | return _react2.default.createElement(
|
40 | _TabList2.default,
|
41 | props,
|
42 | children
|
43 | );
|
44 | });
|
45 |
|
46 | var DragTabList = function (_SortMethod) {
|
47 | _inherits(DragTabList, _SortMethod);
|
48 |
|
49 | function DragTabList() {
|
50 | _classCallCheck(this, DragTabList);
|
51 |
|
52 | return _possibleConstructorReturn(this, (DragTabList.__proto__ || Object.getPrototypeOf(DragTabList)).apply(this, arguments));
|
53 | }
|
54 |
|
55 | _createClass(DragTabList, [{
|
56 | key: 'render',
|
57 | value: function render() {
|
58 | var _props = this.props,
|
59 | children = _props.children,
|
60 | props = _objectWithoutProperties(_props, ['children']);
|
61 |
|
62 | return _react2.default.createElement(
|
63 | DragTabContainer,
|
64 | _extends({ onSortEnd: this.onSortEnd,
|
65 | axis: 'x',
|
66 | lockAxis: 'x'
|
67 |
|
68 |
|
69 | , pressDelay: 100
|
70 | }, props),
|
71 | children
|
72 | );
|
73 | }
|
74 | }]);
|
75 |
|
76 | return DragTabList;
|
77 | }(_SortMethod3.default);
|
78 |
|
79 | exports.default = DragTabList;
|
80 |
|
81 |
|
82 | DragTabList.displayName = 'DragTabList';
|
83 | module.exports = exports['default']; |
\ | No newline at end of file |