Skip to main content
cngx-src documentation

CngxPaginatorHost

Interface

projects/ui/paginator/paginator-host.token.ts

Import#

import { CngxPaginatorHost } from '@cngx/ui/paginator'

Description#

Read-mostly state-and-navigation contract every paginator segment part injects instead of the concrete CngxPaginator shell.
A structural subset of the CngxPaginate brain (@cngx/common/data) - the brain provides it via useExisting, so a decomposed skin keeps talking to the same token without depending on the organism class (Atomic Decompose, DI abstraction).

The signals are the single derivation source for every segment's disabled state, label, and aria-current; the methods are the only write paths, each routing through the brain so the clamp-computed() and busy-gate invariants hold.

Index#

Instance Properties#

cumulativeRange#Signal<[number, number]>
Readonly

[0, end] cumulative slice indices for append-don't-replace (load-more) consumers - every page revealed so far, sliced from the top.

isBusy#Signal
Readonly

true while the bound async state is busy - navigation is gated.

isFirst#Signal
Readonly

true when on the first page.

isLast#Signal
Readonly

true when on the last page.

pageIndex#Signal
Readonly

Current page index (0-based), auto-clamped to totalPages.

pageSize#Signal
Readonly

Current page size.

range#Signal<[number, number]>
Readonly

[start, end] slice indices for the current page - always in-bounds.

total#Signal
Readonly

Total item count (before pagination).

totalPages#Signal
Readonly

Total number of pages (minimum 1).

Methods#

first#void

Navigate to the first page.

last#void

Navigate to the last page.

setPage#void
setPage(index: number)

Navigate to index, clamped to [0, totalPages - 1]. No-op while busy.

@paramindexnumber
setPageSize#void
setPageSize(size: number, resetPage?: boolean)

Change page size; resets to page 0 unless resetPage is false. No-op while busy.

@paramsizenumber
@paramresetPage?boolean