CngxIncrementalList
projects/ui/collection/incremental-list.component.ts
Import#
import { CngxIncrementalList } from '@cngx/ui/collection'
Description#
Append-style collection organism.
Accumulates rows across pages (append, don't replace) and switches its view
by async status - loading / content / empty / error / end-reached - from a
single [state] source. A thin shell over the CngxPaginate brain (applied
as a hostDirective): the accumulated slice is read from the brain's
cumulativeRange(), the end-reached branch from isLast(), and the loading
gate from the bound state's isBusy(). It owns no [mode] flag and no
accumulation state of its own.
The brain is provided as CNGX_PAGINATOR_HOST via useExisting, so an
existing trigger atom (cngx-pgn-load-more, cngx-pgn-infinite) injects the
same contract when projected - the trigger stays a swappable terminal unit,
the rich async experience lives here.
Two-way [(pageIndex)] / [(pageSize)] mirror the paginator shell: the
brain's controlled inputs are aliased through hostDirectives and this
component is the single emitter of the matching outputs.
All ARIA is signal-driven: aria-busy reflects the brain busy signal and a
polite live region communicates every settle (empty / error / end-reached).
Metadata#
Host#
Providers#
CNGX_PAGINATOR_HOST- useExisting
CngxPaginate
Dependencies#
Relationships
Index#
Methods
Derived State
HostBindings
Inputs#
Initial per-row height estimate (px) for the virtualized window - the first
guess before a row is measured. Ignored unless [virtualize] is set.
48Visual skin; reflected onto [data-skin]. Paint-only.
'plain'(index: number, item: T) => unknownItem identity for the accumulated @for. Defaults to the row index
(append-safe: appended rows keep their position). Supply a key fn when the
bound [state] data can be replaced or reordered, so a projected item
template keeps its per-row state instead of being reused by position.
(index) => indexOpt into DOM recycling. When set, the accumulated content branch renders
only the visible window of rows through an internal virtualized body inside
a bounded scroll viewport; every off-window row is a pixel spacer. Unset
(default) keeps the render-all path - the recycler never constructs, so a
small list pays nothing. Reflected onto [data-virtualize].
false, { transform: booleanAttribute }Outputs#
Emits the effective page index on every change - navigation or total-shrink clamp.
Instance Properties#
unknownStable retry callback - emits the retry output; shared by the built-in button and the error slot context.
() => {...}unknown@for track expression - delegates to the trackBy input (index by default).
() => {...}Methods#
HostBindings#
| Binding | Expression |
|---|---|
[attr.aria-busy] | paginate.isBusy() |
[attr.data-skin] | skin() |
[attr.data-virtualize] | virtualize() ? '' : null |