core/select/select.component.ts
AfterContentInit
OnChanges
OnDestroy
AfterViewInit
ControlValueAccessor
Validator
host | { |
providers |
{
provide: NG_VALUE_ACCESSOR, multi: true, useExisting: forwardRef(() => SelectComponent)
}
{
provide: NG_VALIDATORS, useExisting: forwardRef(() => SelectComponent), multi: true
}
SelectKeyboardService
|
selector | c8y-select |
templateUrl | ./select.component.html |
Properties |
Methods |
Inputs |
Outputs |
Accessors |
autoClose |
Type : boolean
|
Default value : true
|
Defines, if the dropdown should close automatically after user interaction. |
canDeselect |
Type : boolean
|
Default value : false
|
Allows the user to deselect an item. |
canSelectWithSpace |
Type : boolean
|
Default value : !this.multi
|
If enabled, an item can be selected with the space key. |
container |
Type : string | "body"
|
Default value : 'body'
|
The container to put the dropdown to. Defaults to body. |
disabled |
Type : boolean
|
Default value : false
|
If set to true, the select is disabled. |
icon |
Type : string
|
Default value : 'caret-down'
|
The icon to be displayed in the select. |
insideClick |
Type : boolean
|
Defines if the dropdown should stay open when the user clicks inside the select. If set to true, the dropdown will only close when the user clicks outside the select. |
items |
Type : [] | [] | []
|
Items to be displayed in the select.
Can be an array of strings or an array of objects with Example : Example : Example : |
multi |
Type : boolean
|
Default value : false
|
If set to true, the user can select multiple items. |
name |
Type : string
|
Default value : 'select'
|
The name used for this select. |
placeholder |
Type : string
|
Default value : 'Select item…'
|
Placeholder text to be displayed in the select. |
required |
Type : boolean
|
Default value : false
|
Marks the select as required. |
selected |
Type : string | SelectableItem | Array
|
The selected item. |
onDeselect |
Type : EventEmitter
|
Emits if a item was deselected. |
onIconClick |
Type : EventEmitter
|
Emits when the select icon is clicked. |
onSelect |
Type : EventEmitter
|
Emits if a item is selected. |
close |
close()
|
Closes the dropdown.
Returns :
void
|
deselect | ||||||||
deselect(item: SelectableItem)
|
||||||||
Deselects an item.
Parameters :
Returns :
void
|
deselectAll |
deselectAll()
|
Deselects all items
Returns :
void
|
open |
open()
|
Opens the dropdown.
Returns :
void
|
select | ||||||||
select(item: SelectableItem)
|
||||||||
Selects an item
Parameters :
Returns :
void
|
searchHasFocus |
Default value : false
|
Indicates if the search input has focus. |
items | ||||||
getitems()
|
||||||
The items to be displayed in the select.
Returns :
SelectableItemTemplate[]
|
||||||
setitems(value: string[] | SelectableItem[] | SelectableItemTemplate[])
|
||||||
Items to be displayed in the select.
Can be an array of strings or an array of objects with Example : Example : Example :
Parameters :
Example :
Returns :
void
|
selected | ||||||
getselected()
|
||||||
Returns the selected item.
Returns :
SelectableItem[]
|
||||||
setselected(value: string | SelectableItem | Array<string | SelectableItem>)
|
||||||
The selected item.
Parameters :
Returns :
void
|
preselectedItem |
getpreselectedItem()
|
A item which is preselected. It is used when a user types in the search input to give a visual typeahead feedback.
Returns :
SelectableItem
|