Coveo DynamicFacetRange Component (CoveoDynamicFacetRange)

A DynamicFacetRange is a facet whose values are expressed as ranges.

You must set the field option to a value targeting a numeric or date field in your index for this component to work.

This component extends the DynamicFacet component and supports all DynamicFacet options except:

Not supported in

Coveo for Salesforce Free

Available since

October 2019 Release (v2.7219)

Index

Methods

collapse

  • collapse(): void

debugInfo

  • debugInfo(): any

deselectMultipleValues

  • deselectMultipleValues(values: string[]): void

deselectValue

  • deselectValue(value: string): void

disable

  • disable(): void
  • Disable the component. Normally this means that the component will not execute handlers for the framework events (query events, for example). Components are enabled by default on creation.

    Returns void

enable

  • enable(): void
  • Enable the component. Normally this means that the component will execute handlers for the framework events (query events, for example). Components are enabled by default on creation.

    Returns void

enableFreezeCurrentValuesFlag

  • enableFreezeCurrentValuesFlag(): void
  • Sets a flag indicating whether the facet values should be returned in their current order.

    Setting the flag to true helps ensuring that the values do not move around while the end-user is interacting with them.

    The flag is automatically set back to false after a query is built.

    Returns void

enableFreezeFacetOrderFlag

  • enableFreezeFacetOrderFlag(): void
  • For this method to work, the component has to be the child of a DynamicFacetManager component.

    Sets a flag indicating whether the facets should be returned in their current order.

    Setting the flag to true helps ensuring that the facets do not move around while the end-user is interacting with them.

    The flag is automatically set back to false after a query is built.

    Returns void

expand

  • expand(): void

focusValueAfterRerender

  • focusValueAfterRerender(value: string): void

getBindings

getCaptionForStringValue

  • getCaptionForStringValue(value: string): string

hasSelectedValue

  • hasSelectedValue(value: string): boolean

reset

  • reset(): void

selectMultipleValues

  • selectMultipleValues(values: string[]): void

selectValue

  • selectValue(value: string): void
  • Selects a single value in this facet.

    Does not trigger a query automatically. Does not update the visual of the facet until a query is performed.

    Parameters

    • value: string

      The name of the facet value to select.

    Returns void

showLessValues

  • showLessValues(): void

showMoreValues

  • showMoreValues(additionalNumberOfValues?: number): void

toggleCollapse

  • toggleCollapse(): void

toggleSelectValue

  • toggleSelectValue(value: string): void

Static get

  • get(element: HTMLElement, componentClass?: any, noThrow?: boolean): BaseComponent
  • Get the bound component to the given HTMLElement. Throws an assert if the HTMLElement has no component bound, unless using the noThrow argument.
    If there is multiple component bound to the current HTMLElement, you must specify the component class.

    Parameters

    • element: HTMLElement

      HTMLElement for which to get the bound component.

    • Optional componentClass: any

      Optional component class. If the HTMLElement has multiple components bound, you must specify which one you are targeting.

    • Optional noThrow: boolean

      Boolean option to tell the method to not throw on error.

    Returns BaseComponent

Properties

bind

Allows the component to bind events and execute them only when it is enabled.

type

{Coveo.ComponentEvents}

componentOptionsModel

componentOptionsModel: ComponentOptionsModel

Contains the state of options for different components. Mainly used by ResultLink.

componentStateModel

componentStateModel: ComponentStateModel

Contains the state of different components (enabled vs disabled). Allows to get/set values. Triggers component state event when modified. Each component can listen to those events.

disabled

disabled: boolean

A disabled component will not participate in the query, or listen to ComponentEvents.

type

{boolean}

logger

logger: Logger

Allows component to log in the dev console.

queryController

queryController: QueryController

Contains the singleton that allows to trigger queries.

queryStateModel

queryStateModel: QueryStateModel

Contains the state of the query. Allows to get/set values. Trigger query state event when modified. Each component can listen to those events.

root

root: HTMLElement

A reference to the root HTMLElement (the SearchInterface).

searchInterface

searchInterface: SearchInterface

A reference to the root of every component, the SearchInterface.

Static ID

ID: string

The static ID that each component needs in order to be identified.
For example, SearchButton -> static ID: SearchButton -> className: CoveoSearchButton

Accessors

usageAnalytics

Component Options

currencySymbol

currencySymbol: string

The currency symbol to use if the valueFormat is currency.

By default, the component uses the currency associated with the currently loaded culture file (see Changing the Language of Your Search Interface).

Markup configuration example(s) :
data-currency-symbol='foo'

numberOfDecimals

numberOfDecimals: number

The number of decimals to display when the valueFormat is number

By default, the number of decimals is what's returned by the index.

Markup configuration example(s) :
data-number-of-decimals='2'

ranges

ranges: IRangeValue[]

The list of range values to request (see Requesting Specific FacetRange Values).

This value will override the numberOfValues value.

If this option is not defined, the index will try to generate automatic ranges.

sortOrder

sortOrder: FacetRangeSortOrder

The sort order to use for this facet.

Can be either ascending or descending.

Default: ascending.

valueFormat

The string format to apply to the minimum and maximum value of each range displayed in the facet.

See DynamicFacetRangeValueFormat for the list and description of allowed formats.

Default: If the field contains "date", the format will be date. Else, it will be number.

Markup configuration example(s) :
data-value-format='date'

valueSeparator

valueSeparator: string

The label to insert between the minimum and maximum value of each range displayed in the facet.

Default: The localized string for to.

Markup configuration example(s) :
data-value-separator='until'
data-value-separator='up to'

Constructors

constructor

Implements