...
From a configuration perspective, a search bar is defined by an object with following properties:
hideSide
:Boolean
boolean
- Defines if a side search should be displayedfilters
:Array<SearchItem>
- Defines the items that are used as search entries. Each item will at that level will reflect either:A button in the search bar
An entry in the side search (entry must describe a tree field filter)
...
A SearchItem can be one of the following:
A
String
reflectingstring
referencing aNamedFilterConfig
An
ItemFilterConfiguration
ItemFilterConfig
A
GroupFilterConfiguration
GroupFilterConfig
NamedFilterConfig
description
...
NamedFilterConfig
are defined in $.common.namedFilters
. It can be one of:
A
String
string
reflecting aNamedFilterConfig
A
String
string
reflecting a field name (as defined in the admin structure area)An
ItemFilterConfiguration
ItemFilterConfig
A
CustomConstraintFilterConfig
A
GroupFilterConfiguration
GroupFilterConfig
...
ItemFilterConfig
description
An ItemFilterConfiguration
ItemFilterConfig
reflects a single filter. It can be defined as:
A
String
string
representing the field you want to create a filter from. In such case, default behaviour of this filter will be defined base on the field type. This is equivalent to creating a FieldFilterConfig by only specifying the field property:Code Block language json "myfieldname" // equivalent to { "field": "myfieldname" }
An
FieldFilterConfig
describing the filter.
...
Property | Type | Default | Description |
---|---|---|---|
|
|
| When set to true, the field button won’t show by default. User will need to select the field from the + button |
|
|
| Allows to add one or more classes to the component |
|
|
| Allows to force a component to be used. Usage of this property is discouraged. |
|
| value of | Name of the constraint to which this filter applies |
|
|
| When set to true, the filter is considered as a custom parameter and sent as such to the REST service |
|
|
| The name of the field on which the filter applies. If not provided, the filter will be resolved as a |
|
|
| I18n key to use for the button of the field |
| String |
field label if i18n not available | The label of the button |
...
Property | Type | Default | Description |
---|---|---|---|
|
|
| Shows boolean filter as a Switch |
...
Boolean filter when inline
is false
or undefined
...
Boolean property when inline
is true
Additional FieldFilterConfig
properties for Date
fields
Property | Type | Default | Description |
---|---|---|---|
|
|
| Adds ability to filter between two dates |
|
|
| Can only define one value: |
|
|
| Allows to define “built-in” constraints for searching on the date field: |
...
Property | Type | Description |
---|---|---|
|
| Label of the constraint |
|
| The constraint to apply on the date field |
...
Property | Type | Default | Description |
---|---|---|---|
|
| Resolved from the field referenced resource | Allows to force not using a tree filter for a tree field. |
...
Property | Type | Default | Description |
---|---|---|---|
|
| One of Defines how aggregates should be used
| |
|
|
| Name of the cursor, or cursor definition to use for displaying possible relationship values. If an empty object, an anonymous cursor is created based on the field’s related resource |
|
|
| Max number of displayed items |
|
| If the field is a child, If the field is a childmultiple,
| The operator to use for the filter |
|
|
| Enable searching when number of possible values reaches this value |
...
Property | Type | Default | Description |
---|---|---|---|
|
|
| Allows to display |
|
|
| Allows to use an alternate layout. |
|
|
| The operator to use for the filter |
|
|
| Allows to move the filter to the side of the search bar |
|
|
| Allows to define the default filter to use in the side panel when multiple are available |
|
|
| Name of the tree, or tree definition to use for displaying possible relationship values. If an empty object, an anonymous tree is created based on the field’s related resource |
...
Tree relationship with folder layout
Tree relationship with empty layout
...
Additional FieldFilterConfig
for tree String
fields
Property | Type | Default | Description |
---|---|---|---|
|
|
| Will use each operator to produce an input |
CustomConstraintFilterConfig
description
CustomConstraintFilterConfig
allows to define a filter that relies on filters applying to multiple fields.
Property | Type | Default | Description |
---|---|---|---|
|
|
| When set to true, the field button won’t show by default. User will need to select the field from the + button |
|
|
| Allows to add one or more classes to the component |
|
|
| Allows to force a component to be used. Usage of this property is discouraged. |
|
| value of | Name of the constraint to which this filter applies |
|
|
| The filter’s constraint. |
|
|
| I18n key to use for the button of the field |
|
|
field label if i18n not available | The label of the button |
GroupFilterConfig
description
A GroupFilterConfig
allows to group multiple ItemFilterConfig
or GroupFilterConfig
together.
For easier configuration, a GroupFilterConfig can de defined as a simple Array, where:
The first item in the array is either:
a
string
(the value is considered to be an i18n keyan
Array<string>
wherefirst item is an i18n key
second item is a css selector used for displaying the icon
an
Object
null
Other items are all of type
SearchItem
On such configuration, this array is transformed by the application into a GroupFilterConfig
object:
Code Block |
---|
["some.key", "item1", "item2"] |
is equivalent to:
Code Block |
---|
{
"i18n": "some.key",
"config": ["item1", "item2"]
} |
Code Block |
---|
[{...props}, "item1", "item2"] |
is equivalent to:
Code Block |
---|
{
...props,
"config": ["item1", "item2"]
} |
Code Block |
---|
[["some.key", "far fa-cog"], "item1", "item2"] |
is equivalent to:
Code Block |
---|
{
"i18n": "some.key",
"icon": "far fa-cog",
"config": ["item1", "item2"]
} |
Code Block |
---|
[null, "item1", "item2"] |
is equivalent to:
Code Block |
---|
{
"config": ["item1", "item2"]
} |
GroupFilterConfig
properties
Property | Type | Default | Description |
---|---|---|---|
|
|
| The i18n key of the group name |
|
|
| The icon for the group button |
|
|
| The |
GroupTabWrapper
additional properties
A tabs
property can be provided to define how to organise , items within the groups.
Passing tabs as an Array
Use the array syntax for static tabs. Each item within the tabs array should be an object with following properties:
Property | Type | Default | Description |
---|---|---|---|
|
|
| The i18n key of the tab name |
|
|
| The content of the tab |
Passing tabs as an Object
Use the object syntax if you want to generate the tabs as values of a filter. On such circumstance, tabs should be an object with following properties:
Property | Type | Default | Description |
---|---|---|---|
|
|
| A This |
|
|
| The content of the tab. Each key should be the value of the |
GroupWrapper
additional properties
Property | Type | Default | Description |
---|---|---|---|
|
|
| When defined, allows to group constraints from nested configs with logical operators |
|
|
| When set to |