ontotext-reusable-ui-components
Version:
Unified reusable UI components designed for the Ontotext ecosystem.
55 lines (54 loc) • 2.28 kB
TypeScript
import { EventEmitter, OnChanges, SimpleChanges, TemplateRef } from '@angular/core';
import { SearchFacetGroupModel } from './models/search-facet-group-model';
import { SearchFacetType } from './models/search-facet-type';
import { SearchFacetModel } from './models/search-facet-model';
import { OnDestroyMixin } from '@w11k/ngx-componentdestroyed';
import { SearchFacetSelection } from './models/search-facet-selection';
export declare class OntoSearchFacetComponent extends OnDestroyMixin implements OnChanges {
/**
* Holds the facet group data.
*/
data: SearchFacetGroupModel;
/**
* Used do define the facet type.
*/
type: SearchFacetType;
/**
* Custom template reference. Will override the template used in facet preview.
* When creating the custom template, a variable must be declared in order to access the object and its properties.
* The variable represents a map element - the key holds the label of the facet. The value is a two element object,
* containing the search result's count and a boolean variable, bind to the selected status.
* e.q. "Facet Label" => {count: 5, selected: true}
*
* For example, if you name you variable item:
* <ng-template #checkboxFacetTemplate let-item>
* <span class="facet-label">{{item.key}}</span>
* <span class="facet-count">({{item.value.count}})</span>
* </ng-template>
*/
facetTemplate: TemplateRef<any>;
/**
* Custom template reference. Will override the template used in facet name preview.
* You can pass directly the desired facet group name=
*
* For example:
* <ng-template #facetTitleTemplate>
* <strong>{{facetGroupName}}</strong>
* </ng-template>
*/
facetTitleTemplate: TemplateRef<any>;
/**
* Emits selected search facets on selection change.
*/
onSelectionChange: EventEmitter<SearchFacetSelection>;
CHECKBOX: SearchFacetType;
DATEPICKER: SearchFacetType;
TOGGLE: SearchFacetType;
RANGE: SearchFacetType;
DROPDOWN_MULTI_SELECT: SearchFacetType;
facetGroup: SearchFacetModel[];
facetGroupName: string;
selected: SearchFacetModel[];
ngOnChanges(changes: SimpleChanges): void;
onSelectionEvent($event: any): void;
}