@nova-ui/bits
Version:
SolarWinds Nova Framework
105 lines (104 loc) • 4.4 kB
TypeScript
import { EventEmitter, OnChanges, OnInit, SimpleChanges, TemplateRef } from "@angular/core";
import { ControlValueAccessor } from "@angular/forms";
import { ISelectChangedEvent, ISelectGroup } from "./public-api";
import { UtilService } from "../../services/util.service";
import { NuiFormFieldControl } from "../form-field/public-api";
import * as i0 from "@angular/core";
/**
* @deprecated in v11 - Use BaseSelectV2 instead - Removal: NUI-5796
*/
export declare abstract class BaseSelect implements OnInit, OnChanges, ControlValueAccessor, NuiFormFieldControl {
protected utilService: UtilService;
/**
* The option to disable the select.
*/
isDisabled: boolean;
/**
* The option to make select inline.
*/
inline: boolean;
/**
* The option to fill width of a container.
*/
justified: boolean;
/**
* Array of values that are bound to the repeat of dropdown items. If you want to have grouped data you need to pass
* data as ISelectGroup[].
*/
itemsSource: any[] | ISelectGroup[];
/**
* Receives item that will be selected before user starts to communicate with select component
*/
value: any;
/**
* The icon to be rendered.
*/
icon: string;
/**
* Template for formatting selected item on the dropdown button. Used only with nui-select.
*/
displayFormat: string;
/**
* Name of the item property that will be shown in the dropdown menu.
*/
displayValue: string;
/**
* Name of the item property that will be used as the model.
*/
modelValue: string;
/**
* Value used as a placeholder for the select.
*/
placeholder: string;
/**
* Needed to provide own template for every item in select you need to link `customTemplate` input with `TemplateRef`
* that represents custom template
*/
customTemplate: TemplateRef<string>;
/**
* Input to apply error state styles
*/
isInErrorState: boolean;
/**
* Input to set aria label text
*/
ariaLabel: string;
/**
* Value for enabling remove value feature
*/
isRemoveValueEnabled: boolean;
/**
*
* Change event. To subscribe to it you should pass a function, argument of which is ISelectChangeEvent object.
*/
changed: EventEmitter<ISelectChangedEvent<any>>;
valueChange: import("rxjs").Observable<any>;
name: string;
selectedItem: any;
displayValueFn: (params: {
item: any;
}) => string;
itemToSelect: any;
inputValue: string;
protected constructor(utilService: UtilService);
ngOnInit(): void;
ngOnChanges(changes: SimpleChanges): void;
abstract displayPlaceholder(): boolean;
abstract handleBlur(event: any): void;
getItemDisplay(item: any): any;
getDisplayValueFormatted(item: any): string;
getIconColor(): string;
isItemSelected(item: any): boolean;
getSelectedItem(): any;
select(item: any): void;
getItemModel(item: any): any;
onChange(value: any): void;
onTouched(): void;
writeValue(value: any): void;
registerOnChange(fn: () => void): void;
registerOnTouched(fn: () => void): void;
changeValue(value: any): void;
setDisabledState(isDisabled: boolean): void;
static ɵfac: i0.ɵɵFactoryDeclaration<BaseSelect, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseSelect, never, never, { "isDisabled": { "alias": "isDisabled"; "required": false; }; "inline": { "alias": "inline"; "required": false; }; "justified": { "alias": "justified"; "required": false; }; "itemsSource": { "alias": "itemsSource"; "required": false; }; "value": { "alias": "value"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "displayFormat": { "alias": "displayFormat"; "required": false; }; "displayValue": { "alias": "displayValue"; "required": false; }; "modelValue": { "alias": "modelValue"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "customTemplate": { "alias": "customTemplate"; "required": false; }; "isInErrorState": { "alias": "isInErrorState"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "isRemoveValueEnabled": { "alias": "isRemoveValueEnabled"; "required": false; }; }, { "changed": "changed"; "valueChange": "valueChange"; }, never, never, false, never>;
}