react-virtual-sortable 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -86,29 +86,30 @@ function Virtual() {
86
86
 
87
87
  **Uncommonly used**
88
88
 
89
- | **Prop** | **Type** | **Default** | **Description** |
90
- | -------------------- | --------- | ------------------ | --------------------------------------------------------------------------- |
91
- | `draggable` | `String` | `[role="item"]` | Specifies which items inside the element should be draggable |
92
- | `sortable` | `Boolean` | `true` | Whether the current list can be sorted by dragging |
93
- | `lockAxis` | `x \| y` | `-` | Axis on which dragging will be locked |
94
- | `keepOffset` | `Boolean` | `false` | When scrolling up to load data, keep the same offset as the previous scroll |
95
- | `disabled` | `Boolean` | `false` | Disables the sortable if set to true |
96
- | `animation` | `Number` | `150` | Drag-and-drop's animation delay |
97
- | `autoScroll` | `Boolean` | `true` | Automatic scrolling when moving to the edge of the container |
98
- | `scrollSpeed` | `Object` | `{ x: 10, y: 10 }` | Vertical&Horizontal scrolling speed (px) |
99
- | `scrollThreshold` | `Number` | `55` | Threshold to trigger autoscroll |
100
- | `delay` | `Number` | `0` | Time in milliseconds to define when the sorting should start |
101
- | `delayOnTouchOnly` | `Boolean` | `false` | Only delay on press if user is using touch |
102
- | `appendToBody` | `Boolean` | `false` | Appends the ghost element into the document's body |
103
- | `dropOnAnimationEnd` | `Boolean` | `true` | Drop item on animation end |
104
- | `rootTag` | `String` | `div` | Label type for root element |
105
- | `wrapTag` | `String` | `div` | Label type for list wrap element |
106
- | `wrapStyle` | `Object` | `{}` | List wrapper element style |
107
- | `wrapClass` | `String` | `''` | List wrapper element class |
108
- | `ghostStyle` | `Object` | `{}` | The style of the mask element when dragging |
109
- | `ghostClass` | `String` | `''` | The class of the mask element when dragging |
110
- | `chosenClass` | `String` | `''` | Class name for the chosen item |
111
- | `placeholderClass` | `String` | `''` | Class name for the drop placeholder |
89
+ | **Prop** | **Type** | **Default** | **Description** |
90
+ | -------------------- | --------- | ----------------------- | --------------------------------------------------------------------------- |
91
+ | `buffer` | `Number` | `Math.round(keeps / 3)` | Buffer size to detect range change |
92
+ | `draggable` | `String` | `[role="item"]` | Specifies which items inside the element should be draggable |
93
+ | `sortable` | `Boolean` | `true` | Whether the current list can be sorted by dragging |
94
+ | `lockAxis` | `x \| y` | `-` | Axis on which dragging will be locked |
95
+ | `keepOffset` | `Boolean` | `false` | When scrolling up to load data, keep the same offset as the previous scroll |
96
+ | `disabled` | `Boolean` | `false` | Disables the sortable if set to true |
97
+ | `animation` | `Number` | `150` | Drag-and-drop's animation delay |
98
+ | `autoScroll` | `Boolean` | `true` | Automatic scrolling when moving to the edge of the container |
99
+ | `scrollSpeed` | `Object` | `{ x: 10, y: 10 }` | Vertical&Horizontal scrolling speed (px) |
100
+ | `scrollThreshold` | `Number` | `55` | Threshold to trigger autoscroll |
101
+ | `delay` | `Number` | `0` | Time in milliseconds to define when the sorting should start |
102
+ | `delayOnTouchOnly` | `Boolean` | `false` | Only delay on press if user is using touch |
103
+ | `appendToBody` | `Boolean` | `false` | Appends the ghost element into the document's body |
104
+ | `dropOnAnimationEnd` | `Boolean` | `true` | Drop item on animation end |
105
+ | `rootTag` | `String` | `div` | Label type for root element |
106
+ | `wrapTag` | `String` | `div` | Label type for list wrap element |
107
+ | `wrapStyle` | `Object` | `{}` | List wrapper element style |
108
+ | `wrapClass` | `String` | `''` | List wrapper element class |
109
+ | `ghostStyle` | `Object` | `{}` | The style of the mask element when dragging |
110
+ | `ghostClass` | `String` | `''` | The class of the mask element when dragging |
111
+ | `chosenClass` | `String` | `''` | Class name for the chosen item |
112
+ | `placeholderClass` | `String` | `''` | Class name for the drop placeholder |
112
113
 
113
114
  ## Methods
114
115
  Use the methods exposed in the component by setting `ref`
@@ -134,7 +135,7 @@ return (
134
135
  )
135
136
  ```
136
137
 
137
- | **Prop** | **Description** |
138
+ | **Method** | **Description** |
138
139
  | ----------------------------- | ---------------------------------------------------------- |
139
140
  | `getSize(key)` | get the height of the specified item by key value |
140
141
  | `getOffset()` | get the current scroll top/left |
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-virtual-sortable v1.1.0
2
+ * react-virtual-sortable v1.1.1
3
3
  * open source under the MIT license
4
4
  * https://github.com/mfuu/react-virtual-sortable#readme
5
5
  */
@@ -905,6 +905,7 @@
905
905
  for (var name in defaults) {
906
906
  !(name in this.options) && (this.options[name] = defaults[name]);
907
907
  }
908
+ this.option('buffer', options.buffer);
908
909
  this.sizes = new Map(); // store item size
909
910
  this.sizeType = 'INIT';
910
911
  this.fixedSize = 0;
@@ -1028,6 +1029,13 @@
1028
1029
  var _this2 = this;
1029
1030
  var oldValue = this.options[key];
1030
1031
  this.options[key] = value;
1032
+ if (key === 'buffer') {
1033
+ if (value === undefined || value === null) {
1034
+ this.buffer = Math.round(this.options.keeps / 3);
1035
+ } else {
1036
+ this.buffer = value;
1037
+ }
1038
+ }
1031
1039
  if (key === 'uniqueKeys') {
1032
1040
  this.sizes.forEach(function (_v, k) {
1033
1041
  if (!value.includes(k)) {
@@ -1188,14 +1196,14 @@
1188
1196
  if (scrolls >= this.range.start) {
1189
1197
  return;
1190
1198
  }
1191
- var start = Math.max(scrolls - this.options.buffer, 0);
1199
+ var start = Math.max(scrolls - this.buffer, 0);
1192
1200
  this.checkIfUpdate(start, this.getEndByStart(start));
1193
1201
  }
1194
1202
  }, {
1195
1203
  key: "handleScrollBehind",
1196
1204
  value: function handleScrollBehind() {
1197
1205
  var scrolls = this.getScrollItems();
1198
- if (scrolls < this.range.start + this.options.buffer) {
1206
+ if (scrolls < this.range.start + this.buffer) {
1199
1207
  return;
1200
1208
  }
1201
1209
  this.checkIfUpdate(scrolls, this.getEndByStart(scrolls));
@@ -1322,7 +1330,7 @@
1322
1330
  }();
1323
1331
 
1324
1332
  var SortableAttrs = ['delay', 'group', 'handle', 'lockAxis', 'disabled', 'sortable', 'draggable', 'animation', 'autoScroll', 'ghostClass', 'ghostStyle', 'chosenClass', 'scrollSpeed', 'appendToBody', 'ghostContainer', 'scrollThreshold', 'delayOnTouchOnly', 'placeholderClass', 'dropOnAnimationEnd'];
1325
- var VirtualAttrs = ['size', 'keeps', 'scroller', 'direction', 'uniqueKeys', 'debounceTime', 'throttleTime'];
1333
+ var VirtualAttrs = ['size', 'keeps', 'buffer', 'scroller', 'direction', 'debounceTime', 'throttleTime'];
1326
1334
  var VirtualSortable = /*#__PURE__*/function () {
1327
1335
  function VirtualSortable(el, options) {
1328
1336
  _classCallCheck(this, VirtualSortable);
@@ -1374,7 +1382,6 @@
1374
1382
  return res;
1375
1383
  }, {});
1376
1384
  this.virtual = new Virtual(Object.assign(Object.assign({}, props), {
1377
- buffer: this.options.buffer,
1378
1385
  wrapper: this.options.wrapper,
1379
1386
  scroller: this.options.scroller,
1380
1387
  uniqueKeys: this.options.uniqueKeys,
@@ -1630,6 +1637,8 @@
1630
1637
  size = _props$size === void 0 ? undefined : _props$size,
1631
1638
  _props$keeps = props.keeps,
1632
1639
  keeps = _props$keeps === void 0 ? 30 : _props$keeps,
1640
+ _props$buffer = props.buffer,
1641
+ buffer = _props$buffer === void 0 ? undefined : _props$buffer,
1633
1642
  _props$scroller = props.scroller,
1634
1643
  scroller = _props$scroller === void 0 ? undefined : _props$scroller,
1635
1644
  _props$direction = props.direction,
@@ -1816,6 +1825,7 @@
1816
1825
  // virtual attrs
1817
1826
  size: size,
1818
1827
  keeps: keeps,
1828
+ buffer: buffer,
1819
1829
  scroller: scroller,
1820
1830
  direction: direction,
1821
1831
  debounceTime: debounceTime,
@@ -1842,7 +1852,6 @@
1842
1852
  };
1843
1853
  var initVirtualSortable = function initVirtualSortable() {
1844
1854
  VS.current = new VirtualSortable(rootElRef.current, Object.assign(Object.assign({}, combinedAttrs), {
1845
- buffer: Math.round(keeps / 3),
1846
1855
  wrapper: wrapElRef.current,
1847
1856
  scroller: scroller || rootElRef.current,
1848
1857
  uniqueKeys: uniqueKeys.current,
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-virtual-sortable v1.1.0
2
+ * react-virtual-sortable v1.1.1
3
3
  * open source under the MIT license
4
4
  * https://github.com/mfuu/react-virtual-sortable#readme
5
5
  */
@@ -8,4 +8,4 @@
8
8
  * sortable-dnd v0.7.1
9
9
  * open source under the MIT license
10
10
  * https://github.com/mfuu/sortable-dnd#readme
11
- */!function(t){t.exports=function(){function t(){return t=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)({}).hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},t.apply(null,arguments)}function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}var n={capture:!1,passive:!1},o=/\s+/g;function i(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var r=i(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),l=i(/Edge/i),a=i(/safari/i)&&!i(/chrome/i)&&!i(/android/i),s=function(){var t=!1;return document.addEventListener("checkIfSupportPassive",null,{get passive(){return t=!0,!0}}),t}();function c(t,e,o){window.addEventListener?t.addEventListener(e,o,!(!s&&r)&&n):window.attachEvent?t.attachEvent("on"+e,o):t["on"+e]=o}function u(t,e,o){window.removeEventListener?t.removeEventListener(e,o,!(!s&&r)&&n):window.detachEvent?t.detachEvent("on"+e,o):t["on"+e]=null}function h(){return document.scrollingElement||document.documentElement}function d(t,e,n){if(t.getBoundingClientRect||t===window){var o,i,r,l,a,s,c;if(t!==window&&t.parentNode&&t!==h()?(i=(o=t.getBoundingClientRect()).top,r=o.left,l=o.bottom,a=o.right,s=o.height,c=o.width):(i=0,r=0,l=window.innerHeight,a=window.innerWidth,s=window.innerHeight,c=window.innerWidth),e&&t!==window){n=n||t.parentNode;do{if(n&&n.getBoundingClientRect){var u=n.getBoundingClientRect();i-=u.top+parseInt(w(n,"border-top-width")),r-=u.left+parseInt(w(n,"border-left-width")),l=i+o.height,a=r+o.width;break}}while(n=n.parentNode)}return{top:i,left:r,bottom:l,right:a,width:c,height:s}}}function f(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&S(t,e):S(t,e))||o&&t===n)return t;if(t===n)break}while(t=t.parentNode);return null}}function p(t,e){if(!t||!e)return!1;if(e.compareDocumentPosition)return!!(16&e.compareDocumentPosition(t));if(e.contains&&1===t.nodeType)return e.contains(t)&&e!==t;for(;t=t.parentNode;)if(t===e)return!0;return!1}function v(t,e){for(var n=t.lastElementChild;n&&(n===tt.ghost||"none"===w(n,"display")||e&&!S(n,e));)n=n.previousElementSibling;return n||null}function g(t,e){if(!t||!t.parentNode)return-1;for(var n=0;t=t.previousElementSibling;)t===tt.ghost||"TEMPLATE"===t.nodeName.toUpperCase()||"none"===w(t,"display")||e&&!S(t,e)||n++;return n}function m(t,e,n,o){for(var i=0,r=0,l=t.children;i<l.length;){if(l[i]!==tt.ghost&&"none"!==w(l[i],"display")&&f(l[i],n,t,!1)&&(o||l[i]!==tt.dragged)){if(r===e)return l[i];r++}i++}return null}function y(t,e){var n=w(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=m(t,0,e),a=m(t,1,e),s=i&&w(i),c=a&&w(a),u=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+d(i).width,h=c&&parseInt(c.marginLeft)+parseInt(c.marginRight)+d(a).width,f=l||r?"cssFloat":"float";if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&s.float&&"none"!==s.float){var p="left"===s.float?"left":"right";return!a||"both"!==c.clear&&c.clear!==p?"horizontal":"vertical"}return i&&("block"===s.display||"flex"===s.display||"table"===s.display||"grid"===s.display||u>=o&&"none"===n[f]||a&&"none"===n[f]&&u+h>o)?"vertical":"horizontal"}function b(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var i=(" "+t.className+" ").replace(o," ").replace(" "+e+" "," ");t.className=(i+(n?" "+e:"")).replace(o," ")}}function S(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function w(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function x(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}function E(t,e){var n,o,i=(o=e,(n=t).compareDocumentPosition?n.compareDocumentPosition(o):n.contains?(n!=o&&n.contains(o)&&16)+(n!=o&&o.contains(n)&&8)+(n.sourceIndex>=0&&o.sourceIndex>=0?(n.sourceIndex<o.sourceIndex&&4)+(n.sourceIndex>o.sourceIndex&&2):1):0);return 2===i?1:4===i?-1:0}function T(t){void 0!==t.preventDefault&&t.cancelable&&t.preventDefault()}function O(e){var n=e.sortable,o=e.name,i=e.evt,r=n.options[o];if("function"==typeof r)return r(t({},i))}function I(t){if("function"==typeof t){for(var e=arguments.length,n=new Array(e>1?e-1:0),o=1;o<e;o++)n[o-1]=arguments[o];return t.apply(void 0,n)}return t}var k="Sortable"+Date.now();function z(t){this.options=t,this.scrollEl=null,this.autoScrollInterval=null}function _(t){this.options=t,this.animationStack=[],this.animationCallbackId=null}function D(t,e){return Math.sqrt(Math.pow(t.left-e.left,2)+Math.pow(t.top-e.top,2))}z.prototype={nulling:function(){this.autoScrollInterval&&(clearInterval(this.autoScrollInterval),this.autoScrollInterval=null)},onStarted:function(){this.nulling(),this.autoScrollInterval=setInterval(this.autoScroll.bind(this))},onMove:function(t,e,n,o){var i=n?n[k].options:o;!n||i.autoScroll?(this.options=i,this.scrollEl=function(t,e){if(!t||!t.getBoundingClientRect)return h();var n=t,o=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=w(n);if(n.clientWidth<n.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!n.getBoundingClientRect||n===document.body)return h();if(o||e)return n;o=!0}}}while(n=n.parentNode);return h()}(t,!0),this.moveEvent=e):this.scrollEl=null},autoScroll:function(){var t=this.options,e=this.moveEvent,n=this.scrollEl,o=t.scrollThreshold,i=t.scrollSpeed;if(n&&void 0!==e.clientX&&void 0!==e.clientY){var r=d(n);if(r){var l=e.clientX,a=e.clientY,s=r.top,c=r.right,u=r.bottom,h=r.left,f=r.height,p=r.width;if(!(a<s||l>c||a>u||l<h)){var v=n.scrollTop,g=n.scrollLeft,m=n.scrollHeight,y=n.scrollWidth;n.scrollLeft+=this.getScrollOffset(l,h,c,o,i.x,g,y,p),n.scrollTop+=this.getScrollOffset(a,s,u,o,i.y,v,m,f)}}}},getScrollOffset:function(t,e,n,o,i,r,l,a){return r>0&&t>=e&&t<=e+o?Math.max(-1,(t-e)/o-1)*i:r+a<l&&t<=n&&t>=n-o?Math.min(1,(t-n)/o+1)*i:0}},_.prototype={collect:function(t){if(t){for(var e=d(t),n=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,o=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,i=Math.min(e.right,n),r=Math.min(e.bottom,o),l=Array.prototype.slice.call(t.children),a=[],s=0,c=l.length;s<c;s++){var u=l[s];if(u!==tt.ghost&&"none"!==w(u,"display")){var h=d(u);if(!(h.bottom<0||h.right<0)){if(0===a.length&&u.previousElementSibling){var f=u.previousElementSibling;do{if(f&&f!==tt.ghost&&"none"!==w(f,"display"))break}while(f=f.previousElementSibling);f&&a.push({el:f,rect:d(f)})}if(h.top-h.height>r||h.left-h.width>i){a.push({el:u,rect:h});break}a.push({el:u,rect:h})}}}this.animationStack.push(a)}},animate:function(t){var e=this,n=this.animationStack.pop(),o=this.options.animation;if(!n||!o)return clearTimeout(this.animationCallbackId),void("function"==typeof t&&t());var i=0;n.forEach(function(t){var n=0,r=t.el,l=d(r),a=t.rect,s=r.prevToRect,c=r.prevFromRect;if(r.animating&&c&&s&&x(a,l)){var u=function(t,e){var n="";if("string"==typeof t)n=t;else do{var o=w(t,"transform");o&&"none"!==o&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}(r,!0);u&&(n=D({top:l.top-u.f,left:l.left-u.e},l)/D(c,s)*o)}x(a,l)||(r.prevFromRect=a,r.prevToRect=l,n||(n=o),e.execute(r,a,l,n)),n&&(i=Math.max(i,n))}),clearTimeout(this.animationCallbackId),i?this.animationCallbackId=setTimeout(function(){"function"==typeof t&&t()},i):"function"==typeof t&&t()},execute:function(t,e,n,o){var i=this.options.easing||"",r=e.left-n.left,l=e.top-n.top;w(t,"transition",""),w(t,"transform","translate3d(".concat(r,"px, ").concat(l,"px, 0)")),this.repaintDummy=function(t){return t.offsetWidth}(t),w(t,"transition","transform ".concat(o,"ms ").concat(i)),w(t,"transform","translate3d(0px, 0px, 0px)"),"number"==typeof t.animating&&clearTimeout(t.animating),t.animating=setTimeout(function(){w(t,"transition",""),w(t,"transform",""),t.prevFromRect=null,t.prevToRect=null,t.animating=null},o)}};var C,M,R,N,A,j,B,P,H,L,F,K,Y,W,X,U,q,V,G,$,J,Q=[];function Z(t){var n,o,i,r={},l=t.group;l&&"object"===e(l)||(l={name:l,pull:!0,put:!0,revertDrag:!0}),r.name=l.name,r.pull=null===(n=l.pull)||void 0===n||n,r.put=null===(o=l.put)||void 0===o||o,r.revertDrag=null===(i=l.revertDrag)||void 0===i||i,t.group=r}function tt(e,n){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable-dnd: `el` must be an HTMLElement, not ".concat({}.toString.call(e));e[k]=this,this.el=e,this.options=n=t({},n);var o={store:null,group:"",handle:null,draggable:">*",sortable:!0,disabled:!1,customGhost:null,lockAxis:"",direction:"",animation:150,easing:"",chosenClass:"",placeholderClass:"",ghostClass:"",ghostStyle:{},ghostContainer:null,appendToBody:!1,autoScroll:!0,scrollThreshold:55,scrollSpeed:{x:10,y:10},delay:0,delayOnTouchOnly:!1,swapOnDrop:!0,removeCloneOnDrop:!0,dropOnAnimationEnd:!1,supportTouch:"ontouchstart"in window,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,emptyInsertThreshold:-1};for(var i in o)!(i in n)&&(n[i]=o[i]);for(var r in Z(n),this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));c(e,n.supportTouch?"touchstart":"mousedown",this._onDrag),this.autoScroller=new z(n),this.animator=new _(n),Q.push(e)}return tt.prototype={constructor:tt,_onDrag:function(t){var e=this,n=this.el,o=this.options,i=o.handle,s=t.touches&&t.touches[0],u=(s||t).target,h=n.ownerDocument;if(!R&&!o.disabled&&o.group.pull&&!(/mousedown|pointerdown/.test(t.type)&&0!==t.button||a&&u&&"SELECT"===u.tagName.toUpperCase())){var d=f(u,o.draggable,n);d&&!d.animating&&(X={event:t,clientX:(s||t).clientX,clientY:(s||t).clientY},R=d,c(V=s?R:document,"mouseup",this._onDrop),c(V,"touchend",this._onDrop),c(V,"touchcancel",this._onDrop),"function"==typeof i&&!i(t)||"string"==typeof i&&!f(u,i,R)||(!o.delay||o.delayOnTouchOnly&&!s||l||r?this._onStart(s,t):(c(h,"touchmove",this._delayedMoveHandler),c(h,"mousemove",this._delayedMoveHandler),c(h,"mouseup",this._cancelStart),c(h,"touchend",this._cancelStart),c(h,"touchcancel",this._cancelStart),this._dragStartTimer=setTimeout(function(){return e._onStart(s,t)},o.delay))))}},_delayedMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-X.clientX),Math.abs(e.clientY-X.clientY))>=Math.floor(this.options.touchStartThreshold/(window.devicePixelRatio||1))&&this._cancelStart()},_cancelStart:function(){var t=this.el.ownerDocument;clearTimeout(this._dragStartTimer),u(t,"touchmove",this._delayedMoveHandler),u(t,"mousemove",this._delayedMoveHandler),u(t,"mouseup",this._cancelStart),u(t,"touchend",this._cancelStart),u(t,"touchcancel",this._cancelStart)},_onStart:function(t,e){T(e);var n=this.el,o=this.options,i=g(R);K=i,Y=i,W=i,C=n,M=n,j=n,H=R,L=R.parentNode,F=o.group.pull,$=R,G={to:n,target:R,newIndex:i,relative:0},B=R.cloneNode(!0),tt.dragged=R,tt.clone=B,tt.active=this,O({sortable:this,name:"onChoose",evt:this._getEventProperties(e)}),b(R,o.chosenClass,!0),c(V,t?"touchmove":"mousemove",this._nearestSortable);try{document.selection?setTimeout(function(){return document.selection.empty()},0):window.getSelection().removeAllRanges()}catch(t){}c(document,"selectstart",T),a&&w(document.body,"user-select","none")},_onStarted:function(){var t=this.options;this.animator.collect(L),this._appendGhost(),b(B,t.chosenClass,!0),b(B,t.placeholderClass,!0),R.parentNode.insertBefore(B,R),w(R,"display","none"),O({sortable:this,name:"onDrag",evt:this._getEventProperties(X.event)}),this.animator.animate(),this.autoScroller.onStarted()},_appendGhost:function(){if(!P){var e=this.options,n=e.appendToBody?document.body:I(e.ghostContainer,this)||this.el,o=I(e.customGhost,B)||B;b(P=o.cloneNode(!0),e.ghostClass,!0);var i=d(R),r=t({position:"fixed",top:i.top,left:i.left,width:i.width,height:i.height,margin:0,zIndex:1e5,opacity:"0.8",overflow:"hidden",boxSizing:"border-box",transform:"",transition:"",pointerEvents:"none"},e.ghostStyle);for(var l in r)w(P,l,r[l]);tt.ghost=P,n.appendChild(P);var a=(X.clientX-i.left)/parseInt(P.style.width)*100,s=(X.clientY-i.top)/parseInt(P.style.height)*100;w(P,"transform-origin","".concat(a,"% ").concat(s,"%")),w(P,"will-change","transform")}},_nearestSortable:function(t){T(t);var e=t.touches&&t.touches[0]||t;if(R&&function(t){var e=U||X;return!(void 0!==t.clientX&&void 0!==t.clientY&&Math.abs(t.clientX-e.clientX)<=0&&Math.abs(t.clientY-e.clientY)<=0)}(e)){!U&&this._onStarted();var n=this.options.lockAxis,o="x"===n?X.clientX:e.clientX,i="y"===n?X.clientY:e.clientY,r=document.elementFromPoint(o,i),l=o-X.clientX,a=i-X.clientY;U={event:t,clientX:o,clientY:i},w(P,"transform","translate3d(".concat(l,"px, ").concat(a,"px, 0)"));var s,c,u,h=(s=o,c=i,Q.reduce(function(t,e){var n=e[k].options.emptyInsertThreshold;if(null!=n){var o=d(e),i=s>=o.left-n&&s<=o.right+n,r=c>=o.top-n&&c<=o.bottom+n;return i&&r&&(!u||u&&o.left>=u.left&&o.right<=u.right&&o.top>=u.top&&o.bottom<=u.bottom)&&(t=e,u=o),t}},null));h&&h[k]._onMove(t,r),this.autoScroller.onMove(r,U,h,this.options)}},_allowPut:function(){var t=this.options.group,e=j[k].options.group;return this.el===j||!!t.put&&(t.put.join&&t.put.indexOf(e.name)>-1||e.name&&t.name&&e.name===t.name)},_getDirection:function(){var t=this.options.draggable,e=this.options.direction;return e?I(e,U.event,B,this):y(L,t)},_allowSwap:function(){var t=d(N),e="vertical"===this._getDirection(),n=e?"top":"left",o=e?"bottom":"right",i=N[e?"offsetHeight":"offsetWidth"],r=e?U.clientY:U.clientX,l=r>=t[n]&&r<t[o]-i/2?-1:1,a=m(L,0,this.options.draggable),s=v(L),c=d(a),u=d(s);if(N===L||p(L,N))return B===a&&r<c[n]?(A=N,!0):B===s&&r>u[o]&&(A=N.nextSibling,!0);var h=E(B,N);return A=h<0?N.nextSibling:N,q!==N?(J=l,!0):J!==l&&(J=l,l<0?h>0:h<0)},_onMove:function(t,e){var n=this.el,o=this.options;if(!o.disabled&&this._allowPut()){if(N=f(e,o.draggable,n),O({sortable:this,name:"onMove",evt:this._getEventProperties(t,{target:N})}),o.sortable||n!==j)return n===M||e!==n&&v(n)?void(N&&!N.animating&&!p(N,B)&&this._allowSwap()&&(N!==B&&A!==B?(n!==M?this._onInsert(t):N!==R&&this._onChange(t),q=N):q=N)):(N=q=null,void this._onInsert(t));M!==j&&(N=q=R,J=0,this._onInsert(t))}},_onInsert:function(t){var e=this.el,n=N||B,o="clone"===F&&e!==j&&M===j,i="clone"===F&&e===j&&M!==j,r=p(N,document),l=N===R&&!r,a=M[k],s=j[k];C=e,K=g(B),H=n,L=r?N.parentNode:e,a.animator.collect(B.parentNode),this.animator.collect(L),o&&(G.target=$,G.newIndex=K,G.relative=$===R?0:E(B,$),w(R,"display",""),s.options.group.revertDrag||B.parentNode.insertBefore(R,B)),i&&(K=g(R),w(R,"display","none")),w(B,"display",l?"none":""),N&&r?L.insertBefore(B,J<0?N:N.nextSibling):L.appendChild(B),Y=l?W:g(B),o&&s.options.group.revertDrag&&(G.target=R,G.newIndex=W,G.relative=0,O({sortable:s,name:"onChange",evt:this._getEventProperties(t,{to:j,target:R,newIndex:W,revertDrag:!0})})),o||O({sortable:a,name:"onRemove",evt:this._getEventProperties(t,{newIndex:-1})}),i&&n!==R&&($=n,O({sortable:this,name:"onChange",evt:this._getEventProperties(t,{from:j,backToOrigin:!0})})),i||O({sortable:this,name:"onAdd",evt:this._getEventProperties(t,{oldIndex:-1})}),a.animator.animate(),this.animator.animate(),M=e},_onChange:function(t){var e=this.el;this.animator.collect(L),K=g(B),L=N.parentNode,H=N,e===j&&($=N),L.insertBefore(B,A),Y=g(B),O({sortable:this,name:"onChange",evt:this._getEventProperties(t)}),this.animator.animate(),M=e},_onDrop:function(t){var e=this,n=this.options;if(this._cancelStart(),u(V,"touchmove",this._nearestSortable),u(V,"mousemove",this._nearestSortable),u(V,"mouseup",this._onDrop),u(V,"touchend",this._onDrop),u(V,"touchcancel",this._onDrop),u(document,"selectstart",T),a&&w(document.body,"user-select",""),P&&P.parentNode&&P.parentNode.removeChild(P),j)if(M=j,K=W,H===B&&(H=R),b(R,n.chosenClass,!1),O({sortable:this,name:"onUnchoose",evt:this._getEventProperties(t)}),U){this.animator.collect(L),b(B,n.chosenClass,!1),b(B,n.placeholderClass,!1);var o=this._getEventProperties(t);!n.dropOnAnimationEnd&&this._onEnd(o),this.animator.animate(function(){n.dropOnAnimationEnd&&e._onEnd(o)})}else this._nulling();else this._nulling()},_onEnd:function(e){var n=this.options,o="clone"===F,i=M===C;o&&!i||!I(n.swapOnDrop,e)||L.insertBefore(R,B),o&&!i||!I(n.removeCloneOnDrop,e)||B&&B.parentNode&&B.parentNode.removeChild(B),w(R,"display",""),M!==C&&O({sortable:M[k],name:"onDrop",evt:t({},e,o?G:{newIndex:-1})}),O({sortable:C[k],name:"onDrop",evt:t({},e,i?{}:{oldIndex:-1})}),this._nulling()},_getEventProperties:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o={};return o.event=e,o.to=C,o.from=M,o.node=R,o.clone=B,o.target=H,o.oldIndex=K,o.newIndex=Y,o.pullMode=F,t(o,n),o.relative=H===R?0:E(B,H),o},_nulling:function(){C=M=R=N=A=j=B=P=H=L=F=K=Y=W=X=U=q=V=G=$=J=tt.clone=tt.ghost=tt.active=tt.dragged=null,this.autoScroller.nulling()},destroy:function(){this._cancelStart(),this._nulling(),u(this.el,"touchstart",this._onDrag),u(this.el,"mousedown",this._onDrag);var t=Q.indexOf(this.el);t>-1&&Q.splice(t,1),this.el[k]=this.animator=this.autoScroller=null},option:function(t,e){if(void 0===e)return this.options[t];this.options[t]=e,this.animator.options[t]=e,this.autoScroller.options[t]=e,"group"===t&&Z(this.options)}},tt.utils={on:c,off:u,css:w,index:g,matches:S,closest:f,getRect:d,toggleClass:b,detectDirection:y},tt.get=function(t){return t[k]},tt.create=function(t,e){return new tt(t,e)},tt}()}(f);var p=d(f.exports);function v(t,e){var n,o=function(){for(var o=this,i=arguments.length,r=new Array(i),l=0;l<i;l++)r[l]=arguments[l];n||(e<=0?t.apply(this,r):n=setTimeout(function(){n=null,t.apply(o,r)},e))};return o.cancel=function(){n&&(clearTimeout(n),n=null)},o}function g(t,e){var n=v(t,e),o=function(){n.cancel();for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];n.apply(this,e)};return o.cancel=function(){n.cancel()},o}function m(t,e){return 0===t&&0===e?1/t==1/e:!(!Number.isNaN(t)||!Number.isNaN(e))||t==e}function y(t,e){return(Array.isArray(e)?e:e.replace(/\[/g,".").replace(/\]/g,".").split(".")).reduce(function(t,e){return(t||{})[e]},t)}function b(t){return t instanceof Document&&9===t.nodeType||t instanceof Window}var S=function(){return l(function t(e){i(this,t),this.options=e;var n={size:0,keeps:0,buffer:0,wrapper:null,scroller:null,direction:"vertical",uniqueKeys:[],debounceTime:null,throttleTime:null};for(var o in n)!(o in this.options)&&(this.options[o]=n[o]);this.sizes=new Map,this.sizeType="INIT",this.fixedSize=0,this.averageSize=0,this.range={start:0,end:0,front:0,behind:0},this.offset=0,this.direction="STATIONARY",this.updateScrollElement(),this.updateOnScrollFunction(),this.addScrollEventListener(),this.checkIfUpdate(0,e.keeps-1)},[{key:"isFixed",value:function(){return"FIXED"===this.sizeType}},{key:"isFront",value:function(){return"FRONT"===this.direction}},{key:"isBehind",value:function(){return"BEHIND"===this.direction}},{key:"isHorizontal",value:function(){return"horizontal"===this.options.direction}},{key:"getSize",value:function(t){return this.sizes.get(t)||this.getItemSize()}},{key:"getOffset",value:function(){var t=this.isHorizontal()?"scrollLeft":"scrollTop";return this.scrollEl[t]}},{key:"getScrollSize",value:function(){var t=this.isHorizontal()?"scrollWidth":"scrollHeight";return this.scrollEl[t]}},{key:"getClientSize",value:function(){var t=this.isHorizontal()?"offsetWidth":"offsetHeight";return this.scrollEl[t]}},{key:"scrollToOffset",value:function(t){var e=this.isHorizontal()?"scrollLeft":"scrollTop";this.scrollEl[e]=t}},{key:"scrollToIndex",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top";if(t>=this.options.uniqueKeys.length-1)this.scrollToBottom();else if(t<0)this.scrollToOffset(0);else{var n=this.getOffset(),o=this.getClientSize(),i=this.getSize(this.options.uniqueKeys[t]),r=this.getOffsetByRange(0,t)+this.getScrollStartOffset(),l=r+i;if("auto"===e){if(r>=n&&l<=n+o)return;e=r<n?"top":"bottom"}if("top"===e)this.scrollToOffset(r);else if("bottom"===e){var a=Math.max(0,l-o);this.scrollToOffset(a)}}}},{key:"scrollToBottom",value:function(){var t=this,e=this.getScrollSize();this.scrollToOffset(e),setTimeout(function(){t.isReachedBottom()||t.scrollToBottom()},5)}},{key:"isReachedBottom",value:function(){return this.getOffset()+this.getClientSize()+1>=this.getScrollSize()}},{key:"option",value:function(t,e){var n=this,o=this.options[t];this.options[t]=e,"uniqueKeys"===t&&this.sizes.forEach(function(t,o){e.includes(o)||n.sizes.delete(o)}),"scroller"===t&&(o&&p.utils.off(o,"scroll",this.onScroll),this.updateScrollElement(),this.addScrollEventListener())}},{key:"updateRange",value:function(t){if(t)this.handleUpdate(t.start);else{var e=this.range.start;e=Math.max(e,0),this.handleUpdate(e)}}},{key:"updateItemSize",value:function(t,e){e&&this.sizes.get(t)!==e&&(this.sizes.set(t,e),"INIT"===this.sizeType?(this.sizeType="FIXED",this.fixedSize=e):this.isFixed()&&this.fixedSize!==e&&(this.sizeType="DYNAMIC",this.fixedSize=0),this.averageSize||"DYNAMIC"!==this.sizeType||this.sizes.size!==this.options.keeps||this.updateAverageSize())}},{key:"updateAverageSize",value:function(){var t=s(this.sizes.values()).reduce(function(t,e){return t+e},0);this.averageSize=Math.round(t/this.sizes.size)}},{key:"addScrollEventListener",value:function(){this.options.scroller&&p.utils.on(this.options.scroller,"scroll",this.onScroll)}},{key:"removeScrollEventListener",value:function(){this.options.scroller&&p.utils.off(this.options.scroller,"scroll",this.onScroll)}},{key:"enableScroll",value:function(t){var e=this.options.scroller,n=t?p.utils.off:p.utils.on,o="onwheel"in document.createElement("div")?"wheel":"mousewheel";n(e,"DOMMouseScroll",this.preventDefault),n(e,o,this.preventDefault),n(e,"touchmove",this.preventDefault),n(e,"keydown",this.preventDefaultForKeyDown)}},{key:"preventDefault",value:function(t){t.preventDefault()}},{key:"preventDefaultForKeyDown",value:function(t){if({37:1,38:1,39:1,40:1}[t.keyCode])return this.preventDefault(t),!1}},{key:"updateScrollElement",value:function(){var t=this.options.scroller;if(b(t)){var e=document.scrollingElement||document.documentElement||document.body;this.scrollEl=e}else this.scrollEl=t}},{key:"updateOnScrollFunction",value:function(){var t=this,e=this.options,n=e.debounceTime,o=e.throttleTime;this.onScroll=n?g(function(){return t.handleScroll()},n):o?v(function(){return t.handleScroll()},o):function(){return t.handleScroll()}}},{key:"handleScroll",value:function(){var t=this.getOffset(),e=this.getClientSize(),n=this.getScrollSize();t===this.offset?this.direction="STATIONARY":this.direction=t<this.offset?"FRONT":"BEHIND",this.offset=t;var o=this.isFront()&&t<=0,i=this.isBehind()&&e+t+1>=n;this.options.onScroll({top:o,bottom:i,offset:t,direction:this.direction}),this.isFront()?this.handleScrollFront():this.isBehind()&&this.handleScrollBehind()}},{key:"handleScrollFront",value:function(){var t=this.getScrollItems();if(!(t>=this.range.start)){var e=Math.max(t-this.options.buffer,0);this.checkIfUpdate(e,this.getEndByStart(e))}}},{key:"handleScrollBehind",value:function(){var t=this.getScrollItems();t<this.range.start+this.options.buffer||this.checkIfUpdate(t,this.getEndByStart(t))}},{key:"getScrollItems",value:function(){var t=this.offset-this.getScrollStartOffset();if(t<=0)return 0;if(this.isFixed())return Math.floor(t/this.fixedSize);for(var e=0,n=this.options.uniqueKeys.length,o=0,i=0;e<=n;){if(o=e+Math.floor((n-e)/2),(i=this.getOffsetByRange(0,o))===t)return o;i<t?e=o+1:i>t&&(n=o-1)}return e>0?--e:0}},{key:"checkIfUpdate",value:function(t,e){var n=this.options.keeps;this.options.uniqueKeys.length<=n?t=0:e-t<n-1&&(t=e-n+1),this.range.start!==t&&this.handleUpdate(t)}},{key:"handleUpdate",value:function(t){var e=this.range.start!==t;this.range.start=t,this.range.end=this.getEndByStart(t),this.range.front=this.getFrontOffset(),this.range.behind=this.getBehindOffset(),this.options.onUpdate(Object.assign({},this.range),e)}},{key:"getFrontOffset",value:function(){return this.isFixed()?this.fixedSize*this.range.start:this.getOffsetByRange(0,this.range.start)}},{key:"getBehindOffset",value:function(){var t=this.range.end,e=this.getLastIndex();return this.isFixed()?(e-t)*this.fixedSize:(e-t)*this.getItemSize()}},{key:"getOffsetByRange",value:function(t,e){if(t>=e)return 0;for(var n=0,o=t;o<e;o++){var i=this.sizes.get(this.options.uniqueKeys[o]);n+="number"==typeof i?i:this.getItemSize()}return n}},{key:"getEndByStart",value:function(t){return Math.min(t+this.options.keeps-1,this.getLastIndex())}},{key:"getLastIndex",value:function(){var t=this.options,e=t.uniqueKeys,n=t.keeps;return e.length>0?e.length-1:n-1}},{key:"getItemSize",value:function(){return this.isFixed()?this.fixedSize:this.options.size||this.averageSize}},{key:"getScrollStartOffset",value:function(){var t=this.options,e=t.wrapper,n=t.scroller;if(n===e)return 0;var o=0;if(n&&e){var i=this.isHorizontal()?"left":"top",r=b(n)?p.utils.getRect(e):p.utils.getRect(e,!0,n);o=this.offset+r[i]}return o}}])}(),w=["delay","group","handle","lockAxis","disabled","sortable","draggable","animation","autoScroll","ghostClass","ghostStyle","chosenClass","scrollSpeed","appendToBody","ghostContainer","scrollThreshold","delayOnTouchOnly","placeholderClass","dropOnAnimationEnd"],x=["size","keeps","scroller","direction","uniqueKeys","debounceTime","throttleTime"],E=function(){return l(function t(e,n){i(this,t),this.el=e,this.options=n,this.initVirtual(),this.initSortable()},[{key:"destroy",value:function(){this.virtual.removeScrollEventListener(),this.sortable.destroy()}},{key:"option",value:function(t,e){this.options[t]=e,x.includes(t)&&this.virtual.option(t,e),w.includes(t)&&this.sortable.option(t,e)}},{key:"call",value:function(t){if(t in this.virtual){var e=this.virtual[t];if("function"==typeof e){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return e.apply(this.virtual,o)}throw new Error("Property ".concat(String(t)," is not a function on Virtual."))}throw new Error("Method ".concat(String(t)," does not exist on Virtual."))}},{key:"initVirtual",value:function(){var t=this,e=x.reduce(function(e,n){return e[n]=t.options[n],e},{});this.virtual=new S(Object.assign(Object.assign({},e),{buffer:this.options.buffer,wrapper:this.options.wrapper,scroller:this.options.scroller,uniqueKeys:this.options.uniqueKeys,onScroll:function(e){return t.onScroll(e)},onUpdate:function(e,n){return t.onUpdate(e,n)}}))}},{key:"onScroll",value:function(t){this.dispatchEvent("onScroll",t)}},{key:"onUpdate",value:function(t,e){"dragging"===this.sortableState&&e&&(this.removeDraggedEl=!0),this.dispatchEvent("onUpdate",t,e)}},{key:"initSortable",value:function(){var t=this,e=w.reduce(function(e,n){return e[n]=t.options[n],e},{});this.sortable=new p(this.el,Object.assign(Object.assign({},e),{emptyInsertThreshold:0,swapOnDrop:!1,removeCloneOnDrop:function(t){return t.from===t.to},onDrag:function(e){return t.onDrag(e)},onDrop:function(e){return t.onDrop(e)}}))}},{key:"onDrag",value:function(t){this.sortableState="dragging";var e=t.node.getAttribute("data-key"),n=this.getIndex(e);this.sortable.option("store",{key:e,index:n}),this.dispatchEvent("onDrag",{key:e,index:n,event:t})}},{key:"onDrop",value:function(t){var e,n,o=p.get(t.from).option("store"),i=o.key,r=o.index,l={key:i,event:t,changed:!1,oldIndex:r,newIndex:r};if(t.from!==t.to||t.node!==t.target){var a=this.getEventProperties(l,t);Object.assign(l,a)}this.dispatchEvent("onDrop",l),t.from===this.el&&this.removeDraggedEl&&(null===(e=p.dragged)||void 0===e||e.remove()),t.from!==t.to&&(null===(n=p.clone)||void 0===n||n.remove()),this.sortableState="",this.removeDraggedEl=!1}},{key:"getEventProperties",value:function(t,e){var n=t.key,o=t.oldIndex,i=e.target.getAttribute("data-key"),r=-1,l=o;return e.from===e.to?((l=this.getIndex(n))<(r=this.getIndex(i))&&-1===e.relative||l>r&&1===e.relative)&&(r+=e.relative):(e.from===this.el&&(l=this.getIndex(n)),e.to===this.el&&(l=-1,r=this.getIndex(i),0===e.relative?r=this.options.uniqueKeys.length:1===e.relative&&(r+=e.relative))),{changed:e.from!==e.to||r!==l,oldIndex:l,newIndex:r}}},{key:"getIndex",value:function(t){if(null==t)return-1;for(var e=this.options.uniqueKeys,n=0,o=e.length;n<o;n++)if(m(e[n],t))return n;return-1}},{key:"dispatchEvent",value:function(t){if(t in this.options){var e=this.options[t];if("function"==typeof e){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return e.apply(this,o)}}}}])}();function T(t){var e=t.dataKey,o=t.horizontal,i=t.dragging,r=t.children,l=t.onSizeChange,a=n.useRef(null);n.useLayoutEffect(function(){var t;return void 0!==("undefined"==typeof ResizeObserver?"undefined":u(ResizeObserver))&&(t=new ResizeObserver(function(){var t=o?"offsetWidth":"offsetHeight",n=a.current[t];l(e,n)}),a.current&&(null==t||t.observe(a.current))),function(){t&&(t.disconnect(),t=null)}},[a]);var s=n.useMemo(function(){var t=r.props.style||{},n=m(e,i);return Object.assign(Object.assign({},t),{display:n?"none":""})},[i]);return n.cloneElement(r,{"data-key":e,role:"item",ref:a,style:s,className:r.props.className})}var O,I=n.memo(T);function k(t,e){var o=t.dataKey,i=void 0===o?"":o,r=t.dataSource,l=void 0===r?[]:r,u=t.tableMode,h=void 0!==u&&u,d=t.wrapTag,f=void 0===d?"div":d,p=t.rootTag,v=void 0===p?"div":p,b=t.style,S=void 0===b?{}:b,w=t.className,x=void 0===w?"":w,T=t.wrapStyle,k=void 0===T?{}:T,z=t.wrapClass,_=void 0===z?"":z,D=t.size,C=void 0===D?void 0:D,M=t.keeps,R=void 0===M?30:M,N=t.scroller,A=void 0===N?void 0:N,j=t.direction,B=void 0===j?"vertical":j,P=t.debounceTime,H=void 0===P?0:P,L=t.throttleTime,F=void 0===L?0:L,K=t.delay,Y=void 0===K?0:K,W=t.group,X=void 0===W?"":W,U=t.handle,q=void 0===U?"":U,V=t.lockAxis,G=void 0===V?void 0:V,$=t.disabled,J=void 0!==$&&$,Q=t.sortable,Z=void 0===Q||Q,tt=t.draggable,et=void 0===tt?'[role="item"]':tt,nt=t.animation,ot=void 0===nt?150:nt,it=t.autoScroll,rt=void 0===it||it,lt=t.scrollSpeed,at=void 0===lt?{x:10,y:10}:lt,st=t.ghostClass,ct=void 0===st?"":st,ut=t.ghostStyle,ht=void 0===ut?void 0:ut,dt=t.chosenClass,ft=void 0===dt?"":dt,pt=t.placeholderClass,vt=void 0===pt?"":pt,gt=t.appendToBody,mt=void 0!==gt&&gt,yt=t.scrollThreshold,bt=void 0===yt?55:yt,St=t.delayOnTouchOnly,wt=void 0!==St&&St,xt=t.dropOnAnimationEnd,Et=void 0===xt||xt,Tt=a(n.useState({start:0,end:R-1,front:0,behind:0}),2),Ot=Tt[0],It=Tt[1],kt=n.useRef(""),zt=n.useRef(),_t=n.useRef(),Dt=function(t){return Vt.current.call("getSize",t)},Ct=function(){return Vt.current.call("getOffset")},Mt=function(){return Vt.current.call("getClientSize")},Rt=function(){return Vt.current.call("getScrollSize")},Nt=function(t){Vt.current.call("scrollToOffset",t)},At=function(t,e){Vt.current.call("scrollToIndex",t,e)},jt=function(t,e){var n=Lt.current.indexOf(t);n>-1&&Vt.current.call("scrollToIndex",n,e)},Bt=function(){Nt(0)},Pt=function(){Vt.current.call("scrollToBottom")};n.useImperativeHandle(e,function(){return{getSize:Dt,getOffset:Ct,getClientSize:Mt,getScrollSize:Rt,scrollToTop:Bt,scrollToKey:jt,scrollToIndex:At,scrollToOffset:Nt,scrollToBottom:Pt}});var Ht=n.useRef([]),Lt=n.useRef([]),Ft=n.useRef(0),Kt=n.useRef(0);n.useEffect(function(){var e;if(Ht.current=l,Xt(),Ut(Ft.current,l.length),Kt.current&&t.keepOffset){var n=l.length-Kt.current;n>0&&(null===(e=Vt.current)||void 0===e||e.call("scrollToIndex",n)),Kt.current=0}Ft.current=l.length},[l]),n.useEffect(function(){return $t(),function(){Vt.current.destroy()}},[]);var Yt,Wt,Xt=function(){var t;Lt.current=Ht.current.map(function(t){return y(t,i)}),null===(t=Vt.current)||void 0===t||t.option("uniqueKeys",Lt.current)},Ut=function(t,e){var n,o;if(t!==e){var i=Object.assign({},Ot);t>R&&e>t&&i.end===t-1&&(null===(n=Vt.current)||void 0===n?void 0:n.call("isReachedBottom"))&&i.start++,null===(o=Vt.current)||void 0===o||o.call("updateRange",i)}},qt=function(e){for(var n=t[e],o=arguments.length,i=new Array(o>1?o-1:0),r=1;r<o;r++)i[r-1]=arguments[r];n&&n.apply(null,i)},Vt=n.useRef(),Gt={size:C,keeps:R,scroller:A,direction:B,debounceTime:H,throttleTime:F,delay:Y,group:X,handle:q,lockAxis:G,disabled:J,sortable:Z,draggable:et,animation:ot,autoScroll:rt,ghostClass:ct,ghostStyle:ht,chosenClass:ft,scrollSpeed:at,appendToBody:mt,scrollThreshold:bt,delayOnTouchOnly:wt,placeholderClass:vt,dropOnAnimationEnd:Et},$t=function(){Vt.current=new E(zt.current,Object.assign(Object.assign({},Gt),{buffer:Math.round(R/3),wrapper:_t.current,scroller:A||zt.current,uniqueKeys:Lt.current,ghostContainer:_t.current,onDrag:ee,onDrop:ne,onScroll:Zt,onUpdate:te}))};Yt=Gt,Wt=function(){Vt.current&&Object.keys(Gt).forEach(function(e){void 0!==t[e]&&Vt.current.option(e,t[e])})},n.useEffect(Wt,Object.values(Yt));var Jt=g(function(){Kt.current=Ht.current.length,qt("onTop")},50),Qt=g(function(){qt("onBottom")},50),Zt=function(t){Kt.current=0,t.top?Jt():t.bottom&&Qt()},te=function(t,e){It(t),e&&qt("onRangeChange",t)},ee=function(t){var e,n,o=t.key,i=t.index,r=Ht.current[i];kt.current=o,O=r,Z||(null===(e=Vt.current)||void 0===e||e.call("enableScroll",!1),null===(n=Vt.current)||void 0===n||n.option("autoScroll",!1)),qt("onDrag",Object.assign(Object.assign({},t),{item:r}))},ne=function(e){var n=O,o=e.oldIndex,i=e.newIndex,r=s(Ht.current),l=s(Ht.current);-1===o?l.splice(i,0,n):-1===i?l.splice(o,1):(l.splice(o,1),l.splice(i,0,n)),Vt.current.call("enableScroll",!0),Vt.current.option("autoScroll",t.autoScroll),kt.current="",qt("onDrop",Object.assign(Object.assign({},e),{item:n,list:l,oldList:r}))},oe=n.useMemo(function(){var t=Ot.front,e=Ot.behind,n="horizontal"===B,o=n?"auto hidden":"hidden auto",i=n?"0px ".concat(e,"px 0px ").concat(t,"px"):"".concat(t,"px 0px ").concat(e,"px");return{rootElStyle:Object.assign(Object.assign({},S),{overflow:h||A?"":o}),wrapElStyle:Object.assign(Object.assign({},k),{padding:h?"":i})}},[Ot,S,k,A,h,B]),ie=oe.rootElStyle,re=oe.wrapElStyle,le=n.useMemo(function(){return{rootElTag:h?"table":f,wrapElTag:h?"tbody":f}},[v,f,h]),ae=le.rootElTag,se=le.wrapElTag,ce=function(t){var e=t.list,o=t.start,i=t.end,r=t.dataKey,l=t.horizontal,a=t.dragging,s=t.children,c=t.onSizeChange;return n.useMemo(function(){return e.slice(o,i+1).map(function(t,e){var i=o+e,u=y(t,r);return n.createElement(I,{key:u,dataKey:u,dragging:a,horizontal:l,onSizeChange:c},"function"==typeof s?s(t,i,u):s)})},[e,o,i,r,l,a,s])}({list:l,start:Ot.start,end:Ot.end,dataKey:i,children:t.children,dragging:kt.current,horizontal:"horizontal"===B,onSizeChange:function(t,e){if(!m(t,kt.current)&&Vt.current){var n=Vt.current.virtual.sizes.size;Vt.current.call("updateItemSize",t,e),n===R-1&&Ht.current.length>R&&Vt.current.call("updateRange",Ot)}}}),ue=function(t,e){var o,i,r,l=(o={padding:0,border:0},i="vertical"===B?"height":"width",r="".concat(t,"px"),(i=c(i))in o?Object.defineProperty(o,i,{value:r,enumerable:!0,configurable:!0,writable:!0}):o[i]=r,o);return n.createElement("tr",{key:e},n.createElement("td",{style:l}))};return n.createElement(ae,{ref:zt,style:ie,className:x},[t.header,n.createElement(se,{ref:_t,style:re,className:_},[h&&ue(Ot.front,"front")].concat(s(ce),[h&&ue(Ot.behind,"behind")])),t.footer])}return n.forwardRef(k)});
11
+ */!function(t){t.exports=function(){function t(){return t=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)({}).hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},t.apply(null,arguments)}function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}var n={capture:!1,passive:!1},o=/\s+/g;function i(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var r=i(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),l=i(/Edge/i),a=i(/safari/i)&&!i(/chrome/i)&&!i(/android/i),s=function(){var t=!1;return document.addEventListener("checkIfSupportPassive",null,{get passive(){return t=!0,!0}}),t}();function c(t,e,o){window.addEventListener?t.addEventListener(e,o,!(!s&&r)&&n):window.attachEvent?t.attachEvent("on"+e,o):t["on"+e]=o}function u(t,e,o){window.removeEventListener?t.removeEventListener(e,o,!(!s&&r)&&n):window.detachEvent?t.detachEvent("on"+e,o):t["on"+e]=null}function h(){return document.scrollingElement||document.documentElement}function d(t,e,n){if(t.getBoundingClientRect||t===window){var o,i,r,l,a,s,c;if(t!==window&&t.parentNode&&t!==h()?(i=(o=t.getBoundingClientRect()).top,r=o.left,l=o.bottom,a=o.right,s=o.height,c=o.width):(i=0,r=0,l=window.innerHeight,a=window.innerWidth,s=window.innerHeight,c=window.innerWidth),e&&t!==window){n=n||t.parentNode;do{if(n&&n.getBoundingClientRect){var u=n.getBoundingClientRect();i-=u.top+parseInt(w(n,"border-top-width")),r-=u.left+parseInt(w(n,"border-left-width")),l=i+o.height,a=r+o.width;break}}while(n=n.parentNode)}return{top:i,left:r,bottom:l,right:a,width:c,height:s}}}function f(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&S(t,e):S(t,e))||o&&t===n)return t;if(t===n)break}while(t=t.parentNode);return null}}function p(t,e){if(!t||!e)return!1;if(e.compareDocumentPosition)return!!(16&e.compareDocumentPosition(t));if(e.contains&&1===t.nodeType)return e.contains(t)&&e!==t;for(;t=t.parentNode;)if(t===e)return!0;return!1}function v(t,e){for(var n=t.lastElementChild;n&&(n===tt.ghost||"none"===w(n,"display")||e&&!S(n,e));)n=n.previousElementSibling;return n||null}function g(t,e){if(!t||!t.parentNode)return-1;for(var n=0;t=t.previousElementSibling;)t===tt.ghost||"TEMPLATE"===t.nodeName.toUpperCase()||"none"===w(t,"display")||e&&!S(t,e)||n++;return n}function m(t,e,n,o){for(var i=0,r=0,l=t.children;i<l.length;){if(l[i]!==tt.ghost&&"none"!==w(l[i],"display")&&f(l[i],n,t,!1)&&(o||l[i]!==tt.dragged)){if(r===e)return l[i];r++}i++}return null}function y(t,e){var n=w(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=m(t,0,e),a=m(t,1,e),s=i&&w(i),c=a&&w(a),u=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+d(i).width,h=c&&parseInt(c.marginLeft)+parseInt(c.marginRight)+d(a).width,f=l||r?"cssFloat":"float";if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&s.float&&"none"!==s.float){var p="left"===s.float?"left":"right";return!a||"both"!==c.clear&&c.clear!==p?"horizontal":"vertical"}return i&&("block"===s.display||"flex"===s.display||"table"===s.display||"grid"===s.display||u>=o&&"none"===n[f]||a&&"none"===n[f]&&u+h>o)?"vertical":"horizontal"}function b(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var i=(" "+t.className+" ").replace(o," ").replace(" "+e+" "," ");t.className=(i+(n?" "+e:"")).replace(o," ")}}function S(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function w(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function x(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}function E(t,e){var n,o,i=(o=e,(n=t).compareDocumentPosition?n.compareDocumentPosition(o):n.contains?(n!=o&&n.contains(o)&&16)+(n!=o&&o.contains(n)&&8)+(n.sourceIndex>=0&&o.sourceIndex>=0?(n.sourceIndex<o.sourceIndex&&4)+(n.sourceIndex>o.sourceIndex&&2):1):0);return 2===i?1:4===i?-1:0}function T(t){void 0!==t.preventDefault&&t.cancelable&&t.preventDefault()}function O(e){var n=e.sortable,o=e.name,i=e.evt,r=n.options[o];if("function"==typeof r)return r(t({},i))}function I(t){if("function"==typeof t){for(var e=arguments.length,n=new Array(e>1?e-1:0),o=1;o<e;o++)n[o-1]=arguments[o];return t.apply(void 0,n)}return t}var k="Sortable"+Date.now();function z(t){this.options=t,this.scrollEl=null,this.autoScrollInterval=null}function _(t){this.options=t,this.animationStack=[],this.animationCallbackId=null}function D(t,e){return Math.sqrt(Math.pow(t.left-e.left,2)+Math.pow(t.top-e.top,2))}z.prototype={nulling:function(){this.autoScrollInterval&&(clearInterval(this.autoScrollInterval),this.autoScrollInterval=null)},onStarted:function(){this.nulling(),this.autoScrollInterval=setInterval(this.autoScroll.bind(this))},onMove:function(t,e,n,o){var i=n?n[k].options:o;!n||i.autoScroll?(this.options=i,this.scrollEl=function(t,e){if(!t||!t.getBoundingClientRect)return h();var n=t,o=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=w(n);if(n.clientWidth<n.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!n.getBoundingClientRect||n===document.body)return h();if(o||e)return n;o=!0}}}while(n=n.parentNode);return h()}(t,!0),this.moveEvent=e):this.scrollEl=null},autoScroll:function(){var t=this.options,e=this.moveEvent,n=this.scrollEl,o=t.scrollThreshold,i=t.scrollSpeed;if(n&&void 0!==e.clientX&&void 0!==e.clientY){var r=d(n);if(r){var l=e.clientX,a=e.clientY,s=r.top,c=r.right,u=r.bottom,h=r.left,f=r.height,p=r.width;if(!(a<s||l>c||a>u||l<h)){var v=n.scrollTop,g=n.scrollLeft,m=n.scrollHeight,y=n.scrollWidth;n.scrollLeft+=this.getScrollOffset(l,h,c,o,i.x,g,y,p),n.scrollTop+=this.getScrollOffset(a,s,u,o,i.y,v,m,f)}}}},getScrollOffset:function(t,e,n,o,i,r,l,a){return r>0&&t>=e&&t<=e+o?Math.max(-1,(t-e)/o-1)*i:r+a<l&&t<=n&&t>=n-o?Math.min(1,(t-n)/o+1)*i:0}},_.prototype={collect:function(t){if(t){for(var e=d(t),n=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,o=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,i=Math.min(e.right,n),r=Math.min(e.bottom,o),l=Array.prototype.slice.call(t.children),a=[],s=0,c=l.length;s<c;s++){var u=l[s];if(u!==tt.ghost&&"none"!==w(u,"display")){var h=d(u);if(!(h.bottom<0||h.right<0)){if(0===a.length&&u.previousElementSibling){var f=u.previousElementSibling;do{if(f&&f!==tt.ghost&&"none"!==w(f,"display"))break}while(f=f.previousElementSibling);f&&a.push({el:f,rect:d(f)})}if(h.top-h.height>r||h.left-h.width>i){a.push({el:u,rect:h});break}a.push({el:u,rect:h})}}}this.animationStack.push(a)}},animate:function(t){var e=this,n=this.animationStack.pop(),o=this.options.animation;if(!n||!o)return clearTimeout(this.animationCallbackId),void("function"==typeof t&&t());var i=0;n.forEach(function(t){var n=0,r=t.el,l=d(r),a=t.rect,s=r.prevToRect,c=r.prevFromRect;if(r.animating&&c&&s&&x(a,l)){var u=function(t,e){var n="";if("string"==typeof t)n=t;else do{var o=w(t,"transform");o&&"none"!==o&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}(r,!0);u&&(n=D({top:l.top-u.f,left:l.left-u.e},l)/D(c,s)*o)}x(a,l)||(r.prevFromRect=a,r.prevToRect=l,n||(n=o),e.execute(r,a,l,n)),n&&(i=Math.max(i,n))}),clearTimeout(this.animationCallbackId),i?this.animationCallbackId=setTimeout(function(){"function"==typeof t&&t()},i):"function"==typeof t&&t()},execute:function(t,e,n,o){var i=this.options.easing||"",r=e.left-n.left,l=e.top-n.top;w(t,"transition",""),w(t,"transform","translate3d(".concat(r,"px, ").concat(l,"px, 0)")),this.repaintDummy=function(t){return t.offsetWidth}(t),w(t,"transition","transform ".concat(o,"ms ").concat(i)),w(t,"transform","translate3d(0px, 0px, 0px)"),"number"==typeof t.animating&&clearTimeout(t.animating),t.animating=setTimeout(function(){w(t,"transition",""),w(t,"transform",""),t.prevFromRect=null,t.prevToRect=null,t.animating=null},o)}};var C,M,R,N,A,j,B,P,H,L,F,K,Y,W,X,U,q,V,G,$,J,Q=[];function Z(t){var n,o,i,r={},l=t.group;l&&"object"===e(l)||(l={name:l,pull:!0,put:!0,revertDrag:!0}),r.name=l.name,r.pull=null===(n=l.pull)||void 0===n||n,r.put=null===(o=l.put)||void 0===o||o,r.revertDrag=null===(i=l.revertDrag)||void 0===i||i,t.group=r}function tt(e,n){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable-dnd: `el` must be an HTMLElement, not ".concat({}.toString.call(e));e[k]=this,this.el=e,this.options=n=t({},n);var o={store:null,group:"",handle:null,draggable:">*",sortable:!0,disabled:!1,customGhost:null,lockAxis:"",direction:"",animation:150,easing:"",chosenClass:"",placeholderClass:"",ghostClass:"",ghostStyle:{},ghostContainer:null,appendToBody:!1,autoScroll:!0,scrollThreshold:55,scrollSpeed:{x:10,y:10},delay:0,delayOnTouchOnly:!1,swapOnDrop:!0,removeCloneOnDrop:!0,dropOnAnimationEnd:!1,supportTouch:"ontouchstart"in window,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,emptyInsertThreshold:-1};for(var i in o)!(i in n)&&(n[i]=o[i]);for(var r in Z(n),this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));c(e,n.supportTouch?"touchstart":"mousedown",this._onDrag),this.autoScroller=new z(n),this.animator=new _(n),Q.push(e)}return tt.prototype={constructor:tt,_onDrag:function(t){var e=this,n=this.el,o=this.options,i=o.handle,s=t.touches&&t.touches[0],u=(s||t).target,h=n.ownerDocument;if(!R&&!o.disabled&&o.group.pull&&!(/mousedown|pointerdown/.test(t.type)&&0!==t.button||a&&u&&"SELECT"===u.tagName.toUpperCase())){var d=f(u,o.draggable,n);d&&!d.animating&&(X={event:t,clientX:(s||t).clientX,clientY:(s||t).clientY},R=d,c(V=s?R:document,"mouseup",this._onDrop),c(V,"touchend",this._onDrop),c(V,"touchcancel",this._onDrop),"function"==typeof i&&!i(t)||"string"==typeof i&&!f(u,i,R)||(!o.delay||o.delayOnTouchOnly&&!s||l||r?this._onStart(s,t):(c(h,"touchmove",this._delayedMoveHandler),c(h,"mousemove",this._delayedMoveHandler),c(h,"mouseup",this._cancelStart),c(h,"touchend",this._cancelStart),c(h,"touchcancel",this._cancelStart),this._dragStartTimer=setTimeout(function(){return e._onStart(s,t)},o.delay))))}},_delayedMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-X.clientX),Math.abs(e.clientY-X.clientY))>=Math.floor(this.options.touchStartThreshold/(window.devicePixelRatio||1))&&this._cancelStart()},_cancelStart:function(){var t=this.el.ownerDocument;clearTimeout(this._dragStartTimer),u(t,"touchmove",this._delayedMoveHandler),u(t,"mousemove",this._delayedMoveHandler),u(t,"mouseup",this._cancelStart),u(t,"touchend",this._cancelStart),u(t,"touchcancel",this._cancelStart)},_onStart:function(t,e){T(e);var n=this.el,o=this.options,i=g(R);K=i,Y=i,W=i,C=n,M=n,j=n,H=R,L=R.parentNode,F=o.group.pull,$=R,G={to:n,target:R,newIndex:i,relative:0},B=R.cloneNode(!0),tt.dragged=R,tt.clone=B,tt.active=this,O({sortable:this,name:"onChoose",evt:this._getEventProperties(e)}),b(R,o.chosenClass,!0),c(V,t?"touchmove":"mousemove",this._nearestSortable);try{document.selection?setTimeout(function(){return document.selection.empty()},0):window.getSelection().removeAllRanges()}catch(t){}c(document,"selectstart",T),a&&w(document.body,"user-select","none")},_onStarted:function(){var t=this.options;this.animator.collect(L),this._appendGhost(),b(B,t.chosenClass,!0),b(B,t.placeholderClass,!0),R.parentNode.insertBefore(B,R),w(R,"display","none"),O({sortable:this,name:"onDrag",evt:this._getEventProperties(X.event)}),this.animator.animate(),this.autoScroller.onStarted()},_appendGhost:function(){if(!P){var e=this.options,n=e.appendToBody?document.body:I(e.ghostContainer,this)||this.el,o=I(e.customGhost,B)||B;b(P=o.cloneNode(!0),e.ghostClass,!0);var i=d(R),r=t({position:"fixed",top:i.top,left:i.left,width:i.width,height:i.height,margin:0,zIndex:1e5,opacity:"0.8",overflow:"hidden",boxSizing:"border-box",transform:"",transition:"",pointerEvents:"none"},e.ghostStyle);for(var l in r)w(P,l,r[l]);tt.ghost=P,n.appendChild(P);var a=(X.clientX-i.left)/parseInt(P.style.width)*100,s=(X.clientY-i.top)/parseInt(P.style.height)*100;w(P,"transform-origin","".concat(a,"% ").concat(s,"%")),w(P,"will-change","transform")}},_nearestSortable:function(t){T(t);var e=t.touches&&t.touches[0]||t;if(R&&function(t){var e=U||X;return!(void 0!==t.clientX&&void 0!==t.clientY&&Math.abs(t.clientX-e.clientX)<=0&&Math.abs(t.clientY-e.clientY)<=0)}(e)){!U&&this._onStarted();var n=this.options.lockAxis,o="x"===n?X.clientX:e.clientX,i="y"===n?X.clientY:e.clientY,r=document.elementFromPoint(o,i),l=o-X.clientX,a=i-X.clientY;U={event:t,clientX:o,clientY:i},w(P,"transform","translate3d(".concat(l,"px, ").concat(a,"px, 0)"));var s,c,u,h=(s=o,c=i,Q.reduce(function(t,e){var n=e[k].options.emptyInsertThreshold;if(null!=n){var o=d(e),i=s>=o.left-n&&s<=o.right+n,r=c>=o.top-n&&c<=o.bottom+n;return i&&r&&(!u||u&&o.left>=u.left&&o.right<=u.right&&o.top>=u.top&&o.bottom<=u.bottom)&&(t=e,u=o),t}},null));h&&h[k]._onMove(t,r),this.autoScroller.onMove(r,U,h,this.options)}},_allowPut:function(){var t=this.options.group,e=j[k].options.group;return this.el===j||!!t.put&&(t.put.join&&t.put.indexOf(e.name)>-1||e.name&&t.name&&e.name===t.name)},_getDirection:function(){var t=this.options.draggable,e=this.options.direction;return e?I(e,U.event,B,this):y(L,t)},_allowSwap:function(){var t=d(N),e="vertical"===this._getDirection(),n=e?"top":"left",o=e?"bottom":"right",i=N[e?"offsetHeight":"offsetWidth"],r=e?U.clientY:U.clientX,l=r>=t[n]&&r<t[o]-i/2?-1:1,a=m(L,0,this.options.draggable),s=v(L),c=d(a),u=d(s);if(N===L||p(L,N))return B===a&&r<c[n]?(A=N,!0):B===s&&r>u[o]&&(A=N.nextSibling,!0);var h=E(B,N);return A=h<0?N.nextSibling:N,q!==N?(J=l,!0):J!==l&&(J=l,l<0?h>0:h<0)},_onMove:function(t,e){var n=this.el,o=this.options;if(!o.disabled&&this._allowPut()){if(N=f(e,o.draggable,n),O({sortable:this,name:"onMove",evt:this._getEventProperties(t,{target:N})}),o.sortable||n!==j)return n===M||e!==n&&v(n)?void(N&&!N.animating&&!p(N,B)&&this._allowSwap()&&(N!==B&&A!==B?(n!==M?this._onInsert(t):N!==R&&this._onChange(t),q=N):q=N)):(N=q=null,void this._onInsert(t));M!==j&&(N=q=R,J=0,this._onInsert(t))}},_onInsert:function(t){var e=this.el,n=N||B,o="clone"===F&&e!==j&&M===j,i="clone"===F&&e===j&&M!==j,r=p(N,document),l=N===R&&!r,a=M[k],s=j[k];C=e,K=g(B),H=n,L=r?N.parentNode:e,a.animator.collect(B.parentNode),this.animator.collect(L),o&&(G.target=$,G.newIndex=K,G.relative=$===R?0:E(B,$),w(R,"display",""),s.options.group.revertDrag||B.parentNode.insertBefore(R,B)),i&&(K=g(R),w(R,"display","none")),w(B,"display",l?"none":""),N&&r?L.insertBefore(B,J<0?N:N.nextSibling):L.appendChild(B),Y=l?W:g(B),o&&s.options.group.revertDrag&&(G.target=R,G.newIndex=W,G.relative=0,O({sortable:s,name:"onChange",evt:this._getEventProperties(t,{to:j,target:R,newIndex:W,revertDrag:!0})})),o||O({sortable:a,name:"onRemove",evt:this._getEventProperties(t,{newIndex:-1})}),i&&n!==R&&($=n,O({sortable:this,name:"onChange",evt:this._getEventProperties(t,{from:j,backToOrigin:!0})})),i||O({sortable:this,name:"onAdd",evt:this._getEventProperties(t,{oldIndex:-1})}),a.animator.animate(),this.animator.animate(),M=e},_onChange:function(t){var e=this.el;this.animator.collect(L),K=g(B),L=N.parentNode,H=N,e===j&&($=N),L.insertBefore(B,A),Y=g(B),O({sortable:this,name:"onChange",evt:this._getEventProperties(t)}),this.animator.animate(),M=e},_onDrop:function(t){var e=this,n=this.options;if(this._cancelStart(),u(V,"touchmove",this._nearestSortable),u(V,"mousemove",this._nearestSortable),u(V,"mouseup",this._onDrop),u(V,"touchend",this._onDrop),u(V,"touchcancel",this._onDrop),u(document,"selectstart",T),a&&w(document.body,"user-select",""),P&&P.parentNode&&P.parentNode.removeChild(P),j)if(M=j,K=W,H===B&&(H=R),b(R,n.chosenClass,!1),O({sortable:this,name:"onUnchoose",evt:this._getEventProperties(t)}),U){this.animator.collect(L),b(B,n.chosenClass,!1),b(B,n.placeholderClass,!1);var o=this._getEventProperties(t);!n.dropOnAnimationEnd&&this._onEnd(o),this.animator.animate(function(){n.dropOnAnimationEnd&&e._onEnd(o)})}else this._nulling();else this._nulling()},_onEnd:function(e){var n=this.options,o="clone"===F,i=M===C;o&&!i||!I(n.swapOnDrop,e)||L.insertBefore(R,B),o&&!i||!I(n.removeCloneOnDrop,e)||B&&B.parentNode&&B.parentNode.removeChild(B),w(R,"display",""),M!==C&&O({sortable:M[k],name:"onDrop",evt:t({},e,o?G:{newIndex:-1})}),O({sortable:C[k],name:"onDrop",evt:t({},e,i?{}:{oldIndex:-1})}),this._nulling()},_getEventProperties:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o={};return o.event=e,o.to=C,o.from=M,o.node=R,o.clone=B,o.target=H,o.oldIndex=K,o.newIndex=Y,o.pullMode=F,t(o,n),o.relative=H===R?0:E(B,H),o},_nulling:function(){C=M=R=N=A=j=B=P=H=L=F=K=Y=W=X=U=q=V=G=$=J=tt.clone=tt.ghost=tt.active=tt.dragged=null,this.autoScroller.nulling()},destroy:function(){this._cancelStart(),this._nulling(),u(this.el,"touchstart",this._onDrag),u(this.el,"mousedown",this._onDrag);var t=Q.indexOf(this.el);t>-1&&Q.splice(t,1),this.el[k]=this.animator=this.autoScroller=null},option:function(t,e){if(void 0===e)return this.options[t];this.options[t]=e,this.animator.options[t]=e,this.autoScroller.options[t]=e,"group"===t&&Z(this.options)}},tt.utils={on:c,off:u,css:w,index:g,matches:S,closest:f,getRect:d,toggleClass:b,detectDirection:y},tt.get=function(t){return t[k]},tt.create=function(t,e){return new tt(t,e)},tt}()}(f);var p=d(f.exports);function v(t,e){var n,o=function(){for(var o=this,i=arguments.length,r=new Array(i),l=0;l<i;l++)r[l]=arguments[l];n||(e<=0?t.apply(this,r):n=setTimeout(function(){n=null,t.apply(o,r)},e))};return o.cancel=function(){n&&(clearTimeout(n),n=null)},o}function g(t,e){var n=v(t,e),o=function(){n.cancel();for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];n.apply(this,e)};return o.cancel=function(){n.cancel()},o}function m(t,e){return 0===t&&0===e?1/t==1/e:!(!Number.isNaN(t)||!Number.isNaN(e))||t==e}function y(t,e){return(Array.isArray(e)?e:e.replace(/\[/g,".").replace(/\]/g,".").split(".")).reduce(function(t,e){return(t||{})[e]},t)}function b(t){return t instanceof Document&&9===t.nodeType||t instanceof Window}var S=function(){return l(function t(e){i(this,t),this.options=e;var n={size:0,keeps:0,buffer:0,wrapper:null,scroller:null,direction:"vertical",uniqueKeys:[],debounceTime:null,throttleTime:null};for(var o in n)!(o in this.options)&&(this.options[o]=n[o]);this.option("buffer",e.buffer),this.sizes=new Map,this.sizeType="INIT",this.fixedSize=0,this.averageSize=0,this.range={start:0,end:0,front:0,behind:0},this.offset=0,this.direction="STATIONARY",this.updateScrollElement(),this.updateOnScrollFunction(),this.addScrollEventListener(),this.checkIfUpdate(0,e.keeps-1)},[{key:"isFixed",value:function(){return"FIXED"===this.sizeType}},{key:"isFront",value:function(){return"FRONT"===this.direction}},{key:"isBehind",value:function(){return"BEHIND"===this.direction}},{key:"isHorizontal",value:function(){return"horizontal"===this.options.direction}},{key:"getSize",value:function(t){return this.sizes.get(t)||this.getItemSize()}},{key:"getOffset",value:function(){var t=this.isHorizontal()?"scrollLeft":"scrollTop";return this.scrollEl[t]}},{key:"getScrollSize",value:function(){var t=this.isHorizontal()?"scrollWidth":"scrollHeight";return this.scrollEl[t]}},{key:"getClientSize",value:function(){var t=this.isHorizontal()?"offsetWidth":"offsetHeight";return this.scrollEl[t]}},{key:"scrollToOffset",value:function(t){var e=this.isHorizontal()?"scrollLeft":"scrollTop";this.scrollEl[e]=t}},{key:"scrollToIndex",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top";if(t>=this.options.uniqueKeys.length-1)this.scrollToBottom();else if(t<0)this.scrollToOffset(0);else{var n=this.getOffset(),o=this.getClientSize(),i=this.getSize(this.options.uniqueKeys[t]),r=this.getOffsetByRange(0,t)+this.getScrollStartOffset(),l=r+i;if("auto"===e){if(r>=n&&l<=n+o)return;e=r<n?"top":"bottom"}if("top"===e)this.scrollToOffset(r);else if("bottom"===e){var a=Math.max(0,l-o);this.scrollToOffset(a)}}}},{key:"scrollToBottom",value:function(){var t=this,e=this.getScrollSize();this.scrollToOffset(e),setTimeout(function(){t.isReachedBottom()||t.scrollToBottom()},5)}},{key:"isReachedBottom",value:function(){return this.getOffset()+this.getClientSize()+1>=this.getScrollSize()}},{key:"option",value:function(t,e){var n=this,o=this.options[t];this.options[t]=e,"buffer"===t&&(this.buffer=null==e?Math.round(this.options.keeps/3):e),"uniqueKeys"===t&&this.sizes.forEach(function(t,o){e.includes(o)||n.sizes.delete(o)}),"scroller"===t&&(o&&p.utils.off(o,"scroll",this.onScroll),this.updateScrollElement(),this.addScrollEventListener())}},{key:"updateRange",value:function(t){if(t)this.handleUpdate(t.start);else{var e=this.range.start;e=Math.max(e,0),this.handleUpdate(e)}}},{key:"updateItemSize",value:function(t,e){e&&this.sizes.get(t)!==e&&(this.sizes.set(t,e),"INIT"===this.sizeType?(this.sizeType="FIXED",this.fixedSize=e):this.isFixed()&&this.fixedSize!==e&&(this.sizeType="DYNAMIC",this.fixedSize=0),this.averageSize||"DYNAMIC"!==this.sizeType||this.sizes.size!==this.options.keeps||this.updateAverageSize())}},{key:"updateAverageSize",value:function(){var t=s(this.sizes.values()).reduce(function(t,e){return t+e},0);this.averageSize=Math.round(t/this.sizes.size)}},{key:"addScrollEventListener",value:function(){this.options.scroller&&p.utils.on(this.options.scroller,"scroll",this.onScroll)}},{key:"removeScrollEventListener",value:function(){this.options.scroller&&p.utils.off(this.options.scroller,"scroll",this.onScroll)}},{key:"enableScroll",value:function(t){var e=this.options.scroller,n=t?p.utils.off:p.utils.on,o="onwheel"in document.createElement("div")?"wheel":"mousewheel";n(e,"DOMMouseScroll",this.preventDefault),n(e,o,this.preventDefault),n(e,"touchmove",this.preventDefault),n(e,"keydown",this.preventDefaultForKeyDown)}},{key:"preventDefault",value:function(t){t.preventDefault()}},{key:"preventDefaultForKeyDown",value:function(t){if({37:1,38:1,39:1,40:1}[t.keyCode])return this.preventDefault(t),!1}},{key:"updateScrollElement",value:function(){var t=this.options.scroller;if(b(t)){var e=document.scrollingElement||document.documentElement||document.body;this.scrollEl=e}else this.scrollEl=t}},{key:"updateOnScrollFunction",value:function(){var t=this,e=this.options,n=e.debounceTime,o=e.throttleTime;this.onScroll=n?g(function(){return t.handleScroll()},n):o?v(function(){return t.handleScroll()},o):function(){return t.handleScroll()}}},{key:"handleScroll",value:function(){var t=this.getOffset(),e=this.getClientSize(),n=this.getScrollSize();t===this.offset?this.direction="STATIONARY":this.direction=t<this.offset?"FRONT":"BEHIND",this.offset=t;var o=this.isFront()&&t<=0,i=this.isBehind()&&e+t+1>=n;this.options.onScroll({top:o,bottom:i,offset:t,direction:this.direction}),this.isFront()?this.handleScrollFront():this.isBehind()&&this.handleScrollBehind()}},{key:"handleScrollFront",value:function(){var t=this.getScrollItems();if(!(t>=this.range.start)){var e=Math.max(t-this.buffer,0);this.checkIfUpdate(e,this.getEndByStart(e))}}},{key:"handleScrollBehind",value:function(){var t=this.getScrollItems();t<this.range.start+this.buffer||this.checkIfUpdate(t,this.getEndByStart(t))}},{key:"getScrollItems",value:function(){var t=this.offset-this.getScrollStartOffset();if(t<=0)return 0;if(this.isFixed())return Math.floor(t/this.fixedSize);for(var e=0,n=this.options.uniqueKeys.length,o=0,i=0;e<=n;){if(o=e+Math.floor((n-e)/2),(i=this.getOffsetByRange(0,o))===t)return o;i<t?e=o+1:i>t&&(n=o-1)}return e>0?--e:0}},{key:"checkIfUpdate",value:function(t,e){var n=this.options.keeps;this.options.uniqueKeys.length<=n?t=0:e-t<n-1&&(t=e-n+1),this.range.start!==t&&this.handleUpdate(t)}},{key:"handleUpdate",value:function(t){var e=this.range.start!==t;this.range.start=t,this.range.end=this.getEndByStart(t),this.range.front=this.getFrontOffset(),this.range.behind=this.getBehindOffset(),this.options.onUpdate(Object.assign({},this.range),e)}},{key:"getFrontOffset",value:function(){return this.isFixed()?this.fixedSize*this.range.start:this.getOffsetByRange(0,this.range.start)}},{key:"getBehindOffset",value:function(){var t=this.range.end,e=this.getLastIndex();return this.isFixed()?(e-t)*this.fixedSize:(e-t)*this.getItemSize()}},{key:"getOffsetByRange",value:function(t,e){if(t>=e)return 0;for(var n=0,o=t;o<e;o++){var i=this.sizes.get(this.options.uniqueKeys[o]);n+="number"==typeof i?i:this.getItemSize()}return n}},{key:"getEndByStart",value:function(t){return Math.min(t+this.options.keeps-1,this.getLastIndex())}},{key:"getLastIndex",value:function(){var t=this.options,e=t.uniqueKeys,n=t.keeps;return e.length>0?e.length-1:n-1}},{key:"getItemSize",value:function(){return this.isFixed()?this.fixedSize:this.options.size||this.averageSize}},{key:"getScrollStartOffset",value:function(){var t=this.options,e=t.wrapper,n=t.scroller;if(n===e)return 0;var o=0;if(n&&e){var i=this.isHorizontal()?"left":"top",r=b(n)?p.utils.getRect(e):p.utils.getRect(e,!0,n);o=this.offset+r[i]}return o}}])}(),w=["delay","group","handle","lockAxis","disabled","sortable","draggable","animation","autoScroll","ghostClass","ghostStyle","chosenClass","scrollSpeed","appendToBody","ghostContainer","scrollThreshold","delayOnTouchOnly","placeholderClass","dropOnAnimationEnd"],x=["size","keeps","buffer","scroller","direction","debounceTime","throttleTime"],E=function(){return l(function t(e,n){i(this,t),this.el=e,this.options=n,this.initVirtual(),this.initSortable()},[{key:"destroy",value:function(){this.virtual.removeScrollEventListener(),this.sortable.destroy()}},{key:"option",value:function(t,e){this.options[t]=e,x.includes(t)&&this.virtual.option(t,e),w.includes(t)&&this.sortable.option(t,e)}},{key:"call",value:function(t){if(t in this.virtual){var e=this.virtual[t];if("function"==typeof e){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return e.apply(this.virtual,o)}throw new Error("Property ".concat(String(t)," is not a function on Virtual."))}throw new Error("Method ".concat(String(t)," does not exist on Virtual."))}},{key:"initVirtual",value:function(){var t=this,e=x.reduce(function(e,n){return e[n]=t.options[n],e},{});this.virtual=new S(Object.assign(Object.assign({},e),{wrapper:this.options.wrapper,scroller:this.options.scroller,uniqueKeys:this.options.uniqueKeys,onScroll:function(e){return t.onScroll(e)},onUpdate:function(e,n){return t.onUpdate(e,n)}}))}},{key:"onScroll",value:function(t){this.dispatchEvent("onScroll",t)}},{key:"onUpdate",value:function(t,e){"dragging"===this.sortableState&&e&&(this.removeDraggedEl=!0),this.dispatchEvent("onUpdate",t,e)}},{key:"initSortable",value:function(){var t=this,e=w.reduce(function(e,n){return e[n]=t.options[n],e},{});this.sortable=new p(this.el,Object.assign(Object.assign({},e),{emptyInsertThreshold:0,swapOnDrop:!1,removeCloneOnDrop:function(t){return t.from===t.to},onDrag:function(e){return t.onDrag(e)},onDrop:function(e){return t.onDrop(e)}}))}},{key:"onDrag",value:function(t){this.sortableState="dragging";var e=t.node.getAttribute("data-key"),n=this.getIndex(e);this.sortable.option("store",{key:e,index:n}),this.dispatchEvent("onDrag",{key:e,index:n,event:t})}},{key:"onDrop",value:function(t){var e,n,o=p.get(t.from).option("store"),i=o.key,r=o.index,l={key:i,event:t,changed:!1,oldIndex:r,newIndex:r};if(t.from!==t.to||t.node!==t.target){var a=this.getEventProperties(l,t);Object.assign(l,a)}this.dispatchEvent("onDrop",l),t.from===this.el&&this.removeDraggedEl&&(null===(e=p.dragged)||void 0===e||e.remove()),t.from!==t.to&&(null===(n=p.clone)||void 0===n||n.remove()),this.sortableState="",this.removeDraggedEl=!1}},{key:"getEventProperties",value:function(t,e){var n=t.key,o=t.oldIndex,i=e.target.getAttribute("data-key"),r=-1,l=o;return e.from===e.to?((l=this.getIndex(n))<(r=this.getIndex(i))&&-1===e.relative||l>r&&1===e.relative)&&(r+=e.relative):(e.from===this.el&&(l=this.getIndex(n)),e.to===this.el&&(l=-1,r=this.getIndex(i),0===e.relative?r=this.options.uniqueKeys.length:1===e.relative&&(r+=e.relative))),{changed:e.from!==e.to||r!==l,oldIndex:l,newIndex:r}}},{key:"getIndex",value:function(t){if(null==t)return-1;for(var e=this.options.uniqueKeys,n=0,o=e.length;n<o;n++)if(m(e[n],t))return n;return-1}},{key:"dispatchEvent",value:function(t){if(t in this.options){var e=this.options[t];if("function"==typeof e){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return e.apply(this,o)}}}}])}();function T(t){var e=t.dataKey,o=t.horizontal,i=t.dragging,r=t.children,l=t.onSizeChange,a=n.useRef(null);n.useLayoutEffect(function(){var t;return void 0!==("undefined"==typeof ResizeObserver?"undefined":u(ResizeObserver))&&(t=new ResizeObserver(function(){var t=o?"offsetWidth":"offsetHeight",n=a.current[t];l(e,n)}),a.current&&(null==t||t.observe(a.current))),function(){t&&(t.disconnect(),t=null)}},[a]);var s=n.useMemo(function(){var t=r.props.style||{},n=m(e,i);return Object.assign(Object.assign({},t),{display:n?"none":""})},[i]);return n.cloneElement(r,{"data-key":e,role:"item",ref:a,style:s,className:r.props.className})}var O,I=n.memo(T);function k(t,e){var o=t.dataKey,i=void 0===o?"":o,r=t.dataSource,l=void 0===r?[]:r,u=t.tableMode,h=void 0!==u&&u,d=t.wrapTag,f=void 0===d?"div":d,p=t.rootTag,v=void 0===p?"div":p,b=t.style,S=void 0===b?{}:b,w=t.className,x=void 0===w?"":w,T=t.wrapStyle,k=void 0===T?{}:T,z=t.wrapClass,_=void 0===z?"":z,D=t.size,C=void 0===D?void 0:D,M=t.keeps,R=void 0===M?30:M,N=t.buffer,A=void 0===N?void 0:N,j=t.scroller,B=void 0===j?void 0:j,P=t.direction,H=void 0===P?"vertical":P,L=t.debounceTime,F=void 0===L?0:L,K=t.throttleTime,Y=void 0===K?0:K,W=t.delay,X=void 0===W?0:W,U=t.group,q=void 0===U?"":U,V=t.handle,G=void 0===V?"":V,$=t.lockAxis,J=void 0===$?void 0:$,Q=t.disabled,Z=void 0!==Q&&Q,tt=t.sortable,et=void 0===tt||tt,nt=t.draggable,ot=void 0===nt?'[role="item"]':nt,it=t.animation,rt=void 0===it?150:it,lt=t.autoScroll,at=void 0===lt||lt,st=t.scrollSpeed,ct=void 0===st?{x:10,y:10}:st,ut=t.ghostClass,ht=void 0===ut?"":ut,dt=t.ghostStyle,ft=void 0===dt?void 0:dt,pt=t.chosenClass,vt=void 0===pt?"":pt,gt=t.placeholderClass,mt=void 0===gt?"":gt,yt=t.appendToBody,bt=void 0!==yt&&yt,St=t.scrollThreshold,wt=void 0===St?55:St,xt=t.delayOnTouchOnly,Et=void 0!==xt&&xt,Tt=t.dropOnAnimationEnd,Ot=void 0===Tt||Tt,It=a(n.useState({start:0,end:R-1,front:0,behind:0}),2),kt=It[0],zt=It[1],_t=n.useRef(""),Dt=n.useRef(),Ct=n.useRef(),Mt=function(t){return $t.current.call("getSize",t)},Rt=function(){return $t.current.call("getOffset")},Nt=function(){return $t.current.call("getClientSize")},At=function(){return $t.current.call("getScrollSize")},jt=function(t){$t.current.call("scrollToOffset",t)},Bt=function(t,e){$t.current.call("scrollToIndex",t,e)},Pt=function(t,e){var n=Kt.current.indexOf(t);n>-1&&$t.current.call("scrollToIndex",n,e)},Ht=function(){jt(0)},Lt=function(){$t.current.call("scrollToBottom")};n.useImperativeHandle(e,function(){return{getSize:Mt,getOffset:Rt,getClientSize:Nt,getScrollSize:At,scrollToTop:Ht,scrollToKey:Pt,scrollToIndex:Bt,scrollToOffset:jt,scrollToBottom:Lt}});var Ft=n.useRef([]),Kt=n.useRef([]),Yt=n.useRef(0),Wt=n.useRef(0);n.useEffect(function(){var e;if(Ft.current=l,qt(),Vt(Yt.current,l.length),Wt.current&&t.keepOffset){var n=l.length-Wt.current;n>0&&(null===(e=$t.current)||void 0===e||e.call("scrollToIndex",n)),Wt.current=0}Yt.current=l.length},[l]),n.useEffect(function(){return Qt(),function(){$t.current.destroy()}},[]);var Xt,Ut,qt=function(){var t;Kt.current=Ft.current.map(function(t){return y(t,i)}),null===(t=$t.current)||void 0===t||t.option("uniqueKeys",Kt.current)},Vt=function(t,e){var n,o;if(t!==e){var i=Object.assign({},kt);t>R&&e>t&&i.end===t-1&&(null===(n=$t.current)||void 0===n?void 0:n.call("isReachedBottom"))&&i.start++,null===(o=$t.current)||void 0===o||o.call("updateRange",i)}},Gt=function(e){for(var n=t[e],o=arguments.length,i=new Array(o>1?o-1:0),r=1;r<o;r++)i[r-1]=arguments[r];n&&n.apply(null,i)},$t=n.useRef(),Jt={size:C,keeps:R,buffer:A,scroller:B,direction:H,debounceTime:F,throttleTime:Y,delay:X,group:q,handle:G,lockAxis:J,disabled:Z,sortable:et,draggable:ot,animation:rt,autoScroll:at,ghostClass:ht,ghostStyle:ft,chosenClass:vt,scrollSpeed:ct,appendToBody:bt,scrollThreshold:wt,delayOnTouchOnly:Et,placeholderClass:mt,dropOnAnimationEnd:Ot},Qt=function(){$t.current=new E(Dt.current,Object.assign(Object.assign({},Jt),{wrapper:Ct.current,scroller:B||Dt.current,uniqueKeys:Kt.current,ghostContainer:Ct.current,onDrag:oe,onDrop:ie,onScroll:ee,onUpdate:ne}))};Xt=Jt,Ut=function(){$t.current&&Object.keys(Jt).forEach(function(e){void 0!==t[e]&&$t.current.option(e,t[e])})},n.useEffect(Ut,Object.values(Xt));var Zt=g(function(){Wt.current=Ft.current.length,Gt("onTop")},50),te=g(function(){Gt("onBottom")},50),ee=function(t){Wt.current=0,t.top?Zt():t.bottom&&te()},ne=function(t,e){zt(t),e&&Gt("onRangeChange",t)},oe=function(t){var e,n,o=t.key,i=t.index,r=Ft.current[i];_t.current=o,O=r,et||(null===(e=$t.current)||void 0===e||e.call("enableScroll",!1),null===(n=$t.current)||void 0===n||n.option("autoScroll",!1)),Gt("onDrag",Object.assign(Object.assign({},t),{item:r}))},ie=function(e){var n=O,o=e.oldIndex,i=e.newIndex,r=s(Ft.current),l=s(Ft.current);-1===o?l.splice(i,0,n):-1===i?l.splice(o,1):(l.splice(o,1),l.splice(i,0,n)),$t.current.call("enableScroll",!0),$t.current.option("autoScroll",t.autoScroll),_t.current="",Gt("onDrop",Object.assign(Object.assign({},e),{item:n,list:l,oldList:r}))},re=n.useMemo(function(){var t=kt.front,e=kt.behind,n="horizontal"===H,o=n?"auto hidden":"hidden auto",i=n?"0px ".concat(e,"px 0px ").concat(t,"px"):"".concat(t,"px 0px ").concat(e,"px");return{rootElStyle:Object.assign(Object.assign({},S),{overflow:h||B?"":o}),wrapElStyle:Object.assign(Object.assign({},k),{padding:h?"":i})}},[kt,S,k,B,h,H]),le=re.rootElStyle,ae=re.wrapElStyle,se=n.useMemo(function(){return{rootElTag:h?"table":f,wrapElTag:h?"tbody":f}},[v,f,h]),ce=se.rootElTag,ue=se.wrapElTag,he=function(t){var e=t.list,o=t.start,i=t.end,r=t.dataKey,l=t.horizontal,a=t.dragging,s=t.children,c=t.onSizeChange;return n.useMemo(function(){return e.slice(o,i+1).map(function(t,e){var i=o+e,u=y(t,r);return n.createElement(I,{key:u,dataKey:u,dragging:a,horizontal:l,onSizeChange:c},"function"==typeof s?s(t,i,u):s)})},[e,o,i,r,l,a,s])}({list:l,start:kt.start,end:kt.end,dataKey:i,children:t.children,dragging:_t.current,horizontal:"horizontal"===H,onSizeChange:function(t,e){if(!m(t,_t.current)&&$t.current){var n=$t.current.virtual.sizes.size;$t.current.call("updateItemSize",t,e),n===R-1&&Ft.current.length>R&&$t.current.call("updateRange",kt)}}}),de=function(t,e){var o,i,r,l=(o={padding:0,border:0},i="vertical"===H?"height":"width",r="".concat(t,"px"),(i=c(i))in o?Object.defineProperty(o,i,{value:r,enumerable:!0,configurable:!0,writable:!0}):o[i]=r,o);return n.createElement("tr",{key:e},n.createElement("td",{style:l}))};return n.createElement(ce,{ref:Dt,style:le,className:x},[t.header,n.createElement(ue,{ref:Ct,style:ae,className:_},[h&&de(kt.front,"front")].concat(s(he),[h&&de(kt.behind,"behind")])),t.footer])}return n.forwardRef(k)});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-virtual-sortable",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "A virtual scrolling list component that can be sorted by dragging",
5
5
  "main": "dist/virtual-list.js",
6
6
  "types": "types/index.d.ts",
package/types/index.d.ts CHANGED
@@ -31,8 +31,9 @@ interface VirtualProps<T> {
31
31
  dataSource: T[];
32
32
  children: React.ReactElement | RenderFunc<T>;
33
33
  tableMode?: boolean;
34
- keeps?: number;
35
34
  size?: number;
35
+ keeps?: number;
36
+ buffer?: number;
36
37
  group?: Group | string;
37
38
  handle?: string;
38
39
  lockAxis?: 'x' | 'y';
@@ -53,12 +54,12 @@ interface VirtualProps<T> {
53
54
  delayOnTouchOnly?: boolean;
54
55
  dropOnAnimationEnd?: boolean;
55
56
  rootTag?: string;
56
- style?: CSSStyleDeclaration;
57
+ style?: React.CSSProperties;
57
58
  className?: string;
58
59
  wrapTag?: string;
59
- wrapStyle?: CSSStyleDeclaration;
60
+ wrapStyle?: React.CSSProperties;
60
61
  wrapClass?: string;
61
- ghostStyle?: CSSStyleDeclaration;
62
+ ghostStyle?: React.CSSProperties;
62
63
  ghostClass?: string;
63
64
  chosenClass?: string;
64
65
  placeholderClass?: string;
@@ -84,9 +85,7 @@ interface VirtualComponentRef {
84
85
 
85
86
  declare function VirtualList<T>(props: VirtualProps<T>, ref: React.ForwardedRef<VirtualComponentRef>): React.ReactElement<{
86
87
  ref: React.MutableRefObject<HTMLElement | undefined>;
87
- style: {
88
- overflow: string;
89
- };
88
+ style: React.CSSProperties;
90
89
  className: string;
91
90
  }, string | React.JSXElementConstructor<any>>;
92
91
  declare const _default: <T>(props: VirtualProps<T> & {