vue-dndrop
Advanced tools
Comparing version 0.9.15 to 0.9.16
@@ -0,1 +1,7 @@ | ||
/** | ||
* Bundle of: vue-dndrop | ||
* Generated: 2021-08-11 | ||
* Version: 0.9.15 | ||
*/ | ||
import { smoothDnD, dropHandlers, constants } from 'smooth-dnd'; | ||
@@ -2,0 +8,0 @@ export * from 'smooth-dnd'; |
@@ -0,1 +1,7 @@ | ||
/** | ||
* Bundle of: vue-dndrop | ||
* Generated: 2021-08-11 | ||
* Version: 0.9.15 | ||
*/ | ||
(function (global, factory) { | ||
@@ -2,0 +8,0 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('smooth-dnd')) : |
@@ -1,207 +0,1 @@ | ||
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('smooth-dnd')) : | ||
typeof define === 'function' && define.amd ? define(['exports', 'smooth-dnd'], factory) : | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.VueDndrop = {}, global.SmoothDnD)); | ||
}(this, (function (exports, smoothDnd) { 'use strict'; | ||
var isArray = function (obj) { | ||
return Object.prototype.toString.call(obj) === '[object Array]'; | ||
}; | ||
function getTagProps (ctx, tagClasses) { | ||
var tag = ctx.$props.tag; | ||
if (tag) { | ||
if (typeof tag === 'string') { | ||
var result = { value: tag }; | ||
if (tagClasses) { | ||
result.props = { class: tagClasses }; | ||
} | ||
return result; | ||
} else if (typeof tag === 'object') { | ||
var result$1 = { value: tag.value || 'div', props: tag.props || {} }; | ||
if (tagClasses) { | ||
if (result$1.props.class) { | ||
if (isArray(result$1.props.class)) { | ||
result$1.props.class.push(tagClasses); | ||
} else { | ||
result$1.props.class = [tagClasses, result$1.props.class]; | ||
} | ||
} else { | ||
result$1.props.class = tagClasses; | ||
} | ||
} | ||
return result$1; | ||
} | ||
} | ||
return { value: 'div' }; | ||
} | ||
function validateTagProp (tag) { | ||
if (tag) { | ||
if (typeof tag === 'string') { return true; } | ||
if (typeof tag === 'object') { | ||
if ( | ||
typeof tag.value === 'string' || | ||
typeof tag.value === 'function' || | ||
typeof tag.value === 'object' | ||
) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
return true; | ||
} | ||
/* eslint-disable curly */ | ||
smoothDnd.smoothDnD.dropHandler = smoothDnd.dropHandlers.reactDropHandler().handler; | ||
smoothDnd.smoothDnD.wrapChild = false; | ||
var eventEmitterMap = { | ||
'drag-start': 'onDragStart', | ||
'drag-end': 'onDragEnd', | ||
'drop': 'onDrop', | ||
'drag-enter': 'onDragEnter', | ||
'drag-leave': 'onDragLeave', | ||
'drop-ready': 'onDropReady' | ||
}; | ||
function getContainerOptions (props, context) { | ||
var options = Object.keys(props).reduce(function (result, key) { | ||
var optionName = key; | ||
var prop = props[optionName]; | ||
if (prop !== undefined) { | ||
if (typeof prop === 'function') { | ||
if (eventEmitterMap[optionName]) { | ||
result[eventEmitterMap[optionName]] = function (params) { | ||
context.$emit(optionName, params); | ||
}; | ||
} else { | ||
result[optionName] = function () { | ||
var params = [], len = arguments.length; | ||
while ( len-- ) params[ len ] = arguments[ len ]; | ||
return (prop).apply(void 0, params); | ||
}; | ||
} | ||
} else { | ||
result[optionName] = prop; | ||
} | ||
} | ||
return result; | ||
}, {}); | ||
return options; | ||
} | ||
var mapOptions = function (context) { | ||
var props = Object.assign({}, context.$props, context.$listeners); | ||
return getContainerOptions(props, context); | ||
}; | ||
var Container = { | ||
name: 'Container', | ||
mounted: function mounted () { | ||
this.containerElement = this.$refs.container || this.$el; | ||
this.container = smoothDnd.smoothDnD(this.containerElement, mapOptions(this)); | ||
}, | ||
updated: function updated () { | ||
if ( | ||
this.$refs.container !== this.containerElement && | ||
this.$el !== this.containerElement | ||
) { | ||
if (this.container) { | ||
this.container.dispose(); | ||
} | ||
this.containerElement = this.$refs.container || this.$el; | ||
this.container = smoothDnd.smoothDnD(this.containerElement, mapOptions(this)); | ||
return; | ||
} | ||
this.container.setOptions(mapOptions(this)); | ||
}, | ||
destroyed: function destroyed () { | ||
if (this.container) { | ||
this.container.dispose(); | ||
} | ||
}, | ||
props: { | ||
behaviour: String, | ||
groupName: String, | ||
orientation: String, | ||
dragHandleSelector: String, | ||
nonDragAreaSelector: String, | ||
dragBeginDelay: Number, | ||
animationDuration: Number, | ||
autoScrollEnabled: { type: Boolean, default: true }, | ||
lockAxis: String, | ||
dragClass: String, | ||
dropClass: String, | ||
removeOnDropOut: { type: Boolean, default: false }, | ||
'drag-start': Function, | ||
'drag-end': Function, | ||
drop: Function, | ||
getChildPayload: Function, | ||
shouldAnimateDrop: Function, | ||
shouldAcceptDrop: Function, | ||
'drag-enter': Function, | ||
'drag-leave': Function, | ||
tag: { | ||
validator: validateTagProp, | ||
default: 'div', | ||
}, | ||
getGhostParent: Function, | ||
'drop-ready': Function, | ||
dropPlaceholder: [Object, Boolean] | ||
}, | ||
render: function (createElement) { | ||
var tagProps = getTagProps(this); | ||
return createElement( | ||
tagProps.value, | ||
Object.assign({}, { ref: 'container' }, tagProps.props), | ||
this.$slots.default | ||
); | ||
} | ||
}; | ||
var wrapChild = function (createElement, ctx) { | ||
var tagProps = getTagProps(ctx, smoothDnd.constants.wrapperClass); | ||
return createElement( | ||
tagProps.value, | ||
Object.assign({}, tagProps.props), | ||
ctx.$slots.default | ||
); | ||
}; | ||
var Draggable = { | ||
name: 'Draggable', | ||
props: { | ||
tag: { | ||
validator: validateTagProp, | ||
default: 'div' | ||
} | ||
}, | ||
render: function (createElement) { | ||
return wrapChild(createElement, this); | ||
} | ||
}; | ||
exports.Container = Container; | ||
exports.Draggable = Draggable; | ||
Object.keys(smoothDnd).forEach(function (k) { | ||
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { | ||
enumerable: true, | ||
get: function () { | ||
return smoothDnd[k]; | ||
} | ||
}); | ||
}); | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
}))); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("smooth-dnd")):"function"==typeof define&&define.amd?define(["exports","smooth-dnd"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).VueDndrop={},e.SmoothDnD)}(this,function(t,r){"use strict";function o(e,t){e=e.$props.tag;if(e){if("string"==typeof e){var n={value:e};return t&&(n.props={class:t}),n}if("object"==typeof e){n={value:e.value||"div",props:e.props||{}};return t&&(n.props.class?(e=n.props.class,"[object Array]"===Object.prototype.toString.call(e)?n.props.class.push(t):n.props.class=[t,n.props.class]):n.props.class=t),n}}return{value:"div"}}function e(e){return!e||("string"==typeof e||"object"==typeof e&&("string"==typeof e.value||"function"==typeof e.value||"object"==typeof e.value))}r.smoothDnD.dropHandler=r.dropHandlers.reactDropHandler().handler,r.smoothDnD.wrapChild=!1;var i={"drag-start":"onDragStart","drag-end":"onDragEnd",drop:"onDrop","drag-enter":"onDragEnter","drag-leave":"onDragLeave","drop-ready":"onDropReady"};function n(e){var o,a,t=Object.assign({},e.$props,e.$listeners);return o=t,a=e,Object.keys(o).reduce(function(e,t){var n=t,r=o[n];return void 0!==r&&("function"==typeof r?i[n]?e[i[n]]=function(e){a.$emit(n,e)}:e[n]=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return r.apply(void 0,e)}:e[n]=r),e},{})}var a={name:"Container",mounted:function(){this.containerElement=this.$refs.container||this.$el,this.container=r.smoothDnD(this.containerElement,n(this))},updated:function(){if(this.$refs.container!==this.containerElement&&this.$el!==this.containerElement)return this.container&&this.container.dispose(),this.containerElement=this.$refs.container||this.$el,void(this.container=r.smoothDnD(this.containerElement,n(this)));this.container.setOptions(n(this))},destroyed:function(){this.container&&this.container.dispose()},props:{behaviour:String,groupName:String,orientation:String,dragHandleSelector:String,nonDragAreaSelector:String,dragBeginDelay:Number,animationDuration:Number,autoScrollEnabled:{type:Boolean,default:!0},lockAxis:String,dragClass:String,dropClass:String,removeOnDropOut:{type:Boolean,default:!1},"drag-start":Function,"drag-end":Function,drop:Function,getChildPayload:Function,shouldAnimateDrop:Function,shouldAcceptDrop:Function,"drag-enter":Function,"drag-leave":Function,tag:{validator:e,default:"div"},getGhostParent:Function,"drop-ready":Function,dropPlaceholder:[Object,Boolean]},render:function(e){var t=o(this);return e(t.value,Object.assign({},{ref:"container"},t.props),this.$slots.default)}},s={name:"Draggable",props:{tag:{validator:e,default:"div"}},render:function(e){return t=e,e=o(n=this,r.constants.wrapperClass),t(e.value,Object.assign({},e.props),n.$slots.default);var t,n}};t.Container=a,t.Draggable=s,Object.keys(r).forEach(function(e){"default"===e||t.hasOwnProperty(e)||Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})}),Object.defineProperty(t,"__esModule",{value:!0})}); |
{ | ||
"name": "vue-dndrop", | ||
"version": "0.9.15", | ||
"version": "0.9.16", | ||
"description": "Vue wrappers for smooth-dnd", | ||
@@ -38,4 +38,3 @@ "author": "amendx && kutlugsahin", | ||
"build": "rollup -c build/rollup.js", | ||
"lint": "eslint src/*", | ||
"test": "jest --watchAll --verbose" | ||
"lint": "eslint src/*" | ||
}, | ||
@@ -50,33 +49,17 @@ "license": "MIT", | ||
"devDependencies": { | ||
"babel-jest": "^23.4.0", | ||
"cross-env": "^5.2.0", | ||
"eslint": "^5.16.0", | ||
"eslint-config-standard": "^12.0.0", | ||
"cross-env": "^7.0.3", | ||
"eslint": "^7.32.0", | ||
"eslint-config-standard": "^16.0.3", | ||
"eslint-plugin-import": "^2.24.0", | ||
"eslint-plugin-node": "^7.0.1", | ||
"eslint-plugin-promise": "^4.3.1", | ||
"eslint-plugin-standard": "^4.1.0", | ||
"jest": "^27.0.6", | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-promise": "^5.1.0", | ||
"eslint-plugin-standard": "^5.0.0", | ||
"rollup": "^2.56.2", | ||
"rollup-plugin-buble": "^0.19.8", | ||
"rollup-plugin-commonjs": "^8.4.1", | ||
"rollup-plugin-license": "^0.6.0", | ||
"rollup-plugin-typescript2": "0.14.0", | ||
"rollup-plugin-uglify": "^3.0.0" | ||
"rollup-plugin-commonjs": "^10.1.0", | ||
"rollup-plugin-license": "^2.5.0", | ||
"rollup-plugin-typescript2": "^0.30.0", | ||
"rollup-plugin-uglify": "^6.0.4" | ||
}, | ||
"jest": { | ||
"transform": { | ||
"\\.js$": "<rootDir>/node_modules/babel-jest" | ||
}, | ||
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$", | ||
"moduleFileExtensions": [ | ||
"ts", | ||
"tsx", | ||
"js", | ||
"jsx", | ||
"json", | ||
"node" | ||
] | ||
}, | ||
"homepage": "https://github.com/amendx/vue-dnd#readme" | ||
} |
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
13
0
32626
380
2