Liking cljdoc? Tell your friends :D

com.fulcrologic.fulcro.dom.inputs

A namespace for dealing with inputs in HTML DOM when you wish to control a value in the data model that cannot be directly represented by normal HTML inputs (which always use strings). For example, you want to have an int in your data model, but HTML5 number inputs return a string. The primary utility is StringBufferedInput which generates a new React class that wraps an HTML input. The namespace also includes a few uses that are handy (at least as examples): ui-int-input and ui-keyword-input. See the source of those for examples.

A namespace for dealing with inputs in HTML DOM when you wish to control a value in the data model
that cannot be directly represented by normal HTML inputs (which always use strings). For example, you want to have an int in
your data model, but HTML5 number inputs return a string. The primary utility is `StringBufferedInput` which generates
a new React class that wraps an HTML `input`. The namespace also includes a few uses that are handy (at least as
examples): `ui-int-input` and `ui-keyword-input`. See the source of those for examples.
raw docstring

just-digitsclj/s

(just-digits s)

Returns s with all non-digits stripped.

Returns `s` with all non-digits stripped.
sourceraw docstring

StringBufferedInputclj/s

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

symbol-charsclj/s

(symbol-chars s)

Returns s with all non-digits stripped.

Returns `s` with all non-digits stripped.
sourceraw docstring

to-intclj/s

(to-int s)

Convert a string s

Convert a string `s`
sourceraw docstring

ui-int-inputclj/s

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

ui-keyword-inputclj/s

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

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close