(chip-label options value)The label of the chip for value: the label of its option, or the value when it has none.
The label of the chip for `value`: the label of its option, or the value when it has none.
(clamp-active-idx raw-idx visible-count)Returns active-idx bounded by visible-count. -1 when there is nothing visible; otherwise the index, capped at the last visible position. raw-idx of nil is treated as 0.
Returns active-idx bounded by visible-count. -1 when there is nothing visible; otherwise the index, capped at the last visible position. raw-idx of nil is treated as 0.
(csv-unrepresentable values)The values that a comma-separated value cannot hold: those with the separator, or with leading or trailing whitespace.
The values that a comma-separated value cannot hold: those with the separator, or with leading or trailing whitespace.
(filter-options options query selected-set)Filters options by case-insensitive substring match on label, excludes already-selected values, and caps at max-rendered-options.
Filters options by case-insensitive substring match on label, excludes already-selected values, and caps at max-rendered-options.
(find-option-by-value options value)Returns the first option map where :value matches, or nil.
Returns the first option map where :value matches, or nil.
(highlight-match label query)Splits label around the first case-insensitive match of query. Returns {:before :match :after} or nil if no match.
Splits label around the first case-insensitive match of query.
Returns {:before :match :after} or nil if no match.(invalid-json-message s)The error text for a value attribute s that is not a JSON array of strings.
The error text for a value attribute `s` that is not a JSON array of strings.
(last-value value-set)Returns the largest value in the set in sort order, or nil for an empty set. The selected-set is rendered sorted, so this is the value Backspace removes.
Returns the largest value in the set in sort order, or nil for an empty set. The selected-set is rendered sorted, so this is the value Backspace removes.
(max-reached? value-set max-val)Returns true when a max is set and the value set has reached it.
Returns true when a max is set and the value set has reached it.
(next-active-idx n active-idx)Advance active-idx forward, wrapping.
Advance active-idx forward, wrapping.
(normalize {:keys [value-raw placeholder-raw name-raw disabled-present?
required-present? open-present? placement-raw max-raw
error-raw value-format-raw]})Derives a complete view-model from raw attribute presence/values.
Derives a complete view-model from raw attribute presence/values.
(normalize-placement s)Normalizes raw placement string. Falls back to default-placement if invalid.
Normalizes raw placement string. Falls back to default-placement if invalid.
(normalize-value-format s)Normalizes raw value-format string. Falls back to default-value-format if invalid.
Normalizes raw value-format string. Falls back to default-value-format if invalid.
(parse-json-value s)Parses a JSON array of strings into a set of its non-empty strings, kept exactly. Returns nil
when s is not a JSON array of strings, and #{} when s is nil or empty.
Parses a JSON array of strings into a set of its non-empty strings, kept exactly. Returns nil
when `s` is not a JSON array of strings, and #{} when `s` is nil or empty.(parse-max s)Parses max attribute to a positive integer, or nil if absent/invalid.
Parses max attribute to a positive integer, or nil if absent/invalid.
(parse-value s)Parses a comma-separated value string into a set of trimmed, non-empty strings. nil or empty string yields #{}.
Parses a comma-separated value string into a set of trimmed, non-empty strings.
nil or empty string yields #{}.(parse-value-as value-format s)Parses a value attribute in value-format into {:value set :invalid? boolean}. An invalid
json value yields the empty set.
Parses a value attribute in `value-format` into `{:value set :invalid? boolean}`. An invalid
json value yields the empty set.(prev-active-idx n active-idx)Advance active-idx backward, wrapping.
Advance active-idx backward, wrapping.
(serialize-json-value value-set)Serializes a set of values into a sorted JSON array. Empty set yields empty string.
Serializes a set of values into a sorted JSON array. Empty set yields empty string.
(serialize-value value-set)Serializes a set of values into a sorted, comma-separated string. Empty set yields empty string.
Serializes a set of values into a sorted, comma-separated string. Empty set yields empty string.
(serialize-value-as value-format value-set)Serializes a set of values in value-format.
Serializes a set of values in `value-format`.
(shown-panel options query wanted-active-idx {:keys [value max]})What the panel shows for the model m: :items, each with its key and the text of what it
shows, and :active-id, the id of the active option or nil. With no option to show, the one
item is the empty message. The key of an option is made of its value, so an option keeps
its key while the query and the selection change.
What the panel shows for the model `m`: `:items`, each with its key and the text of what it shows, and `:active-id`, the id of the active option or nil. With no option to show, the one item is the empty message. The key of an option is made of its value, so an option keeps its key while the query and the selection change.
(unrepresentable-message values)The warning text for values that a comma-separated value splits or trims.
The warning text for `values` that a comma-separated value splits or trims.
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 |