From 5cd8ede95fcfd4a123931665cd6e04627c0a16c0 Mon Sep 17 00:00:00 2001 From: lucasferreiralimax Date: Sat, 5 Oct 2024 01:57:49 -0300 Subject: [PATCH] add hammerjs for test --- package-lock.json | 4 ++-- package.json | 3 ++- projects/slidecontent-angular/ng-package.json | 5 +++-- projects/slidecontent-angular/package.json | 5 +++-- .../src/lib/slide-content/slide-content.component.ts | 6 +++--- src/app/views/home/home.module.ts | 4 ++-- 6 files changed, 15 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index 108b222..ffcc534 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "slidecontent-angular", - "version": "1.4.0", + "version": "1.4.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "slidecontent-angular", - "version": "1.4.0", + "version": "1.4.1", "dependencies": { "@angular/animations": "^18.2.7", "@angular/common": "^18.2.7", diff --git a/package.json b/package.json index c994222..03ad3ab 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "slidecontent-angular", - "version": "1.4.0", + "version": "1.4.1", "scripts": { "ng": "ng", "start": "ng serve --configuration=pt", @@ -20,6 +20,7 @@ "@angular/platform-browser": "^18.2.7", "@angular/platform-browser-dynamic": "^18.2.7", "@angular/router": "^18.2.7", + "hammerjs": "^2.0.8", "rxjs": "~7.8.1", "slidecontent-angular": "^1.4.0", "tslib": "^2.7.0", diff --git a/projects/slidecontent-angular/ng-package.json b/projects/slidecontent-angular/ng-package.json index cec55f0..31a754a 100644 --- a/projects/slidecontent-angular/ng-package.json +++ b/projects/slidecontent-angular/ng-package.json @@ -3,5 +3,6 @@ "dest": "../../dist/slidecontent-angular", "lib": { "entryFile": "src/public-api.ts" - } -} \ No newline at end of file + }, + "allowedNonPeerDependencies": ["hammerjs"] +} diff --git a/projects/slidecontent-angular/package.json b/projects/slidecontent-angular/package.json index ffac702..439812c 100644 --- a/projects/slidecontent-angular/package.json +++ b/projects/slidecontent-angular/package.json @@ -1,13 +1,14 @@ { "name": "slidecontent-angular", - "version": "1.4.0", + "version": "1.4.1", "peerDependencies": { "@angular/common": "^18.2.0", "@angular/core": "^18.2.0", "hammerjs": "^2.0.8" }, "dependencies": { - "tslib": "^2.3.0" + "tslib": "^2.3.0", + "hammerjs": "^2.0.8" }, "sideEffects": false } diff --git a/projects/slidecontent-angular/src/lib/slide-content/slide-content.component.ts b/projects/slidecontent-angular/src/lib/slide-content/slide-content.component.ts index 94529af..074be74 100644 --- a/projects/slidecontent-angular/src/lib/slide-content/slide-content.component.ts +++ b/projects/slidecontent-angular/src/lib/slide-content/slide-content.component.ts @@ -84,13 +84,13 @@ export class SlideContentComponent implements OnInit, AfterViewInit, OnDestroy { this.hammer.on("panend", (event) => this.onPanEnd(event)); } - onPanStart(event: HammerInput) { + onPanStart(event: any) { this.isDragging = true; this.startPanX = event.center.x; // Inicia a posição X do pan this.content.nativeElement.style.cursor = "grabbing"; } - onPanMove(event: HammerInput) { + onPanMove(event: any) { if (!this.isDragging) { return; } @@ -113,7 +113,7 @@ export class SlideContentComponent implements OnInit, AfterViewInit, OnDestroy { } } - onPanEnd(event: HammerInput) { + onPanEnd(event: any) { this.content.nativeElement.style.cursor = "grab"; setTimeout(() => { this.isDragging = false; diff --git a/src/app/views/home/home.module.ts b/src/app/views/home/home.module.ts index 177d464..6765013 100644 --- a/src/app/views/home/home.module.ts +++ b/src/app/views/home/home.module.ts @@ -4,8 +4,8 @@ import { CommonModule } from '@angular/common'; import { HomeComponent } from './home.component'; import { HomeRoutingModule } from './home-routing.module'; -// import { SlideModule } from '../../../../projects/slidecontent-angular/src/public-api'; -import { SlideModule } from 'slidecontent-angular'; +import { SlideModule } from '../../../../projects/slidecontent-angular/src/public-api'; +// import { SlideModule } from 'slidecontent-angular'; @NgModule({ declarations: [