Liking cljdoc? Tell your friends :D

baredom.components.x-rating.model


allowed-precisioncljs

source

allowed-shapescljs

source

allowed-sizescljs

source

aria-valuetextcljs

(aria-valuetext value max-stars shape)

Screen-reader announcement for the current rating. The icon noun follows the shape so a heart rating is not announced as "stars".

Screen-reader announcement for the current rating. The icon noun follows
the shape so a heart rating is not announced as "stars".
sourceraw docstring

attr-allow-clearcljs

source

attr-aria-describedbycljs

source

attr-aria-labelcljs

source

attr-aria-labelledbycljs

source

attr-disabledcljs

source

attr-labelcljs

source

attr-maxcljs

source

attr-namecljs

source

attr-precisioncljs

source

attr-readonlycljs

source

attr-shapecljs

source

attr-sizecljs

source

attr-valuecljs

source

clampcljs

(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.
sourceraw docstring

clamp-valuecljs

(clamp-value v max-stars)

Clamp a rating into [0, max-stars].

Clamp a rating into [0, max-stars].
sourceraw docstring

default-maxcljs

source

default-precisioncljs

source

default-shapecljs

source

default-sizecljs

source

default-valuecljs

source

event-changecljs

source

event-change-requestcljs

source

event-hovercljs

source

event-schemacljs

source

fill-statescljs

(fill-states value max-stars)

Per-star fill keywords (:full / :half / :empty) for the whole row.

Per-star fill keywords (:full / :half / :empty) for the whole row.
sourceraw docstring

interactable?cljs

(interactable? {:keys [disabled? readonly?]})

True when the rating accepts user interaction (not disabled, not readonly).

True when the rating accepts user interaction (not disabled, not readonly).
sourceraw docstring

key-targetcljs

(key-target key cur max-stars p-step allow-clear?)

Pure: the proposed (unclamped) value for a keydown. Arrow keys move by one precision step, Home jumps to 0, End to max, Delete/Backspace clear to 0 when clearing is allowed.

Pure: the proposed (unclamped) value for a keydown. Arrow keys move by one
precision step, Home jumps to 0, End to max, Delete/Backspace clear to 0
when clearing is allowed.
sourceraw docstring

make-change-request-detailcljs

(make-change-request-detail value prev-value max-stars)
source

make-detailcljs

(make-detail value max-stars)
source

max-stars-capcljs

source

method-apicljs

source

non-emptycljs

(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.
sourceraw docstring

normalizecljs

(normalize {:keys [value max precision shape allow-clear disabled readonly name
                   label 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.
sourceraw docstring

normalize-maxcljs

(normalize-max s)

Star count: a whole number in [1, max-stars-cap]. The cap also tames a non-finite attribute — js/Math.round of Infinity stays Infinity, which the min then clamps.

Star count: a whole number in [1, max-stars-cap]. The cap also tames a
non-finite attribute — js/Math.round of Infinity stays Infinity, which the
`min` then clamps.
sourceraw docstring

normalize-numbercljs

(normalize-number s default-val)

Parse s to a number, falling back to default-val for nil / NaN input.

Parse `s` to a number, falling back to `default-val` for nil / NaN input.
sourceraw docstring

normalize-precisioncljs

(normalize-precision s)
source

normalize-shapecljs

(normalize-shape s)
source

normalize-sizecljs

(normalize-size s)
source

observed-attributescljs

source

pointer->valuecljs

(pointer->value client-x rect-left rect-width star-count p-step)

Pointer clientX + stars-row rect -> the discrete rating candidate in [0.5 .. star-count]. Stars are laid out with no gap, so each star spans rect-width / star-count. With a 0.5 step, the left half of a star picks the half value. Never returns 0 — clearing is handled by the component.

Pointer clientX + stars-row rect -> the discrete rating candidate in
[0.5 .. star-count]. Stars are laid out with no gap, so each star spans
rect-width / star-count. With a 0.5 step, the left half of a star picks
the half value. Never returns 0 — clearing is handled by the component.
sourceraw docstring

pointer-star-indexcljs

(pointer-star-index client-x rect-left rect-width star-count)

0-based index of the star under the pointer, clamped to [0, star-count-1].

0-based index of the star under the pointer, clamped to [0, star-count-1].
sourceraw docstring

precision-stepcljs

(precision-step norm-precision)

Numeric increment for a normalized precision: 0.5 for "half", else 1.

Numeric increment for a normalized precision: 0.5 for "half", else 1.
sourceraw docstring

property-apicljs

source

snap-to-precisioncljs

(snap-to-precision v step)

Snap v to the nearest multiple of step. A nil or non-positive step leaves v unchanged. The result is rounded to 9 decimals to suppress floating-point noise.

Snap `v` to the nearest multiple of `step`. A nil or non-positive step
leaves `v` unchanged. The result is rounded to 9 decimals to suppress
floating-point noise.
sourceraw docstring

star-fillcljs

(star-fill star-index value)

Fill state of star star-index (0-based) for the rating value.

Fill state of star `star-index` (0-based) for the rating `value`.
sourceraw docstring

tag-namecljs

source

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close