Comparing version 1.12.0 to 1.13.0
@@ -1,2 +0,2 @@ | ||
System.registerDynamic("src/dnd.draggable", ["@angular/core", "./dnd.component", "./dnd.config", "./dnd.service"], true, function($__require, exports, module) { | ||
System.registerDynamic("src/draggable.component", ["@angular/core", "./abstract.component", "./dnd.config", "./dnd.service"], true, function($__require, exports, module) { | ||
"use strict"; | ||
@@ -34,3 +34,3 @@ ; | ||
var core_2 = $__require('@angular/core'); | ||
var dnd_component_1 = $__require('./dnd.component'); | ||
var abstract_component_1 = $__require('./abstract.component'); | ||
var dnd_config_1 = $__require('./dnd.config'); | ||
@@ -108,3 +108,3 @@ var dnd_service_1 = $__require('./dnd.service'); | ||
return DraggableComponent; | ||
}(dnd_component_1.AbstractComponent)); | ||
}(abstract_component_1.AbstractComponent)); | ||
exports.DraggableComponent = DraggableComponent; | ||
@@ -114,3 +114,3 @@ return module.exports; | ||
System.registerDynamic("src/dnd.droppable", ["@angular/core", "./dnd.component", "./dnd.config", "./dnd.service"], true, function($__require, exports, module) { | ||
System.registerDynamic("src/droppable.component", ["@angular/core", "./abstract.component", "./dnd.config", "./dnd.service"], true, function($__require, exports, module) { | ||
"use strict"; | ||
@@ -148,3 +148,3 @@ ; | ||
var core_2 = $__require('@angular/core'); | ||
var dnd_component_1 = $__require('./dnd.component'); | ||
var abstract_component_1 = $__require('./abstract.component'); | ||
var dnd_config_1 = $__require('./dnd.config'); | ||
@@ -254,3 +254,3 @@ var dnd_service_1 = $__require('./dnd.service'); | ||
return DroppableComponent; | ||
}(dnd_component_1.AbstractComponent)); | ||
}(abstract_component_1.AbstractComponent)); | ||
exports.DroppableComponent = DroppableComponent; | ||
@@ -260,3 +260,3 @@ return module.exports; | ||
System.registerDynamic("src/dnd.sortable", ["@angular/core", "./dnd.component", "./dnd.config", "./dnd.service"], true, function($__require, exports, module) { | ||
System.registerDynamic("src/sortable.component", ["@angular/core", "./abstract.component", "./dnd.config", "./dnd.service"], true, function($__require, exports, module) { | ||
"use strict"; | ||
@@ -294,3 +294,3 @@ ; | ||
var core_2 = $__require('@angular/core'); | ||
var dnd_component_1 = $__require('./dnd.component'); | ||
var abstract_component_1 = $__require('./abstract.component'); | ||
var dnd_config_1 = $__require('./dnd.config'); | ||
@@ -348,3 +348,3 @@ var dnd_service_1 = $__require('./dnd.service'); | ||
return SortableContainer; | ||
}(dnd_component_1.AbstractComponent)); | ||
}(abstract_component_1.AbstractComponent)); | ||
exports.SortableContainer = SortableContainer; | ||
@@ -456,3 +456,3 @@ var SortableComponent = (function(_super) { | ||
return SortableComponent; | ||
}(dnd_component_1.AbstractComponent)); | ||
}(abstract_component_1.AbstractComponent)); | ||
exports.SortableComponent = SortableComponent; | ||
@@ -627,3 +627,3 @@ return module.exports; | ||
System.registerDynamic("src/dnd.component", ["@angular/core", "./dnd.config", "./dnd.service", "./dnd.utils"], true, function($__require, exports, module) { | ||
System.registerDynamic("src/abstract.component", ["@angular/core", "./dnd.config", "./dnd.service", "./dnd.utils"], true, function($__require, exports, module) { | ||
"use strict"; | ||
@@ -814,3 +814,3 @@ ; | ||
System.registerDynamic("ng2-dnd", ["./src/dnd.config", "./src/dnd.service", "./src/dnd.draggable", "./src/dnd.droppable", "./src/dnd.sortable", "./src/dnd.component"], true, function($__require, exports, module) { | ||
System.registerDynamic("index", ["./src/dnd.config", "./src/dnd.service", "./src/draggable.component", "./src/droppable.component", "./src/sortable.component", "./src/abstract.component"], true, function($__require, exports, module) { | ||
"use strict"; | ||
@@ -828,14 +828,14 @@ ; | ||
var dnd_service_1 = $__require('./src/dnd.service'); | ||
var dnd_draggable_1 = $__require('./src/dnd.draggable'); | ||
var dnd_droppable_1 = $__require('./src/dnd.droppable'); | ||
var dnd_sortable_1 = $__require('./src/dnd.sortable'); | ||
__export($__require('./src/dnd.component')); | ||
var draggable_component_1 = $__require('./src/draggable.component'); | ||
var droppable_component_1 = $__require('./src/droppable.component'); | ||
var sortable_component_1 = $__require('./src/sortable.component'); | ||
__export($__require('./src/abstract.component')); | ||
__export($__require('./src/dnd.config')); | ||
__export($__require('./src/dnd.service')); | ||
__export($__require('./src/dnd.draggable')); | ||
__export($__require('./src/dnd.droppable')); | ||
__export($__require('./src/dnd.sortable')); | ||
__export($__require('./src/draggable.component')); | ||
__export($__require('./src/droppable.component')); | ||
__export($__require('./src/sortable.component')); | ||
exports.DND_PROVIDERS = [dnd_config_1.DragDropConfig, dnd_service_1.DragDropService, dnd_service_1.DragDropSortableService]; | ||
exports.DND_DIRECTIVES = [dnd_draggable_1.DraggableComponent, dnd_droppable_1.DroppableComponent, dnd_sortable_1.SortableContainer, dnd_sortable_1.SortableComponent]; | ||
exports.DND_DIRECTIVES = [draggable_component_1.DraggableComponent, droppable_component_1.DroppableComponent, sortable_component_1.SortableContainer, sortable_component_1.SortableComponent]; | ||
return module.exports; | ||
}); |
@@ -1,2 +0,2 @@ | ||
System.registerDynamic("src/dnd.draggable",["@angular/core","./dnd.component","./dnd.config","./dnd.service"],!0,function(e,t,r){"use strict";var a=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var a in t)t.hasOwnProperty(a)&&(e[a]=t[a]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=this&&this.__decorate||function(e,t,r,a){var n,o=arguments.length,i=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(i=(o<3?n(i):o>3?n(t,r,i):n(t,r))||i);return o>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=e("@angular/core"),s=e("@angular/core"),c=e("./dnd.component"),l=e("./dnd.config"),d=e("./dnd.service"),p=function(e){function t(t,r,a,n){e.call(this,t,r,a,n),this.onDragStart=new s.EventEmitter,this.onDragEnd=new s.EventEmitter,this.onDragSuccessCallback=new s.EventEmitter,this._defaultCursor=this._elem.style.cursor,this.dragEnabled=!0}return a(t,e),Object.defineProperty(t.prototype,"draggable",{set:function(e){this.dragEnabled=!!e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dropzones",{set:function(e){this.dropZones=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"effectallowed",{set:function(e){this.effectAllowed=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"effectcursor",{set:function(e){this.effectCursor=e},enumerable:!0,configurable:!0}),t.prototype._onDragStartCallback=function(e){this._dragDropService.isDragged=!0,this._dragDropService.dragData=this.dragData,this._dragDropService.onDragSuccessCallback=this.onDragSuccessCallback,this._elem.classList.add(this._config.onDragStartClass),this.onDragStart.emit({dragData:this.dragData,mouseEvent:e})},t.prototype._onDragEndCallback=function(e){this._dragDropService.isDragged=!1,this._dragDropService.dragData=null,this._dragDropService.onDragSuccessCallback=null,this._elem.classList.remove(this._config.onDragStartClass),this.onDragEnd.emit({dragData:this.dragData,mouseEvent:e})},n([s.Input("dragEnabled"),o("design:type",Boolean),o("design:paramtypes",[Boolean])],t.prototype,"draggable",null),n([s.Output(),o("design:type",s.EventEmitter)],t.prototype,"onDragStart",void 0),n([s.Output(),o("design:type",s.EventEmitter)],t.prototype,"onDragEnd",void 0),n([s.Input(),o("design:type",Object)],t.prototype,"dragData",void 0),n([s.Output("onDragSuccess"),o("design:type",s.EventEmitter)],t.prototype,"onDragSuccessCallback",void 0),n([s.Input("dropZones"),o("design:type",Array),o("design:paramtypes",[Array])],t.prototype,"dropzones",null),n([s.Input("effectAllowed"),o("design:type",String),o("design:paramtypes",[String])],t.prototype,"effectallowed",null),n([s.Input("effectCursor"),o("design:type",String),o("design:paramtypes",[String])],t.prototype,"effectcursor",null),n([s.Input(),o("design:type",Object)],t.prototype,"dragImage",void 0),n([s.Input(),o("design:type",Boolean)],t.prototype,"cloneItem",void 0),t=n([s.Directive({selector:"[dnd-draggable]"}),o("design:paramtypes",[s.ElementRef,d.DragDropService,l.DragDropConfig,i.ChangeDetectorRef])],t)}(c.AbstractComponent);return t.DraggableComponent=p,r.exports}),System.registerDynamic("src/dnd.droppable",["@angular/core","./dnd.component","./dnd.config","./dnd.service"],!0,function(e,t,r){"use strict";var a=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var a in t)t.hasOwnProperty(a)&&(e[a]=t[a]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=this&&this.__decorate||function(e,t,r,a){var n,o=arguments.length,i=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(i=(o<3?n(i):o>3?n(t,r,i):n(t,r))||i);return o>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=e("@angular/core"),s=e("@angular/core"),c=e("./dnd.component"),l=e("./dnd.config"),d=e("./dnd.service"),p=function(e){function t(t,r,a,n){e.call(this,t,r,a,n),this.onDropSuccess=new s.EventEmitter,this.onDragEnter=new s.EventEmitter,this.onDragOver=new s.EventEmitter,this.onDragLeave=new s.EventEmitter,this.dropEnabled=!0}return a(t,e),Object.defineProperty(t.prototype,"droppable",{set:function(e){this.dropEnabled=!!e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowdrop",{set:function(e){this.allowDrop=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dropzones",{set:function(e){this.dropZones=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"effectallowed",{set:function(e){this.effectAllowed=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"effectcursor",{set:function(e){this.effectCursor=e},enumerable:!0,configurable:!0}),t.prototype._onDragEnterCallback=function(e){this._dragDropService.isDragged&&(this._elem.classList.add(this._config.onDragEnterClass),this.onDragEnter.emit({dragData:this._dragDropService.dragData,mouseEvent:e}))},t.prototype._onDragOverCallback=function(e){this._dragDropService.isDragged&&(this._elem.classList.add(this._config.onDragOverClass),this.onDragOver.emit({dragData:this._dragDropService.dragData,mouseEvent:e}))},t.prototype._onDragLeaveCallback=function(e){this._dragDropService.isDragged&&(this._elem.classList.remove(this._config.onDragOverClass),this._elem.classList.remove(this._config.onDragEnterClass),this.onDragLeave.emit({dragData:this._dragDropService.dragData,mouseEvent:e}))},t.prototype._onDropCallback=function(e){this._dragDropService.isDragged&&(this.onDropSuccess.emit({dragData:this._dragDropService.dragData,mouseEvent:e}),this._dragDropService.onDragSuccessCallback&&this._dragDropService.onDragSuccessCallback.emit({dragData:this._dragDropService.dragData,mouseEvent:e}),this._elem.classList.remove(this._config.onDragOverClass),this._elem.classList.remove(this._config.onDragEnterClass))},n([s.Input("dropEnabled"),o("design:type",Boolean),o("design:paramtypes",[Boolean])],t.prototype,"droppable",null),n([s.Output(),o("design:type",s.EventEmitter)],t.prototype,"onDropSuccess",void 0),n([s.Output(),o("design:type",s.EventEmitter)],t.prototype,"onDragEnter",void 0),n([s.Output(),o("design:type",s.EventEmitter)],t.prototype,"onDragOver",void 0),n([s.Output(),o("design:type",s.EventEmitter)],t.prototype,"onDragLeave",void 0),n([s.Input("allowDrop"),o("design:type",Function),o("design:paramtypes",[Function])],t.prototype,"allowdrop",null),n([s.Input("dropZones"),o("design:type",Array),o("design:paramtypes",[Array])],t.prototype,"dropzones",null),n([s.Input("effectAllowed"),o("design:type",String),o("design:paramtypes",[String])],t.prototype,"effectallowed",null),n([s.Input("effectCursor"),o("design:type",String),o("design:paramtypes",[String])],t.prototype,"effectcursor",null),t=n([s.Directive({selector:"[dnd-droppable]"}),o("design:paramtypes",[s.ElementRef,d.DragDropService,l.DragDropConfig,i.ChangeDetectorRef])],t)}(c.AbstractComponent);return t.DroppableComponent=p,r.exports}),System.registerDynamic("src/dnd.sortable",["@angular/core","./dnd.component","./dnd.config","./dnd.service"],!0,function(e,t,r){"use strict";var a=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var a in t)t.hasOwnProperty(a)&&(e[a]=t[a]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=this&&this.__decorate||function(e,t,r,a){var n,o=arguments.length,i=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(i=(o<3?n(i):o>3?n(t,r,i):n(t,r))||i);return o>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=e("@angular/core"),s=e("@angular/core"),c=e("./dnd.component"),l=e("./dnd.config"),d=e("./dnd.service"),p=function(e){function t(t,r,a,n,o){e.call(this,t,r,a,n),this._sortableDataService=o,this._sortableData=[],this.dragEnabled=!1}return a(t,e),Object.defineProperty(t.prototype,"draggable",{set:function(e){this.dragEnabled=!!e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sortableData",{get:function(){return this._sortableData},set:function(e){this._sortableData=e,this.dropEnabled=0===this._sortableData.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dropzones",{set:function(e){this.dropZones=e},enumerable:!0,configurable:!0}),t.prototype._onDragEnterCallback=function(e){if(this._sortableDataService.isDragged){var t=this._sortableDataService.sortableData[this._sortableDataService.index];this._sortableData.indexOf(t)===-1&&(this._sortableDataService.sortableData.splice(this._sortableDataService.index,1),this._sortableData.unshift(t),this._sortableDataService.sortableData=this._sortableData,this._sortableDataService.index=0),this.detectChanges()}},n([s.Input("dragEnabled"),o("design:type",Boolean),o("design:paramtypes",[Boolean])],t.prototype,"draggable",null),n([s.Input(),o("design:type",Array),o("design:paramtypes",[Array])],t.prototype,"sortableData",null),n([s.Input("dropZones"),o("design:type",Array),o("design:paramtypes",[Array])],t.prototype,"dropzones",null),t=n([s.Directive({selector:"[dnd-sortable-container]"}),o("design:paramtypes",[s.ElementRef,d.DragDropService,l.DragDropConfig,i.ChangeDetectorRef,d.DragDropSortableService])],t)}(c.AbstractComponent);t.SortableContainer=p;var g=function(e){function t(t,r,a,n,o,i){e.call(this,t,r,a,i),this._sortableContainer=n,this._sortableDataService=o,this.onDragSuccessCallback=new s.EventEmitter,this.onDragStartCallback=new s.EventEmitter,this.onDragOverCallback=new s.EventEmitter,this.onDragEndCallback=new s.EventEmitter,this.onDropSuccessCallback=new s.EventEmitter,this.dropZones=this._sortableContainer.dropZones,this.dragEnabled=!0,this.dropEnabled=!0}return a(t,e),Object.defineProperty(t.prototype,"draggable",{set:function(e){this.dragEnabled=!!e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"droppable",{set:function(e){this.dropEnabled=!!e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"effectallowed",{set:function(e){this.effectAllowed=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"effectcursor",{set:function(e){this.effectCursor=e},enumerable:!0,configurable:!0}),t.prototype._onDragStartCallback=function(e){this._sortableDataService.isDragged=!0,this._sortableDataService.sortableData=this._sortableContainer.sortableData,this._sortableDataService.index=this.index,this._sortableDataService.markSortable(this._elem),this._dragDropService.isDragged=!0,this._dragDropService.dragData=this.dragData,this._dragDropService.onDragSuccessCallback=this.onDragSuccessCallback,this.onDragStartCallback.emit(this._dragDropService.dragData)},t.prototype._onDragOverCallback=function(e){this._sortableDataService.isDragged&&this._elem!=this._sortableDataService.elem&&(this._sortableDataService.sortableData=this._sortableContainer.sortableData,this._sortableDataService.index=this.index,this._sortableDataService.markSortable(this._elem),this.onDragOverCallback.emit(this._dragDropService.dragData))},t.prototype._onDragEndCallback=function(e){this._sortableDataService.isDragged=!1,this._sortableDataService.sortableData=null,this._sortableDataService.index=null,this._sortableDataService.markSortable(null),this._dragDropService.isDragged=!1,this._dragDropService.dragData=null,this._dragDropService.onDragSuccessCallback=null,this.onDragEndCallback.emit(this._dragDropService.dragData)},t.prototype._onDragEnterCallback=function(e){if(this._sortableDataService.isDragged&&(this._sortableDataService.markSortable(this._elem),this.index!==this._sortableDataService.index||this._sortableDataService.sortableData!=this._sortableContainer.sortableData)){var t=this._sortableDataService.sortableData[this._sortableDataService.index];this._sortableDataService.sortableData.splice(this._sortableDataService.index,1),this._sortableContainer.sortableData.splice(this.index,0,t),this._sortableDataService.sortableData=this._sortableContainer.sortableData,this._sortableDataService.index=this.index}},t.prototype._onDropCallback=function(e){this._sortableDataService.isDragged&&(this.onDropSuccessCallback.emit(this._dragDropService.dragData),this._dragDropService.onDragSuccessCallback&&this._dragDropService.onDragSuccessCallback.emit(this._dragDropService.dragData),this._sortableContainer.detectChanges())},n([s.Input("sortableIndex"),o("design:type",Number)],t.prototype,"index",void 0),n([s.Input("dragEnabled"),o("design:type",Boolean),o("design:paramtypes",[Boolean])],t.prototype,"draggable",null),n([s.Input("dropEnabled"),o("design:type",Boolean),o("design:paramtypes",[Boolean])],t.prototype,"droppable",null),n([s.Input(),o("design:type",Object)],t.prototype,"dragData",void 0),n([s.Input("effectAllowed"),o("design:type",String),o("design:paramtypes",[String])],t.prototype,"effectallowed",null),n([s.Input("effectCursor"),o("design:type",String),o("design:paramtypes",[String])],t.prototype,"effectcursor",null),n([s.Output("onDragSuccess"),o("design:type",s.EventEmitter)],t.prototype,"onDragSuccessCallback",void 0),n([s.Output("onDragStart"),o("design:type",s.EventEmitter)],t.prototype,"onDragStartCallback",void 0),n([s.Output("onDragOver"),o("design:type",s.EventEmitter)],t.prototype,"onDragOverCallback",void 0),n([s.Output("onDragEnd"),o("design:type",s.EventEmitter)],t.prototype,"onDragEndCallback",void 0),n([s.Output("onDropSuccess"),o("design:type",s.EventEmitter)],t.prototype,"onDropSuccessCallback",void 0),t=n([s.Directive({selector:"[dnd-sortable]"}),o("design:paramtypes",[s.ElementRef,d.DragDropService,l.DragDropConfig,p,d.DragDropSortableService,i.ChangeDetectorRef])],t)}(c.AbstractComponent);return t.SortableComponent=g,r.exports}),System.registerDynamic("src/dnd.config",["@angular/core","./dnd.utils"],!0,function(e,t,r){"use strict";var a=this&&this.__decorate||function(e,t,r,a){var n,o=arguments.length,i=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(i=(o<3?n(i):o>3?n(t,r,i):n(t,r))||i);return o>3&&i&&Object.defineProperty(t,r,i),i},n=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=e("@angular/core"),i=e("./dnd.utils"),s=function(){function e(e){this.name=e}return e.COPY=new e("copy"),e.LINK=new e("link"),e.MOVE=new e("move"),e.NONE=new e("none"),e=a([o.Injectable(),n("design:paramtypes",[String])],e)}();t.DataTransferEffect=s;var c=function(){function e(e,t,r){if(void 0===t&&(t=0),void 0===r&&(r=0),this.imageElement=e,this.x_offset=t,this.y_offset=r,i.isString(this.imageElement)){var a=this.imageElement;this.imageElement=new HTMLImageElement,this.imageElement.src=a}}return e=a([o.Injectable(),n("design:paramtypes",[Object,Number,Number])],e)}();t.DragImage=c;var l=function(){function e(){this.onDragStartClass="dnd-drag-start",this.onDragEnterClass="dnd-drag-enter",this.onDragOverClass="dnd-drag-over",this.onSortableDragClass="dnd-sortable-drag",this.dragEffect=s.MOVE,this.dropEffect=s.MOVE,this.dragCursor="move"}return e=a([o.Injectable(),n("design:paramtypes",[])],e)}();return t.DragDropConfig=l,r.exports}),System.registerDynamic("src/dnd.service",["@angular/core","./dnd.config","./dnd.utils"],!0,function(e,t,r){"use strict";var a=this&&this.__decorate||function(e,t,r,a){var n,o=arguments.length,i=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(i=(o<3?n(i):o>3?n(t,r,i):n(t,r))||i);return o>3&&i&&Object.defineProperty(t,r,i),i},n=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=e("@angular/core"),i=e("./dnd.config"),s=e("./dnd.utils"),c=function(){function e(){this.allowedDropZones=[]}return e=a([o.Injectable(),n("design:paramtypes",[])],e)}();t.DragDropService=c;var l=function(){function e(e){this._config=e}return Object.defineProperty(e.prototype,"elem",{get:function(){return this._elem},enumerable:!0,configurable:!0}),e.prototype.markSortable=function(e){s.isPresent(this._elem)&&this._elem.classList.remove(this._config.onSortableDragClass),s.isPresent(e)&&(this._elem=e,this._elem.classList.add(this._config.onSortableDragClass))},e=a([o.Injectable(),n("design:paramtypes",[i.DragDropConfig])],e)}();return t.DragDropSortableService=l,r.exports}),System.registerDynamic("src/dnd.utils",[],!0,function(e,t,r){"use strict";function a(e){return"string"==typeof e}function n(e){return void 0!==e&&null!==e}function o(e){return"function"==typeof e}function i(e){var t=new HTMLImageElement;return t.src=e,t}function s(e){return e()}return t.isString=a,t.isPresent=n,t.isFunction=o,t.createImage=i,t.callFun=s,r.exports}),System.registerDynamic("src/dnd.component",["@angular/core","./dnd.config","./dnd.service","./dnd.utils"],!0,function(e,t,r){"use strict";var a=this&&this.__decorate||function(e,t,r,a){var n,o=arguments.length,i=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(i=(o<3?n(i):o>3?n(t,r,i):n(t,r))||i);return o>3&&i&&Object.defineProperty(t,r,i),i},n=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=e("@angular/core"),i=e("@angular/core"),s=e("./dnd.config"),c=e("./dnd.service"),l=e("./dnd.utils"),d=function(){function e(e,t,r,a){var n=this;this._dragDropService=t,this._config=r,this._cdr=a,this._dragEnabled=!1,this.dropEnabled=!1,this.dropZones=[],this.cloneItem=!1,this._elem=e.nativeElement,this._elem.ondragenter=function(e){n._onDragEnter(e)},this._elem.ondragover=function(e){return n._onDragOver(e),null!=e.dataTransfer&&(e.dataTransfer.dropEffect=n._config.dropEffect.name),!1},this._elem.ondragleave=function(e){n._onDragLeave(e)},this._elem.ondrop=function(e){n._onDrop(e)},this._elem.ondragstart=function(e){if(n._onDragStart(e),null!=e.dataTransfer){if(e.dataTransfer.setData("text",""),e.dataTransfer.effectAllowed=n.effectAllowed||n._config.dragEffect.name,l.isPresent(n.dragImage))if(l.isString(n.dragImage))e.dataTransfer.setDragImage(l.createImage(n.dragImage));else if(l.isFunction(n.dragImage))e.dataTransfer.setDragImage(l.callFun(n.dragImage));else{var t=n.dragImage;e.dataTransfer.setDragImage(t.imageElement,t.x_offset,t.y_offset)}else if(l.isPresent(n._config.dragImage)){var r=n._config.dragImage;e.dataTransfer.setDragImage(r.imageElement,r.x_offset,r.y_offset)}else n.cloneItem&&(n._dragHelper=n._elem.cloneNode(!0),n._dragHelper.classList.add("dnd-drag-item"),n._dragHelper.style.position="absolute",n._dragHelper.style.top="0px",n._dragHelper.style.left="-1000px",n._elem.parentElement.appendChild(n._dragHelper),e.dataTransfer.setDragImage(n._dragHelper,e.offsetX,e.offsetY));n._dragEnabled?n._elem.style.cursor=n.effectCursor?n.effectCursor:n._config.dragCursor:n._elem.style.cursor=n._defaultCursor}},this._elem.ondragend=function(e){n._elem.parentElement&&n._dragHelper&&n._elem.parentElement.removeChild(n._dragHelper),n._onDragEnd(e),n._elem.style.cursor=n._defaultCursor}}return Object.defineProperty(e.prototype,"dragEnabled",{get:function(){return this._dragEnabled},set:function(e){this._dragEnabled=!!e,this._elem.draggable=this._dragEnabled},enumerable:!0,configurable:!0}),e.prototype.detectChanges=function(){var e=this;setTimeout(function(){e._cdr.detectChanges()},250)},e.prototype._onDragEnter=function(e){this._isDropAllowed&&this._onDragEnterCallback(e)},e.prototype._onDragOver=function(e){this._isDropAllowed&&(e.preventDefault&&e.preventDefault(),this._onDragOverCallback(e))},e.prototype._onDragLeave=function(e){this._isDropAllowed&&this._onDragLeaveCallback(e)},e.prototype._onDrop=function(e){this._isDropAllowed&&(e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),this._onDropCallback(e),this.detectChanges())},Object.defineProperty(e.prototype,"_isDropAllowed",{get:function(){if(this._dragDropService.isDragged&&this.dropEnabled){if(this.allowDrop)return this.allowDrop(this._dragDropService.dragData);if(0===this.dropZones.length&&0===this._dragDropService.allowedDropZones.length)return!0;for(var e=0;e<this._dragDropService.allowedDropZones.length;e++){var t=this._dragDropService.allowedDropZones[e];if(this.dropZones.indexOf(t)!==-1)return!0}}return!1},enumerable:!0,configurable:!0}),e.prototype._onDragStart=function(e){this._dragEnabled&&(this._dragDropService.allowedDropZones=this.dropZones,this._onDragStartCallback(e))},e.prototype._onDragEnd=function(e){this._dragDropService.allowedDropZones=[],this._onDragEndCallback(e)},e.prototype._onDragEnterCallback=function(e){},e.prototype._onDragOverCallback=function(e){},e.prototype._onDragLeaveCallback=function(e){},e.prototype._onDropCallback=function(e){},e.prototype._onDragStartCallback=function(e){},e.prototype._onDragEndCallback=function(e){},e=a([o.Injectable(),n("design:paramtypes",[i.ElementRef,c.DragDropService,s.DragDropConfig,o.ChangeDetectorRef])],e)}();return t.AbstractComponent=d,r.exports}),System.registerDynamic("ng2-dnd",["./src/dnd.config","./src/dnd.service","./src/dnd.draggable","./src/dnd.droppable","./src/dnd.sortable","./src/dnd.component"],!0,function(e,t,r){"use strict";function a(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}var n=e("./src/dnd.config"),o=e("./src/dnd.service"),i=e("./src/dnd.draggable"),s=e("./src/dnd.droppable"),c=e("./src/dnd.sortable");return a(e("./src/dnd.component")),a(e("./src/dnd.config")),a(e("./src/dnd.service")),a(e("./src/dnd.draggable")),a(e("./src/dnd.droppable")),a(e("./src/dnd.sortable")),t.DND_PROVIDERS=[n.DragDropConfig,o.DragDropService,o.DragDropSortableService],t.DND_DIRECTIVES=[i.DraggableComponent,s.DroppableComponent,c.SortableContainer,c.SortableComponent],r.exports}); | ||
System.registerDynamic("src/draggable.component",["@angular/core","./abstract.component","./dnd.config","./dnd.service"],!0,function(e,t,r){"use strict";var a=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var a in t)t.hasOwnProperty(a)&&(e[a]=t[a]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},o=this&&this.__decorate||function(e,t,r,a){var o,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(n<3?o(i):n>3?o(t,r,i):o(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i},n=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=e("@angular/core"),s=e("@angular/core"),c=e("./abstract.component"),l=e("./dnd.config"),p=e("./dnd.service"),d=function(e){function t(t,r,a,o){e.call(this,t,r,a,o),this.onDragStart=new s.EventEmitter,this.onDragEnd=new s.EventEmitter,this.onDragSuccessCallback=new s.EventEmitter,this._defaultCursor=this._elem.style.cursor,this.dragEnabled=!0}return a(t,e),Object.defineProperty(t.prototype,"draggable",{set:function(e){this.dragEnabled=!!e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dropzones",{set:function(e){this.dropZones=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"effectallowed",{set:function(e){this.effectAllowed=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"effectcursor",{set:function(e){this.effectCursor=e},enumerable:!0,configurable:!0}),t.prototype._onDragStartCallback=function(e){this._dragDropService.isDragged=!0,this._dragDropService.dragData=this.dragData,this._dragDropService.onDragSuccessCallback=this.onDragSuccessCallback,this._elem.classList.add(this._config.onDragStartClass),this.onDragStart.emit({dragData:this.dragData,mouseEvent:e})},t.prototype._onDragEndCallback=function(e){this._dragDropService.isDragged=!1,this._dragDropService.dragData=null,this._dragDropService.onDragSuccessCallback=null,this._elem.classList.remove(this._config.onDragStartClass),this.onDragEnd.emit({dragData:this.dragData,mouseEvent:e})},o([s.Input("dragEnabled"),n("design:type",Boolean),n("design:paramtypes",[Boolean])],t.prototype,"draggable",null),o([s.Output(),n("design:type",s.EventEmitter)],t.prototype,"onDragStart",void 0),o([s.Output(),n("design:type",s.EventEmitter)],t.prototype,"onDragEnd",void 0),o([s.Input(),n("design:type",Object)],t.prototype,"dragData",void 0),o([s.Output("onDragSuccess"),n("design:type",s.EventEmitter)],t.prototype,"onDragSuccessCallback",void 0),o([s.Input("dropZones"),n("design:type",Array),n("design:paramtypes",[Array])],t.prototype,"dropzones",null),o([s.Input("effectAllowed"),n("design:type",String),n("design:paramtypes",[String])],t.prototype,"effectallowed",null),o([s.Input("effectCursor"),n("design:type",String),n("design:paramtypes",[String])],t.prototype,"effectcursor",null),o([s.Input(),n("design:type",Object)],t.prototype,"dragImage",void 0),o([s.Input(),n("design:type",Boolean)],t.prototype,"cloneItem",void 0),t=o([s.Directive({selector:"[dnd-draggable]"}),n("design:paramtypes",[s.ElementRef,p.DragDropService,l.DragDropConfig,i.ChangeDetectorRef])],t)}(c.AbstractComponent);return t.DraggableComponent=d,r.exports}),System.registerDynamic("src/droppable.component",["@angular/core","./abstract.component","./dnd.config","./dnd.service"],!0,function(e,t,r){"use strict";var a=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var a in t)t.hasOwnProperty(a)&&(e[a]=t[a]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},o=this&&this.__decorate||function(e,t,r,a){var o,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(n<3?o(i):n>3?o(t,r,i):o(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i},n=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=e("@angular/core"),s=e("@angular/core"),c=e("./abstract.component"),l=e("./dnd.config"),p=e("./dnd.service"),d=function(e){function t(t,r,a,o){e.call(this,t,r,a,o),this.onDropSuccess=new s.EventEmitter,this.onDragEnter=new s.EventEmitter,this.onDragOver=new s.EventEmitter,this.onDragLeave=new s.EventEmitter,this.dropEnabled=!0}return a(t,e),Object.defineProperty(t.prototype,"droppable",{set:function(e){this.dropEnabled=!!e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowdrop",{set:function(e){this.allowDrop=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dropzones",{set:function(e){this.dropZones=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"effectallowed",{set:function(e){this.effectAllowed=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"effectcursor",{set:function(e){this.effectCursor=e},enumerable:!0,configurable:!0}),t.prototype._onDragEnterCallback=function(e){this._dragDropService.isDragged&&(this._elem.classList.add(this._config.onDragEnterClass),this.onDragEnter.emit({dragData:this._dragDropService.dragData,mouseEvent:e}))},t.prototype._onDragOverCallback=function(e){this._dragDropService.isDragged&&(this._elem.classList.add(this._config.onDragOverClass),this.onDragOver.emit({dragData:this._dragDropService.dragData,mouseEvent:e}))},t.prototype._onDragLeaveCallback=function(e){this._dragDropService.isDragged&&(this._elem.classList.remove(this._config.onDragOverClass),this._elem.classList.remove(this._config.onDragEnterClass),this.onDragLeave.emit({dragData:this._dragDropService.dragData,mouseEvent:e}))},t.prototype._onDropCallback=function(e){this._dragDropService.isDragged&&(this.onDropSuccess.emit({dragData:this._dragDropService.dragData,mouseEvent:e}),this._dragDropService.onDragSuccessCallback&&this._dragDropService.onDragSuccessCallback.emit({dragData:this._dragDropService.dragData,mouseEvent:e}),this._elem.classList.remove(this._config.onDragOverClass),this._elem.classList.remove(this._config.onDragEnterClass))},o([s.Input("dropEnabled"),n("design:type",Boolean),n("design:paramtypes",[Boolean])],t.prototype,"droppable",null),o([s.Output(),n("design:type",s.EventEmitter)],t.prototype,"onDropSuccess",void 0),o([s.Output(),n("design:type",s.EventEmitter)],t.prototype,"onDragEnter",void 0),o([s.Output(),n("design:type",s.EventEmitter)],t.prototype,"onDragOver",void 0),o([s.Output(),n("design:type",s.EventEmitter)],t.prototype,"onDragLeave",void 0),o([s.Input("allowDrop"),n("design:type",Function),n("design:paramtypes",[Function])],t.prototype,"allowdrop",null),o([s.Input("dropZones"),n("design:type",Array),n("design:paramtypes",[Array])],t.prototype,"dropzones",null),o([s.Input("effectAllowed"),n("design:type",String),n("design:paramtypes",[String])],t.prototype,"effectallowed",null),o([s.Input("effectCursor"),n("design:type",String),n("design:paramtypes",[String])],t.prototype,"effectcursor",null),t=o([s.Directive({selector:"[dnd-droppable]"}),n("design:paramtypes",[s.ElementRef,p.DragDropService,l.DragDropConfig,i.ChangeDetectorRef])],t)}(c.AbstractComponent);return t.DroppableComponent=d,r.exports}),System.registerDynamic("src/sortable.component",["@angular/core","./abstract.component","./dnd.config","./dnd.service"],!0,function(e,t,r){"use strict";var a=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var a in t)t.hasOwnProperty(a)&&(e[a]=t[a]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},o=this&&this.__decorate||function(e,t,r,a){var o,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(n<3?o(i):n>3?o(t,r,i):o(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i},n=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=e("@angular/core"),s=e("@angular/core"),c=e("./abstract.component"),l=e("./dnd.config"),p=e("./dnd.service"),d=function(e){function t(t,r,a,o,n){e.call(this,t,r,a,o),this._sortableDataService=n,this._sortableData=[],this.dragEnabled=!1}return a(t,e),Object.defineProperty(t.prototype,"draggable",{set:function(e){this.dragEnabled=!!e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sortableData",{get:function(){return this._sortableData},set:function(e){this._sortableData=e,this.dropEnabled=0===this._sortableData.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dropzones",{set:function(e){this.dropZones=e},enumerable:!0,configurable:!0}),t.prototype._onDragEnterCallback=function(e){if(this._sortableDataService.isDragged){var t=this._sortableDataService.sortableData[this._sortableDataService.index];this._sortableData.indexOf(t)===-1&&(this._sortableDataService.sortableData.splice(this._sortableDataService.index,1),this._sortableData.unshift(t),this._sortableDataService.sortableData=this._sortableData,this._sortableDataService.index=0),this.detectChanges()}},o([s.Input("dragEnabled"),n("design:type",Boolean),n("design:paramtypes",[Boolean])],t.prototype,"draggable",null),o([s.Input(),n("design:type",Array),n("design:paramtypes",[Array])],t.prototype,"sortableData",null),o([s.Input("dropZones"),n("design:type",Array),n("design:paramtypes",[Array])],t.prototype,"dropzones",null),t=o([s.Directive({selector:"[dnd-sortable-container]"}),n("design:paramtypes",[s.ElementRef,p.DragDropService,l.DragDropConfig,i.ChangeDetectorRef,p.DragDropSortableService])],t)}(c.AbstractComponent);t.SortableContainer=d;var g=function(e){function t(t,r,a,o,n,i){e.call(this,t,r,a,i),this._sortableContainer=o,this._sortableDataService=n,this.onDragSuccessCallback=new s.EventEmitter,this.onDragStartCallback=new s.EventEmitter,this.onDragOverCallback=new s.EventEmitter,this.onDragEndCallback=new s.EventEmitter,this.onDropSuccessCallback=new s.EventEmitter,this.dropZones=this._sortableContainer.dropZones,this.dragEnabled=!0,this.dropEnabled=!0}return a(t,e),Object.defineProperty(t.prototype,"draggable",{set:function(e){this.dragEnabled=!!e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"droppable",{set:function(e){this.dropEnabled=!!e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"effectallowed",{set:function(e){this.effectAllowed=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"effectcursor",{set:function(e){this.effectCursor=e},enumerable:!0,configurable:!0}),t.prototype._onDragStartCallback=function(e){this._sortableDataService.isDragged=!0,this._sortableDataService.sortableData=this._sortableContainer.sortableData,this._sortableDataService.index=this.index,this._sortableDataService.markSortable(this._elem),this._dragDropService.isDragged=!0,this._dragDropService.dragData=this.dragData,this._dragDropService.onDragSuccessCallback=this.onDragSuccessCallback,this.onDragStartCallback.emit(this._dragDropService.dragData)},t.prototype._onDragOverCallback=function(e){this._sortableDataService.isDragged&&this._elem!=this._sortableDataService.elem&&(this._sortableDataService.sortableData=this._sortableContainer.sortableData,this._sortableDataService.index=this.index,this._sortableDataService.markSortable(this._elem),this.onDragOverCallback.emit(this._dragDropService.dragData))},t.prototype._onDragEndCallback=function(e){this._sortableDataService.isDragged=!1,this._sortableDataService.sortableData=null,this._sortableDataService.index=null,this._sortableDataService.markSortable(null),this._dragDropService.isDragged=!1,this._dragDropService.dragData=null,this._dragDropService.onDragSuccessCallback=null,this.onDragEndCallback.emit(this._dragDropService.dragData)},t.prototype._onDragEnterCallback=function(e){if(this._sortableDataService.isDragged&&(this._sortableDataService.markSortable(this._elem),this.index!==this._sortableDataService.index||this._sortableDataService.sortableData!=this._sortableContainer.sortableData)){var t=this._sortableDataService.sortableData[this._sortableDataService.index];this._sortableDataService.sortableData.splice(this._sortableDataService.index,1),this._sortableContainer.sortableData.splice(this.index,0,t),this._sortableDataService.sortableData=this._sortableContainer.sortableData,this._sortableDataService.index=this.index}},t.prototype._onDropCallback=function(e){this._sortableDataService.isDragged&&(this.onDropSuccessCallback.emit(this._dragDropService.dragData),this._dragDropService.onDragSuccessCallback&&this._dragDropService.onDragSuccessCallback.emit(this._dragDropService.dragData),this._sortableContainer.detectChanges())},o([s.Input("sortableIndex"),n("design:type",Number)],t.prototype,"index",void 0),o([s.Input("dragEnabled"),n("design:type",Boolean),n("design:paramtypes",[Boolean])],t.prototype,"draggable",null),o([s.Input("dropEnabled"),n("design:type",Boolean),n("design:paramtypes",[Boolean])],t.prototype,"droppable",null),o([s.Input(),n("design:type",Object)],t.prototype,"dragData",void 0),o([s.Input("effectAllowed"),n("design:type",String),n("design:paramtypes",[String])],t.prototype,"effectallowed",null),o([s.Input("effectCursor"),n("design:type",String),n("design:paramtypes",[String])],t.prototype,"effectcursor",null),o([s.Output("onDragSuccess"),n("design:type",s.EventEmitter)],t.prototype,"onDragSuccessCallback",void 0),o([s.Output("onDragStart"),n("design:type",s.EventEmitter)],t.prototype,"onDragStartCallback",void 0),o([s.Output("onDragOver"),n("design:type",s.EventEmitter)],t.prototype,"onDragOverCallback",void 0),o([s.Output("onDragEnd"),n("design:type",s.EventEmitter)],t.prototype,"onDragEndCallback",void 0),o([s.Output("onDropSuccess"),n("design:type",s.EventEmitter)],t.prototype,"onDropSuccessCallback",void 0),t=o([s.Directive({selector:"[dnd-sortable]"}),n("design:paramtypes",[s.ElementRef,p.DragDropService,l.DragDropConfig,d,p.DragDropSortableService,i.ChangeDetectorRef])],t)}(c.AbstractComponent);return t.SortableComponent=g,r.exports}),System.registerDynamic("src/dnd.config",["@angular/core","./dnd.utils"],!0,function(e,t,r){"use strict";var a=this&&this.__decorate||function(e,t,r,a){var o,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(n<3?o(i):n>3?o(t,r,i):o(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},n=e("@angular/core"),i=e("./dnd.utils"),s=function(){function e(e){this.name=e}return e.COPY=new e("copy"),e.LINK=new e("link"),e.MOVE=new e("move"),e.NONE=new e("none"),e=a([n.Injectable(),o("design:paramtypes",[String])],e)}();t.DataTransferEffect=s;var c=function(){function e(e,t,r){if(void 0===t&&(t=0),void 0===r&&(r=0),this.imageElement=e,this.x_offset=t,this.y_offset=r,i.isString(this.imageElement)){var a=this.imageElement;this.imageElement=new HTMLImageElement,this.imageElement.src=a}}return e=a([n.Injectable(),o("design:paramtypes",[Object,Number,Number])],e)}();t.DragImage=c;var l=function(){function e(){this.onDragStartClass="dnd-drag-start",this.onDragEnterClass="dnd-drag-enter",this.onDragOverClass="dnd-drag-over",this.onSortableDragClass="dnd-sortable-drag",this.dragEffect=s.MOVE,this.dropEffect=s.MOVE,this.dragCursor="move"}return e=a([n.Injectable(),o("design:paramtypes",[])],e)}();return t.DragDropConfig=l,r.exports}),System.registerDynamic("src/dnd.service",["@angular/core","./dnd.config","./dnd.utils"],!0,function(e,t,r){"use strict";var a=this&&this.__decorate||function(e,t,r,a){var o,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(n<3?o(i):n>3?o(t,r,i):o(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},n=e("@angular/core"),i=e("./dnd.config"),s=e("./dnd.utils"),c=function(){function e(){this.allowedDropZones=[]}return e=a([n.Injectable(),o("design:paramtypes",[])],e)}();t.DragDropService=c;var l=function(){function e(e){this._config=e}return Object.defineProperty(e.prototype,"elem",{get:function(){return this._elem},enumerable:!0,configurable:!0}),e.prototype.markSortable=function(e){s.isPresent(this._elem)&&this._elem.classList.remove(this._config.onSortableDragClass),s.isPresent(e)&&(this._elem=e,this._elem.classList.add(this._config.onSortableDragClass))},e=a([n.Injectable(),o("design:paramtypes",[i.DragDropConfig])],e)}();return t.DragDropSortableService=l,r.exports}),System.registerDynamic("src/dnd.utils",[],!0,function(e,t,r){"use strict";function a(e){return"string"==typeof e}function o(e){return void 0!==e&&null!==e}function n(e){return"function"==typeof e}function i(e){var t=new HTMLImageElement;return t.src=e,t}function s(e){return e()}return t.isString=a,t.isPresent=o,t.isFunction=n,t.createImage=i,t.callFun=s,r.exports}),System.registerDynamic("src/abstract.component",["@angular/core","./dnd.config","./dnd.service","./dnd.utils"],!0,function(e,t,r){"use strict";var a=this&&this.__decorate||function(e,t,r,a){var o,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(n<3?o(i):n>3?o(t,r,i):o(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},n=e("@angular/core"),i=e("@angular/core"),s=e("./dnd.config"),c=e("./dnd.service"),l=e("./dnd.utils"),p=function(){function e(e,t,r,a){var o=this;this._dragDropService=t,this._config=r,this._cdr=a,this._dragEnabled=!1,this.dropEnabled=!1,this.dropZones=[],this.cloneItem=!1,this._elem=e.nativeElement,this._elem.ondragenter=function(e){o._onDragEnter(e)},this._elem.ondragover=function(e){return o._onDragOver(e),null!=e.dataTransfer&&(e.dataTransfer.dropEffect=o._config.dropEffect.name),!1},this._elem.ondragleave=function(e){o._onDragLeave(e)},this._elem.ondrop=function(e){o._onDrop(e)},this._elem.ondragstart=function(e){if(o._onDragStart(e),null!=e.dataTransfer){if(e.dataTransfer.setData("text",""),e.dataTransfer.effectAllowed=o.effectAllowed||o._config.dragEffect.name,l.isPresent(o.dragImage))if(l.isString(o.dragImage))e.dataTransfer.setDragImage(l.createImage(o.dragImage));else if(l.isFunction(o.dragImage))e.dataTransfer.setDragImage(l.callFun(o.dragImage));else{var t=o.dragImage;e.dataTransfer.setDragImage(t.imageElement,t.x_offset,t.y_offset)}else if(l.isPresent(o._config.dragImage)){var r=o._config.dragImage;e.dataTransfer.setDragImage(r.imageElement,r.x_offset,r.y_offset)}else o.cloneItem&&(o._dragHelper=o._elem.cloneNode(!0),o._dragHelper.classList.add("dnd-drag-item"),o._dragHelper.style.position="absolute",o._dragHelper.style.top="0px",o._dragHelper.style.left="-1000px",o._elem.parentElement.appendChild(o._dragHelper),e.dataTransfer.setDragImage(o._dragHelper,e.offsetX,e.offsetY));o._dragEnabled?o._elem.style.cursor=o.effectCursor?o.effectCursor:o._config.dragCursor:o._elem.style.cursor=o._defaultCursor}},this._elem.ondragend=function(e){o._elem.parentElement&&o._dragHelper&&o._elem.parentElement.removeChild(o._dragHelper),o._onDragEnd(e),o._elem.style.cursor=o._defaultCursor}}return Object.defineProperty(e.prototype,"dragEnabled",{get:function(){return this._dragEnabled},set:function(e){this._dragEnabled=!!e,this._elem.draggable=this._dragEnabled},enumerable:!0,configurable:!0}),e.prototype.detectChanges=function(){var e=this;setTimeout(function(){e._cdr.detectChanges()},250)},e.prototype._onDragEnter=function(e){this._isDropAllowed&&this._onDragEnterCallback(e)},e.prototype._onDragOver=function(e){this._isDropAllowed&&(e.preventDefault&&e.preventDefault(),this._onDragOverCallback(e))},e.prototype._onDragLeave=function(e){this._isDropAllowed&&this._onDragLeaveCallback(e)},e.prototype._onDrop=function(e){this._isDropAllowed&&(e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),this._onDropCallback(e),this.detectChanges())},Object.defineProperty(e.prototype,"_isDropAllowed",{get:function(){if(this._dragDropService.isDragged&&this.dropEnabled){if(this.allowDrop)return this.allowDrop(this._dragDropService.dragData);if(0===this.dropZones.length&&0===this._dragDropService.allowedDropZones.length)return!0;for(var e=0;e<this._dragDropService.allowedDropZones.length;e++){var t=this._dragDropService.allowedDropZones[e];if(this.dropZones.indexOf(t)!==-1)return!0}}return!1},enumerable:!0,configurable:!0}),e.prototype._onDragStart=function(e){this._dragEnabled&&(this._dragDropService.allowedDropZones=this.dropZones,this._onDragStartCallback(e))},e.prototype._onDragEnd=function(e){this._dragDropService.allowedDropZones=[],this._onDragEndCallback(e)},e.prototype._onDragEnterCallback=function(e){},e.prototype._onDragOverCallback=function(e){},e.prototype._onDragLeaveCallback=function(e){},e.prototype._onDropCallback=function(e){},e.prototype._onDragStartCallback=function(e){},e.prototype._onDragEndCallback=function(e){},e=a([n.Injectable(),o("design:paramtypes",[i.ElementRef,c.DragDropService,s.DragDropConfig,n.ChangeDetectorRef])],e)}();return t.AbstractComponent=p,r.exports}),System.registerDynamic("index",["./src/dnd.config","./src/dnd.service","./src/draggable.component","./src/droppable.component","./src/sortable.component","./src/abstract.component"],!0,function(e,t,r){"use strict";function a(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}var o=e("./src/dnd.config"),n=e("./src/dnd.service"),i=e("./src/draggable.component"),s=e("./src/droppable.component"),c=e("./src/sortable.component");return a(e("./src/abstract.component")),a(e("./src/dnd.config")),a(e("./src/dnd.service")),a(e("./src/draggable.component")),a(e("./src/droppable.component")),a(e("./src/sortable.component")),t.DND_PROVIDERS=[o.DragDropConfig,n.DragDropService,n.DragDropSortableService],t.DND_DIRECTIVES=[i.DraggableComponent,s.DroppableComponent,c.SortableContainer,c.SortableComponent],r.exports}); | ||
//# sourceMappingURL=bundles/ng2-dnd.min.js.map |
{ | ||
"name": "ng2-dnd", | ||
"description": "Angular 2 Drag-and-Drop without dependencies", | ||
"main": "index.js", | ||
"version": "1.13.0", | ||
"scripts": { | ||
@@ -29,18 +29,21 @@ "test": "tsc && karma start", | ||
}, | ||
"main": "index.js", | ||
"typings": "index", | ||
"homepage": "https://github.com/akserg/ng2-dnd#readme", | ||
"dependencies": { | ||
"es6-shim": "^0.35.0", | ||
"core-js": "^2.4.1", | ||
"reflect-metadata": "^0.1.3", | ||
"rxjs": "5.0.0-beta.6", | ||
"zone.js": "^0.6.12" | ||
"rxjs": "5.0.0-beta.11", | ||
"zone.js": "^0.6.17" | ||
}, | ||
"devDependencies": { | ||
"@angular/common": "^2.0.0-rc.4", | ||
"@angular/compiler": "^2.0.0-rc.4", | ||
"@angular/core": "^2.0.0-rc.4", | ||
"@angular/platform-browser": "^2.0.0-rc.4", | ||
"@angular/platform-browser-dynamic": "^2.0.0-rc.4", | ||
"cz-conventional-changelog": "^1.1.6", | ||
"@angular/common": "^2.0.0-rc.5", | ||
"@angular/compiler": "^2.0.0-rc.5", | ||
"@angular/core": "^2.0.0-rc.5", | ||
"@angular/platform-browser": "^2.0.0-rc.5", | ||
"@angular/platform-browser-dynamic": "^2.0.0-rc.5", | ||
"commitizen": "^2.7.6", | ||
"cz-conventional-changelog": "^1.1.5", | ||
"jasmine-core": "~2.3.4", | ||
"karma": "~0.13.15", | ||
"karma": "~0.13.20", | ||
"karma-chrome-launcher": "~0.2.2", | ||
@@ -51,4 +54,4 @@ "karma-firefox-launcher": "~0.1.7", | ||
"semantic-release": "^4.3.5", | ||
"systemjs": "^0.19.27", | ||
"systemjs-builder": "^0.15.16", | ||
"systemjs": "~0.19.6", | ||
"systemjs-builder": "^0.15.6", | ||
"typescript": "^1.8.7", | ||
@@ -62,4 +65,3 @@ "typings": "^0.8.1", | ||
} | ||
}, | ||
"version": "1.12.0" | ||
} | ||
} |
108
README.md
@@ -12,2 +12,4 @@ # Angular 2 Drag-and-Drop [![npm version](https://badge.fury.io/js/ng2-dnd.svg)](https://badge.fury.io/js/ng2-dnd) [![npm monthly downloads](https://img.shields.io/npm/dm/ng2-dnd.svg?style=flat-square)](https://www.npmjs.com/package/ng2-dnd) | ||
_Some of these APIs and Components are not final and are subject to change!_ | ||
## Installation | ||
@@ -19,3 +21,2 @@ ```bash | ||
## Demo | ||
Simple examples using ng2-dnd: | ||
@@ -40,20 +41,31 @@ - with SystemJS in [ng2-systemjs-demo](https://github.com/akserg/ng2-systemjs-demo) | ||
If you use SystemJS to load your files, you might have to update your config: | ||
```js | ||
System.config({ | ||
map: { | ||
'ng2-dnd': 'node_modules/ng2-dnd' | ||
}, | ||
packages: { | ||
'ng2-dnd': { main: 'index.js', defaultExtension: 'js' }, | ||
} | ||
}); | ||
``` | ||
Finally, you can use *ng2-dnd* in your Angular 2 project: | ||
- Import `DND_PROVIDERS, DND_DIRECTIVES` from `ng2-dnd/ng2-dnd`; | ||
- Use `DND_PROVIDERS` in the bootstrap of your application; | ||
- Import `DND_PROVIDERS, DND_DIRECTIVES` from `ng2-dnd`; | ||
- Use `DND_PROVIDERS` in the `providers` property of your application component; | ||
- Add `DND_DIRECTIVES` to the `directives` property of your application component; | ||
- Use `dnd-draggable` and `dnd-droppable` properties in template of your components. | ||
- Use `dnd-draggable`, `dnd-droppable`, `dnd-sortable` and `dnd-sortable-container` properties in template of your components. | ||
- Inject style into your web page | ||
```js | ||
import {Component} from '@angular/core'; | ||
import {DND_PROVIDERS, DND_DIRECTIVES} from 'ng2-dnd/ng2-dnd'; | ||
import {bootstrap} from '@angular/platform-browser-dynamic'; | ||
import {DND_PROVIDERS, DND_DIRECTIVES} from 'ng2-dnd'; | ||
import {bootstrap} from '@angular/platform/browser'; | ||
bootstrap(AppComponent, [ | ||
DND_PROVIDERS // It is required to have 1 unique instance of your service | ||
]); | ||
@Component({ | ||
selector: 'app', | ||
directives: [DND_DIRECTIVES], | ||
providers: [DND_PROVIDERS] | ||
template: ` | ||
@@ -91,7 +103,5 @@ <h4>Simple Drag-and-Drop</h4> | ||
}) | ||
export class AppComponent { | ||
export class AppComponent { } | ||
constructor() { } | ||
} | ||
bootstrap(AppComponent); | ||
``` | ||
@@ -104,12 +114,9 @@ | ||
import {Component} from '@angular/core'; | ||
import {DND_PROVIDERS, DND_DIRECTIVES} from 'ng2-dnd/ng2-dnd'; | ||
import {bootstrap} from '@angular/platform-browser-dynamic'; | ||
import {DND_PROVIDERS, DND_DIRECTIVES} from 'ng2-dnd'; | ||
import {bootstrap} from '@angular/platform/browser'; | ||
bootstrap(AppComponent, [ | ||
DND_PROVIDERS // It is required to have 1 unique instance of your service | ||
]); | ||
@Component({ | ||
selector: 'app', | ||
directives: [DND_DIRECTIVES], | ||
providers: [DND_PROVIDERS] | ||
template: ` | ||
@@ -162,7 +169,5 @@ <h4>Restricting Drag-and-Drop with zones</h4> | ||
}) | ||
export class AppComponent { | ||
export class AppComponent { } | ||
constructor() { } | ||
} | ||
bootstrap(AppComponent); | ||
``` | ||
@@ -175,8 +180,5 @@ | ||
import {Component} from '@angular/core'; | ||
import {DND_PROVIDERS, DND_DIRECTIVES} from 'ng2-dnd/ng2-dnd'; | ||
import {bootstrap} from '@angular/platform-browser-dynamic'; | ||
import {DND_PROVIDERS, DND_DIRECTIVES} from 'ng2-dnd'; | ||
import {bootstrap} from '@angular/platform/browser'; | ||
bootstrap(AppComponent, [ | ||
DND_PROVIDERS // It is required to have 1 unique instance of your service | ||
]); | ||
@@ -186,2 +188,3 @@ @Component({ | ||
directives: [DND_DIRECTIVES], | ||
providers: [DND_PROVIDERS] | ||
template: ` | ||
@@ -236,2 +239,4 @@ <h4>Transfer custom data in Drag-and-Drop</h4> | ||
} | ||
bootstrap(AppComponent); | ||
``` | ||
@@ -250,12 +255,9 @@ | ||
import {Component} from '@angular/core'; | ||
import {DND_PROVIDERS, DND_DIRECTIVES} from 'ng2-dnd/ng2-dnd'; | ||
import {bootstrap} from '@angular/platform-browser-dynamic'; | ||
import {DND_PROVIDERS, DND_DIRECTIVES} from 'ng2-dnd'; | ||
import {bootstrap} from '@angular/platform/browser'; | ||
bootstrap(AppComponent, [ | ||
DND_PROVIDERS // It is required to have 1 unique instance of your service | ||
]); | ||
@Component({ | ||
selector: 'app', | ||
directives: [DND_DIRECTIVES], | ||
providers: [DND_PROVIDERS] | ||
template: ` | ||
@@ -324,2 +326,4 @@ <h4>Use a custom function to determine where dropping is allowed</h4> | ||
} | ||
bootstrap(AppComponent); | ||
``` | ||
@@ -332,12 +336,9 @@ | ||
import {Component} from '@angular/core'; | ||
import {DND_PROVIDERS, DND_DIRECTIVES} from 'ng2-dnd/ng2-dnd'; | ||
import {bootstrap} from '@angular/platform-browser-dynamic'; | ||
import {DND_PROVIDERS, DND_DIRECTIVES} from 'ng2-dnd'; | ||
import {bootstrap} from '@angular/platform/browser'; | ||
bootstrap(AppComponent, [ | ||
DND_PROVIDERS // It is required to have 1 unique instance of your service | ||
]); | ||
@Component({ | ||
selector: 'app', | ||
directives: [DND_DIRECTIVES], | ||
providers: [DND_PROVIDERS] | ||
template: ` | ||
@@ -423,4 +424,5 @@ <h4>Shopping basket</h4> | ||
} | ||
} | ||
} | ||
bootstrap(AppComponent); | ||
``` | ||
@@ -433,12 +435,9 @@ | ||
import {Component} from '@angular/core'; | ||
import {DND_PROVIDERS, DND_DIRECTIVES} from 'ng2-dnd/ng2-dnd'; | ||
import {bootstrap} from '@angular/platform-browser-dynamic'; | ||
import {DND_PROVIDERS, DND_DIRECTIVES} from 'ng2-dnd'; | ||
import {bootstrap} from '@angular/platform/browser'; | ||
bootstrap(AppComponent, [ | ||
DND_PROVIDERS // It is required to have 1 unique instance of your service | ||
]); | ||
@Component({ | ||
selector: 'app', | ||
directives: [DND_DIRECTIVES], | ||
providers: [DND_PROVIDERS] | ||
template: ` | ||
@@ -472,2 +471,4 @@ <h4>Simple sortable</h4> | ||
} | ||
bootstrap(AppComponent); | ||
``` | ||
@@ -480,12 +481,9 @@ | ||
import {Component} from '@angular/core'; | ||
import {DND_PROVIDERS, DND_DIRECTIVES} from 'ng2-dnd/ng2-dnd'; | ||
import {bootstrap} from '@angular/platform-browser-dynamic'; | ||
import {DND_PROVIDERS, DND_DIRECTIVES} from 'ng2-dnd'; | ||
import {bootstrap} from '@angular/platform/browser'; | ||
bootstrap(AppComponent, [ | ||
DND_PROVIDERS // It is required to have 1 unique instance of your service | ||
]); | ||
@Component({ | ||
selector: 'app', | ||
directives: [DND_DIRECTIVES], | ||
providers: [DND_PROVIDERS] | ||
template: ` | ||
@@ -537,2 +535,4 @@ <h4>Multi list sortable</h4> | ||
} | ||
bootstrap(AppComponent); | ||
``` | ||
@@ -539,0 +539,0 @@ # Credits |
Sorry, the diff of this file is not supported yet
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
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
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
0
175967
19
34
2911
1
+ Addedcore-js@^2.4.1
+ Addedcore-js@2.6.12(transitive)
+ Addedrxjs@5.0.0-beta.11(transitive)
+ Addedsymbol-observable@1.2.0(transitive)
- Removedes6-shim@^0.35.0
- Removedes6-shim@0.35.8(transitive)
- Removedrxjs@5.0.0-beta.6(transitive)
Updatedrxjs@5.0.0-beta.11
Updatedzone.js@^0.6.17