mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
search fixes (#3272)
* "show less" button for search filter container * consistent button styles across widgets * i18n support for facets * page sizes for check list * display page buttons only when needed * page sizes for all facet fields * test fixes * update lib versions * fix angular configuration
This commit is contained in:
committed by
Eugenio Romano
parent
87a464907c
commit
ba35eda2f9
@@ -21,6 +21,12 @@ import { MatRadioChange } from '@angular/material';
|
||||
import { SearchWidget } from '../../search-widget.interface';
|
||||
import { SearchWidgetSettings } from '../../search-widget-settings.interface';
|
||||
import { SearchQueryBuilderService } from '../../search-query-builder.service';
|
||||
import { SearchFilterList } from '../search-filter/models/search-filter-list.model';
|
||||
|
||||
export interface SearchRadioOption {
|
||||
name: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'adf-search-radio',
|
||||
@@ -37,8 +43,24 @@ export class SearchRadioComponent implements SearchWidget, OnInit {
|
||||
id: string;
|
||||
settings: SearchWidgetSettings;
|
||||
context: SearchQueryBuilderService;
|
||||
options: SearchFilterList<SearchRadioOption>;
|
||||
pageSize = 5;
|
||||
|
||||
constructor() {
|
||||
this.options = new SearchFilterList<SearchRadioOption>();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
if (this.settings) {
|
||||
this.pageSize = this.settings.pageSize || 5;
|
||||
|
||||
if (this.settings.options && this.settings.options.length > 0) {
|
||||
this.options = new SearchFilterList<SearchRadioOption>(
|
||||
this.settings.options, this.pageSize
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
this.setValue(
|
||||
this.getSelectedValue()
|
||||
);
|
||||
|
Reference in New Issue
Block a user