Skip to main content
cngx-src documentation

CngxOptionFilterHost

Interface

projects/common/interactive/listbox/option-filter-host.ts

Referenced by#

Import#

import { CngxOptionFilterHost } from '@cngx/common/interactive'

Description#

Pull-based contract a parent host (e.g. CngxSelectShell with a search input, future filter-driven hosts) implements so individual CngxOption instances can compute their own hidden visibility from a host-owned searchTerm signal and a host-owned matches policy.

Splitting policy from visibility keeps the option agnostic about HOW filtering decides - substring, fuzzy, server-driven - and gives the host a single point of control. Empty search term ALWAYS resolves to "show everything"; the option short-circuits before calling matches.

Index#

Properties

Methods

Instance Properties#

searchTerm#Signal
Readonly

Current search term. Empty string means "no filter active".

Methods#

matches#boolean
matches(value: T, label: string, term: string)

Decides whether the option is a match for the active term. Receives the option's value, its resolved plain-text label, and the current term.

@paramvalueT
@paramlabelstring
@paramtermstring