drag-list-react
Advanced tools
Comparing version 1.0.4 to 1.0.5
/*! | ||
* drag-list-react v1.0.2 | ||
* drag-list-react v1.0.5 | ||
* (c) 2017 LowesYang | ||
* Released under the MIT License. | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["drag-list-react"]=t():e["drag-list-react"]=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=37)}([function(e,t,n){"use strict";function r(e,t,n,r,i,a,s,u){if(o(t),!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,i,a,s,u],f=0;c=new Error(t.replace(/%s/g,function(){return l[f++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}}var o=function(e){};e.exports=r},function(e,t,n){"use strict";var r=n(5),o=r;e.exports=o},,function(e,t,n){"use strict";function r(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,u=r(e),c=1;c<arguments.length;c++){n=Object(arguments[c]);for(var l in n)i.call(n,l)&&(u[l]=n[l]);if(o){s=o(n);for(var f=0;f<s.length;f++)a.call(n,s[f])&&(u[s[f]]=n[s[f]])}}return u}},,function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},,function(e,t,n){"use strict";function r(e){return void 0!==e.ref}function o(e){return void 0!==e.key}var i=n(3),a=n(8),s=(n(1),n(28),Object.prototype.hasOwnProperty),u=n(26),c={key:!0,ref:!0,__self:!0,__source:!0},l=function(e,t,n,r,o,i,a){var s={$$typeof:u,type:e,key:t,ref:n,props:a,_owner:i};return s};l.createElement=function(e,t,n){var i,u={},f=null,p=null;if(null!=t){r(t)&&(p=t.ref),o(t)&&(f=""+t.key),void 0===t.__self?null:t.__self,void 0===t.__source?null:t.__source;for(i in t)s.call(t,i)&&!c.hasOwnProperty(i)&&(u[i]=t[i])}var d=arguments.length-2;if(1===d)u.children=n;else if(d>1){for(var h=Array(d),m=0;m<d;m++)h[m]=arguments[m+2];u.children=h}if(e&&e.defaultProps){var y=e.defaultProps;for(i in y)void 0===u[i]&&(u[i]=y[i])}return l(e,f,p,0,0,a.current,u)},l.createFactory=function(e){var t=l.createElement.bind(null,e);return t.type=e,t},l.cloneAndReplaceKey=function(e,t){return l(e.type,t,e.ref,e._self,e._source,e._owner,e.props)},l.cloneElement=function(e,t,n){var u,f=i({},e.props),p=e.key,d=e.ref,h=(e._self,e._source,e._owner);if(null!=t){r(t)&&(d=t.ref,h=a.current),o(t)&&(p=""+t.key);var m;e.type&&e.type.defaultProps&&(m=e.type.defaultProps);for(u in t)s.call(t,u)&&!c.hasOwnProperty(u)&&(void 0===t[u]&&void 0!==m?f[u]=m[u]:f[u]=t[u])}var y=arguments.length-2;if(1===y)f.children=n;else if(y>1){for(var v=Array(y),g=0;g<y;g++)v[g]=arguments[g+2];f.children=v}return l(e.type,p,d,0,0,h,f)},l.isValidElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===u},e.exports=l},function(e,t,n){"use strict";var r={current:null};e.exports=r},,,function(e,t,n){"use strict";function r(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);n+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var o=new Error(n);throw o.name="Invariant Violation",o.framesToPop=1,o}e.exports=r},,function(e,t,n){"use strict";var r=n(3),o=n(25),i=n(66),a=n(67),s=n(7),u=n(68),c=n(69),l=n(70),f=n(73),p=s.createElement,d=s.createFactory,h=s.cloneElement,m=r,y=function(e){return e},v={Children:{map:i.map,forEach:i.forEach,count:i.count,toArray:i.toArray,only:f},Component:o.Component,PureComponent:o.PureComponent,createElement:p,cloneElement:h,isValidElement:s.isValidElement,PropTypes:u,createClass:l,createFactory:d,createMixin:y,DOM:a,version:c,__spread:m};e.exports=v},function(e,t,n){"use strict";var r={};e.exports=r},,,,,function(e,t,n){"use strict";e.exports=n(13)},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},,,,,function(e,t,n){"use strict";function r(e,t,n){this.props=e,this.context=t,this.refs=c,this.updater=n||u}function o(e,t,n){this.props=e,this.context=t,this.refs=c,this.updater=n||u}function i(){}var a=n(11),s=n(3),u=n(27),c=(n(28),n(14));n(0),n(72);r.prototype.isReactComponent={},r.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&a("85"),this.updater.enqueueSetState(this,e),t&&this.updater.enqueueCallback(this,t,"setState")},r.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this),e&&this.updater.enqueueCallback(this,e,"forceUpdate")};i.prototype=r.prototype,o.prototype=new i,o.prototype.constructor=o,s(o.prototype,r.prototype),o.prototype.isPureReactComponent=!0,e.exports={Component:r,PureComponent:o}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;e.exports=r},function(e,t,n){"use strict";var r=(n(1),{isMounted:function(e){return!1},enqueueCallback:function(e,t){},enqueueForceUpdate:function(e){},enqueueReplaceState:function(e,t){},enqueueSetState:function(e,t){}});e.exports=r},function(e,t,n){"use strict";var r=!1;e.exports=r},function(e,t){function n(e,t){var n=e[1]||"",o=e[3];if(!o)return n;if(t&&"function"==typeof btoa){var i=r(o);return[n].concat(o.sources.map(function(e){return"/*# sourceURL="+o.sourceRoot+e+" */"})).concat([i]).join("\n")}return[n].join("\n")}function r(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var r=n(t,e);return t[2]?"@media "+t[2]+"{"+r+"}":r}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},o=0;o<this.length;o++){var i=this[o][0];"number"==typeof i&&(r[i]=!0)}for(o=0;o<e.length;o++){var a=e[o];"number"==typeof a[0]&&r[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),t.push(a))}},t}},function(e,t,n){"use strict";var r=n(47);e.exports=function(e){return r(e,!1)}},,,,,,function(e,t,n){function r(e,t){for(var n=0;n<e.length;n++){var r=e[n],o=h[r.id];if(o){o.refs++;for(var i=0;i<o.parts.length;i++)o.parts[i](r.parts[i]);for(;i<r.parts.length;i++)o.parts.push(l(r.parts[i],t))}else{for(var a=[],i=0;i<r.parts.length;i++)a.push(l(r.parts[i],t));h[r.id]={id:r.id,refs:1,parts:a}}}}function o(e){for(var t=[],n={},r=0;r<e.length;r++){var o=e[r],i=o[0],a=o[1],s=o[2],u=o[3],c={css:a,media:s,sourceMap:u};n[i]?n[i].parts.push(c):t.push(n[i]={id:i,parts:[c]})}return t}function i(e,t){var n=y(e.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var r=b[b.length-1];if("top"===e.insertAt)r?r.nextSibling?n.insertBefore(t,r.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),b.push(t);else{if("bottom"!==e.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");n.appendChild(t)}}function a(e){e.parentNode.removeChild(e);var t=b.indexOf(e);t>=0&&b.splice(t,1)}function s(e){var t=document.createElement("style");return e.attrs.type="text/css",c(t,e.attrs),i(e,t),t}function u(e){var t=document.createElement("link");return e.attrs.type="text/css",e.attrs.rel="stylesheet",c(t,e.attrs),i(e,t),t}function c(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}function l(e,t){var n,r,o;if(t.singleton){var i=g++;n=v||(v=s(t)),r=f.bind(null,n,i,!1),o=f.bind(null,n,i,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=u(t),r=d.bind(null,n,t),o=function(){a(n),n.href&&URL.revokeObjectURL(n.href)}):(n=s(t),r=p.bind(null,n),o=function(){a(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}function f(e,t,n,r){var o=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=w(t,o);else{var i=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}function p(e,t){var n=t.css,r=t.media;if(r&&e.setAttribute("media",r),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function d(e,t,n){var r=n.css,o=n.sourceMap,i=void 0===t.convertToAbsoluteUrls&&o;(t.convertToAbsoluteUrls||i)&&(r=E(r)),o&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var a=new Blob([r],{type:"text/css"}),s=e.href;e.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}var h={},m=function(e){var t;return function(){return void 0===t&&(t=e.apply(this,arguments)),t}}(function(){return window&&document&&document.all&&!window.atob}),y=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e.call(this,n)),t[n]}}(function(e){return document.querySelector(e)}),v=null,g=0,b=[],E=n(75);e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");t=t||{},t.attrs="object"==typeof t.attrs?t.attrs:{},void 0===t.singleton&&(t.singleton=m()),void 0===t.insertInto&&(t.insertInto="head"),void 0===t.insertAt&&(t.insertAt="bottom");var n=o(e);return r(n,t),function(e){for(var i=[],a=0;a<n.length;a++){var s=n[a],u=h[s.id];u.refs--,i.push(u)}if(e){r(o(e),t)}for(var a=0;a<i.length;a++){var u=i[a];if(0===u.refs){for(var c=0;c<u.parts.length;c++)u.parts[c]();delete h[u.id]}}}};var w=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(19),l=r(c),f=n(40),p=r(f),d=n(39),h=n(38),m=n(41),y=(r(m),function(e,t){var n,r;return r=n=function(n){function r(e){o(this,r);var t=i(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.checkLongPress=function(){return!t.props.isLongPress||t.isLongPress},t.longPress=function(e){if(0===e.button){t.mousePos=t.isInline?e.pageX:e.pageY;var n=e.target;t.props.isLongPress?(clearTimeout(t.setTime),t.setTime=setTimeout(t.dragBegin.bind(t,n),t.props.delay||300),t.isLongPress=!0):t.dragBegin(n)}},t.dragBegin=function(e){if(t.checkLongPress()&&!t.isDragBegin){var n=(0,d.getListContainer)(e,h.DRAG_CONTAINER);if(t._container===n&&(t.currDragItem=(0,d.getElement)(e,t._container,h.ITEM_CAN_DRAG),t.currDragItem)){t.isDragBegin=!0;var r=t.state.list,o=t.currDragItem,i=o.el,a=o.ind;t.beginPos=t.isInline?i.offsetLeft:i.offsetTop;var s=i.cloneNode(!0);s.className+=" "+h.FLOAT_DRAG_ITEM,s.style.width=i.offsetWidth+1+"px",t.isInline?s.style.left=t.beginPos+"px":s.style.top=t.beginPos+"px",t._container.appendChild(s),t.floatEl=s,t.currDragItem.item=r[a],r[a]={id:Date.now(),type:"placeholder"},t.setState({list:r},function(){t.props.onDragBegin&&t.props.onDragBegin(t.currDragItem.item,t.currDragItem.ind,t.currDragItem.el)})}}},t.getItemRectInfo=function(e){var n=e.getBoundingClientRect();return{itemOffset:t.isInline?n.left:n.top,itemSize:t.isInline?e.offsetWidth:e.offsetHeight}},t.dragging=function(e){if(e.stopPropagation(),t.checkLongPress()&&t.isDragBegin&&0===e.button){(0,d.disabledSelection)();var n=t.currDragItem.ind,r=t.isInline?e.pageX:e.pageY,o=r-t.mousePos,i=t.isInline?e.clientX:e.clientY;t.isInline?t.floatEl.style.left=t.beginPos+o+"px":t.floatEl.style.top=t.beginPos+o+"px";for(var a=t._container.childNodes,s=t.state.list,u=0;u<a.length;u++){var c=a[u];if(!(c.className&&c.className.indexOf(h.FLOAT_DRAG_ITEM)>=0)){var l=t.getItemRectInfo(c),f=l.itemOffset,p=l.itemSize;if(i>f&&i<f+p){var m=[s[u],s[n]];s[n]=m[0],s[u]=m[1],n=t.currDragItem.ind=u,t.setState({list:s});break}}}}},t.dragEnd=function(e){if(e.stopPropagation(),t.checkLongPress()&&0===e.button&&(t.isLongPress=!1,t.isDragBegin=!1,t.currDragItem)){var n=t.state.list,r=t.currDragItem,o=r.ind,i=r.item;n[o]=i,t.setState({list:n},function(){t.props.onDragEnd&&t.props.onDragEnd(n)}),t._container.removeChild(t.floatEl),t.currDragItem=null,t.floatEl=null}},t.state={list:e.list},t.isInline=(0,d.isInline)(t.props.type),t.isDragBegin=!1,t.isLongPress=!1,t._container=null,t.currDragItem=null,t.floatEl=null,t.setTime=null,t}return a(r,n),u(r,[{key:"componentDidMount",value:function(){window.addEventListener?(window.addEventListener("mousemove",this.dragging),window.addEventListener("touchmove",this.dragging),window.addEventListener("mouseup",this.dragEnd),window.addEventListener("mouseleave",this.dragEnd),window.addEventListener("touchend",this.dragEnd)):(window.attachEvent("onmousemove",this.dragging),window.attachEvent("ontouchmove",this.dragging),window.attachEvent("onmouseup",this.dragEnd),window.attachEvent("onmouseleave",this.dragEnd),window.attachEvent("ontouchend",this.dragEnd)),this.isInline&&(this._container.style.cssText+="\n display:flex;\n flex-direction:row;\n ")}},{key:"componentWillUnMount",value:function(){window.removeEventListener?(window.removeEventListener("mousemove",this.dragging),window.removeEventListener("mouseup",this.dragEnd),window.removeEventListener("mouseleave",this.dragEnd),window.removeEventListener("ontouchmove",this.dragging),window.removeEventListener("ontouchend",this.dragEnd)):(window.detachEvent("onmousemove",this.dragging),window.detachEvent("onmouseup",this.dragEnd),window.detachEvent("onmouseleave",this.dragEnd),window.detachEvent("ontouchmove",this.dragging),window.detachEvent("ontouchend",this.dragEnd))}},{key:"render",value:function(){var n=this,r=this.props.gutter,o={margin:r+"px"},i=this.state.list.map(function(r,i){if("placeholder"===r.type){var a=Object.assign({},o,{width:n.floatEl.offsetWidth,flex:"1 0 "+n.floatEl.offsetWidth+"px",height:n.floatEl.offsetHeight});return t?l.default.createElement(t,{key:r.id,style:a}):l.default.createElement("div",{key:r.id,style:a})}return l.default.createElement("div",{key:r.id,className:h.ITEM_CAN_DRAG,style:o},l.default.createElement(e,s({parentId:r.id},n.props,r)))});return l.default.createElement("div",{className:(this.props.className||"")+" "+h.DRAG_CONTAINER,style:this.props.style,onMouseDown:this.longPress,ref:function(e){return n._container=e}},i)}}]),r}(c.Component),n.PropTypes={list:p.default.array.isRequired,type:p.default.string,isLongPress:p.default.bool,delay:p.default.number,gutter:p.default.number,onDragBegin:p.default.func,onDragEnd:p.default.func},r});t.default=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.DRAG_CONTAINER="lowes-drag-list",t.ITEM_CAN_DRAG="lowes-can-drag",t.FLOAT_DRAG_ITEM="lowes-drag-item"},function(e,t,n){"use strict";function r(e,t){for(e=e.parentNode;e&&!(e.className&&e.className.indexOf(t)>=0);)e=e.parentNode;return e}function o(e,t,n){for(e=e.parentNode;e&&!(e.className&&e.className.indexOf(n)>=0);)e=e.parentNode;return e?{el:e,ind:Array.prototype.indexOf.call(t.childNodes,e)}:null}function i(){window.getSelection?window.getSelection().removeAllRanges():document.selection.empty()}function a(e){return"inline"===e}Object.defineProperty(t,"__esModule",{value:!0}),t.getListContainer=r,t.getElement=o,t.disabledSelection=i,t.isInline=a},function(e,t,n){e.exports=n(46)()},function(e,t,n){var r=n(43);"string"==typeof r&&(r=[[e.i,r,""]]);n(36)(r,{});r.locals&&(e.exports=r.locals)},function(e,t,n){"use strict";function r(e){return e}function o(e,t,n){function o(e,t){var n=g.hasOwnProperty(t)?g[t]:null;x.hasOwnProperty(t)&&s("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&s("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function c(e,n){if(n){s("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),s(!t(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,i=r.__reactAutoBindPairs;n.hasOwnProperty(u)&&b.mixins(e,n.mixins);for(var a in n)if(n.hasOwnProperty(a)&&a!==u){var c=n[a],l=r.hasOwnProperty(a);if(o(l,a),b.hasOwnProperty(a))b[a](e,c);else{var f=g.hasOwnProperty(a),h="function"==typeof c,m=h&&!f&&!l&&!1!==n.autobind;if(m)i.push(a,c),r[a]=c;else if(l){var y=g[a];s(f&&("DEFINE_MANY_MERGED"===y||"DEFINE_MANY"===y),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",y,a),"DEFINE_MANY_MERGED"===y?r[a]=p(r[a],c):"DEFINE_MANY"===y&&(r[a]=d(r[a],c))}else r[a]=c}}}else;}function l(e,t){if(t)for(var n in t){var r=t[n];if(t.hasOwnProperty(n)){var o=n in b;s(!o,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n);var i=n in e;s(!i,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),e[n]=r}}}function f(e,t){s(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var n in t)t.hasOwnProperty(n)&&(s(void 0===e[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),e[n]=t[n]);return e}function p(e,t){return function(){var n=e.apply(this,arguments),r=t.apply(this,arguments);if(null==n)return r;if(null==r)return n;var o={};return f(o,n),f(o,r),o}}function d(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function h(e,t){var n=t.bind(e);return n}function m(e){for(var t=e.__reactAutoBindPairs,n=0;n<t.length;n+=2){var r=t[n],o=t[n+1];e[r]=h(e,o)}}function y(e){var t=r(function(e,r,o){this.__reactAutoBindPairs.length&&m(this),this.props=e,this.context=r,this.refs=a,this.updater=o||n,this.state=null;var i=this.getInitialState?this.getInitialState():null;s("object"==typeof i&&!Array.isArray(i),"%s.getInitialState(): must return an object or null",t.displayName||"ReactCompositeComponent"),this.state=i});t.prototype=new P,t.prototype.constructor=t,t.prototype.__reactAutoBindPairs=[],v.forEach(c.bind(null,t)),c(t,E),c(t,e),c(t,w),t.getDefaultProps&&(t.defaultProps=t.getDefaultProps()),s(t.prototype.render,"createClass(...): Class specification must implement a `render` method.");for(var o in g)t.prototype[o]||(t.prototype[o]=null);return t}var v=[],g={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},b={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n<t.length;n++)c(e,t[n])},childContextTypes:function(e,t){e.childContextTypes=i({},e.childContextTypes,t)},contextTypes:function(e,t){e.contextTypes=i({},e.contextTypes,t)},getDefaultProps:function(e,t){e.getDefaultProps?e.getDefaultProps=p(e.getDefaultProps,t):e.getDefaultProps=t},propTypes:function(e,t){e.propTypes=i({},e.propTypes,t)},statics:function(e,t){l(e,t)},autobind:function(){}},E={componentDidMount:function(){this.__isMounted=!0}},w={componentWillUnmount:function(){this.__isMounted=!1}},x={replaceState:function(e,t){this.updater.enqueueReplaceState(this,e,t)},isMounted:function(){return!!this.__isMounted}},P=function(){};return i(P.prototype,e.prototype,x),y}var i=n(3),a=n(14),s=n(0),u="mixins";e.exports=o},function(e,t,n){t=e.exports=n(29)(void 0),t.push([e.i,".lowes-drag-list {\r\n position: relative;\r\n}\r\n\r\n.lowes-drag-item {\r\n position: absolute;\r\n z-index:2000;\r\n -webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);\r\n -moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);\r\n box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);\r\n -webkit-transform: translateX(20px);\r\n -moz-transform: translateX(20px);\r\n -ms-transform: translateX(20px);\r\n -o-transform: translateX(20px);\r\n transform: translateX(20px);\r\n}\r\n",""])},,function(e,t,n){"use strict";function r(e,t,n,r,o){}e.exports=r},function(e,t,n){"use strict";var r=n(5),o=n(0),i=n(20);e.exports=function(){function e(e,t,n,r,a,s){s!==i&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";var r=n(5),o=n(0),i=n(1),a=n(20),s=n(45);e.exports=function(e,t){function n(e){var t=e&&(_&&e[_]||e[I]);if("function"==typeof t)return t}function u(e,t){return e===t?0!==e||1/e==1/t:e!==e&&t!==t}function c(e){this.message=e,this.stack=""}function l(e){function n(n,r,i,s,u,l,f){if(s=s||O,l=l||i,f!==a)if(t)o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");else;return null==r[i]?n?new c(null===r[i]?"The "+u+" `"+l+"` is marked as required in `"+s+"`, but its value is `null`.":"The "+u+" `"+l+"` is marked as required in `"+s+"`, but its value is `undefined`."):null:e(r,i,s,u,l)}var r=n.bind(null,!1);return r.isRequired=n.bind(null,!0),r}function f(e){function t(t,n,r,o,i,a){var s=t[n];if(E(s)!==e)return new c("Invalid "+o+" `"+i+"` of type `"+w(s)+"` supplied to `"+r+"`, expected `"+e+"`.");return null}return l(t)}function p(e){function t(t,n,r,o,i){if("function"!=typeof e)return new c("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var s=t[n];if(!Array.isArray(s)){return new c("Invalid "+o+" `"+i+"` of type `"+E(s)+"` supplied to `"+r+"`, expected an array.")}for(var u=0;u<s.length;u++){var l=e(s,u,r,o,i+"["+u+"]",a);if(l instanceof Error)return l}return null}return l(t)}function d(e){function t(t,n,r,o,i){if(!(t[n]instanceof e)){var a=e.name||O;return new c("Invalid "+o+" `"+i+"` of type `"+P(t[n])+"` supplied to `"+r+"`, expected instance of `"+a+"`.")}return null}return l(t)}function h(e){function t(t,n,r,o,i){for(var a=t[n],s=0;s<e.length;s++)if(u(a,e[s]))return null;return new c("Invalid "+o+" `"+i+"` of value `"+a+"` supplied to `"+r+"`, expected one of "+JSON.stringify(e)+".")}return Array.isArray(e)?l(t):r.thatReturnsNull}function m(e){function t(t,n,r,o,i){if("function"!=typeof e)return new c("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var s=t[n],u=E(s);if("object"!==u)return new c("Invalid "+o+" `"+i+"` of type `"+u+"` supplied to `"+r+"`, expected an object.");for(var l in s)if(s.hasOwnProperty(l)){var f=e(s,l,r,o,i+"."+l,a);if(f instanceof Error)return f}return null}return l(t)}function y(e){function t(t,n,r,o,i){for(var s=0;s<e.length;s++){if(null==(0,e[s])(t,n,r,o,i,a))return null}return new c("Invalid "+o+" `"+i+"` supplied to `"+r+"`.")}if(!Array.isArray(e))return r.thatReturnsNull;for(var n=0;n<e.length;n++){var o=e[n];if("function"!=typeof o)return i(!1,"Invalid argument supplid to oneOfType. Expected an array of check functions, but received %s at index %s.",x(o),n),r.thatReturnsNull}return l(t)}function v(e){function t(t,n,r,o,i){var s=t[n],u=E(s);if("object"!==u)return new c("Invalid "+o+" `"+i+"` of type `"+u+"` supplied to `"+r+"`, expected `object`.");for(var l in e){var f=e[l];if(f){var p=f(s,l,r,o,i+"."+l,a);if(p)return p}}return null}return l(t)}function g(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(g);if(null===t||e(t))return!0;var r=n(t);if(!r)return!1;var o,i=r.call(t);if(r!==t.entries){for(;!(o=i.next()).done;)if(!g(o.value))return!1}else for(;!(o=i.next()).done;){var a=o.value;if(a&&!g(a[1]))return!1}return!0;default:return!1}}function b(e,t){return"symbol"===e||("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}function E(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":b(t,e)?"symbol":t}function w(e){if(void 0===e||null===e)return""+e;var t=E(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function x(e){var t=w(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}function P(e){return e.constructor&&e.constructor.name?e.constructor.name:O}var _="function"==typeof Symbol&&Symbol.iterator,I="@@iterator",O="<<anonymous>>",N={array:f("array"),bool:f("boolean"),func:f("function"),number:f("number"),object:f("object"),string:f("string"),symbol:f("symbol"),any:function(){return l(r.thatReturnsNull)}(),arrayOf:p,element:function(){function t(t,n,r,o,i){var a=t[n];if(!e(a)){return new c("Invalid "+o+" `"+i+"` of type `"+E(a)+"` supplied to `"+r+"`, expected a single ReactElement.")}return null}return l(t)}(),instanceOf:d,node:function(){function e(e,t,n,r,o){return g(e[t])?null:new c("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}return l(e)}(),objectOf:m,oneOf:h,oneOfType:y,shape:v};return c.prototype=Error.prototype,N.checkPropTypes=s,N.PropTypes=N,N}},,,,,,,,,,,,,,,,,function(e,t,n){"use strict";function r(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})}function o(e){var t=/(=0|=2)/g,n={"=0":"=","=2":":"};return(""+("."===e[0]&&"$"===e[1]?e.substring(2):e.substring(1))).replace(t,function(e){return n[e]})}var i={escape:r,unescape:o};e.exports=i},function(e,t,n){"use strict";var r=n(11),o=(n(0),function(e){var t=this;if(t.instancePool.length){var n=t.instancePool.pop();return t.call(n,e),n}return new t(e)}),i=function(e,t){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,e,t),r}return new n(e,t)},a=function(e,t,n){var r=this;if(r.instancePool.length){var o=r.instancePool.pop();return r.call(o,e,t,n),o}return new r(e,t,n)},s=function(e,t,n,r){var o=this;if(o.instancePool.length){var i=o.instancePool.pop();return o.call(i,e,t,n,r),i}return new o(e,t,n,r)},u=function(e){var t=this;e instanceof t||r("25"),e.destructor(),t.instancePool.length<t.poolSize&&t.instancePool.push(e)},c=o,l=function(e,t){var n=e;return n.instancePool=[],n.getPooled=t||c,n.poolSize||(n.poolSize=10),n.release=u,n},f={addPoolingTo:l,oneArgumentPooler:o,twoArgumentPooler:i,threeArgumentPooler:a,fourArgumentPooler:s};e.exports=f},function(e,t,n){"use strict";function r(e){return(""+e).replace(E,"$&/")}function o(e,t){this.func=e,this.context=t,this.count=0}function i(e,t,n){var r=e.func,o=e.context;r.call(o,t,e.count++)}function a(e,t,n){if(null==e)return e;var r=o.getPooled(t,n);v(e,i,r),o.release(r)}function s(e,t,n,r){this.result=e,this.keyPrefix=t,this.func=n,this.context=r,this.count=0}function u(e,t,n){var o=e.result,i=e.keyPrefix,a=e.func,s=e.context,u=a.call(s,t,e.count++);Array.isArray(u)?c(u,o,n,y.thatReturnsArgument):null!=u&&(m.isValidElement(u)&&(u=m.cloneAndReplaceKey(u,i+(!u.key||t&&t.key===u.key?"":r(u.key)+"/")+n)),o.push(u))}function c(e,t,n,o,i){var a="";null!=n&&(a=r(n)+"/");var c=s.getPooled(t,a,o,i);v(e,u,c),s.release(c)}function l(e,t,n){if(null==e)return e;var r=[];return c(e,r,null,t,n),r}function f(e,t,n){return null}function p(e,t){return v(e,f,null)}function d(e){var t=[];return c(e,t,null,y.thatReturnsArgument),t}var h=n(65),m=n(7),y=n(5),v=n(74),g=h.twoArgumentPooler,b=h.fourArgumentPooler,E=/\/+/g;o.prototype.destructor=function(){this.func=null,this.context=null,this.count=0},h.addPoolingTo(o,g),s.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},h.addPoolingTo(s,b);var w={forEach:a,map:l,mapIntoWithKeyPrefixInternal:c,count:p,toArray:d};e.exports=w},function(e,t,n){"use strict";var r=n(7),o=r.createFactory,i={a:o("a"),abbr:o("abbr"),address:o("address"),area:o("area"),article:o("article"),aside:o("aside"),audio:o("audio"),b:o("b"),base:o("base"),bdi:o("bdi"),bdo:o("bdo"),big:o("big"),blockquote:o("blockquote"),body:o("body"),br:o("br"),button:o("button"),canvas:o("canvas"),caption:o("caption"),cite:o("cite"),code:o("code"),col:o("col"),colgroup:o("colgroup"),data:o("data"),datalist:o("datalist"),dd:o("dd"),del:o("del"),details:o("details"),dfn:o("dfn"),dialog:o("dialog"),div:o("div"),dl:o("dl"),dt:o("dt"),em:o("em"),embed:o("embed"),fieldset:o("fieldset"),figcaption:o("figcaption"),figure:o("figure"),footer:o("footer"),form:o("form"),h1:o("h1"),h2:o("h2"),h3:o("h3"),h4:o("h4"),h5:o("h5"),h6:o("h6"),head:o("head"),header:o("header"),hgroup:o("hgroup"),hr:o("hr"),html:o("html"),i:o("i"),iframe:o("iframe"),img:o("img"),input:o("input"),ins:o("ins"),kbd:o("kbd"),keygen:o("keygen"),label:o("label"),legend:o("legend"),li:o("li"),link:o("link"),main:o("main"),map:o("map"),mark:o("mark"),menu:o("menu"),menuitem:o("menuitem"),meta:o("meta"),meter:o("meter"),nav:o("nav"),noscript:o("noscript"),object:o("object"),ol:o("ol"),optgroup:o("optgroup"),option:o("option"),output:o("output"),p:o("p"),param:o("param"),picture:o("picture"),pre:o("pre"),progress:o("progress"),q:o("q"),rp:o("rp"),rt:o("rt"),ruby:o("ruby"),s:o("s"),samp:o("samp"),script:o("script"),section:o("section"),select:o("select"),small:o("small"),source:o("source"),span:o("span"),strong:o("strong"),style:o("style"),sub:o("sub"),summary:o("summary"),sup:o("sup"),table:o("table"),tbody:o("tbody"),td:o("td"),textarea:o("textarea"),tfoot:o("tfoot"),th:o("th"),thead:o("thead"),time:o("time"),title:o("title"),tr:o("tr"),track:o("track"),u:o("u"),ul:o("ul"),var:o("var"),video:o("video"),wbr:o("wbr"),circle:o("circle"),clipPath:o("clipPath"),defs:o("defs"),ellipse:o("ellipse"),g:o("g"),image:o("image"),line:o("line"),linearGradient:o("linearGradient"),mask:o("mask"),path:o("path"),pattern:o("pattern"),polygon:o("polygon"),polyline:o("polyline"),radialGradient:o("radialGradient"),rect:o("rect"),stop:o("stop"),svg:o("svg"),text:o("text"),tspan:o("tspan")};e.exports=i},function(e,t,n){"use strict";var r=n(7),o=r.isValidElement,i=n(30);e.exports=i(o)},function(e,t,n){"use strict";e.exports="15.6.1"},function(e,t,n){"use strict";var r=n(25),o=r.Component,i=n(7),a=i.isValidElement,s=n(27),u=n(42);e.exports=u(o,a,s)},function(e,t,n){"use strict";function r(e){var t=e&&(o&&e[o]||e[i]);if("function"==typeof t)return t}var o="function"==typeof Symbol&&Symbol.iterator,i="@@iterator";e.exports=r},function(e,t,n){"use strict";var r=function(){};e.exports=r},function(e,t,n){"use strict";function r(e){return i.isValidElement(e)||o("143"),e}var o=n(11),i=n(7);n(0);e.exports=r},function(e,t,n){"use strict";function r(e,t){return e&&"object"==typeof e&&null!=e.key?c.escape(e.key):t.toString(36)}function o(e,t,n,i){var p=typeof e;if("undefined"!==p&&"boolean"!==p||(e=null),null===e||"string"===p||"number"===p||"object"===p&&e.$$typeof===s)return n(i,e,""===t?l+r(e,0):t),1;var d,h,m=0,y=""===t?l:t+f;if(Array.isArray(e))for(var v=0;v<e.length;v++)d=e[v],h=y+r(d,v),m+=o(d,h,n,i);else{var g=u(e);if(g){var b,E=g.call(e);if(g!==e.entries)for(var w=0;!(b=E.next()).done;)d=b.value,h=y+r(d,w++),m+=o(d,h,n,i);else for(;!(b=E.next()).done;){var x=b.value;x&&(d=x[1],h=y+c.escape(x[0])+f+r(d,0),m+=o(d,h,n,i))}}else if("object"===p){var P="",_=String(e);a("31","[object Object]"===_?"object with keys {"+Object.keys(e).join(", ")+"}":_,P)}}return m}function i(e,t,n){return null==e?0:o(e,"",t,n)}var a=n(11),s=(n(8),n(26)),u=n(71),c=(n(0),n(64)),l=(n(1),"."),f=":";e.exports=i},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,r=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(e,t){var o=t.trim().replace(/^"(.*)"$/,function(e,t){return t}).replace(/^'(.*)'$/,function(e,t){return t});if(/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(o))return e;var i;return i=0===o.indexOf("//")?o:0===o.indexOf("/")?n+o:r+o.replace(/^\.\//,""),"url("+JSON.stringify(i)+")"})}}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["drag-list-react"]=t():e["drag-list-react"]=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=37)}([function(e,t,n){"use strict";function r(e,t,n,r,i,a,s,u){if(o(t),!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,i,a,s,u],f=0;c=new Error(t.replace(/%s/g,function(){return l[f++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}}var o=function(e){};e.exports=r},function(e,t,n){"use strict";var r=n(5),o=r;e.exports=o},,function(e,t,n){"use strict";function r(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,u=r(e),c=1;c<arguments.length;c++){n=Object(arguments[c]);for(var l in n)i.call(n,l)&&(u[l]=n[l]);if(o){s=o(n);for(var f=0;f<s.length;f++)a.call(n,s[f])&&(u[s[f]]=n[s[f]])}}return u}},,function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},,function(e,t,n){"use strict";function r(e){return void 0!==e.ref}function o(e){return void 0!==e.key}var i=n(3),a=n(8),s=(n(1),n(28),Object.prototype.hasOwnProperty),u=n(26),c={key:!0,ref:!0,__self:!0,__source:!0},l=function(e,t,n,r,o,i,a){var s={$$typeof:u,type:e,key:t,ref:n,props:a,_owner:i};return s};l.createElement=function(e,t,n){var i,u={},f=null,p=null;if(null!=t){r(t)&&(p=t.ref),o(t)&&(f=""+t.key),void 0===t.__self?null:t.__self,void 0===t.__source?null:t.__source;for(i in t)s.call(t,i)&&!c.hasOwnProperty(i)&&(u[i]=t[i])}var d=arguments.length-2;if(1===d)u.children=n;else if(d>1){for(var h=Array(d),m=0;m<d;m++)h[m]=arguments[m+2];u.children=h}if(e&&e.defaultProps){var y=e.defaultProps;for(i in y)void 0===u[i]&&(u[i]=y[i])}return l(e,f,p,0,0,a.current,u)},l.createFactory=function(e){var t=l.createElement.bind(null,e);return t.type=e,t},l.cloneAndReplaceKey=function(e,t){return l(e.type,t,e.ref,e._self,e._source,e._owner,e.props)},l.cloneElement=function(e,t,n){var u,f=i({},e.props),p=e.key,d=e.ref,h=(e._self,e._source,e._owner);if(null!=t){r(t)&&(d=t.ref,h=a.current),o(t)&&(p=""+t.key);var m;e.type&&e.type.defaultProps&&(m=e.type.defaultProps);for(u in t)s.call(t,u)&&!c.hasOwnProperty(u)&&(void 0===t[u]&&void 0!==m?f[u]=m[u]:f[u]=t[u])}var y=arguments.length-2;if(1===y)f.children=n;else if(y>1){for(var v=Array(y),g=0;g<y;g++)v[g]=arguments[g+2];f.children=v}return l(e.type,p,d,0,0,h,f)},l.isValidElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===u},e.exports=l},function(e,t,n){"use strict";var r={current:null};e.exports=r},,,function(e,t,n){"use strict";function r(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);n+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var o=new Error(n);throw o.name="Invariant Violation",o.framesToPop=1,o}e.exports=r},,function(e,t,n){"use strict";var r=n(3),o=n(25),i=n(66),a=n(67),s=n(7),u=n(68),c=n(69),l=n(70),f=n(73),p=s.createElement,d=s.createFactory,h=s.cloneElement,m=r,y=function(e){return e},v={Children:{map:i.map,forEach:i.forEach,count:i.count,toArray:i.toArray,only:f},Component:o.Component,PureComponent:o.PureComponent,createElement:p,cloneElement:h,isValidElement:s.isValidElement,PropTypes:u,createClass:l,createFactory:d,createMixin:y,DOM:a,version:c,__spread:m};e.exports=v},function(e,t,n){"use strict";var r={};e.exports=r},,,,,function(e,t,n){"use strict";e.exports=n(13)},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},,,,,function(e,t,n){"use strict";function r(e,t,n){this.props=e,this.context=t,this.refs=c,this.updater=n||u}function o(e,t,n){this.props=e,this.context=t,this.refs=c,this.updater=n||u}function i(){}var a=n(11),s=n(3),u=n(27),c=(n(28),n(14));n(0),n(72);r.prototype.isReactComponent={},r.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&a("85"),this.updater.enqueueSetState(this,e),t&&this.updater.enqueueCallback(this,t,"setState")},r.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this),e&&this.updater.enqueueCallback(this,e,"forceUpdate")};i.prototype=r.prototype,o.prototype=new i,o.prototype.constructor=o,s(o.prototype,r.prototype),o.prototype.isPureReactComponent=!0,e.exports={Component:r,PureComponent:o}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;e.exports=r},function(e,t,n){"use strict";var r=(n(1),{isMounted:function(e){return!1},enqueueCallback:function(e,t){},enqueueForceUpdate:function(e){},enqueueReplaceState:function(e,t){},enqueueSetState:function(e,t){}});e.exports=r},function(e,t,n){"use strict";var r=!1;e.exports=r},function(e,t){function n(e,t){var n=e[1]||"",o=e[3];if(!o)return n;if(t&&"function"==typeof btoa){var i=r(o);return[n].concat(o.sources.map(function(e){return"/*# sourceURL="+o.sourceRoot+e+" */"})).concat([i]).join("\n")}return[n].join("\n")}function r(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var r=n(t,e);return t[2]?"@media "+t[2]+"{"+r+"}":r}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},o=0;o<this.length;o++){var i=this[o][0];"number"==typeof i&&(r[i]=!0)}for(o=0;o<e.length;o++){var a=e[o];"number"==typeof a[0]&&r[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),t.push(a))}},t}},function(e,t,n){"use strict";var r=n(47);e.exports=function(e){return r(e,!1)}},,,,,,function(e,t,n){function r(e,t){for(var n=0;n<e.length;n++){var r=e[n],o=h[r.id];if(o){o.refs++;for(var i=0;i<o.parts.length;i++)o.parts[i](r.parts[i]);for(;i<r.parts.length;i++)o.parts.push(l(r.parts[i],t))}else{for(var a=[],i=0;i<r.parts.length;i++)a.push(l(r.parts[i],t));h[r.id]={id:r.id,refs:1,parts:a}}}}function o(e){for(var t=[],n={},r=0;r<e.length;r++){var o=e[r],i=o[0],a=o[1],s=o[2],u=o[3],c={css:a,media:s,sourceMap:u};n[i]?n[i].parts.push(c):t.push(n[i]={id:i,parts:[c]})}return t}function i(e,t){var n=y(e.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var r=b[b.length-1];if("top"===e.insertAt)r?r.nextSibling?n.insertBefore(t,r.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),b.push(t);else{if("bottom"!==e.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");n.appendChild(t)}}function a(e){e.parentNode.removeChild(e);var t=b.indexOf(e);t>=0&&b.splice(t,1)}function s(e){var t=document.createElement("style");return e.attrs.type="text/css",c(t,e.attrs),i(e,t),t}function u(e){var t=document.createElement("link");return e.attrs.type="text/css",e.attrs.rel="stylesheet",c(t,e.attrs),i(e,t),t}function c(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}function l(e,t){var n,r,o;if(t.singleton){var i=g++;n=v||(v=s(t)),r=f.bind(null,n,i,!1),o=f.bind(null,n,i,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=u(t),r=d.bind(null,n,t),o=function(){a(n),n.href&&URL.revokeObjectURL(n.href)}):(n=s(t),r=p.bind(null,n),o=function(){a(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}function f(e,t,n,r){var o=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=x(t,o);else{var i=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}function p(e,t){var n=t.css,r=t.media;if(r&&e.setAttribute("media",r),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function d(e,t,n){var r=n.css,o=n.sourceMap,i=void 0===t.convertToAbsoluteUrls&&o;(t.convertToAbsoluteUrls||i)&&(r=E(r)),o&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var a=new Blob([r],{type:"text/css"}),s=e.href;e.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}var h={},m=function(e){var t;return function(){return void 0===t&&(t=e.apply(this,arguments)),t}}(function(){return window&&document&&document.all&&!window.atob}),y=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e.call(this,n)),t[n]}}(function(e){return document.querySelector(e)}),v=null,g=0,b=[],E=n(75);e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");t=t||{},t.attrs="object"==typeof t.attrs?t.attrs:{},void 0===t.singleton&&(t.singleton=m()),void 0===t.insertInto&&(t.insertInto="head"),void 0===t.insertAt&&(t.insertAt="bottom");var n=o(e);return r(n,t),function(e){for(var i=[],a=0;a<n.length;a++){var s=n[a],u=h[s.id];u.refs--,i.push(u)}if(e){r(o(e),t)}for(var a=0;a<i.length;a++){var u=i[a];if(0===u.refs){for(var c=0;c<u.parts.length;c++)u.parts[c]();delete h[u.id]}}}};var x=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(19),l=r(c),f=n(40),p=r(f),d=n(39),h=n(38),m=n(41),y=(r(m),function(e,t){var n,r;return r=n=function(n){function r(e){o(this,r);var t=i(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.checkLongPress=function(){return!t.props.isLongPress||t.isLongPress},t.longPress=function(e){if((t.isMobile||0===e.button)&&!t.props.disabled){t.mousePos=t.isInline?e.touches?e.touches[0].pageX:e.pageX:e.touches?e.touches[0].pageY:e.pageY;var n=e.target;t.isMobile&&(t.mobileEl=n,n.addEventListener("touchmove",t.dragging),n.addEventListener("touchend",t.dragEnd),n.addEventListener("touchcancel",t.dragEnd),document.body.addEventListener("touchmove",t.preventScroll),document.body.style.cssText="\n height:"+window.innerHeight+"px;\n overflow:hidden;\n "),t.props.isLongPress?(clearTimeout(t.setTime),t.setTime=setTimeout(t.dragBegin.bind(t,n),t.props.delay||300),t.isLongPress=!0):t.dragBegin(n)}},t.dragBegin=function(e){if(t.checkLongPress()&&!t.isDragBegin){console.log("dragBegin");var n=(0,d.getListContainer)(e,h.DRAG_CONTAINER);if(t._container===n&&(t.currDragItem=(0,d.getElement)(e,t._container,h.ITEM_CAN_DRAG),t.currDragItem)){t.isDragBegin=!0;var r=t.state.list,o=t.currDragItem,i=o.el,a=o.ind;t.beginPos=t.isInline?i.offsetLeft:i.offsetTop;var s=i.cloneNode(!0);s.className+=" "+h.FLOAT_DRAG_ITEM,s.style.width=i.offsetWidth+"px",s.style.height=i.offsetHeight+"px",t.isInline?s.style.left=t.beginPos+"px":s.style.top=t.beginPos+"px",t._container.appendChild(s),t.floatEl=s,t.currDragItem.item=r[a],r[a]={id:r[a].id,type:"placeholder"},t.setState({list:r},function(){t.props.onDragBegin&&t.props.onDragBegin(t.currDragItem.item,t.currDragItem.ind,t.currDragItem.el)})}}},t.getItemRectInfo=function(e){var n=e.getBoundingClientRect();return{itemOffset:t.isInline?n.left:n.top,itemSize:t.isInline?e.offsetWidth:e.offsetHeight}},t.dragging=function(e){if(e.preventDefault(),e.stopPropagation(),t.checkLongPress()&&t.isDragBegin){console.log("dragging"),(0,d.disabledSelection)();var n=t.currDragItem.ind,r=t.isInline?e.touches?e.touches[0].pageX:e.pageX:e.touches?e.touches[0].pageY:e.pageY,o=r-t.mousePos,i=t.isInline?e.touches?e.touches[0].clientX:e.clientX:e.touches?e.touches[0].clientY:e.clientY;t.isInline?t.floatEl.style.left=t.beginPos+o+"px":t.floatEl.style.top=t.beginPos+o+"px";for(var a=t._container.childNodes,s=t.state.list,u=0;u<a.length;u++){var c=a[u];if(!(c.className&&c.className.indexOf(h.FLOAT_DRAG_ITEM)>=0)){var l=t.getItemRectInfo(c),f=l.itemOffset,p=l.itemSize;if(i>f&&i<f+p&&n!==u){var m=[s[u],s[n]];s[n]=m[0],s[u]=m[1],n=t.currDragItem.ind=u,t.setState({list:s});break}}}}},t.dragEnd=function(e){if(e.stopPropagation(),(t.isMobile||0===e.button)&&t.checkLongPress()){if(console.log("dragend"),t.isMobile){var n=t.mobileEl;n&&(n.removeEventListener("touchmove",t.dragging),n.removeEventListener("touchend",t.dragEnd),n.removeEventListener("touchcancel",t.dragEnd)),t.mobileEl=null,document.body.style.cssText="",document.body.removeEventListener("touchmove",t.preventScroll)}if(t.mousePos=t.beginPos=null,t.isLongPress=!1,t.isDragBegin=!1,t.currDragItem){var r=t.state.list,o=t.currDragItem,i=o.ind,a=o.item;r[i]=a,t.setState({list:r},function(){t.props.onDragEnd&&t.props.onDragEnd(r)}),t._container.removeChild(t.floatEl),t.currDragItem=null,t.floatEl=null}}},t.state={list:e.list},t.isInline=(0,d.isInline)(t.props.type),t.isMobile=(0,d.checkMobile)(),t.mobileEl=null,t.isDragBegin=!1,t.isLongPress=!1,t._container=null,t.currDragItem=null,t.floatEl=null,t.setTime=null,t}return a(r,n),u(r,[{key:"componentDidMount",value:function(){window.addEventListener?(window.addEventListener("mousemove",this.dragging),window.addEventListener("mouseup",this.dragEnd),window.addEventListener("mouseleave",this.dragEnd)):(window.attachEvent("onmousemove",this.dragging),window.attachEvent("onmouseup",this.dragEnd),window.attachEvent("onmouseleave",this.dragEnd)),this.isInline&&(this._container.style.cssText+="\n display:flex;\n flex-direction:row;\n ")}},{key:"componentWillUnMount",value:function(){window.removeEventListener?(window.removeEventListener("mousemove",this.dragging),window.removeEventListener("mouseup",this.dragEnd),window.removeEventListener("mouseleave",this.dragEnd)):(window.detachEvent("onmousemove",this.dragging),window.detachEvent("onmouseup",this.dragEnd),window.detachEvent("onmouseleave",this.dragEnd))}},{key:"preventScroll",value:function(e){e.preventDefault()}},{key:"render",value:function(){var n=this,r=this.props.gutter,o={margin:r+"px"},i=this.state.list.map(function(r,i){if("placeholder"===r.type){var a={margin:o.margin,width:n.floatEl.offsetWidth,flex:"1 0 "+n.floatEl.offsetWidth+"px",height:n.floatEl.offsetHeight};return t?l.default.createElement(t,{key:r.id,style:a}):l.default.createElement("div",{key:r.id,style:a})}return l.default.createElement("div",{key:r.id,className:h.ITEM_CAN_DRAG,style:o},l.default.createElement(e,s({parentId:r.id},r)))}),a=s({},this.props);return["list","disabled","gutter","isLongPress","delay","onDragBegin","onDragEnd","type","className"].forEach(function(e){return delete a[e]}),l.default.createElement("div",s({className:(this.props.className||"")+" "+h.DRAG_CONTAINER},a,{onMouseDown:this.longPress,onTouchStart:this.longPress,ref:function(e){return n._container=e}}),i)}}]),r}(c.Component),n.PropTypes={list:p.default.array.isRequired,type:p.default.string,isLongPress:p.default.bool,delay:p.default.number,gutter:p.default.number,onDragBegin:p.default.func,onDragEnd:p.default.func},r});t.default=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.DRAG_CONTAINER="lowes-drag-list",t.ITEM_CAN_DRAG="lowes-can-drag",t.FLOAT_DRAG_ITEM="lowes-drag-item"},function(e,t,n){"use strict";function r(e,t){for(e=e.parentNode;e&&!(e.className&&e.className.indexOf(t)>=0);)e=e.parentNode;return e}function o(e,t,n){for(e=e.parentNode;e&&!(e.className&&e.className.indexOf(n)>=0);)e=e.parentNode;return e?{el:e,ind:Array.prototype.indexOf.call(t.childNodes,e)}:null}function i(){window.getSelection?window.getSelection().removeAllRanges():document.selection.empty()}function a(e){return"inline"===e}function s(){for(var e=["Android","iPhone","SymbianOS","Windows Phone","iPad","iPod"],t=navigator.userAgent,n=0;n<e.length;n++)if(t.indexOf(e[n])>0)return!0;return!1}Object.defineProperty(t,"__esModule",{value:!0}),t.getListContainer=r,t.getElement=o,t.disabledSelection=i,t.isInline=a,t.checkMobile=s},function(e,t,n){e.exports=n(46)()},function(e,t,n){var r=n(43);"string"==typeof r&&(r=[[e.i,r,""]]);n(36)(r,{});r.locals&&(e.exports=r.locals)},function(e,t,n){"use strict";function r(e){return e}function o(e,t,n){function o(e,t){var n=g.hasOwnProperty(t)?g[t]:null;w.hasOwnProperty(t)&&s("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&s("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function c(e,n){if(n){s("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),s(!t(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,i=r.__reactAutoBindPairs;n.hasOwnProperty(u)&&b.mixins(e,n.mixins);for(var a in n)if(n.hasOwnProperty(a)&&a!==u){var c=n[a],l=r.hasOwnProperty(a);if(o(l,a),b.hasOwnProperty(a))b[a](e,c);else{var f=g.hasOwnProperty(a),h="function"==typeof c,m=h&&!f&&!l&&!1!==n.autobind;if(m)i.push(a,c),r[a]=c;else if(l){var y=g[a];s(f&&("DEFINE_MANY_MERGED"===y||"DEFINE_MANY"===y),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",y,a),"DEFINE_MANY_MERGED"===y?r[a]=p(r[a],c):"DEFINE_MANY"===y&&(r[a]=d(r[a],c))}else r[a]=c}}}else;}function l(e,t){if(t)for(var n in t){var r=t[n];if(t.hasOwnProperty(n)){var o=n in b;s(!o,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n);var i=n in e;s(!i,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),e[n]=r}}}function f(e,t){s(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var n in t)t.hasOwnProperty(n)&&(s(void 0===e[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),e[n]=t[n]);return e}function p(e,t){return function(){var n=e.apply(this,arguments),r=t.apply(this,arguments);if(null==n)return r;if(null==r)return n;var o={};return f(o,n),f(o,r),o}}function d(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function h(e,t){var n=t.bind(e);return n}function m(e){for(var t=e.__reactAutoBindPairs,n=0;n<t.length;n+=2){var r=t[n],o=t[n+1];e[r]=h(e,o)}}function y(e){var t=r(function(e,r,o){this.__reactAutoBindPairs.length&&m(this),this.props=e,this.context=r,this.refs=a,this.updater=o||n,this.state=null;var i=this.getInitialState?this.getInitialState():null;s("object"==typeof i&&!Array.isArray(i),"%s.getInitialState(): must return an object or null",t.displayName||"ReactCompositeComponent"),this.state=i});t.prototype=new P,t.prototype.constructor=t,t.prototype.__reactAutoBindPairs=[],v.forEach(c.bind(null,t)),c(t,E),c(t,e),c(t,x),t.getDefaultProps&&(t.defaultProps=t.getDefaultProps()),s(t.prototype.render,"createClass(...): Class specification must implement a `render` method.");for(var o in g)t.prototype[o]||(t.prototype[o]=null);return t}var v=[],g={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},b={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n<t.length;n++)c(e,t[n])},childContextTypes:function(e,t){e.childContextTypes=i({},e.childContextTypes,t)},contextTypes:function(e,t){e.contextTypes=i({},e.contextTypes,t)},getDefaultProps:function(e,t){e.getDefaultProps?e.getDefaultProps=p(e.getDefaultProps,t):e.getDefaultProps=t},propTypes:function(e,t){e.propTypes=i({},e.propTypes,t)},statics:function(e,t){l(e,t)},autobind:function(){}},E={componentDidMount:function(){this.__isMounted=!0}},x={componentWillUnmount:function(){this.__isMounted=!1}},w={replaceState:function(e,t){this.updater.enqueueReplaceState(this,e,t)},isMounted:function(){return!!this.__isMounted}},P=function(){};return i(P.prototype,e.prototype,w),y}var i=n(3),a=n(14),s=n(0),u="mixins";e.exports=o},function(e,t,n){t=e.exports=n(29)(void 0),t.push([e.i,".lowes-drag-list {\r\n position: relative;\r\n}\r\n\r\n.lowes-drag-item {\r\n margin:auto;\r\n position: absolute;\r\n cursor:move;\r\n z-index:2000;\r\n -webkit-touch-callout:none;\r\n -webkit-user-select:none;\r\n -khtml-user-select:none;\r\n -moz-user-select:none;\r\n -ms-user-select:none;\r\n user-select:none;\r\n -webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);\r\n -moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);\r\n box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);\r\n -webkit-transform: translateX(20px);\r\n -moz-transform: translateX(20px);\r\n -ms-transform: translateX(20px);\r\n -o-transform: translateX(20px);\r\n transform: translateX(20px);\r\n}\r\n",""])},,function(e,t,n){"use strict";function r(e,t,n,r,o){}e.exports=r},function(e,t,n){"use strict";var r=n(5),o=n(0),i=n(20);e.exports=function(){function e(e,t,n,r,a,s){s!==i&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";var r=n(5),o=n(0),i=n(1),a=n(20),s=n(45);e.exports=function(e,t){function n(e){var t=e&&(_&&e[_]||e[I]);if("function"==typeof t)return t}function u(e,t){return e===t?0!==e||1/e==1/t:e!==e&&t!==t}function c(e){this.message=e,this.stack=""}function l(e){function n(n,r,i,s,u,l,f){if(s=s||O,l=l||i,f!==a)if(t)o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");else;return null==r[i]?n?new c(null===r[i]?"The "+u+" `"+l+"` is marked as required in `"+s+"`, but its value is `null`.":"The "+u+" `"+l+"` is marked as required in `"+s+"`, but its value is `undefined`."):null:e(r,i,s,u,l)}var r=n.bind(null,!1);return r.isRequired=n.bind(null,!0),r}function f(e){function t(t,n,r,o,i,a){var s=t[n];if(E(s)!==e)return new c("Invalid "+o+" `"+i+"` of type `"+x(s)+"` supplied to `"+r+"`, expected `"+e+"`.");return null}return l(t)}function p(e){function t(t,n,r,o,i){if("function"!=typeof e)return new c("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var s=t[n];if(!Array.isArray(s)){return new c("Invalid "+o+" `"+i+"` of type `"+E(s)+"` supplied to `"+r+"`, expected an array.")}for(var u=0;u<s.length;u++){var l=e(s,u,r,o,i+"["+u+"]",a);if(l instanceof Error)return l}return null}return l(t)}function d(e){function t(t,n,r,o,i){if(!(t[n]instanceof e)){var a=e.name||O;return new c("Invalid "+o+" `"+i+"` of type `"+P(t[n])+"` supplied to `"+r+"`, expected instance of `"+a+"`.")}return null}return l(t)}function h(e){function t(t,n,r,o,i){for(var a=t[n],s=0;s<e.length;s++)if(u(a,e[s]))return null;return new c("Invalid "+o+" `"+i+"` of value `"+a+"` supplied to `"+r+"`, expected one of "+JSON.stringify(e)+".")}return Array.isArray(e)?l(t):r.thatReturnsNull}function m(e){function t(t,n,r,o,i){if("function"!=typeof e)return new c("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var s=t[n],u=E(s);if("object"!==u)return new c("Invalid "+o+" `"+i+"` of type `"+u+"` supplied to `"+r+"`, expected an object.");for(var l in s)if(s.hasOwnProperty(l)){var f=e(s,l,r,o,i+"."+l,a);if(f instanceof Error)return f}return null}return l(t)}function y(e){function t(t,n,r,o,i){for(var s=0;s<e.length;s++){if(null==(0,e[s])(t,n,r,o,i,a))return null}return new c("Invalid "+o+" `"+i+"` supplied to `"+r+"`.")}if(!Array.isArray(e))return r.thatReturnsNull;for(var n=0;n<e.length;n++){var o=e[n];if("function"!=typeof o)return i(!1,"Invalid argument supplid to oneOfType. Expected an array of check functions, but received %s at index %s.",w(o),n),r.thatReturnsNull}return l(t)}function v(e){function t(t,n,r,o,i){var s=t[n],u=E(s);if("object"!==u)return new c("Invalid "+o+" `"+i+"` of type `"+u+"` supplied to `"+r+"`, expected `object`.");for(var l in e){var f=e[l];if(f){var p=f(s,l,r,o,i+"."+l,a);if(p)return p}}return null}return l(t)}function g(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(g);if(null===t||e(t))return!0;var r=n(t);if(!r)return!1;var o,i=r.call(t);if(r!==t.entries){for(;!(o=i.next()).done;)if(!g(o.value))return!1}else for(;!(o=i.next()).done;){var a=o.value;if(a&&!g(a[1]))return!1}return!0;default:return!1}}function b(e,t){return"symbol"===e||("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}function E(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":b(t,e)?"symbol":t}function x(e){if(void 0===e||null===e)return""+e;var t=E(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function w(e){var t=x(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}function P(e){return e.constructor&&e.constructor.name?e.constructor.name:O}var _="function"==typeof Symbol&&Symbol.iterator,I="@@iterator",O="<<anonymous>>",N={array:f("array"),bool:f("boolean"),func:f("function"),number:f("number"),object:f("object"),string:f("string"),symbol:f("symbol"),any:function(){return l(r.thatReturnsNull)}(),arrayOf:p,element:function(){function t(t,n,r,o,i){var a=t[n];if(!e(a)){return new c("Invalid "+o+" `"+i+"` of type `"+E(a)+"` supplied to `"+r+"`, expected a single ReactElement.")}return null}return l(t)}(),instanceOf:d,node:function(){function e(e,t,n,r,o){return g(e[t])?null:new c("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}return l(e)}(),objectOf:m,oneOf:h,oneOfType:y,shape:v};return c.prototype=Error.prototype,N.checkPropTypes=s,N.PropTypes=N,N}},,,,,,,,,,,,,,,,,function(e,t,n){"use strict";function r(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})}function o(e){var t=/(=0|=2)/g,n={"=0":"=","=2":":"};return(""+("."===e[0]&&"$"===e[1]?e.substring(2):e.substring(1))).replace(t,function(e){return n[e]})}var i={escape:r,unescape:o};e.exports=i},function(e,t,n){"use strict";var r=n(11),o=(n(0),function(e){var t=this;if(t.instancePool.length){var n=t.instancePool.pop();return t.call(n,e),n}return new t(e)}),i=function(e,t){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,e,t),r}return new n(e,t)},a=function(e,t,n){var r=this;if(r.instancePool.length){var o=r.instancePool.pop();return r.call(o,e,t,n),o}return new r(e,t,n)},s=function(e,t,n,r){var o=this;if(o.instancePool.length){var i=o.instancePool.pop();return o.call(i,e,t,n,r),i}return new o(e,t,n,r)},u=function(e){var t=this;e instanceof t||r("25"),e.destructor(),t.instancePool.length<t.poolSize&&t.instancePool.push(e)},c=o,l=function(e,t){var n=e;return n.instancePool=[],n.getPooled=t||c,n.poolSize||(n.poolSize=10),n.release=u,n},f={addPoolingTo:l,oneArgumentPooler:o,twoArgumentPooler:i,threeArgumentPooler:a,fourArgumentPooler:s};e.exports=f},function(e,t,n){"use strict";function r(e){return(""+e).replace(E,"$&/")}function o(e,t){this.func=e,this.context=t,this.count=0}function i(e,t,n){var r=e.func,o=e.context;r.call(o,t,e.count++)}function a(e,t,n){if(null==e)return e;var r=o.getPooled(t,n);v(e,i,r),o.release(r)}function s(e,t,n,r){this.result=e,this.keyPrefix=t,this.func=n,this.context=r,this.count=0}function u(e,t,n){var o=e.result,i=e.keyPrefix,a=e.func,s=e.context,u=a.call(s,t,e.count++);Array.isArray(u)?c(u,o,n,y.thatReturnsArgument):null!=u&&(m.isValidElement(u)&&(u=m.cloneAndReplaceKey(u,i+(!u.key||t&&t.key===u.key?"":r(u.key)+"/")+n)),o.push(u))}function c(e,t,n,o,i){var a="";null!=n&&(a=r(n)+"/");var c=s.getPooled(t,a,o,i);v(e,u,c),s.release(c)}function l(e,t,n){if(null==e)return e;var r=[];return c(e,r,null,t,n),r}function f(e,t,n){return null}function p(e,t){return v(e,f,null)}function d(e){var t=[];return c(e,t,null,y.thatReturnsArgument),t}var h=n(65),m=n(7),y=n(5),v=n(74),g=h.twoArgumentPooler,b=h.fourArgumentPooler,E=/\/+/g;o.prototype.destructor=function(){this.func=null,this.context=null,this.count=0},h.addPoolingTo(o,g),s.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},h.addPoolingTo(s,b);var x={forEach:a,map:l,mapIntoWithKeyPrefixInternal:c,count:p,toArray:d};e.exports=x},function(e,t,n){"use strict";var r=n(7),o=r.createFactory,i={a:o("a"),abbr:o("abbr"),address:o("address"),area:o("area"),article:o("article"),aside:o("aside"),audio:o("audio"),b:o("b"),base:o("base"),bdi:o("bdi"),bdo:o("bdo"),big:o("big"),blockquote:o("blockquote"),body:o("body"),br:o("br"),button:o("button"),canvas:o("canvas"),caption:o("caption"),cite:o("cite"),code:o("code"),col:o("col"),colgroup:o("colgroup"),data:o("data"),datalist:o("datalist"),dd:o("dd"),del:o("del"),details:o("details"),dfn:o("dfn"),dialog:o("dialog"),div:o("div"),dl:o("dl"),dt:o("dt"),em:o("em"),embed:o("embed"),fieldset:o("fieldset"),figcaption:o("figcaption"),figure:o("figure"),footer:o("footer"),form:o("form"),h1:o("h1"),h2:o("h2"),h3:o("h3"),h4:o("h4"),h5:o("h5"),h6:o("h6"),head:o("head"),header:o("header"),hgroup:o("hgroup"),hr:o("hr"),html:o("html"),i:o("i"),iframe:o("iframe"),img:o("img"),input:o("input"),ins:o("ins"),kbd:o("kbd"),keygen:o("keygen"),label:o("label"),legend:o("legend"),li:o("li"),link:o("link"),main:o("main"),map:o("map"),mark:o("mark"),menu:o("menu"),menuitem:o("menuitem"),meta:o("meta"),meter:o("meter"),nav:o("nav"),noscript:o("noscript"),object:o("object"),ol:o("ol"),optgroup:o("optgroup"),option:o("option"),output:o("output"),p:o("p"),param:o("param"),picture:o("picture"),pre:o("pre"),progress:o("progress"),q:o("q"),rp:o("rp"),rt:o("rt"),ruby:o("ruby"),s:o("s"),samp:o("samp"),script:o("script"),section:o("section"),select:o("select"),small:o("small"),source:o("source"),span:o("span"),strong:o("strong"),style:o("style"),sub:o("sub"),summary:o("summary"),sup:o("sup"),table:o("table"),tbody:o("tbody"),td:o("td"),textarea:o("textarea"),tfoot:o("tfoot"),th:o("th"),thead:o("thead"),time:o("time"),title:o("title"),tr:o("tr"),track:o("track"),u:o("u"),ul:o("ul"),var:o("var"),video:o("video"),wbr:o("wbr"),circle:o("circle"),clipPath:o("clipPath"),defs:o("defs"),ellipse:o("ellipse"),g:o("g"),image:o("image"),line:o("line"),linearGradient:o("linearGradient"),mask:o("mask"),path:o("path"),pattern:o("pattern"),polygon:o("polygon"),polyline:o("polyline"),radialGradient:o("radialGradient"),rect:o("rect"),stop:o("stop"),svg:o("svg"),text:o("text"),tspan:o("tspan")};e.exports=i},function(e,t,n){"use strict";var r=n(7),o=r.isValidElement,i=n(30);e.exports=i(o)},function(e,t,n){"use strict";e.exports="15.6.1"},function(e,t,n){"use strict";var r=n(25),o=r.Component,i=n(7),a=i.isValidElement,s=n(27),u=n(42);e.exports=u(o,a,s)},function(e,t,n){"use strict";function r(e){var t=e&&(o&&e[o]||e[i]);if("function"==typeof t)return t}var o="function"==typeof Symbol&&Symbol.iterator,i="@@iterator";e.exports=r},function(e,t,n){"use strict";var r=function(){};e.exports=r},function(e,t,n){"use strict";function r(e){return i.isValidElement(e)||o("143"),e}var o=n(11),i=n(7);n(0);e.exports=r},function(e,t,n){"use strict";function r(e,t){return e&&"object"==typeof e&&null!=e.key?c.escape(e.key):t.toString(36)}function o(e,t,n,i){var p=typeof e;if("undefined"!==p&&"boolean"!==p||(e=null),null===e||"string"===p||"number"===p||"object"===p&&e.$$typeof===s)return n(i,e,""===t?l+r(e,0):t),1;var d,h,m=0,y=""===t?l:t+f;if(Array.isArray(e))for(var v=0;v<e.length;v++)d=e[v],h=y+r(d,v),m+=o(d,h,n,i);else{var g=u(e);if(g){var b,E=g.call(e);if(g!==e.entries)for(var x=0;!(b=E.next()).done;)d=b.value,h=y+r(d,x++),m+=o(d,h,n,i);else for(;!(b=E.next()).done;){var w=b.value;w&&(d=w[1],h=y+c.escape(w[0])+f+r(d,0),m+=o(d,h,n,i))}}else if("object"===p){var P="",_=String(e);a("31","[object Object]"===_?"object with keys {"+Object.keys(e).join(", ")+"}":_,P)}}return m}function i(e,t,n){return null==e?0:o(e,"",t,n)}var a=n(11),s=(n(8),n(26)),u=n(71),c=(n(0),n(64)),l=(n(1),"."),f=":";e.exports=i},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,r=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(e,t){var o=t.trim().replace(/^"(.*)"$/,function(e,t){return t}).replace(/^'(.*)'$/,function(e,t){return t});if(/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(o))return e;var i;return i=0===o.indexOf("//")?o:0===o.indexOf("/")?n+o:r+o.replace(/^\.\//,""),"url("+JSON.stringify(i)+")"})}}])}); |
{ | ||
"name": "drag-list-react", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "A component of dragging and resorting list for React", | ||
@@ -5,0 +5,0 @@ "main": "dist/drag-list-react.js", |
# Drag-list-react | ||
[![npm](https://img.shields.io/badge/npm-v1.0.3-green.svg)](https://www.npmjs.com/package/drag-list-react) | ||
[![npm](https://img.shields.io/badge/npm-v1.0.5-green.svg)](https://www.npmjs.com/package/drag-list-react) | ||
[![Build Status](https://travis-ci.org/yyh1102/Drag-list-react.svg?branch=master)](https://travis-ci.org/yyh1102/Drag-list-react) | ||
@@ -8,3 +8,3 @@ [![npm](https://img.shields.io/npm/l/express.svg)](https://opensource.org/licenses/mit-license.php) | ||
[demo](http://htmlpreview.github.io/?https://github.com/yyh1102/Drag-list-react/blob/master/demo/index.html) | ||
[demo](https://yyh1102.github.io/react-drag-list/) | ||
@@ -67,2 +67,3 @@ ## Install | ||
|------|------|---------|-------------| | ||
| disabled | Boolean | false | Disabled dragging and dropping | | ||
| type | String | | Type of drag list.The list will be horizontal when it is set ```inline```.| | ||
@@ -69,0 +70,0 @@ | isLongPress | Boolean | false | Should dragging be triggered by long pressing or not | |
import React, {Component} from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import {getListContainer, getElement, disabledSelection, isInline} from './utils'; | ||
import {getListContainer, getElement, disabledSelection, isInline, checkMobile} from './utils'; | ||
import {DRAG_CONTAINER, FLOAT_DRAG_ITEM, ITEM_CAN_DRAG} from './constants'; | ||
@@ -8,11 +8,12 @@ import styles from './DragList.css'; | ||
const DragList = (DragItem, Placeholder) => class extends Component { | ||
static PropTypes={ | ||
list:PropTypes.array.isRequired, | ||
type:PropTypes.string, | ||
isLongPress:PropTypes.bool, | ||
delay:PropTypes.number, | ||
gutter:PropTypes.number, | ||
onDragBegin:PropTypes.func, | ||
onDragEnd:PropTypes.func | ||
static PropTypes = { | ||
list: PropTypes.array.isRequired, | ||
type: PropTypes.string, | ||
isLongPress: PropTypes.bool, | ||
delay: PropTypes.number, | ||
gutter: PropTypes.number, | ||
onDragBegin: PropTypes.func, | ||
onDragEnd: PropTypes.func | ||
} | ||
constructor(props) { | ||
@@ -24,2 +25,4 @@ super(props); | ||
this.isInline = isInline(this.props.type); //inline,original | ||
this.isMobile = checkMobile(); //check is mobile or not | ||
this.mobileEl = null; //cache e.target, for supporting touch event in mobile device | ||
this.isDragBegin = false; | ||
@@ -36,13 +39,9 @@ this.isLongPress = false; | ||
window.addEventListener('mousemove', this.dragging); | ||
window.addEventListener('touchmove', this.dragging); | ||
window.addEventListener('mouseup', this.dragEnd); | ||
window.addEventListener('mouseleave', this.dragEnd); | ||
window.addEventListener('touchend', this.dragEnd); | ||
} | ||
else { | ||
window.attachEvent('onmousemove', this.dragging); | ||
window.attachEvent('ontouchmove', this.dragging); | ||
window.attachEvent('onmouseup', this.dragEnd); | ||
window.attachEvent('onmouseleave', this.dragEnd); | ||
window.attachEvent('ontouchend', this.dragEnd); | ||
} | ||
@@ -56,9 +55,2 @@ if (this.isInline) | ||
// componentWillReceiveProps(nextProps) { | ||
// const currentChildren = this.state.children; | ||
// const nextChildren = nextProps.children; | ||
// const newChildren = mergeChildren(currentChildren, nextChildren); | ||
// this.setState({ children: newChildren }); | ||
// } | ||
componentWillUnMount() { | ||
@@ -69,4 +61,2 @@ if (window.removeEventListener) { | ||
window.removeEventListener('mouseleave', this.dragEnd); | ||
window.removeEventListener('ontouchmove', this.dragging); | ||
window.removeEventListener('ontouchend', this.dragEnd); | ||
} | ||
@@ -77,7 +67,9 @@ else { | ||
window.detachEvent('onmouseleave', this.dragEnd); | ||
window.detachEvent('ontouchmove', this.dragging); | ||
window.detachEvent('ontouchend', this.dragEnd); | ||
} | ||
} | ||
preventScroll(e) { | ||
e.preventDefault(); | ||
} | ||
checkLongPress = () => { | ||
@@ -88,6 +80,22 @@ return !this.props.isLongPress || this.isLongPress; | ||
longPress = (e) => { | ||
if (e.button !== 0) return; | ||
this.mousePos = this.isInline ? e.pageX : e.pageY; | ||
if (!this.isMobile && e.button !== 0 || this.props.disabled) return; | ||
this.mousePos = this.isInline ? | ||
(e.touches ? e.touches[0].pageX : e.pageX) | ||
: (e.touches ? e.touches[0].pageY : e.pageY); | ||
const el = e.target; | ||
if (this.isMobile) { | ||
this.mobileEl = el; | ||
// listen touch event in e.target | ||
el.addEventListener('touchmove', this.dragging); | ||
el.addEventListener('touchend', this.dragEnd); | ||
el.addEventListener('touchcancel', this.dragEnd); | ||
// prevent scrolling | ||
document.body.addEventListener('touchmove',this.preventScroll); | ||
document.body.style.cssText = ` | ||
height:${window.innerHeight+'px'}; | ||
overflow:hidden; | ||
`; | ||
} | ||
if (this.props.isLongPress) { | ||
// Long press | ||
clearTimeout(this.setTime); | ||
@@ -104,3 +112,3 @@ this.setTime = setTimeout(this.dragBegin.bind(this, el), this.props.delay || 300); | ||
if (!this.checkLongPress() || this.isDragBegin) return; | ||
// console.log('dragBegin'); | ||
console.log('dragBegin'); | ||
const listContainer = getListContainer(el, DRAG_CONTAINER); | ||
@@ -112,6 +120,6 @@ //如果经过父级遍历到的容器与真实的容器不一致,则需要将事件交由上一层组件处理 | ||
this.isDragBegin = true; | ||
const list = this.state.list; | ||
const {el: dragEl, ind} = this.currDragItem; | ||
//Save the position of drag item | ||
@@ -122,3 +130,4 @@ this.beginPos = this.isInline ? dragEl.offsetLeft : dragEl.offsetTop; | ||
floatEl.className += ` ${FLOAT_DRAG_ITEM}`; | ||
floatEl.style.width = dragEl.offsetWidth + 1 + 'px'; | ||
floatEl.style.width = dragEl.offsetWidth + 'px'; | ||
floatEl.style.height = dragEl.offsetHeight + 'px'; | ||
if (this.isInline) floatEl.style.left = this.beginPos + 'px'; | ||
@@ -128,6 +137,6 @@ else floatEl.style.top = this.beginPos + 'px'; | ||
this.floatEl = floatEl; | ||
this.currDragItem.item = list[ind]; | ||
this.currDragItem.item = list[ind]; | ||
list[ind] = { | ||
id: Date.now(), | ||
id: list[ind].id, | ||
type: 'placeholder' | ||
@@ -140,6 +149,5 @@ } | ||
this.props.onDragBegin | ||
&& this.props.onDragBegin(this.currDragItem.item,this.currDragItem.ind,this.currDragItem.el); | ||
&& this.props.onDragBegin(this.currDragItem.item, this.currDragItem.ind, this.currDragItem.el); | ||
}) | ||
} | ||
@@ -159,13 +167,19 @@ | ||
dragging = (e) => { | ||
// debugger; | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
if (!this.checkLongPress() | ||
|| !this.isDragBegin | ||
|| e.button !== 0) | ||
|| !this.isDragBegin) | ||
return; | ||
//ban selection event | ||
// console.log('dragging') | ||
console.log('dragging') | ||
disabledSelection(); | ||
let {ind} = this.currDragItem; | ||
const nextPos = this.isInline ? e.pageX : e.pageY, offsetDist = nextPos - this.mousePos; | ||
const mouseClient = this.isInline ? e.clientX : e.clientY; | ||
const nextPos = this.isInline ? | ||
(e.touches ? e.touches[0].pageX : e.pageX) | ||
: (e.touches ? e.touches[0].pageY : e.pageY), | ||
offsetDist = nextPos - this.mousePos; | ||
const mouseClient = this.isInline ? | ||
(e.touches ? e.touches[0].clientX : e.clientX) | ||
: (e.touches ? e.touches[0].clientY : e.clientY); | ||
@@ -182,3 +196,3 @@ //float node follow the mouse | ||
const {itemOffset, itemSize} = this.getItemRectInfo(item); | ||
if (mouseClient > itemOffset && mouseClient < itemOffset + itemSize) { | ||
if (mouseClient > itemOffset && mouseClient < itemOffset + itemSize && ind !== i) { | ||
[list[ind], list[i]] = [list[i], list[ind]]; | ||
@@ -188,3 +202,3 @@ ind = this.currDragItem.ind = i; | ||
list | ||
}) | ||
}); | ||
break; | ||
@@ -197,3 +211,18 @@ } | ||
e.stopPropagation(); | ||
if (!this.checkLongPress() || e.button !== 0) return; | ||
if (!this.isMobile && e.button !== 0 | ||
|| !this.checkLongPress()) | ||
return; | ||
console.log("dragend"); | ||
if (this.isMobile) { | ||
const el = this.mobileEl; | ||
if (el) { | ||
el.removeEventListener('touchmove', this.dragging); | ||
el.removeEventListener('touchend', this.dragEnd); | ||
el.removeEventListener('touchcancel', this.dragEnd); | ||
} | ||
this.mobileEl = null; | ||
document.body.style.cssText = ''; | ||
document.body.removeEventListener('touchmove',this.preventScroll); | ||
} | ||
this.mousePos = this.beginPos = null; | ||
this.isLongPress = false; | ||
@@ -222,10 +251,11 @@ this.isDragBegin = false; | ||
margin: `${gutter}px`, | ||
} | ||
}; | ||
const List = this.state.list.map((item, key) => { | ||
if (item.type === 'placeholder') { | ||
const placeholderStyle = Object.assign({}, itemStyle, { | ||
const placeholderStyle = { | ||
margin: itemStyle.margin, | ||
width: this.floatEl.offsetWidth, | ||
flex: `1 0 ${this.floatEl.offsetWidth}px`, | ||
height: this.floatEl.offsetHeight | ||
}); | ||
}; | ||
return Placeholder ? | ||
@@ -244,3 +274,2 @@ <Placeholder key={item.id} style={placeholderStyle}/> : | ||
parentId={item.id} | ||
{...this.props} | ||
{...item} | ||
@@ -251,8 +280,24 @@ /> | ||
} | ||
}) | ||
}); | ||
//get the props should be passed to real DOM | ||
const props = {...this.props}; | ||
[ | ||
'list', | ||
'disabled', | ||
'gutter', | ||
'isLongPress', | ||
'delay', | ||
'onDragBegin', | ||
'onDragEnd', | ||
'type', | ||
'className' | ||
].forEach(key => delete props[key]); | ||
return ( | ||
<div | ||
className={(this.props.className || '') + ' ' + DRAG_CONTAINER} | ||
style={this.props.style} | ||
{...props} | ||
onMouseDown={this.longPress} | ||
onTouchStart={this.longPress} | ||
ref={el => this._container = el} | ||
@@ -259,0 +304,0 @@ > |
@@ -8,3 +8,3 @@ /** | ||
export function getListContainer(el, className) { | ||
el=el.parentNode; | ||
el = el.parentNode; | ||
while (el) { | ||
@@ -37,3 +37,3 @@ if (el.className && el.className.indexOf(className) >= 0) { | ||
} | ||
if(!el) return null; | ||
if (!el) return null; | ||
const ind = Array.prototype.indexOf.call(container.childNodes, el); | ||
@@ -54,4 +54,13 @@ return { | ||
export function isInline(type){ | ||
export function isInline(type) { | ||
return type === 'inline'; | ||
} | ||
export function checkMobile() { | ||
const agents = ['Android', 'iPhone', 'SymbianOS', 'Windows Phone', 'iPad', 'iPod']; | ||
const userAgentInfo = navigator.userAgent; | ||
for (let i = 0; i < agents.length; i++) { | ||
if (userAgentInfo.indexOf(agents[i]) > 0) return true; | ||
} | ||
return false; | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
225559
19
648
72