Skip to main content

FacetValueSelectorComponent

FacetValueSelectorComponent

A form control for selecting facet values.

Example

<vdr-facet-value-selector
[facets]="facets"
(selectedValuesChange)="selectedValues = $event"
></vdr-facet-value-selector>

The facets input should be provided from the parent component like this:

Example

this.facets = this.dataService
.facet.getAllFacets()
.mapSingle(data => data.facets.items);
Signature
class FacetValueSelectorComponent implements OnInit, OnDestroy, ControlValueAccessor {
@Output() selectedValuesChange = new EventEmitter<FacetValueFragment[]>();
@Input() readonly = false;
@Input() transformControlValueAccessorValue: (value: FacetValueFragment[]) => any[] = value => value;
searchInput$ = new Subject<string>();
searchLoading = false;
searchResults$: Observable<FacetValueFragment[]>;
selectedIds$ = new Subject<string[]>();
onChangeFn: (val: any) => void;
onTouchFn: () => void;
disabled = false;
value: Array<string | FacetValueFragment>;
constructor(dataService: DataService, changeDetectorRef: ChangeDetectorRef)
ngOnInit() => void;
ngOnDestroy() => ;
onChange(selected: FacetValueFragment[]) => ;
registerOnChange(fn: any) => ;
registerOnTouched(fn: any) => ;
setDisabledState(isDisabled: boolean) => void;
focus() => ;
writeValue(obj: string | FacetValueFragment[] | Array<string | number> | null) => void;
}
  • Implements: OnInit, OnDestroy, ControlValueAccessor

selectedValuesChange

property

readonly

property

transformControlValueAccessorValue

property
(value: FacetValueFragment[]) => any[]

searchInput$

property

searchLoading

property

searchResults$

property
Observable<FacetValueFragment[]>

selectedIds$

property

onChangeFn

property
(val: any) => void

onTouchFn

property
() => void

disabled

property

value

property
Array<string | FacetValueFragment>

constructor

method
(dataService: DataService, changeDetectorRef: ChangeDetectorRef) => FacetValueSelectorComponent

ngOnInit

method
() => void

ngOnDestroy

method
() =>

onChange

method
(selected: FacetValueFragment[]) =>

registerOnChange

method
(fn: any) =>

registerOnTouched

method
(fn: any) =>

setDisabledState

method
(isDisabled: boolean) => void

focus

method
() =>

writeValue

method
(obj: string | FacetValueFragment[] | Array<string | number> | null) => void