UNPKG

carbon-components-angular

Version:
89 lines (85 loc) 3.54 kB
/** * * carbon-angular v0.0.0 | menu-button.component.d.ts * * Copyright 2014, 2025 IBM * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { AfterViewInit, ChangeDetectorRef, ElementRef, NgZone, OnChanges, OnDestroy, QueryList, Renderer2, SimpleChanges, TemplateRef, ViewContainerRef } from "@angular/core"; import { ContextMenuItemComponent, ItemClickEvent } from "carbon-components-angular/context-menu"; import * as i0 from "@angular/core"; declare type MenuButtonPlacement = "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end"; export declare class MenuButtonComponent implements OnChanges, AfterViewInit, OnDestroy { protected ngZone: NgZone; protected renderer: Renderer2; protected hostElement: ElementRef; protected viewContainerRef: ViewContainerRef; protected changeDetectorRef: ChangeDetectorRef; static menuButtonCounter: number; menuId: string; set projectedMenuItems(itemList: QueryList<ContextMenuItemComponent>); containerClass: boolean; kind: "primary" | "tertiary" | "ghost"; size: "sm" | "md" | "lg"; menuAlignment: MenuButtonPlacement; buttonTabIndex: "0" | "1" | "-1" | string; disabled: boolean; open: boolean; label: string; referenceElement: ElementRef<HTMLButtonElement>; menuTemplate: TemplateRef<any>; protected documentClick: any; protected unmountFloatingElement: Function; private subscriptions; private _alignment; private menuRef; constructor(ngZone: NgZone, renderer: Renderer2, hostElement: ElementRef, viewContainerRef: ViewContainerRef, changeDetectorRef: ChangeDetectorRef); /** * In case user updates alignment, store initial value. * This allows us to test user passed alignment on each open */ ngOnChanges(changes: SimpleChanges): void; /** * If user has passed in true for open, we dynamically open the menu */ ngAfterViewInit(): void; /** * Clean up Floating-ui & subscriptions */ ngOnDestroy(): void; /** * As of now, menu button does not support nexted menu, on button click it should close */ handleMenuItemClick(event: ItemClickEvent): void; /** * On body click, close the menu * @param event */ handleFocusOut(event: any): void; /** * Clean up `autoUpdate` if auto alignment is enabled */ cleanUp(): void; /** * Handles emitting open/close event */ toggleMenu(): void; roundByDPR(value: any): number; /** * Compute position of menu */ recomputePosition(): void; static ɵfac: i0.ɵɵFactoryDeclaration<MenuButtonComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<MenuButtonComponent, "cds-menu-button", never, { "menuId": "menuId"; "kind": "kind"; "size": "size"; "menuAlignment": "menuAlignment"; "buttonTabIndex": "buttonTabIndex"; "disabled": "disabled"; "open": "open"; "label": "label"; }, {}, ["projectedMenuItems"], ["cds-menu-item, cds-menu-divider"], false>; } export {};