Input types extend over the :type
attribute
of reacl-c-basics.forms.core/input
items, giving more control
over the data types of the state value, and to some extend over the
ui controls to enter those values. The type system defined here is
also extensible.
Input types extend over the `:type` attribute of [[reacl-c-basics.forms.core/input]] items, giving more control over the data types of the state value, and to some extend over the ui controls to enter those values. The type system defined here is also extensible.
(add-attributes type attrs)
Adds additional default attributes for the dom element used for the given type.
Adds additional default attributes for the dom element used for the given type.
An input for a boolean value, represented a checkbox.
An input for a boolean value, represented a checkbox.
(decimal decimals)
A input type for an integer, but represented and entered as (/ v (^ 10 decimals)
. E.g. 234 with 2 decimals is shown and entered as
"2.34".
A input type for an integer, but represented and entered as `(/ v (^ 10 decimals)`. E.g. 234 with 2 decimals is shown and entered as "2.34".
(enum values-labels)
An input type for one of some arbitrary values. The argument
values-labels
must consist of a sequence of tuples [value text]
specifying the value selected and a string that represents the value
for the user.
An input type for one of some arbitrary values. The argument `values-labels` must consist of a sequence of tuples `[value text]` specifying the value selected and a string that represents the value for the user.
(extend-type type parse unparse)
Creates an input type that can allow for more values than the given
one. The function parse
will be called with the parse function of
the given type and the string entered by the user, and the function
unparse
alike.
Creates an input type that can allow for more values than the given one. The function `parse` will be called with the parse function of the given type and the string entered by the user, and the function `unparse` alike.
(fixnum decimals)
An input type for a float, but when entered and displayed, exactly the given number of decimal places are used or shown respectively.
An input type for a float, but when entered and displayed, exactly the given number of decimal places are used or shown respectively.
An input type for a integer number.
An input type for a integer number.
An input type for a string, represented in a multiline textbox element.
An input type for a string, represented in a multiline textbox element.
(native-type type)
Creates an input type for one of the native 'types' supported by a dom/input, i.e. "text", "number", "checkbox" etc. Note that not all types are supported by all browsers.
Creates an input type for one of the native 'types' supported by a dom/input, i.e. "text", "number", "checkbox" etc. Note that not all types are supported by all browsers.
An input type for an optional integer number.
An input type for an optional integer number.
An input type for an optional, but non-empty string.
An input type for an optional, but non-empty string.
An input type for an optional number.
An input type for an optional number.
An input type for an optional string.
An input type for an optional string.
(optional type)
Adds 'nil' as a possible value to the given input type. Note that this is may not possible for all types.
Adds 'nil' as a possible value to the given input type. Note that this is may not possible for all types.
(parsed-type base-type parse unparse)
Creates an input that requires parsing and unparsing of the string
entered by the user. The function parse
is called with the string
entered by the user, and must either return the parsed value of
throw parsed/parse-error
. The function unparse
must return a
string representing a parsed value.
Creates an input that requires parsing and unparsing of the string entered by the user. The function `parse` is called with the string entered by the user, and must either return the parsed value of throw [[parsed/parse-error]]. The function `unparse` must return a string representing a parsed value.
(restrict-type type f)
Creates an input that allows to restrict the parsed value of the
given type further, by threading it though the given function f
,
which may throw parsed/parse-error
. Note that it can be more
intuitive for the user to set the input element attribute :invalid
in some cases.
Creates an input that allows to restrict the parsed value of the given type further, by threading it though the given function `f`, which may throw [[parsed/parse-error]]. Note that it can be more intuitive for the user to set the input element attribute `:invalid` in some cases.
(string-enum strings)
An input type for one of the given strings.
An input type for one of the given strings.
(update-type-base type f)
Calls f with the current base function and replaces it with the result.
Calls f with the current base function and replaces it with the result.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close