Skip to main content
cngx-src documentation

CngxSliderRangeHost

Interface

projects/common/interactive/slider/range-slider.token.ts

Referenced by#

Import#

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

Description#

Contract a CngxRangeSlider provides so each CngxSliderThumb can read the shared track config, learn its sibling-clamped bounds, and write its end of the tuple - all without injecting the concrete parent class (which would create a cyclic type and block Atomic Decompose). The cross-clamp lives in boundsFor, so two thumbs can never pass each other and no effect is needed to keep them ordered.

Index#

Instance Properties#

disabled#Signal
Readonly

Whether the whole range slider is disabled.

largeStep#Signal
Readonly

Page-key jump size shared by both thumbs (absolute). Undefined = derive from range.

max#Signal
Readonly

Track upper bound.

min#Signal
Readonly

Track lower bound.

orientation#Signal<"horizontal" | "vertical">
Readonly

Track axis shared by both thumbs.

step#Signal
Readonly

Step granularity shared by both thumbs.

value#Signal<[number, number]>
Readonly

Current [start, end] tuple - the single source of truth.

valueText#Signal
Readonly

Optional aria-valuetext formatter shared across both thumbs.

Methods#

boundsFor(position: CngxSliderThumbPosition)

Sibling-clamped bounds for one thumb, preventing thumb-cross.

commit#void
commit(position: CngxSliderThumbPosition, value: number)

Write one end of the tuple (the thumb's core has already snapped + clamped).

@paramvaluenumber
fractionFromPointer#number
fractionFromPointer(clientX: number, clientY: number)

Map a pointer position to a 0..1 fraction along the shared track, using the range host's own geometry. A thumb cannot measure this itself - its element is the tiny handle, not the full track - so the host owns the math.

@paramclientXnumber
@paramclientYnumber