File

src/lib/pg-components/select/select.component.ts

Description

Example of usage: https://mef.dev/ui_kit_demo/view/controls/select

Implements

OnInit AfterContentInit AfterContentChecked ControlValueAccessor

Metadata

Index

Properties
Methods
Inputs
Outputs
HostListeners
Accessors

Constructor

constructor(_elementRef: ElementRef, _renderer: Renderer2, cDRef: ChangeDetectorRef)
Parameters :
Name Type Optional
_elementRef ElementRef No
_renderer Renderer2 No
cDRef ChangeDetectorRef No

Inputs

AllowClear
Type : boolean
Disabled
Type : boolean
Filter
Type : boolean
Default value : true
FirstDefault
Type : boolean
Default value : false
KeepUnListOptions
Type : boolean
MaxMultiple
Type : any
Default value : Infinity
Mode
Type : string
Multiple
Type : boolean
NotFoundContent
Type : string
Open
Type : boolean
PlaceHolder
Type : string
ShowSearch
Type : boolean
Size
Type : string
Tags
Type : boolean

Outputs

change
Type : EventEmitter<string>
OpenChange
Type : EventEmitter<boolean>
ScrollToBottom
Type : EventEmitter<boolean>
SearchChange
Type : EventEmitter<string>

HostListeners

click
Arguments : '$event'
click(e: MouseEvent)
keydown
Arguments : '$event'
keydown(e: KeyboardEvent)

Methods

_getTriggerRect
_getTriggerRect()
Returns : ClientRect
_setTriggerWidth
_setTriggerWidth()
Returns : void
checkDropDownScroll
checkDropDownScroll()
Returns : void
chooseOption
chooseOption(option: MefDevOptionComponent, isUserClick: boolean, $event?: MouseEvent)

choose option

Parameters :
Name Type Optional Default value
option MefDevOptionComponent No
isUserClick boolean No false
$event MouseEvent Yes
Returns : void
clearAllSelectedOption
clearAllSelectedOption(emitChange: boolean)
Parameters :
Name Type Optional Default value
emitChange boolean No true
Returns : void
clearSearchText
clearSearchText()
Returns : void
clearSelect
clearSelect($event?: MouseEvent)

clear single selected option

Parameters :
Name Type Optional
$event MouseEvent Yes
Returns : void
clickOption
clickOption(option: MefDevOptionComponent, $event?: MouseEvent)

click dropdown option by user

Parameters :
Name Type Optional
option MefDevOptionComponent No
$event MouseEvent Yes
Returns : void
closeDropDown
closeDropDown()
Returns : void
compositionEnd
compositionEnd()
Returns : void
compositionStart
compositionStart()
Returns : void
dropDownScroll
dropDownScroll(ul: HTMLUListElement)
Parameters :
Name Type Optional
ul HTMLUListElement No
Returns : void
emitMultipleOptions
emitMultipleOptions()

emit multiple options

Returns : void
flushComponentState
flushComponentState()
Returns : void
forceUpdateSelectedOption
forceUpdateSelectedOption(value: string | string[])
Parameters :
Name Type Optional
value string | string[] No
Returns : void
handleKeyBackspaceEvent
handleKeyBackspaceEvent(event: KeyboardEvent)
Parameters :
Name Type Optional
event KeyboardEvent No
Returns : void
handleKeyDownEvent
handleKeyDownEvent($event: MouseEvent)
Parameters :
Name Type Optional
$event MouseEvent No
Returns : void
handleKeyEnterEvent
handleKeyEnterEvent(event: KeyboardEvent)
Parameters :
Name Type Optional
event KeyboardEvent No
Returns : void
handleKeyUpEvent
handleKeyUpEvent($event: MouseEvent)
Parameters :
Name Type Optional
$event MouseEvent No
Returns : void
isInSet
isInSet(set: Set<MefDevOptionComponent>, option: MefDevOptionComponent)

determine if option in set

Parameters :
Name Type Optional
set Set<MefDevOptionComponent> No
option MefDevOptionComponent No
nextOption
nextOption(option: MefDevOptionComponent, options: MefDevOptionComponent[])
Parameters :
Name Type Optional
option MefDevOptionComponent No
options MefDevOptionComponent[] No
onClick
onClick(e: MouseEvent)
Decorators :
@HostListener('click', ['$event'])
Parameters :
Name Type Optional
e MouseEvent No
Returns : void
onKeyDown
onKeyDown(e: KeyboardEvent)
Decorators :
@HostListener('keydown', ['$event'])
Parameters :
Name Type Optional
e KeyboardEvent No
Returns : void
onPositionChange
onPositionChange(position: ConnectedOverlayPositionChange)

dropdown position changed

Parameters :
Name Type Optional
position ConnectedOverlayPositionChange No
Returns : void
onSearchChange
onSearchChange(searchValue: string)
Parameters :
Name Type Optional
searchValue string No
Returns : void
preOption
preOption(option: MefDevOptionComponent, options: MefDevOptionComponent[])
Parameters :
Name Type Optional
option MefDevOptionComponent No
options MefDevOptionComponent[] No
registerOnChange
registerOnChange(fn: (value: string | string[]) => void)
Parameters :
Name Type Optional
fn function No
Returns : void
registerOnTouched
registerOnTouched(fn: () => void)
Parameters :
Name Type Optional
fn function No
Returns : void
removeOption
removeOption(option: MefDevOptionComponent)

-option remove or tags remove

Parameters :
Name Type Optional
option MefDevOptionComponent No
Returns : void
scrollToActive
scrollToActive()
Returns : void
selectMultipleOption
selectMultipleOption(option: MefDevOptionComponent, $event?: MouseEvent)

select multiple option

Parameters :
Name Type Optional
option MefDevOptionComponent No
$event MouseEvent Yes
Returns : void
setClassMap
setClassMap()
Returns : void
setDisabledState
setDisabledState(isDisabled: boolean)
Parameters :
Name Type Optional
isDisabled boolean No
Returns : void
setDropDownClassMap
setDropDownClassMap()
Returns : void
updateFilterOption
updateFilterOption(updateActiveFilter: boolean)
Parameters :
Name Type Optional Default value
updateActiveFilter boolean No true
Returns : void
updateSelectedOption
updateSelectedOption(currentModelValue: string | string[], triggerByNgModel: boolean)

update selected option when add remove option etc

Parameters :
Name Type Optional Default value
currentModelValue string | string[] No
triggerByNgModel boolean No false
Returns : void
updateWidth
updateWidth(element: HTMLInputElement, text: string)
Parameters :
Name Type Optional
element HTMLInputElement No
text string No
Returns : void
writeValue
writeValue(value: string | string[])
Parameters :
Name Type Optional
value string | string[] No
Returns : void

Properties

_activeFilterOption
Type : MefDevOptionComponent
_cacheOptions
Type : MefDevOptionComponent[]
Default value : []
_cdkOverlay
Type : CdkConnectedOverlay
Decorators :
@ViewChild(CdkConnectedOverlay)
_classList
Type : string[]
Default value : []
_composing
Default value : false
_dropDownClassMap
Type : any
_dropDownPosition
Type : "top" | "center" | "bottom"
Default value : "bottom"
_dropDownPrefixCls
Default value : `${this._prefixCls}-dropdown`
_el
Type : HTMLElement
_filterOptions
Type : MefDevOptionComponent[]
Default value : []
_isMultiInit
Default value : false
_isOpen
Default value : false
_mode
Type : any
_notFoundContent
Type : string
Default value : "No Content"
_operatingMultipleOption
Type : MefDevOptionComponent
_options
Type : MefDevOptionComponent[]
Default value : []
_placeholder
Type : string
Default value : "placeholder"
_prefixCls
Type : string
Default value : "pg-select"
_searchText
Type : string
Default value : ""
_selectedOption
Type : MefDevOptionComponent
_selectedOptions
Type : Set<MefDevOptionComponent>
Default value : new Set()
_selectionClassMap
Type : any
_selectionPrefixCls
Default value : `${this._prefixCls}-selection`
_size
Type : string
_tagsOptions
Type : MefDevOptionComponent[]
Default value : []
_triggerWidth
Type : number
Default value : 0
_value
Type : string[] | string
addOption
Default value : () => {...}

new -option insert or new tags insert

dropdownUl
Type : ElementRef
Decorators :
@ViewChild('dropdownUl')
onChange
Type : function
Default value : () => {...}
onTouched
Type : function
Default value : () => {...}
searchInputElementRef
Type : any
Decorators :
@ViewChild('searchInput')
trigger
Type : ElementRef
Decorators :
@ViewChild('trigger')
unSelectMultipleOption
Default value : () => {...}

cancel select multiple option

Accessors

AllowClear
getAllowClear()
setAllowClear(value: boolean)
Parameters :
Name Type Optional
value boolean No
Returns : void
KeepUnListOptions
getKeepUnListOptions()
setKeepUnListOptions(value: boolean)
Parameters :
Name Type Optional
value boolean No
Returns : void
Mode
setMode(value: string)
Parameters :
Name Type Optional
value string No
Returns : void
Multiple
getMultiple()
setMultiple(value: boolean)
Parameters :
Name Type Optional
value boolean No
Returns : void
PlaceHolder
getPlaceHolder()
setPlaceHolder(value: string)
Parameters :
Name Type Optional
value string No
Returns : void
NotFoundContent
getNotFoundContent()
setNotFoundContent(value: string)
Parameters :
Name Type Optional
value string No
Returns : void
Size
getSize()
setSize(value: string)
Parameters :
Name Type Optional
value string No
Returns : void
ShowSearch
getShowSearch()
setShowSearch(value: boolean)
Parameters :
Name Type Optional
value boolean No
Returns : void
Tags
getTags()
setTags(value: boolean)
Parameters :
Name Type Optional
value boolean No
Returns : void
Disabled
getDisabled()
setDisabled(value: boolean)
Parameters :
Name Type Optional
value boolean No
Returns : void
Open
getOpen()
setOpen(value: boolean)
Parameters :
Name Type Optional
value boolean No
Returns : void
Value
getValue()
setValue(value: string | string[])
Parameters :
Name Type Optional
value string | string[] No
Returns : void

results matching ""

    No results matching ""