Class: AutocompleteMultiComponent<T>
autocomplete.AutocompleteMultiComponent
AutocompleteMultiComponent allows user to pass a set of options and select multiple ones
along with other inputs, the optionsProvider determines the set of options passed to the autocomplete list
component is connected to a model, and every change on selection, should reflect on model value.
Component has 2 modes, classic and urban, which determine it's appearance appearance config should be passed in app.module
Type parameters​
| Name |
|---|
T |
Hierarchy​
ControlComponent<T[]>↳
AutocompleteMultiComponent
Implements​
HasOptionsProvider<T>OnInit
Properties​
_model​
• Protected _model: T[]
Inherited from​
ControlComponent._model
Defined in​
libs/ng-core/src/lib/components/control.component.ts:63
_options​
• Private _options: SelectOption<T>[] = []
Defined in​
libs/legi-shared/autocomplete/autocomplete-multi/autocomplete-multi.component.ts:125
_optionsProvider​
• Private _optionsProvider: SelectOptionsProvider<T>
Defined in​
libs/legi-shared/autocomplete/autocomplete-multi/autocomplete-multi.component.ts:127
btnLabel​
• Optional btnLabel: string
Defined in​
libs/legi-shared/autocomplete/autocomplete-multi/autocomplete-multi.component.ts:52
cdr​
• Protected cdr: ChangeDetectorRef
Inherited from​
ControlComponent.cdr
controlChanged​
• Protected controlChanged: Subject<void>
Inherited from​
ControlComponent.controlChanged
Defined in​
libs/ng-core/src/lib/components/control.component.ts:61
controlContainer​
• Protected Optional controlContainer: ControlContainer
Inherited from​
ControlComponent.controlContainer
defaultValue​
• Optional defaultValue: T[]
Inherited from​
ControlComponent.defaultValue
Defined in​
libs/ng-core/src/lib/components/control.component.ts:59
disabled​
• disabled: boolean = false
Inherited from​
ControlComponent.disabled
Defined in​
libs/ng-core/src/lib/components/control.component.ts:53
displayFn​
• displayFn: (value?: T) => Nil<string>
Type declaration​
â–¸ (value?): Nil<string>
Linked to displayWith property of mat-autocomplete
Parameters​
| Name | Type | Description |
|---|---|---|
value? | T | The displayFn searches for option inside list of options. when option matching the value is found, displayFn translates the label of the option found, considering that label is an instance of @typedef SelectOptionLabel |
Returns​
Nil<string>
Defined in​
libs/legi-shared/autocomplete/autocomplete-multi/autocomplete-multi.component.ts:157
embeddedControl​
• Optional embeddedControl: AbstractControl
Inherited from​
ControlComponent.embeddedControl
Defined in​
libs/ng-core/src/lib/components/control.component.ts:55
hint​
• Optional hint: string
Defined in​
libs/legi-shared/autocomplete/autocomplete-multi/autocomplete-multi.component.ts:88
label​
• Optional label: string
Defined in​
libs/legi-shared/autocomplete/autocomplete-multi/autocomplete-multi.component.ts:50
lang​
• Optional lang: string
Defined in​
libs/legi-shared/autocomplete/autocomplete-multi/autocomplete-multi.component.ts:54
logger​
• Protected logger: Logger
Inherited from​
ControlComponent.logger
maxOptionsSize​
• maxOptionsSize: number = 15
Defined in​
libs/legi-shared/autocomplete/autocomplete-multi/autocomplete-multi.component.ts:81
modelAsOptions​
• modelAsOptions: SelectOption<T>[] = []
Defined in​
libs/legi-shared/autocomplete/autocomplete-multi/autocomplete-multi.component.ts:116
modelChanged$​
• modelChanged$: Subject<T[]>
Defined in​
libs/legi-shared/autocomplete/autocomplete-multi/autocomplete-multi.component.ts:100
multiInput​
• multiInput: ElementRef<HTMLInputElement>
Defined in​
libs/legi-shared/autocomplete/autocomplete-multi/autocomplete-multi.component.ts:93
name​
• Optional name: string
Inherited from​
ControlComponent.name
Defined in​
libs/ng-core/src/lib/components/control.component.ts:23
newModel​
• newModel: undefined | T[]
Defined in​
libs/legi-shared/autocomplete/autocomplete-multi/autocomplete-multi.component.ts:114
onDestroy$​
• onDestroy$: Observable<void>
Inherited from​
ControlComponent.onDestroy$
Defined in​
libs/ng-core/src/lib/mixins/on-destroy.mixin.ts:9
onModelChange​
• Protected onModelChange: Function
Inherited from​
ControlComponent.onModelChange
Defined in​
libs/ng-core/src/lib/components/control.component.ts:129
onModelTouched​
• Protected onModelTouched: Function
Inherited from​
ControlComponent.onModelTouched
Defined in​
libs/ng-core/src/lib/components/control.component.ts:131
panelWidth​
• Optional panelWidth: string | number
Defined in​
libs/legi-shared/autocomplete/autocomplete-multi/autocomplete-multi.component.ts:86
placeholder​
• Optional placeholder: string
Defined in​
libs/legi-shared/autocomplete/autocomplete-multi/autocomplete-multi.component.ts:48
queryChanges​
• queryChanges: Subject<string>
Defined in​
libs/legi-shared/autocomplete/autocomplete-multi/autocomplete-multi.component.ts:98
removeDisabledOptions​
• removeDisabledOptions: boolean = true
Defined in​
libs/legi-shared/autocomplete/autocomplete-multi/autocomplete-multi.component.ts:90
required​
• Optional required: boolean
Inherited from​
ControlComponent.required
Defined in​
libs/ng-core/src/lib/components/control.component.ts:20
sortType​
• Optional sortType: SelectOptionSortType
Defined in​
libs/legi-shared/autocomplete/autocomplete-multi/autocomplete-multi.component.ts:84
storedValueOptions​
• Private storedValueOptions: SelectOption<T>[] = []
Defined in​
libs/legi-shared/autocomplete/autocomplete-multi/autocomplete-multi.component.ts:126
subSink​
• subSink: Subscription
Inherited from​
ControlComponent.subSink
Defined in​
libs/ng-core/src/lib/mixins/on-destroy.mixin.ts:10
template​
• template: TemplateRef<unknown>
Defined in​
libs/legi-shared/autocomplete/autocomplete-multi/autocomplete-multi.component.ts:96
valueChanges​
• Optional valueChanges: Observable<any>
Inherited from​
ControlComponent.valueChanges
Defined in​
libs/ng-core/src/lib/components/control.component.ts:57
arguments​
â–ª Static arguments: any
Inherited from​
ControlComponent.arguments
Defined in​
apps/docs/node_modules/typescript/lib/lib.es5.d.ts:302
caller​
â–ª Static caller: Function
Inherited from​
ControlComponent.caller
Defined in​
apps/docs/node_modules/typescript/lib/lib.es5.d.ts:303
length​
â–ª Static Readonly length: number
Inherited from​
ControlComponent.length
Defined in​
apps/docs/node_modules/typescript/lib/lib.es5.d.ts:299
name​
â–ª Static Readonly name: string
Returns the name of the function. Function names are read-only and can not be changed.
Inherited from​
ControlComponent.name
Defined in​
apps/docs/node_modules/typescript/lib/lib.es2015.core.d.ts:97
Accessors​
formControl​
• get formControl(): Maybe<AbstractControl>
Returns​
Maybe<AbstractControl>
Inherited from​
ControlComponent.formControl
Defined in​
libs/ng-core/src/lib/components/control.component.ts:36
• set formControl(value): void
Parameters​
| Name | Type |
|---|---|
value | Maybe<AbstractControl> |
Returns​
void
Inherited from​
ControlComponent.formControl
Defined in​
libs/ng-core/src/lib/components/control.component.ts:40
formControlName​
• get formControlName(): Maybe<string>
Returns​
Maybe<string>
Inherited from​
ControlComponent.formControlName
Defined in​
libs/ng-core/src/lib/components/control.component.ts:26
• set formControlName(value): void
Parameters​
| Name | Type |
|---|---|
value | Maybe<string> |
Returns​
void
Inherited from​
ControlComponent.formControlName
Defined in​
libs/ng-core/src/lib/components/control.component.ts:30
model​
• set model(val): void
Parameters​
| Name | Type |
|---|---|
val | T[] |
Returns​
void
Overrides​
ControlComponent.model
Defined in​
libs/legi-shared/autocomplete/autocomplete-multi/autocomplete-multi.component.ts:102
options​
• set options(value): void
Parameters​
| Name | Type |
|---|---|
value | SelectOption<T>[] |
Returns​
void
Defined in​
libs/legi-shared/autocomplete/autocomplete-multi/autocomplete-multi.component.ts:56
optionsProvider​
• set optionsProvider(value): void
Parameters​
| Name | Type |
|---|---|
value | SelectOptionsProvider<T> |
Returns​
void
Implementation of​
HasOptionsProvider.optionsProvider
Defined in​
libs/legi-shared/autocomplete/autocomplete-multi/autocomplete-multi.component.ts:68
Methods​
addSelectedValue​
â–¸ addSelectedValue(): void
addSelectedValue resets value of input,
this behavior is only necessary in classic mode
Returns​
void
Defined in​
libs/legi-shared/autocomplete/autocomplete-multi/autocomplete-multi.component.ts:198
embeddedValueToValue​
â–¸ Protected embeddedValueToValue(value): T[]
Parameters​
| Name | Type |
|---|---|
value | T[] |
Returns​
T[]
Inherited from​
ControlComponent.embeddedValueToValue
Defined in​
libs/ng-core/src/lib/components/control.component.ts:123
emptySink​
â–¸ emptySink(): void
Returns​
void
Inherited from​
ControlComponent.emptySink
Defined in​
libs/ng-core/src/lib/mixins/on-destroy.mixin.ts:13
firstUntilDestroyed​
â–¸ firstUntilDestroyed<T>(): MonoTypeOperatorFunction<T>
Type parameters​
| Name |
|---|
T |
Returns​
MonoTypeOperatorFunction<T>
Inherited from​
ControlComponent.firstUntilDestroyed
Defined in​
libs/ng-core/src/lib/mixins/on-destroy.mixin.ts:12
getContext​
â–¸ getContext(option): Object
getContext provides option context for ng-template
adding more flexibility for customizing chip template of selected options
Parameters​
| Name | Type |
|---|---|
option | SelectOption<T> |
Returns​
Object
| Name | Type |
|---|---|
$implicit | SelectOption<T> |
option | SelectOption<T> |
Defined in​
libs/legi-shared/autocomplete/autocomplete-multi/autocomplete-multi.component.ts:216
getSelectOption​
â–¸ Private getSelectOption(value): Promise<undefined | SelectOption<T>>
getSelectOption returns option object with a matching value
Parameters​
| Name | Type |
|---|---|
value | T |
Returns​
Promise<undefined | SelectOption<T>>
Defined in​
libs/legi-shared/autocomplete/autocomplete-multi/autocomplete-multi.component.ts:261
initModelChange​
â–¸ Private initModelChange(): void
initModelChange updates model value with selected options
Returns​
void
Defined in​
libs/legi-shared/autocomplete/autocomplete-multi/autocomplete-multi.component.ts:271
ngOnDestroy​
â–¸ ngOnDestroy(): void
A callback method that performs custom clean-up, invoked immediately before a directive, pipe, or service instance is destroyed.
Returns​
void
Inherited from​
ControlComponent.ngOnDestroy
Defined in​
node_modules/@angular/core/core.d.ts:5167
onOptionSelected​
â–¸ onOptionSelected(event): void
onOptionSelected adds the selected option value to the list of current
model selected values
Parameters​
| Name | Type |
|---|---|
event | MatAutocompleteSelectedEvent |
Returns​
void
Defined in​
libs/legi-shared/autocomplete/autocomplete-multi/autocomplete-multi.component.ts:184
registerOnChange​
â–¸ registerOnChange(fn): void
Parameters​
| Name | Type |
|---|---|
fn | Function |
Returns​
void
Inherited from​
ControlComponent.registerOnChange
Defined in​
libs/ng-core/src/lib/components/control.component.ts:96
registerOnTouched​
â–¸ registerOnTouched(fn): void
Parameters​
| Name | Type |
|---|---|
fn | Function |
Returns​
void
Inherited from​
ControlComponent.registerOnTouched
Defined in​
libs/ng-core/src/lib/components/control.component.ts:100
removeValue​
â–¸ removeValue(value): void
removeValue will filter the value of the current model list of selected values
Parameters​
| Name | Type |
|---|---|
value | SelectOption<T> |
Returns​
void
Defined in​
libs/legi-shared/autocomplete/autocomplete-multi/autocomplete-multi.component.ts:174
setModelAndEmit​
â–¸ setModelAndEmit(value): void
Parameters​
| Name | Type |
|---|---|
value | T[] |
Returns​
void
Inherited from​
ControlComponent.setModelAndEmit
Defined in​
libs/ng-core/src/lib/components/control.component.ts:112
storeValueOption​
â–¸ Private storeValueOption(value): Promise<undefined | SelectOption<T>>
storeValueOption stores an option in storedValueOptions
Parameters​
| Name | Type |
|---|---|
value | T |
Returns​
Promise<undefined | SelectOption<T>>
Defined in​
libs/legi-shared/autocomplete/autocomplete-multi/autocomplete-multi.component.ts:248
untilDestroyed​
â–¸ untilDestroyed<T>(): MonoTypeOperatorFunction<T>
Type parameters​
| Name |
|---|
T |
Returns​
MonoTypeOperatorFunction<T>
Inherited from​
ControlComponent.untilDestroyed
Defined in​
libs/ng-core/src/lib/mixins/on-destroy.mixin.ts:11
useOptionsProvider​
â–¸ Private useOptionsProvider(): void
useOptionsProvider updates the list of options based on user query changes,
filtering disabled options, and returning all the matched options (or a
slice of options list with a predefined maxOptionsSize)
Returns​
void
Defined in​
libs/legi-shared/autocomplete/autocomplete-multi/autocomplete-multi.component.ts:225
valueToEmbeddedValue​
â–¸ Protected valueToEmbeddedValue(value): T[]
Parameters​
| Name | Type |
|---|---|
value | T[] |
Returns​
T[]
Inherited from​
ControlComponent.valueToEmbeddedValue
Defined in​
libs/ng-core/src/lib/components/control.component.ts:119
writeValue​
â–¸ writeValue(value): void
Parameters​
| Name | Type |
|---|---|
value | T[] |
Returns​
void
Inherited from​
ControlComponent.writeValue
Defined in​
libs/ng-core/src/lib/components/control.component.ts:85
[hasInstance]​
â–¸ Static [hasInstance](value): boolean
Determines whether the given value inherits from this function if this function was used as a constructor function.
A constructor function can control which objects are recognized as its instances by 'instanceof' by overriding this method.
Parameters​
| Name | Type |
|---|---|
value | any |
Returns​
boolean
Inherited from​
ControlComponent.__@hasInstance@35749
Defined in​
apps/docs/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:162
apply​
â–¸ Static apply<T>(thisArg): void
Calls the function with the specified object as the this value and the elements of specified array as the arguments.
Type parameters​
| Name |
|---|
T |
Parameters​
| Name | Type | Description |
|---|---|---|
thisArg | T | The object to be used as the this object. |
Returns​
void
Inherited from​
ControlComponent.apply
Defined in​
apps/docs/node_modules/typescript/lib/lib.es5.d.ts:364
â–¸ Static apply<T, A>(thisArg, args): void
Type parameters​
| Name | Type |
|---|---|
T | T |
A | extends any[] |
Parameters​
| Name | Type |
|---|---|
thisArg | T |
args | A |
Returns​
void
Inherited from​
ControlComponent.apply
Defined in​
apps/docs/node_modules/typescript/lib/lib.es5.d.ts:365
â–¸ Static apply(thisArg, argArray?): any
Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function.
Parameters​
| Name | Type | Description |
|---|---|---|
thisArg | any | The object to be used as the this object. |
argArray? | any | A set of arguments to be passed to the function. |
Returns​
any
Inherited from​
ControlComponent.apply
Defined in​
apps/docs/node_modules/typescript/lib/lib.es5.d.ts:278
bind​
â–¸ Static bind<T>(thisArg): T
For a given function, creates a bound function that has the same body as the original function. The this object of the bound function is associated with the specified object, and has the specified initial parameters.
Type parameters​
| Name |
|---|
T |
Parameters​
| Name | Type | Description |
|---|---|---|
thisArg | any | The object to be used as the this object. |
Returns​
T
Inherited from​
ControlComponent.bind
Defined in​
apps/docs/node_modules/typescript/lib/lib.es5.d.ts:380
â–¸ Static bind<A0, A, R>(thisArg, arg0): (...args: A) => R
Type parameters​
| Name | Type |
|---|---|
A0 | A0 |
A | extends any[] |
R | R |
Parameters​
| Name | Type |
|---|---|
thisArg | any |
arg0 | A0 |
Returns​
fn
• new bind(...args)
Parameters​
| Name | Type |
|---|---|
...args | A |
Inherited from​
ControlComponent.bind
Defined in​
apps/docs/node_modules/typescript/lib/lib.es5.d.ts:381
â–¸ Static bind<A0, A1, A, R>(thisArg, arg0, arg1): (...args: A) => R
Type parameters​
| Name | Type |
|---|---|
A0 | A0 |
A1 | A1 |
A | extends any[] |
R | R |
Parameters​
| Name | Type |
|---|---|
thisArg | any |
arg0 | A0 |
arg1 | A1 |
Returns​
fn
• new bind(...args)
Parameters​
| Name | Type |
|---|---|
...args | A |
Inherited from​
ControlComponent.bind
Defined in​
apps/docs/node_modules/typescript/lib/lib.es5.d.ts:382
â–¸ Static bind<A0, A1, A2, A, R>(thisArg, arg0, arg1, arg2): (...args: A) => R
Type parameters​
| Name | Type |
|---|---|
A0 | A0 |
A1 | A1 |
A2 | A2 |
A | extends any[] |
R | R |
Parameters​
| Name | Type |
|---|---|
thisArg | any |
arg0 | A0 |
arg1 | A1 |
arg2 | A2 |
Returns​
fn
• new bind(...args)
Parameters​
| Name | Type |
|---|---|
...args | A |
Inherited from​
ControlComponent.bind
Defined in​
apps/docs/node_modules/typescript/lib/lib.es5.d.ts:383
â–¸ Static bind<A0, A1, A2, A3, A, R>(thisArg, arg0, arg1, arg2, arg3): (...args: A) => R
Type parameters​
| Name | Type |
|---|---|
A0 | A0 |
A1 | A1 |
A2 | A2 |
A3 | A3 |
A | extends any[] |
R | R |
Parameters​
| Name | Type |
|---|---|
thisArg | any |
arg0 | A0 |
arg1 | A1 |
arg2 | A2 |
arg3 | A3 |
Returns​
fn
• new bind(...args)
Parameters​
| Name | Type |
|---|---|
...args | A |
Inherited from​
ControlComponent.bind
Defined in​
apps/docs/node_modules/typescript/lib/lib.es5.d.ts:384
â–¸ Static bind<AX, R>(thisArg, ...args): (...args: AX[]) => R
Type parameters​
| Name |
|---|
AX |
R |
Parameters​
| Name | Type |
|---|---|
thisArg | any |
...args | AX[] |
Returns​
fn
• new bind(...args)
Parameters​
| Name | Type |
|---|---|
...args | AX[] |
Inherited from​
ControlComponent.bind
Defined in​
apps/docs/node_modules/typescript/lib/lib.es5.d.ts:385
â–¸ Static bind(thisArg, ...argArray): any
For a given function, creates a bound function that has the same body as the original function. The this object of the bound function is associated with the specified object, and has the specified initial parameters.
Parameters​
| Name | Type | Description |
|---|---|---|
thisArg | any | An object to which the this keyword can refer inside the new function. |
...argArray | any[] | A list of arguments to be passed to the new function. |
Returns​
any
Inherited from​
ControlComponent.bind
Defined in​
apps/docs/node_modules/typescript/lib/lib.es5.d.ts:293
call​
â–¸ Static call<T, A>(thisArg, ...args): void
Calls the function with the specified object as the this value and the specified rest arguments as the arguments.
Type parameters​
| Name | Type |
|---|---|
T | T |
A | extends any[] |
Parameters​
| Name | Type | Description |
|---|---|---|
thisArg | T | The object to be used as the this object. |
...args | A | Argument values to be passed to the function. |
Returns​
void
Inherited from​
ControlComponent.call
Defined in​
apps/docs/node_modules/typescript/lib/lib.es5.d.ts:372
â–¸ Static call(thisArg, ...argArray): any
Calls a method of an object, substituting another object for the current object.
Parameters​
| Name | Type | Description |
|---|---|---|
thisArg | any | The object to be used as the current object. |
...argArray | any[] | A list of arguments to be passed to the method. |
Returns​
any
Inherited from​
ControlComponent.call
Defined in​
apps/docs/node_modules/typescript/lib/lib.es5.d.ts:285
toString​
â–¸ Static toString(): string
Returns a string representation of a function.
Returns​
string
Inherited from​
ControlComponent.toString
Defined in​
apps/docs/node_modules/typescript/lib/lib.es5.d.ts:296