(calculate? field)
Checks whether a field is a calculate field
Checks whether a field is a calculate field
(categorical? field)
Checks whether a field is a category field (select one or multiple)
Checks whether a field is a category field (select one or multiple)
(default-geofield flat-form)
From a list of geofields, get the default one to map. Implementation: pick first geoshape if any, else pick first geofield.
From a list of geofields, get the default one to map. Implementation: pick first geoshape if any, else pick first geofield.
(default-lang languages)
Get default language (English or alphabetical first) from within a list.
Get default language (English or alphabetical first) from within a list.
(field-name-in-set? names field)
Helper function: is the :name of a field among a set of names
Helper function: is the :name of a field among a set of names
(field-type-in-set? types field)
Helper function: is the :type of a field among a set of types
Helper function: is the :type of a field among a set of types
(flatten-form {:keys [children] :as form} & {:keys [flatten-repeats?]})
Input: map derived from form.json. Output: a flattened vector; each element is a field; a field is a {:name .. :label .. :type ..} map. By default, REPEAT BLOCKS ARE NOT FLATTENED, repeat blocks represent subforms, which need special handling in most cases. :flatten-repeats? overrides default behavior, also flattens repeats.
Input: map derived from form.json. Output: a flattened vector; each element is a field; a field is a {:name .. :label .. :type ..} map. By default, REPEAT BLOCKS ARE NOT FLATTENED, repeat blocks represent subforms, which need special handling in most cases. :flatten-repeats? overrides default behavior, also flattens repeats.
(format-answer field
answer
&
{:keys [language compact? label field-key media record-modal?
media-count total-media]
:or {field-key :name record-modal? false}})
String representation for a particular field datapoint (answer). re-formatting depends on field type, eg. name->label substitution. Optional: compact? should be true if a short string needs to be returned.
String representation for a particular field datapoint (answer). re-formatting depends on field type, eg. name->label substitution. Optional: compact? should be true if a short string needs to be returned.
(geofields flat-form)
Get just the geofields from the form.
Get just the geofields from the form.
(get-column-class field)
Assign class according to field type category, e.g. integer & decimals are both in the numeric category
Assign class according to field type category, e.g. integer & decimals are both in the numeric category
(get-icon field)
Get the icon relevant to the given field (depending on its type).
Get the icon relevant to the given field (depending on its type).
(get-label {:keys [label name]} & [language])
Gets the label object out of a map with key :label (eg. a field). If multiple languages, and none specified, picks out alphabetically first.
Gets the label object out of a map with key :label (eg. a field). If multiple languages, and none specified, picks out alphabetically first.
(get-languages form)
Get the languages for a given form.
Get the languages for a given form.
(group? field)
Checks whether a field in a form (ie, a field) is a group field
Checks whether a field in a form (ie, a field) is a group field
(has-data? field)
Returns false for fields such as note, group, etc. which don't have data
Returns false for fields such as note, group, etc. which don't have data
(infor-icon-component answer & {:keys [media-count total-media help-url]})
Returns an infor icon with a tooltip message
Returns an infor icon with a tooltip message
(media-files-upload-error-component answer
&
{:keys [help-url error-message
record-modal?]})
Displays tip question and tooltip msg for failed media files uploads
Displays tip question and tooltip msg for failed media files uploads
(meta-fields flat-form
&
{:keys [relabel? with-submission-details?] :or {relabel? true}})
Get just the meta fields out of the form. Options to re-label meta fields, or include submission time in meta list.
Get just the meta fields out of the form. Options to re-label meta fields, or include submission time in meta list.
(multilingual? form)
Does this form contain labels in multiple languages?
Does this form contain labels in multiple languages?
(name-label-map {:keys [children name label] :as child}
prefix
acc
flatten-repeats?)
(non-meta-fields flat-form)
Get just the fields in this form that are not meta fields.
Get just the fields in this form that are not meta fields.
(note? field)
Checks whether a field in a form (a field) is a group field
Checks whether a field in a form (a field) is a group field
(numeric? field)
Checks whether a field is a numeric field
Checks whether a field is a numeric field
(relabel-meta-field {:keys [label name type] :as field})
Try and produce a label for meta field if non-existent.
Try and produce a label for meta field if non-existent.
(repeat? field)
Checks whether a field in a form (ie, a field) is a repeat field
Checks whether a field in a form (ie, a field) is a repeat field
(select-all? field)
Checks whether a field is a select multiple (select all that apply) field
Checks whether a field is a select multiple (select all that apply) field
(select-one? field)
Checks whether a field is a select one field
Checks whether a field is a select one field
(text? field)
Checks whether a field is a text / string field.
Checks whether a field is a text / string field.
(time-based? field)
Checks whether a field is a date or a time field
Checks whether a field is a date or a time field
(uses-search-expression? appearance-value)
Checks if the appearance-value has the search expression
Checks if the appearance-value has the search expression
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close