idle-detector
Version:
[Description:] This library is created to detect the Inactivity of the User. You can specify the Inactivity [timeout] in [milliseconds].
1 lines • 5.18 kB
Source Map (JSON)
{"version":3,"file":"idle-detector.mjs","sources":["../../../projects/idle-detector/src/lib/idle-detector.service.ts","../../../projects/idle-detector/src/lib/idle-detector.component.ts","../../../projects/idle-detector/src/lib/idle-detector.directive.ts","../../../projects/idle-detector/src/lib/idle-detector.module.ts","../../../projects/idle-detector/src/public-api.ts","../../../projects/idle-detector/src/idle-detector.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class IdleDetectorService {\n\n constructor() { }\n}\n","import { Component, OnInit } from '@angular/core';\n\n@Component({\n selector: 'lib-idle-detector',\n template: `\n <p>\n idle-detector works!\n </p>\n `,\n styles: [\n ]\n})\nexport class IdleDetectorComponent implements OnInit {\n\n constructor() { }\n\n ngOnInit(): void {\n }\n\n timeoutDetected(event:any){\n alert(\"timedout\")\n }\n}\n","import { Directive,EventEmitter,Output,Input,OnInit } from '@angular/core';\n\n@Directive({\n selector: '[libIdleDetector]'\n})\nexport class IdleDetectorDirective implements OnInit {\n @Input() timeout:any;\n @Output() timedOut:any = new EventEmitter();\n timer:any;\n ngOnInit(){\n this.inactivityTime();\n }\n inactivityTime(){\n window.onload = this.resetTimer;\n document.onmousemove = this.resetTimer.bind(this);\n document.onkeypress = this.resetTimer.bind(this);\n }\n \n resetTimer() {\n clearTimeout(this.timer);\n this.timer = setTimeout(()=>{\n this.timedOut.emit('true')\n }, this.timeout)\n }\n constructor() { }\n\n}\n","import { NgModule } from '@angular/core';\nimport { IdleDetectorComponent } from './idle-detector.component';\nimport { IdleDetectorDirective } from './idle-detector.directive';\n\n\n\n@NgModule({\n declarations: [\n IdleDetectorComponent,\n IdleDetectorDirective\n ],\n imports: [\n ],\n exports: [\n IdleDetectorComponent,\n IdleDetectorDirective\n ]\n})\nexport class IdleDetectorModule { }\n","/*\n * Public API Surface of idle-detector\n */\n\nexport * from './lib/idle-detector.service';\nexport * from './lib/idle-detector.component';\nexport * from './lib/idle-detector.directive';\nexport * from './lib/idle-detector.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAKa,mBAAmB,CAAA;AAE9B,IAAA,WAAA,GAAA,GAAiB;;iHAFN,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAnB,mBAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,cAFlB,MAAM,EAAA,CAAA,CAAA;4FAEP,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAH/B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;iBACnB,CAAA;;;MCQY,qBAAqB,CAAA;AAEhC,IAAA,WAAA,GAAA,GAAiB;IAEjB,QAAQ,GAAA;KACP;AAED,IAAA,eAAe,CAAC,KAAS,EAAA;QACvB,KAAK,CAAC,UAAU,CAAC,CAAA;KAClB;;mHATU,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAArB,qBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,qBAAqB,EARtB,QAAA,EAAA,mBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA;;;;AAIT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,CAAA;4FAIU,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAVjC,SAAS;AAAC,YAAA,IAAA,EAA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