Support for generated reports. Report rendering is pluggable, so reports can be quite varied. The general definition of a report is a component that loads data and displays it, possibly paginates, sorts and filters it, but for which interactions are done via custom mutations (disable, delete, sort) or reloads.
Reports can customize their layout via plugins, and the layout can then allow futher nested customization of element render. For example, it is trivial to create a layout renderer that is some kind of graph, and then use loaded data as the input for that display.
Customizing the report's state machine and possibly wrapping it with more complex layout controls makes it possible to create UI dashboards and much more complex application features.
Support for generated reports. Report rendering is pluggable, so reports can be quite varied. The general definition of a report is a component that loads data and displays it, possibly paginates, sorts and filters it, but for which interactions are done via custom mutations (disable, delete, sort) or reloads. Reports can customize their layout via plugins, and the layout can then allow futher nested customization of element render. For example, it is trivial to create a layout renderer that is some kind of graph, and then use loaded data as the input for that display. Customizing the report's state machine and possibly wrapping it with more complex layout controls makes it possible to create UI dashboards and much more complex application features.
(column-classes report-instance-or-class
{:com.fulcrologic.rad.report/keys [column-class]
:com.fulcrologic.rad.attributes/keys [qualified-key]
:as attr})
Returns a string of column classes that can be defined on the attribute at ::report/column-class or on the report in the ::report/column-classes map. The report map overrides the attribute
Returns a string of column classes that can be defined on the attribute at ::report/column-class or on the report in the ::report/column-classes map. The report map overrides the attribute
(control-renderer report-instance)
Get the report controls renderer for the given report instance.
Get the report controls renderer for the given report instance.
(current-control-parameters
{:com.fulcrologic.fulcro.ui-state-machines/keys [state-map] :as env})
Internal state machine helper. May be used by extensions to the stock state machine.
Internal state machine helper. May be used by extensions to the stock state machine.
(current-page report-instance)
(current-page state-map report-class-or-registry-key)
Returns the current page number displayed on the report
Returns the current page number displayed on the report
(current-rows report-instance)
Get a vector of the current rows that should be shown by the renderer (sorted/paginated/filtered). report-instance
is available in the rendering env
.
Get a vector of the current rows that should be shown by the renderer (sorted/paginated/filtered). `report-instance` is available in the rendering `env`.
(currently-selected-row report-instance)
(currently-selected-row state-map report-class-or-registry-key)
Returns the currently-selected row index, if any (-1 if nothing is selected).
Returns the currently-selected row index, if any (-1 if nothing is selected).
(defsc-report sym arglist & args)
Define a report. Just like defsc, but you do not specify query/ident/etc.
Instead, use report-options (aliased as ro below):
ro/columns ro/route ro/row-pk ro/source-attribute
If you elide the body, one will be generated for you.
Define a report. Just like defsc, but you do not specify query/ident/etc. Instead, use report-options (aliased as ro below): ro/columns ro/route ro/row-pk ro/source-attribute If you elide the body, one will be generated for you.
(filter-rows {:com.fulcrologic.fulcro.ui-state-machines/keys [state-map]
:as uism-env})
Generates filtered rows, which is an intermediate cached value (not displayed). This function is used in the internal state machine, and may be useful when extending the pre-defined machine.
Generates filtered rows, which is an intermediate cached value (not displayed). This function is used in the internal state machine, and may be useful when extending the pre-defined machine.
(filter-rows! this)
(filter-rows! app class-or-reg-key)
Update the filtered rows based on current report parameters.
Update the filtered rows based on current report parameters.
(form-link report-instance row-props column-key)
Get the form link info for a given (column) key.
Returns nil if there is no link info, otherwise returns:
{:edit-form FormClass
:entity-id id-of-entity-to-edit}
Get the form link info for a given (column) key. Returns nil if there is no link info, otherwise returns: ``` {:edit-form FormClass :entity-id id-of-entity-to-edit} ```
(formatted-column-value report-instance
row-props
{:com.fulcrologic.rad.report/keys
[field-formatter column-formatter column-styles]
:com.fulcrologic.rad.attributes/keys [qualified-key
type style]
:as column-attribute})
Given a report instance, a row of props, and a column attribute for that report: returns the formatted value of that column using the field formatter(s) defined on the column attribute or report. If no formatter is provided a default formatter will be used.
Given a report instance, a row of props, and a column attribute for that report: returns the formatted value of that column using the field formatter(s) defined on the column attribute or report. If no formatter is provided a default formatter will be used.
(goto-page! this page-number)
(goto-page! app class-or-reg-key page-number)
Move to the next page (if there is one)
Move to the next page (if there is one)
(goto-page* env page)
Internal state machine implementation. May be used by extensions to the stock state machine.
Internal state machine implementation. May be used by extensions to the stock state machine.
(handle-filter-event {:com.fulcrologic.fulcro.ui-state-machines/keys [app]
:as env})
Internal state machien implementation of handling :event/filter.
Internal state machien implementation of handling :event/filter.
(handle-resume-report
{:com.fulcrologic.fulcro.ui-state-machines/keys [state-map] :as env})
Internal state machine implementation. Called on :event/resumt to do the steps to resume an already running report that has just been re-mounted.
Internal state machine implementation. Called on :event/resumt to do the steps to resume an already running report that has just been re-mounted.
(initialize-parameters
{:com.fulcrologic.fulcro.ui-state-machines/keys [app event-data] :as env})
(install-formatter! app type style formatter)
Install a formatter for the given data type and style. The data type must match a supported data type
of attributes, and the style can either be :default
or a user-defined keyword the represents the
style you want to support. Some common styles have predefined support, such as :USD
for US Dollars.
This should be called before mounting your app.
Ex.:
(install-formatter! app :boolean :default (fn [report-instance value] (if value "yes" "no")))
Install a formatter for the given data type and style. The data type must match a supported data type of attributes, and the style can either be `:default` or a user-defined keyword the represents the style you want to support. Some common styles have predefined support, such as `:USD` for US Dollars. This should be called before mounting your app. Ex.: ```clojure (install-formatter! app :boolean :default (fn [report-instance value] (if value "yes" "no"))) ```
(link report-instance row-props column-key)
Get a regular lambda link for a given (column) key.
Returns nil if there is no link info, otherwise returns:
{:edit-form FormClass
:entity-id id-of-entity-to-edit}
Get a regular lambda link for a given (column) key. Returns nil if there is no link info, otherwise returns: ``` {:edit-form FormClass :entity-id id-of-entity-to-edit} ```
(loading? report-instance)
Returns true if the given report instance has an active network load in progress.
Returns true if the given report instance has an active network load in progress.
(next-page! this)
(next-page! app class-or-reg-key)
Move to the next page (if there is one)
Move to the next page (if there is one)
(page-count report-instance)
(page-count state-map report-class-or-registry-key)
Returns how many pages the current report has.
Returns how many pages the current report has.
(page-number-changed env)
Internal state machine helper. May be used by extensions. Sends a message to routing system that the page number changed.
Internal state machine helper. May be used by extensions. Sends a message to routing system that the page number changed.
(populate-current-page uism-env)
Internal state machine implementation. May be used by extensions to the stock state machine.
Internal state machine implementation. May be used by extensions to the stock state machine.
(postprocess-page uism-env)
Internal state machine helper.
Apply the user-defined UISM operation to the report state machine just after the current page has been populated. The :current-rows alias will have the result of filter/sort/paginate, and the report actor is :actor/report. See the definition of the report state machine for more information.
Internal state machine helper. Apply the user-defined UISM operation to the report state machine just after the current page has been populated. The :current-rows alias will have the result of filter/sort/paginate, and the report actor is :actor/report. See the definition of the report state machine for more information.
(preprocess-raw-result uism-env)
Internal state machine implementation. May be used by extensions to the stock state machine. Apply the raw result transform, if it is defined.
Internal state machine implementation. May be used by extensions to the stock state machine. Apply the raw result transform, if it is defined.
(prior-page! this)
(prior-page! app class-or-reg-key)
Move to the next page (if there is one)
Move to the next page (if there is one)
Alias to control/run!
. Runs the report.
Alias to `control/run!`. Runs the report.
(report-ident report-class-or-registry-key)
Returns the ident of a RAD report. The parameter can be a react instance, a class, or the registry key(word) of the report.
Returns the ident of a RAD report. The parameter can be a react instance, a class, or the registry key(word) of the report.
(report-options uism-env & k-or-ks)
Returns the report options from the current report actor.
Returns the report options from the current report actor.
(rotate-result report-class grouped-result)
Given a report class that has columns, and a raw result grouped by those columns: returns a vector of rows that rotate the grouped result into a normal report shape.
Given a report class that has columns, and a raw result grouped by those columns: returns a vector of rows that rotate the grouped result into a normal report shape.
(route-params-path env control-key)
Internal state machine helper. May be used by extensions to the stock state machine.
Internal state machine helper. May be used by extensions to the stock state machine.
(run-report! this)
(run-report! app-ish class-or-registry-key)
Run a report with the current parameters
Run a report with the current parameters
[instance k v]
Alias to control/set-parameter!
. Set the given parameter value on the report. Usually used internally by controls.
[instance k v] Alias to `control/set-parameter!`. Set the given parameter value on the report. Usually used internally by controls.
(sort-rows {:com.fulcrologic.fulcro.ui-state-machines/keys [state-map]
:as uism-env})
Sorts the filtered rows. Input is the cached intermediate filtered rows, output is cached sorted rows (not visible). This function is used in the internal state machine, and may be useful when extending the pre-defined machine.
Sorts the filtered rows. Input is the cached intermediate filtered rows, output is cached sorted rows (not visible). This function is used in the internal state machine, and may be useful when extending the pre-defined machine.
(sort-rows! this by-attribute)
(sort-rows! app class-or-reg-key by-attribute)
Sort the report by the given attribute. Changes direction if the report is already sorted by that attribute. The implementation
of sorting is built-in and uses compare, but you can override how sorting works by defining ::report/sort-rows
on your report.
Sort the report by the given attribute. Changes direction if the report is already sorted by that attribute. The implementation of sorting is built-in and uses compare, but you can override how sorting works by defining `::report/sort-rows` on your report.
(start-report! app report-class)
(start-report! app report-class options)
Start a report. Not normally needed, since a report is started when it is routed to; however, if you put a report on-screen initially (or don't use dynamic router), then you must call this to start your report.
options
can contain ::id
, which will cause an instance of the report to be started. Used by containers so that
multiple instances of the same report can co-exist with different views on the same screen.
Start a report. Not normally needed, since a report is started when it is routed to; however, if you put a report on-screen initially (or don't use dynamic router), then you must call this to start your report. `options` can contain `::id`, which will cause an instance of the report to be started. Used by containers so that multiple instances of the same report can co-exist with different views on the same screen.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close