import * as i2 from "igniteui-angular/directives"; import { IgxButtonDirective } from "igniteui-angular/directives"; import * as i0 from "@angular/core"; import { AfterViewInit, EventEmitter, OnDestroy } from "@angular/core"; import { Subject } from "rxjs"; import { IBaseEventArgs } from "igniteui-angular/core"; /** * Determines the Button Group alignment */ export declare const ButtonGroupAlignment: { readonly horizontal: "horizontal"; readonly vertical: "vertical"; }; export type ButtonGroupAlignment = typeof ButtonGroupAlignment[keyof typeof ButtonGroupAlignment]; /** * **Ignite UI for Angular Button Group** - * [Documentation](https://www.infragistics.com/products/ignite-ui-angular/angular/components/buttongroup.html) * * The Ignite UI Button Group displays a group of buttons either vertically or horizontally. The group supports * single, multi and singleRequired selection. * * Example: * ```html * * * ``` * The `fontOptions` value shown above is defined as: * ```typescript * public fontOptions: IButtonGroupButton[] = [ * { label: 'Bold', icon: 'format_bold', selected: false }, * { label: 'Italic', icon: 'format_italic', selected: false }, * { label: 'Underline', icon: 'format_underlined', selected: false }]; * ``` */ export declare class IgxButtonGroupComponent implements AfterViewInit, OnDestroy { private _cdr; private _renderer; private _el; /** * A collection containing all buttons inside the button group. */ get buttons(): IgxButtonDirective[]; /** * Gets/Sets the value of the `id` attribute. If not set it will be automatically generated. * ```html * * ``` */ id: string; /** @hidden @internal */ cssClass: string; /** @hidden @internal */ /** * @hidden */ zIndex: number; /** * Sets/gets the role attribute value. * * @example * ```typescript * @ViewChild("MyButtonGroup", { read: IgxButtonGroupComponent }) * public badge: IgxButtonGroupComponent; * * buttonGroup.role = 'group'; * ``` */ role: string; /** * Allows you to set a style using the `itemContentCssClass` input. * The value should be the CSS class name that will be applied to the button group. * ```typescript * public style1 = "styleClass"; * //.. * ``` * ```html * * ``` */ set itemContentCssClass(value: string); /** * Returns the CSS class of the item content of the button group. * ```typescript * @ViewChild("MyChild") * public buttonG: IgxButtonGroupComponent; * ngAfterViewInit(){ * let buttonSelect = this.buttonG.itemContentCssClass; * } * ``` */ get itemContentCssClass(): string; /** * Gets/Sets the selection mode to 'single', 'singleRequired' or 'multi' of the buttons. By default, the selection mode is 'single'. * ```html * * ``` */ get selectionMode(): "single" | "singleRequired" | "multi"; set selectionMode(selectionMode: 'single' | 'singleRequired' | 'multi'); /** * Configures the buttons rendered by the button group using a collection of `IButtonGroupButton` objects. * The buttons are rendered before any buttons projected in the group's content. * * The `selected` flag of each item is kept in sync with the selection state of its button. * * @example * ```typescript * public cities: IButtonGroupButton[] = [ * { label: 'Sofia' }, * { label: 'London' }, * { label: 'New York', selected: true }, * { label: 'Tokyo', disabled: true } * ]; * ``` * ```html * * ``` */ values: IButtonGroupButton[]; /** * Disables the `igx-buttongroup` component. By default it's false. * ```html * * ``` */ get disabled(): boolean; set disabled(value: boolean); /** * Allows you to set the button group alignment. * Available options are `ButtonGroupAlignment.horizontal` (default) and `ButtonGroupAlignment.vertical`. * ```typescript * public alignment = ButtonGroupAlignment.vertical; * //.. * ``` * ```html * * ``` */ set alignment(value: ButtonGroupAlignment); /** * Returns the alignment of the `igx-buttongroup`. * ```typescript * @ViewChild("MyChild") * public buttonG: IgxButtonGroupComponent; * ngAfterViewInit(){ * let buttonAlignment = this.buttonG.alignment; * } * ``` */ get alignment(): ButtonGroupAlignment; /** * An @Ouput property that emits an event when a button is selected. * ```typescript * @ViewChild("toast") * private toast: IgxToastComponent; * public selectedHandler(buttongroup) { * this.toast.open() * } * //... * ``` * ```html * * You have made a selection! * ``` */ selected: EventEmitter; /** * An @Ouput property that emits an event when a button is deselected. * ```typescript * @ViewChild("toast") * private toast: IgxToastComponent; * public deselectedHandler(buttongroup){ * this.toast.open() * } * //... * ``` * ```html * #MyChild [selectionMode]="'multi'" (deselected)="deselectedHandler($event)"> * You have deselected a button! * ``` */ deselected: EventEmitter; private viewButtons; private templateButtons; /** * Returns true if the `igx-buttongroup` alignment is vertical. * Note that in order for the accessor to work correctly the property should be set explicitly. * ```html * * ``` * ```typescript * //... * @ViewChild("MyChild") * private buttonG: IgxButtonGroupComponent; * ngAfterViewInit(){ * let orientation = this.buttonG.isVertical; * } * ``` */ get isVertical(): boolean; /** * @hidden */ selectedIndexes: number[]; protected buttonClickNotifier$: Subject; protected queryListNotifier$: Subject; private _isVertical; private _itemContentCssClass; private _disabled; private _selectionMode; private mutationObserver; private observerConfig; /** * Gets the selected button/buttons. * ```typescript * @ViewChild("MyChild") * private buttonG: IgxButtonGroupComponent; * ngAfterViewInit(){ * let selectedButton = this.buttonG.selectedButtons; * } * ``` */ get selectedButtons(): IgxButtonDirective[]; /** * Selects a button by its index. * ```typescript * @ViewChild("MyChild") * private buttonG: IgxButtonGroupComponent; * ngAfterViewInit(){ * this.buttonG.selectButton(2); * this.cdr.detectChanges(); * } * ``` * * @memberOf {@link IgxButtonGroupComponent} */ selectButton(index: number): void; /** * @hidden * @internal */ updateSelected(index: number): void; updateDeselected(index: number): void; /** * Deselects a button by its index. * ```typescript * @ViewChild("MyChild") * private buttonG: IgxButtonGroupComponent; * ngAfterViewInit(){ * this.buttonG.deselectButton(2); * this.cdr.detectChanges(); * } * ``` * * @memberOf {@link IgxButtonGroupComponent} */ deselectButton(index: number): void; /** * @hidden */ ngAfterViewInit(): void; /** * @hidden */ ngOnDestroy(): void; /** * @hidden */ _clickHandler(index: number): void; private setMutationsObserver; private getUpdatedButtons; private updateButtonSelectionState; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; static ngAcceptInputType_disabled: unknown; } export interface IButtonGroupEventArgs extends IBaseEventArgs { owner: IgxButtonGroupComponent; button: IgxButtonDirective; index: number; } /** * Describes a button rendered by `IgxButtonGroupComponent` through its `values` input. * * @example * ```typescript * public alignOptions: IButtonGroupButton[] = [ * { label: 'Left', icon: 'format_align_left', selected: true }, * { label: 'Center', icon: 'format_align_center' }, * { label: 'Right', icon: 'format_align_right', disabled: true } * ]; * ``` */ export interface IButtonGroupButton { /** * The text displayed in the button. It is also used as the button's `aria-label` * and to track the button when the `values` collection changes, so it should be unique in the collection. */ label: string; /** The name of the icon displayed before the label. */ icon?: string; /** The color of the ripple effect shown when the button is clicked. */ ripple?: string; /** Whether the button is selected. Kept in sync with the selection state of the button group. */ selected?: boolean; /** Whether the button is disabled. Disabling the button group disables all of its buttons. */ disabled?: boolean; /** Rendered as the button's `data-togglable` attribute. */ togglable?: boolean; } export declare const IGX_BUTTON_GROUP_DIRECTIVES: readonly [typeof IgxButtonGroupComponent, typeof IgxButtonDirective]; /** * @hidden * @deprecated * IMPORTANT: The following is NgModule exported for backwards-compatibility before standalone components */ export declare class IgxButtonGroupModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; }