{"version":3,"file":"primeng-focustrap.mjs","sources":["../../src/app/components/focustrap/focustrap.ts","../../src/app/components/focustrap/primeng-focustrap.ts"],"sourcesContent":["import { DomHandler } from 'primeng/dom';\n\nimport { CommonModule } from '@angular/common';\nimport { AfterViewInit, Directive, ElementRef, HostListener, Input, NgModule } from '@angular/core';\nimport { LicenseManager } from 'primeng/api';\n\n@Directive({\n selector: '[pFocusTrap]',\n host: {\n class: 'p-element'\n }\n})\nexport class FocusTrap implements AfterViewInit {\n @Input() pFocusTrapDisabled: boolean;\n\n constructor(public el: ElementRef) {}\n\n @HostListener('keydown.tab', ['$event'])\n @HostListener('keydown.shift.tab', ['$event'])\n onkeydown(e) {\n if (this.pFocusTrapDisabled !== true) {\n e.preventDefault();\n const focusableElement = DomHandler.getNextFocusableElement(this.el.nativeElement, e.shiftKey);\n\n if (focusableElement) {\n focusableElement.focus();\n focusableElement.select?.();\n }\n }\n }\n\n ngAfterViewInit() {\n LicenseManager.check();\n }\n}\n\n@NgModule({\n imports: [CommonModule],\n exports: [FocusTrap],\n declarations: [FocusTrap]\n})\nexport class FocusTrapModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;MAYa,SAAS,CAAA;AAGlB,IAAA,WAAA,CAAmB,EAAc,EAAA;AAAd,QAAA,IAAE,CAAA,EAAA,GAAF,EAAE,CAAY;KAAI;AAIrC,IAAA,SAAS,CAAC,CAAC,EAAA;;AACP,QAAA,IAAI,IAAI,CAAC,kBAAkB,KAAK,IAAI,EAAE;YAClC,CAAC,CAAC,cAAc,EAAE,CAAC;AACnB,YAAA,MAAM,gBAAgB,GAAG,UAAU,CAAC,uBAAuB,CAAC,IAAI,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC;AAE/F,YAAA,IAAI,gBAAgB,EAAE;gBAClB,gBAAgB,CAAC,KAAK,EAAE,CAAC;AACzB,gBAAA,CAAA,EAAA,GAAA,gB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