Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-smooth-dnd

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-smooth-dnd - npm Package Compare versions

Comparing version 0.8.2 to 0.9.0

2

dist/index.js

@@ -1,1 +0,1 @@

!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("prop-types"),require("smooth-dnd")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","smooth-dnd"],e):e((n=n||self).ReactSmoothDnD={},n.React,n.PropTypes,n.SmoothDnD)}(this,function(e,r,n,o){"use strict";var i="default"in r?r.default:r;function a(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function s(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function p(n,e,t){return e&&s(n.prototype,e),t&&s(n,t),n}function l(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function t(){return(t=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n}).apply(this,arguments)}function u(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&h(n,e)}function c(n){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)})(n)}function h(n,e){return(h=Object.setPrototypeOf||function(n,e){return n.__proto__=e,n})(n,e)}function d(n){if(void 0===n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function f(n,e){return!e||"object"!=typeof e&&"function"!=typeof e?d(n):e}n=n&&n.hasOwnProperty("default")?n.default:n,o.smoothDnD.dropHandler=o.dropHandlers.reactDropHandler().handler,o.smoothDnD.wrapChild=!1;var g=function(n){function t(n){var e;return a(this,t),l(d(e=f(this,c(t).call(this,n))),"prevContainer",void 0),l(d(e),"container",null),l(d(e),"containerRef",i.createRef()),e.getContainerOptions=e.getContainerOptions.bind(d(e)),e.getContainer=e.getContainer.bind(d(e)),e.prevContainer=null,e}return u(t,r.Component),p(t,[{key:"componentDidMount",value:function(){this.prevContainer=this.getContainer(),this.container=o.smoothDnD(this.getContainer(),this.getContainerOptions())}},{key:"componentWillUnmount",value:function(){this.container.dispose(),this.container=null}},{key:"componentDidUpdate",value:function(){this.getContainer()&&this.prevContainer&&this.prevContainer!==this.getContainer()&&(this.container.dispose(),this.container=o.smoothDnD(this.getContainer(),this.getContainerOptions()),this.prevContainer=this.getContainer())}},{key:"render",value:function(){return this.props.render?this.props.render(this.containerRef):i.createElement("div",{style:this.props.style,ref:this.containerRef},this.props.children)}},{key:"getContainer",value:function(){return this.containerRef.current}},{key:"getContainerOptions",value:function(){var n={};return this.props.onDragStart&&(n.onDragStart=this.props.onDragStart.bind(null)),this.props.onDragEnd&&(n.onDragEnd=this.props.onDragEnd.bind(null)),this.props.onDrop&&(n.onDrop=this.props.onDrop.bind(null)),this.props.getChildPayload&&(n.getChildPayload=this.props.getChildPayload.bind(null)),this.props.shouldAnimateDrop&&(n.shouldAnimateDrop=this.props.shouldAnimateDrop.bind(null)),this.props.shouldAcceptDrop&&(n.shouldAcceptDrop=this.props.shouldAcceptDrop.bind(null)),this.props.onDragEnter&&(n.onDragEnter=this.props.onDragEnter.bind(null)),this.props.onDragLeave&&(n.onDragLeave=this.props.onDragLeave.bind(null)),this.props.render&&(n.render=this.props.render.bind(null)),this.props.onDropReady&&(n.onDropReady=this.props.onDropReady.bind(null)),this.props.getGhostParent&&(n.getGhostParent=this.props.getGhostParent.bind(null)),Object.assign({},this.props,n)}}]),t}();l(g,"propTypes",{behaviour:n.oneOf(["move","copy","drag-zone","contain"]),groupName:n.string,orientation:n.oneOf(["horizontal","vertical"]),style:n.object,dragHandleSelector:n.string,nonDragAreaSelector:n.string,dragBeginDelay:n.number,animationDuration:n.number,autoScrollEnabled:n.bool,lockAxis:n.string,dragClass:n.string,dropClass:n.string,onDragStart:n.func,onDragEnd:n.func,onDrop:n.func,getChildPayload:n.func,shouldAnimateDrop:n.func,shouldAcceptDrop:n.func,onDragEnter:n.func,onDragLeave:n.func,render:n.func,getGhostParent:n.func,removeOnDropOut:n.bool,dropPlaceholder:n.oneOfType([n.shape({className:n.string,animationDuration:n.number,showOnTop:n.bool}),n.bool])}),l(g,"defaultProps",{behaviour:"move",orientation:"vertical"});var D=o.constants.wrapperClass,b=function(n){function e(){return a(this,e),f(this,c(e).apply(this,arguments))}return u(e,r.Component),p(e,[{key:"render",value:function(){if(this.props.render)return i.cloneElement(this.props.render(),{className:D});var n="".concat(this.props.className?this.props.className+" ":"");return i.createElement("div",t({},this.props,{className:"".concat(n).concat(D)}),this.props.children)}}]),e}();l(b,"propsTypes",{render:n.func,className:n.string}),Object.keys(o).forEach(function(n){e[n]=o[n]}),e.Container=g,e.Draggable=b,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react"),require("prop-types"),require("smooth-dnd")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","smooth-dnd"],n):n((e=e||self).ReactSmoothDnD={},e.React,e.PropTypes,e.SmoothDnD)}(this,function(n,r,e,o){"use strict";var i="default"in r?r.default:r;function a(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function s(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,n,t){return n&&s(e.prototype,n),t&&s(e,t),e}function p(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function t(){return(t=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)}function u(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&f(e,n)}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,n){return(f=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e})(e,n)}function h(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t=i[r],0<=n.indexOf(t)||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],0<=n.indexOf(t)||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(e,n){return!n||"object"!=typeof n&&"function"!=typeof n?d(e):n}e=e&&e.hasOwnProperty("default")?e.default:e,o.smoothDnD.dropHandler=o.dropHandlers.reactDropHandler().handler,o.smoothDnD.wrapChild=!1;var g=function(e){function t(e){var n;return a(this,t),p(d(n=y(this,l(t).call(this,e))),"prevContainer",void 0),p(d(n),"container",null),p(d(n),"containerRef",i.createRef()),n.getContainerOptions=n.getContainerOptions.bind(d(n)),n.getContainer=n.getContainer.bind(d(n)),n.isObjectTypePropsChanged=n.isObjectTypePropsChanged.bind(d(n)),n.prevContainer=null,n}return u(t,r.Component),c(t,[{key:"componentDidMount",value:function(){this.prevContainer=this.getContainer(),this.container=o.smoothDnD(this.getContainer(),this.getContainerOptions())}},{key:"componentWillUnmount",value:function(){this.container.dispose(),this.container=null}},{key:"componentDidUpdate",value:function(e){if(this.getContainer()){if(this.prevContainer&&this.prevContainer!==this.getContainer())return this.container.dispose(),this.container=o.smoothDnD(this.getContainer(),this.getContainerOptions()),void(this.prevContainer=this.getContainer());this.isObjectTypePropsChanged(e)&&this.container.setOptions(this.getContainerOptions())}}},{key:"isObjectTypePropsChanged",value:function(e){var n=this.props,t=(n.render,n.children,n.style,h(n,["render","children","style"]));for(var r in t){var o=r;if(t.hasOwnProperty(o)){var i=t[o];if("function"!=typeof i&&i!==e[o])return!0}}return!1}},{key:"render",value:function(){return this.props.render?this.props.render(this.containerRef):i.createElement("div",{style:this.props.style,ref:this.containerRef},this.props.children)}},{key:"getContainer",value:function(){return this.containerRef.current}},{key:"getContainerOptions",value:function(){var o=this;return Object.keys(this.props).reduce(function(e,n){var t=n,r=o.props[t];return e[t]="function"==typeof r?function(){return o.props[t].apply(void 0,arguments)}:r,e},{})}}]),t}();p(g,"propTypes",{behaviour:e.oneOf(["move","copy","drop-zone","contain"]),groupName:e.string,orientation:e.oneOf(["horizontal","vertical"]),style:e.object,dragHandleSelector:e.string,nonDragAreaSelector:e.string,dragBeginDelay:e.number,animationDuration:e.number,autoScrollEnabled:e.bool,lockAxis:e.string,dragClass:e.string,dropClass:e.string,onDragStart:e.func,onDragEnd:e.func,onDrop:e.func,getChildPayload:e.func,shouldAnimateDrop:e.func,shouldAcceptDrop:e.func,onDragEnter:e.func,onDragLeave:e.func,render:e.func,getGhostParent:e.func,removeOnDropOut:e.bool,dropPlaceholder:e.oneOfType([e.shape({className:e.string,animationDuration:e.number,showOnTop:e.bool}),e.bool])}),p(g,"defaultProps",{behaviour:"move",orientation:"vertical"});var b=o.constants.wrapperClass,v=function(e){function n(){return a(this,n),y(this,l(n).apply(this,arguments))}return u(n,r.Component),c(n,[{key:"render",value:function(){if(this.props.render)return i.cloneElement(this.props.render(),{className:b});var e="".concat(this.props.className?this.props.className+" ":"");return i.createElement("div",t({},this.props,{className:"".concat(e).concat(b)}),this.props.children)}}]),n}();p(v,"propsTypes",{render:e.func,className:e.string}),Object.keys(o).forEach(function(e){n[e]=o[e]}),n.Container=g,n.Draggable=v,Object.defineProperty(n,"__esModule",{value:!0})});

@@ -49,7 +49,8 @@ import React, { Component, CSSProperties } from 'react';

componentWillUnmount(): void;
componentDidUpdate(): void;
componentDidUpdate(prevProps: ContainerProps): void;
isObjectTypePropsChanged(prevProps: ContainerProps): boolean;
render(): JSX.Element;
getContainer(): any;
getContainerOptions(): ContainerProps;
getContainerOptions(): ContainerOptions;
}
export default Container;
{
"name": "react-smooth-dnd",
"version": "0.8.2",
"version": "0.9.0",
"description": "Drag and Drop library",

@@ -51,5 +51,5 @@ "main": "./dist/index.js",

"dependencies": {
"smooth-dnd": "0.9.4",
"smooth-dnd": "0.9.5",
"prop-types":">=15.6.0"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc