{"_id":"@edwin2delossantos/ng-longpress","_rev":"7-9c189497d9cca9a91aa47861bb5f317a","name":"@edwin2delossantos/ng-longpress","dist-tags":{"latest":"0.0.7"},"versions":{"0.0.1":{"name":"@edwin2delossantos/ng-longpress","version":"0.0.1","_id":"@edwin2delossantos/ng-longpress@0.0.1","maintainers":[{"name":"edwin2delossantos","email":"edwin2delossantos@gmail.com"}],"dist":{"shasum":"f95c64c1448bb80ad5ce9f9ab5eadd21526d9dae","tarball":"https://registry.npmjs.org/@edwin2delossantos/ng-longpress/-/ng-longpress-0.0.1.tgz","fileCount":8,"integrity":"sha512-mX63k8qbBg0nA60+eAiXJSweqv/mJF+s94UJFoM3a3LNenZZgnUICdVnyOfFrDe65cyxZIKcUYK1WI0rZddwFA==","signatures":[{"sig":"MEUCIFfEqJ2jNB35k8LtWgWM6k1IxSeBn64hHvpXcAxtvm6/AiEAuJZT0aUslKyMf+aF33GD+3q5yECIpGFzeM2VcYuwtes=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10590},"module":"fesm2022/ng-longpress.mjs","exports":{".":{"types":"./index.d.ts","default":"./fesm2022/ng-longpress.mjs"},"./package.json":{"default":"./package.json"}},"gitHead":"915765e9a394c03e2ea3f80255f9fd7eed35d103","typings":"index.d.ts","_npmUser":{"name":"edwin2delossantos","email":"edwin2delossantos@gmail.com"},"_npmVersion":"10.2.4","description":"```markdown # ng-longpress","directories":{},"sideEffects":false,"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0"},"_hasShrinkwrap":false,"peerDependencies":{"@angular/core":"^19.2.0","@angular/common":"^19.2.0"},"_npmOperationalInternal":{"tmp":"tmp/ng-longpress_0.0.1_1742953401691_0.6805730441869529","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@edwin2delossantos/ng-longpress","version":"0.0.2","keywords":["angular","directive","longpress","mouse event","touch event","press and hold","ng-longpress"],"_id":"@edwin2delossantos/ng-longpress@0.0.2","maintainers":[{"name":"edwin2delossantos","email":"edwin2delossantos@gmail.com"}],"dist":{"shasum":"ae9e6cc59dd8a3155edeae9905b4ebac02f1815b","tarball":"https://registry.npmjs.org/@edwin2delossantos/ng-longpress/-/ng-longpress-0.0.2.tgz","fileCount":9,"integrity":"sha512-uZmj9R7Aq+Oas8lI0zzv9Wn4ngSxmRu3rmuvwI9hD82vnOnPSWb2CsK0pye1GzvHQkSpbb7SngKO27+9IsgThQ==","signatures":[{"sig":"MEQCIGhsaVygsKLZS63XonQ2L8n6FJwkjBq5BySn15zDNuxsAiAMnFz2ElerL0jniKGb3vCRmSGtrpxHO4vfMTT0tjbyPA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11998},"module":"fesm2022/edwin2delossantos-ng-longpress.mjs","exports":{".":{"types":"./index.d.ts","default":"./fesm2022/edwin2delossantos-ng-longpress.mjs"},"./package.json":{"default":"./package.json"}},"gitHead":"c79f7b64ca2def0a34d7b1b3b3f65ab2fe63acdc","typings":"index.d.ts","_npmUser":{"name":"edwin2delossantos","email":"edwin2delossantos@gmail.com"},"_npmVersion":"10.2.4","description":"An Angular directive for detecting long press events.","directories":{},"sideEffects":false,"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0"},"_hasShrinkwrap":false,"peerDependencies":{"@angular/core":"^19.2.0","@angular/common":"^19.2.0"},"_npmOperationalInternal":{"tmp":"tmp/ng-longpress_0.0.2_1742953795588_0.8818219366043529","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@edwin2delossantos/ng-longpress","version":"0.0.3","keywords":["angular","directive","longpress","mouse event","touch event","press and hold","ng-longpress"],"_id":"@edwin2delossantos/ng-longpress@0.0.3","maintainers":[{"name":"edwin2delossantos","email":"edwin2delossantos@gmail.com"}],"dist":{"shasum":"4be9c93dae9ffbcd80ecf36ae7d24195bd0653ab","tarball":"https://registry.npmjs.org/@edwin2delossantos/ng-longpress/-/ng-longpress-0.0.3.tgz","fileCount":9,"integrity":"sha512-9PQK3r2btwAtIc5KXdnQnzXLJ7RguKNh/zkNHh1yrwrEjv1ObDag7FYDROPkVVnoy4nwOfpCqcDCnHoMk1Z76Q==","signatures":[{"sig":"MEYCIQCMXpg0PQdJ0wk27zaBAbdBwL2l8L6z+epxna4S6wEc3wIhAJszjOOqvbxhjHNq6BCix6kq9rVjhN5v++PN35IlBNaY","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11983},"module":"fesm2022/edwin2delossantos-ng-longpress.mjs","exports":{".":{"types":"./index.d.ts","default":"./fesm2022/edwin2delossantos-ng-longpress.mjs"},"./package.json":{"default":"./package.json"}},"gitHead":"c79f7b64ca2def0a34d7b1b3b3f65ab2fe63acdc","typings":"index.d.ts","_npmUser":{"name":"edwin2delossantos","email":"edwin2delossantos@gmail.com"},"_npmVersion":"10.2.4","description":"An Angular directive for detecting long press events.","directories":{},"sideEffects":false,"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0"},"_hasShrinkwrap":false,"peerDependencies":{"@angular/core":"^19.2.0","@angular/common":"^19.2.0"},"_npmOperationalInternal":{"tmp":"tmp/ng-longpress_0.0.3_1742953957459_0.03549487821384978","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"@edwin2delossantos/ng-longpress","version":"0.0.4","keywords":["angular","directive","longpress","mouse event","touch event","press and hold","ng-longpress"],"author":{"name":"Edwin Delos Santos"},"license":"MIT","_id":"@edwin2delossantos/ng-longpress@0.0.4","maintainers":[{"name":"edwin2delossantos","email":"edwin2delossantos@gmail.com"}],"dist":{"shasum":"4838a8498131bc7e69cfd4897680277d331fe882","tarball":"https://registry.npmjs.org/@edwin2delossantos/ng-longpress/-/ng-longpress-0.0.4.tgz","fileCount":9,"integrity":"sha512-VsTLdfRJ+E8dcTC9pFCgN25sW7pqdqojc6Wcaamy6uZHrXm09niWlKABvio8VlmzlTlY6o5C/mfGSoQSacCL5Q==","signatures":[{"sig":"MEUCIQDiYnRze+PauC/FMxgu8zyLaqmPi9CHKDZPQt4EQBNzuAIgd1Wwbgj96V4fBkH8S8tfEwZQLkikK6I26mpy9JSZVnE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12037},"module":"fesm2022/edwin2delossantos-ng-longpress.mjs","exports":{".":{"types":"./index.d.ts","default":"./fesm2022/edwin2delossantos-ng-longpress.mjs"},"./package.json":{"default":"./package.json"}},"gitHead":"c79f7b64ca2def0a34d7b1b3b3f65ab2fe63acdc","typings":"index.d.ts","_npmUser":{"name":"edwin2delossantos","email":"edwin2delossantos@gmail.com"},"_npmVersion":"10.2.4","description":"An Angular directive for detecting long press events.","directories":{},"sideEffects":false,"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0"},"_hasShrinkwrap":false,"peerDependencies":{"@angular/core":"^19.2.0","@angular/common":"^19.2.0"},"_npmOperationalInternal":{"tmp":"tmp/ng-longpress_0.0.4_1742954044553_0.12460394285730603","host":"s3://npm-registry-packages-npm-production"}},"0.0.5":{"name":"@edwin2delossantos/ng-longpress","version":"0.0.5","keywords":["angular","directive","longpress","mouse event","touch event","press and hold","ng-longpress"],"author":{"name":"Edwin Delos Santos"},"license":"MIT","_id":"@edwin2delossantos/ng-longpress@0.0.5","maintainers":[{"name":"edwin2delossantos","email":"edwin2delossantos@gmail.com"}],"homepage":"https://github.com/fow903/ng-longpress#readme","bugs":{"url":"https://github.com/fow903/ng-longpress/issues"},"dist":{"shasum":"e10d3248bfd27819eac4c27b2c1f17fe94fd4499","tarball":"https://registry.npmjs.org/@edwin2delossantos/ng-longpress/-/ng-longpress-0.0.5.tgz","fileCount":9,"integrity":"sha512-0JVgmXQaQMgnuTFvncgdJqvfE5ubeKKt1V/0EraJex6J9V4zdHWneaSCZGLbhfgz5vqk8LwtGdEnc2Z7qPAv3A==","signatures":[{"sig":"MEUCIC45V4eeE9qxM2tFJ2KJ3VleXfIAt8dWGzmzD+8DKhbzAiEAoYUvONB/w5lJy5miQIAAWYsEtgMI36waUMMe4b8McVk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12135},"module":"fesm2022/edwin2delossantos-ng-longpress.mjs","exports":{".":{"types":"./index.d.ts","default":"./fesm2022/edwin2delossantos-ng-longpress.mjs"},"./package.json":{"default":"./package.json"}},"gitHead":"c79f7b64ca2def0a34d7b1b3b3f65ab2fe63acdc","typings":"index.d.ts","_npmUser":{"name":"edwin2delossantos","email":"edwin2delossantos@gmail.com"},"repository":{"url":"git+https://github.com/fow903/ng-longpress.git","type":"git"},"_npmVersion":"10.2.4","description":"An Angular directive for detecting long press events.","directories":{},"sideEffects":false,"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0"},"_hasShrinkwrap":false,"peerDependencies":{"@angular/core":"^19.2.0","@angular/common":"^19.2.0"},"_npmOperationalInternal":{"tmp":"tmp/ng-longpress_0.0.5_1743091098574_0.23521143657780086","host":"s3://npm-registry-packages-npm-production"}},"0.0.6":{"name":"@edwin2delossantos/ng-longpress","version":"0.0.6","keywords":["angular","directive","longpress","mouse event","touch event","press and hold","ng-longpress"],"author":{"name":"Edwin Delos Santos"},"license":"MIT","_id":"@edwin2delossantos/ng-longpress@0.0.6","maintainers":[{"name":"edwin2delossantos","email":"edwin2delossantos@gmail.com"}],"homepage":"https://github.com/fow903/ng-longpress#readme","bugs":{"url":"https://github.com/fow903/ng-longpress/issues"},"dist":{"shasum":"c94bd8eb9ae5f94150556a1ee21fe30c0947e988","tarball":"https://registry.npmjs.org/@edwin2delossantos/ng-longpress/-/ng-longpress-0.0.6.tgz","fileCount":9,"integrity":"sha512-v43LsCziaFXZGQrwhkcLNcO1h8hZMMKCySsIrWOR4aOZgz+NDOQ5CPKZmV4uZW5gab1D5+iIr7ozlg6O8y2vPw==","signatures":[{"sig":"MEUCIQC1qowkdBmHzIonKHgn+UAztJkM9K4EK7gsbkURlDIfUAIgVOBjPMe56CvUHOb4y657aCnp++JYficp4T9pCBBe/3s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12271},"module":"fesm2022/edwin2delossantos-ng-longpress.mjs","exports":{".":{"types":"./index.d.ts","default":"./fesm2022/edwin2delossantos-ng-longpress.mjs"},"./package.json":{"default":"./package.json"}},"gitHead":"d11736d81eb24b6dd113ae2d048b3250c6f3274f","typings":"index.d.ts","_npmUser":{"name":"edwin2delossantos","email":"edwin2delossantos@gmail.com"},"repository":{"url":"git+https://github.com/fow903/ng-longpress.git","type":"git"},"_npmVersion":"10.2.4","description":"An Angular directive for detecting long press events.","directories":{},"sideEffects":false,"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0"},"_hasShrinkwrap":false,"peerDependencies":{"@angular/core":"^19.2.0","@angular/common":"^19.2.0"},"_npmOperationalInternal":{"tmp":"tmp/ng-longpress_0.0.6_1743092452180_0.669823199859936","host":"s3://npm-registry-packages-npm-production"}},"0.0.7":{"name":"@edwin2delossantos/ng-longpress","version":"0.0.7","description":"An Angular directive for detecting long press events.","license":"MIT","author":{"name":"Edwin Delos Santos"},"keywords":["angular","directive","longpress","mouse event","touch event","press and hold","ng-longpress"],"repository":{"type":"git","url":"git+https://github.com/fow903/ng-longpress.git"},"peerDependencies":{"@angular/common":"^19.2.0","@angular/core":"^19.2.0"},"dependencies":{"tslib":"^2.3.0"},"sideEffects":false,"module":"fesm2022/edwin2delossantos-ng-longpress.mjs","typings":"index.d.ts","exports":{"./package.json":{"default":"./package.json"},".":{"types":"./index.d.ts","default":"./fesm2022/edwin2delossantos-ng-longpress.mjs"}},"_id":"@edwin2delossantos/ng-longpress@0.0.7","gitHead":"d11736d81eb24b6dd113ae2d048b3250c6f3274f","bugs":{"url":"https://github.com/fow903/ng-longpress/issues"},"homepage":"https://github.com/fow903/ng-longpress#readme","_nodeVersion":"18.19.1","_npmVersion":"10.2.4","dist":{"integrity":"sha512-m7ABxoZlKkhu2vb6tspyHLjk7WS7qrmQ6pSAQNNNaK9fU0zUYRKbh7a8sfA7Hr7R9bXTUAvdmt8ofp7Pps0MWw==","shasum":"3f64fb1aabd3ec748f33aad201e2818e5b8d0f51","tarball":"https://registry.npmjs.org/@edwin2delossantos/ng-longpress/-/ng-longpress-0.0.7.tgz","fileCount":9,"unpackedSize":12271,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIAVL3Kri6eqDrSp1rjbCMEd/ywEr42FnUqHIFi9v24/GAiEAmeGL2zJyZlBSW7MItVUY7hkZgYX6MrxXdBiDlrraJco="}]},"_npmUser":{"name":"edwin2delossantos","email":"edwin2delossantos@gmail.com"},"directories":{},"maintainers":[{"name":"edwin2delossantos","email":"edwin2delossantos@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ng-longpress_0.0.7_1743093131354_0.5234406680771391"},"_hasShrinkwrap":false}},"time":{"created":"2025-03-26T01:43:21.628Z","modified":"2025-03-27T16:32:11.724Z","0.0.1":"2025-03-26T01:43:21.863Z","0.0.2":"2025-03-26T01:49:55.769Z","0.0.3":"2025-03-26T01:52:37.651Z","0.0.4":"2025-03-26T01:54:04.754Z","0.0.5":"2025-03-27T15:58:18.874Z","0.0.6":"2025-03-27T16:20:52.374Z","0.0.7":"2025-03-27T16:32:11.547Z"},"bugs":{"url":"https://github.com/fow903/ng-longpress/issues"},"author":{"name":"Edwin Delos Santos"},"license":"MIT","homepage":"https://github.com/fow903/ng-longpress#readme","keywords":["angular","directive","longpress","mouse event","touch event","press and hold","ng-longpress"],"repository":{"type":"git","url":"git+https://github.com/fow903/ng-longpress.git"},"description":"An Angular directive for detecting long press events.","maintainers":[{"name":"edwin2delossantos","email":"edwin2delossantos@gmail.com"}],"readme":"# ng-longpress\n\n**ng-longpress** is an Angular directive that detects long press events on elements. When a user presses and holds the mouse button, the directive emits a typed `MouseEvent` repeatedly until the press is released. This package is perfect for adding custom long press behavior to your Angular applications.\n\n## Features\n\n- Detects long press events on any element.\n- Repeatedly emits events while the mouse button is held down.\n- Provides a typed `MouseEvent` for strong type-checking in TypeScript.\n- Compatible with Angular 14+ (supports standalone directives if needed).\n\n## Installation\n\nInstall the package via npm:\n\n```bash\nnpm i @edwin2delossantos/ng-longpress\n```\n\n## Usage\n\n### Importing the Module\n\nTo use the directive, import the `NgLongpressModule` into the Angular module where you want the directive to be available. For example, in your AppModule or any feature module:\n\n```typescript\nimport { NgModule } from '@angular/core';\nimport { BrowserModule } from '@angular/platform-browser';\nimport { NgLongpressModule } from '@edwin2delossantos/ng-longpress';\n\n@NgModule({\n  declarations: [\n    // your components here\n  ],\n  imports: [\n    BrowserModule,\n    NgLongpressModule  // Import the module to use the long press directive\n  ],\n  bootstrap: [/* your root component */]\n})\nexport class AppModule { }\n```\n\n### Using the Directive in a Template\n\nOnce the module is imported, you can use the directive in your component templates. Add the `appLongPress` attribute to any element and bind to its `longPress` event:\n\n```html\n<div appLongPress (longPress)=\"onLongPress($event)\">\n  Press and hold this element\n</div>\n```\n\n### Handling the Long Press Event\n\nDefine an event handler in your component to respond to the long press event:\n\n```typescript\nimport { Component } from '@angular/core';\n\n@Component({\n  selector: 'app-example',\n  templateUrl: './example.component.html'\n})\nexport class ExampleComponent {\n  onLongPress(event: MouseEvent): void {\n    console.log('Long press event detected!', event);\n    // Add your long press logic here\n  }\n}\n```\n\n## How It Works\n\n- **Long Press Threshold:** The directive waits for 500 milliseconds after a `mousedown` event before emitting the first long press event.\n- **Repeat Rate:** Once the threshold is met, the directive emits the event repeatedly every 100 milliseconds until the user releases the mouse button or moves the cursor away.\n- **Event Handling:** The directive emits a typed `MouseEvent` for strong TypeScript integration.\n\n## Standalone vs Module Declaration\n\nIf you are using Angular 14+ and prefer to keep the directive standalone, you can mark it as `standalone: true` in its decorator and then import it directly. For module-based usage (recommended for libraries), ensure that the directive is not marked as standalone or, if it is, re-export it via a module as shown above.\n\n## License\n\nThis project is licensed under the MIT License.\n","readmeFilename":"README.md"}