Skip to content

Commit

Permalink
add hammerjs for test
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasferreiralimax committed Oct 5, 2024
1 parent 1652752 commit 5cd8ede
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 12 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "slidecontent-angular",
"version": "1.4.0",
"version": "1.4.1",
"scripts": {
"ng": "ng",
"start": "ng serve --configuration=pt",
Expand All @@ -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",
Expand Down
5 changes: 3 additions & 2 deletions projects/slidecontent-angular/ng-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"dest": "../../dist/slidecontent-angular",
"lib": {
"entryFile": "src/public-api.ts"
}
}
},
"allowedNonPeerDependencies": ["hammerjs"]
}
5 changes: 3 additions & 2 deletions projects/slidecontent-angular/package.json
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/app/views/home/home.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down

0 comments on commit 5cd8ede

Please sign in to comment.