UNPKG

md2

Version:

Angular2 based Material Design components, directives and services are Accordion, Autocomplete, Chips(Tags), Collapse, Colorpicker, Data Table, Datepicker, Dialog(Modal), Menu, Multiselect, Select, Tabs, Tags(Chips), Toast and Tooltip.

79 lines (78 loc) 3.04 kB
import { ElementRef, EventEmitter } from '@angular/core'; import { Md2Optgroup } from './optgroup'; /** Event object emitted by MdOption when selected or deselected. */ export declare class Md2OptionSelectionChange { source: Md2Option; isUserInput: boolean; constructor(source: Md2Option, isUserInput?: boolean); } /** * Single option inside of a `<md2-select>` element. */ export declare class Md2Option { readonly group: Md2Optgroup; private _element; private _selected; private _active; /** Whether the option is disabled. */ private _disabled; private _id; /** Whether the wrapping component is in multiple selection mode. */ multiple: boolean; /** The unique ID of the option. */ readonly id: string; /** Whether or not the option is currently selected. */ readonly selected: boolean; /** The form value of the option. */ value: any; /** Whether the option is disabled. */ disabled: any; /** Event emitted when the option is selected or deselected. */ onSelectionChange: EventEmitter<Md2OptionSelectionChange>; constructor(group: Md2Optgroup, _element: ElementRef); /** * Whether or not the option is currently active and ready to be selected. * An active option displays styles as if it is focused, but the * focus is actually retained somewhere else. This comes in handy * for components like autocomplete where focus must remain on the input. */ readonly active: boolean; /** * The displayed value of the option. It is necessary to show the selected option in the * select's trigger. */ readonly viewValue: string; /** Selects the option. */ select(): void; /** Deselects the option. */ deselect(): void; /** Sets focus onto this option. */ focus(): void; /** * This method sets display styles on the option to make it appear * active. This is used by the ActiveDescendantKeyManager so key * events will display the proper options as active on arrow key events. */ setActiveStyles(): void; /** * This method removes display styles on the option that made it appear * active. This is used by the ActiveDescendantKeyManager so key * events will display the proper options as active on arrow key events. */ setInactiveStyles(): void; /** Ensures the option is selected when activated from the keyboard. */ _handleKeydown(event: KeyboardEvent): void; /** * Selects the option while indicating the selection came from the user. Used to * determine if the select's view -> model callback should be invoked. */ _selectViaInteraction(): void; /** Returns the correct tabindex for the option depending on disabled state. */ _getTabIndex(): string; /** Fetches the host DOM element. */ _getHostElement(): HTMLElement; /** Emits the selection change event. */ private _emitSelectionChangeEvent(isUserInput?); } export declare class Md2OptionModule { }