Skip to main content
cngx-src documentation

CngxSliderCore

Interface

projects/common/interactive/slider/slider-core.ts

Import#

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

Description#

Derived view and write surface produced by createSliderCore. All read members are computed() from the option signals; all mutation goes through the four imperative helpers, which snap-to-step and clamp before writing. The directive binds clampedValue to aria-valuenow, fraction to its thumb-position CSS var, and ariaValueText to aria-valuetext.

Index#

Instance Properties#

ariaValueText#Signal
Readonly

aria-valuetext string (formatter output or the numeric value).

atMax#Signal
Readonly

True when the clamped value sits on the effective upper bound.

atMin#Signal
Readonly

True when the clamped value sits on the effective lower bound.

clampedValue#Signal
Readonly

value snapped to step and clamped to the effective bounds - bind to aria-valuenow.

fraction#Signal
Readonly

Position along the track in [0, 1] - bind to the thumb-position CSS var.

percent#Signal
Readonly

fraction as a 0..100 percentage.

value#Signal
Readonly

Raw model value (may sit outside the effective bounds until first write).

Methods#

setFromFraction#void
setFromFraction(fraction: number)

Map a [0, 1] track fraction to a value, then setValue it.

@paramfractionnumber
setValue#void
setValue(next: number)

Snap and clamp next, then write it (no-op when unchanged).

@paramnextnumber
stepBy#void
stepBy(stepCount: number)

Move by stepCount steps from the current value (negative to decrease).

@paramstepCountnumber
stepToMax#void

Jump to the effective upper bound.

stepToMin#void

Jump to the effective lower bound.