A namespace for specialized tool for dealing with inputs in HTML DOM to control a value in the data model that cannot be directly represented by normal HTML inputs. For example, you want to have an int in your data model, but HTML5 number inputs return a string and do not constrain the input to integers.
A namespace for specialized tool for dealing with inputs in HTML DOM to control a value in the data model that cannot be directly represented by normal HTML inputs. For example, you want to have an int in your data model, but HTML5 number inputs return a string and do not constrain the input to integers.
(just-digits s)
Returns s
with all non-digits stripped.
Returns `s` with all non-digits stripped.
(StringBufferedInput kw {:keys [model->string string->model string-filter]})
Create a new type of input that can be derived from a string. kw
is a fully-qualified keyword name for the new
class (which will be used to register it in the component registry), and model->string
and string->model
are
functions that can do the conversions (and MUST tolerate nil as input).
model->string
MUST return a string (empty if invalid), and string->model
should return nil if the string doesn't
yet convert to a valid model value.
string-filter
is an optional (fn [string?] string?)
that can be used to rewrite incoming strings (i.e. filter
things).
Create a new type of input that can be derived from a string. `kw` is a fully-qualified keyword name for the new class (which will be used to register it in the component registry), and `model->string` and `string->model` are functions that can do the conversions (and MUST tolerate nil as input). `model->string` MUST return a string (empty if invalid), and `string->model` should return nil if the string doesn't yet convert to a valid model value. `string-filter` is an optional `(fn [string?] string?)` that can be used to rewrite incoming strings (i.e. filter things).
(symbol-chars s)
Returns s
with all non-digits stripped.
Returns `s` with all non-digits stripped.
An integer input. Can be used like dom/input
but onChange and onBlur handlers will be passed an int instead of
a raw react event, and you should supply an int for :value
instead of a string. You may set the :type
to text
or number depending on how you want the control to display, even though the model value is always an int or nil.
All other attributes passed in props are passed through to the contained dom/input
.
An integer input. Can be used like `dom/input` but onChange and onBlur handlers will be passed an int instead of a raw react event, and you should supply an int for `:value` instead of a string. You may set the `:type` to text or number depending on how you want the control to display, even though the model value is always an int or nil. All other attributes passed in props are passed through to the contained `dom/input`.
A keyword input. Used just like a DOM input, but requires you supply nil or a keyword for :value
, and
will send a keyword to onChange
and onBlur
. Any other attributes in props are passed directly to the
underlying dom/input
.
A keyword input. Used just like a DOM input, but requires you supply nil or a keyword for `:value`, and will send a keyword to `onChange` and `onBlur`. Any other attributes in props are passed directly to the underlying `dom/input`.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close