UNPKG

ngx-bootstrap

Version:
627 lines (616 loc) 31.2 kB
import * as i0 from '@angular/core'; import { Injectable, EventEmitter, ChangeDetectionStrategy, Component, input, output, effect, HostListener, Directive, HostBinding, NgModule } from '@angular/core'; import { filter } from 'rxjs/operators'; import * as i1 from 'ngx-bootstrap/component-loader'; import { ComponentLoaderFactory } from 'ngx-bootstrap/component-loader'; import * as i2 from '@angular/animations'; import { style, animate } from '@angular/animations'; import { NgClass } from '@angular/common'; /** Default dropdown configuration */ class BsDropdownConfig { constructor() { /** default dropdown auto closing behavior */ this.autoClose = true; /** default dropdown auto closing behavior */ this.insideClick = false; /** turn on/off animation */ this.isAnimated = false; /** value true of stopOnClickPropagation allows event stopPropagation*/ this.stopOnClickPropagation = false; } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: BsDropdownConfig, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); } static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: BsDropdownConfig, providedIn: 'root' }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: BsDropdownConfig, decorators: [{ type: Injectable, args: [{ providedIn: 'root' }] }] }); class BsDropdownState { constructor() { this.direction = 'down'; this.autoClose = true; this.insideClick = false; this.isAnimated = false; this.stopOnClickPropagation = false; this.isOpenChange = new EventEmitter(); this.isDisabledChange = new EventEmitter(); this.toggleClick = new EventEmitter(); this.counts = 0; this.dropdownMenu = new Promise(resolve => { this.resolveDropdownMenu = resolve; }); } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: BsDropdownState, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); } static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: BsDropdownState, providedIn: 'platform' }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: BsDropdownState, decorators: [{ type: Injectable, args: [{ providedIn: 'platform' }] }], ctorParameters: () => [] }); const DROPDOWN_ANIMATION_TIMING = '220ms cubic-bezier(0, 0, 0.2, 1)'; const dropdownAnimation = [ style({ height: 0, overflow: 'hidden' }), animate(DROPDOWN_ANIMATION_TIMING, style({ height: '*', overflow: 'hidden' })) ]; // todo: revert ngClass to [class] when false positive angular-cli issue is fixed // [class.dropdown]="direction === 'down'"--> class BsDropdownContainerComponent { get direction() { return this._state.direction; } constructor(_state, cd, _renderer, _element, _builder) { this._state = _state; this.cd = cd; this._renderer = _renderer; this._element = _element; this.isOpen = false; this._factoryDropDownAnimation = _builder.build(dropdownAnimation); this._subscription = _state.isOpenChange.subscribe((value) => { this.isOpen = value; const dropdown = this._element.nativeElement.querySelector('.dropdown-menu'); this._renderer.addClass(this._element.nativeElement.querySelector('div'), 'open'); if (dropdown) { this._renderer.addClass(dropdown, 'show'); if (dropdown.classList.contains('dropdown-menu-right') || dropdown.classList.contains('dropdown-menu-end')) { this._renderer.setStyle(dropdown, 'left', 'auto'); this._renderer.setStyle(dropdown, 'right', '0'); } if (this.direction === 'up') { this._renderer.setStyle(dropdown, 'top', 'auto'); this._renderer.setStyle(dropdown, 'transform', 'translateY(-101%)'); } } if (dropdown && this._state.isAnimated) { this._factoryDropDownAnimation.create(dropdown) .play(); } this.cd.markForCheck(); this.cd.detectChanges(); }); } /** @internal */ _contains(el) { return this._element.nativeElement.contains(el); } ngOnDestroy() { this._subscription.unsubscribe(); } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: BsDropdownContainerComponent, deps: [{ token: BsDropdownState }, { token: i0.ChangeDetectorRef }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i2.AnimationBuilder }], target: i0.ɵɵFactoryTarget.Component }); } static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.0", type: BsDropdownContainerComponent, isStandalone: true, selector: "bs-dropdown-container", host: { styleAttribute: "display:block;position: absolute;z-index: 1040" }, ngImport: i0, template: ` <div [class.dropup]="direction === 'up'" [ngClass]="{dropdown: direction === 'down'}" [class.show]="isOpen" [class.open]="isOpen"><ng-content></ng-content> </div> `, isInline: true, dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: BsDropdownContainerComponent, decorators: [{ type: Component, args: [{ selector: 'bs-dropdown-container', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [NgClass], host: { style: 'display:block;position: absolute;z-index: 1040' }, template: ` <div [class.dropup]="direction === 'up'" [ngClass]="{dropdown: direction === 'down'}" [class.show]="isOpen" [class.open]="isOpen"><ng-content></ng-content> </div> `, }] }], ctorParameters: () => [{ type: BsDropdownState }, { type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i2.AnimationBuilder }] }); class BsDropdownDirective { get isDisabled() { return this._isDisabled; } get isOpen() { if (this._showInline) { return this._isInlineOpen; } return this._dropdown.isShown; } get _showInline() { return !this.container(); } constructor(_elementRef, _renderer, _viewContainerRef, _cis, _state, _config, _builder) { this._elementRef = _elementRef; this._renderer = _renderer; this._viewContainerRef = _viewContainerRef; this._cis = _cis; this._state = _state; this._config = _config; /** * Placement of a popover. Accepts: "top", "bottom", "left", "right" */ this.placement = input(...(ngDevMode ? [undefined, { debugName: "placement" }] : [])); /** * Specifies events that should trigger. Supports a space separated list of * event names. */ this.triggers = input(...(ngDevMode ? [undefined, { debugName: "triggers" }] : [])); /** * A selector specifying the element the popover should be appended to. */ this.container = input(...(ngDevMode ? [undefined, { debugName: "container" }] : [])); /** * This attribute indicates that the dropdown should be opened upwards */ this.dropup = input(false, ...(ngDevMode ? [{ debugName: "dropup" }] : [])); // Internal resolved value for dropup (for host binding) this._dropup = false; /** * Indicates that dropdown will be closed on item or document click, * and after pressing ESC */ this.autoClose = input(undefined, ...(ngDevMode ? [{ debugName: "autoClose" }] : [])); /** * Indicates that dropdown will be animated */ this.isAnimated = input(undefined, ...(ngDevMode ? [{ debugName: "isAnimated" }] : [])); /** * This attribute indicates that the dropdown shouldn't close on inside click when autoClose is set to true */ this.insideClick = input(undefined, ...(ngDevMode ? [{ debugName: "insideClick" }] : [])); /** * Disables dropdown toggle and hides dropdown menu if opened */ // eslint-disable-next-line @angular-eslint/no-input-rename this.isDisabledInput = input(false, { ...(ngDevMode ? { debugName: "isDisabledInput" } : {}), alias: 'isDisabled' }); /** * Returns whether or not the popover is currently being shown */ // eslint-disable-next-line @angular-eslint/no-input-rename this.isOpenInput = input(false, { ...(ngDevMode ? { debugName: "isOpenInput" } : {}), alias: 'isOpen' }); /** * Emits an event when isOpen change */ this.isOpenChange = output(); /** * Emits an event when the popover is shown */ this.onShown = output(); /** * Emits an event when the popover is hidden */ this.onHidden = output(); // todo: move to component loader this._isInlineOpen = false; this._isDisabled = false; this._subscriptions = []; this._isInited = false; // set initial dropdown state from config this._state.autoClose = this._config.autoClose; this._state.insideClick = this._config.insideClick; this._state.isAnimated = this._config.isAnimated; this._state.stopOnClickPropagation = this._config.stopOnClickPropagation; this._factoryDropDownAnimation = _builder.build(dropdownAnimation); // create dropdown component loader this._dropdown = this._cis .createLoader(this._elementRef, this._viewContainerRef, this._renderer) .provide({ provide: BsDropdownState, useValue: this._state }); this._dropdown.onShown.subscribe((v) => this.onShown.emit(v)); this._dropdown.onHidden.subscribe((v) => this.onHidden.emit(v)); this._state.isOpenChange.subscribe((v) => this.isOpenChange.emit(v)); // Effect for dropup effect(() => { this._dropup = this.dropup(); }); // Effect for autoClose effect(() => { const val = this.autoClose(); if (val !== undefined) { this._state.autoClose = val; } }); // Effect for isAnimated effect(() => { const val = this.isAnimated(); if (val !== undefined) { this._state.isAnimated = val; } }); // Effect for insideClick effect(() => { const val = this.insideClick(); if (val !== undefined) { this._state.insideClick = val; } }); // Effect for isDisabled effect(() => { const val = this.isDisabledInput(); this._isDisabled = val; this._state.isDisabledChange.emit(val); if (val) { this.hide(); } }); // Effect for isOpen effect(() => { const val = this.isOpenInput(); if (val) { this.show(); } else { this.hide(); } }); } ngOnInit() { // fix: seems there are an issue with `routerLinkActive` // which result in duplicated call ngOnInit without call to ngOnDestroy // read more: https://github.com/valor-software/ngx-bootstrap/issues/1885 if (this._isInited) { return; } this._isInited = true; // attach DOM listeners this._dropdown.listen({ // because of dropdown inline mode outsideClick: false, triggers: this.triggers(), show: () => this.show() }); // toggle visibility on toggle element click this._subscriptions.push(this._state.toggleClick.subscribe((value) => this.toggle(value))); // hide dropdown if set disabled while opened this._subscriptions.push(this._state.isDisabledChange .pipe(filter((value) => value)) .subscribe(( /*value: boolean*/) => this.hide())); } /** * Opens an element’s popover. This is considered a “manual” triggering of * the popover. */ show() { if (this.isOpen || this.isDisabled) { return; } if (this._showInline) { if (!this._inlinedMenu) { this._state.dropdownMenu .then((dropdownMenu) => { this._dropdown.attachInline(dropdownMenu.viewContainer, dropdownMenu.templateRef); this._inlinedMenu = this._dropdown._inlineViewRef; this.addBs4Polyfills(); if (this._inlinedMenu) { this._renderer.addClass(this._inlinedMenu.rootNodes[0].parentNode, 'open'); } this.playAnimation(); }) // swallow errors .catch(); } this.addBs4Polyfills(); this._isInlineOpen = true; this.onShown.emit(true); this._state.isOpenChange.emit(true); this.playAnimation(); return; } this._state.dropdownMenu .then((dropdownMenu) => { // check direction in which dropdown should be opened const _dropup = this._dropup || (typeof this._dropup !== 'undefined' && this._dropup); this._state.direction = _dropup ? 'up' : 'down'; const _placement = this.placement() || (_dropup ? 'top start' : 'bottom start'); // show dropdown this._dropdown .attach(BsDropdownContainerComponent) .to(this.container()) .position({ attachment: _placement }) .show({ content: dropdownMenu.templateRef, placement: _placement }); this._state.isOpenChange.emit(true); }) // swallow error .catch(); } /** * Closes an element’s popover. This is considered a “manual” triggering of * the popover. */ hide() { if (!this.isOpen) { return; } if (this._showInline) { this.removeShowClass(); this.removeDropupStyles(); this._isInlineOpen = false; this.onHidden.emit(true); } else { this._dropdown.hide(); } this._state.isOpenChange.emit(false); } /** * Toggles an element’s popover. This is considered a “manual” triggering of * the popover. With parameter <code>true</code> allows toggling, with parameter <code>false</code> * only hides opened dropdown. Parameter usage will be removed in ngx-bootstrap v3 */ toggle(value) { if (this.isOpen || !value) { return this.hide(); } return this.show(); } /** @internal */ _contains(event) { // handle Event target typing if (!(event.target instanceof Node)) { return false; } return (this._elementRef.nativeElement.contains(event.target) || (this._dropdown.instance && this._dropdown.instance._contains(event.target))); } navigationClick(event) { const ke = event; const ref = this._elementRef.nativeElement.querySelector('.dropdown-menu'); if (!ref) { return; } const firstActive = this._elementRef.nativeElement.ownerDocument.activeElement; const allRef = ref.querySelectorAll('.dropdown-item'); switch (ke.keyCode) { case 38: if (this._state.counts > 0) { allRef[--this._state.counts].focus(); } break; case 40: if (this._state.counts + 1 < allRef.length) { if (firstActive.classList !== allRef[this._state.counts].classList) { allRef[this._state.counts].focus(); } else { allRef[++this._state.counts].focus(); } } break; default: } if ('preventDefault' in ke) { ke.preventDefault(); } } ngOnDestroy() { // clean up subscriptions and destroy dropdown for (const sub of this._subscriptions) { sub.unsubscribe(); } this._dropdown.dispose(); } addBs4Polyfills() { this.addShowClass(); this.checkRightAlignment(); this.addDropupStyles(); } playAnimation() { if (this._state.isAnimated && this._inlinedMenu) { setTimeout(() => { if (this._inlinedMenu) { this._factoryDropDownAnimation.create(this._inlinedMenu.rootNodes[0]).play(); } }); } } addShowClass() { if (this._inlinedMenu && this._inlinedMenu.rootNodes[0]) { this._renderer.addClass(this._inlinedMenu.rootNodes[0], 'show'); } } removeShowClass() { if (this._inlinedMenu && this._inlinedMenu.rootNodes[0]) { this._renderer.removeClass(this._inlinedMenu.rootNodes[0], 'show'); } } checkRightAlignment() { if (this._inlinedMenu && this._inlinedMenu.rootNodes[0]) { const isRightAligned = this._inlinedMenu.rootNodes[0].classList.contains('dropdown-menu-right') || this._inlinedMenu.rootNodes[0].classList.contains('dropdown-menu-end'); this._renderer.setStyle(this._inlinedMenu.rootNodes[0], 'left', isRightAligned ? 'auto' : '0'); this._renderer.setStyle(this._inlinedMenu.rootNodes[0], 'right', isRightAligned ? '0' : 'auto'); } } addDropupStyles() { if (this._inlinedMenu && this._inlinedMenu.rootNodes[0]) { // a little hack to not break support of bootstrap 4 beta this._renderer.setStyle(this._inlinedMenu.rootNodes[0], 'top', this.dropup() ? 'auto' : '100%'); this._renderer.setStyle(this._inlinedMenu.rootNodes[0], 'transform', this.dropup() ? 'translateY(-101%)' : 'translateY(0)'); this._renderer.setStyle(this._inlinedMenu.rootNodes[0], 'bottom', 'auto'); } } removeDropupStyles() { if (this._inlinedMenu && this._inlinedMenu.rootNodes[0]) { this._renderer.removeStyle(this._inlinedMenu.rootNodes[0], 'top'); this._renderer.removeStyle(this._inlinedMenu.rootNodes[0], 'transform'); this._renderer.removeStyle(this._inlinedMenu.rootNodes[0], 'bottom'); } } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: BsDropdownDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ViewContainerRef }, { token: i1.ComponentLoaderFactory }, { token: BsDropdownState }, { token: BsDropdownConfig }, { token: i2.AnimationBuilder }], target: i0.ɵɵFactoryTarget.Directive }); } static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.0", type: BsDropdownDirective, isStandalone: true, selector: "[bsDropdown], [dropdown]", inputs: { placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, triggers: { classPropertyName: "triggers", publicName: "triggers", isSignal: true, isRequired: false, transformFunction: null }, container: { classPropertyName: "container", publicName: "container", isSignal: true, isRequired: false, transformFunction: null }, dropup: { classPropertyName: "dropup", publicName: "dropup", isSignal: true, isRequired: false, transformFunction: null }, autoClose: { classPropertyName: "autoClose", publicName: "autoClose", isSignal: true, isRequired: false, transformFunction: null }, isAnimated: { classPropertyName: "isAnimated", publicName: "isAnimated", isSignal: true, isRequired: false, transformFunction: null }, insideClick: { classPropertyName: "insideClick", publicName: "insideClick", isSignal: true, isRequired: false, transformFunction: null }, isDisabledInput: { classPropertyName: "isDisabledInput", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, isOpenInput: { classPropertyName: "isOpenInput", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isOpenChange: "isOpenChange", onShown: "onShown", onHidden: "onHidden" }, host: { listeners: { "keydown.arrowDown": "navigationClick($event)", "keydown.arrowUp": "navigationClick($event)" }, properties: { "class.dropup": "_dropup", "class.open": "isOpen", "class.show": "isOpen" } }, providers: [BsDropdownState, ComponentLoaderFactory, BsDropdownConfig], exportAs: ["bs-dropdown"], ngImport: i0 }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: BsDropdownDirective, decorators: [{ type: Directive, args: [{ selector: '[bsDropdown], [dropdown]', exportAs: 'bs-dropdown', providers: [BsDropdownState, ComponentLoaderFactory, BsDropdownConfig], standalone: true, host: { '[class.dropup]': '_dropup', '[class.open]': 'isOpen', '[class.show]': 'isOpen' } }] }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ViewContainerRef }, { type: i1.ComponentLoaderFactory }, { type: BsDropdownState }, { type: BsDropdownConfig }, { type: i2.AnimationBuilder }], propDecorators: { placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: false }] }], triggers: [{ type: i0.Input, args: [{ isSignal: true, alias: "triggers", required: false }] }], container: [{ type: i0.Input, args: [{ isSignal: true, alias: "container", required: false }] }], dropup: [{ type: i0.Input, args: [{ isSignal: true, alias: "dropup", required: false }] }], autoClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoClose", required: false }] }], isAnimated: [{ type: i0.Input, args: [{ isSignal: true, alias: "isAnimated", required: false }] }], insideClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "insideClick", required: false }] }], isDisabledInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDisabled", required: false }] }], isOpenInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "isOpen", required: false }] }], isOpenChange: [{ type: i0.Output, args: ["isOpenChange"] }], onShown: [{ type: i0.Output, args: ["onShown"] }], onHidden: [{ type: i0.Output, args: ["onHidden"] }], navigationClick: [{ type: HostListener, args: ['keydown.arrowDown', ['$event']] }, { type: HostListener, args: ['keydown.arrowUp', ['$event']] }] } }); class BsDropdownMenuDirective { constructor(_state, _viewContainer, _templateRef) { _state.resolveDropdownMenu({ templateRef: _templateRef, viewContainer: _viewContainer }); } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: BsDropdownMenuDirective, deps: [{ token: BsDropdownState }, { token: i0.ViewContainerRef }, { token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); } static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.0", type: BsDropdownMenuDirective, isStandalone: true, selector: "[bsDropdownMenu],[dropdownMenu]", exportAs: ["bs-dropdown-menu"], ngImport: i0 }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: BsDropdownMenuDirective, decorators: [{ type: Directive, args: [{ selector: '[bsDropdownMenu],[dropdownMenu]', exportAs: 'bs-dropdown-menu', standalone: true }] }], ctorParameters: () => [{ type: BsDropdownState }, { type: i0.ViewContainerRef }, { type: i0.TemplateRef }] }); class BsDropdownToggleDirective { constructor(_changeDetectorRef, _dropdown, _element, _renderer, _state) { this._changeDetectorRef = _changeDetectorRef; this._dropdown = _dropdown; this._element = _element; this._renderer = _renderer; this._state = _state; this.isOpen = false; this._subscriptions = []; // sync is open value with state this._subscriptions.push(this._state.isOpenChange.subscribe((value) => { this.isOpen = value; if (value) { this._documentClickListener = this._renderer.listen('document', 'click', (event) => { if (!(event.target instanceof Node)) { return; } const isPrimaryClick = event instanceof MouseEvent ? event.button !== 2 : true; if (this._state.autoClose && isPrimaryClick && !this._element.nativeElement.contains(event.target) && !(this._state.insideClick && this._dropdown._contains(event))) { this._state.toggleClick.emit(false); this._changeDetectorRef.detectChanges(); } }); this._escKeyUpListener = this._renderer.listen(this._element.nativeElement, 'keyup.esc', () => { if (this._state.autoClose) { this._state.toggleClick.emit(false); this._changeDetectorRef.detectChanges(); } }); } else { this._documentClickListener && this._documentClickListener(); this._escKeyUpListener && this._escKeyUpListener(); } })); // populate disabled state this._subscriptions.push(this._state.isDisabledChange .subscribe((value) => this.isDisabled = value || void 0)); } onClick(event) { if (this._state.stopOnClickPropagation) { event.stopPropagation(); } if (this.isDisabled) { return; } this._state.toggleClick.emit(true); } ngOnDestroy() { if (this._documentClickListener) { this._documentClickListener(); } if (this._escKeyUpListener) { this._escKeyUpListener(); } for (const sub of this._subscriptions) { sub.unsubscribe(); } } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: BsDropdownToggleDirective, deps: [{ token: i0.ChangeDetectorRef }, { token: BsDropdownDirective }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: BsDropdownState }], target: i0.ɵɵFactoryTarget.Directive }); } static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.0", type: BsDropdownToggleDirective, isStandalone: true, selector: "[bsDropdownToggle],[dropdownToggle]", host: { listeners: { "click": "onClick($event)" }, properties: { "attr.aria-haspopup": "true", "attr.disabled": "this.isDisabled", "attr.aria-expanded": "this.isOpen" } }, exportAs: ["bs-dropdown-toggle"], ngImport: i0 }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: BsDropdownToggleDirective, decorators: [{ type: Directive, args: [{ selector: '[bsDropdownToggle],[dropdownToggle]', exportAs: 'bs-dropdown-toggle', host: { '[attr.aria-haspopup]': 'true' }, standalone: true }] }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: BsDropdownDirective }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: BsDropdownState }], propDecorators: { isDisabled: [{ type: HostBinding, args: ['attr.disabled'] }], isOpen: [{ type: HostBinding, args: ['attr.aria-expanded'] }], onClick: [{ type: HostListener, args: ['click', ['$event']] }] } }); class BsDropdownModule { static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: BsDropdownModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); } static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.0", ngImport: i0, type: BsDropdownModule, imports: [BsDropdownDirective, BsDropdownContainerComponent, BsDropdownMenuDirective, BsDropdownToggleDirective], exports: [BsDropdownMenuDirective, BsDropdownToggleDirective, BsDropdownDirective] }); } static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: BsDropdownModule }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: BsDropdownModule, decorators: [{ type: NgModule, args: [{ imports: [ BsDropdownDirective, BsDropdownContainerComponent, BsDropdownMenuDirective, BsDropdownToggleDirective ], exports: [ BsDropdownMenuDirective, BsDropdownToggleDirective, BsDropdownDirective ] }] }] }); /** * Generated bundle index. Do not edit. */ export { BsDropdownConfig, BsDropdownContainerComponent, BsDropdownDirective, BsDropdownMenuDirective, BsDropdownModule, BsDropdownState, BsDropdownToggleDirective }; //# sourceMappingURL=ngx-bootstrap-dropdown.mjs.map