primeng
Version:
PrimeNG is a premium UI library for Angular featuring a rich set of 90+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeBlock,
184 lines (180 loc) • 7.9 kB
TypeScript
import { SelectButtonPassThrough, SelectButtonOptionClickEvent, SelectButtonChangeEvent, SelectButtonItemTemplateContext } from 'primeng/types/selectbutton';
export * from 'primeng/types/selectbutton';
import * as _angular_core from '@angular/core';
import { Provider, TemplateRef } from '@angular/core';
import { BaseEditableHolder } from 'primeng/baseeditableholder';
import * as i1 from 'primeng/bind';
import { Bind } from 'primeng/bind';
import { InputSize } from 'primeng/types/shared';
import { ToggleButtonChangeEvent } from 'primeng/types/togglebutton';
import { BaseStyle } from 'primeng/base';
import * as i2 from 'primeng/api';
/**
*
* SelectButton is used to choose single or multiple items from a list using buttons.
*
* [Live Demo](https://www.primeng.org/selectbutton/)
*
* @module selectbuttonstyle
*
*/
declare enum SelectButtonClasses {
/**
* Class name of the root element
*/
root = "p-selectbutton"
}
declare class SelectButtonStyle extends BaseStyle {
name: string;
style: string;
classes: {
root: ({ instance }: {
instance: any;
}) => (string | {
'p-invalid': any;
'p-selectbutton-fluid': any;
})[];
};
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SelectButtonStyle, never>;
static ɵprov: _angular_core.ɵɵInjectableDeclaration<SelectButtonStyle>;
}
interface SelectButtonStyle extends BaseStyle {
}
declare const SELECTBUTTON_VALUE_ACCESSOR: Provider;
/**
* SelectButton is used to choose single or multiple items from a list using buttons.
* @group Components
*/
declare class SelectButton extends BaseEditableHolder<SelectButtonPassThrough> {
componentName: string;
/**
* An array of selectitems to display as the available options.
* @group Props
*/
options: _angular_core.InputSignal<any[] | undefined>;
/**
* Name of the label field of an option.
* @group Props
*/
optionLabel: _angular_core.InputSignal<string | undefined>;
/**
* Name of the value field of an option.
* @group Props
*/
optionValue: _angular_core.InputSignal<string | undefined>;
/**
* Name of the disabled field of an option.
* @group Props
*/
optionDisabled: _angular_core.InputSignal<string | undefined>;
/**
* Whether selection can be cleared.
* @group Props
*/
unselectable: _angular_core.InputSignalWithTransform<boolean, unknown>;
/**
* Index of the element in tabbing order.
* @group Props
*/
tabindex: _angular_core.InputSignalWithTransform<number, unknown>;
/**
* When specified, allows selecting multiple values.
* @group Props
*/
multiple: _angular_core.InputSignalWithTransform<boolean, unknown>;
/**
* Whether selection can not be cleared.
* @group Props
*/
allowEmpty: _angular_core.InputSignalWithTransform<boolean, unknown>;
/**
* Style class of the component.
* @group Props
*/
styleClass: _angular_core.InputSignal<string | undefined>;
/**
* Establishes relationships between the component and label(s) where its value should be one or more element IDs.
* @group Props
*/
ariaLabelledBy: _angular_core.InputSignal<string | undefined>;
/**
* A property to uniquely identify a value in options.
* @group Props
*/
dataKey: _angular_core.InputSignal<string | undefined>;
/**
* When present, it specifies that the component should automatically get focus on load.
* @group Props
*/
autofocus: _angular_core.InputSignalWithTransform<boolean, unknown>;
/**
* Specifies the size of the component.
* @defaultValue undefined
* @group Props
*/
size: _angular_core.InputSignal<InputSize | undefined>;
/**
* Spans 100% width of the container when enabled.
* @defaultValue undefined
* @group Props
*/
fluid: _angular_core.InputSignalWithTransform<boolean, unknown>;
/**
* Callback to invoke on input click.
* @param {SelectButtonOptionClickEvent} event - Custom click event.
* @group Emits
*/
onOptionClick: _angular_core.OutputEmitterRef<SelectButtonOptionClickEvent>;
/**
* Callback to invoke on selection change.
* @param {SelectButtonChangeEvent} event - Custom change event.
* @group Emits
*/
onChange: _angular_core.OutputEmitterRef<SelectButtonChangeEvent>;
/**
* Custom item template.
* @param {SelectButtonItemTemplateContext} context - item context.
* @see {@link SelectButtonItemTemplateContext}
* @group Templates
*/
itemTemplate: _angular_core.Signal<TemplateRef<SelectButtonItemTemplateContext> | undefined>;
equalityKey: _angular_core.Signal<string | null | undefined>;
$allowEmpty: _angular_core.Signal<boolean>;
dataP: _angular_core.Signal<string>;
value: _angular_core.WritableSignal<any>;
focusedIndex: _angular_core.WritableSignal<number>;
_componentStyle: SelectButtonStyle;
$pcSelectButton: SelectButton | undefined;
bindDirectiveInstance: Bind;
onAfterViewChecked(): void;
getAllowEmpty(): boolean;
getOptionLabel(option: any): any;
getOptionValue(option: any): any;
isOptionDisabled(option: any): any;
isButtonDisabled(option: any): any;
getItemContext(option: any, index: number): {
$implicit: any;
index: number;
};
onOptionSelect(event: ToggleButtonChangeEvent, option: any, index: number): void;
changeTabIndexes(event: Event, direction: string): void;
onFocus(event: Event, index: number): void;
onBlur(): void;
removeOption(option: any): void;
isSelected(option: any): boolean;
/**
* @override
*
* @see {@link BaseEditableHolder.writeControlValue}
* Writes the value to the control.
*/
writeControlValue(value: any, setModelValue: (value: any) => void): void;
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SelectButton, never>;
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SelectButton, "p-selectbutton, p-select-button", never, { "options": { "alias": "options"; "required": false; "isSignal": true; }; "optionLabel": { "alias": "optionLabel"; "required": false; "isSignal": true; }; "optionValue": { "alias": "optionValue"; "required": false; "isSignal": true; }; "optionDisabled": { "alias": "optionDisabled"; "required": false; "isSignal": true; }; "unselectable": { "alias": "unselectable"; "required": false; "isSignal": true; }; "tabindex": { "alias": "tabindex"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "allowEmpty": { "alias": "allowEmpty"; "required": false; "isSignal": true; }; "styleClass": { "alias": "styleClass"; "required": false; "isSignal": true; }; "ariaLabelledBy": { "alias": "ariaLabelledBy"; "required": false; "isSignal": true; }; "dataKey": { "alias": "dataKey"; "required": false; "isSignal": true; }; "autofocus": { "alias": "autofocus"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "fluid": { "alias": "fluid"; "required": false; "isSignal": true; }; }, { "onOptionClick": "onOptionClick"; "onChange": "onChange"; }, ["itemTemplate"], never, true, [{ directive: typeof i1.Bind; inputs: {}; outputs: {}; }]>;
}
declare class SelectButtonModule {
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SelectButtonModule, never>;
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<SelectButtonModule, never, [typeof SelectButton, typeof i2.SharedModule], [typeof SelectButton, typeof i2.SharedModule]>;
static ɵinj: _angular_core.ɵɵInjectorDeclaration<SelectButtonModule>;
}
export { SELECTBUTTON_VALUE_ACCESSOR, SelectButton, SelectButtonClasses, SelectButtonModule, SelectButtonStyle };