{"version":3,"file":"bootkit-angular-components-dropdown.mjs","sources":["../../../projects/bootkit/components/dropdown/types.ts","../../../projects/bootkit/components/dropdown/dropdown-item.directive.ts","../../../projects/bootkit/components/dropdown/dropdown-menu.directive.ts","../../../projects/bootkit/components/dropdown/dropdown.module.ts","../../../projects/bootkit/components/dropdown/public-api.ts","../../../projects/bootkit/components/dropdown/bootkit-angular-components-dropdown.ts"],"sourcesContent":["export type DropdownAutoCloseBehavior = 'default' | 'inside' | 'outside' | 'manual';\r\nexport type DropdownSize = 'default' | 'small' | 'large';\r\n// export type DropdownToggleTriggerMode = 'click' | 'hover' | 'focus';\r\n","import { Directive, Optional, TemplateRef } from '@angular/core';\r\n\r\n/**\r\n * Directive to be used as a dropdown item.\r\n * \r\n * @export\r\n * @class DropdownItemDirective\r\n */\r\n@Directive({\r\n    selector: '[bkDropdownItem]',\r\n    exportAs: 'bkDropdownItem',\r\n    standalone: true,\r\n})\r\nexport class DropdownItemDirective {\r\n    /**\r\n     * Creates an instance of DropdownItemDirective.\r\n     * \r\n     * @param {TemplateRef<any>} [templateRef] - Optional template reference.\r\n     * @memberof DropdownItemDirective\r\n     */\r\n    constructor(@Optional() public readonly templateRef?: TemplateRef<any>) {}\r\n}\r\n","import { Directive, ElementRef, HostListener, input, OnDestroy, Renderer2 } from '@angular/core';\r\nimport { DropdownAutoCloseBehavior } from './types';\r\nimport { Subscription } from 'rxjs';\r\nimport { OverlayDirective } from '@bootkit/angular/components/overlay';\r\n// import { OverlayDirective } from '../overlay';\r\n\r\n/**\r\n * Directive to manage dropdown menu behavior.\r\n */\r\n@Directive({\r\n    selector: '[bkDropdownMenu]',\r\n    exportAs: 'bkDropdownMenu',\r\n    standalone: true,\r\n})\r\nexport class DropdownMenuDirective implements OnDestroy {\r\n    /** auto close behavior */\r\n    public autoClose = input<DropdownAutoCloseBehavior>('default');\r\n\r\n    /** Toggles element */\r\n    public toggle = input<any>(undefined);\r\n\r\n    private _pointerEventsSubscription?: Subscription;\r\n\r\n    constructor(\r\n        private _el: ElementRef,\r\n        private _renderer: Renderer2,\r\n        private _overlayDirective: OverlayDirective\r\n    ) {\r\n        ['dropdown-menu', 'show'].forEach(x => this._renderer.addClass(this._el.nativeElement, x));\r\n        _renderer.setStyle(this._el.nativeElement, 'position', 'static');\r\n\r\n        this._pointerEventsSubscription = _overlayDirective.outsidePointerEvent.subscribe(e => {\r\n            if (this.toggle() == undefined || !this.toggle().contains(e.target)) {\r\n                if (this.autoClose() == 'default' || this.autoClose() == 'outside') {\r\n                    this._overlayDirective.hide();\r\n                }\r\n            }\r\n        });\r\n    }\r\n\r\n    @HostListener('click')\r\n    private _onClick() {\r\n        if (this.autoClose() == 'default' || this.autoClose() == 'inside') {\r\n            this._overlayDirective.hide();\r\n        }\r\n    }\r\n\r\n    ngOnDestroy(): void {\r\n        this._pointerEventsSubscription?.unsubscribe();\r\n    }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { DropdownItemDirective } from './dropdown-item.directive';\r\nimport { DropdownMenuDirective } from './dropdown-menu.directive';\r\n// import { DropdownToggleDirective } from './dropdown-toggle.directive';\r\n// import { DropdownComponent } from './dropdown-button.component';\r\n// import { OverlayModule } from '../overlay';\r\nimport { OverlayModule } from '@bootkit/angular/components/overlay';\r\n\r\n\r\nconst Items = [\r\n    DropdownItemDirective,\r\n    DropdownMenuDirective,\r\n\r\n    // DropdownComponent,\r\n    // DropdownToggleDirective,\r\n]\r\n\r\n@NgModule({\r\n    imports: Items,\r\n    exports: [\r\n        ...Items,\r\n        OverlayModule\r\n    ]\r\n})\r\nexport class DropdownModule { }\r\n","export  *  from './types';\r\nexport * from './dropdown-item.directive';\r\nexport * from './dropdown-menu.directive';\r\nexport * from './dropdown.module';\r\n\r\n// export * from './dropdown-button.component';\r\n// export * from './dropdown-toggle.directive';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAEA;;ACAA;;;;;AAKG;MAMU,qBAAqB,CAAA;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