moodle_local_treestudyplan/amd/build/vue-easy-dnd.min.js

3 lines
37 KiB
JavaScript
Raw Normal View History

define("local_treestudyplan/vue-easy-dnd",["exports","./reflect-metadata","./vue-property-decorator"],(function(_exports,_reflectMetadata,_vuePropertyDecorator){function _typeof(obj){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}function __decorate(decorators,target,key,desc){var d,c=arguments.length,r=c<3?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc;if("object"===("undefined"==typeof Reflect?"undefined":_typeof(Reflect))&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r}function __metadata(metadataKey,metadataValue){if("object"===("undefined"==typeof Reflect?"undefined":_typeof(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(metadataKey,metadataValue)}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.ReorderEvent=_exports.InsertEvent=_exports.DropMixin=_exports.DropMask=_exports.DropList=_exports.Drop=_exports.DragMixin=_exports.DragImagesManager=_exports.DragAwareMixin=_exports.Drag=_exports.DnDEvent=void 0,_exports.createDragImage=createDragImage,_exports.dnd=void 0;var DnD=function(){this.inProgress=!1,this.type=null,this.data=null,this.source=null,this.top=null,this.position=null,this.eventBus=new _vuePropertyDecorator.Vue,this.sourceListeners=null,this.success=null};DnD.prototype.startDrag=function(source,event,x,y,type,data){this.type=type,this.data=data,this.source=source,this.position={x:x,y:y},this.top=null,this.sourceListeners=source.$listeners,this.inProgress=!0,this.emit(event,"dragstart"),this.emit(event,"dragtopchanged",{previousTop:null})},DnD.prototype.stopDrag=function(event){this.success=null!==this.top&&this.top.compatibleMode&&this.top.dropAllowed,null!==this.top&&this.emit(event,"drop"),this.emit(event,"dragend"),this.inProgress=!1,this.data=null,this.source=null,this.position=null,this.success=null},DnD.prototype.mouseMove=function(event,comp){if(this.inProgress){var prevent=!1,previousTop=this.top;null===comp||comp.isDropMask?(this.top=null,prevent=!0):comp.candidate(this.type,this.data,this.source)&&(this.top=comp,prevent=!0),prevent&&event.stopPropagation(),this.top!==previousTop&&this.emit(event.detail.native,"dragtopchanged",{previousTop:previousTop}),this.position={x:event.detail.x,y:event.detail.y},this.emit(event.detail.native,"dragpositionchanged")}},DnD.prototype.emit=function(native,event,data){this.eventBus.$emit(event,Object.assign({},{type:this.type,data:this.data,top:this.top,source:this.source,position:this.position,success:this.success,native:native},data))},DnD.prototype.on=function(event,callback){this.eventBus.$on(event,callback)},DnD.prototype.off=function(event,callback){this.eventBus.$off(event,callback)};var dnd=new DnD;_exports.dnd=dnd,_exports.dnd=dnd=_vuePropertyDecorator.Vue.observable(dnd);var DragAwareMixin=function(Vue){function DragAwareMixin(){Vue.apply(this,arguments)}Vue&&(DragAwareMixin.__proto__=Vue),DragAwareMixin.prototype=Object.create(Vue&&Vue.prototype),DragAwareMixin.prototype.constructor=DragAwareMixin;var prototypeAccessors={dragInProgress:{configurable:!0},dragData:{configurable:!0},dragType:{configurable:!0},dragPosition:{configurable:!0},dragSource:{configurable:!0},dragTop:{configurable:!0}};return prototypeAccessors.dragInProgress.get=function(){return dnd.inProgress},prototypeAccessors.dragData.get=function(){return dnd.data},prototypeAccessors.dragType.get=function(){return dnd.type},prototypeAccessors.dragPosition.get=function(){return dnd.position},prototypeAccessors.dragSource.get=function(){return dnd.source},prototypeAccessors.dragTop.get=function(){return dnd.top},Object.defineProperties(DragAwareMixin.prototype,prototypeAccessors),DragAwareMixin}(_vuePropertyDecorator.Vue),DragAware
//# sourceMappingURL=vue-easy-dnd.min.js.map