UNPKG

gentics-ui-core

Version:

This is the common core framework for the Gentics CMS and Mesh UI, and other Angular applications.

73 lines (72 loc) 3.1 kB
import { AfterViewInit, ChangeDetectorRef, ElementRef, OnDestroy, QueryList } from '@angular/core'; import { DropdownItem } from '../dropdown-list/dropdown-item.component'; import * as i0 from "@angular/core"; /** * A split button component. * * The main content of the button and the handler of the main click event is specified by * using a `<gtx-split-button-primary-action>` child element. * * Secondary actions can be defined using `<gtx-dropdown-item>` child elements and * their click handlers. If secondary actions are defined, a dropdown trigger * will be displayed to the right of the main content. * * All input properties of `<gtx-button>`, except for `icon` and `submit` are supported. * * This component depends on the `<gtx-overlay-host>` being present in the app. * * ```html * <gtx-split-button> * <gtx-split-button-primary-action (click)="save()">Save Document</gtx-split-button-primary-action> * <gtx-dropdown-item (click)="saveAndPublish()">Save and Publish</gtx-dropdown-item> * <gtx-dropdown-item (click)="saveAndEmail()">Save and Send via E-Mail</gtx-dropdown-item> * </gtx-split-button> * ``` */ export declare class SplitButton implements AfterViewInit, OnDestroy { private changeDetector; /** * Sets the input field to be auto-focused. Handled by `AutofocusDirective`. */ autofocus: boolean; /** * Specify the size of the button. Can be "small", "regular" or "large". */ size: 'small' | 'regular' | 'large'; /** * Type determines the style of the button. Can be "default", "secondary", * "success", "warning" or "alert". */ type: 'default' | 'secondary' | 'success' | 'warning' | 'alert'; /** * Setting the "flat" attribute gives the button a transparent background * and only depth on hover. */ get flat(): boolean; set flat(value: boolean); /** * Controls whether the button is disabled. */ get disabled(): boolean; set disabled(value: boolean); primaryAction: ElementRef; secondaryActions: QueryList<DropdownItem>; isFlat: boolean; isDisabled: boolean; private queryListSub; constructor(changeDetector: ChangeDetectorRef); ngAfterViewInit(): void; ngOnDestroy(): void; /** * If the user does not click the primary action content itself, but the button around it, * this method is used to trigger a click event on the primary action content. */ onPrimaryButtonClick(event: Event): void; /** * Returns true if the event was fired by the primary `gtx-button` element or one of its children, * but not by the `gtx-split-button-primary-action` or one of its children. */ private isFromPrimaryButton; static ɵfac: i0.ɵɵFactoryDeclaration<SplitButton, never>; static ɵcmp: i0.ɵɵComponentDeclaration<SplitButton, "gtx-split-button", never, { "autofocus": "autofocus"; "size": "size"; "type": "type"; "flat": "flat"; "disabled": "disabled"; }, {}, ["primaryAction", "secondaryActions"], ["gtx-split-button-primary-action", "gtx-dropdown-item"]>; }