ng2-drag-n-drop
Advanced tools
Comparing version 1.0.4 to 1.1.0
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/forms')) : | ||
typeof define === 'function' && define.amd ? define(['exports', '@angular/core', '@angular/forms'], factory) : | ||
(factory((global['ng2-dnd'] = {}),global.ng.core,global.ng.forms)); | ||
typeof define === 'function' && define.amd ? define('ng2-drag-n-drop', ['exports', '@angular/core', '@angular/forms'], factory) : | ||
(factory((global['ng2-drag-n-drop'] = {}),global.ng.core,global.ng.forms)); | ||
}(this, (function (exports,core,forms) { 'use strict'; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. All rights reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use | ||
this file except in compliance with the License. You may obtain a copy of the | ||
License at http://www.apache.org/licenses/LICENSE-2.0 | ||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED | ||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, | ||
MERCHANTABLITY OR NON-INFRINGEMENT. | ||
See the Apache Version 2.0 License for specific language governing permissions | ||
and limitations under the License. | ||
***************************************************************************** */ | ||
/* global Reflect, Promise */ | ||
var extendStatics = function(d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
// Copyright (C) 2016-2018 Sergey Akopkokhyants | ||
// This project is licensed under the terms of the MIT license. | ||
// https://github.com/akserg/ng2-dnd | ||
/** | ||
* Check and return true if an object is type of string | ||
*/ | ||
return extendStatics(d, b); | ||
}; | ||
function __extends(d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
} | ||
function isString(obj) { | ||
return typeof obj === "string"; | ||
} | ||
/** | ||
* Check and return true if an object not undefined or null | ||
*/ | ||
function isPresent(obj) { | ||
return obj !== undefined && obj !== null; | ||
} | ||
/** | ||
* Check and return true if an object is type of Function | ||
*/ | ||
function isFunction(obj) { | ||
return typeof obj === "function"; | ||
} | ||
/** | ||
* Create Image element with specified url string | ||
*/ | ||
function createImage(src) { | ||
@@ -46,11 +46,5 @@ var img = new HTMLImageElement(); | ||
} | ||
/** | ||
* Call the function | ||
*/ | ||
function callFun(fun) { | ||
return fun(); | ||
} | ||
// Copyright (C) 2016-2018 Sergey Akopkokhyants | ||
// This project is licensed under the terms of the MIT license. | ||
// https://github.com/akserg/ng2-dnd | ||
var DataTransferEffect = /** @class */ (function () { | ||
@@ -74,6 +68,5 @@ function DataTransferEffect(name) { | ||
if (isString(this.imageElement)) { | ||
// Create real image from string source | ||
var imgScr = this.imageElement; | ||
var imgScr = (this.imageElement); | ||
this.imageElement = new HTMLImageElement(); | ||
this.imageElement.src = imgScr; | ||
((this.imageElement)).src = imgScr; | ||
} | ||
@@ -96,19 +89,2 @@ } | ||
}()); | ||
// Copyright (C) 2016-2018 Sergey Akopkokhyants | ||
// This project is licensed under the terms of the MIT license. | ||
// https://github.com/akserg/ng2-dnd | ||
var __decorate$1 = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") | ||
r = Reflect.decorate(decorators, target, key, desc); | ||
else | ||
for (var i = decorators.length - 1; i >= 0; i--) | ||
if (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; | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") | ||
return Reflect.metadata(k, v); | ||
}; | ||
var DragDropData = /** @class */ (function () { | ||
@@ -120,5 +96,5 @@ function DragDropData() { | ||
function dragDropServiceFactory() { | ||
return new exports.DragDropService(); | ||
return new DragDropService(); | ||
} | ||
exports.DragDropService = /** @class */ (function () { | ||
var DragDropService = /** @class */ (function () { | ||
function DragDropService() { | ||
@@ -129,9 +105,9 @@ this.allowedDropZones = []; | ||
}()); | ||
exports.DragDropService = __decorate$1([ | ||
core.Injectable() | ||
], exports.DragDropService); | ||
DragDropService.decorators = [ | ||
{ type: core.Injectable }, | ||
]; | ||
function dragDropSortableServiceFactory(config) { | ||
return new exports.DragDropSortableService(config); | ||
return new DragDropSortableService(config); | ||
} | ||
exports.DragDropSortableService = /** @class */ (function () { | ||
var DragDropSortableService = /** @class */ (function () { | ||
function DragDropSortableService(_config) { | ||
@@ -158,24 +134,9 @@ this._config = _config; | ||
}()); | ||
exports.DragDropSortableService = __decorate$1([ | ||
core.Injectable(), | ||
__metadata("design:paramtypes", [DragDropConfig]) | ||
], exports.DragDropSortableService); | ||
// Copyright (C) 2016-2018 Sergey Akopkokhyants | ||
// This project is licensed under the terms of the MIT license. | ||
// https://github.com/akserg/ng2-dnd | ||
var __decorate$3 = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") | ||
r = Reflect.decorate(decorators, target, key, desc); | ||
else | ||
for (var i = decorators.length - 1; i >= 0; i--) | ||
if (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; | ||
}; | ||
var __metadata$2 = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") | ||
return Reflect.metadata(k, v); | ||
}; | ||
exports.AbstractComponent = /** @class */ (function () { | ||
DragDropSortableService.decorators = [ | ||
{ type: core.Injectable }, | ||
]; | ||
DragDropSortableService.ctorParameters = function () { return [ | ||
{ type: DragDropConfig, }, | ||
]; }; | ||
var AbstractComponent = /** @class */ (function () { | ||
function AbstractComponent(elemRef, _dragDropService, _config, _cdr) { | ||
@@ -186,19 +147,9 @@ var _this = this; | ||
this._cdr = _cdr; | ||
/** | ||
* Whether the object is draggable. Default is true. | ||
*/ | ||
this._dragEnabled = false; | ||
/** | ||
* Allows drop on this element | ||
*/ | ||
this.dropEnabled = false; | ||
this.dropZones = []; | ||
this.cloneItem = false; | ||
// Assign default cursor unless overridden | ||
this._defaultCursor = _config.defaultCursor; | ||
this._elem = elemRef.nativeElement; | ||
this._elem.style.cursor = this._defaultCursor; // set default cursor on our element | ||
// | ||
// DROP events | ||
// | ||
this._elem.style.cursor = this._defaultCursor; | ||
this._elem.ondragenter = function (event) { | ||
@@ -209,3 +160,2 @@ _this._onDragEnter(event); | ||
_this._onDragOver(event); | ||
// | ||
if (event.dataTransfer != null) { | ||
@@ -222,5 +172,2 @@ event.dataTransfer.dropEffect = _this._config.dropEffect.name; | ||
}; | ||
// | ||
// Drag events | ||
// | ||
this._elem.onmousedown = function (event) { | ||
@@ -231,3 +178,3 @@ _this._target = event.target; | ||
if (_this._dragHandle) { | ||
if (!_this._dragHandle.contains(_this._target)) { | ||
if (!_this._dragHandle.contains((_this._target))) { | ||
event.preventDefault(); | ||
@@ -238,18 +185,15 @@ return; | ||
_this._onDragStart(event); | ||
// | ||
if (event.dataTransfer != null) { | ||
event.dataTransfer.setData('text', ''); | ||
// Change drag effect | ||
event.dataTransfer.effectAllowed = _this.effectAllowed || _this._config.dragEffect.name; | ||
// Change drag image | ||
if (isPresent(_this.dragImage)) { | ||
if (isString(_this.dragImage)) { | ||
event.dataTransfer.setDragImage(createImage(_this.dragImage)); | ||
((event.dataTransfer)).setDragImage(createImage((_this.dragImage))); | ||
} | ||
else if (isFunction(_this.dragImage)) { | ||
event.dataTransfer.setDragImage(callFun(_this.dragImage)); | ||
((event.dataTransfer)).setDragImage(callFun((_this.dragImage))); | ||
} | ||
else { | ||
var img = _this.dragImage; | ||
event.dataTransfer.setDragImage(img.imageElement, img.x_offset, img.y_offset); | ||
var img = (_this.dragImage); | ||
((event.dataTransfer)).setDragImage(img.imageElement, img.x_offset, img.y_offset); | ||
} | ||
@@ -259,6 +203,6 @@ } | ||
var dragImage = _this._config.dragImage; | ||
event.dataTransfer.setDragImage(dragImage.imageElement, dragImage.x_offset, dragImage.y_offset); | ||
((event.dataTransfer)).setDragImage(dragImage.imageElement, dragImage.x_offset, dragImage.y_offset); | ||
} | ||
else if (_this.cloneItem) { | ||
_this._dragHelper = _this._elem.cloneNode(true); | ||
_this._dragHelper = (_this._elem.cloneNode(true)); | ||
_this._dragHelper.classList.add('dnd-drag-item'); | ||
@@ -269,5 +213,4 @@ _this._dragHelper.style.position = "absolute"; | ||
_this._elem.parentElement.appendChild(_this._dragHelper); | ||
event.dataTransfer.setDragImage(_this._dragHelper, event.offsetX, event.offsetY); | ||
((event.dataTransfer)).setDragImage(_this._dragHelper, event.offsetX, event.offsetY); | ||
} | ||
// Change drag cursor | ||
var cursorelem = (_this._dragHandle) ? _this._dragHandle : _this._elem; | ||
@@ -286,5 +229,3 @@ if (_this._dragEnabled) { | ||
} | ||
// console.log('ondragend', event.target); | ||
_this._onDragEnd(event); | ||
// Restore style of dragged element | ||
var cursorelem = (_this._dragHandle) ? _this._dragHandle : _this._elem; | ||
@@ -308,8 +249,6 @@ cursorelem.style.cursor = _this._defaultCursor; | ||
}; | ||
/******* Change detection ******/ | ||
AbstractComponent.prototype.detectChanges = function () { | ||
var _this = this; | ||
// Programmatically run change detection to fix issue in Safari | ||
setTimeout(function () { | ||
if (_this._cdr && !_this._cdr.destroyed) { | ||
if (_this._cdr && !((_this._cdr)).destroyed) { | ||
_this._cdr.detectChanges(); | ||
@@ -319,7 +258,4 @@ } | ||
}; | ||
//****** Droppable *******// | ||
AbstractComponent.prototype._onDragEnter = function (event) { | ||
// console.log('ondragenter._isDropAllowed', this._isDropAllowed); | ||
if (this._isDropAllowed(event)) { | ||
// event.preventDefault(); | ||
this._onDragEnterCallback(event); | ||
@@ -329,7 +265,4 @@ } | ||
AbstractComponent.prototype._onDragOver = function (event) { | ||
// // console.log('ondragover._isDropAllowed', this._isDropAllowed); | ||
if (this._isDropAllowed(event)) { | ||
// The element is over the same source element - do nothing | ||
if (event.preventDefault) { | ||
// Necessary. Allows us to drop. | ||
event.preventDefault(); | ||
@@ -341,5 +274,3 @@ } | ||
AbstractComponent.prototype._onDragLeave = function (event) { | ||
// console.log('ondragleave._isDropAllowed', this._isDropAllowed); | ||
if (this._isDropAllowed(event)) { | ||
// event.preventDefault(); | ||
this._onDragLeaveCallback(event); | ||
@@ -349,5 +280,3 @@ } | ||
AbstractComponent.prototype._onDrop = function (event) { | ||
// console.log('ondrop._isDropAllowed', this._isDropAllowed); | ||
if (this._isDropAllowed(event)) { | ||
// Necessary. Allows us to drop. | ||
this._preventAndStop(event); | ||
@@ -360,8 +289,5 @@ this._onDropCallback(event); | ||
if ((this._dragDropService.isDragged || (event.dataTransfer && event.dataTransfer.files)) && this.dropEnabled) { | ||
// First, if `allowDrop` is set, call it to determine whether the | ||
// dragged element can be dropped here. | ||
if (this.allowDrop) { | ||
return this.allowDrop(this._dragDropService.dragData); | ||
} | ||
// Otherwise, use dropZones if they are set. | ||
if (this.dropZones.length === 0 && this._dragDropService.allowedDropZones.length === 0) { | ||
@@ -387,8 +313,5 @@ return true; | ||
}; | ||
//*********** Draggable **********// | ||
AbstractComponent.prototype._onDragStart = function (event) { | ||
//console.log('ondragstart.dragEnabled', this._dragEnabled); | ||
if (this._dragEnabled) { | ||
this._dragDropService.allowedDropZones = this.dropZones; | ||
// console.log('ondragstart.allowedDropZones', this._dragDropService.allowedDropZones); | ||
this._onDragStartCallback(event); | ||
@@ -399,6 +322,4 @@ } | ||
this._dragDropService.allowedDropZones = []; | ||
// console.log('ondragend.allowedDropZones', this._dragDropService.allowedDropZones); | ||
this._onDragEndCallback(event); | ||
}; | ||
//**** Drop Callbacks ****// | ||
AbstractComponent.prototype._onDragEnterCallback = function (event) { }; | ||
@@ -408,3 +329,2 @@ AbstractComponent.prototype._onDragOverCallback = function (event) { }; | ||
AbstractComponent.prototype._onDropCallback = function (event) { }; | ||
//**** Drag Callbacks ****// | ||
AbstractComponent.prototype._onDragStartCallback = function (event) { }; | ||
@@ -414,7 +334,11 @@ AbstractComponent.prototype._onDragEndCallback = function (event) { }; | ||
}()); | ||
exports.AbstractComponent = __decorate$3([ | ||
core.Injectable(), | ||
__metadata$2("design:paramtypes", [core.ElementRef, exports.DragDropService, DragDropConfig, | ||
core.ChangeDetectorRef]) | ||
], exports.AbstractComponent); | ||
AbstractComponent.decorators = [ | ||
{ type: core.Injectable }, | ||
]; | ||
AbstractComponent.ctorParameters = function () { return [ | ||
{ type: core.ElementRef, }, | ||
{ type: DragDropService, }, | ||
{ type: DragDropConfig, }, | ||
{ type: core.ChangeDetectorRef, }, | ||
]; }; | ||
var AbstractHandleComponent = /** @class */ (function () { | ||
@@ -431,32 +355,8 @@ function AbstractHandleComponent(elemRef, _dragDropService, _config, _Component, _cdr) { | ||
}()); | ||
// Copyright (C) 2016-2018 Sergey Akopkokhyants | ||
// This project is licensed under the terms of the MIT license. | ||
// https://github.com/akserg/ng2-dnd | ||
var __decorate$2 = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") | ||
r = Reflect.decorate(decorators, target, key, desc); | ||
else | ||
for (var i = decorators.length - 1; i >= 0; i--) | ||
if (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; | ||
}; | ||
var __metadata$1 = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") | ||
return Reflect.metadata(k, v); | ||
}; | ||
exports.DraggableComponent = /** @class */ (function (_super) { | ||
var DraggableComponent = /** @class */ (function (_super) { | ||
__extends(DraggableComponent, _super); | ||
function DraggableComponent(elemRef, dragDropService, config, cdr) { | ||
var _this = _super.call(this, elemRef, dragDropService, config, cdr) || this; | ||
/** | ||
* Callback function called when the drag actions happened. | ||
*/ | ||
_this.onDragStart = new core.EventEmitter(); | ||
_this.onDragEnd = new core.EventEmitter(); | ||
/** | ||
* Callback function called when the drag action ends with a valid drop action. | ||
* It is activated after the on-drop-success callback | ||
*/ | ||
_this.onDragSuccessCallback = new core.EventEmitter(); | ||
@@ -482,5 +382,2 @@ _this._defaultCursor = _this._elem.style.cursor; | ||
Object.defineProperty(DraggableComponent.prototype, "effectallowed", { | ||
/** | ||
* Drag allowed effect | ||
*/ | ||
set: function (value) { | ||
@@ -493,5 +390,2 @@ this.effectAllowed = value; | ||
Object.defineProperty(DraggableComponent.prototype, "effectcursor", { | ||
/** | ||
* Drag effect cursor | ||
*/ | ||
set: function (value) { | ||
@@ -508,3 +402,2 @@ this.effectCursor = value; | ||
this._elem.classList.add(this._config.onDragStartClass); | ||
// | ||
this.onDragStart.emit({ dragData: this.dragData, mouseEvent: event }); | ||
@@ -517,57 +410,28 @@ }; | ||
this._elem.classList.remove(this._config.onDragStartClass); | ||
// | ||
this.onDragEnd.emit({ dragData: this.dragData, mouseEvent: event }); | ||
}; | ||
return DraggableComponent; | ||
}(exports.AbstractComponent)); | ||
__decorate$2([ | ||
core.Input("dragEnabled"), | ||
__metadata$1("design:type", Boolean), | ||
__metadata$1("design:paramtypes", [Boolean]) | ||
], exports.DraggableComponent.prototype, "draggable", null); | ||
__decorate$2([ | ||
core.Output(), | ||
__metadata$1("design:type", core.EventEmitter) | ||
], exports.DraggableComponent.prototype, "onDragStart", void 0); | ||
__decorate$2([ | ||
core.Output(), | ||
__metadata$1("design:type", core.EventEmitter) | ||
], exports.DraggableComponent.prototype, "onDragEnd", void 0); | ||
__decorate$2([ | ||
core.Input(), | ||
__metadata$1("design:type", Object) | ||
], exports.DraggableComponent.prototype, "dragData", void 0); | ||
__decorate$2([ | ||
core.Output("onDragSuccess"), | ||
__metadata$1("design:type", core.EventEmitter) | ||
], exports.DraggableComponent.prototype, "onDragSuccessCallback", void 0); | ||
__decorate$2([ | ||
core.Input("dropZones"), | ||
__metadata$1("design:type", Array), | ||
__metadata$1("design:paramtypes", [Array]) | ||
], exports.DraggableComponent.prototype, "dropzones", null); | ||
__decorate$2([ | ||
core.Input("effectAllowed"), | ||
__metadata$1("design:type", String), | ||
__metadata$1("design:paramtypes", [String]) | ||
], exports.DraggableComponent.prototype, "effectallowed", null); | ||
__decorate$2([ | ||
core.Input("effectCursor"), | ||
__metadata$1("design:type", String), | ||
__metadata$1("design:paramtypes", [String]) | ||
], exports.DraggableComponent.prototype, "effectcursor", null); | ||
__decorate$2([ | ||
core.Input(), | ||
__metadata$1("design:type", Object) | ||
], exports.DraggableComponent.prototype, "dragImage", void 0); | ||
__decorate$2([ | ||
core.Input(), | ||
__metadata$1("design:type", Boolean) | ||
], exports.DraggableComponent.prototype, "cloneItem", void 0); | ||
exports.DraggableComponent = __decorate$2([ | ||
core.Directive({ selector: '[dnd-draggable]' }), | ||
__metadata$1("design:paramtypes", [core.ElementRef, exports.DragDropService, DragDropConfig, | ||
core.ChangeDetectorRef]) | ||
], exports.DraggableComponent); | ||
exports.DraggableHandleComponent = /** @class */ (function (_super) { | ||
}(AbstractComponent)); | ||
DraggableComponent.decorators = [ | ||
{ type: core.Directive, args: [{ selector: '[dnd-draggable]' },] }, | ||
]; | ||
DraggableComponent.ctorParameters = function () { return [ | ||
{ type: core.ElementRef, }, | ||
{ type: DragDropService, }, | ||
{ type: DragDropConfig, }, | ||
{ type: core.ChangeDetectorRef, }, | ||
]; }; | ||
DraggableComponent.propDecorators = { | ||
"draggable": [{ type: core.Input, args: ["dragEnabled",] },], | ||
"onDragStart": [{ type: core.Output },], | ||
"onDragEnd": [{ type: core.Output },], | ||
"dragData": [{ type: core.Input },], | ||
"onDragSuccessCallback": [{ type: core.Output, args: ["onDragSuccess",] },], | ||
"dropzones": [{ type: core.Input, args: ["dropZones",] },], | ||
"effectallowed": [{ type: core.Input, args: ["effectAllowed",] },], | ||
"effectcursor": [{ type: core.Input, args: ["effectCursor",] },], | ||
"dragImage": [{ type: core.Input },], | ||
"cloneItem": [{ type: core.Input },], | ||
}; | ||
var DraggableHandleComponent = /** @class */ (function (_super) { | ||
__extends(DraggableHandleComponent, _super); | ||
@@ -579,32 +443,16 @@ function DraggableHandleComponent(elemRef, dragDropService, config, _Component, cdr) { | ||
}(AbstractHandleComponent)); | ||
exports.DraggableHandleComponent = __decorate$2([ | ||
core.Directive({ selector: '[dnd-draggable-handle]' }), | ||
__metadata$1("design:paramtypes", [core.ElementRef, exports.DragDropService, DragDropConfig, exports.DraggableComponent, | ||
core.ChangeDetectorRef]) | ||
], exports.DraggableHandleComponent); | ||
// Copyright (C) 2016-2018 Sergey Akopkokhyants | ||
// This project is licensed under the terms of the MIT license. | ||
// https://github.com/akserg/ng2-dnd | ||
var __decorate$4 = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") | ||
r = Reflect.decorate(decorators, target, key, desc); | ||
else | ||
for (var i = decorators.length - 1; i >= 0; i--) | ||
if (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; | ||
}; | ||
var __metadata$3 = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") | ||
return Reflect.metadata(k, v); | ||
}; | ||
exports.DroppableComponent = /** @class */ (function (_super) { | ||
DraggableHandleComponent.decorators = [ | ||
{ type: core.Directive, args: [{ selector: '[dnd-draggable-handle]' },] }, | ||
]; | ||
DraggableHandleComponent.ctorParameters = function () { return [ | ||
{ type: core.ElementRef, }, | ||
{ type: DragDropService, }, | ||
{ type: DragDropConfig, }, | ||
{ type: DraggableComponent, }, | ||
{ type: core.ChangeDetectorRef, }, | ||
]; }; | ||
var DroppableComponent = /** @class */ (function (_super) { | ||
__extends(DroppableComponent, _super); | ||
function DroppableComponent(elemRef, dragDropService, config, cdr) { | ||
var _this = _super.call(this, elemRef, dragDropService, config, cdr) || this; | ||
/** | ||
* Callback function called when the drop action completes correctly. | ||
* It is activated before the on-drag-success callback. | ||
*/ | ||
_this.onDropSuccess = new core.EventEmitter(); | ||
@@ -639,5 +487,2 @@ _this.onDragEnter = new core.EventEmitter(); | ||
Object.defineProperty(DroppableComponent.prototype, "effectallowed", { | ||
/** | ||
* Drag allowed effect | ||
*/ | ||
set: function (value) { | ||
@@ -650,5 +495,2 @@ this.effectAllowed = value; | ||
Object.defineProperty(DroppableComponent.prototype, "effectcursor", { | ||
/** | ||
* Drag effect cursor | ||
*/ | ||
set: function (value) { | ||
@@ -672,3 +514,2 @@ this.effectCursor = value; | ||
}; | ||
DroppableComponent.prototype._onDragLeaveCallback = function (event) { | ||
@@ -681,5 +522,4 @@ if (this._dragDropService.isDragged) { | ||
}; | ||
DroppableComponent.prototype._onDropCallback = function (event) { | ||
var dataTransfer = event.dataTransfer; | ||
var dataTransfer = ((event)).dataTransfer; | ||
if (this._dragDropService.isDragged || (dataTransfer && dataTransfer.files)) { | ||
@@ -695,67 +535,24 @@ this.onDropSuccess.emit({ dragData: this._dragDropService.dragData, mouseEvent: event }); | ||
return DroppableComponent; | ||
}(exports.AbstractComponent)); | ||
__decorate$4([ | ||
core.Input("dropEnabled"), | ||
__metadata$3("design:type", Boolean), | ||
__metadata$3("design:paramtypes", [Boolean]) | ||
], exports.DroppableComponent.prototype, "droppable", null); | ||
__decorate$4([ | ||
core.Output(), | ||
__metadata$3("design:type", core.EventEmitter) | ||
], exports.DroppableComponent.prototype, "onDropSuccess", void 0); | ||
__decorate$4([ | ||
core.Output(), | ||
__metadata$3("design:type", core.EventEmitter) | ||
], exports.DroppableComponent.prototype, "onDragEnter", void 0); | ||
__decorate$4([ | ||
core.Output(), | ||
__metadata$3("design:type", core.EventEmitter) | ||
], exports.DroppableComponent.prototype, "onDragOver", void 0); | ||
__decorate$4([ | ||
core.Output(), | ||
__metadata$3("design:type", core.EventEmitter) | ||
], exports.DroppableComponent.prototype, "onDragLeave", void 0); | ||
__decorate$4([ | ||
core.Input("allowDrop"), | ||
__metadata$3("design:type", Function), | ||
__metadata$3("design:paramtypes", [Function]) | ||
], exports.DroppableComponent.prototype, "allowdrop", null); | ||
__decorate$4([ | ||
core.Input("dropZones"), | ||
__metadata$3("design:type", Array), | ||
__metadata$3("design:paramtypes", [Array]) | ||
], exports.DroppableComponent.prototype, "dropzones", null); | ||
__decorate$4([ | ||
core.Input("effectAllowed"), | ||
__metadata$3("design:type", String), | ||
__metadata$3("design:paramtypes", [String]) | ||
], exports.DroppableComponent.prototype, "effectallowed", null); | ||
__decorate$4([ | ||
core.Input("effectCursor"), | ||
__metadata$3("design:type", String), | ||
__metadata$3("design:paramtypes", [String]) | ||
], exports.DroppableComponent.prototype, "effectcursor", null); | ||
exports.DroppableComponent = __decorate$4([ | ||
core.Directive({ selector: '[dnd-droppable]' }), | ||
__metadata$3("design:paramtypes", [core.ElementRef, exports.DragDropService, DragDropConfig, | ||
core.ChangeDetectorRef]) | ||
], exports.DroppableComponent); | ||
// Copyright (C) 2016-2018 Sergey Akopkokhyants | ||
// This project is licensed under the terms of the MIT license. | ||
// https://github.com/akserg/ng2-dnd | ||
var __decorate$5 = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") | ||
r = Reflect.decorate(decorators, target, key, desc); | ||
else | ||
for (var i = decorators.length - 1; i >= 0; i--) | ||
if (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; | ||
}(AbstractComponent)); | ||
DroppableComponent.decorators = [ | ||
{ type: core.Directive, args: [{ selector: '[dnd-droppable]' },] }, | ||
]; | ||
DroppableComponent.ctorParameters = function () { return [ | ||
{ type: core.ElementRef, }, | ||
{ type: DragDropService, }, | ||
{ type: DragDropConfig, }, | ||
{ type: core.ChangeDetectorRef, }, | ||
]; }; | ||
DroppableComponent.propDecorators = { | ||
"droppable": [{ type: core.Input, args: ["dropEnabled",] },], | ||
"onDropSuccess": [{ type: core.Output },], | ||
"onDragEnter": [{ type: core.Output },], | ||
"onDragOver": [{ type: core.Output },], | ||
"onDragLeave": [{ type: core.Output },], | ||
"allowdrop": [{ type: core.Input, args: ["allowDrop",] },], | ||
"dropzones": [{ type: core.Input, args: ["dropZones",] },], | ||
"effectallowed": [{ type: core.Input, args: ["effectAllowed",] },], | ||
"effectcursor": [{ type: core.Input, args: ["effectCursor",] },], | ||
}; | ||
var __metadata$4 = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") | ||
return Reflect.metadata(k, v); | ||
}; | ||
exports.SortableContainer = /** @class */ (function (_super) { | ||
var SortableContainer = /** @class */ (function (_super) { | ||
__extends(SortableContainer, _super); | ||
@@ -788,5 +585,3 @@ function SortableContainer(elemRef, dragDropService, config, cdr, _sortableDataService) { | ||
} | ||
// | ||
this.dropEnabled = !!this._sortableData; | ||
// console.log("collection is changed, drop enabled: " + this.dropEnabled); | ||
}, | ||
@@ -806,7 +601,3 @@ enumerable: true, | ||
var item = this._sortableDataService.sortableContainer.getItemAt(this._sortableDataService.index); | ||
// Check does element exist in sortableData of this Container | ||
if (this.indexOf(item) === -1) { | ||
// Let's add it | ||
// console.log('Container._onDragEnterCallback. drag node [' + this._sortableDataService.index.toString() + '] over parent node'); | ||
// Remove item from previouse list | ||
this._sortableDataService.sortableContainer.removeItemAt(this._sortableDataService.index); | ||
@@ -816,3 +607,2 @@ if (this._sortableDataService.sortableContainer._sortableData.length === 0) { | ||
} | ||
// Add item to new list | ||
this.insertItemAt(item, 0); | ||
@@ -822,3 +612,2 @@ this._sortableDataService.sortableContainer = this; | ||
} | ||
// Refresh changes in properties of container component | ||
this.detectChanges(); | ||
@@ -839,24 +628,22 @@ } | ||
}; | ||
SortableContainer.prototype.replaceItemAt = function (item, index) { | ||
this.sortableHandler.replaceItemAt(this._sortableData, item, index); | ||
}; | ||
return SortableContainer; | ||
}(exports.AbstractComponent)); | ||
__decorate$5([ | ||
core.Input("dragEnabled"), | ||
__metadata$4("design:type", Boolean), | ||
__metadata$4("design:paramtypes", [Boolean]) | ||
], exports.SortableContainer.prototype, "draggable", null); | ||
__decorate$5([ | ||
core.Input(), | ||
__metadata$4("design:type", Object), | ||
__metadata$4("design:paramtypes", [Object]) | ||
], exports.SortableContainer.prototype, "sortableData", null); | ||
__decorate$5([ | ||
core.Input("dropZones"), | ||
__metadata$4("design:type", Array), | ||
__metadata$4("design:paramtypes", [Array]) | ||
], exports.SortableContainer.prototype, "dropzones", null); | ||
exports.SortableContainer = __decorate$5([ | ||
core.Directive({ selector: '[dnd-sortable-container]' }), | ||
__metadata$4("design:paramtypes", [core.ElementRef, exports.DragDropService, DragDropConfig, core.ChangeDetectorRef, | ||
exports.DragDropSortableService]) | ||
], exports.SortableContainer); | ||
}(AbstractComponent)); | ||
SortableContainer.decorators = [ | ||
{ type: core.Directive, args: [{ selector: '[dnd-sortable-container]' },] }, | ||
]; | ||
SortableContainer.ctorParameters = function () { return [ | ||
{ type: core.ElementRef, }, | ||
{ type: DragDropService, }, | ||
{ type: DragDropConfig, }, | ||
{ type: core.ChangeDetectorRef, }, | ||
{ type: DragDropSortableService, }, | ||
]; }; | ||
SortableContainer.propDecorators = { | ||
"draggable": [{ type: core.Input, args: ["dragEnabled",] },], | ||
"sortableData": [{ type: core.Input },], | ||
"dropzones": [{ type: core.Input, args: ["dropZones",] },], | ||
}; | ||
var SortableArrayHandler = /** @class */ (function () { | ||
@@ -877,2 +664,5 @@ function SortableArrayHandler() { | ||
}; | ||
SortableArrayHandler.prototype.replaceItemAt = function (sortableData, item, index) { | ||
sortableData.splice(index, 1, item); | ||
}; | ||
return SortableArrayHandler; | ||
@@ -895,5 +685,8 @@ }()); | ||
}; | ||
SortableFormArrayHandler.prototype.replaceItemAt = function (sortableData, item, index) { | ||
sortableData.setControl(index, item); | ||
}; | ||
return SortableFormArrayHandler; | ||
}()); | ||
exports.SortableComponent = /** @class */ (function (_super) { | ||
var SortableComponent = /** @class */ (function (_super) { | ||
__extends(SortableComponent, _super); | ||
@@ -904,6 +697,2 @@ function SortableComponent(elemRef, dragDropService, config, _sortableContainer, _sortableDataService, cdr) { | ||
_this._sortableDataService = _sortableDataService; | ||
/** | ||
* Callback function called when the drag action ends with a valid drop action. | ||
* It is activated after the on-drop-success callback | ||
*/ | ||
_this.onDragSuccessCallback = new core.EventEmitter(); | ||
@@ -934,5 +723,2 @@ _this.onDragStartCallback = new core.EventEmitter(); | ||
Object.defineProperty(SortableComponent.prototype, "effectallowed", { | ||
/** | ||
* Drag allowed effect | ||
*/ | ||
set: function (value) { | ||
@@ -945,5 +731,2 @@ this.effectAllowed = value; | ||
Object.defineProperty(SortableComponent.prototype, "effectcursor", { | ||
/** | ||
* Drag effect cursor | ||
*/ | ||
set: function (value) { | ||
@@ -956,3 +739,2 @@ this.effectCursor = value; | ||
SortableComponent.prototype._onDragStartCallback = function (event) { | ||
// console.log('_onDragStartCallback. dragging elem with index ' + this.index); | ||
this._sortableDataService.isDragged = true; | ||
@@ -962,20 +744,27 @@ this._sortableDataService.sortableContainer = this._sortableContainer; | ||
this._sortableDataService.markSortable(this._elem); | ||
// Add dragData | ||
this._dragDropService.isDragged = true; | ||
this._dragDropService.dragData = this.dragData; | ||
this._dragDropService.onDragSuccessCallback = this.onDragSuccessCallback; | ||
// | ||
this.onDragStartCallback.emit(this._dragDropService.dragData); | ||
}; | ||
SortableComponent.prototype._onDragOverCallback = function (event) { | ||
if (this._sortableDataService.isDragged && this._elem !== this._sortableDataService.elem) { | ||
// console.log('_onDragOverCallback. dragging elem with index ' + this.index); | ||
if (this._sortableDataService.isDragged) { | ||
this._sortableDataService.sortableContainer = this._sortableContainer; | ||
this._sortableDataService.index = this.index; | ||
this._sortableDataService.markSortable(this._elem); | ||
this.onDragOverCallback.emit(this._dragDropService.dragData); | ||
this._sortableContainer._elem.classList.add(this._config.onDragOverClass); | ||
if (this._dragDropService.dragData instanceof Array) { | ||
if (this._dragDropService.dragData[0] !== this._sortableContainer.getItemAt(this.index)) { | ||
var temp = this._sortableContainer.getItemAt(this.index); | ||
var tempIndex = this._sortableContainer.indexOf(this._dragDropService.dragData[0]); | ||
this._sortableContainer.replaceItemAt(this._dragDropService.dragData[0], this.index); | ||
console.log(this._sortableContainer.sortableData); | ||
this._sortableContainer.replaceItemAt(temp, tempIndex); | ||
} | ||
} | ||
var sortableItem = { index: this._sortableDataService.index, dragData: this._dragDropService.dragData }; | ||
this.onDragOverCallback.emit(sortableItem); | ||
} | ||
}; | ||
SortableComponent.prototype._onDragEndCallback = function (event) { | ||
// console.log('_onDragEndCallback. end dragging elem with index ' + this.index); | ||
this._sortableDataService.isDragged = false; | ||
@@ -985,7 +774,6 @@ this._sortableDataService.sortableContainer = null; | ||
this._sortableDataService.markSortable(null); | ||
// Add dragGata | ||
this._dragDropService.isDragged = false; | ||
this._dragDropService.dragData = null; | ||
this._dragDropService.onDragSuccessCallback = null; | ||
// | ||
this._sortableContainer._elem.classList.remove(this._config.onDragOverClass); | ||
this.onDragEndCallback.emit(this._dragDropService.dragData); | ||
@@ -998,6 +786,3 @@ }; | ||
(this._sortableDataService.sortableContainer.sortableData !== this._sortableContainer.sortableData)) { | ||
// console.log('Component._onDragEnterCallback. drag node [' + this.index + '] over node [' + this._sortableDataService.index + ']'); | ||
// Get item | ||
var item = this._sortableDataService.sortableContainer.getItemAt(this._sortableDataService.index); | ||
// Remove item from previouse list | ||
this._sortableDataService.sortableContainer.removeItemAt(this._sortableDataService.index); | ||
@@ -1007,3 +792,2 @@ if (this._sortableDataService.sortableContainer.sortableData.length === 0) { | ||
} | ||
// Add item to new list | ||
this._sortableContainer.insertItemAt(item, this.index); | ||
@@ -1021,9 +805,6 @@ if (this._sortableContainer.dropEnabled) { | ||
if (this._sortableDataService.isDragged) { | ||
// console.log('onDropCallback.onDropSuccessCallback.dragData', this._dragDropService.dragData); | ||
this.onDropSuccessCallback.emit(this._dragDropService.dragData); | ||
if (this._dragDropService.onDragSuccessCallback) { | ||
// console.log('onDropCallback.onDragSuccessCallback.dragData', this._dragDropService.dragData); | ||
this._dragDropService.onDragSuccessCallback.emit(this._dragDropService.dragData); | ||
} | ||
// Refresh changes in properties of container component | ||
this._sortableContainer.detectChanges(); | ||
@@ -1033,59 +814,28 @@ } | ||
return SortableComponent; | ||
}(exports.AbstractComponent)); | ||
__decorate$5([ | ||
core.Input('sortableIndex'), | ||
__metadata$4("design:type", Number) | ||
], exports.SortableComponent.prototype, "index", void 0); | ||
__decorate$5([ | ||
core.Input("dragEnabled"), | ||
__metadata$4("design:type", Boolean), | ||
__metadata$4("design:paramtypes", [Boolean]) | ||
], exports.SortableComponent.prototype, "draggable", null); | ||
__decorate$5([ | ||
core.Input("dropEnabled"), | ||
__metadata$4("design:type", Boolean), | ||
__metadata$4("design:paramtypes", [Boolean]) | ||
], exports.SortableComponent.prototype, "droppable", null); | ||
__decorate$5([ | ||
core.Input(), | ||
__metadata$4("design:type", Object) | ||
], exports.SortableComponent.prototype, "dragData", void 0); | ||
__decorate$5([ | ||
core.Input("effectAllowed"), | ||
__metadata$4("design:type", String), | ||
__metadata$4("design:paramtypes", [String]) | ||
], exports.SortableComponent.prototype, "effectallowed", null); | ||
__decorate$5([ | ||
core.Input("effectCursor"), | ||
__metadata$4("design:type", String), | ||
__metadata$4("design:paramtypes", [String]) | ||
], exports.SortableComponent.prototype, "effectcursor", null); | ||
__decorate$5([ | ||
core.Output("onDragSuccess"), | ||
__metadata$4("design:type", core.EventEmitter) | ||
], exports.SortableComponent.prototype, "onDragSuccessCallback", void 0); | ||
__decorate$5([ | ||
core.Output("onDragStart"), | ||
__metadata$4("design:type", core.EventEmitter) | ||
], exports.SortableComponent.prototype, "onDragStartCallback", void 0); | ||
__decorate$5([ | ||
core.Output("onDragOver"), | ||
__metadata$4("design:type", core.EventEmitter) | ||
], exports.SortableComponent.prototype, "onDragOverCallback", void 0); | ||
__decorate$5([ | ||
core.Output("onDragEnd"), | ||
__metadata$4("design:type", core.EventEmitter) | ||
], exports.SortableComponent.prototype, "onDragEndCallback", void 0); | ||
__decorate$5([ | ||
core.Output("onDropSuccess"), | ||
__metadata$4("design:type", core.EventEmitter) | ||
], exports.SortableComponent.prototype, "onDropSuccessCallback", void 0); | ||
exports.SortableComponent = __decorate$5([ | ||
core.Directive({ selector: '[dnd-sortable]' }), | ||
__metadata$4("design:paramtypes", [core.ElementRef, exports.DragDropService, DragDropConfig, | ||
exports.SortableContainer, | ||
exports.DragDropSortableService, | ||
core.ChangeDetectorRef]) | ||
], exports.SortableComponent); | ||
exports.SortableHandleComponent = /** @class */ (function (_super) { | ||
}(AbstractComponent)); | ||
SortableComponent.decorators = [ | ||
{ type: core.Directive, args: [{ selector: '[dnd-sortable]' },] }, | ||
]; | ||
SortableComponent.ctorParameters = function () { return [ | ||
{ type: core.ElementRef, }, | ||
{ type: DragDropService, }, | ||
{ type: DragDropConfig, }, | ||
{ type: SortableContainer, }, | ||
{ type: DragDropSortableService, }, | ||
{ type: core.ChangeDetectorRef, }, | ||
]; }; | ||
SortableComponent.propDecorators = { | ||
"index": [{ type: core.Input, args: ['sortableIndex',] },], | ||
"draggable": [{ type: core.Input, args: ["dragEnabled",] },], | ||
"droppable": [{ type: core.Input, args: ["dropEnabled",] },], | ||
"dragData": [{ type: core.Input },], | ||
"effectallowed": [{ type: core.Input, args: ["effectAllowed",] },], | ||
"effectcursor": [{ type: core.Input, args: ["effectCursor",] },], | ||
"onDragSuccessCallback": [{ type: core.Output, args: ["onDragSuccess",] },], | ||
"onDragStartCallback": [{ type: core.Output, args: ["onDragStart",] },], | ||
"onDragOverCallback": [{ type: core.Output, args: ["onDragOver",] },], | ||
"onDragEndCallback": [{ type: core.Output, args: ["onDragEnd",] },], | ||
"onDropSuccessCallback": [{ type: core.Output, args: ["onDropSuccess",] },], | ||
}; | ||
var SortableHandleComponent = /** @class */ (function (_super) { | ||
__extends(SortableHandleComponent, _super); | ||
@@ -1097,26 +847,18 @@ function SortableHandleComponent(elemRef, dragDropService, config, _Component, cdr) { | ||
}(AbstractHandleComponent)); | ||
exports.SortableHandleComponent = __decorate$5([ | ||
core.Directive({ selector: '[dnd-sortable-handle]' }), | ||
__metadata$4("design:paramtypes", [core.ElementRef, exports.DragDropService, DragDropConfig, exports.SortableComponent, | ||
core.ChangeDetectorRef]) | ||
], exports.SortableHandleComponent); | ||
// Copyright (C) 2016-2018 Sergey Akopkokhyants | ||
// This project is licensed under the terms of the MIT license. | ||
// https://github.com/akserg/ng2-dnd | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") | ||
r = Reflect.decorate(decorators, target, key, desc); | ||
else | ||
for (var i = decorators.length - 1; i >= 0; i--) | ||
if (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; | ||
}; | ||
SortableHandleComponent.decorators = [ | ||
{ type: core.Directive, args: [{ selector: '[dnd-sortable-handle]' },] }, | ||
]; | ||
SortableHandleComponent.ctorParameters = function () { return [ | ||
{ type: core.ElementRef, }, | ||
{ type: DragDropService, }, | ||
{ type: DragDropConfig, }, | ||
{ type: SortableComponent, }, | ||
{ type: core.ChangeDetectorRef, }, | ||
]; }; | ||
var providers = [ | ||
DragDropConfig, | ||
{ provide: exports.DragDropService, useFactory: dragDropServiceFactory }, | ||
{ provide: exports.DragDropSortableService, useFactory: dragDropSortableServiceFactory, deps: [DragDropConfig] } | ||
{ provide: DragDropService, useFactory: dragDropServiceFactory }, | ||
{ provide: DragDropSortableService, useFactory: dragDropSortableServiceFactory, deps: [DragDropConfig] } | ||
]; | ||
exports.DndModule = DndModule_1 = /** @class */ (function () { | ||
var DndModule = /** @class */ (function () { | ||
function DndModule() { | ||
@@ -1126,3 +868,3 @@ } | ||
return { | ||
ngModule: DndModule_1, | ||
ngModule: DndModule, | ||
providers: providers | ||
@@ -1133,11 +875,12 @@ }; | ||
}()); | ||
exports.DndModule = DndModule_1 = __decorate([ | ||
core.NgModule({ | ||
declarations: [exports.DraggableComponent, exports.DraggableHandleComponent, exports.DroppableComponent, exports.SortableContainer, exports.SortableComponent, exports.SortableHandleComponent], | ||
exports: [exports.DraggableComponent, exports.DraggableHandleComponent, exports.DroppableComponent, exports.SortableContainer, exports.SortableComponent, exports.SortableHandleComponent], | ||
}) | ||
], exports.DndModule); | ||
var DndModule_1; | ||
DndModule.decorators = [ | ||
{ type: core.NgModule, args: [{ | ||
declarations: [DraggableComponent, DraggableHandleComponent, DroppableComponent, SortableContainer, SortableComponent, SortableHandleComponent], | ||
exports: [DraggableComponent, DraggableHandleComponent, DroppableComponent, SortableContainer, SortableComponent, SortableHandleComponent], | ||
},] }, | ||
]; | ||
exports.providers = providers; | ||
exports.DndModule = DndModule; | ||
exports.AbstractComponent = AbstractComponent; | ||
exports.AbstractHandleComponent = AbstractHandleComponent; | ||
@@ -1147,5 +890,13 @@ exports.DataTransferEffect = DataTransferEffect; | ||
exports.DragDropConfig = DragDropConfig; | ||
exports.DragDropData = DragDropData; | ||
exports.dragDropServiceFactory = dragDropServiceFactory; | ||
exports.dragDropSortableServiceFactory = dragDropSortableServiceFactory; | ||
exports.DragDropData = DragDropData; | ||
exports.DragDropService = DragDropService; | ||
exports.DragDropSortableService = DragDropSortableService; | ||
exports.DraggableComponent = DraggableComponent; | ||
exports.DraggableHandleComponent = DraggableHandleComponent; | ||
exports.DroppableComponent = DroppableComponent; | ||
exports.SortableContainer = SortableContainer; | ||
exports.SortableComponent = SortableComponent; | ||
exports.SortableHandleComponent = SortableHandleComponent; | ||
@@ -1155,2 +906,2 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
}))); | ||
//# sourceMappingURL=ng2-dnd.umd.js.map | ||
//# sourceMappingURL=ng2-drag-n-drop.umd.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/forms")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/forms"],t):t(e["ng2-dnd"]={},e.ng.core,e.ng.forms)}(this,function(e,t,r){"use strict";function o(e){return"string"==typeof e}function a(e){return e!==undefined&&null!==e}function n(){return new e.DragDropService}function i(t){return new e.DragDropSortableService(t)}var s=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),l=function(){return function(e){this.name=e}}();l.COPY=new l("copy"),l.LINK=new l("link"),l.MOVE=new l("move"),l.NONE=new l("none");var p=function(){return function(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,o(this.imageElement)){var a=this.imageElement;this.imageElement=new HTMLImageElement,this.imageElement.src=a}}}(),c=function(){return function(){this.onDragStartClass="dnd-drag-start",this.onDragEnterClass="dnd-drag-enter",this.onDragOverClass="dnd-drag-over",this.onSortableDragClass="dnd-sortable-drag",this.dragEffect=l.MOVE,this.dropEffect=l.MOVE,this.dragCursor="move",this.defaultCursor="pointer"}}(),d=this&&this.__decorate||function(e,t,r,o){var a,n=arguments.length,i=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(n<3?a(i):n>3?a(t,r,i):a(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i},g=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},f=function(){return function(){}}();e.DragDropService=function(){return function(){this.allowedDropZones=[]}}(),e.DragDropService=d([t.Injectable()],e.DragDropService),e.DragDropSortableService=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){a(this._elem)&&this._elem.classList.remove(this._config.onSortableDragClass),a(e)&&(this._elem=e,this._elem.classList.add(this._config.onSortableDragClass))},e}(),e.DragDropSortableService=d([t.Injectable(),g("design:paramtypes",[c])],e.DragDropSortableService);var u=this&&this.__decorate||function(e,t,r,o){var a,n=arguments.length,i=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(n<3?a(i):n>3?a(t,r,i):a(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i},D=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};e.AbstractComponent=function(){function e(e,t,r,n){var i=this;this._dragDropService=t,this._config=r,this._cdr=n,this._dragEnabled=!1,this.dropEnabled=!1,this.dropZones=[],this.cloneItem=!1,this._defaultCursor=r.defaultCursor,this._elem=e.nativeElement,this._elem.style.cursor=this._defaultCursor,this._elem.ondragenter=function(e){i._onDragEnter(e)},this._elem.ondragover=function(e){return i._onDragOver(e),null!=e.dataTransfer&&(e.dataTransfer.dropEffect=i._config.dropEffect.name),!1},this._elem.ondragleave=function(e){i._onDragLeave(e)},this._elem.ondrop=function(e){i._onDrop(e)},this._elem.onmousedown=function(e){i._target=e.target},this._elem.ondragstart=function(e){if(!i._dragHandle||i._dragHandle.contains(i._target)){if(i._onDragStart(e),null!=e.dataTransfer){if(e.dataTransfer.setData("text",""),e.dataTransfer.effectAllowed=i.effectAllowed||i._config.dragEffect.name,a(i.dragImage))if(o(i.dragImage))e.dataTransfer.setDragImage(function(e){var t=new HTMLImageElement;return t.src=e,t}(i.dragImage));else if(function(e){return"function"==typeof e}(i.dragImage))e.dataTransfer.setDragImage(function(e){return e()}(i.dragImage));else{var t=i.dragImage;e.dataTransfer.setDragImage(t.imageElement,t.x_offset,t.y_offset)}else if(a(i._config.dragImage)){var r=i._config.dragImage;e.dataTransfer.setDragImage(r.imageElement,r.x_offset,r.y_offset)}else i.cloneItem&&(i._dragHelper=i._elem.cloneNode(!0),i._dragHelper.classList.add("dnd-drag-item"),i._dragHelper.style.position="absolute",i._dragHelper.style.top="0px",i._dragHelper.style.left="-1000px",i._elem.parentElement.appendChild(i._dragHelper),e.dataTransfer.setDragImage(i._dragHelper,e.offsetX,e.offsetY));var n=i._dragHandle?i._dragHandle:i._elem;i._dragEnabled?n.style.cursor=i.effectCursor?i.effectCursor:i._config.dragCursor:n.style.cursor=i._defaultCursor}}else e.preventDefault()},this._elem.ondragend=function(e){i._elem.parentElement&&i._dragHelper&&i._elem.parentElement.removeChild(i._dragHelper),i._onDragEnd(e);(i._dragHandle?i._dragHandle:i._elem).style.cursor=i._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.setDragHandle=function(e){this._dragHandle=e},e.prototype.detectChanges=function(){var e=this;setTimeout(function(){e._cdr&&!e._cdr.destroyed&&e._cdr.detectChanges()},250)},e.prototype._onDragEnter=function(e){this._isDropAllowed(e)&&this._onDragEnterCallback(e)},e.prototype._onDragOver=function(e){this._isDropAllowed(e)&&(e.preventDefault&&e.preventDefault(),this._onDragOverCallback(e))},e.prototype._onDragLeave=function(e){this._isDropAllowed(e)&&this._onDragLeaveCallback(e)},e.prototype._onDrop=function(e){this._isDropAllowed(e)&&(this._preventAndStop(e),this._onDropCallback(e),this.detectChanges())},e.prototype._isDropAllowed=function(e){if((this._dragDropService.isDragged||e.dataTransfer&&e.dataTransfer.files)&&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 t=0;t<this._dragDropService.allowedDropZones.length;t++){var r=this._dragDropService.allowedDropZones[t];if(-1!==this.dropZones.indexOf(r))return!0}}return!1},e.prototype._preventAndStop=function(e){e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation()},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}(),e.AbstractComponent=u([t.Injectable(),D("design:paramtypes",[t.ElementRef,e.DragDropService,c,t.ChangeDetectorRef])],e.AbstractComponent);var b=function(){return function(e,t,r,o,a){this._dragDropService=t,this._config=r,this._Component=o,this._cdr=a,this._elem=e.nativeElement,this._Component.setDragHandle(this._elem)}}(),m=this&&this.__decorate||function(e,t,r,o){var a,n=arguments.length,i=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(n<3?a(i):n>3?a(t,r,i):a(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i},h=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};e.DraggableComponent=function(e){function r(r,o,a,n){var i=e.call(this,r,o,a,n)||this;return i.onDragStart=new t.EventEmitter,i.onDragEnd=new t.EventEmitter,i.onDragSuccessCallback=new t.EventEmitter,i._defaultCursor=i._elem.style.cursor,i.dragEnabled=!0,i}return s(r,e),Object.defineProperty(r.prototype,"draggable",{set:function(e){this.dragEnabled=!!e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"dropzones",{set:function(e){this.dropZones=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"effectallowed",{set:function(e){this.effectAllowed=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"effectcursor",{set:function(e){this.effectCursor=e},enumerable:!0,configurable:!0}),r.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})},r.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})},r}(e.AbstractComponent),m([t.Input("dragEnabled"),h("design:type",Boolean),h("design:paramtypes",[Boolean])],e.DraggableComponent.prototype,"draggable",null),m([t.Output(),h("design:type",t.EventEmitter)],e.DraggableComponent.prototype,"onDragStart",void 0),m([t.Output(),h("design:type",t.EventEmitter)],e.DraggableComponent.prototype,"onDragEnd",void 0),m([t.Input(),h("design:type",Object)],e.DraggableComponent.prototype,"dragData",void 0),m([t.Output("onDragSuccess"),h("design:type",t.EventEmitter)],e.DraggableComponent.prototype,"onDragSuccessCallback",void 0),m([t.Input("dropZones"),h("design:type",Array),h("design:paramtypes",[Array])],e.DraggableComponent.prototype,"dropzones",null),m([t.Input("effectAllowed"),h("design:type",String),h("design:paramtypes",[String])],e.DraggableComponent.prototype,"effectallowed",null),m([t.Input("effectCursor"),h("design:type",String),h("design:paramtypes",[String])],e.DraggableComponent.prototype,"effectcursor",null),m([t.Input(),h("design:type",Object)],e.DraggableComponent.prototype,"dragImage",void 0),m([t.Input(),h("design:type",Boolean)],e.DraggableComponent.prototype,"cloneItem",void 0),e.DraggableComponent=m([t.Directive({selector:"[dnd-draggable]"}),h("design:paramtypes",[t.ElementRef,e.DragDropService,c,t.ChangeDetectorRef])],e.DraggableComponent),e.DraggableHandleComponent=function(e){function t(t,r,o,a,n){return e.call(this,t,r,o,a,n)||this}return s(t,e),t}(b),e.DraggableHandleComponent=m([t.Directive({selector:"[dnd-draggable-handle]"}),h("design:paramtypes",[t.ElementRef,e.DragDropService,c,e.DraggableComponent,t.ChangeDetectorRef])],e.DraggableHandleComponent);var _=this&&this.__decorate||function(e,t,r,o){var a,n=arguments.length,i=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(n<3?a(i):n>3?a(t,r,i):a(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i},v=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};e.DroppableComponent=function(e){function r(r,o,a,n){var i=e.call(this,r,o,a,n)||this;return i.onDropSuccess=new t.EventEmitter,i.onDragEnter=new t.EventEmitter,i.onDragOver=new t.EventEmitter,i.onDragLeave=new t.EventEmitter,i.dropEnabled=!0,i}return s(r,e),Object.defineProperty(r.prototype,"droppable",{set:function(e){this.dropEnabled=!!e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"allowdrop",{set:function(e){this.allowDrop=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"dropzones",{set:function(e){this.dropZones=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"effectallowed",{set:function(e){this.effectAllowed=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"effectcursor",{set:function(e){this.effectCursor=e},enumerable:!0,configurable:!0}),r.prototype._onDragEnterCallback=function(e){this._dragDropService.isDragged&&(this._elem.classList.add(this._config.onDragEnterClass),this.onDragEnter.emit({dragData:this._dragDropService.dragData,mouseEvent:e}))},r.prototype._onDragOverCallback=function(e){this._dragDropService.isDragged&&(this._elem.classList.add(this._config.onDragOverClass),this.onDragOver.emit({dragData:this._dragDropService.dragData,mouseEvent:e}))},r.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}))},r.prototype._onDropCallback=function(e){var t=e.dataTransfer;(this._dragDropService.isDragged||t&&t.files)&&(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))},r}(e.AbstractComponent),_([t.Input("dropEnabled"),v("design:type",Boolean),v("design:paramtypes",[Boolean])],e.DroppableComponent.prototype,"droppable",null),_([t.Output(),v("design:type",t.EventEmitter)],e.DroppableComponent.prototype,"onDropSuccess",void 0),_([t.Output(),v("design:type",t.EventEmitter)],e.DroppableComponent.prototype,"onDragEnter",void 0),_([t.Output(),v("design:type",t.EventEmitter)],e.DroppableComponent.prototype,"onDragOver",void 0),_([t.Output(),v("design:type",t.EventEmitter)],e.DroppableComponent.prototype,"onDragLeave",void 0),_([t.Input("allowDrop"),v("design:type",Function),v("design:paramtypes",[Function])],e.DroppableComponent.prototype,"allowdrop",null),_([t.Input("dropZones"),v("design:type",Array),v("design:paramtypes",[Array])],e.DroppableComponent.prototype,"dropzones",null),_([t.Input("effectAllowed"),v("design:type",String),v("design:paramtypes",[String])],e.DroppableComponent.prototype,"effectallowed",null),_([t.Input("effectCursor"),v("design:type",String),v("design:paramtypes",[String])],e.DroppableComponent.prototype,"effectcursor",null),e.DroppableComponent=_([t.Directive({selector:"[dnd-droppable]"}),v("design:paramtypes",[t.ElementRef,e.DragDropService,c,t.ChangeDetectorRef])],e.DroppableComponent);var y=this&&this.__decorate||function(e,t,r,o){var a,n=arguments.length,i=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(n<3?a(i):n>3?a(t,r,i):a(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i},C=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};e.SortableContainer=function(e){function t(t,r,o,a,n){var i=e.call(this,t,r,o,a)||this;return i._sortableDataService=n,i._sortableData=[],i.dragEnabled=!1,i}return s(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,e instanceof r.FormArray?this.sortableHandler=new E:this.sortableHandler=new S,this.dropEnabled=!!this._sortableData},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.sortableContainer.getItemAt(this._sortableDataService.index);-1===this.indexOf(t)&&(this._sortableDataService.sortableContainer.removeItemAt(this._sortableDataService.index),0===this._sortableDataService.sortableContainer._sortableData.length&&(this._sortableDataService.sortableContainer.dropEnabled=!0),this.insertItemAt(t,0),this._sortableDataService.sortableContainer=this,this._sortableDataService.index=0),this.detectChanges()}},t.prototype.getItemAt=function(e){return this.sortableHandler.getItemAt(this._sortableData,e)},t.prototype.indexOf=function(e){return this.sortableHandler.indexOf(this._sortableData,e)},t.prototype.removeItemAt=function(e){this.sortableHandler.removeItemAt(this._sortableData,e)},t.prototype.insertItemAt=function(e,t){this.sortableHandler.insertItemAt(this._sortableData,e,t)},t}(e.AbstractComponent),y([t.Input("dragEnabled"),C("design:type",Boolean),C("design:paramtypes",[Boolean])],e.SortableContainer.prototype,"draggable",null),y([t.Input(),C("design:type",Object),C("design:paramtypes",[Object])],e.SortableContainer.prototype,"sortableData",null),y([t.Input("dropZones"),C("design:type",Array),C("design:paramtypes",[Array])],e.SortableContainer.prototype,"dropzones",null),e.SortableContainer=y([t.Directive({selector:"[dnd-sortable-container]"}),C("design:paramtypes",[t.ElementRef,e.DragDropService,c,t.ChangeDetectorRef,e.DragDropSortableService])],e.SortableContainer);var S=function(){function e(){}return e.prototype.getItemAt=function(e,t){return e[t]},e.prototype.indexOf=function(e,t){return e.indexOf(t)},e.prototype.removeItemAt=function(e,t){e.splice(t,1)},e.prototype.insertItemAt=function(e,t,r){e.splice(r,0,t)},e}(),E=function(){function e(){}return e.prototype.getItemAt=function(e,t){return e.at(t)},e.prototype.indexOf=function(e,t){return e.controls.indexOf(t)},e.prototype.removeItemAt=function(e,t){e.removeAt(t)},e.prototype.insertItemAt=function(e,t,r){e.insert(r,t)},e}();e.SortableComponent=function(e){function r(r,o,a,n,i,s){var l=e.call(this,r,o,a,s)||this;return l._sortableContainer=n,l._sortableDataService=i,l.onDragSuccessCallback=new t.EventEmitter,l.onDragStartCallback=new t.EventEmitter,l.onDragOverCallback=new t.EventEmitter,l.onDragEndCallback=new t.EventEmitter,l.onDropSuccessCallback=new t.EventEmitter,l.dropZones=l._sortableContainer.dropZones,l.dragEnabled=!0,l.dropEnabled=!0,l}return s(r,e),Object.defineProperty(r.prototype,"draggable",{set:function(e){this.dragEnabled=!!e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"droppable",{set:function(e){this.dropEnabled=!!e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"effectallowed",{set:function(e){this.effectAllowed=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"effectcursor",{set:function(e){this.effectCursor=e},enumerable:!0,configurable:!0}),r.prototype._onDragStartCallback=function(e){this._sortableDataService.isDragged=!0,this._sortableDataService.sortableContainer=this._sortableContainer,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)},r.prototype._onDragOverCallback=function(e){this._sortableDataService.isDragged&&this._elem!==this._sortableDataService.elem&&(this._sortableDataService.sortableContainer=this._sortableContainer,this._sortableDataService.index=this.index,this._sortableDataService.markSortable(this._elem),this.onDragOverCallback.emit(this._dragDropService.dragData))},r.prototype._onDragEndCallback=function(e){this._sortableDataService.isDragged=!1,this._sortableDataService.sortableContainer=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)},r.prototype._onDragEnterCallback=function(e){if(this._sortableDataService.isDragged&&(this._sortableDataService.markSortable(this._elem),this.index!==this._sortableDataService.index||this._sortableDataService.sortableContainer.sortableData!==this._sortableContainer.sortableData)){var t=this._sortableDataService.sortableContainer.getItemAt(this._sortableDataService.index);this._sortableDataService.sortableContainer.removeItemAt(this._sortableDataService.index),0===this._sortableDataService.sortableContainer.sortableData.length&&(this._sortableDataService.sortableContainer.dropEnabled=!0),this._sortableContainer.insertItemAt(t,this.index),this._sortableContainer.dropEnabled&&(this._sortableContainer.dropEnabled=!1),this._sortableDataService.sortableContainer=this._sortableContainer,this._sortableDataService.index=this.index,this.detectChanges()}},r.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())},r}(e.AbstractComponent),y([t.Input("sortableIndex"),C("design:type",Number)],e.SortableComponent.prototype,"index",void 0),y([t.Input("dragEnabled"),C("design:type",Boolean),C("design:paramtypes",[Boolean])],e.SortableComponent.prototype,"draggable",null),y([t.Input("dropEnabled"),C("design:type",Boolean),C("design:paramtypes",[Boolean])],e.SortableComponent.prototype,"droppable",null),y([t.Input(),C("design:type",Object)],e.SortableComponent.prototype,"dragData",void 0),y([t.Input("effectAllowed"),C("design:type",String),C("design:paramtypes",[String])],e.SortableComponent.prototype,"effectallowed",null),y([t.Input("effectCursor"),C("design:type",String),C("design:paramtypes",[String])],e.SortableComponent.prototype,"effectcursor",null),y([t.Output("onDragSuccess"),C("design:type",t.EventEmitter)],e.SortableComponent.prototype,"onDragSuccessCallback",void 0),y([t.Output("onDragStart"),C("design:type",t.EventEmitter)],e.SortableComponent.prototype,"onDragStartCallback",void 0),y([t.Output("onDragOver"),C("design:type",t.EventEmitter)],e.SortableComponent.prototype,"onDragOverCallback",void 0),y([t.Output("onDragEnd"),C("design:type",t.EventEmitter)],e.SortableComponent.prototype,"onDragEndCallback",void 0),y([t.Output("onDropSuccess"),C("design:type",t.EventEmitter)],e.SortableComponent.prototype,"onDropSuccessCallback",void 0),e.SortableComponent=y([t.Directive({selector:"[dnd-sortable]"}),C("design:paramtypes",[t.ElementRef,e.DragDropService,c,e.SortableContainer,e.DragDropSortableService,t.ChangeDetectorRef])],e.SortableComponent),e.SortableHandleComponent=function(e){function t(t,r,o,a,n){return e.call(this,t,r,o,a,n)||this}return s(t,e),t}(b),e.SortableHandleComponent=y([t.Directive({selector:"[dnd-sortable-handle]"}),C("design:paramtypes",[t.ElementRef,e.DragDropService,c,e.SortableComponent,t.ChangeDetectorRef])],e.SortableHandleComponent);var O=this&&this.__decorate||function(e,t,r,o){var a,n=arguments.length,i=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(n<3?a(i):n>3?a(t,r,i):a(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i},I=[c,{provide:e.DragDropService,useFactory:n},{provide:e.DragDropSortableService,useFactory:i,deps:[c]}];e.DndModule=w=function(){function e(){}return e.forRoot=function(){return{ngModule:w,providers:I}},e}(),e.DndModule=w=O([t.NgModule({declarations:[e.DraggableComponent,e.DraggableHandleComponent,e.DroppableComponent,e.SortableContainer,e.SortableComponent,e.SortableHandleComponent],exports:[e.DraggableComponent,e.DraggableHandleComponent,e.DroppableComponent,e.SortableContainer,e.SortableComponent,e.SortableHandleComponent]})],e.DndModule);var w;e.providers=I,e.AbstractHandleComponent=b,e.DataTransferEffect=l,e.DragImage=p,e.DragDropConfig=c,e.DragDropData=f,e.dragDropServiceFactory=n,e.dragDropSortableServiceFactory=i,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=ng2-dnd.umd.min.js.map | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/forms")):"function"==typeof define&&define.amd?define("ng2-drag-n-drop",["exports","@angular/core","@angular/forms"],t):t(e["ng2-drag-n-drop"]={},e.ng.core,e.ng.forms)}(this,function(e,l,t){"use strict";var a=function(e,t){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function r(e,t){function r(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function c(e){return"string"==typeof e}function p(e){return e!==undefined&&null!==e}var o=function k(e){this.name=e};o.COPY=new o("copy"),o.LINK=new o("link"),o.MOVE=new o("move"),o.NONE=new o("none");var n=function w(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,c(this.imageElement)){var a=this.imageElement;this.imageElement=new HTMLImageElement,this.imageElement.src=a}},s=function A(){this.onDragStartClass="dnd-drag-start",this.onDragEnterClass="dnd-drag-enter",this.onDragOverClass="dnd-drag-over",this.onSortableDragClass="dnd-sortable-drag",this.dragEffect=o.MOVE,this.dropEffect=o.MOVE,this.dragCursor="move",this.defaultCursor="pointer"},i=function x(){};function d(){return new g}var g=function P(){this.allowedDropZones=[]};function u(e){return new f(e)}g.decorators=[{type:l.Injectable}];var f=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){p(this._elem)&&this._elem.classList.remove(this._config.onSortableDragClass),p(e)&&(this._elem=e,this._elem.classList.add(this._config.onSortableDragClass))},e}();f.decorators=[{type:l.Injectable}],f.ctorParameters=function(){return[{type:s}]};var D=function(){function e(e,t,r,a){var i=this;this._dragDropService=t,this._config=r,this._cdr=a,this._dragEnabled=!1,this.dropEnabled=!1,this.dropZones=[],this.cloneItem=!1,this._defaultCursor=r.defaultCursor,this._elem=e.nativeElement,this._elem.style.cursor=this._defaultCursor,this._elem.ondragenter=function(e){i._onDragEnter(e)},this._elem.ondragover=function(e){return i._onDragOver(e),null!=e.dataTransfer&&(e.dataTransfer.dropEffect=i._config.dropEffect.name),!1},this._elem.ondragleave=function(e){i._onDragLeave(e)},this._elem.ondrop=function(e){i._onDrop(e)},this._elem.onmousedown=function(e){i._target=e.target},this._elem.ondragstart=function(e){if(!i._dragHandle||i._dragHandle.contains(i._target)){if(i._onDragStart(e),null!=e.dataTransfer){if(e.dataTransfer.setData("text",""),e.dataTransfer.effectAllowed=i.effectAllowed||i._config.dragEffect.name,p(i.dragImage))if(c(i.dragImage))e.dataTransfer.setDragImage(function o(e){var t=new HTMLImageElement;return t.src=e,t}(i.dragImage));else if(function n(e){return"function"==typeof e}(i.dragImage))e.dataTransfer.setDragImage(function s(e){return e()}(i.dragImage));else{var t=i.dragImage;e.dataTransfer.setDragImage(t.imageElement,t.x_offset,t.y_offset)}else if(p(i._config.dragImage)){var r=i._config.dragImage;e.dataTransfer.setDragImage(r.imageElement,r.x_offset,r.y_offset)}else i.cloneItem&&(i._dragHelper=i._elem.cloneNode(!0),i._dragHelper.classList.add("dnd-drag-item"),i._dragHelper.style.position="absolute",i._dragHelper.style.top="0px",i._dragHelper.style.left="-1000px",i._elem.parentElement.appendChild(i._dragHelper),e.dataTransfer.setDragImage(i._dragHelper,e.offsetX,e.offsetY));var a=i._dragHandle?i._dragHandle:i._elem;i._dragEnabled?a.style.cursor=i.effectCursor?i.effectCursor:i._config.dragCursor:a.style.cursor=i._defaultCursor}}else e.preventDefault()},this._elem.ondragend=function(e){i._elem.parentElement&&i._dragHelper&&i._elem.parentElement.removeChild(i._dragHelper),i._onDragEnd(e),(i._dragHandle?i._dragHandle:i._elem).style.cursor=i._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.setDragHandle=function(e){this._dragHandle=e},e.prototype.detectChanges=function(){var e=this;setTimeout(function(){e._cdr&&!e._cdr.destroyed&&e._cdr.detectChanges()},250)},e.prototype._onDragEnter=function(e){this._isDropAllowed(e)&&this._onDragEnterCallback(e)},e.prototype._onDragOver=function(e){this._isDropAllowed(e)&&(e.preventDefault&&e.preventDefault(),this._onDragOverCallback(e))},e.prototype._onDragLeave=function(e){this._isDropAllowed(e)&&this._onDragLeaveCallback(e)},e.prototype._onDrop=function(e){this._isDropAllowed(e)&&(this._preventAndStop(e),this._onDropCallback(e),this.detectChanges())},e.prototype._isDropAllowed=function(e){if((this._dragDropService.isDragged||e.dataTransfer&&e.dataTransfer.files)&&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 t=0;t<this._dragDropService.allowedDropZones.length;t++){var r=this._dragDropService.allowedDropZones[t];if(-1!==this.dropZones.indexOf(r))return!0}}return!1},e.prototype._preventAndStop=function(e){e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation()},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}();D.decorators=[{type:l.Injectable}],D.ctorParameters=function(){return[{type:l.ElementRef},{type:g},{type:s},{type:l.ChangeDetectorRef}]};var h=function H(e,t,r,a,o){this._dragDropService=t,this._config=r,this._Component=a,this._cdr=o,this._elem=e.nativeElement,this._Component.setDragHandle(this._elem)},b=function(n){function e(e,t,r,a){var o=n.call(this,e,t,r,a)||this;return o.onDragStart=new l.EventEmitter,o.onDragEnd=new l.EventEmitter,o.onDragSuccessCallback=new l.EventEmitter,o._defaultCursor=o._elem.style.cursor,o.dragEnabled=!0,o}return r(e,n),Object.defineProperty(e.prototype,"draggable",{set:function(e){this.dragEnabled=!!e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dropzones",{set:function(e){this.dropZones=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"effectallowed",{set:function(e){this.effectAllowed=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"effectcursor",{set:function(e){this.effectCursor=e},enumerable:!0,configurable:!0}),e.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})},e.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})},e}(D);b.decorators=[{type:l.Directive,args:[{selector:"[dnd-draggable]"}]}],b.ctorParameters=function(){return[{type:l.ElementRef},{type:g},{type:s},{type:l.ChangeDetectorRef}]},b.propDecorators={draggable:[{type:l.Input,args:["dragEnabled"]}],onDragStart:[{type:l.Output}],onDragEnd:[{type:l.Output}],dragData:[{type:l.Input}],onDragSuccessCallback:[{type:l.Output,args:["onDragSuccess"]}],dropzones:[{type:l.Input,args:["dropZones"]}],effectallowed:[{type:l.Input,args:["effectAllowed"]}],effectcursor:[{type:l.Input,args:["effectCursor"]}],dragImage:[{type:l.Input}],cloneItem:[{type:l.Input}]};var _=function(n){function e(e,t,r,a,o){return n.call(this,e,t,r,a,o)||this}return r(e,n),e}(h);_.decorators=[{type:l.Directive,args:[{selector:"[dnd-draggable-handle]"}]}],_.ctorParameters=function(){return[{type:l.ElementRef},{type:g},{type:s},{type:b},{type:l.ChangeDetectorRef}]};var m=function(n){function e(e,t,r,a){var o=n.call(this,e,t,r,a)||this;return o.onDropSuccess=new l.EventEmitter,o.onDragEnter=new l.EventEmitter,o.onDragOver=new l.EventEmitter,o.onDragLeave=new l.EventEmitter,o.dropEnabled=!0,o}return r(e,n),Object.defineProperty(e.prototype,"droppable",{set:function(e){this.dropEnabled=!!e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"allowdrop",{set:function(e){this.allowDrop=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dropzones",{set:function(e){this.dropZones=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"effectallowed",{set:function(e){this.effectAllowed=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"effectcursor",{set:function(e){this.effectCursor=e},enumerable:!0,configurable:!0}),e.prototype._onDragEnterCallback=function(e){this._dragDropService.isDragged&&(this._elem.classList.add(this._config.onDragEnterClass),this.onDragEnter.emit({dragData:this._dragDropService.dragData,mouseEvent:e}))},e.prototype._onDragOverCallback=function(e){this._dragDropService.isDragged&&(this._elem.classList.add(this._config.onDragOverClass),this.onDragOver.emit({dragData:this._dragDropService.dragData,mouseEvent:e}))},e.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}))},e.prototype._onDropCallback=function(e){var t=e.dataTransfer;(this._dragDropService.isDragged||t&&t.files)&&(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))},e}(D);m.decorators=[{type:l.Directive,args:[{selector:"[dnd-droppable]"}]}],m.ctorParameters=function(){return[{type:l.ElementRef},{type:g},{type:s},{type:l.ChangeDetectorRef}]},m.propDecorators={droppable:[{type:l.Input,args:["dropEnabled"]}],onDropSuccess:[{type:l.Output}],onDragEnter:[{type:l.Output}],onDragOver:[{type:l.Output}],onDragLeave:[{type:l.Output}],allowdrop:[{type:l.Input,args:["allowDrop"]}],dropzones:[{type:l.Input,args:["dropZones"]}],effectallowed:[{type:l.Input,args:["effectAllowed"]}],effectcursor:[{type:l.Input,args:["effectCursor"]}]};var v=function(s){function e(e,t,r,a,o){var n=s.call(this,e,t,r,a)||this;return n._sortableDataService=o,n._sortableData=[],n.dragEnabled=!1,n}return r(e,s),Object.defineProperty(e.prototype,"draggable",{set:function(e){this.dragEnabled=!!e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sortableData",{get:function(){return this._sortableData},set:function(e){(this._sortableData=e)instanceof t.FormArray?this.sortableHandler=new C:this.sortableHandler=new y,this.dropEnabled=!!this._sortableData},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dropzones",{set:function(e){this.dropZones=e},enumerable:!0,configurable:!0}),e.prototype._onDragEnterCallback=function(e){if(this._sortableDataService.isDragged){var t=this._sortableDataService.sortableContainer.getItemAt(this._sortableDataService.index);-1===this.indexOf(t)&&(this._sortableDataService.sortableContainer.removeItemAt(this._sortableDataService.index),0===this._sortableDataService.sortableContainer._sortableData.length&&(this._sortableDataService.sortableContainer.dropEnabled=!0),this.insertItemAt(t,0),(this._sortableDataService.sortableContainer=this)._sortableDataService.index=0),this.detectChanges()}},e.prototype.getItemAt=function(e){return this.sortableHandler.getItemAt(this._sortableData,e)},e.prototype.indexOf=function(e){return this.sortableHandler.indexOf(this._sortableData,e)},e.prototype.removeItemAt=function(e){this.sortableHandler.removeItemAt(this._sortableData,e)},e.prototype.insertItemAt=function(e,t){this.sortableHandler.insertItemAt(this._sortableData,e,t)},e.prototype.replaceItemAt=function(e,t){this.sortableHandler.replaceItemAt(this._sortableData,e,t)},e}(D);v.decorators=[{type:l.Directive,args:[{selector:"[dnd-sortable-container]"}]}],v.ctorParameters=function(){return[{type:l.ElementRef},{type:g},{type:s},{type:l.ChangeDetectorRef},{type:f}]},v.propDecorators={draggable:[{type:l.Input,args:["dragEnabled"]}],sortableData:[{type:l.Input}],dropzones:[{type:l.Input,args:["dropZones"]}]};var y=function(){function e(){}return e.prototype.getItemAt=function(e,t){return e[t]},e.prototype.indexOf=function(e,t){return e.indexOf(t)},e.prototype.removeItemAt=function(e,t){e.splice(t,1)},e.prototype.insertItemAt=function(e,t,r){e.splice(r,0,t)},e.prototype.replaceItemAt=function(e,t,r){e.splice(r,1,t)},e}(),C=function(){function e(){}return e.prototype.getItemAt=function(e,t){return e.at(t)},e.prototype.indexOf=function(e,t){return e.controls.indexOf(t)},e.prototype.removeItemAt=function(e,t){e.removeAt(t)},e.prototype.insertItemAt=function(e,t,r){e.insert(r,t)},e.prototype.replaceItemAt=function(e,t,r){e.setControl(r,t)},e}(),S=function(i){function e(e,t,r,a,o,n){var s=i.call(this,e,t,r,n)||this;return s._sortableContainer=a,s._sortableDataService=o,s.onDragSuccessCallback=new l.EventEmitter,s.onDragStartCallback=new l.EventEmitter,s.onDragOverCallback=new l.EventEmitter,s.onDragEndCallback=new l.EventEmitter,s.onDropSuccessCallback=new l.EventEmitter,s.dropZones=s._sortableContainer.dropZones,s.dragEnabled=!0,s.dropEnabled=!0,s}return r(e,i),Object.defineProperty(e.prototype,"draggable",{set:function(e){this.dragEnabled=!!e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"droppable",{set:function(e){this.dropEnabled=!!e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"effectallowed",{set:function(e){this.effectAllowed=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"effectcursor",{set:function(e){this.effectCursor=e},enumerable:!0,configurable:!0}),e.prototype._onDragStartCallback=function(e){this._sortableDataService.isDragged=!0,this._sortableDataService.sortableContainer=this._sortableContainer,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)},e.prototype._onDragOverCallback=function(e){if(this._sortableDataService.isDragged){if(this._sortableDataService.sortableContainer=this._sortableContainer,this._sortableDataService.index=this.index,this._sortableDataService.markSortable(this._elem),this._sortableContainer._elem.classList.add(this._config.onDragOverClass),this._dragDropService.dragData instanceof Array&&this._dragDropService.dragData[0]!==this._sortableContainer.getItemAt(this.index)){var t=this._sortableContainer.getItemAt(this.index),r=this._sortableContainer.indexOf(this._dragDropService.dragData[0]);this._sortableContainer.replaceItemAt(this._dragDropService.dragData[0],this.index),console.log(this._sortableContainer.sortableData),this._sortableContainer.replaceItemAt(t,r)}var a={index:this._sortableDataService.index,dragData:this._dragDropService.dragData};this.onDragOverCallback.emit(a)}},e.prototype._onDragEndCallback=function(e){this._sortableDataService.isDragged=!1,this._sortableDataService.sortableContainer=null,this._sortableDataService.index=null,this._sortableDataService.markSortable(null),this._dragDropService.isDragged=!1,this._dragDropService.dragData=null,this._dragDropService.onDragSuccessCallback=null,this._sortableContainer._elem.classList.remove(this._config.onDragOverClass),this.onDragEndCallback.emit(this._dragDropService.dragData)},e.prototype._onDragEnterCallback=function(e){if(this._sortableDataService.isDragged&&(this._sortableDataService.markSortable(this._elem),this.index!==this._sortableDataService.index||this._sortableDataService.sortableContainer.sortableData!==this._sortableContainer.sortableData)){var t=this._sortableDataService.sortableContainer.getItemAt(this._sortableDataService.index);this._sortableDataService.sortableContainer.removeItemAt(this._sortableDataService.index),0===this._sortableDataService.sortableContainer.sortableData.length&&(this._sortableDataService.sortableContainer.dropEnabled=!0),this._sortableContainer.insertItemAt(t,this.index),this._sortableContainer.dropEnabled&&(this._sortableContainer.dropEnabled=!1),this._sortableDataService.sortableContainer=this._sortableContainer,this._sortableDataService.index=this.index,this.detectChanges()}},e.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())},e}(D);S.decorators=[{type:l.Directive,args:[{selector:"[dnd-sortable]"}]}],S.ctorParameters=function(){return[{type:l.ElementRef},{type:g},{type:s},{type:v},{type:f},{type:l.ChangeDetectorRef}]},S.propDecorators={index:[{type:l.Input,args:["sortableIndex"]}],draggable:[{type:l.Input,args:["dragEnabled"]}],droppable:[{type:l.Input,args:["dropEnabled"]}],dragData:[{type:l.Input}],effectallowed:[{type:l.Input,args:["effectAllowed"]}],effectcursor:[{type:l.Input,args:["effectCursor"]}],onDragSuccessCallback:[{type:l.Output,args:["onDragSuccess"]}],onDragStartCallback:[{type:l.Output,args:["onDragStart"]}],onDragOverCallback:[{type:l.Output,args:["onDragOver"]}],onDragEndCallback:[{type:l.Output,args:["onDragEnd"]}],onDropSuccessCallback:[{type:l.Output,args:["onDropSuccess"]}]};var E=function(n){function e(e,t,r,a,o){return n.call(this,e,t,r,a,o)||this}return r(e,n),e}(h);E.decorators=[{type:l.Directive,args:[{selector:"[dnd-sortable-handle]"}]}],E.ctorParameters=function(){return[{type:l.ElementRef},{type:g},{type:s},{type:S},{type:l.ChangeDetectorRef}]};var I=[s,{provide:g,useFactory:d},{provide:f,useFactory:u,deps:[s]}],O=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:I}},e}();O.decorators=[{type:l.NgModule,args:[{declarations:[b,_,m,v,S,E],exports:[b,_,m,v,S,E]}]}],e.providers=I,e.DndModule=O,e.AbstractComponent=D,e.AbstractHandleComponent=h,e.DataTransferEffect=o,e.DragImage=n,e.DragDropConfig=s,e.dragDropServiceFactory=d,e.dragDropSortableServiceFactory=u,e.DragDropData=i,e.DragDropService=g,e.DragDropSortableService=f,e.DraggableComponent=b,e.DraggableHandleComponent=_,e.DroppableComponent=m,e.SortableContainer=v,e.SortableComponent=S,e.SortableHandleComponent=E,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=ng2-drag-n-drop.umd.min.js.map |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":3,"metadata":{"providers":[{"__symbolic":"reference","name":"DragDropConfig"},{"provide":{"__symbolic":"reference","name":"DragDropService"},"useFactory":{"__symbolic":"reference","name":"dragDropServiceFactory"}},{"provide":{"__symbolic":"reference","name":"DragDropSortableService"},"useFactory":{"__symbolic":"reference","name":"dragDropSortableServiceFactory"},"deps":[{"__symbolic":"reference","name":"DragDropConfig"}]}],"DndModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"declarations":[{"__symbolic":"reference","name":"DraggableComponent"},{"__symbolic":"reference","name":"DraggableHandleComponent"},{"__symbolic":"reference","name":"DroppableComponent"},{"__symbolic":"reference","name":"SortableContainer"},{"__symbolic":"reference","name":"SortableComponent"},{"__symbolic":"reference","name":"SortableHandleComponent"}],"exports":[{"__symbolic":"reference","name":"DraggableComponent"},{"__symbolic":"reference","name":"DraggableHandleComponent"},{"__symbolic":"reference","name":"DroppableComponent"},{"__symbolic":"reference","name":"SortableContainer"},{"__symbolic":"reference","name":"SortableComponent"},{"__symbolic":"reference","name":"SortableHandleComponent"}]}]}],"members":{},"statics":{"forRoot":{"__symbolic":"function","parameters":[],"value":{"ngModule":{"__symbolic":"reference","name":"DndModule"},"providers":{"__symbolic":"reference","name":"providers"}}}}},"AbstractComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","name":"DragDropService"},{"__symbolic":"reference","name":"DragDropConfig"},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef"}]}],"setDragHandle":[{"__symbolic":"method"}],"detectChanges":[{"__symbolic":"method"}],"_onDragEnter":[{"__symbolic":"method"}],"_onDragOver":[{"__symbolic":"method"}],"_onDragLeave":[{"__symbolic":"method"}],"_onDrop":[{"__symbolic":"method"}],"_isDropAllowed":[{"__symbolic":"method"}],"_preventAndStop":[{"__symbolic":"method"}],"_onDragStart":[{"__symbolic":"method"}],"_onDragEnd":[{"__symbolic":"method"}],"_onDragEnterCallback":[{"__symbolic":"method"}],"_onDragOverCallback":[{"__symbolic":"method"}],"_onDragLeaveCallback":[{"__symbolic":"method"}],"_onDropCallback":[{"__symbolic":"method"}],"_onDragStartCallback":[{"__symbolic":"method"}],"_onDragEndCallback":[{"__symbolic":"method"}]}},"AbstractHandleComponent":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","name":"DragDropService"},{"__symbolic":"reference","name":"DragDropConfig"},{"__symbolic":"reference","name":"AbstractComponent"},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef"}]}]}},"DataTransferEffect":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"}]}]},"statics":{"COPY":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"DataTransferEffect"},"arguments":["copy"]},"LINK":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"DataTransferEffect"},"arguments":["link"]},"MOVE":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"DataTransferEffect"},"arguments":["move"]},"NONE":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"DataTransferEffect"},"arguments":["none"]}}},"DragImage":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"any"},{"__symbolic":"reference","name":"number"},{"__symbolic":"reference","name":"number"}]}]}},"DragDropConfig":{"__symbolic":"class","members":{}},"DragDropData":{"__symbolic":"class","members":{}},"dragDropServiceFactory":{"__symbolic":"function","parameters":[],"value":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"DragDropService"}}},"DragDropService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{}},"dragDropSortableServiceFactory":{"__symbolic":"function","parameters":["config"],"value":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"DragDropSortableService"},"arguments":[{"__symbolic":"reference","name":"config"}]}},"DragDropSortableService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"DragDropConfig"}]}],"markSortable":[{"__symbolic":"method"}]}},"DraggableComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"AbstractComponent"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"[dnd-draggable]"}]}],"members":{"draggable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["dragEnabled"]}]}],"onDragStart":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"onDragEnd":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"dragData":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"onDragSuccessCallback":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"},"arguments":["onDragSuccess"]}]}],"dropzones":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["dropZones"]}]}],"effectallowed":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["effectAllowed"]}]}],"effectcursor":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["effectCursor"]}]}],"dragImage":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"cloneItem":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","name":"DragDropService"},{"__symbolic":"reference","name":"DragDropConfig"},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef"}]}],"_onDragStartCallback":[{"__symbolic":"method"}],"_onDragEndCallback":[{"__symbolic":"method"}]}},"DraggableHandleComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"AbstractHandleComponent"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"[dnd-draggable-handle]"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","name":"DragDropService"},{"__symbolic":"reference","name":"DragDropConfig"},{"__symbolic":"reference","name":"DraggableComponent"},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef"}]}]}},"DroppableComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"AbstractComponent"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"[dnd-droppable]"}]}],"members":{"droppable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["dropEnabled"]}]}],"onDropSuccess":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"onDragEnter":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"onDragOver":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"onDragLeave":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"allowdrop":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["allowDrop"]}]}],"dropzones":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["dropZones"]}]}],"effectallowed":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["effectAllowed"]}]}],"effectcursor":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["effectCursor"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","name":"DragDropService"},{"__symbolic":"reference","name":"DragDropConfig"},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef"}]}],"_onDragEnterCallback":[{"__symbolic":"method"}],"_onDragOverCallback":[{"__symbolic":"method"}],"_onDragLeaveCallback":[{"__symbolic":"method"}],"_onDropCallback":[{"__symbolic":"method"}]}},"SortableContainer":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"AbstractComponent"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"[dnd-sortable-container]"}]}],"members":{"draggable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["dragEnabled"]}]}],"sortableData":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"dropzones":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["dropZones"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","name":"DragDropService"},{"__symbolic":"reference","name":"DragDropConfig"},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef"},{"__symbolic":"reference","name":"DragDropSortableService"}]}],"_onDragEnterCallback":[{"__symbolic":"method"}],"getItemAt":[{"__symbolic":"method"}],"indexOf":[{"__symbolic":"method"}],"removeItemAt":[{"__symbolic":"method"}],"insertItemAt":[{"__symbolic":"method"}]}},"SortableComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"AbstractComponent"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"[dnd-sortable]"}]}],"members":{"index":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["sortableIndex"]}]}],"draggable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["dragEnabled"]}]}],"droppable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["dropEnabled"]}]}],"dragData":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"effectallowed":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["effectAllowed"]}]}],"effectcursor":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["effectCursor"]}]}],"onDragSuccessCallback":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"},"arguments":["onDragSuccess"]}]}],"onDragStartCallback":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"},"arguments":["onDragStart"]}]}],"onDragOverCallback":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"},"arguments":["onDragOver"]}]}],"onDragEndCallback":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"},"arguments":["onDragEnd"]}]}],"onDropSuccessCallback":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"},"arguments":["onDropSuccess"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","name":"DragDropService"},{"__symbolic":"reference","name":"DragDropConfig"},{"__symbolic":"reference","name":"SortableContainer"},{"__symbolic":"reference","name":"DragDropSortableService"},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef"}]}],"_onDragStartCallback":[{"__symbolic":"method"}],"_onDragOverCallback":[{"__symbolic":"method"}],"_onDragEndCallback":[{"__symbolic":"method"}],"_onDragEnterCallback":[{"__symbolic":"method"}],"_onDropCallback":[{"__symbolic":"method"}]}},"SortableHandleComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"AbstractHandleComponent"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"[dnd-sortable-handle]"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","name":"DragDropService"},{"__symbolic":"reference","name":"DragDropConfig"},{"__symbolic":"reference","name":"SortableComponent"},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef"}]}]}}},"origins":{"providers":"./src/dnd.module","DndModule":"./src/dnd.module","AbstractComponent":"./src/abstract.component","AbstractHandleComponent":"./src/abstract.component","DataTransferEffect":"./src/dnd.config","DragImage":"./src/dnd.config","DragDropConfig":"./src/dnd.config","DragDropData":"./src/dnd.service","dragDropServiceFactory":"./src/dnd.service","DragDropService":"./src/dnd.service","dragDropSortableServiceFactory":"./src/dnd.service","DragDropSortableService":"./src/dnd.service","DraggableComponent":"./src/draggable.component","DraggableHandleComponent":"./src/draggable.component","DroppableComponent":"./src/droppable.component","SortableContainer":"./src/sortable.component","SortableComponent":"./src/sortable.component","SortableHandleComponent":"./src/sortable.component"},"importAs":"ng2-dnd"} | ||
{"__symbolic":"module","version":4,"metadata":{"providers":[{"__symbolic":"reference","name":"DragDropConfig"},{"provide":{"__symbolic":"reference","name":"DragDropService"},"useFactory":{"__symbolic":"reference","name":"dragDropServiceFactory"}},{"provide":{"__symbolic":"reference","name":"DragDropSortableService"},"useFactory":{"__symbolic":"reference","name":"dragDropSortableServiceFactory"},"deps":[{"__symbolic":"reference","name":"DragDropConfig"}]}],"DndModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":25,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"DraggableComponent"},{"__symbolic":"reference","name":"DraggableHandleComponent"},{"__symbolic":"reference","name":"DroppableComponent"},{"__symbolic":"reference","name":"SortableContainer"},{"__symbolic":"reference","name":"SortableComponent"},{"__symbolic":"reference","name":"SortableHandleComponent"}],"exports":[{"__symbolic":"reference","name":"DraggableComponent"},{"__symbolic":"reference","name":"DraggableHandleComponent"},{"__symbolic":"reference","name":"DroppableComponent"},{"__symbolic":"reference","name":"SortableContainer"},{"__symbolic":"reference","name":"SortableComponent"},{"__symbolic":"reference","name":"SortableHandleComponent"}]}]}],"members":{},"statics":{"forRoot":{"__symbolic":"function","parameters":[],"value":{"ngModule":{"__symbolic":"reference","name":"DndModule"},"providers":{"__symbolic":"reference","name":"providers"}}}}},"AbstractComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":11,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":93,"character":25},{"__symbolic":"reference","name":"DragDropService"},{"__symbolic":"reference","name":"DragDropConfig"},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":94,"character":22}]}],"setDragHandle":[{"__symbolic":"method"}],"detectChanges":[{"__symbolic":"method"}],"_onDragEnter":[{"__symbolic":"method"}],"_onDragOver":[{"__symbolic":"method"}],"_onDragLeave":[{"__symbolic":"method"}],"_onDrop":[{"__symbolic":"method"}],"_isDropAllowed":[{"__symbolic":"method"}],"_preventAndStop":[{"__symbolic":"method"}],"_onDragStart":[{"__symbolic":"method"}],"_onDragEnd":[{"__symbolic":"method"}],"_onDragEnterCallback":[{"__symbolic":"method"}],"_onDragOverCallback":[{"__symbolic":"method"}],"_onDragLeaveCallback":[{"__symbolic":"method"}],"_onDropCallback":[{"__symbolic":"method"}],"_onDragStartCallback":[{"__symbolic":"method"}],"_onDragEndCallback":[{"__symbolic":"method"}]}},"AbstractHandleComponent":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":93,"character":25},{"__symbolic":"reference","name":"DragDropService"},{"__symbolic":"reference","name":"DragDropConfig"},{"__symbolic":"reference","name":"AbstractComponent"},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":94,"character":22}]}]}},"DataTransferEffect":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"}]}]},"statics":{"COPY":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"DataTransferEffect"},"arguments":["copy"]},"LINK":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"DataTransferEffect"},"arguments":["link"]},"MOVE":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"DataTransferEffect"},"arguments":["move"]},"NONE":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"DataTransferEffect"},"arguments":["none"]}}},"DragImage":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"any"},{"__symbolic":"reference","name":"number"},{"__symbolic":"reference","name":"number"}]}]}},"DragDropConfig":{"__symbolic":"class","members":{}},"DragDropData":{"__symbolic":"class","members":{}},"dragDropServiceFactory":{"__symbolic":"function","parameters":[],"value":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"DragDropService"}}},"DragDropService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":19,"character":1}}],"members":{}},"dragDropSortableServiceFactory":{"__symbolic":"function","parameters":["config"],"value":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"DragDropSortableService"},"arguments":[{"__symbolic":"reference","name":"config"}]}},"DragDropSortableService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":31,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"DragDropConfig"}]}],"markSortable":[{"__symbolic":"method"}]}},"DraggableComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"AbstractComponent"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":11,"character":1},"arguments":[{"selector":"[dnd-draggable]"}]}],"members":{"draggable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":14,"character":5},"arguments":["dragEnabled"]}]}],"onDragStart":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":21,"character":5}}]}],"onDragEnd":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":22,"character":5}}]}],"dragData":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":27,"character":5}}]}],"onDragSuccessCallback":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":33,"character":5},"arguments":["onDragSuccess"]}]}],"dropzones":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":35,"character":5},"arguments":["dropZones"]}]}],"effectallowed":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":42,"character":5},"arguments":["effectAllowed"]}]}],"effectcursor":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":49,"character":5},"arguments":["effectCursor"]}]}],"dragImage":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":76,"character":5}}]}],"cloneItem":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":79,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":81,"character":25},{"__symbolic":"reference","name":"DragDropService"},{"__symbolic":"reference","name":"DragDropConfig"},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":82,"character":12}]}],"_onDragStartCallback":[{"__symbolic":"method"}],"_onDragEndCallback":[{"__symbolic":"method"}]}},"DraggableHandleComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"AbstractHandleComponent"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":109,"character":1},"arguments":[{"selector":"[dnd-draggable-handle]"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":81,"character":25},{"__symbolic":"reference","name":"DragDropService"},{"__symbolic":"reference","name":"DragDropConfig"},{"__symbolic":"reference","name":"DraggableComponent"},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":82,"character":12}]}]}},"DroppableComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"AbstractComponent"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":11,"character":1},"arguments":[{"selector":"[dnd-droppable]"}]}],"members":{"droppable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":14,"character":5},"arguments":["dropEnabled"]}]}],"onDropSuccess":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":22,"character":5}}]}],"onDragEnter":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":23,"character":5}}]}],"onDragOver":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":24,"character":5}}]}],"onDragLeave":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":25,"character":5}}]}],"allowdrop":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":27,"character":5},"arguments":["allowDrop"]}]}],"dropzones":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":31,"character":5},"arguments":["dropZones"]}]}],"effectallowed":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":38,"character":5},"arguments":["effectAllowed"]}]}],"effectcursor":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":45,"character":5},"arguments":["effectCursor"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":49,"character":25},{"__symbolic":"reference","name":"DragDropService"},{"__symbolic":"reference","name":"DragDropConfig"},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":50,"character":12}]}],"_onDragEnterCallback":[{"__symbolic":"method"}],"_onDragOverCallback":[{"__symbolic":"method"}],"_onDragLeaveCallback":[{"__symbolic":"method"}],"_onDropCallback":[{"__symbolic":"method"}]}},"SortableContainer":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"AbstractComponent"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":12,"character":1},"arguments":[{"selector":"[dnd-sortable-container]"}]}],"members":{"draggable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":15,"character":5},"arguments":["dragEnabled"]}]}],"sortableData":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":22,"character":5}}]}],"dropzones":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":37,"character":5},"arguments":["dropZones"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":41,"character":25},{"__symbolic":"reference","name":"DragDropService"},{"__symbolic":"reference","name":"DragDropConfig"},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":41,"character":98},{"__symbolic":"reference","name":"DragDropSortableService"}]}],"_onDragEnterCallback":[{"__symbolic":"method"}],"getItemAt":[{"__symbolic":"method"}],"indexOf":[{"__symbolic":"method"}],"removeItemAt":[{"__symbolic":"method"}],"insertItemAt":[{"__symbolic":"method"}],"replaceItemAt":[{"__symbolic":"method"}]}},"SortableComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"AbstractComponent"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":133,"character":1},"arguments":[{"selector":"[dnd-sortable]"}]}],"members":{"index":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":136,"character":5},"arguments":["sortableIndex"]}]}],"draggable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":138,"character":5},"arguments":["dragEnabled"]}]}],"droppable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":142,"character":5},"arguments":["dropEnabled"]}]}],"dragData":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":149,"character":5}}]}],"effectallowed":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":154,"character":5},"arguments":["effectAllowed"]}]}],"effectcursor":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":161,"character":5},"arguments":["effectCursor"]}]}],"onDragSuccessCallback":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":169,"character":5},"arguments":["onDragSuccess"]}]}],"onDragStartCallback":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":171,"character":5},"arguments":["onDragStart"]}]}],"onDragOverCallback":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":172,"character":5},"arguments":["onDragOver"]}]}],"onDragEndCallback":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":173,"character":5},"arguments":["onDragEnd"]}]}],"onDropSuccessCallback":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":174,"character":5},"arguments":["onDropSuccess"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":41,"character":25},{"__symbolic":"reference","name":"DragDropService"},{"__symbolic":"reference","name":"DragDropConfig"},{"__symbolic":"reference","name":"SortableContainer"},{"__symbolic":"reference","name":"DragDropSortableService"},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":41,"character":98}]}],"_onDragStartCallback":[{"__symbolic":"method"}],"_onDragOverCallback":[{"__symbolic":"method"}],"_onDragEndCallback":[{"__symbolic":"method"}],"_onDragEnterCallback":[{"__symbolic":"method"}],"_onDropCallback":[{"__symbolic":"method"}]}},"SortableHandleComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"AbstractHandleComponent"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":275,"character":1},"arguments":[{"selector":"[dnd-sortable-handle]"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":41,"character":25},{"__symbolic":"reference","name":"DragDropService"},{"__symbolic":"reference","name":"DragDropConfig"},{"__symbolic":"reference","name":"SortableComponent"},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":41,"character":98}]}]}}},"origins":{"providers":"./src/dnd.module","DndModule":"./src/dnd.module","AbstractComponent":"./src/abstract.component","AbstractHandleComponent":"./src/abstract.component","DataTransferEffect":"./src/dnd.config","DragImage":"./src/dnd.config","DragDropConfig":"./src/dnd.config","DragDropData":"./src/dnd.service","dragDropServiceFactory":"./src/dnd.service","DragDropService":"./src/dnd.service","dragDropSortableServiceFactory":"./src/dnd.service","DragDropSortableService":"./src/dnd.service","DraggableComponent":"./src/draggable.component","DraggableHandleComponent":"./src/draggable.component","DroppableComponent":"./src/droppable.component","SortableContainer":"./src/sortable.component","SortableComponent":"./src/sortable.component","SortableHandleComponent":"./src/sortable.component"},"importAs":"ng2-drag-n-drop"} |
{ | ||
"author": { | ||
"name": "Mohammed Ali Chherawalla" | ||
}, | ||
"repository": { | ||
@@ -9,12 +6,7 @@ "type": "git", | ||
}, | ||
"scripts": { | ||
"build": "npm run clean && ngc && ng-packagr -p ng-package.json && cp style.css dist/bundles/style.css && rimraf dist/tests", | ||
"clean": "rimraf dist", | ||
"commit": "npm run prepublish && npm test && git-cz", | ||
"semantic-release": "semantic-release pre && npm publish && semantic-release post", | ||
"test": "karma start", | ||
"test-watch": "tsc --noUnusedParameters --noUnusedLocals && karma start --no-single-run --auto-watch" | ||
"author": { | ||
"name": "Mohammed Ali Chherawalla" | ||
}, | ||
"typings": "ng2-drag-n-drop.d.ts", | ||
"version": "1.0.4", | ||
"version": "1.1.0", | ||
"bugs": { | ||
@@ -67,3 +59,3 @@ "url": "https://github.com/aliChherawalla/ng2-drag-n-drop/issues" | ||
}, | ||
"es2015": "ng2-drag-n-drop.js", | ||
"es2015": "esm2015/ng2-drag-n-drop.js", | ||
"homepage": "https://github.com/aliChherawalla/ng2-drag-n-drop#readme", | ||
@@ -81,3 +73,3 @@ "keywords": [ | ||
"metadata": "ng2-drag-n-drop.metadata.json", | ||
"module": "ng2-drag-n-drop.es5.js", | ||
"module": "esm5/ng2-drag-n-drop.js", | ||
"name": "ng2-drag-n-drop", | ||
@@ -87,3 +79,6 @@ "peerDependencies": { | ||
"@angular/forms": "^4.0.0 || ^5.0.0" | ||
}, | ||
"dependencies": { | ||
"tslib": "^1.7.1" | ||
} | ||
} |
@@ -827,2 +827,2 @@ # Angular 2 Drag-and-Drop | ||
# License | ||
[MIT](/LICENSE) | ||
[MIT](/LICENSE) |
@@ -80,10 +80,10 @@ import { ChangeDetectorRef } from '@angular/core'; | ||
detectChanges(): void; | ||
private _onDragEnter(event); | ||
private _onDragOver(event); | ||
private _onDragLeave(event); | ||
private _onDrop(event); | ||
private _isDropAllowed(event); | ||
private _preventAndStop(event); | ||
private _onDragStart(event); | ||
private _onDragEnd(event); | ||
private _onDragEnter; | ||
private _onDragOver; | ||
private _onDragLeave; | ||
private _onDrop; | ||
private _isDropAllowed; | ||
private _preventAndStop; | ||
private _onDragStart; | ||
private _onDragEnd; | ||
_onDragEnterCallback(event: Event): void; | ||
@@ -90,0 +90,0 @@ _onDragOverCallback(event: Event): void; |
import { ModuleWithProviders } from "@angular/core"; | ||
import { DragDropConfig } from './dnd.config'; | ||
import { DragDropService, DragDropSortableService } from './dnd.service'; | ||
import { DragDropService, DragDropSortableService, dragDropServiceFactory, dragDropSortableServiceFactory } from './dnd.service'; | ||
export * from './abstract.component'; | ||
@@ -12,6 +12,7 @@ export * from './dnd.config'; | ||
provide: typeof DragDropService; | ||
useFactory: () => DragDropService; | ||
useFactory: typeof dragDropServiceFactory; | ||
deps?: undefined; | ||
} | { | ||
provide: typeof DragDropSortableService; | ||
useFactory: (config: DragDropConfig) => DragDropSortableService; | ||
useFactory: typeof dragDropSortableServiceFactory; | ||
deps: (typeof DragDropConfig)[]; | ||
@@ -18,0 +19,0 @@ })[]; |
@@ -20,2 +20,3 @@ import { ChangeDetectorRef } from '@angular/core'; | ||
insertItemAt(item: any, index: number): void; | ||
replaceItemAt(item: any, index: number): void; | ||
} | ||
@@ -22,0 +23,0 @@ export declare class SortableComponent extends AbstractComponent { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Mixed license
License(Experimental) Package contains multiple licenses.
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
473691
3
1
3290
827
+ Addedtslib@^1.7.1