(clamp v lo hi)Clamp v into [lo, hi]. When hi < lo (degenerate range) returns lo.
Clamp `v` into [lo, hi]. When hi < lo (degenerate range) returns lo.
(clamp-end proposed start-val max-val gap)Clamp a proposed end value into [start-val + gap, max-val].
Clamp a proposed end value into [start-val + gap, max-val].
(clamp-start proposed min-val end-val gap)Clamp a proposed start value into [min-val, end-val - gap].
Clamp a proposed start value into [min-val, end-val - gap].
(client-x->ratio client-x rect-left rect-width)Pointer clientX + track rect -> ratio in [0,1].
Pointer clientX + track rect -> ratio in [0,1].
(client-x->value client-x rect-left rect-width min-val max-val)Pointer clientX + track rect -> raw (unsnapped) value in [min-val, max-val].
Pointer clientX + track rect -> raw (unsnapped) value in [min-val, max-val].
(fill-percent value min-val max-val)Position of value along [min-val, max-val] as a percentage 0-100.
Position of `value` along [min-val, max-val] as a percentage 0-100.
(interactable? {:keys [disabled? readonly?]})True when the slider accepts user interaction (not disabled, not readonly).
True when the slider accepts user interaction (not disabled, not readonly).
(key-target key shift? cur min-val max-val step-num)Pure: the proposed (unclamped) value for a thumb keydown. Arrow keys move by one step (ten with shift), Page keys by ten, Home/End jump to bounds.
Pure: the proposed (unclamped) value for a thumb keydown. Arrow keys move by one step (ten with shift), Page keys by ten, Home/End jump to bounds.
(make-change-request-detail start end prev-start prev-end min-val max-val)(nearest-thumb clicked-val start-val end-val)Which thumb (:start / :end) sits closest to clicked-val. On a tie —
which includes coincident thumbs — a click at or below the start value
picks :start, otherwise :end.
Which thumb (:start / :end) sits closest to `clicked-val`. On a tie — which includes coincident thumbs — a click at or below the start value picks :start, otherwise :end.
(non-empty s)The string s when it is a non-empty string, otherwise nil.
The string `s` when it is a non-empty string, otherwise nil.
(normalize {min-raw :min
max-raw :max
:keys [start end step min-gap disabled readonly name label
show-value size aria-label aria-labelledby
aria-describedby]})Build the stable, value-comparable view-model from raw attribute strings.
Build the stable, value-comparable view-model from raw attribute strings.
(resolve-range raw-start raw-end min-val max-val gap)Resolve a raw start/end pair into a clamped, gap-respecting range within
[min-val, max-val]. No swapping: end is the dependent value, so it is
pulled up to satisfy the gap; only when that would exceed max-val does
start give way and get pulled down.
Resolve a raw start/end pair into a clamped, gap-respecting range within [min-val, max-val]. No swapping: `end` is the dependent value, so it is pulled up to satisfy the gap; only when that would exceed `max-val` does `start` give way and get pulled down.
(segment-geometry start-val end-val min-val max-val)Left% and width% of the highlighted track segment between the two thumbs.
Left% and width% of the highlighted track segment between the two thumbs.
(snap-to-step v min-val step-num)Snap v to the nearest multiple of step-num measured from min-val.
A nil or non-positive step leaves v unchanged. Does not clamp. The
result is rounded to 9 decimals to suppress floating-point noise.
Snap `v` to the nearest multiple of `step-num` measured from `min-val`. A nil or non-positive step leaves `v` unchanged. Does not clamp. The result is rounded to 9 decimals to suppress floating-point noise.
(step-size norm-step)Numeric step from a normalized step string. "any" or invalid -> nil.
Numeric step from a normalized step string. "any" or invalid -> nil.
(value-text start end)Header display text for the current range.
Header display text for the current range.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |