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

3 lines
44 KiB
JavaScript
Raw Normal View History

define("local_treestudyplan/vue-easy-dnd/vue-easy-dnd.esm",["exports","./reflect-metadata","./vue-property-decorator"],(function(_exports,_reflectMetadata,_vuePropertyDecorator){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 extendStatics=function(d,b){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])},extendStatics(d,b)};function __extends(d,b){function __(){this.constructor=d}extendStatics(d,b),d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)}var __assign=function(){return __assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},__assign.apply(this,arguments)};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"==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"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(metadataKey,metadataValue)}function __values(o){var m="function"==typeof Symbol&&o[Symbol.iterator],i=0;return m?m.call(o):{next:function(){return o&&i>=o.length&&(o=void 0),{value:o&&o[i++],done:!o}}}}function __read(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error:error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar}function __spread(){for(var ar=[],i=0;i<arguments.length;i++)ar=ar.concat(__read(arguments[i]));return ar}var dnd=new(function(){function DnD(){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}return 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.resetVariables=function(){this.inProgress=!1,this.data=null,this.source=null,this.position=null,this.success=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.resetVariables()},DnD.prototype.cancelDrag=function(event){this.success=!1,this.emit(event,"dragend"),this.resetVariables()},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,__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)},DnD}
2023-08-21 22:04:51 +02:00
//# sourceMappingURL=vue-easy-dnd.esm.min.js.map