(?show-message form name)
(?show-message form name messages)
1. If parameter messages is provided return a message. If message is not supported, then return true. 2. If messages is not provided return boolean
(?spec-problems spec value)
Return nil if pass.
Return nil if pass.
(event->names->value! form event)
Update input value to names->value and validate. The best with :on-change event.
Update input value to names->value and validate. The best with :on-change event.
(get-message form name messages)
1. If invalid is a vector find the deepest message. 2. If invalid is not a vector return as it is.
(show-all form)
Add all names (inputs) to :names->show
Add all names (inputs) to :names->show
(show-if-not-empty form name)
Add name (input) to :names->show if value is not empty. hint: Add to :names->show has to be done once and it stays forever. Prevent to show errors when user jump between inputs by tab.
Add name (input) to :names->show if value is not empty. hint: Add to :names->show has to be done once and it stays forever. Prevent to show errors when user jump between inputs by tab.
(spec-validate form spec name)
Check value by spec. If validate return nil, otherwise return a reason: the :via value of spec problem.
Check value by spec. If validate return nil, otherwise return a reason: the :via value of spec problem.
(validate-form form)
1. Validate names->value with :spec-form. 2. Next validate names->value with names->validators. Do not overwrite errors from 1. by 2.
(validate-name form name)
Validate name (input) in names->value. Update names->invalid.
Validate name (input) in names->value. Update names->invalid.
(validator->fn form validator)
If spec, transform to fn. Make consistent fn to check values: (fn [name] ...) return reason of fail or nil
If spec, transform to fn. Make consistent fn to check values: (fn [name] ...) return reason of fail or nil
(validators->some-validators form names->validators)
convert validators {:name [::spec f ...]} into {:name some-validator} which check all validators unless one of them fail.
convert validators {:name [::spec f ...]} into {:name some-validator} which check all validators unless one of them fail.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close