import * as i2 from 'igniteui-angular/directives'; import { IgxButtonDirective } from 'igniteui-angular/directives'; import * as i0 from '@angular/core'; import { AfterViewInit, OnDestroy, EventEmitter } from '@angular/core'; import { Subject } from 'rxjs'; import { IBaseEventArgs } from 'igniteui-angular/core'; /** * Determines the Button Group alignment */ declare const ButtonGroupAlignment: { readonly horizontal: "horizontal"; readonly vertical: "vertical"; }; 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 * this.fontOptions = [ * { icon: 'format_bold', selected: false }, * { icon: 'format_italic', selected: false }, * { icon: 'format_underlined', selected: false }]; * ``` */ 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 */ zIndex: number; /** * 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 `IgxButtonGroup`. * ```typescript * @ViewChild("MyChild") * public buttonG: IgxButtonGroupComponent; * ngAfterViewInit(){ * let buttonSelect = this.buttonG.itemContentCssClass; * } * ``` */ get itemContentCssClass(): string; /** * Enables selecting multiple buttons. By default, multi-selection is false. * * @deprecated in version 16.1.0. Use the `selectionMode` property instead. */ get multiSelection(): boolean; set multiSelection(selectionMode: boolean); /** * 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'); /** * Property that configures the buttons in the button group using a collection of `Button` objects. * ```typescript * public ngOnInit() { * this.cities = [ * new Button({ * label: "Sofia" * }), * new Button({ * label: "London" * }), * new Button({ * label: "New York", * selected: true * }), * new Button({ * label: "Tokyo" * }) * ]; * } * //.. * ``` * ```html * * ``` */ values: any; /** * 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; } interface IButtonGroupEventArgs extends IBaseEventArgs { owner: IgxButtonGroupComponent; button: IgxButtonDirective; index: number; } 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 */ declare class IgxButtonGroupModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export { ButtonGroupAlignment, IGX_BUTTON_GROUP_DIRECTIVES, IgxButtonGroupComponent, IgxButtonGroupModule }; export type { IButtonGroupEventArgs };