(->caption field)(busy-button {:keys [html caption busy?] icon-id :icon})(checkbox-field model field)(checkbox-field model field options)(checkbox-input model field)(checkbox-input
model
field
{:keys [on-change value html] :or {on-change identity} :as options})(checkbox-inputs model field items {:keys [container-html] :as options})(checkboxes-field model field items)(checkboxes-field model field items options)Renders a list of checkboxes that behavior like a multi-select select element.
Renders a list of checkboxes that behavior like a multi-select select element.
(date-field model field options)(date-input
model
field
{:as options :keys [icon] :or {icon (icon :calendar {:size :small})}})(decimal-field model field)(decimal-field model field options)(decimal-input model field {:keys [fraction-digits] :as options})Renders a decimal input that also supports simple arithmetic (e.g. entering "9.99 * 1.0825" evaluates to 10.814175).
options: fraction-digits - when supplied, the evaluated result is rounded to this many decimal places (e.g. 2 for currency amounts).
Renders a decimal input that also supports simple arithmetic (e.g. entering
"9.99 * 1.0825" evaluates to 10.814175).
options:
fraction-digits - when supplied, the evaluated result is rounded to this
many decimal places (e.g. 2 for currency amounts).(email-field model field)(email-field model field options)(float-field model field options)(float-input model field options)Renders the specified icon using the configured framework
Renders the specified icon using the configured framework
Renders the specified icon and text using the configured framework
Renders the specified icon and text using the configured framework
(image-field model field options)Renders an image input with a label. See image-input.
Renders an image input with a label. See image-input.
(image-input model field _options)Renders a file input for choosing an image, e.g. a photo taken with a phone's camera. The chosen file is shrunk with dgknght.app-lib.images/resize and stored in the model as {:blob :url}, where :url is an object URL for previewing the blob.
The object URL is revoked when the image is replaced or removed. Revoke it yourself once you're done with the image, e.g. after uploading it.
The decoration renders the preview and the buttons for choosing and removing the image.
model - an atom wrapping a map which contains an attribute to be updated field - a vector of fields identifying the attribute to be updated options - capture - the capture attribute of the input, e.g. "environment" to open a phone's rear camera directly resize - options passed to dgknght.app-lib.images/resize, e.g. :max-dimension and :on-error on-change - called with the image when one is chosen, or with nil when the chosen image is removed saved? - true if there's a saved image, which the chosen image would replace on-remove - called when the saved image is removed html - a map of attributes to be passed directly to the input element
Bootstrap 5 decoration options - saved-image - hiccup showing the saved image, e.g. a cached-image from dgknght.app-lib.images.reagent captions - the content of the :add, :replace, and :remove buttons, e.g. an icon with text titles - the titles (tooltips) of the :choose and :remove buttons preview-html - attributes merged into the preview <img>
Renders a file input for choosing an image, e.g. a photo taken with a
phone's camera. The chosen file is shrunk with
dgknght.app-lib.images/resize and stored in the model as {:blob :url},
where :url is an object URL for previewing the blob.
The object URL is revoked when the image is replaced or removed. Revoke
it yourself once you're done with the image, e.g. after uploading it.
The decoration renders the preview and the buttons for choosing and
removing the image.
model - an atom wrapping a map which contains an attribute to be updated
field - a vector of fields identifying the attribute to be updated
options -
capture - the capture attribute of the input, e.g. "environment" to
open a phone's rear camera directly
resize - options passed to dgknght.app-lib.images/resize, e.g.
:max-dimension and :on-error
on-change - called with the image when one is chosen, or with nil when
the chosen image is removed
saved? - true if there's a saved image, which the chosen image
would replace
on-remove - called when the saved image is removed
html - a map of attributes to be passed directly to the input element
Bootstrap 5 decoration options -
saved-image - hiccup showing the saved image, e.g. a cached-image from
dgknght.app-lib.images.reagent
captions - the content of the :add, :replace, and :remove buttons,
e.g. an icon with text
titles - the titles (tooltips) of the :choose and :remove buttons
preview-html - attributes merged into the preview <img>(integer-field model field options)(integer-input model field options)(invalid? model)Returns true if the model has any form validation errors.
Returns true if the model has any form validation errors.
(password-field model field {:keys [new?] :as options})(select-elem model
field
items
{:keys [transform-fn disabled-fn validations on-change errors html]
:or {transform-fn identity
on-change identity
disabled-fn (constantly false)
html {}}
:as options})Renders a select element.
model - An atom that will contain data entered into the form field - a vector describing the location in the model where the value for this field is to be saved. (As in get-in) items - The items to be rendered in the list. Each item in the list is a tuple with the value in the 1st position and the label in the 2nd.
Renders a select element. model - An atom that will contain data entered into the form field - a vector describing the location in the model where the value for this field is to be saved. (As in get-in) items - The items to be rendered in the list. Each item in the list is a tuple with the value in the 1st position and the label in the 2nd.
(select-field model field items)(select-field model field items options)Renders a select element within a bootstrap field-group with a label.
model - An atom that will contain data entered into the form field - a vector describing the location in the model where the value for this field is to be saved. (As in get-in) items - The items to be rendered in the list. Each item in the list is a tuple with the value in the 1st position and the label in the 2nd.
Renders a select element within a bootstrap field-group with a label. model - An atom that will contain data entered into the form field - a vector describing the location in the model where the value for this field is to be saved. (As in get-in) items - The items to be rendered in the list. Each item in the list is a tuple with the value in the 1st position and the label in the 2nd.
(text-field model field options)(text-input model
field
{:keys [html on-change validations errors]
input-type :type
:or {input-type :text on-change identity}
:as options})(textarea-elem model field)(textarea-elem model field {:keys [validations errors] :as options})(textarea-field model field)(textarea-field model field options)(time-input model field options)(typeahead-field model field {:as options :keys [errors]})(typeahead-input model field {:as options :keys [errors]})Renders an input field with typeahead search capability
model - an atom wrapping a map which contains an attribute to be updated field - a vector of fields identifying the attribute to be updated (as is get-in/update-in) options - search-fn - a fn that takes a single string argument and returns matching data records find-fn - a fn that takes the stored values and finds the corrsponding data record caption-fn - accepts a data record and returns the value to display in the field list-caption-fn - like caption-fn, but used to render a data record in the list. Uses caption-fn if not supplied value-fn - accepts a data record and returns the value to be stored in the attribute on-change - callback invoked when the value of the attribute changes html - a map of attributes to be passed directly to the input element max-items - the maximum number of matching data records to show in the list list-attr - attributes to be applied to the list HTML element
Renders an input field with typeahead search capability model - an atom wrapping a map which contains an attribute to be updated field - a vector of fields identifying the attribute to be updated (as is get-in/update-in) options - search-fn - a fn that takes a single string argument and returns matching data records find-fn - a fn that takes the stored values and finds the corrsponding data record caption-fn - accepts a data record and returns the value to display in the field list-caption-fn - like caption-fn, but used to render a data record in the list. Uses caption-fn if not supplied value-fn - accepts a data record and returns the value to be stored in the attribute on-change - callback invoked when the value of the attribute changes html - a map of attributes to be passed directly to the input element max-items - the maximum number of matching data records to show in the list list-attr - attributes to be applied to the list HTML element
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 |