From e46f7e6c1c339f05e826777d7dad177f82af81b1 Mon Sep 17 00:00:00 2001 From: Mashhood Rastgar Date: Wed, 29 Mar 2017 10:19:49 +0500 Subject: [PATCH] upgraded to angular4, removed ThrowDirections ThrowDirections and Directions were not configured properly so just have Directions as exported by the swing library --- package.json | 10 ++++++---- src/index.ts | 1 - src/swing-stack-component.ts | 2 +- src/swing.ts | 11 ++--------- 4 files changed, 9 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 5606b8b..08e8710 100644 --- a/package.json +++ b/package.json @@ -23,12 +23,14 @@ "swing": "^4.2.0" }, "devDependencies": { - "@angular/common": "^2.0.2", - "@angular/core": "^2.0.2", - "angular-cli": "^1.0.0-beta.17", + "@angular/common": "^4.0.0", + "@angular/compiler": "^4.0.0", + "@angular/core": "^4.0.0", + "@angular/cli": "1.0.0", + "@angular/compiler-cli": "^4.0.0", "core-js": "^2.4.1", "reflect-metadata": "^0.1.3", "rxjs": "5.0.0-beta.12", - "zone.js": "^0.6.23" + "zone.js": "^0.8.4" } } diff --git a/src/index.ts b/src/index.ts index 1311e12..b24095a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,6 @@ export { SwingStackComponent } from './swing-stack-component'; export { SwingCardComponent } from './swing-card-component'; export { - ThrowDirection, ThrowEvent, DragEvent, ThrowEventName, diff --git a/src/swing-stack-component.ts b/src/swing-stack-component.ts index cb05f00..e8c51bc 100644 --- a/src/swing-stack-component.ts +++ b/src/swing-stack-component.ts @@ -3,7 +3,7 @@ declare var require: any; import {Component, Input, ContentChildren, QueryList, AfterContentInit, EventEmitter } from '@angular/core'; -import { ThrowDirection, ThrowEvent, DragEvent, Stack, Card, StackConfig} from './swing'; +import { Direction, ThrowEvent, DragEvent, Stack, Card, StackConfig } from './swing'; import {SwingCardComponent} from './swing-card-component'; const Swing = require('swing'); diff --git a/src/swing.ts b/src/swing.ts index d94b65c..7aac7e2 100644 --- a/src/swing.ts +++ b/src/swing.ts @@ -4,13 +4,6 @@ declare var require: any; const Swing = require('swing'); -export enum ThrowDirection { - LEFT = -1, - RIGHT = 1, - UP = 2, - DOWN = 3 -} - export interface ThrowEvent { /** * The element being dragged. @@ -21,7 +14,7 @@ export interface ThrowEvent { * The direction in which the element is being dragged: Card.DIRECTION_LEFT * or Card.DIRECTION_RIGHT */ - throwDirection: ThrowDirection; + throwDirection: Direction; } export interface DragEvent { @@ -37,7 +30,7 @@ export interface DragEvent { /** * Only available when the event is dragmove */ - throwDirection?: ThrowDirection; + throwDirection?: Direction; /** * Only available when the event is dragmove */