A scoped and simplified part of the headless state that is relevant to the CategoryFacet controller.

interface CategoryFacetState {
    activeValue: undefined | CategoryFacetValue;
    canShowLessValues: boolean;
    canShowMoreValues: boolean;
    enabled: boolean;
    facetId: string;
    facetSearch: CategoryFacetSearchState;
    hasActiveValues: boolean;
    isHierarchical: boolean;
    isLoading: boolean;
    selectedValueAncestry: CategoryFacetValue[];
    sortCriteria: CategoryFacetSortCriterion;
    valuesAsTrees: CategoryFacetValue[];
}

Hierarchy (View Summary)

Properties

activeValue: undefined | CategoryFacetValue

The facet's selected value if any, undefined otherwise.

canShowLessValues: boolean

Returns true if fewer values can be displayed, and false if not.

canShowMoreValues: boolean

Returns true if there are more values to display and, false if not.

enabled: boolean

Whether the facet is enabled and its values are used to filter search results.

facetId: string

The facet ID.

The state of the facet's searchbox.

hasActiveValues: boolean

Returns true if there's at least one non-idle value, and false if not.

isHierarchical: boolean

Whether valuesAsTree contains hierarchical values (i.e. facet values with children), or only 'flat' values (i.e. facet values without children).

isLoading: boolean

Returns true if a search is in progress, and false if not.

selectedValueAncestry: CategoryFacetValue[]

The selected facet values ancestry. The first element is the "root" of the selected value ancestry tree. The last element is the selected value itself.

The facet's active sortCriterion.

valuesAsTrees: CategoryFacetValue[]

The root facet values. Child values might be available in valuesAsTrees[i].children[j]

`{value: 'foo' }