react-smooth-dnd
Advanced tools
Comparing version 0.4.5 to 0.4.6
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("smooth-dnd"),require("prop-types"),require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["smooth-dnd","prop-types","react","react-dom"],t):"object"==typeof exports?exports.ReactSmoothDnD=t(require("smooth-dnd"),require("prop-types"),require("react"),require("react-dom")):e.ReactSmoothDnD=t(e.SmoothDND,e.PropTypes,e.React,e.ReactDOM)}(this,function(e,t,n,r){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=6)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=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},o=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}}(),i=n(3),a=s(i),u=s(n(2));function s(e){return e&&e.__esModule?e:{default:e}}var c=n(1).constants.wrapperClass,f=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(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)}(t,i.Component),o(t,[{key:"render",value:function(){if(this.props.render)return a.default.cloneElement(this.props.render(),{className:c});var e=this.props.className?this.props.className+" ":"";return a.default.createElement("div",r({},this.props,{className:""+e+c}),this.props.children)}}]),t}();f.propTypes={render:u.default.func},t.default=f},function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t){e.exports=n},function(e,t){e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=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}}(),o=n(3),i=f(o),a=f(n(4)),u=f(n(2)),s=n(1),c=f(s);f(n(0));function f(e){return e&&e.__esModule?e:{default:e}}c.default.dropHandler=s.dropHandlers.reactDropHandler().handler,c.default.wrapChild=function(e){return e};var l=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.getContainerOptions=n.getContainerOptions.bind(n),n.setRef=n.setRef.bind(n),n.prevContainer=null,n}return function(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)}(t,o.Component),r(t,[{key:"componentDidMount",value:function(){this.containerDiv=this.containerDiv||a.default.findDOMNode(this),this.prevContainer=this.containerDiv,this.container=(0,c.default)(this.containerDiv,this.getContainerOptions(this.props))}},{key:"componentWillUnmount",value:function(){this.container.dispose(),this.container=null}},{key:"componentDidUpdate",value:function(){this.containerDiv=this.containerDiv||a.default.findDOMNode(this),this.containerDiv&&this.prevContainer&&this.prevContainer!==this.containerDiv&&(this.container.dispose(),this.container=(0,c.default)(this.containerDiv,this.getContainerOptions(this.props)),this.prevContainer=this.containerDiv)}},{key:"render",value:function(){return this.props.render?this.props.render(this.setRef):i.default.createElement("div",{style:this.props.style,ref:this.setRef},this.props.children)}},{key:"setRef",value:function(e){this.containerDiv=e}},{key:"getContainerOptions",value:function(e){return Object.assign({},e)}}]),t}();l.propTypes={behaviour:u.default.oneOf(["move","copy","drag-zone"]),groupName:u.default.string,orientation:u.default.oneOf(["horizontal","vertical"]),style:u.default.object,dragHandleSelector:u.default.string,nonDragAreaSelector:u.default.string,dragBeginDelay:u.default.number,animationDuration:u.default.number,autoScrollEnabled:u.default.string,lockAxis:u.default.string,dragClass:u.default.string,dropClass:u.default.string,onDragStart:u.default.func,onDragEnd:u.default.func,onDrop:u.default.func,getChildPayload:u.default.func,shouldAnimateDrop:u.default.func,shouldAcceptDrop:u.default.func,onDragEnter:u.default.func,onDragLeave:u.default.func,render:u.default.func},l.defaultProps={behaviour:"move",orientation:"vertical"},t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Draggable=t.Container=void 0;var r=i(n(5)),o=i(n(0));function i(e){return e&&e.__esModule?e:{default:e}}t.Container=r.default,t.Draggable=o.default}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("smooth-dnd"),require("prop-types"),require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["smooth-dnd","prop-types","react","react-dom"],t):"object"==typeof exports?exports.ReactSmoothDnD=t(require("smooth-dnd"),require("prop-types"),require("react"),require("react-dom")):e.ReactSmoothDnD=t(e.SmoothDND,e.PropTypes,e.React,e.ReactDOM)}(this,function(e,t,n,r){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=6)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=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},o=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}}(),i=n(3),a=c(i),u=c(n(2));function c(e){return e&&e.__esModule?e:{default:e}}var s=n(1).constants.wrapperClass,l=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(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)}(t,i.Component),o(t,[{key:"render",value:function(){if(this.props.render)return a.default.cloneElement(this.props.render(),{className:s});var e=this.props.className?this.props.className+" ":"";return a.default.createElement("div",r({},this.props,{className:""+e+s}),this.props.children)}}]),t}();l.propTypes={render:u.default.func},t.default=l},function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t){e.exports=n},function(e,t){e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=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}}(),o=n(3),i=l(o),a=l(n(4)),u=l(n(2)),c=n(1),s=l(c);l(n(0));function l(e){return e&&e.__esModule?e:{default:e}}s.default.dropHandler=c.dropHandlers.reactDropHandler().handler,s.default.wrapChild=function(e){return e};var f=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.getContainerOptions=n.getContainerOptions.bind(n),n.setRef=n.setRef.bind(n),n.prevContainer=null,n}return function(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)}(t,o.Component),r(t,[{key:"componentDidMount",value:function(){this.containerDiv=this.containerDiv||a.default.findDOMNode(this),this.prevContainer=this.containerDiv,this.container=(0,s.default)(this.containerDiv,this.getContainerOptions(this.props))}},{key:"componentWillUnmount",value:function(){this.container.dispose(),this.container=null}},{key:"componentDidUpdate",value:function(){this.containerDiv=this.containerDiv||a.default.findDOMNode(this),this.containerDiv&&this.prevContainer&&this.prevContainer!==this.containerDiv&&(this.container.dispose(),this.container=(0,s.default)(this.containerDiv,this.getContainerOptions(this.props)),this.prevContainer=this.containerDiv)}},{key:"render",value:function(){return this.props.render?this.props.render(this.setRef):i.default.createElement("div",{style:this.props.style,ref:this.setRef},this.props.children)}},{key:"setRef",value:function(e){this.containerDiv=e}},{key:"getContainerOptions",value:function(e){return Object.assign({},e,{onDragStart:function(){return e.onDragStart.apply(e,arguments)},onDragEnd:function(){return e.onDragEnd.apply(e,arguments)},onDrop:function(){return e.onDrop.apply(e,arguments)},getChildPayload:function(){return e.getChildPayload.apply(e,arguments)},shouldAnimateDrop:function(){return e.shouldAnimateDrop.apply(e,arguments)},shouldAcceptDrop:function(){return e.shouldAcceptDrop.apply(e,arguments)},onDragEnter:function(){return e.onDragEnter.apply(e,arguments)},onDragLeave:function(){return e.onDragLeave.apply(e,arguments)},render:function(){return e.render.apply(e,arguments)}})}}]),t}();f.propTypes={behaviour:u.default.oneOf(["move","copy","drag-zone"]),groupName:u.default.string,orientation:u.default.oneOf(["horizontal","vertical"]),style:u.default.object,dragHandleSelector:u.default.string,nonDragAreaSelector:u.default.string,dragBeginDelay:u.default.number,animationDuration:u.default.number,autoScrollEnabled:u.default.string,lockAxis:u.default.string,dragClass:u.default.string,dropClass:u.default.string,onDragStart:u.default.func,onDragEnd:u.default.func,onDrop:u.default.func,getChildPayload:u.default.func,shouldAnimateDrop:u.default.func,shouldAcceptDrop:u.default.func,onDragEnter:u.default.func,onDragLeave:u.default.func,render:u.default.func},f.defaultProps={behaviour:"move",orientation:"vertical"},t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Draggable=t.Container=void 0;var r=i(n(5)),o=i(n(0));function i(e){return e&&e.__esModule?e:{default:e}}t.Container=r.default,t.Draggable=o.default}])}); |
{ | ||
"name": "react-smooth-dnd", | ||
"version": "0.4.5", | ||
"version": "0.4.6", | ||
"description": "Drag and Drop library", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -58,3 +58,13 @@ import React, { Component } from 'react'; | ||
getContainerOptions(props) { | ||
return Object.assign({}, props); | ||
return Object.assign({}, props, { | ||
onDragStart: (...p) => props.onDragStart(...p), | ||
onDragEnd: (...p) => props.onDragEnd(...p), | ||
onDrop: (...p) => props.onDrop(...p), | ||
getChildPayload: (...p) => props.getChildPayload(...p), | ||
shouldAnimateDrop: (...p) => props.shouldAnimateDrop(...p), | ||
shouldAcceptDrop: (...p) => props.shouldAcceptDrop(...p), | ||
onDragEnter: (...p) => props.onDragEnter(...p), | ||
onDragLeave: (...p) => props.onDragLeave(...p), | ||
render: (...p) => props.render(...p) | ||
}); | ||
} | ||
@@ -61,0 +71,0 @@ } |
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
30881
159