Liking cljdoc? Tell your friends :D

rui.forms.core

It contains all logic functions for forms.

It contains all logic functions for forms.
raw docstring

add-form-errorscljs

(add-form-errors db form-id errors)

Adds a given errors into the db by a given form-id. The errors should be a map with vectors

Adds a given `errors` into the `db` by a given `form-id`.
The `errors` should be a map with vectors
sourceraw docstring

assoc-field-valuecljs

(assoc-field-value db form-id field-id value)

Assocs a given value into the db by a given form-id and field-id

Assocs a given `value` into the `db` by a given `form-id` and `field-id`
sourceraw docstring

assoc-valuescljs

(assoc-values db form-id values)

Assocs a given values into the db by a given form-id

Assocs a given `values` into the `db` by a given `form-id`
sourceraw docstring

create-formcljs

(create-form form-map init-values)

Creates a Form from a given map.

Creates a `Form` from a given `map`.
sourceraw docstring

db->formcljs

(db->form db id)

Return a Form by a given id in the db.

Return a `Form` by a given `id` in the `db`.
sourceraw docstring

Fieldcljs

source

field-statecljs

(field-state form id)

Returns a field's state as a string.

Returns a field's state as a `string`.
sourceraw docstring

field-statescljs

source

Formcljs

source

form->valuescljs

(form->values form)

Returns form's values as a hashmap.

Returns `form`'s values as a hashmap.
sourceraw docstring

form-errors<responsecljs

(form-errors<response db form-id errors)

Takes a response's body as errors and assoc them in the db by a form-id. The errors should be a map with vectors

Takes a response's body as errors and assoc them in the `db` by a `form-id`.
The `errors` should be a map with vectors
sourceraw docstring

gen-field-idcljs

(gen-field-id form field-name)
source

init-fieldcljs

(init-field id)
(init-field id value)

Initializes a Field by id, or value with default values.

Initializes a `Field` by `id`, or `value` with default values.
sourceraw docstring

init-formcljs

(init-form db form-map initial-values)

Initializes a form in the db within form-map and initial-values

Initializes a form in the `db` within `form-map` and `initial-values`
sourceraw docstring

init-form!cljs

(init-form! form-id validator)
(init-form! form-id validator initial-values)

Initializes a form in DB by a given form-id with a validator function that takes a map of fields values and returns a map of vectors as errors or nil. Optionally takes an initial-values map.

Initializes a form in DB by a given `form-id` with a `validator` function that takes a map of fields values
and returns a map of vectors as errors or `nil`. Optionally takes an `initial-values` map.
sourceraw docstring

input-on-blur!cljs

(input-on-blur! form id event)

Dispatches a input's on-blur event

Dispatches a input's on-blur event
sourceraw docstring

input-on-change!cljs

(input-on-change! form id event)
(input-on-change! form id formatter event)

Dispatches a input's on-change event. Optionally takes a formatter function that takes a new values and returns formatter value.

Dispatches a input's on-change event. Optionally takes a `formatter` function that takes a new values and returns
formatter value.
sourceraw docstring

validate-formcljs

(validate-form form)

Validates a given form by its valdiator. It returns new form with updated values:

  • errors
  • valid?
  • every field's valid? is updated too
Validates a given `form` by its valdiator. It returns new form with updated values:
- `errors`
- `valid?`
- every field's `valid?` is updated too
sourceraw docstring

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

× close