Components

<AssociationSelector/>

Displays the currently associated entities of a many-to-many relationship as seen from one of the associated sides.

Props

NameTypeDescription
display string or funcPath to use as display value for associations or render function for associations ( linkObj => ReactElement ).
valuestringPath to use as the representative value / id of the link
query instance of GraphQLQueryiQuery GraphQL query to fetch the current list of target objects
queryConditioninstance of Condition or funcOptional FilterDSL condition to be applied to the execution of the AssociationSelector's query
modalTitlestringTitle for the modal dialog selecting the target object
namestringName / path for the association selector field. In contrast to most normal fields this does not point to a scalar value but to list of associative entity / link table fields with embedded target objects
modeFieldMode valueMode for this calendar field. If not set or set to null, the mode will be inherited from the &lt;Form/&gt; or &lt;FormBlock&gt;.
helpTextstringAdditional help text for this field. Is rendered for non-erroneous fields in place of the error.
labelstringLabel for the field. Must be defined if name is missing.
labelClassstringAdditional HTML classes for the label element.
formGroupClassstringAdditional HTML classes for the form group element.
fadeboolWhether to do the modal fade animation on selection (default is true)
generateIdfuncFunction to return a new id value for newly created associations. Note that you can use placeholder id values. Default is to create a new UUID (NPM "uuid" v4).
onNewfuncOptional callback function that is called for every newly created association link and allows to modify properties on that new link. ( link => ... )
disabledbool or funcDisables the AssociationSelector. Can be defined as callback function.
alignPaginationstringset the pagination alignment of the datagrid in the modal ("left" [default], "center", "right")
paginationPageSizesArray of string or numberset the available page sizes for the datagrid pagination

<AttachmentField/>

Attachment form field allowing the user to upload attachments and remove attachments. Storage of the attachments has to be done with the Attachments API.

Props

NameTypeDescription
name stringName / path for this field (e.g. "name", but also "foos.0.name")
deleteRemovedboolIf true, delete removed attachments from the database, otherwise just de-reference them. (default is true)
modeFieldMode valueMode for this field. If not set or set to null, the mode will be inherited from the &lt;Form/&gt; or &lt;FormBlock&gt;.
helpTextstring or func or elementAdditional help text for this field. Is rendered for non-erroneous fields in place of the error. If a function is given, it should be a stable reference ( e.g. with useCallback()) to prevent creating the field context over and over. The same considerations apply to using elements. ( The expression <Bla/> recreates that element on every invocation, use static element references)
tooltipstringTooltip / title attribute for the input element
labelstringLabel for the field.
labelClassstringAdditional HTML classes for the label element.
formGroupClassstringAdditional HTML classes for the form group element.
addonsarrayArray of addons as props instead of as children. Only useful if you're writing a component wrapping Field and want to render your addons as field addons while using the render function form.
onChangefuncOptional local on-change handler ( ({oldValue, fieldContext}, value) => ... )

<Button/>

no description

Props

NameTypeDescription
transitionstringTransition reference. button must have either a `transition` or an `action` attribute.
classNamestringAdditional button classes
textstringText for the button
tooltipstringText for the button
disabledfuncAdditional function to check for disabled status. The default behavior is to disable the button if the button has a transition which is not discarding and there are form errors. This check runs before that and can disable the button in any case.
contextanyExplicitly sets the button context to the given object. If no context is given, the form base object of the surrounding form is used.
actionfuncOptional action function, receives the context as argument
typestringthe type of the button, defaults to "button"

<CalendarField/>

no description

Props

NameTypeDescription
minDateinstance of DateTimeMinimum date the user can select
maxDateinstance of DateTimeMaximum date the user can select
name stringName / path for the calendar field value (e.g. "name", but also "foos.0.name")
modeFieldMode valueMode for this calendar field. If not set or set to null, the mode will be inherited from the &lt;Form/&gt; or &lt;FormBlock&gt;.
helpTextstring or func or elementAdditional help text for this field. Is rendered for non-erroneous fields in place of the error. If a function is given, it should be a stable reference ( e.g. with useCallback()) to prevent creating the field context over and over. The same considerations apply to using elements. ( The expression <Bla/> recreates that element on every invocation, use static element references)
tooltipstringTooltip / title attribute for the input element
labelstringLabel for the field.
placeholderstringPlaceholder text to render for text inputs.
inputClassstringAdditional HTML classes for the input element.
labelClassstringAdditional HTML classes for the label element.
formGroupClassstringAdditional HTML classes for the form group element.
addonClassstringAdditional HTML classes for the calendar button addon
dateFormatstringDate format string to use for "Date" typed fields.
autoFocusboolPass-through autoFocus attribute for the Calendar input field
timestampFormatstringDate format string to use for "Timestamp" typed fields.
onChangefuncOptional local on-change handler ( ({oldValue, fieldContext}, value) => ... )

<CollapsiblePanel/>

no description

Props

NameTypeDescription
headerstring or elementthe header of the section and also the tooltip of the shortcut link
collapsedbooldefines if the panel is initially collapsed or expanded

<CollapsibleSidebar/>

Create a Column, that can be expanded/collapsed. This component is supposed to be used inside a flex layout (like bootstraps grid system)

Props

NameTypeDescription
collapsedLabelTextstringThe text shown, if the element is collapsed
maxWidthstringthe upper boundary that will be used for drag resizing\ allowed units: px, vw, vh\ defaults to 400px
minWidthstringthe lower boundary that will be used for drag resizing\ allowed units: px, vw, vh\ defaults to 100px
widthstringthe initial width, that will be used if the device is at least a medum size device\ allowed units: px, vw, vh\ defaults to 200px

<ConditionEditor/>

No documentation

<DataGrid/>

Data grid what works based on degenerified InteractiveQuery types.

DataGrid Examples

If we have an GraphQL query injection like this

class ExampleScope
{
@observable
foos = injection(
// language=GraphQL
`query iQueryFoo($config: QueryConfigInput!)
{
iQueryFoo(config: $config)
{
type
columnStates{
name
enabled
sortable
}
queryConfig{
id
condition
currentPage
pageSize
sortOrder{
fields
}
}
rows{
id
name
num
owner{
id
login
}
}
rowCount
}
}`,
{
"config": {
"pageSize": 20
}
}
);
}

You can use a DataGrid component like this

<DataGrid
value={ scope.foos }
>
<DataGrid.Column
heading={ "Action" }
>
{
foo => (
<Button
className="btn btn-secondary text-nowrap"
icon="fa-edit"
text="Detail"
action={ () => alert("Button for " + JSON.stringify(foo)) }
/>
)
}
</DataGrid.Column>
<DataGrid.Column name="name" filter="containsIgnoreCase"/>
<DataGrid.Column name="num" filter="eq"/>
<DataGrid.Column name="owner.login" filter="containsIgnoreCase" />
</DataGrid>

The columns render the scalar value when being self-closing and being given a field name.

Otherwise you can use a render function to render content. The render function receives the current row object as only argument.

Simple filter comparisons can be given with the filter attribute.

The standard iQuery implementation is able to follow "to One" relations of object and request those with a single joined SQL query.

Here we follow a relation named owner to a corresponding AppUser object and display owner.login as column.

Custom Filter

A client-side custom filter can be defined by giving a function to filter.

<DataGrid.Column
heading={ i18n("Sum") }
filter={ (min,max) => (
field("numa")
.add(
field(
"numb"
)
)
.between(
value(
"Int",
min
),
value(
"Int",
max
)
)
) }
>
{
(row) => row.sumA + row.sumB
}
The function can have one or more arguments.
</DataGrid.Column>

Props

NameTypeDescription
tableClassNamestringAdditional classes to set on the table element. (default is "table-hover table-striped table-bordered")
rowClassesfuncFunction to produce additional classes for each row ( context => classes )
filterTimeoutnumberTimeout in milliseconds for the filter inputs. The actual update of the filter will be delayed until this many milliseconds have passed since the last filter change.
isCompactbooluse compact datagrid mode where by defaul all colums use minimal space (except for the last) and enhanced size parameters are enabled per column
workingSetinstance of WorkingSetWorking set with in-memory objects to be mixed in
alignPaginationstringset the pagination alignment ("left" [default], "center", "right")
moveRowColumnstringThe column used for manually sorting rows. The column must contain number values. It will be rendered in front of all other columns and a grabber icon is renddered instead of the value.
moveRowHandlerfuncHandler for reacting to manual row movement. @param {Object} movedRow the row that has been moved (with the updated moveRowColumn value) @param {Object[]} sortedRows the new sorted row set @param {Number} newValue the new moveRowColumn value of the moved row
paginationPageSizesArray of string or numberset the available page sizes for the pagination
displayControlButtonsboolset whether the control buttons should be displayed or not
resetFilterButtonDisabledboolset whether the "Reset Filters" button is disabled or not
customizeColumnsButtonDisabledboolset whether the "Customize Columns" button is disabled or not
tableConfigobjectthe user table configuration
onTableConfigChangefuncthe function called on changes to the user table configuration

<DateRangeField/>

no description

Props

NameTypeDescription
minDateinstance of DateTimeMinimum date the user can select
maxDateinstance of DateTimeMaximum date the user can select
name stringName / path for the calendar field value (e.g. "name", but also "foos.0.name")
modeFieldMode valueMode for this calendar field. If not set or set to null, the mode will be inherited from the &lt;Form/&gt; or &lt;FormBlock&gt;.
helpTextstring or func or elementAdditional help text for this field. Is rendered for non-erroneous fields in place of the error. If a function is given, it should be a stable reference ( e.g. with useCallback()) to prevent creating the field context over and over. The same considerations apply to using elements. ( The expression <Bla/> recreates that element on every invocation, use static element references)
tooltipstringTooltip / title attribute for the input element
labelstringLabel for the field.
placeholderstringPlaceholder text to render for text inputs.
inputClassstringAdditional HTML classes for the input element.
labelClassstringAdditional HTML classes for the label element.
formGroupClassstringAdditional HTML classes for the form group element.
addonClassstringAdditional HTML classes for the calendar button addon
dateFormatstringDate format string to use for "Date" typed fields.
autoFocusboolPass-through autoFocus attribute for the Calendar input field
timestampFormatstringDate format string to use for "Timestamp" typed fields.
onChangefuncOptional local on-change handler ( ({oldValue, fieldContext}, value) => ... )

<DecimalField/>

no description

Props

NameTypeDescription
name stringName / path for this field (e.g. "name", but also "foos.0.name")
modeFieldMode valueMode for this field. If not set or set to null, the mode will be inherited from the &lt;Form/&gt; or &lt;FormBlock&gt;.
helpTextstring or func or elementAdditional help text for this field. Is rendered for non-erroneous fields in place of the error. If a function is given, it should be a stable reference ( e.g. with useCallback()) to prevent creating the field context over and over. The same considerations apply to using elements. ( The expression <Bla/> recreates that element on every invocation, use static element references)
tooltipstringTooltip / title attribute for the input element
labelstringLabel for the field.
placeholderstringPlaceholder text to render for text inputs.
inputClassstringAdditional HTML classes for the input element.
labelClassstringAdditional HTML classes for the label element.
formGroupClassstringAdditional HTML classes for the form group element.
onChangefuncOptional local on-change handler ( ({oldValue, fieldContext}, value) => ... )
onBlurfuncOptional blur handler to use
autoFocusboolPass-through autoFocus attribute for text inputs
addonsarrayArray of addons as props instead of as children. Only useful if you're writing a component wrapping Field and want to render your addons as field addons while using the render function form.
precisionnumberNumerical precision for big decimal fields. (e.g. 123.45 has a scale of 5)
scalenumberNumerical scale / number of fractional digits for big decimal fields

<DomainActivityIndicator/>

no description

Props

NameTypeDescription
monitor instance of MonitorMonitor object provided by useMonitor()
domainType stringDomain type of the entity to show activity for
id anyId of the entity to show activity for
versionstringVersion of the entity if used together with merging. Prevents false-positive changes

<FieldMetaButton/>

Addon button to invoke meta functionality to configure the current mask. Detects the surrounding field / process / view and invokes a subprocess with those parameters.

Props

NameTypeDescription
subProcess stringSubprocess to call from the button. Will receive the input parameters "processName", "state", and "fieldName".
iconstringIcon to use for the button. Default is fa-cog.
labelstringText to use for the button. Default is `i18n("Configure Field")`
miniboolIf false, use label in button, otherwise just use aria-label
dialogOptionsobjectProcess dialog options for the invoked subprocess.

<FKSelector/>

Renders the current value of foreign key references and allows changing of references via text-input and selection from modal grid.

Props

NameTypeDescription
displaystring or funcProperty to use as display value or render function for the current value ( formConfig => ReactElement ). Can be used to extend on simple property rendering.
query instance of GraphQLQuery or instance of InteractiveQueryiQuery GraphQL query to fetch the current list of target objects or iQuery document containing all values
queryConditioninstance of Condition or funcOptional FilterDSL condition to be applied to the execution of the FKSelector's query
modalTitlestringTitle for the modal dialog selecting the target object
name stringName / path for the foreign key value (e.g. "name", but also "foos.0.name").
modeFieldMode valueMode for this foreign key selector. If not set or set to null, the mode will be inherited from the &lt;Form/&gt; or &lt;FormBlock&gt;.
modalFilterenumFilter mode for the selector modal. Controls display of column and repeated search filter in interaction with the searchFilter prop,
helpTextstring or func or elementAdditional help text for this field. Is rendered for non-erroneous fields in place of the error. If a function is given, it should be a stable reference ( e.g. with useCallback()) to prevent creating the field context over and over. The same considerations apply to using elements. ( The expression <Bla/> recreates that element on every invocation, use static element references)
tooltipstringTooltip / title attribute for the input element
labelstringLabel for the field. Must be defined if name is missing.
inputClassstringAdditional HTML classes for the display value.
labelClassstringAdditional HTML classes for the label element.
formGroupClassstringAdditional HTML classes for the form group element.
fadeboolWhether to do the modal fade animation on selection (default is true)
autoFocusboolTrue to focus the fk selector input (See `searchFilter` )
searchFilterstring or funcField name or function returning a filter expression used to allow and validate text-input changes of the selected value. The field or filter must match exactly one element from the current `query`. (Function must be of the form `value => ...` and must return a Filter DSL condition.)
searchTimeoutnumberTimeout in ms after which the input will do the validation query ( default: 350).
placeholderstringPlaceholder for input (See `searchFilter`)
cachedPageSizenumberPage size to use when using an in-memory iQuery document as data source. (Default is 5)
validatefuncOptional validation handler ( (ctx, value) => error(s) ).
validateAsyncfuncOptional async validation handler ( (ctx, value) => Promise<error(s)> ).
onChangefuncOptional extended local on-change handler ({oldValue, oldRow, row, fieldContext)}, value => ...)
visibleColumnsstring or Array of stringOptional override for visible columns definition. By default every column returned by the query is visible. The FKSelector then checks for a "fkSelektorVisibleColumns" definition in the type metadata to filter out unneeded columns. This property overrides the type metadata value for a single FKSelector field.
alignPaginationstringset the pagination alignment of the datagrid in the modal ("left" [default], "center", "right")
paginationPageSizesArray of string or numberset the available page sizes for the datagrid pagination

<LogoutForm/>

A CSRF-protection-compliant Spring security log out-form

Props

NameTypeDescription
renderUserfuncOptional render function to render the part before the logout button.

<Pagination/>

Pagination component

Props

NameTypeDescription
pageSizes
buttonConfig

<promiseThrobber/>

Renders a page blocking throbber.

Props

No Props

<ScrollTracker/>

Tracks position changes of focused input elements to counter-act them by setting scroll values

Props

NameTypeDescription
formConfig instance of FormConfigForm config of form to track.

<Section/>

Create a form section This component registers the section to the shortcut context

Props

NameTypeDescription
id stringthe id of the resulting html element
icon string or functhe icon used for the shortcut link can either be a fontawesome key or a render function
heading stringthe header of the section and also the tooltip of the shortcut link
headingRendererstring or funcdefines how the header of the section is rendered, default is a render as h2
hideHeaderboolif set to true, the card header will be set to be visible for screenreaders only
formContextinstance of FormContextthe used FormContext defaults to the default FormContext
collapsiblebooldefines if this section is collapsible or not
initiallyCollapsedboolif the section is collapsible, defines if it is initially collapsed or not has no effect if the section is not collapsible

<ShortcutSidebar/>

Create a Column, that shows all form shortcuts from the surrounding context This component is supposed to be used inside a flex layout (like bootstraps grid system)

Props

No Props

<StyleSwitcher/>

Simple stylesheet switcher based on the server-side infrastructure around de.quinscape.automaton.runtime.provider.AlternateStyleProvider.

Props

NameTypeDescription
onChangefuncOptional change handler. If not set, the current selection is stored as cookie.

<Tree/>

Root tree component.

Tree-Navigation

The tree can be used with both mouse and keyboard.

The care-buttons open and close tree groups and load additional data on demand.

Clicking on the name of the item executes the default action or first action in the actions definition.

( See Tree.Objects and Tree.IndexedObjects )

The context-menu can be opened by right-clicking the name or combining a normal click with either ctrl, shift or alt.

Keyboard navigation

With the keyboard the menu can be opened by either pressing ctrl, shift or alt while pressing the return key or by tabbing onto a visually hidden context menu button with opens the same menu.

Navigation within the tree works via cursor keys. Up and Down move the selection one item up or down. 'Home' and 'End' key select the first or last item in the tree.

Cursor left closes the current tree group or jumps to the current parent if the group is already closed or the item has no descendants.

Cursor right opens the current tree group or jumps to the first descendant if the group is already open.

Props

NameTypeDescription
idstringUnique HTML element id for the tree
aria-labelledbystringPass-trough attribute for the aria-labelledby of the tree.
optionsshapeTree options

<URLField/>

no description

Props

NameTypeDescription
name stringName / path for this field (e.g. "name", but also "foos.0.name")
modeFieldMode valueMode for this field. If not set or set to null, the mode will be inherited from the &lt;Form/&gt; or &lt;FormBlock&gt;.
helpTextstring or func or elementAdditional help text for this field. Is rendered for non-erroneous fields in place of the error. If a function is given, it should be a stable reference ( e.g. with useCallback()) to prevent creating the field context over and over. The same considerations apply to using elements. ( The expression <Bla/> recreates that element on every invocation, use static element references)
tooltipstringTooltip / title attribute for the input element
labelstringLabel for the field.
placeholderstringPlaceholder text to render for text inputs.
inputClassstringAdditional HTML classes for the input element.
labelClassstringAdditional HTML classes for the label element.
formGroupClassstringAdditional HTML classes for the form group element.
onChangefuncOptional local on-change handler ( ({oldValue, fieldContext}, value) => ... )
onBlurfuncOptional blur handler to use
autoFocusboolPass-through autoFocus attribute for text inputs
addonsarrayArray of addons as props instead of as children. Only useful if you're writing a component wrapping Field and want to render your addons as field addons while using the render function form.

<UserColumnConfigDialogModal/>

no description

Props

NameTypeDescription
isOpenboolset whether the Modal is open or closed
togglefuncfunction used to toggle Modal open / closed
inactiveElementsarraylist of inactive (not displayed) columns
activeElementsarraylist of active (displayed) columns
onSubmitfuncsubmit function

Hooks

useAutomatonEnv()

Convenience hook to get the current automaton env from the context.


useDomainMonitor(filter)

Convenience hook to use the domain monitor for a list of domain types. Returns an observable containing the

Parameters

NameTypeDescription
filterObjectFilter expression. (see src/main/java/de/quinscape/automaton/model/domainmon/DomainActivity.java in automaton)

useEntity(domainType, id, version)

Convenience hook to register the usage of an entity with the domain monitor.

Parameters

NameTypeDescription
domainTypeStringdomain type name
idStringid value
versionStringversion string

Return Value

Type: boolean

always true