The NumericFacet controller makes it possible to create a facet with numeric ranges.

Example: numeric-facet.fn.tsx

interface NumericFacet {
    state: NumericFacetState;
    deselectAll(): void;
    disable(): void;
    enable(): void;
    isSortedBy(criterion: RangeFacetSortCriterion): boolean;
    isValueSelected(selection: NumericFacetValue): boolean;
    sortBy(criterion: RangeFacetSortCriterion): void;
    subscribe(listener: () => void): Unsubscribe;
    toggleSelect(selection: NumericFacetValue): void;
    toggleSingleSelect(selection: NumericFacetValue): void;
}

Hierarchy (View Summary)

Methods

  • Deselects all facet values.

    Returns void

  • Disables the facet. I.e., prevents it from filtering results.

    Returns void

  • Enables the facet. I.e., undoes the effects of disable.

    Returns void

  • Checks whether the facet values are sorted according to the specified criterion.

    Parameters

    Returns boolean

    Whether the facet values are sorted according to the specified criterion.

  • Checks whether the specified facet value is selected.

    Parameters

    Returns boolean

    Whether the specified facet value is selected.

  • Sorts the facet values according to the specified criterion.

    Parameters

    Returns void

  • Adds a callback that's invoked on state change.

    Parameters

    • listener: () => void

      A callback that's invoked on state change.

    Returns Unsubscribe

    A function to remove the listener.

  • Toggles the specified facet value.

    Parameters

    Returns void

  • Toggles the specified facet value, deselecting others.

    Parameters

    Returns void

Properties

The state of the NumericFacet controller.