Skip to main content
cngx-src documentation

CngxBucketPaginateHost

Interface

projects/common/data/paginate/bucket-paginate-host.token.ts

Referenced by#

Import#

import { CngxBucketPaginateHost } from '@cngx/common/data'

Description#

Read-and-write contract a category/range chip strip (cngx-pgn-alpha) injects instead of the concrete CngxBucketPaginate directive.
The directive provides it via useExisting, so a chip strip stays decompose-ready - it talks to the token, never to the model class (DI abstraction).

The signals are the single derivation source for every chip's pressed and disabled state; select / clear are the only write paths, each routing through the directive's active model so the toggle invariant (re-selecting the active bucket clears it) holds in one place.

Index#

Instance Properties#

active#Signal
Readonly

Label of the active bucket, or null when no bucket is selected.

buckets#Signal
Readonly

The buckets to render, in declaration order. One chip per entry.

Methods#

clear#void

Clear the active bucket (show the unfiltered collection).

isEmpty#boolean
isEmpty(label: string)

true when no bound item matches the bucket's predicate. Derived from the items / buckets inputs (never a synced flag); a chip binds its disabled state to this so an empty bucket is a dead control with a stated reason.

@paramlabelstring
select#void
select(label: string)

Select the bucket. Re-selecting the already-active bucket clears the selection (toggle). No-op for an empty bucket.

@paramlabelstring