UNPKG

49.7 kBJavaScriptView Raw
1(function (global, factory) {
2 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('prop-types'), require('react-dom')) :
3 typeof define === 'function' && define.amd ? define(['exports', 'react', 'prop-types', 'react-dom'], factory) :
4 (global = global || self, factory(global.SortableHOC = {}, global.React, global.PropTypes, global.ReactDOM));
5}(this, function (exports, React, PropTypes, reactDom) { 'use strict';
6
7 PropTypes = PropTypes && PropTypes.hasOwnProperty('default') ? PropTypes['default'] : PropTypes;
8
9 function createCommonjsModule(fn, module) {
10 return module = { exports: {} }, fn(module, module.exports), module.exports;
11 }
12
13 var _extends_1 = createCommonjsModule(function (module) {
14 function _extends() {
15 module.exports = _extends = Object.assign || function (target) {
16 for (var i = 1; i < arguments.length; i++) {
17 var source = arguments[i];
18
19 for (var key in source) {
20 if (Object.prototype.hasOwnProperty.call(source, key)) {
21 target[key] = source[key];
22 }
23 }
24 }
25
26 return target;
27 };
28
29 return _extends.apply(this, arguments);
30 }
31
32 module.exports = _extends;
33 });
34
35 function _arrayWithHoles(arr) {
36 if (Array.isArray(arr)) return arr;
37 }
38
39 var arrayWithHoles = _arrayWithHoles;
40
41 function _iterableToArrayLimit(arr, i) {
42 var _arr = [];
43 var _n = true;
44 var _d = false;
45 var _e = undefined;
46
47 try {
48 for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
49 _arr.push(_s.value);
50
51 if (i && _arr.length === i) break;
52 }
53 } catch (err) {
54 _d = true;
55 _e = err;
56 } finally {
57 try {
58 if (!_n && _i["return"] != null) _i["return"]();
59 } finally {
60 if (_d) throw _e;
61 }
62 }
63
64 return _arr;
65 }
66
67 var iterableToArrayLimit = _iterableToArrayLimit;
68
69 function _nonIterableRest() {
70 throw new TypeError("Invalid attempt to destructure non-iterable instance");
71 }
72
73 var nonIterableRest = _nonIterableRest;
74
75 function _slicedToArray(arr, i) {
76 return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || nonIterableRest();
77 }
78
79 var slicedToArray = _slicedToArray;
80
81 function _arrayWithoutHoles(arr) {
82 if (Array.isArray(arr)) {
83 for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {
84 arr2[i] = arr[i];
85 }
86
87 return arr2;
88 }
89 }
90
91 var arrayWithoutHoles = _arrayWithoutHoles;
92
93 function _iterableToArray(iter) {
94 if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
95 }
96
97 var iterableToArray = _iterableToArray;
98
99 function _nonIterableSpread() {
100 throw new TypeError("Invalid attempt to spread non-iterable instance");
101 }
102
103 var nonIterableSpread = _nonIterableSpread;
104
105 function _toConsumableArray(arr) {
106 return arrayWithoutHoles(arr) || iterableToArray(arr) || nonIterableSpread();
107 }
108
109 var toConsumableArray = _toConsumableArray;
110
111 function _classCallCheck(instance, Constructor) {
112 if (!(instance instanceof Constructor)) {
113 throw new TypeError("Cannot call a class as a function");
114 }
115 }
116
117 var classCallCheck = _classCallCheck;
118
119 function _defineProperties(target, props) {
120 for (var i = 0; i < props.length; i++) {
121 var descriptor = props[i];
122 descriptor.enumerable = descriptor.enumerable || false;
123 descriptor.configurable = true;
124 if ("value" in descriptor) descriptor.writable = true;
125 Object.defineProperty(target, descriptor.key, descriptor);
126 }
127 }
128
129 function _createClass(Constructor, protoProps, staticProps) {
130 if (protoProps) _defineProperties(Constructor.prototype, protoProps);
131 if (staticProps) _defineProperties(Constructor, staticProps);
132 return Constructor;
133 }
134
135 var createClass = _createClass;
136
137 var _typeof_1 = createCommonjsModule(function (module) {
138 function _typeof2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); }
139
140 function _typeof(obj) {
141 if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") {
142 module.exports = _typeof = function _typeof(obj) {
143 return _typeof2(obj);
144 };
145 } else {
146 module.exports = _typeof = function _typeof(obj) {
147 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj);
148 };
149 }
150
151 return _typeof(obj);
152 }
153
154 module.exports = _typeof;
155 });
156
157 function _assertThisInitialized(self) {
158 if (self === void 0) {
159 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
160 }
161
162 return self;
163 }
164
165 var assertThisInitialized = _assertThisInitialized;
166
167 function _possibleConstructorReturn(self, call) {
168 if (call && (_typeof_1(call) === "object" || typeof call === "function")) {
169 return call;
170 }
171
172 return assertThisInitialized(self);
173 }
174
175 var possibleConstructorReturn = _possibleConstructorReturn;
176
177 var getPrototypeOf = createCommonjsModule(function (module) {
178 function _getPrototypeOf(o) {
179 module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
180 return o.__proto__ || Object.getPrototypeOf(o);
181 };
182 return _getPrototypeOf(o);
183 }
184
185 module.exports = _getPrototypeOf;
186 });
187
188 var setPrototypeOf = createCommonjsModule(function (module) {
189 function _setPrototypeOf(o, p) {
190 module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
191 o.__proto__ = p;
192 return o;
193 };
194
195 return _setPrototypeOf(o, p);
196 }
197
198 module.exports = _setPrototypeOf;
199 });
200
201 function _inherits(subClass, superClass) {
202 if (typeof superClass !== "function" && superClass !== null) {
203 throw new TypeError("Super expression must either be null or a function");
204 }
205
206 subClass.prototype = Object.create(superClass && superClass.prototype, {
207 constructor: {
208 value: subClass,
209 writable: true,
210 configurable: true
211 }
212 });
213 if (superClass) setPrototypeOf(subClass, superClass);
214 }
215
216 var inherits = _inherits;
217
218 function _defineProperty(obj, key, value) {
219 if (key in obj) {
220 Object.defineProperty(obj, key, {
221 value: value,
222 enumerable: true,
223 configurable: true,
224 writable: true
225 });
226 } else {
227 obj[key] = value;
228 }
229
230 return obj;
231 }
232
233 var defineProperty = _defineProperty;
234
235 /**
236 * Copyright (c) 2013-present, Facebook, Inc.
237 *
238 * This source code is licensed under the MIT license found in the
239 * LICENSE file in the root directory of this source tree.
240 */
241
242 /**
243 * Use invariant() to assert state which your program assumes to be true.
244 *
245 * Provide sprintf-style format (only %s is supported) and arguments
246 * to provide information about what broke and what you were
247 * expecting.
248 *
249 * The invariant message will be stripped in production, but the invariant
250 * will remain to ensure logic does not differ in production.
251 */
252
253 var NODE_ENV = process.env.NODE_ENV;
254
255 var invariant = function(condition, format, a, b, c, d, e, f) {
256 if (NODE_ENV !== 'production') {
257 if (format === undefined) {
258 throw new Error('invariant requires an error message argument');
259 }
260 }
261
262 if (!condition) {
263 var error;
264 if (format === undefined) {
265 error = new Error(
266 'Minified exception occurred; use the non-minified dev environment ' +
267 'for the full error message and additional helpful warnings.'
268 );
269 } else {
270 var args = [a, b, c, d, e, f];
271 var argIndex = 0;
272 error = new Error(
273 format.replace(/%s/g, function() { return args[argIndex++]; })
274 );
275 error.name = 'Invariant Violation';
276 }
277
278 error.framesToPop = 1; // we don't care about invariant's own frame
279 throw error;
280 }
281 };
282
283 var invariant_1 = invariant;
284
285 var Manager = function () {
286 function Manager() {
287 classCallCheck(this, Manager);
288
289 defineProperty(this, "refs", {});
290 }
291
292 createClass(Manager, [{
293 key: "add",
294 value: function add(collection, ref) {
295 if (!this.refs[collection]) {
296 this.refs[collection] = [];
297 }
298
299 this.refs[collection].push(ref);
300 }
301 }, {
302 key: "remove",
303 value: function remove(collection, ref) {
304 var index = this.getIndex(collection, ref);
305
306 if (index !== -1) {
307 this.refs[collection].splice(index, 1);
308 }
309 }
310 }, {
311 key: "isActive",
312 value: function isActive() {
313 return this.active;
314 }
315 }, {
316 key: "getActive",
317 value: function getActive() {
318 var _this = this;
319
320 return this.refs[this.active.collection].find(function (_ref) {
321 var node = _ref.node;
322 return node.sortableInfo.index == _this.active.index;
323 });
324 }
325 }, {
326 key: "getIndex",
327 value: function getIndex(collection, ref) {
328 return this.refs[collection].indexOf(ref);
329 }
330 }, {
331 key: "getOrderedRefs",
332 value: function getOrderedRefs() {
333 var collection = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.active.collection;
334 return this.refs[collection].sort(sortByIndex);
335 }
336 }]);
337
338 return Manager;
339 }();
340
341 function sortByIndex(_ref2, _ref3) {
342 var index1 = _ref2.node.sortableInfo.index;
343 var index2 = _ref3.node.sortableInfo.index;
344 return index1 - index2;
345 }
346
347 function arrayMove(array, from, to) {
348 array = array.slice();
349 array.splice(to < 0 ? array.length + to : to, 0, array.splice(from, 1)[0]);
350 return array;
351 }
352 function omit(obj) {
353 for (var _len = arguments.length, keysToOmit = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
354 keysToOmit[_key - 1] = arguments[_key];
355 }
356
357 return Object.keys(obj).reduce(function (acc, key) {
358 if (keysToOmit.indexOf(key) === -1) {
359 acc[key] = obj[key];
360 }
361
362 return acc;
363 }, {});
364 }
365 var events = {
366 start: ['touchstart', 'mousedown'],
367 move: ['touchmove', 'mousemove'],
368 end: ['touchend', 'touchcancel', 'mouseup']
369 };
370 var vendorPrefix = function () {
371 if (typeof window === 'undefined' || typeof document === 'undefined') {
372 return '';
373 }
374
375 var styles = window.getComputedStyle(document.documentElement, '') || ['-moz-hidden-iframe'];
376 var pre = (Array.prototype.slice.call(styles).join('').match(/-(moz|webkit|ms)-/) || styles.OLink === '' && ['', 'o'])[1];
377
378 switch (pre) {
379 case 'ms':
380 return 'ms';
381
382 default:
383 return pre && pre.length ? pre[0].toUpperCase() + pre.substr(1) : '';
384 }
385 }();
386 function closest(el, fn) {
387 while (el) {
388 if (fn(el)) {
389 return el;
390 }
391
392 el = el.parentNode;
393 }
394
395 return null;
396 }
397 function limit(min, max, value) {
398 return Math.max(min, Math.min(value, max));
399 }
400
401 function getPixelValue(stringValue) {
402 if (stringValue.substr(-2) === 'px') {
403 return parseFloat(stringValue);
404 }
405
406 return 0;
407 }
408
409 function getElementMargin(element) {
410 var style = window.getComputedStyle(element);
411 return {
412 top: getPixelValue(style.marginTop),
413 right: getPixelValue(style.marginRight),
414 bottom: getPixelValue(style.marginBottom),
415 left: getPixelValue(style.marginLeft)
416 };
417 }
418 function provideDisplayName(prefix, Component) {
419 var componentName = Component.displayName || Component.name;
420 return componentName ? "".concat(prefix, "(").concat(componentName, ")") : prefix;
421 }
422 function getPosition(event) {
423 if (event.touches && event.touches.length) {
424 return {
425 x: event.touches[0].pageX,
426 y: event.touches[0].pageY
427 };
428 } else if (event.changedTouches && event.changedTouches.length) {
429 return {
430 x: event.changedTouches[0].pageX,
431 y: event.changedTouches[0].pageY
432 };
433 } else {
434 return {
435 x: event.pageX,
436 y: event.pageY
437 };
438 }
439 }
440 function isTouchEvent(event) {
441 return event.touches && event.touches.length || event.changedTouches && event.changedTouches.length;
442 }
443 function getEdgeOffset(node, parent) {
444 var offset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
445 top: 0,
446 left: 0
447 };
448
449 if (!node) {
450 return undefined;
451 }
452
453 var nodeOffset = {
454 top: offset.top + node.offsetTop,
455 left: offset.left + node.offsetLeft
456 };
457
458 if (node.parentNode === parent) {
459 return nodeOffset;
460 }
461
462 return getEdgeOffset(node.parentNode, parent, nodeOffset);
463 }
464 function getLockPixelOffset(_ref) {
465 var lockOffset = _ref.lockOffset,
466 width = _ref.width,
467 height = _ref.height;
468 var offsetX = lockOffset;
469 var offsetY = lockOffset;
470 var unit = 'px';
471
472 if (typeof lockOffset === 'string') {
473 var match = /^[+-]?\d*(?:\.\d*)?(px|%)$/.exec(lockOffset);
474 invariant_1(match !== null, 'lockOffset value should be a number or a string of a ' + 'number followed by "px" or "%". Given %s', lockOffset);
475 offsetX = parseFloat(lockOffset);
476 offsetY = parseFloat(lockOffset);
477 unit = match[1];
478 }
479
480 invariant_1(isFinite(offsetX) && isFinite(offsetY), 'lockOffset value should be a finite. Given %s', lockOffset);
481
482 if (unit === '%') {
483 offsetX = offsetX * width / 100;
484 offsetY = offsetY * height / 100;
485 }
486
487 return {
488 x: offsetX,
489 y: offsetY
490 };
491 }
492
493 function _finallyRethrows(body, finalizer) {
494 try {
495 var result = body();
496 } catch (e) {
497 return finalizer(true, e);
498 }
499
500 if (result && result.then) {
501 return result.then(finalizer.bind(null, false), finalizer.bind(null, true));
502 }
503
504 return finalizer(false, value);
505 }
506 function sortableContainer(WrappedComponent) {
507 var _class, _temp;
508
509 var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
510 withRef: false
511 };
512 return _temp = _class = function (_React$Component) {
513 inherits(WithSortableContainer, _React$Component);
514
515 function WithSortableContainer(props) {
516 var _this;
517
518 classCallCheck(this, WithSortableContainer);
519
520 _this = possibleConstructorReturn(this, getPrototypeOf(WithSortableContainer).call(this, props));
521
522 defineProperty(assertThisInitialized(assertThisInitialized(_this)), "handleStart", function (event) {
523 var _this$props = _this.props,
524 distance = _this$props.distance,
525 shouldCancelStart = _this$props.shouldCancelStart;
526
527 if (event.button === 2 || shouldCancelStart(event)) {
528 return;
529 }
530
531 _this._touched = true;
532 _this._pos = getPosition(event);
533 var node = closest(event.target, function (el) {
534 return el.sortableInfo != null;
535 });
536
537 if (node && node.sortableInfo && _this.nodeIsChild(node) && !_this.state.sorting) {
538 var useDragHandle = _this.props.useDragHandle;
539 var _node$sortableInfo = node.sortableInfo,
540 index = _node$sortableInfo.index,
541 collection = _node$sortableInfo.collection;
542
543 if (useDragHandle && !closest(event.target, function (el) {
544 return el.sortableHandle != null;
545 })) {
546 return;
547 }
548
549 _this.manager.active = {
550 index: index,
551 collection: collection
552 };
553
554 if (!isTouchEvent(event) && event.target.tagName.toLowerCase() === 'a') {
555 event.preventDefault();
556 }
557
558 if (!distance) {
559 if (_this.props.pressDelay === 0) {
560 _this.handlePress(event);
561 } else {
562 _this.pressTimer = setTimeout(function () {
563 return _this.handlePress(event);
564 }, _this.props.pressDelay);
565 }
566 }
567 }
568 });
569
570 defineProperty(assertThisInitialized(assertThisInitialized(_this)), "nodeIsChild", function (node) {
571 return node.sortableInfo.manager === _this.manager;
572 });
573
574 defineProperty(assertThisInitialized(assertThisInitialized(_this)), "handleMove", function (event) {
575 var _this$props2 = _this.props,
576 distance = _this$props2.distance,
577 pressThreshold = _this$props2.pressThreshold;
578
579 if (!_this.state.sorting && _this._touched && !_this._awaitingUpdateBeforeSortStart) {
580 var position = getPosition(event);
581 var delta = {
582 x: _this._pos.x - position.x,
583 y: _this._pos.y - position.y
584 };
585 var combinedDelta = Math.abs(delta.x) + Math.abs(delta.y);
586 _this.delta = delta;
587
588 if (!distance && (!pressThreshold || pressThreshold && combinedDelta >= pressThreshold)) {
589 clearTimeout(_this.cancelTimer);
590 _this.cancelTimer = setTimeout(_this.cancel, 0);
591 } else if (distance && combinedDelta >= distance && _this.manager.isActive()) {
592 _this.handlePress(event);
593 }
594 }
595 });
596
597 defineProperty(assertThisInitialized(assertThisInitialized(_this)), "handleEnd", function () {
598 _this._touched = false;
599
600 _this.cancel();
601 });
602
603 defineProperty(assertThisInitialized(assertThisInitialized(_this)), "cancel", function () {
604 var distance = _this.props.distance;
605 var sorting = _this.state.sorting;
606
607 if (!sorting) {
608 if (!distance) {
609 clearTimeout(_this.pressTimer);
610 }
611
612 _this.manager.active = null;
613 }
614 });
615
616 defineProperty(assertThisInitialized(assertThisInitialized(_this)), "handlePress", function (event) {
617 try {
618 var active = _this.manager.getActive();
619
620 var _temp6 = function () {
621 if (active) {
622 var _temp7 = function _temp7() {
623 var margin = getElementMargin(_node);
624
625 var containerBoundingRect = _this.container.getBoundingClientRect();
626
627 var dimensions = _getHelperDimensions({
628 index: _index,
629 node: _node,
630 collection: _collection
631 });
632
633 _this.node = _node;
634 _this.margin = margin;
635 _this.width = dimensions.width;
636 _this.height = dimensions.height;
637 _this.marginOffset = {
638 x: _this.margin.left + _this.margin.right,
639 y: Math.max(_this.margin.top, _this.margin.bottom)
640 };
641 _this.boundingClientRect = _node.getBoundingClientRect();
642 _this.containerBoundingRect = containerBoundingRect;
643 _this.index = _index;
644 _this.newIndex = _index;
645 _this.axis = {
646 x: _axis.indexOf('x') >= 0,
647 y: _axis.indexOf('y') >= 0
648 };
649 _this.offsetEdge = getEdgeOffset(_node, _this.container);
650 _this.initialOffset = getPosition(event);
651 _this.initialScroll = {
652 top: _this.container.scrollTop,
653 left: _this.container.scrollLeft
654 };
655 _this.initialWindowScroll = {
656 top: window.pageYOffset,
657 left: window.pageXOffset
658 };
659
660 var fields = _node.querySelectorAll('input, textarea, select');
661
662 var clonedNode = _node.cloneNode(true);
663
664 var clonedFields = toConsumableArray(clonedNode.querySelectorAll('input, textarea, select'));
665
666 clonedFields.forEach(function (field, i) {
667 if (field.type !== 'file' && fields[_index]) {
668 field.value = fields[i].value;
669 }
670 });
671 _this.helper = _this.helperContainer.appendChild(clonedNode);
672 _this.helper.style.position = 'fixed';
673 _this.helper.style.top = "".concat(_this.boundingClientRect.top - margin.top, "px");
674 _this.helper.style.left = "".concat(_this.boundingClientRect.left - margin.left, "px");
675 _this.helper.style.width = "".concat(_this.width, "px");
676 _this.helper.style.height = "".concat(_this.height, "px");
677 _this.helper.style.boxSizing = 'border-box';
678 _this.helper.style.pointerEvents = 'none';
679
680 if (_hideSortableGhost) {
681 _this.sortableGhost = _node;
682 _node.style.visibility = 'hidden';
683 _node.style.opacity = 0;
684 }
685
686 _this.minTranslate = {};
687 _this.maxTranslate = {};
688
689 if (_this.axis.x) {
690 _this.minTranslate.x = (_useWindowAsScrollContainer ? 0 : containerBoundingRect.left) - _this.boundingClientRect.left - _this.width / 2;
691 _this.maxTranslate.x = (_useWindowAsScrollContainer ? _this.contentWindow.innerWidth : containerBoundingRect.left + containerBoundingRect.width) - _this.boundingClientRect.left - _this.width / 2;
692 }
693
694 if (_this.axis.y) {
695 _this.minTranslate.y = (_useWindowAsScrollContainer ? 0 : containerBoundingRect.top) - _this.boundingClientRect.top - _this.height / 2;
696 _this.maxTranslate.y = (_useWindowAsScrollContainer ? _this.contentWindow.innerHeight : containerBoundingRect.top + containerBoundingRect.height) - _this.boundingClientRect.top - _this.height / 2;
697 }
698
699 if (_helperClass) {
700 var _this$helper$classLis;
701
702 (_this$helper$classLis = _this.helper.classList).add.apply(_this$helper$classLis, toConsumableArray(_helperClass.split(' ')));
703 }
704
705 _this.listenerNode = event.touches ? _node : _this.contentWindow;
706 events.move.forEach(function (eventName) {
707 return _this.listenerNode.addEventListener(eventName, _this.handleSortMove, false);
708 });
709 events.end.forEach(function (eventName) {
710 return _this.listenerNode.addEventListener(eventName, _this.handleSortEnd, false);
711 });
712
713 _this.setState({
714 sorting: true,
715 sortingIndex: _index
716 });
717
718 if (_onSortStart) {
719 _onSortStart({
720 node: _node,
721 index: _index,
722 collection: _collection
723 }, event);
724 }
725 };
726
727 var _this$props3 = _this.props,
728 _axis = _this$props3.axis,
729 _getHelperDimensions = _this$props3.getHelperDimensions,
730 _helperClass = _this$props3.helperClass,
731 _hideSortableGhost = _this$props3.hideSortableGhost,
732 updateBeforeSortStart = _this$props3.updateBeforeSortStart,
733 _onSortStart = _this$props3.onSortStart,
734 _useWindowAsScrollContainer = _this$props3.useWindowAsScrollContainer;
735 var _node = active.node,
736 _collection = active.collection;
737 var _index = _node.sortableInfo.index;
738
739 var _temp8 = function () {
740 if (typeof updateBeforeSortStart === 'function') {
741 _this._awaitingUpdateBeforeSortStart = true;
742
743 var _temp9 = _finallyRethrows(function () {
744 return Promise.resolve(updateBeforeSortStart({
745 node: _node,
746 index: _index,
747 collection: _collection
748 }, event)).then(function () {});
749 }, function (_wasThrown, _result) {
750 _this._awaitingUpdateBeforeSortStart = false;
751 if (_wasThrown) throw _result;
752 return _result;
753 });
754
755 if (_temp9 && _temp9.then) return _temp9.then(function () {});
756 }
757 }();
758
759 return _temp8 && _temp8.then ? _temp8.then(_temp7) : _temp7(_temp8);
760 }
761 }();
762
763 return Promise.resolve(_temp6 && _temp6.then ? _temp6.then(function () {}) : void 0);
764 } catch (e) {
765 return Promise.reject(e);
766 }
767 });
768
769 defineProperty(assertThisInitialized(assertThisInitialized(_this)), "handleSortMove", function (event) {
770 var onSortMove = _this.props.onSortMove;
771 event.preventDefault();
772
773 _this.updatePosition(event);
774
775 _this.animateNodes();
776
777 _this.autoscroll();
778
779 if (onSortMove) {
780 onSortMove(event);
781 }
782 });
783
784 defineProperty(assertThisInitialized(assertThisInitialized(_this)), "handleSortEnd", function (event) {
785 var _this$props4 = _this.props,
786 hideSortableGhost = _this$props4.hideSortableGhost,
787 onSortEnd = _this$props4.onSortEnd;
788 var collection = _this.manager.active.collection;
789
790 if (_this.listenerNode) {
791 events.move.forEach(function (eventName) {
792 return _this.listenerNode.removeEventListener(eventName, _this.handleSortMove);
793 });
794 events.end.forEach(function (eventName) {
795 return _this.listenerNode.removeEventListener(eventName, _this.handleSortEnd);
796 });
797 }
798
799 _this.helper.parentNode.removeChild(_this.helper);
800
801 if (hideSortableGhost && _this.sortableGhost) {
802 _this.sortableGhost.style.visibility = '';
803 _this.sortableGhost.style.opacity = '';
804 }
805
806 var nodes = _this.manager.refs[collection];
807
808 for (var i = 0, len = nodes.length; i < len; i++) {
809 var _node2 = nodes[i];
810 var el = _node2.node;
811 _node2.edgeOffset = null;
812 el.style["".concat(vendorPrefix, "Transform")] = '';
813 el.style["".concat(vendorPrefix, "TransitionDuration")] = '';
814 }
815
816 clearInterval(_this.autoscrollInterval);
817 _this.autoscrollInterval = null;
818 _this.manager.active = null;
819
820 _this.setState({
821 sorting: false,
822 sortingIndex: null
823 });
824
825 if (typeof onSortEnd === 'function') {
826 onSortEnd({
827 oldIndex: _this.index,
828 newIndex: _this.newIndex,
829 collection: collection
830 }, event);
831 }
832
833 _this._touched = false;
834 });
835
836 defineProperty(assertThisInitialized(assertThisInitialized(_this)), "autoscroll", function () {
837 var disableAutoscroll = _this.props.disableAutoscroll;
838
839 if (disableAutoscroll) {
840 return;
841 }
842
843 var translate = _this.translate;
844 var direction = {
845 x: 0,
846 y: 0
847 };
848 var speed = {
849 x: 1,
850 y: 1
851 };
852 var acceleration = {
853 x: 10,
854 y: 10
855 };
856 var _this$scrollContainer = _this.scrollContainer,
857 scrollTop = _this$scrollContainer.scrollTop,
858 scrollLeft = _this$scrollContainer.scrollLeft,
859 scrollHeight = _this$scrollContainer.scrollHeight,
860 scrollWidth = _this$scrollContainer.scrollWidth,
861 clientHeight = _this$scrollContainer.clientHeight,
862 clientWidth = _this$scrollContainer.clientWidth;
863 var isTop = scrollTop === 0;
864 var isBottom = scrollHeight - scrollTop - clientHeight === 0;
865 var isLeft = scrollLeft === 0;
866 var isRight = scrollWidth - scrollLeft - clientWidth === 0;
867
868 if (translate.y >= _this.maxTranslate.y - _this.height / 2 && !isBottom) {
869 direction.y = 1;
870 speed.y = acceleration.y * Math.abs((_this.maxTranslate.y - _this.height / 2 - translate.y) / _this.height);
871 } else if (translate.x >= _this.maxTranslate.x - _this.width / 2 && !isRight) {
872 direction.x = 1;
873 speed.x = acceleration.x * Math.abs((_this.maxTranslate.x - _this.width / 2 - translate.x) / _this.width);
874 } else if (translate.y <= _this.minTranslate.y + _this.height / 2 && !isTop) {
875 direction.y = -1;
876 speed.y = acceleration.y * Math.abs((translate.y - _this.height / 2 - _this.minTranslate.y) / _this.height);
877 } else if (translate.x <= _this.minTranslate.x + _this.width / 2 && !isLeft) {
878 direction.x = -1;
879 speed.x = acceleration.x * Math.abs((translate.x - _this.width / 2 - _this.minTranslate.x) / _this.width);
880 }
881
882 if (_this.autoscrollInterval) {
883 clearInterval(_this.autoscrollInterval);
884 _this.autoscrollInterval = null;
885 _this.isAutoScrolling = false;
886 }
887
888 if (direction.x !== 0 || direction.y !== 0) {
889 _this.autoscrollInterval = setInterval(function () {
890 _this.isAutoScrolling = true;
891 var offset = {
892 left: speed.x * direction.x,
893 top: speed.y * direction.y
894 };
895 _this.scrollContainer.scrollTop += offset.top;
896 _this.scrollContainer.scrollLeft += offset.left;
897 _this.translate.x += offset.left;
898 _this.translate.y += offset.top;
899
900 _this.animateNodes();
901 }, 5);
902 }
903 });
904
905 _this.manager = new Manager();
906 _this.events = {
907 start: _this.handleStart,
908 move: _this.handleMove,
909 end: _this.handleEnd
910 };
911 invariant_1(!(props.distance && props.pressDelay), 'Attempted to set both `pressDelay` and `distance` on SortableContainer, you may only use one or the other, not both at the same time.');
912 _this.state = {};
913 return _this;
914 }
915
916 createClass(WithSortableContainer, [{
917 key: "getChildContext",
918 value: function getChildContext() {
919 return {
920 manager: this.manager
921 };
922 }
923 }, {
924 key: "componentDidMount",
925 value: function componentDidMount() {
926 var _this2 = this;
927
928 var useWindowAsScrollContainer = this.props.useWindowAsScrollContainer;
929 var container = this.getContainer();
930 Promise.resolve(container).then(function (containerNode) {
931 _this2.container = containerNode;
932 _this2.document = _this2.container.ownerDocument || document;
933 var contentWindow = _this2.props.contentWindow || _this2.document.defaultView || window;
934 _this2.contentWindow = typeof contentWindow === 'function' ? contentWindow() : contentWindow;
935 _this2.scrollContainer = useWindowAsScrollContainer ? _this2.document.scrollingElement || _this2.document.documentElement : _this2.container;
936
937 var _loop = function _loop(key) {
938 if (_this2.events.hasOwnProperty(key)) {
939 events[key].forEach(function (eventName) {
940 return _this2.container.addEventListener(eventName, _this2.events[key], false);
941 });
942 }
943 };
944
945 for (var key in _this2.events) {
946 _loop(key);
947 }
948 });
949 }
950 }, {
951 key: "componentWillUnmount",
952 value: function componentWillUnmount() {
953 var _this3 = this;
954
955 if (this.container) {
956 var _loop2 = function _loop2(key) {
957 if (_this3.events.hasOwnProperty(key)) {
958 events[key].forEach(function (eventName) {
959 return _this3.container.removeEventListener(eventName, _this3.events[key]);
960 });
961 }
962 };
963
964 for (var key in this.events) {
965 _loop2(key);
966 }
967 }
968 }
969 }, {
970 key: "getLockPixelOffsets",
971 value: function getLockPixelOffsets() {
972 var width = this.width,
973 height = this.height;
974 var lockOffset = this.props.lockOffset;
975 var offsets = Array.isArray(lockOffset) ? lockOffset : [lockOffset, lockOffset];
976 invariant_1(offsets.length === 2, 'lockOffset prop of SortableContainer should be a single ' + 'value or an array of exactly two values. Given %s', lockOffset);
977
978 var _offsets = slicedToArray(offsets, 2),
979 minLockOffset = _offsets[0],
980 maxLockOffset = _offsets[1];
981
982 return [getLockPixelOffset({
983 lockOffset: minLockOffset,
984 width: width,
985 height: height
986 }), getLockPixelOffset({
987 lockOffset: maxLockOffset,
988 width: width,
989 height: height
990 })];
991 }
992 }, {
993 key: "updatePosition",
994 value: function updatePosition(event) {
995 var _this$props5 = this.props,
996 lockAxis = _this$props5.lockAxis,
997 lockToContainerEdges = _this$props5.lockToContainerEdges;
998 var offset = getPosition(event);
999 var translate = {
1000 x: offset.x - this.initialOffset.x,
1001 y: offset.y - this.initialOffset.y
1002 };
1003 translate.y -= window.pageYOffset - this.initialWindowScroll.top;
1004 translate.x -= window.pageXOffset - this.initialWindowScroll.left;
1005 this.translate = translate;
1006
1007 if (lockToContainerEdges) {
1008 var _this$getLockPixelOff = this.getLockPixelOffsets(),
1009 _this$getLockPixelOff2 = slicedToArray(_this$getLockPixelOff, 2),
1010 minLockOffset = _this$getLockPixelOff2[0],
1011 maxLockOffset = _this$getLockPixelOff2[1];
1012
1013 var minOffset = {
1014 x: this.width / 2 - minLockOffset.x,
1015 y: this.height / 2 - minLockOffset.y
1016 };
1017 var maxOffset = {
1018 x: this.width / 2 - maxLockOffset.x,
1019 y: this.height / 2 - maxLockOffset.y
1020 };
1021 translate.x = limit(this.minTranslate.x + minOffset.x, this.maxTranslate.x - maxOffset.x, translate.x);
1022 translate.y = limit(this.minTranslate.y + minOffset.y, this.maxTranslate.y - maxOffset.y, translate.y);
1023 }
1024
1025 if (lockAxis === 'x') {
1026 translate.y = 0;
1027 } else if (lockAxis === 'y') {
1028 translate.x = 0;
1029 }
1030
1031 this.helper.style["".concat(vendorPrefix, "Transform")] = "translate3d(".concat(translate.x, "px,").concat(translate.y, "px, 0)");
1032 }
1033 }, {
1034 key: "animateNodes",
1035 value: function animateNodes() {
1036 var _this$props6 = this.props,
1037 transitionDuration = _this$props6.transitionDuration,
1038 hideSortableGhost = _this$props6.hideSortableGhost,
1039 onSortOver = _this$props6.onSortOver;
1040 var nodes = this.manager.getOrderedRefs();
1041 var containerScrollDelta = {
1042 left: this.container.scrollLeft - this.initialScroll.left,
1043 top: this.container.scrollTop - this.initialScroll.top
1044 };
1045 var sortingOffset = {
1046 left: this.offsetEdge.left + this.translate.x + containerScrollDelta.left,
1047 top: this.offsetEdge.top + this.translate.y + containerScrollDelta.top
1048 };
1049 var windowScrollDelta = {
1050 top: window.pageYOffset - this.initialWindowScroll.top,
1051 left: window.pageXOffset - this.initialWindowScroll.left
1052 };
1053 var prevIndex = this.newIndex;
1054 this.newIndex = null;
1055
1056 for (var i = 0, len = nodes.length; i < len; i++) {
1057 var _node3 = nodes[i].node;
1058 var _index2 = _node3.sortableInfo.index;
1059 var width = _node3.offsetWidth;
1060 var height = _node3.offsetHeight;
1061 var offset = {
1062 width: this.width > width ? width / 2 : this.width / 2,
1063 height: this.height > height ? height / 2 : this.height / 2
1064 };
1065 var translate = {
1066 x: 0,
1067 y: 0
1068 };
1069 var edgeOffset = nodes[i].edgeOffset;
1070
1071 if (!edgeOffset) {
1072 edgeOffset = getEdgeOffset(_node3, this.container);
1073 nodes[i].edgeOffset = edgeOffset;
1074 }
1075
1076 var nextNode = i < nodes.length - 1 && nodes[i + 1];
1077 var prevNode = i > 0 && nodes[i - 1];
1078
1079 if (nextNode && !nextNode.edgeOffset) {
1080 nextNode.edgeOffset = getEdgeOffset(nextNode.node, this.container);
1081 }
1082
1083 if (_index2 === this.index) {
1084 if (hideSortableGhost) {
1085 this.sortableGhost = _node3;
1086 _node3.style.visibility = 'hidden';
1087 _node3.style.opacity = 0;
1088 }
1089
1090 continue;
1091 }
1092
1093 if (transitionDuration) {
1094 _node3.style["".concat(vendorPrefix, "TransitionDuration")] = "".concat(transitionDuration, "ms");
1095 }
1096
1097 if (this.axis.x) {
1098 if (this.axis.y) {
1099 if (_index2 < this.index && (sortingOffset.left + windowScrollDelta.left - offset.width <= edgeOffset.left && sortingOffset.top + windowScrollDelta.top <= edgeOffset.top + offset.height || sortingOffset.top + windowScrollDelta.top + offset.height <= edgeOffset.top)) {
1100 translate.x = this.width + this.marginOffset.x;
1101
1102 if (edgeOffset.left + translate.x > this.containerBoundingRect.width - offset.width) {
1103 if (nextNode) {
1104 translate.x = nextNode.edgeOffset.left - edgeOffset.left;
1105 translate.y = nextNode.edgeOffset.top - edgeOffset.top;
1106 }
1107 }
1108
1109 if (this.newIndex === null) {
1110 this.newIndex = _index2;
1111 }
1112 } else if (_index2 > this.index && (sortingOffset.left + windowScrollDelta.left + offset.width >= edgeOffset.left && sortingOffset.top + windowScrollDelta.top + offset.height >= edgeOffset.top || sortingOffset.top + windowScrollDelta.top + offset.height >= edgeOffset.top + height)) {
1113 translate.x = -(this.width + this.marginOffset.x);
1114
1115 if (edgeOffset.left + translate.x < this.containerBoundingRect.left + offset.width) {
1116 if (prevNode) {
1117 translate.x = prevNode.edgeOffset.left - edgeOffset.left;
1118 translate.y = prevNode.edgeOffset.top - edgeOffset.top;
1119 }
1120 }
1121
1122 this.newIndex = _index2;
1123 }
1124 } else {
1125 if (_index2 > this.index && sortingOffset.left + windowScrollDelta.left + offset.width >= edgeOffset.left) {
1126 translate.x = -(this.width + this.marginOffset.x);
1127 this.newIndex = _index2;
1128 } else if (_index2 < this.index && sortingOffset.left + windowScrollDelta.left <= edgeOffset.left + offset.width) {
1129 translate.x = this.width + this.marginOffset.x;
1130
1131 if (this.newIndex == null) {
1132 this.newIndex = _index2;
1133 }
1134 }
1135 }
1136 } else if (this.axis.y) {
1137 if (_index2 > this.index && sortingOffset.top + windowScrollDelta.top + offset.height >= edgeOffset.top) {
1138 translate.y = -(this.height + this.marginOffset.y);
1139 this.newIndex = _index2;
1140 } else if (_index2 < this.index && sortingOffset.top + windowScrollDelta.top <= edgeOffset.top + offset.height) {
1141 translate.y = this.height + this.marginOffset.y;
1142
1143 if (this.newIndex == null) {
1144 this.newIndex = _index2;
1145 }
1146 }
1147 }
1148
1149 _node3.style["".concat(vendorPrefix, "Transform")] = "translate3d(".concat(translate.x, "px,").concat(translate.y, "px,0)");
1150 }
1151
1152 if (this.newIndex == null) {
1153 this.newIndex = this.index;
1154 }
1155
1156 if (onSortOver && this.newIndex !== prevIndex) {
1157 onSortOver({
1158 newIndex: this.newIndex,
1159 oldIndex: prevIndex,
1160 index: this.index,
1161 collection: this.manager.active.collection
1162 });
1163 }
1164 }
1165 }, {
1166 key: "getWrappedInstance",
1167 value: function getWrappedInstance() {
1168 invariant_1(config.withRef, 'To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableContainer() call');
1169 return this.refs.wrappedInstance;
1170 }
1171 }, {
1172 key: "getContainer",
1173 value: function getContainer() {
1174 var getContainer = this.props.getContainer;
1175
1176 if (typeof getContainer !== 'function') {
1177 return reactDom.findDOMNode(this);
1178 }
1179
1180 return getContainer(config.withRef ? this.getWrappedInstance() : undefined);
1181 }
1182 }, {
1183 key: "render",
1184 value: function render() {
1185 var ref = config.withRef ? 'wrappedInstance' : null;
1186 return React.createElement(WrappedComponent, _extends_1({
1187 ref: ref
1188 }, omit(this.props, 'contentWindow', 'useWindowAsScrollContainer', 'distance', 'helperClass', 'hideSortableGhost', 'transitionDuration', 'useDragHandle', 'pressDelay', 'pressThreshold', 'shouldCancelStart', 'updateBeforeSortStart', 'onSortStart', 'onSortMove', 'onSortEnd', 'axis', 'lockAxis', 'lockOffset', 'lockToContainerEdges', 'getContainer', 'getHelperDimensions', 'helperContainer')));
1189 }
1190 }, {
1191 key: "helperContainer",
1192 get: function get() {
1193 var helperContainer = this.props.helperContainer;
1194
1195 if (typeof helperContainer === 'function') {
1196 return helperContainer();
1197 }
1198
1199 return this.props.helperContainer || this.document.body;
1200 }
1201 }]);
1202
1203 return WithSortableContainer;
1204 }(React.Component), defineProperty(_class, "displayName", provideDisplayName('sortableList', WrappedComponent)), defineProperty(_class, "defaultProps", {
1205 axis: 'y',
1206 transitionDuration: 300,
1207 pressDelay: 0,
1208 pressThreshold: 5,
1209 distance: 0,
1210 useWindowAsScrollContainer: false,
1211 hideSortableGhost: true,
1212 shouldCancelStart: function shouldCancelStart(event) {
1213 var disabledElements = ['input', 'textarea', 'select', 'option', 'button'];
1214
1215 if (disabledElements.indexOf(event.target.tagName.toLowerCase()) !== -1) {
1216 return true;
1217 }
1218
1219 return false;
1220 },
1221 lockToContainerEdges: false,
1222 lockOffset: '50%',
1223 getHelperDimensions: function getHelperDimensions(_ref) {
1224 var node = _ref.node;
1225 return {
1226 width: node.offsetWidth,
1227 height: node.offsetHeight
1228 };
1229 },
1230 disableAutoscroll: false
1231 }), defineProperty(_class, "propTypes", {
1232 axis: PropTypes.oneOf(['x', 'y', 'xy']),
1233 distance: PropTypes.number,
1234 lockAxis: PropTypes.string,
1235 helperClass: PropTypes.string,
1236 transitionDuration: PropTypes.number,
1237 contentWindow: PropTypes.any,
1238 updateBeforeSortStart: PropTypes.func,
1239 onSortStart: PropTypes.func,
1240 onSortMove: PropTypes.func,
1241 onSortOver: PropTypes.func,
1242 onSortEnd: PropTypes.func,
1243 shouldCancelStart: PropTypes.func,
1244 pressDelay: PropTypes.number,
1245 pressThreshold: PropTypes.number,
1246 useDragHandle: PropTypes.bool,
1247 useWindowAsScrollContainer: PropTypes.bool,
1248 hideSortableGhost: PropTypes.bool,
1249 lockToContainerEdges: PropTypes.bool,
1250 lockOffset: PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string]))]),
1251 getContainer: PropTypes.func,
1252 getHelperDimensions: PropTypes.func,
1253 helperContainer: PropTypes.oneOfType([PropTypes.func, typeof HTMLElement === 'undefined' ? PropTypes.any : PropTypes.instanceOf(HTMLElement)]),
1254 disableAutoscroll: PropTypes.bool
1255 }), defineProperty(_class, "childContextTypes", {
1256 manager: PropTypes.object.isRequired
1257 }), _temp;
1258 }
1259
1260 function sortableElement(WrappedComponent) {
1261 var _class, _temp;
1262
1263 var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
1264 withRef: false
1265 };
1266 return _temp = _class = function (_React$Component) {
1267 inherits(WithSortableElement, _React$Component);
1268
1269 function WithSortableElement() {
1270 classCallCheck(this, WithSortableElement);
1271
1272 return possibleConstructorReturn(this, getPrototypeOf(WithSortableElement).apply(this, arguments));
1273 }
1274
1275 createClass(WithSortableElement, [{
1276 key: "componentDidMount",
1277 value: function componentDidMount() {
1278 var _this$props = this.props,
1279 collection = _this$props.collection,
1280 disabled = _this$props.disabled,
1281 index = _this$props.index;
1282
1283 if (!disabled) {
1284 this.setDraggable(collection, index);
1285 }
1286 }
1287 }, {
1288 key: "componentWillReceiveProps",
1289 value: function componentWillReceiveProps(nextProps) {
1290 if (this.props.index !== nextProps.index && this.node) {
1291 this.node.sortableInfo.index = nextProps.index;
1292 }
1293
1294 if (this.props.disabled !== nextProps.disabled) {
1295 var collection = nextProps.collection,
1296 disabled = nextProps.disabled,
1297 index = nextProps.index;
1298
1299 if (disabled) {
1300 this.removeDraggable(collection);
1301 } else {
1302 this.setDraggable(collection, index);
1303 }
1304 } else if (this.props.collection !== nextProps.collection) {
1305 this.removeDraggable(this.props.collection);
1306 this.setDraggable(nextProps.collection, nextProps.index);
1307 }
1308 }
1309 }, {
1310 key: "componentWillUnmount",
1311 value: function componentWillUnmount() {
1312 var _this$props2 = this.props,
1313 collection = _this$props2.collection,
1314 disabled = _this$props2.disabled;
1315
1316 if (!disabled) {
1317 this.removeDraggable(collection);
1318 }
1319 }
1320 }, {
1321 key: "setDraggable",
1322 value: function setDraggable(collection, index) {
1323 var node = reactDom.findDOMNode(this);
1324 node.sortableInfo = {
1325 index: index,
1326 collection: collection,
1327 manager: this.context.manager
1328 };
1329 this.node = node;
1330 this.ref = {
1331 node: node
1332 };
1333 this.context.manager.add(collection, this.ref);
1334 }
1335 }, {
1336 key: "removeDraggable",
1337 value: function removeDraggable(collection) {
1338 this.context.manager.remove(collection, this.ref);
1339 }
1340 }, {
1341 key: "getWrappedInstance",
1342 value: function getWrappedInstance() {
1343 invariant_1(config.withRef, 'To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableElement() call');
1344 return this.refs.wrappedInstance;
1345 }
1346 }, {
1347 key: "render",
1348 value: function render() {
1349 var ref = config.withRef ? 'wrappedInstance' : null;
1350 return React.createElement(WrappedComponent, _extends_1({
1351 ref: ref
1352 }, omit(this.props, 'collection', 'disabled', 'index')));
1353 }
1354 }]);
1355
1356 return WithSortableElement;
1357 }(React.Component), defineProperty(_class, "displayName", provideDisplayName('sortableElement', WrappedComponent)), defineProperty(_class, "contextTypes", {
1358 manager: PropTypes.object.isRequired
1359 }), defineProperty(_class, "propTypes", {
1360 index: PropTypes.number.isRequired,
1361 collection: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
1362 disabled: PropTypes.bool
1363 }), defineProperty(_class, "defaultProps", {
1364 collection: 0
1365 }), _temp;
1366 }
1367
1368 function sortableHandle(WrappedComponent) {
1369 var _class, _temp;
1370
1371 var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
1372 withRef: false
1373 };
1374 return _temp = _class = function (_React$Component) {
1375 inherits(WithSortableHandle, _React$Component);
1376
1377 function WithSortableHandle() {
1378 classCallCheck(this, WithSortableHandle);
1379
1380 return possibleConstructorReturn(this, getPrototypeOf(WithSortableHandle).apply(this, arguments));
1381 }
1382
1383 createClass(WithSortableHandle, [{
1384 key: "componentDidMount",
1385 value: function componentDidMount() {
1386 var node = reactDom.findDOMNode(this);
1387 node.sortableHandle = true;
1388 }
1389 }, {
1390 key: "getWrappedInstance",
1391 value: function getWrappedInstance() {
1392 invariant_1(config.withRef, 'To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableHandle() call');
1393 return this.refs.wrappedInstance;
1394 }
1395 }, {
1396 key: "render",
1397 value: function render() {
1398 var ref = config.withRef ? 'wrappedInstance' : null;
1399 return React.createElement(WrappedComponent, _extends_1({
1400 ref: ref
1401 }, this.props));
1402 }
1403 }]);
1404
1405 return WithSortableHandle;
1406 }(React.Component), defineProperty(_class, "displayName", provideDisplayName('sortableHandle', WrappedComponent)), _temp;
1407 }
1408
1409 exports.SortableContainer = sortableContainer;
1410 exports.sortableContainer = sortableContainer;
1411 exports.SortableElement = sortableElement;
1412 exports.sortableElement = sortableElement;
1413 exports.SortableHandle = sortableHandle;
1414 exports.sortableHandle = sortableHandle;
1415 exports.arrayMove = arrayMove;
1416
1417 Object.defineProperty(exports, '__esModule', { value: true });
1418
1419}));