Components
<AssociationSelector/>
Displays the currently associated entities of a many-to-many relationship as seen from one of the associated sides.
Props
Name | Type | Description |
---|---|---|
display | string or func | Path to use as display value for associations or render function for associations ( linkObj => ReactElement ). |
value | string | Path to use as the representative value / id of the link |
query | instance of GraphQLQuery | iQuery GraphQL query to fetch the current list of target objects |
queryCondition | instance of Condition or func | Optional FilterDSL condition to be applied to the execution of the AssociationSelector's query |
modalTitle | string | Title for the modal dialog selecting the target object |
name | string | Name / 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 |
mode | FieldMode value | Mode for this calendar field. If not set or set to null, the mode will be inherited from the <Form/> or <FormBlock>. |
helpText | string | Additional help text for this field. Is rendered for non-erroneous fields in place of the error. |
label | string | Label for the field. Must be defined if name is missing. |
labelClass | string | Additional HTML classes for the label element. |
formGroupClass | string | Additional HTML classes for the form group element. |
fade | bool | Whether to do the modal fade animation on selection (default is true) |
generateId | func | Function 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). |
onNew | func | Optional callback function that is called for every newly created association link and allows to modify properties on that new link. ( link => ... ) |
disabled | bool or func | Disables the AssociationSelector. Can be defined as callback function. |
alignPagination | string | set the pagination alignment of the datagrid in the modal ("left" [default], "center", "right") |
paginationPageSizes | Array of string or number | set 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
Name | Type | Description |
---|---|---|
name | string | Name / path for this field (e.g. "name", but also "foos.0.name") |
deleteRemoved | bool | If true, delete removed attachments from the database, otherwise just de-reference them. (default is true) |
mode | FieldMode value | Mode for this field. If not set or set to null, the mode will be inherited from the <Form/> or <FormBlock>. |
helpText | string or func or element | Additional 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) |
tooltip | string | Tooltip / title attribute for the input element |
label | string | Label for the field. |
labelClass | string | Additional HTML classes for the label element. |
formGroupClass | string | Additional HTML classes for the form group element. |
addons | array | Array 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. |
onChange | func | Optional local on-change handler ( ({oldValue, fieldContext}, value) => ... ) |
<AttachmentLink/>
Renders a link to an attachment
Props
Name | Type | Description |
---|---|---|
attachment | object | An App_Attachment structure / observable |
className | string | Additional HTML classes for the attachment link. |
disabled | bool | True if the attachment link should be disabled |
<Button/>
no description
Props
Name | Type | Description |
---|---|---|
transition | string | Transition reference. button must have either a `transition` or an `action` attribute. |
className | string | Additional button classes |
text | string | Text for the button |
tooltip | string | Text for the button |
disabled | func | Additional 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. |
context | any | Explicitly sets the button context to the given object. If no context is given, the form base object of the surrounding form is used. |
action | func | Optional action function, receives the context as argument |
type | string | the type of the button, defaults to "button" |
<CalendarField/>
no description
Props
Name | Type | Description |
---|---|---|
minDate | instance of DateTime | Minimum date the user can select |
maxDate | instance of DateTime | Maximum date the user can select |
name | string | Name / path for the calendar field value (e.g. "name", but also "foos.0.name") |
mode | FieldMode value | Mode for this calendar field. If not set or set to null, the mode will be inherited from the <Form/> or <FormBlock>. |
helpText | string or func or element | Additional 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) |
tooltip | string | Tooltip / title attribute for the input element |
label | string | Label for the field. |
placeholder | string | Placeholder text to render for text inputs. |
inputClass | string | Additional HTML classes for the input element. |
labelClass | string | Additional HTML classes for the label element. |
formGroupClass | string | Additional HTML classes for the form group element. |
addonClass | string | Additional HTML classes for the calendar button addon |
dateFormat | string | Date format string to use for "Date" typed fields. |
autoFocus | bool | Pass-through autoFocus attribute for the Calendar input field |
timestampFormat | string | Date format string to use for "Timestamp" typed fields. |
onChange | func | Optional local on-change handler ( ({oldValue, fieldContext}, value) => ... ) |
<CollapsiblePanel/>
no description
Props
Name | Type | Description |
---|---|---|
header | string or element | the header of the section and also the tooltip of the shortcut link |
collapsed | bool | defines 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
Name | Type | Description |
---|---|---|
collapsedLabelText | string | The text shown, if the element is collapsed |
maxWidth | string | the upper boundary that will be used for drag resizing\ allowed units: px, vw, vh\ defaults to 400px |
minWidth | string | the lower boundary that will be used for drag resizing\ allowed units: px, vw, vh\ defaults to 100px |
width | string | the 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{@observablefoos = injection(// language=GraphQL`query iQueryFoo($config: QueryConfigInput!){iQueryFoo(config: $config){typecolumnStates{nameenabledsortable}queryConfig{idconditioncurrentPagepageSizesortOrder{fields}}rows{idnamenumowner{idlogin}}rowCount}}`,{"config": {"pageSize": 20}});}
You can use a DataGrid component like this
<DataGridvalue={ scope.foos }><DataGrid.Columnheading={ "Action" }>{foo => (<ButtonclassName="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.Columnheading={ 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
Name | Type | Description |
---|---|---|
tableClassName | string | Additional classes to set on the table element. (default is "table-hover table-striped table-bordered") |
rowClasses | func | Function to produce additional classes for each row ( context => classes ) |
filterTimeout | number | Timeout 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. |
isCompact | bool | use compact datagrid mode where by defaul all colums use minimal space (except for the last) and enhanced size parameters are enabled per column |
workingSet | instance of WorkingSet | Working set with in-memory objects to be mixed in |
alignPagination | string | set the pagination alignment ("left" [default], "center", "right") |
moveRowColumn | string | The 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. |
moveRowHandler | func | Handler 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 |
paginationPageSizes | Array of string or number | set the available page sizes for the pagination |
displayControlButtons | bool | set whether the control buttons should be displayed or not |
resetFilterButtonDisabled | bool | set whether the "Reset Filters" button is disabled or not |
customizeColumnsButtonDisabled | bool | set whether the "Customize Columns" button is disabled or not |
tableConfig | object | the user table configuration |
onTableConfigChange | func | the function called on changes to the user table configuration |
<DateRangeField/>
no description
Props
Name | Type | Description |
---|---|---|
minDate | instance of DateTime | Minimum date the user can select |
maxDate | instance of DateTime | Maximum date the user can select |
name | string | Name / path for the calendar field value (e.g. "name", but also "foos.0.name") |
mode | FieldMode value | Mode for this calendar field. If not set or set to null, the mode will be inherited from the <Form/> or <FormBlock>. |
helpText | string or func or element | Additional 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) |
tooltip | string | Tooltip / title attribute for the input element |
label | string | Label for the field. |
placeholder | string | Placeholder text to render for text inputs. |
inputClass | string | Additional HTML classes for the input element. |
labelClass | string | Additional HTML classes for the label element. |
formGroupClass | string | Additional HTML classes for the form group element. |
addonClass | string | Additional HTML classes for the calendar button addon |
dateFormat | string | Date format string to use for "Date" typed fields. |
autoFocus | bool | Pass-through autoFocus attribute for the Calendar input field |
timestampFormat | string | Date format string to use for "Timestamp" typed fields. |
onChange | func | Optional local on-change handler ( ({oldValue, fieldContext}, value) => ... ) |
<DecimalField/>
no description
Props
Name | Type | Description |
---|---|---|
name | string | Name / path for this field (e.g. "name", but also "foos.0.name") |
mode | FieldMode value | Mode for this field. If not set or set to null, the mode will be inherited from the <Form/> or <FormBlock>. |
helpText | string or func or element | Additional 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) |
tooltip | string | Tooltip / title attribute for the input element |
label | string | Label for the field. |
placeholder | string | Placeholder text to render for text inputs. |
inputClass | string | Additional HTML classes for the input element. |
labelClass | string | Additional HTML classes for the label element. |
formGroupClass | string | Additional HTML classes for the form group element. |
onChange | func | Optional local on-change handler ( ({oldValue, fieldContext}, value) => ... ) |
onBlur | func | Optional blur handler to use |
autoFocus | bool | Pass-through autoFocus attribute for text inputs |
addons | array | Array 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. |
precision | number | Numerical precision for big decimal fields. (e.g. 123.45 has a scale of 5) |
scale | number | Numerical scale / number of fractional digits for big decimal fields |
<DomainActivityIndicator/>
no description
Props
Name | Type | Description |
---|---|---|
monitor | instance of Monitor | Monitor object provided by useMonitor() |
domainType | string | Domain type of the entity to show activity for |
id | any | Id of the entity to show activity for |
version | string | Version of the entity if used together with merging. Prevents false-positive changes |
<DropdownMenu/>
Simplified Dropdown Menu component with a local open state handling. Simply wrap Buttons or DropdownItems in this component.
Props
Name | Type | Description |
---|---|---|
text | string or func | Optional text or render function to change the labeling of the dropdown button. Default is a vertical ellipsis icon. |
title | string | Optional title to change the tooltip of the dropdown button. |
inline | bool | Optional inline mode switch for the dropdown button to not be floated to the right. |
<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
Name | Type | Description |
---|---|---|
subProcess | string | Subprocess to call from the button. Will receive the input parameters "processName", "state", and "fieldName". |
icon | string | Icon to use for the button. Default is fa-cog. |
label | string | Text to use for the button. Default is `i18n("Configure Field")` |
mini | bool | If false, use label in button, otherwise just use aria-label |
dialogOptions | object | Process 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
Name | Type | Description |
---|---|---|
display | string or func | Property 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 InteractiveQuery | iQuery GraphQL query to fetch the current list of target objects or iQuery document containing all values |
queryCondition | instance of Condition or func | Optional FilterDSL condition to be applied to the execution of the FKSelector's query |
modalTitle | string | Title for the modal dialog selecting the target object |
name | string | Name / path for the foreign key value (e.g. "name", but also "foos.0.name"). |
mode | FieldMode value | Mode for this foreign key selector. If not set or set to null, the mode will be inherited from the <Form/> or <FormBlock>. |
modalFilter | enum | Filter mode for the selector modal. Controls display of column and repeated search filter in interaction with the searchFilter prop, |
helpText | string or func or element | Additional 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) |
tooltip | string | Tooltip / title attribute for the input element |
label | string | Label for the field. Must be defined if name is missing. |
inputClass | string | Additional HTML classes for the display value. |
labelClass | string | Additional HTML classes for the label element. |
formGroupClass | string | Additional HTML classes for the form group element. |
fade | bool | Whether to do the modal fade animation on selection (default is true) |
autoFocus | bool | True to focus the fk selector input (See `searchFilter` ) |
searchFilter | string or func | Field 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.) |
searchTimeout | number | Timeout in ms after which the input will do the validation query ( default: 350). |
placeholder | string | Placeholder for input (See `searchFilter`) |
cachedPageSize | number | Page size to use when using an in-memory iQuery document as data source. (Default is 5) |
validate | func | Optional validation handler ( (ctx, value) => error(s) ). |
validateAsync | func | Optional async validation handler ( (ctx, value) => Promise<error(s)> ). |
onChange | func | Optional extended local on-change handler ({oldValue, oldRow, row, fieldContext)}, value => ...) |
visibleColumns | string or Array of string | Optional 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. |
alignPagination | string | set the pagination alignment of the datagrid in the modal ("left" [default], "center", "right") |
paginationPageSizes | Array of string or number | set the available page sizes for the datagrid pagination |
<Link/>
Special automaton link that can do process changes within the current page context. You can use it like a normal link and if the URI patterns match, it will do its magic thing and otherwise it will just be a link.
Props
Name | Type | Description |
---|---|---|
href | string | Internal URI ( required ) |
title | string | Optional title attribute |
role | string | Optional role attribute |
className | string | Classes for the link element ( "link-internal" is added ) |
<LogoutForm/>
A CSRF-protection-compliant Spring security log out-form
Props
Name | Type | Description |
---|---|---|
renderUser | func | Optional render function to render the part before the logout button. |
<Pagination/>
Pagination component
Props
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
formConfig | instance of FormConfig | Form config of form to track. |
<Section/>
Create a form section This component registers the section to the shortcut context
Props
Name | Type | Description |
---|---|---|
id | string | the id of the resulting html element |
icon | string or func | the icon used for the shortcut link can either be a fontawesome key or a render function |
heading | string | the header of the section and also the tooltip of the shortcut link |
headingRenderer | string or func | defines how the header of the section is rendered, default is a render as h2 |
hideHeader | bool | if set to true, the card header will be set to be visible for screenreaders only |
formContext | instance of FormContext | the used FormContext defaults to the default FormContext |
collapsible | bool | defines if this section is collapsible or not |
initiallyCollapsed | bool | if 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
Name | Type | Description |
---|---|---|
onChange | func | Optional change handler. If not set, the current selection is stored as cookie. |
<Tree/>
Root tree component.
Props
Name | Type | Description |
---|---|---|
id | string | Unique HTML element id for the tree |
aria-labelledby | string | Pass-trough attribute for the aria-labelledby of the tree. |
options | shape | Tree options |
<URLField/>
no description
Props
Name | Type | Description |
---|---|---|
name | string | Name / path for this field (e.g. "name", but also "foos.0.name") |
mode | FieldMode value | Mode for this field. If not set or set to null, the mode will be inherited from the <Form/> or <FormBlock>. |
helpText | string or func or element | Additional 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) |
tooltip | string | Tooltip / title attribute for the input element |
label | string | Label for the field. |
placeholder | string | Placeholder text to render for text inputs. |
inputClass | string | Additional HTML classes for the input element. |
labelClass | string | Additional HTML classes for the label element. |
formGroupClass | string | Additional HTML classes for the form group element. |
onChange | func | Optional local on-change handler ( ({oldValue, fieldContext}, value) => ... ) |
onBlur | func | Optional blur handler to use |
autoFocus | bool | Pass-through autoFocus attribute for text inputs |
addons | array | Array 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
Name | Type | Description |
---|---|---|
isOpen | bool | set whether the Modal is open or closed |
toggle | func | function used to toggle Modal open / closed |
inactiveElements | array | list of inactive (not displayed) columns |
activeElements | array | list of active (displayed) columns |
onSubmit | func | submit 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
Name | Type | Description |
---|---|---|
filter | Object | Filter 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
Name | Type | Description |
---|---|---|
domainType | String | domain type name |
id | String | id value |
version | String | version string |
Return Value
Type: booleanalways true