Comparing version 2.0.1 to 2.0.2
import { ModuleWithProviders } from "@angular/core"; | ||
import { DragDropConfig } from './src/dnd.config'; | ||
import { DragDropService, DragDropSortableService } from './src/dnd.service'; | ||
export * from './src/abstract.component'; | ||
@@ -8,6 +10,12 @@ export * from './src/dnd.config'; | ||
export * from './src/sortable.component'; | ||
export declare const DND_PROVIDERS: any[]; | ||
export declare const DND_DIRECTIVES: any[]; | ||
export declare let providers: ({ | ||
provide: typeof DragDropService; | ||
useFactory: () => DragDropService; | ||
} | { | ||
provide: typeof DragDropSortableService; | ||
useFactory: (config: DragDropConfig) => DragDropSortableService; | ||
deps: typeof DragDropConfig[]; | ||
})[]; | ||
export declare class DndModule { | ||
static forRoot(): ModuleWithProviders; | ||
} |
66
index.js
// Copyright (C) 2016 Sergey Akopkokhyants | ||
// This project is licensed under the terms of the MIT license. | ||
// https://github.com/akserg/ng2-dnd | ||
"use strict"; | ||
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; | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
var core_1 = require("@angular/core"); | ||
var common_1 = require("@angular/common"); | ||
var dnd_config_1 = require('./src/dnd.config'); | ||
var dnd_service_1 = require('./src/dnd.service'); | ||
var draggable_component_1 = require('./src/draggable.component'); | ||
var droppable_component_1 = require('./src/droppable.component'); | ||
var sortable_component_1 = require('./src/sortable.component'); | ||
__export(require('./src/abstract.component')); | ||
__export(require('./src/dnd.config')); | ||
__export(require('./src/dnd.service')); | ||
__export(require('./src/draggable.component')); | ||
__export(require('./src/droppable.component')); | ||
__export(require('./src/sortable.component')); | ||
exports.DND_PROVIDERS = [dnd_config_1.DragDropConfig, dnd_service_1.DragDropService, dnd_service_1.DragDropSortableService]; | ||
exports.DND_DIRECTIVES = [draggable_component_1.DraggableComponent, droppable_component_1.DroppableComponent, sortable_component_1.SortableContainer, sortable_component_1.SortableComponent]; | ||
var DndModule = (function () { | ||
import { NgModule } from "@angular/core"; | ||
import { DragDropConfig } from './src/dnd.config'; | ||
import { DragDropService, DragDropSortableService, dragDropServiceFactory, dragDropSortableServiceFactory } from './src/dnd.service'; | ||
import { DraggableComponent } from './src/draggable.component'; | ||
import { DroppableComponent } from './src/droppable.component'; | ||
import { SortableContainer, SortableComponent } from './src/sortable.component'; | ||
export * from './src/abstract.component'; | ||
export * from './src/dnd.config'; | ||
export * from './src/dnd.service'; | ||
export * from './src/draggable.component'; | ||
export * from './src/droppable.component'; | ||
export * from './src/sortable.component'; | ||
export var providers = [ | ||
{ provide: DragDropService, useFactory: dragDropServiceFactory }, | ||
{ provide: DragDropSortableService, useFactory: dragDropSortableServiceFactory, deps: [DragDropConfig] } | ||
]; | ||
export var DndModule = (function () { | ||
function DndModule() { | ||
@@ -38,16 +26,14 @@ } | ||
ngModule: DndModule, | ||
providers: [dnd_config_1.DragDropConfig, dnd_service_1.DragDropService, dnd_service_1.DragDropSortableService] | ||
providers: providers | ||
}; | ||
}; | ||
DndModule = __decorate([ | ||
core_1.NgModule({ | ||
imports: [common_1.CommonModule], | ||
declarations: [draggable_component_1.DraggableComponent, droppable_component_1.DroppableComponent, sortable_component_1.SortableContainer, sortable_component_1.SortableComponent], | ||
exports: [draggable_component_1.DraggableComponent, droppable_component_1.DroppableComponent, sortable_component_1.SortableContainer, sortable_component_1.SortableComponent] | ||
}), | ||
__metadata('design:paramtypes', []) | ||
], DndModule); | ||
DndModule.decorators = [ | ||
{ type: NgModule, args: [{ | ||
declarations: [DraggableComponent, DroppableComponent, SortableContainer, SortableComponent], | ||
exports: [DraggableComponent, DroppableComponent, SortableContainer, SortableComponent], | ||
},] }, | ||
]; | ||
/** @nocollapse */ | ||
DndModule.ctorParameters = function () { return []; }; | ||
return DndModule; | ||
}()); | ||
exports.DndModule = DndModule; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "ng2-dnd", | ||
"description": "Angular 2 Drag-and-Drop without dependencies", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"scripts": { | ||
"test": "tsc && karma start", | ||
"test": "karma start", | ||
"test-watch": "tsc && karma start --no-single-run --auto-watch", | ||
"minify": "node node_modules/uglify-js/bin/uglifyjs bundles/ng2-dnd.js -o bundles/ng2-dnd.min.js --source-map bundles/ng2-dnd.min.js.map -c -m", | ||
"prepublish": "typings install && tsc && node make.js && npm run minify", | ||
"commit": "npm run prepublish && npm test && git-cz", | ||
"prepublish": "ngc && npm run build", | ||
"build": "webpack && cp style.css bundles/style.css", | ||
"semantic-release": "semantic-release pre && npm publish && semantic-release post" | ||
@@ -29,31 +30,47 @@ }, | ||
}, | ||
"main": "index.js", | ||
"typings": "index", | ||
"main": "bundles/index.umd.js", | ||
"module": "index.js", | ||
"typings": "index.d.ts", | ||
"homepage": "https://github.com/akserg/ng2-dnd#readme", | ||
"dependencies": { | ||
"core-js": "^2.4.1", | ||
"reflect-metadata": "^0.1.3", | ||
"rxjs": "5.0.0-beta.12", | ||
"zone.js": "^0.6.23" | ||
"peerDependencies": { | ||
"@angular/core": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"@angular/common": "2.0.0", | ||
"@angular/compiler": "2.0.0", | ||
"@angular/core": "2.0.0", | ||
"@angular/platform-browser": "2.0.0", | ||
"@angular/platform-browser-dynamic": "2.0.0", | ||
"commitizen": "^2.7.6", | ||
"cz-conventional-changelog": "^1.1.5", | ||
"jasmine-core": "~2.5.1", | ||
"karma": "~1.3.0", | ||
"karma-chrome-launcher": "~2.0.0", | ||
"karma-firefox-launcher": "~1.0.0", | ||
"karma-htmlfile-reporter": "^0.3.4", | ||
"karma-jasmine": "~1.0.2", | ||
"semantic-release": "^4.3.5", | ||
"systemjs": "~0.19.27", | ||
"systemjs-builder": "^0.15.6", | ||
"typescript": "^2.0.2", | ||
"typings": "^1.3.3", | ||
"uglify-js": "^2.6.2" | ||
"@angular/common": "^2.1.2", | ||
"@angular/compiler": "^2.1.2", | ||
"@angular/compiler-cli": "^2.1.2", | ||
"@angular/core": "^2.1.2", | ||
"@angular/platform-browser": "^2.1.2", | ||
"@angular/platform-browser-dynamic": "^2.1.2", | ||
"@angular/platform-server": "^2.1.2", | ||
"@types/hammerjs": "2.0.33", | ||
"@types/jasmine": "2.5.37", | ||
"@types/node": "6.0.46", | ||
"awesome-typescript-loader": "2.2.4", | ||
"codelyzer": "1.0.0-beta.3", | ||
"commitizen": "2.8.6", | ||
"core-js": "2.4.1", | ||
"cz-conventional-changelog": "1.2.0", | ||
"istanbul-instrumenter-loader": "0.2.0", | ||
"jasmine-core": "2.5.2", | ||
"karma": "1.3.0", | ||
"karma-chrome-launcher": "2.0.0", | ||
"karma-firefox-launcher": "1.0.0", | ||
"karma-coverage": "1.1.1", | ||
"karma-jasmine": "1.0.2", | ||
"karma-mocha-reporter": "^2.1.0", | ||
"karma-remap-coverage": "~0.1.2", | ||
"karma-sourcemap-loader": "^0.3.7", | ||
"karma-webpack": "^1.8.0", | ||
"loader-utils": "~0.2.16", | ||
"reflect-metadata": "0.1.8", | ||
"rxjs": "^5.0.1", | ||
"semantic-release": "4.3.5", | ||
"source-map-loader": "0.1.5", | ||
"ts-helpers": "1.1.2", | ||
"tslint": "3.15.1", | ||
"tslint-loader": "2.1.5", | ||
"typescript": "2.0.10", | ||
"webpack": "2.1.0-beta.25", | ||
"zone.js": "^0.7.2" | ||
}, | ||
@@ -60,0 +77,0 @@ "config": { |
@@ -213,3 +213,3 @@ # Angular 2 Drag-and-Drop [![npm version](https://badge.fury.io/js/ng2-dnd.svg)](https://badge.fury.io/js/ng2-dnd) [![npm monthly downloads](https://img.shields.io/npm/dm/ng2-dnd.svg?style=flat-square)](https://www.npmjs.com/package/ng2-dnd) | ||
<div [hidden]="!receivedData.length > 0" | ||
*ngFor="#data of receivedData">{{data | json}}</div> | ||
*ngFor="let data of receivedData">{{data | json}}</div> | ||
</div> | ||
@@ -216,0 +216,0 @@ </div> |
// Copyright (C) 2016 Sergey Akopkokhyants | ||
// This project is licensed under the terms of the MIT license. | ||
// https://github.com/akserg/ng2-dnd | ||
"use strict"; | ||
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; | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
var core_1 = require('@angular/core'); | ||
var core_2 = require('@angular/core'); | ||
var dnd_config_1 = require('./dnd.config'); | ||
var dnd_service_1 = require('./dnd.service'); | ||
var dnd_utils_1 = require('./dnd.utils'); | ||
var AbstractComponent = (function () { | ||
import { Injectable, ChangeDetectorRef } from '@angular/core'; | ||
import { ElementRef } from '@angular/core'; | ||
import { DragDropConfig } from './dnd.config'; | ||
import { DragDropService } from './dnd.service'; | ||
import { isString, isFunction, isPresent, createImage, callFun } from './dnd.utils'; | ||
export var AbstractComponent = (function () { | ||
function AbstractComponent(elemRef, _dragDropService, _config, _cdr) { | ||
@@ -68,8 +58,8 @@ var _this = this; | ||
// Change drag image | ||
if (dnd_utils_1.isPresent(_this.dragImage)) { | ||
if (dnd_utils_1.isString(_this.dragImage)) { | ||
event.dataTransfer.setDragImage(dnd_utils_1.createImage(_this.dragImage)); | ||
if (isPresent(_this.dragImage)) { | ||
if (isString(_this.dragImage)) { | ||
event.dataTransfer.setDragImage(createImage(_this.dragImage)); | ||
} | ||
else if (dnd_utils_1.isFunction(_this.dragImage)) { | ||
event.dataTransfer.setDragImage(dnd_utils_1.callFun(_this.dragImage)); | ||
else if (isFunction(_this.dragImage)) { | ||
event.dataTransfer.setDragImage(callFun(_this.dragImage)); | ||
} | ||
@@ -81,3 +71,3 @@ else { | ||
} | ||
else if (dnd_utils_1.isPresent(_this._config.dragImage)) { | ||
else if (isPresent(_this._config.dragImage)) { | ||
var dragImage = _this._config.dragImage; | ||
@@ -220,9 +210,13 @@ event.dataTransfer.setDragImage(dragImage.imageElement, dragImage.x_offset, dragImage.y_offset); | ||
AbstractComponent.prototype._onDragEndCallback = function (event) { }; | ||
AbstractComponent = __decorate([ | ||
core_1.Injectable(), | ||
__metadata('design:paramtypes', [core_2.ElementRef, dnd_service_1.DragDropService, dnd_config_1.DragDropConfig, core_1.ChangeDetectorRef]) | ||
], AbstractComponent); | ||
AbstractComponent.decorators = [ | ||
{ type: Injectable }, | ||
]; | ||
/** @nocollapse */ | ||
AbstractComponent.ctorParameters = function () { return [ | ||
{ type: ElementRef, }, | ||
{ type: DragDropService, }, | ||
{ type: DragDropConfig, }, | ||
{ type: ChangeDetectorRef, }, | ||
]; }; | ||
return AbstractComponent; | ||
}()); | ||
exports.AbstractComponent = AbstractComponent; | ||
//# sourceMappingURL=abstract.component.js.map |
@@ -10,6 +10,6 @@ export declare class DataTransferEffect { | ||
export declare class DragImage { | ||
imageElement: string | HTMLElement; | ||
imageElement: any; | ||
x_offset: number; | ||
y_offset: number; | ||
constructor(imageElement: string | HTMLElement, x_offset?: number, y_offset?: number); | ||
constructor(imageElement: any, x_offset?: number, y_offset?: number); | ||
} | ||
@@ -16,0 +16,0 @@ export declare class DragDropConfig { |
// Copyright (C) 2016 Sergey Akopkokhyants | ||
// This project is licensed under the terms of the MIT license. | ||
// https://github.com/akserg/ng2-dnd | ||
"use strict"; | ||
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; | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
var core_1 = require('@angular/core'); | ||
var dnd_utils_1 = require('./dnd.utils'); | ||
var DataTransferEffect = (function () { | ||
import { isString } from './dnd.utils'; | ||
export var DataTransferEffect = (function () { | ||
function DataTransferEffect(name) { | ||
@@ -24,10 +13,5 @@ this.name = name; | ||
DataTransferEffect.NONE = new DataTransferEffect('none'); | ||
DataTransferEffect = __decorate([ | ||
core_1.Injectable(), | ||
__metadata('design:paramtypes', [String]) | ||
], DataTransferEffect); | ||
return DataTransferEffect; | ||
}()); | ||
exports.DataTransferEffect = DataTransferEffect; | ||
var DragImage = (function () { | ||
export var DragImage = (function () { | ||
function DragImage(imageElement, x_offset, y_offset) { | ||
@@ -39,3 +23,3 @@ if (x_offset === void 0) { x_offset = 0; } | ||
this.y_offset = y_offset; | ||
if (dnd_utils_1.isString(this.imageElement)) { | ||
if (isString(this.imageElement)) { | ||
// Create real image from string source | ||
@@ -47,10 +31,5 @@ var imgScr = this.imageElement; | ||
} | ||
DragImage = __decorate([ | ||
core_1.Injectable(), | ||
__metadata('design:paramtypes', [Object, Number, Number]) | ||
], DragImage); | ||
return DragImage; | ||
}()); | ||
exports.DragImage = DragImage; | ||
var DragDropConfig = (function () { | ||
export var DragDropConfig = (function () { | ||
function DragDropConfig() { | ||
@@ -65,9 +44,3 @@ this.onDragStartClass = "dnd-drag-start"; | ||
} | ||
DragDropConfig = __decorate([ | ||
core_1.Injectable(), | ||
__metadata('design:paramtypes', []) | ||
], DragDropConfig); | ||
return DragDropConfig; | ||
}()); | ||
exports.DragDropConfig = DragDropConfig; | ||
//# sourceMappingURL=dnd.config.js.map |
import { EventEmitter } from '@angular/core'; | ||
import { DragDropConfig } from './dnd.config'; | ||
export interface DragDropData { | ||
export declare class DragDropData { | ||
dragData: any; | ||
mouseEvent: MouseEvent; | ||
} | ||
export declare function dragDropServiceFactory(): DragDropService; | ||
export declare class DragDropService { | ||
@@ -13,2 +14,3 @@ allowedDropZones: Array<string>; | ||
} | ||
export declare function dragDropSortableServiceFactory(config: DragDropConfig): DragDropSortableService; | ||
export declare class DragDropSortableService { | ||
@@ -15,0 +17,0 @@ private _config; |
// Copyright (C) 2016 Sergey Akopkokhyants | ||
// This project is licensed under the terms of the MIT license. | ||
// https://github.com/akserg/ng2-dnd | ||
"use strict"; | ||
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; | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
var core_1 = require('@angular/core'); | ||
var dnd_config_1 = require('./dnd.config'); | ||
var dnd_utils_1 = require('./dnd.utils'); | ||
var DragDropService = (function () { | ||
import { Injectable } from '@angular/core'; | ||
import { DragDropConfig } from './dnd.config'; | ||
import { isPresent } from './dnd.utils'; | ||
export var DragDropData = (function () { | ||
function DragDropData() { | ||
} | ||
return DragDropData; | ||
}()); | ||
export function dragDropServiceFactory() { | ||
return new DragDropService(); | ||
} | ||
export var DragDropService = (function () { | ||
function DragDropService() { | ||
this.allowedDropZones = []; | ||
} | ||
DragDropService = __decorate([ | ||
core_1.Injectable(), | ||
__metadata('design:paramtypes', []) | ||
], DragDropService); | ||
DragDropService.decorators = [ | ||
{ type: Injectable }, | ||
]; | ||
/** @nocollapse */ | ||
DragDropService.ctorParameters = function () { return []; }; | ||
return DragDropService; | ||
}()); | ||
exports.DragDropService = DragDropService; | ||
var DragDropSortableService = (function () { | ||
export function dragDropSortableServiceFactory(config) { | ||
return new DragDropSortableService(config); | ||
} | ||
export var DragDropSortableService = (function () { | ||
function DragDropSortableService(_config) { | ||
@@ -40,6 +41,6 @@ this._config = _config; | ||
DragDropSortableService.prototype.markSortable = function (elem) { | ||
if (dnd_utils_1.isPresent(this._elem)) { | ||
if (isPresent(this._elem)) { | ||
this._elem.classList.remove(this._config.onSortableDragClass); | ||
} | ||
if (dnd_utils_1.isPresent(elem)) { | ||
if (isPresent(elem)) { | ||
this._elem = elem; | ||
@@ -49,9 +50,10 @@ this._elem.classList.add(this._config.onSortableDragClass); | ||
}; | ||
DragDropSortableService = __decorate([ | ||
core_1.Injectable(), | ||
__metadata('design:paramtypes', [dnd_config_1.DragDropConfig]) | ||
], DragDropSortableService); | ||
DragDropSortableService.decorators = [ | ||
{ type: Injectable }, | ||
]; | ||
/** @nocollapse */ | ||
DragDropSortableService.ctorParameters = function () { return [ | ||
{ type: DragDropConfig, }, | ||
]; }; | ||
return DragDropSortableService; | ||
}()); | ||
exports.DragDropSortableService = DragDropSortableService; | ||
//# sourceMappingURL=dnd.service.js.map |
@@ -1,27 +0,23 @@ | ||
"use strict"; | ||
/** | ||
* Check and return true if an object is type of string | ||
*/ | ||
function isString(obj) { | ||
export function isString(obj) { | ||
return typeof obj === "string"; | ||
} | ||
exports.isString = isString; | ||
/** | ||
* Check and return true if an object not undefined or null | ||
*/ | ||
function isPresent(obj) { | ||
export function isPresent(obj) { | ||
return obj !== undefined && obj !== null; | ||
} | ||
exports.isPresent = isPresent; | ||
/** | ||
* Check and return true if an object is type of Function | ||
*/ | ||
function isFunction(obj) { | ||
export function isFunction(obj) { | ||
return typeof obj === "function"; | ||
} | ||
exports.isFunction = isFunction; | ||
/** | ||
* Create Image element with specified url string | ||
*/ | ||
function createImage(src) { | ||
export function createImage(src) { | ||
var img = new HTMLImageElement(); | ||
@@ -31,10 +27,7 @@ img.src = src; | ||
} | ||
exports.createImage = createImage; | ||
/** | ||
* Call the function | ||
*/ | ||
function callFun(fun) { | ||
export function callFun(fun) { | ||
return fun(); | ||
} | ||
exports.callFun = callFun; | ||
//# sourceMappingURL=dnd.utils.js.map |
// Copyright (C) 2016 Sergey Akopkokhyants | ||
// This project is licensed under the terms of the MIT license. | ||
// https://github.com/akserg/ng2-dnd | ||
"use strict"; | ||
var __extends = (this && this.__extends) || function (d, b) { | ||
@@ -10,17 +9,8 @@ for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
}; | ||
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; | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
var core_1 = require('@angular/core'); | ||
var core_2 = require('@angular/core'); | ||
var abstract_component_1 = require('./abstract.component'); | ||
var dnd_config_1 = require('./dnd.config'); | ||
var dnd_service_1 = require('./dnd.service'); | ||
var DraggableComponent = (function (_super) { | ||
import { ChangeDetectorRef } from '@angular/core'; | ||
import { Directive, Input, Output, EventEmitter, ElementRef } from '@angular/core'; | ||
import { AbstractComponent } from './abstract.component'; | ||
import { DragDropConfig } from './dnd.config'; | ||
import { DragDropService } from './dnd.service'; | ||
export var DraggableComponent = (function (_super) { | ||
__extends(DraggableComponent, _super); | ||
@@ -32,4 +22,4 @@ function DraggableComponent(elemRef, dragDropService, config, cdr) { | ||
*/ | ||
this.onDragStart = new core_2.EventEmitter(); | ||
this.onDragEnd = new core_2.EventEmitter(); | ||
this.onDragStart = new EventEmitter(); | ||
this.onDragEnd = new EventEmitter(); | ||
/** | ||
@@ -39,3 +29,3 @@ * Callback function called when the drag action ends with a valid drop action. | ||
*/ | ||
this.onDragSuccessCallback = new core_2.EventEmitter(); | ||
this.onDragSuccessCallback = new EventEmitter(); | ||
this._defaultCursor = this._elem.style.cursor; | ||
@@ -94,53 +84,25 @@ this.dragEnabled = true; | ||
}; | ||
__decorate([ | ||
core_2.Input("dragEnabled"), | ||
__metadata('design:type', Boolean), | ||
__metadata('design:paramtypes', [Boolean]) | ||
], DraggableComponent.prototype, "draggable", null); | ||
__decorate([ | ||
core_2.Output(), | ||
__metadata('design:type', core_2.EventEmitter) | ||
], DraggableComponent.prototype, "onDragStart", void 0); | ||
__decorate([ | ||
core_2.Output(), | ||
__metadata('design:type', core_2.EventEmitter) | ||
], DraggableComponent.prototype, "onDragEnd", void 0); | ||
__decorate([ | ||
core_2.Input(), | ||
__metadata('design:type', Object) | ||
], DraggableComponent.prototype, "dragData", void 0); | ||
__decorate([ | ||
core_2.Output("onDragSuccess"), | ||
__metadata('design:type', core_2.EventEmitter) | ||
], DraggableComponent.prototype, "onDragSuccessCallback", void 0); | ||
__decorate([ | ||
core_2.Input("dropZones"), | ||
__metadata('design:type', Array), | ||
__metadata('design:paramtypes', [Array]) | ||
], DraggableComponent.prototype, "dropzones", null); | ||
__decorate([ | ||
core_2.Input("effectAllowed"), | ||
__metadata('design:type', String), | ||
__metadata('design:paramtypes', [String]) | ||
], DraggableComponent.prototype, "effectallowed", null); | ||
__decorate([ | ||
core_2.Input("effectCursor"), | ||
__metadata('design:type', String), | ||
__metadata('design:paramtypes', [String]) | ||
], DraggableComponent.prototype, "effectcursor", null); | ||
__decorate([ | ||
core_2.Input(), | ||
__metadata('design:type', Object) | ||
], DraggableComponent.prototype, "dragImage", void 0); | ||
__decorate([ | ||
core_2.Input(), | ||
__metadata('design:type', Boolean) | ||
], DraggableComponent.prototype, "cloneItem", void 0); | ||
DraggableComponent = __decorate([ | ||
core_2.Directive({ selector: '[dnd-draggable]' }), | ||
__metadata('design:paramtypes', [core_2.ElementRef, dnd_service_1.DragDropService, dnd_config_1.DragDropConfig, core_1.ChangeDetectorRef]) | ||
], DraggableComponent); | ||
DraggableComponent.decorators = [ | ||
{ type: Directive, args: [{ selector: '[dnd-draggable]' },] }, | ||
]; | ||
/** @nocollapse */ | ||
DraggableComponent.ctorParameters = function () { return [ | ||
{ type: ElementRef, }, | ||
{ type: DragDropService, }, | ||
{ type: DragDropConfig, }, | ||
{ type: ChangeDetectorRef, }, | ||
]; }; | ||
DraggableComponent.propDecorators = { | ||
'draggable': [{ type: Input, args: ["dragEnabled",] },], | ||
'onDragStart': [{ type: Output },], | ||
'onDragEnd': [{ type: Output },], | ||
'dragData': [{ type: Input },], | ||
'onDragSuccessCallback': [{ type: Output, args: ["onDragSuccess",] },], | ||
'dropzones': [{ type: Input, args: ["dropZones",] },], | ||
'effectallowed': [{ type: Input, args: ["effectAllowed",] },], | ||
'effectcursor': [{ type: Input, args: ["effectCursor",] },], | ||
'dragImage': [{ type: Input },], | ||
'cloneItem': [{ type: Input },], | ||
}; | ||
return DraggableComponent; | ||
}(abstract_component_1.AbstractComponent)); | ||
exports.DraggableComponent = DraggableComponent; | ||
//# sourceMappingURL=draggable.component.js.map | ||
}(AbstractComponent)); |
// Copyright (C) 2016 Sergey Akopkokhyants | ||
// This project is licensed under the terms of the MIT license. | ||
// https://github.com/akserg/ng2-dnd | ||
"use strict"; | ||
var __extends = (this && this.__extends) || function (d, b) { | ||
@@ -10,17 +9,8 @@ for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
}; | ||
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; | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
var core_1 = require('@angular/core'); | ||
var core_2 = require('@angular/core'); | ||
var abstract_component_1 = require('./abstract.component'); | ||
var dnd_config_1 = require('./dnd.config'); | ||
var dnd_service_1 = require('./dnd.service'); | ||
var DroppableComponent = (function (_super) { | ||
import { ChangeDetectorRef } from '@angular/core'; | ||
import { Directive, Input, Output, EventEmitter, ElementRef } from '@angular/core'; | ||
import { AbstractComponent } from './abstract.component'; | ||
import { DragDropConfig } from './dnd.config'; | ||
import { DragDropService } from './dnd.service'; | ||
export var DroppableComponent = (function (_super) { | ||
__extends(DroppableComponent, _super); | ||
@@ -33,6 +23,6 @@ function DroppableComponent(elemRef, dragDropService, config, cdr) { | ||
*/ | ||
this.onDropSuccess = new core_2.EventEmitter(); | ||
this.onDragEnter = new core_2.EventEmitter(); | ||
this.onDragOver = new core_2.EventEmitter(); | ||
this.onDragLeave = new core_2.EventEmitter(); | ||
this.onDropSuccess = new EventEmitter(); | ||
this.onDragEnter = new EventEmitter(); | ||
this.onDragOver = new EventEmitter(); | ||
this.onDragLeave = new EventEmitter(); | ||
this.dropEnabled = true; | ||
@@ -112,50 +102,24 @@ } | ||
}; | ||
__decorate([ | ||
core_2.Input("dropEnabled"), | ||
__metadata('design:type', Boolean), | ||
__metadata('design:paramtypes', [Boolean]) | ||
], DroppableComponent.prototype, "droppable", null); | ||
__decorate([ | ||
core_2.Output(), | ||
__metadata('design:type', core_2.EventEmitter) | ||
], DroppableComponent.prototype, "onDropSuccess", void 0); | ||
__decorate([ | ||
core_2.Output(), | ||
__metadata('design:type', core_2.EventEmitter) | ||
], DroppableComponent.prototype, "onDragEnter", void 0); | ||
__decorate([ | ||
core_2.Output(), | ||
__metadata('design:type', core_2.EventEmitter) | ||
], DroppableComponent.prototype, "onDragOver", void 0); | ||
__decorate([ | ||
core_2.Output(), | ||
__metadata('design:type', core_2.EventEmitter) | ||
], DroppableComponent.prototype, "onDragLeave", void 0); | ||
__decorate([ | ||
core_2.Input("allowDrop"), | ||
__metadata('design:type', Function), | ||
__metadata('design:paramtypes', [Function]) | ||
], DroppableComponent.prototype, "allowdrop", null); | ||
__decorate([ | ||
core_2.Input("dropZones"), | ||
__metadata('design:type', Array), | ||
__metadata('design:paramtypes', [Array]) | ||
], DroppableComponent.prototype, "dropzones", null); | ||
__decorate([ | ||
core_2.Input("effectAllowed"), | ||
__metadata('design:type', String), | ||
__metadata('design:paramtypes', [String]) | ||
], DroppableComponent.prototype, "effectallowed", null); | ||
__decorate([ | ||
core_2.Input("effectCursor"), | ||
__metadata('design:type', String), | ||
__metadata('design:paramtypes', [String]) | ||
], DroppableComponent.prototype, "effectcursor", null); | ||
DroppableComponent = __decorate([ | ||
core_2.Directive({ selector: '[dnd-droppable]' }), | ||
__metadata('design:paramtypes', [core_2.ElementRef, dnd_service_1.DragDropService, dnd_config_1.DragDropConfig, core_1.ChangeDetectorRef]) | ||
], DroppableComponent); | ||
DroppableComponent.decorators = [ | ||
{ type: Directive, args: [{ selector: '[dnd-droppable]' },] }, | ||
]; | ||
/** @nocollapse */ | ||
DroppableComponent.ctorParameters = function () { return [ | ||
{ type: ElementRef, }, | ||
{ type: DragDropService, }, | ||
{ type: DragDropConfig, }, | ||
{ type: ChangeDetectorRef, }, | ||
]; }; | ||
DroppableComponent.propDecorators = { | ||
'droppable': [{ type: Input, args: ["dropEnabled",] },], | ||
'onDropSuccess': [{ type: Output },], | ||
'onDragEnter': [{ type: Output },], | ||
'onDragOver': [{ type: Output },], | ||
'onDragLeave': [{ type: Output },], | ||
'allowdrop': [{ type: Input, args: ["allowDrop",] },], | ||
'dropzones': [{ type: Input, args: ["dropZones",] },], | ||
'effectallowed': [{ type: Input, args: ["effectAllowed",] },], | ||
'effectcursor': [{ type: Input, args: ["effectCursor",] },], | ||
}; | ||
return DroppableComponent; | ||
}(abstract_component_1.AbstractComponent)); | ||
exports.DroppableComponent = DroppableComponent; | ||
//# sourceMappingURL=droppable.component.js.map | ||
}(AbstractComponent)); |
// Copyright (C) 2016 Sergey Akopkokhyants | ||
// This project is licensed under the terms of the MIT license. | ||
// https://github.com/akserg/ng2-dnd | ||
"use strict"; | ||
var __extends = (this && this.__extends) || function (d, b) { | ||
@@ -10,17 +9,8 @@ for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
}; | ||
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; | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
var core_1 = require('@angular/core'); | ||
var core_2 = require('@angular/core'); | ||
var abstract_component_1 = require('./abstract.component'); | ||
var dnd_config_1 = require('./dnd.config'); | ||
var dnd_service_1 = require('./dnd.service'); | ||
var SortableContainer = (function (_super) { | ||
import { ChangeDetectorRef } from '@angular/core'; | ||
import { Directive, Input, Output, EventEmitter, ElementRef } from '@angular/core'; | ||
import { AbstractComponent } from './abstract.component'; | ||
import { DragDropConfig } from './dnd.config'; | ||
import { DragDropService, DragDropSortableService } from './dnd.service'; | ||
export var SortableContainer = (function (_super) { | ||
__extends(SortableContainer, _super); | ||
@@ -78,25 +68,21 @@ function SortableContainer(elemRef, dragDropService, config, cdr, _sortableDataService) { | ||
}; | ||
__decorate([ | ||
core_2.Input("dragEnabled"), | ||
__metadata('design:type', Boolean), | ||
__metadata('design:paramtypes', [Boolean]) | ||
], SortableContainer.prototype, "draggable", null); | ||
__decorate([ | ||
core_2.Input(), | ||
__metadata('design:type', Array), | ||
__metadata('design:paramtypes', [Array]) | ||
], SortableContainer.prototype, "sortableData", null); | ||
__decorate([ | ||
core_2.Input("dropZones"), | ||
__metadata('design:type', Array), | ||
__metadata('design:paramtypes', [Array]) | ||
], SortableContainer.prototype, "dropzones", null); | ||
SortableContainer = __decorate([ | ||
core_2.Directive({ selector: '[dnd-sortable-container]' }), | ||
__metadata('design:paramtypes', [core_2.ElementRef, dnd_service_1.DragDropService, dnd_config_1.DragDropConfig, core_1.ChangeDetectorRef, dnd_service_1.DragDropSortableService]) | ||
], SortableContainer); | ||
SortableContainer.decorators = [ | ||
{ type: Directive, args: [{ selector: '[dnd-sortable-container]' },] }, | ||
]; | ||
/** @nocollapse */ | ||
SortableContainer.ctorParameters = function () { return [ | ||
{ type: ElementRef, }, | ||
{ type: DragDropService, }, | ||
{ type: DragDropConfig, }, | ||
{ type: ChangeDetectorRef, }, | ||
{ type: DragDropSortableService, }, | ||
]; }; | ||
SortableContainer.propDecorators = { | ||
'draggable': [{ type: Input, args: ["dragEnabled",] },], | ||
'sortableData': [{ type: Input },], | ||
'dropzones': [{ type: Input, args: ["dropZones",] },], | ||
}; | ||
return SortableContainer; | ||
}(abstract_component_1.AbstractComponent)); | ||
exports.SortableContainer = SortableContainer; | ||
var SortableComponent = (function (_super) { | ||
}(AbstractComponent)); | ||
export var SortableComponent = (function (_super) { | ||
__extends(SortableComponent, _super); | ||
@@ -111,7 +97,7 @@ function SortableComponent(elemRef, dragDropService, config, _sortableContainer, _sortableDataService, cdr) { | ||
*/ | ||
this.onDragSuccessCallback = new core_2.EventEmitter(); | ||
this.onDragStartCallback = new core_2.EventEmitter(); | ||
this.onDragOverCallback = new core_2.EventEmitter(); | ||
this.onDragEndCallback = new core_2.EventEmitter(); | ||
this.onDropSuccessCallback = new core_2.EventEmitter(); | ||
this.onDragSuccessCallback = new EventEmitter(); | ||
this.onDragStartCallback = new EventEmitter(); | ||
this.onDragOverCallback = new EventEmitter(); | ||
this.onDragEndCallback = new EventEmitter(); | ||
this.onDropSuccessCallback = new EventEmitter(); | ||
this.dropZones = this._sortableContainer.dropZones; | ||
@@ -169,3 +155,3 @@ this.dragEnabled = true; | ||
SortableComponent.prototype._onDragOverCallback = function (event) { | ||
if (this._sortableDataService.isDragged && this._elem != this._sortableDataService.elem) { | ||
if (this._sortableDataService.isDragged && this._elem !== this._sortableDataService.elem) { | ||
// console.log('_onDragOverCallback. dragging elem with index ' + this.index); | ||
@@ -195,3 +181,3 @@ this._sortableDataService.sortableData = this._sortableContainer.sortableData; | ||
if ((this.index !== this._sortableDataService.index) || | ||
(this._sortableDataService.sortableData != this._sortableContainer.sortableData)) { | ||
(this._sortableDataService.sortableData !== this._sortableContainer.sortableData)) { | ||
// console.log('Component._onDragEnterCallback. drag node [' + this.index + '] over node [' + this._sortableDataService.index + ']'); | ||
@@ -221,57 +207,28 @@ // Get item | ||
}; | ||
__decorate([ | ||
core_2.Input('sortableIndex'), | ||
__metadata('design:type', Number) | ||
], SortableComponent.prototype, "index", void 0); | ||
__decorate([ | ||
core_2.Input("dragEnabled"), | ||
__metadata('design:type', Boolean), | ||
__metadata('design:paramtypes', [Boolean]) | ||
], SortableComponent.prototype, "draggable", null); | ||
__decorate([ | ||
core_2.Input("dropEnabled"), | ||
__metadata('design:type', Boolean), | ||
__metadata('design:paramtypes', [Boolean]) | ||
], SortableComponent.prototype, "droppable", null); | ||
__decorate([ | ||
core_2.Input(), | ||
__metadata('design:type', Object) | ||
], SortableComponent.prototype, "dragData", void 0); | ||
__decorate([ | ||
core_2.Input("effectAllowed"), | ||
__metadata('design:type', String), | ||
__metadata('design:paramtypes', [String]) | ||
], SortableComponent.prototype, "effectallowed", null); | ||
__decorate([ | ||
core_2.Input("effectCursor"), | ||
__metadata('design:type', String), | ||
__metadata('design:paramtypes', [String]) | ||
], SortableComponent.prototype, "effectcursor", null); | ||
__decorate([ | ||
core_2.Output("onDragSuccess"), | ||
__metadata('design:type', core_2.EventEmitter) | ||
], SortableComponent.prototype, "onDragSuccessCallback", void 0); | ||
__decorate([ | ||
core_2.Output("onDragStart"), | ||
__metadata('design:type', core_2.EventEmitter) | ||
], SortableComponent.prototype, "onDragStartCallback", void 0); | ||
__decorate([ | ||
core_2.Output("onDragOver"), | ||
__metadata('design:type', core_2.EventEmitter) | ||
], SortableComponent.prototype, "onDragOverCallback", void 0); | ||
__decorate([ | ||
core_2.Output("onDragEnd"), | ||
__metadata('design:type', core_2.EventEmitter) | ||
], SortableComponent.prototype, "onDragEndCallback", void 0); | ||
__decorate([ | ||
core_2.Output("onDropSuccess"), | ||
__metadata('design:type', core_2.EventEmitter) | ||
], SortableComponent.prototype, "onDropSuccessCallback", void 0); | ||
SortableComponent = __decorate([ | ||
core_2.Directive({ selector: '[dnd-sortable]' }), | ||
__metadata('design:paramtypes', [core_2.ElementRef, dnd_service_1.DragDropService, dnd_config_1.DragDropConfig, SortableContainer, dnd_service_1.DragDropSortableService, core_1.ChangeDetectorRef]) | ||
], SortableComponent); | ||
SortableComponent.decorators = [ | ||
{ type: Directive, args: [{ selector: '[dnd-sortable]' },] }, | ||
]; | ||
/** @nocollapse */ | ||
SortableComponent.ctorParameters = function () { return [ | ||
{ type: ElementRef, }, | ||
{ type: DragDropService, }, | ||
{ type: DragDropConfig, }, | ||
{ type: SortableContainer, }, | ||
{ type: DragDropSortableService, }, | ||
{ type: ChangeDetectorRef, }, | ||
]; }; | ||
SortableComponent.propDecorators = { | ||
'index': [{ type: Input, args: ['sortableIndex',] },], | ||
'draggable': [{ type: Input, args: ["dragEnabled",] },], | ||
'droppable': [{ type: Input, args: ["dropEnabled",] },], | ||
'dragData': [{ type: Input },], | ||
'effectallowed': [{ type: Input, args: ["effectAllowed",] },], | ||
'effectcursor': [{ type: Input, args: ["effectCursor",] },], | ||
'onDragSuccessCallback': [{ type: Output, args: ["onDragSuccess",] },], | ||
'onDragStartCallback': [{ type: Output, args: ["onDragStart",] },], | ||
'onDragOverCallback': [{ type: Output, args: ["onDragOver",] },], | ||
'onDragEndCallback': [{ type: Output, args: ["onDragEnd",] },], | ||
'onDropSuccessCallback': [{ type: Output, args: ["onDropSuccess",] },], | ||
}; | ||
return SortableComponent; | ||
}(abstract_component_1.AbstractComponent)); | ||
exports.SortableComponent = SortableComponent; | ||
//# sourceMappingURL=sortable.component.js.map | ||
}(AbstractComponent)); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
374859
1
42
37
2705
1
1
+ Added@angular/core@2.4.10(transitive)
+ Addedrxjs@5.5.12(transitive)
+ Addedsymbol-observable@1.0.1(transitive)
+ Addedzone.js@0.7.8(transitive)
- Removedcore-js@^2.4.1
- Removedreflect-metadata@^0.1.3
- Removedrxjs@5.0.0-beta.12
- Removedzone.js@^0.6.23
- Removedcore-js@2.6.12(transitive)
- Removedreflect-metadata@0.1.14(transitive)
- Removedrxjs@5.0.0-beta.12(transitive)
- Removedsymbol-observable@1.2.0(transitive)
- Removedzone.js@0.6.26(transitive)