UNPKG

primeng

Version:

PrimeNG is an open source UI library for Angular featuring a rich set of 80+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeB

374 lines (373 loc) 14.2 kB
import { AfterContentInit, AfterViewInit, EventEmitter, OnDestroy, QueryList, SimpleChanges, TemplateRef } from '@angular/core'; import { PrimeTemplate } from 'primeng/api'; import { BaseComponent } from 'primeng/basecomponent'; import { ButtonProps } from './button.interface'; import { ButtonStyle } from './style/buttonstyle'; import { ButtonSeverity } from './button.interface'; import * as i0 from "@angular/core"; import * as i1 from "@angular/common"; import * as i2 from "primeng/api"; type ButtonIconPosition = 'left' | 'right' | 'top' | 'bottom'; export declare class ButtonLabel extends BaseComponent { _componentStyle: ButtonStyle; static ɵfac: i0.ɵɵFactoryDeclaration<ButtonLabel, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<ButtonLabel, "[pButtonLabel]", never, {}, {}, never, never, true, never>; } export declare class ButtonIcon extends BaseComponent { _componentStyle: ButtonStyle; static ɵfac: i0.ɵɵFactoryDeclaration<ButtonIcon, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<ButtonIcon, "[pButtonIcon]", never, {}, {}, never, never, true, never>; } /** * Button directive is an extension to button component. * @group Components */ export declare class ButtonDirective extends BaseComponent implements AfterViewInit, OnDestroy { /** * Position of the icon. * @deprecated utilize pButtonIcon and pButtonLabel directives. * @group Props */ iconPos: ButtonIconPosition; /** * Uses to pass attributes to the loading icon's DOM element. * @deprecated utilize pButonIcon instead. * @group Props */ loadingIcon: string | undefined; set label(val: string); set icon(val: string); /** * Whether the button is in loading state. * @group Props */ get loading(): boolean; set loading(val: boolean); _buttonProps: ButtonProps; private iconSignal; private labelSignal; isIconOnly: import("@angular/core").Signal<boolean>; set buttonProps(val: ButtonProps); private _severity; /** * Defines the style of the button. * @group Props */ get severity(): ButtonSeverity; set severity(value: ButtonSeverity); /** * Add a shadow to indicate elevation. * @group Props */ raised: boolean; /** * Add a circular border radius to the button. * @group Props */ rounded: boolean; /** * Add a textual class to the button without a background initially. * @group Props */ text: boolean; /** * Add a border class without a background initially. * @group Props */ outlined: boolean; /** * Defines the size of the button. * @group Props */ size: 'small' | 'large' | undefined | null; /** * Add a plain textual class to the button without a background initially. * @deprecated use variant property instead. * @group Props */ plain: boolean; /** * Spans 100% width of the container when enabled. * @group Props */ fluid: boolean | undefined; _label: string | undefined; _icon: string | undefined; _loading: boolean; initialized: boolean | undefined; private get htmlElement(); private _internalClasses; isTextButton: import("@angular/core").Signal<boolean>; /** * Text of the button. * @deprecated use pButtonLabel directive instead. * @group Props */ get label(): string | undefined; /** * Name of the icon. * @deprecated use pButtonIcon directive instead * @group Props */ get icon(): string; /** * Used to pass all properties of the ButtonProps to the Button component. * @deprecated assign props directly to the button element. * @group Props */ get buttonProps(): ButtonProps; spinnerIcon: string; _componentStyle: ButtonStyle; ngAfterViewInit(): void; ngOnChanges(simpleChanges: SimpleChanges): void; getStyleClass(): string[]; get hasFluid(): boolean; setStyleClass(): void; removeExistingSeverityClass(): void; createLabel(): void; createIcon(): void; updateLabel(): void; updateIcon(): void; getIconClass(): string; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration<ButtonDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<ButtonDirective, "[pButton]", never, { "iconPos": { "alias": "iconPos"; "required": false; }; "loadingIcon": { "alias": "loadingIcon"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "severity": { "alias": "severity"; "required": false; }; "raised": { "alias": "raised"; "required": false; }; "rounded": { "alias": "rounded"; "required": false; }; "text": { "alias": "text"; "required": false; }; "outlined": { "alias": "outlined"; "required": false; }; "size": { "alias": "size"; "required": false; }; "plain": { "alias": "plain"; "required": false; }; "fluid": { "alias": "fluid"; "required": false; }; "label": { "alias": "label"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "buttonProps": { "alias": "buttonProps"; "required": false; }; }, {}, ["iconSignal", "labelSignal"], never, true, never>; static ngAcceptInputType_raised: unknown; static ngAcceptInputType_rounded: unknown; static ngAcceptInputType_text: unknown; static ngAcceptInputType_outlined: unknown; static ngAcceptInputType_plain: unknown; static ngAcceptInputType_fluid: unknown; } /** * Button is an extension to standard button element with icons and theming. * @group Components */ export declare class Button extends BaseComponent implements AfterContentInit { /** * Type of the button. * @group Props */ type: string; /** * Position of the icon. * @group Props */ iconPos: ButtonIconPosition; /** * Name of the icon. * @group Props */ icon: string | undefined; /** * Value of the badge. * @group Props */ badge: string | undefined; /** * Uses to pass attributes to the label's DOM element. * @group Props */ label: string | undefined; /** * When present, it specifies that the component should be disabled. * @group Props */ disabled: boolean | undefined; /** * Whether the button is in loading state. * @group Props */ loading: boolean; /** * Icon to display in loading state. * @group Props */ loadingIcon: string | undefined; /** * Add a shadow to indicate elevation. * @group Props */ raised: boolean; /** * Add a circular border radius to the button. * @group Props */ rounded: boolean; /** * Add a textual class to the button without a background initially. * @group Props */ text: boolean; /** * Add a plain textual class to the button without a background initially. * @deprecated use variant property instead. * @group Props */ plain: boolean; /** * Defines the style of the button. * @group Props */ severity: ButtonSeverity; /** * Add a border class without a background initially. * @group Props */ outlined: boolean; /** * Add a link style to the button. * @group Props */ link: boolean; /** * Add a tabindex to the button. * @group Props */ tabindex: number | undefined; /** * Defines the size of the button. * @group Props */ size: 'small' | 'large' | undefined; /** * Specifies the variant of the component. * @group Props */ variant: 'outlined' | 'text' | undefined; /** * Inline style of the element. * @group Props */ style: { [klass: string]: any; } | null | undefined; /** * Class of the element. * @group Props */ styleClass: string | undefined; /** * Style class of the badge. * @group Props * @deprecated use badgeSeverity instead. */ badgeClass: string | undefined; /** * Severity type of the badge. * @group Props * @defaultValue secondary */ badgeSeverity: 'success' | 'info' | 'warn' | 'danger' | 'help' | 'primary' | 'secondary' | 'contrast' | null | undefined; /** * Used to define a string that autocomplete attribute the current element. * @group Props */ ariaLabel: string | undefined; /** * When present, it specifies that the component should automatically get focus on load. * @group Props */ autofocus: boolean | undefined; /** * Spans 100% width of the container when enabled. * @group Props */ fluid: boolean | undefined; /** * Callback to execute when button is clicked. * This event is intended to be used with the <p-button> component. Using a regular <button> element, use (click). * @param {MouseEvent} event - Mouse event. * @group Emits */ onClick: EventEmitter<MouseEvent>; /** * Callback to execute when button is focused. * This event is intended to be used with the <p-button> component. Using a regular <button> element, use (focus). * @param {FocusEvent} event - Focus event. * @group Emits */ onFocus: EventEmitter<FocusEvent>; /** * Callback to execute when button loses focus. * This event is intended to be used with the <p-button> component. Using a regular <button> element, use (blur). * @param {FocusEvent} event - Focus event. * @group Emits */ onBlur: EventEmitter<FocusEvent>; /** * Template of the content. * @group Templates **/ contentTemplate: TemplateRef<any> | undefined; /** * Template of the loading. * @group Templates **/ loadingIconTemplate: TemplateRef<any> | undefined; /** * Template of the icon. * @group Templates **/ iconTemplate: TemplateRef<any> | undefined; _buttonProps: any | undefined; /** * Used to pass all properties of the ButtonProps to the Button component. * @group Props */ get buttonProps(): any | undefined; set buttonProps(val: any | undefined); get hasFluid(): boolean; _componentStyle: ButtonStyle; templates: QueryList<PrimeTemplate> | undefined; _contentTemplate: TemplateRef<any> | undefined; _iconTemplate: TemplateRef<any> | undefined; _loadingIconTemplate: TemplateRef<any> | undefined; ngAfterContentInit(): void; ngOnChanges(simpleChanges: SimpleChanges): void; spinnerIconClass(): string; iconClass(): { [x: string]: string | boolean; 'p-button-icon': boolean; 'p-button-icon-left': string; 'p-button-icon-right': string; 'p-button-icon-top': string; 'p-button-icon-bottom': string; }; get buttonClass(): { [x: string]: string | boolean; 'p-button p-component': boolean; 'p-button-icon-only': boolean; 'p-button-vertical': string; 'p-button-loading': boolean; 'p-button-loading-label-only': boolean; 'p-button-link': boolean; 'p-button-raised': boolean; 'p-button-rounded': boolean; 'p-button-text': boolean; 'p-button-outlined': boolean; 'p-button-sm': boolean; 'p-button-lg': boolean; 'p-button-plain': boolean; 'p-button-fluid': boolean; }; static ɵfac: i0.ɵɵFactoryDeclaration<Button, never>; static ɵcmp: i0.ɵɵComponentDeclaration<Button, "p-button", never, { "type": { "alias": "type"; "required": false; }; "iconPos": { "alias": "iconPos"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "badge": { "alias": "badge"; "required": false; }; "label": { "alias": "label"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "loadingIcon": { "alias": "loadingIcon"; "required": false; }; "raised": { "alias": "raised"; "required": false; }; "rounded": { "alias": "rounded"; "required": false; }; "text": { "alias": "text"; "required": false; }; "plain": { "alias": "plain"; "required": false; }; "severity": { "alias": "severity"; "required": false; }; "outlined": { "alias": "outlined"; "required": false; }; "link": { "alias": "link"; "required": false; }; "tabindex": { "alias": "tabindex"; "required": false; }; "size": { "alias": "size"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "style": { "alias": "style"; "required": false; }; "styleClass": { "alias": "styleClass"; "required": false; }; "badgeClass": { "alias": "badgeClass"; "required": false; }; "badgeSeverity": { "alias": "badgeSeverity"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "autofocus": { "alias": "autofocus"; "required": false; }; "fluid": { "alias": "fluid"; "required": false; }; "buttonProps": { "alias": "buttonProps"; "required": false; }; }, { "onClick": "onClick"; "onFocus": "onFocus"; "onBlur": "onBlur"; }, ["contentTemplate", "loadingIconTemplate", "iconTemplate", "templates"], ["*"], true, never>; static ngAcceptInputType_disabled: unknown; static ngAcceptInputType_loading: unknown; static ngAcceptInputType_raised: unknown; static ngAcceptInputType_rounded: unknown; static ngAcceptInputType_text: unknown; static ngAcceptInputType_plain: unknown; static ngAcceptInputType_outlined: unknown; static ngAcceptInputType_link: unknown; static ngAcceptInputType_tabindex: unknown; static ngAcceptInputType_autofocus: unknown; static ngAcceptInputType_fluid: unknown; } export declare class ButtonModule { static ɵfac: i0.ɵɵFactoryDeclaration<ButtonModule, never>; static ɵmod: i0.ɵɵNgModuleDeclaration<ButtonModule, never, [typeof i1.CommonModule, typeof ButtonDirective, typeof Button, typeof i2.SharedModule, typeof ButtonLabel, typeof ButtonIcon], [typeof ButtonDirective, typeof Button, typeof ButtonLabel, typeof ButtonIcon, typeof i2.SharedModule]>; static ɵinj: i0.ɵɵInjectorDeclaration<ButtonModule>; } export {};