Fluent Commerce Logo
Docs
Sign In

List Component

UI Component

Changed on:

27 Sept 2024

Overview

Standard table card that takes array-like content and renders it as a table. While the Material UI table is available directly, the Mystique Table component adds several enhancements, including:

  • mapping, transforming, and translating values from the GraphQL API
  • pagination automatically hooked up to the page-level query
  • per-row and bulk user action support driven by the workflow
No alt text provided
Plugin NameCore

The standard library of mystique components. 

0000-00-00

v1.0.0

Initial changelog entry.

Alias

fc.list, shared.components.material.DynamicList (for backward compatibility with v1 manifests)

Detailed technical description

Sort Order and Page Size

The list page size and sort order can be controlled by updating the page query to either set the 

`first`
 or 
`last`
 parameter as required.

GraphQL variables are automatically generated by the OMX framework for any connection-type node, so you don't need to define them yourself. But be aware that they will be prefixed with the name (or alias if provided) of the statement that contains the connection object.

In the following example that would be 

`orders`
, so any variables passed in to control the orders connection would begin with 
`orders_`
.

1{
2    "type": "page",
3    "path": "orders",
4    "component": "fc.page",
5    "data": {
6        "query": "{ orders { edges { node { id ref type status } } } }",
7        "variables": {
8            "orders_last": 100  // 'last' means newest first
9        }
10    },
11    "descendants": [{ 
12      "component": "fc.list", 
13      "dataSource": "orders", 
14      "props": {/* config options here */} 
15    }]
16}

Language: java

Name: Example

Description:

[Warning: empty required content area]
ListColumn

`ListColumn`
extends
`DynamicValue`
and inherits all fields. In addition:

Name

Type

Required

Default

Description

align

`'left'`
 / 
`'center'`
 / 
`'center'`
 / 
`'right'`

No

`'left'`

Align column contents

hideBelow

`'xs'`
 / 
`'sm'`
 / 
`'md'`
 / 
`'lg'`
 / 
`'xl'`

No

none

Hide column at media breakpoints smaller than this

hideAbove

`'xs'`
 / 
`'sm'`
 / 
`'md'`
 / 
`'lg'`
 / 
`'xl'`

No

none

Hide column at media breakpoints larger than this

ListFilterConfig

Name

Type

Required

Default

Description

enabled

`true`

Yes

`false`

Flag to enable filters on this list

exclude

`string[]`

No

none

List of filter options to hide.

ListAction

Name

Type

Required

Default

Description

type

`"UserAction"`

Yes

n/a

Currently, it is the only supported value, but it is likely to be expanded in the future.

name

`string`

Yes

n/a

Name of the user action to enable on this list (as defined by the workflow User Action).

Density Config

Name

Type

Required

Default

Description

toggle

`Boolean`

No

`false`

Flag to enable toggle buttons on this list.

initial

`"compressed" / "standard"`

No

`standard`

Show list in compressed or standard mode.

RowConfig

Name

Type

Required

Default

Description

expansion

`MystiqueComponentInstance`

No

n/a

Configure a component to display after each row in a list. This component will receive the row data as its 

`data`
 attribute.

When the expansion row should be optional, the component should simply return 
`null`
 for rows that don't meet the criteria to display an expansion object.

toggle

`Boolean`

No

N/A

Flag to enable expansion toggle on this list


MystiqueComponentInstance

Name

Type

Required

Default

Description

component

`String`

yes

-

Component alias.

roles

`String []`

no

none

Roles assigned to the user.

descendants

`MystiqueComponentInstance[]`

no

none

List of components that can be nested inside.

props

`Record <string, any>`

no

none

Key-value set unique to the nested component.

 

RowComponentDetailed

Name

Type

Required

Default

Description

mobile

`MystiqueComponentInstance`

no

none

Component that overrides the list mobile view only.

desktop

`MystiqueComponentInstance`

no

none

Component that overrides the list desktop view only.

 


Properties

Name

Type

Required

Default

Description

title

`string`

No


The Title text of the card.

highlight

`MystiqueThemeColor`
 / 
`string`
 (hex value)

No


Show a coloured highlight above the card to denote status in cases like dashboard cards.

attributes

`ListColumn[]`
 (extension of 
`DynamicValue[]`
)

Yes


List of columns to show in the table. The label will be used as the column header and the value re-evaluated for every row within the table.

Columns may be selectively shown above or below certain media breakpoints, mapping to device widths (in pixels). By default, these breakpoints are:

  • xs, extra-small: 0px
  • sm, small: 600px
  • md, medium: 960px
  • lg, large: 1280px
  • xl, extra-large: 1920px

Hide Below prevents the column appearing when the device resolution is lower than breakpoint + 1, so columns marked 

`hideBelow:'xs'`
 would not show on devices smaller than 600px.

Hide Above can be useful when aggregating several columns for small screen resolutions. I.e. on mobile devices, 3 columns are marked 
`hideBelow:'xs'`
 but one column marked 
`hideAbove:'xs'`
 contains all three values with line breaks between.

rowLink

`string`

No


Link the entire row to the location in this template string. RowLink is evaluated per line, so can use values from the row object.

e.g. 

`"rowLink":"/orders/{{node.id}}"`
 on a list of orders would resolve to a link to the order page for that column.

Note:
1) If no rowLink is provided and the attributes object contains exactly one linked column, that link will be used by default as the rowLink template.
2) If only one rowLink is provided, clicking anywhere on the list/card will navigate to the linked page. If more than one rowLink is provided on the list/card, then clicking anywhere on the list/card will not navigate to the linked page, as there will be more than one linked page available on the list/card.

defaultPageSize

number

Yes

10

Sets the default number of rows per page value.

rowsPerPageOptions

number[]

No

[10, 25, 100]

Changes the number of rows displayed according to the selected value.

filter

`ListFilterConfig`

No


Enables and configures the filter bar at the top of the list.

Filter options will be derived from the dataSource of the list, so if the dataSource is pointing to a connection, any parameters of that connection will be presented as options, although parameters with types that don't have a matching field implementation are excluded, along with any listed in the explicit "exclude" config option.

The filter configuration modal takes its components from the FieldRegistry, so the available filter controls can be extended by SDK users. See FieldRegistry for more details.

actions

`ListAction[]`

No


Enables bulk user actions on this list. Each row will show a checkbox, and when any rows are selected a button will appear at the top of the list to open that user action.

If the user action requires additional attributes, a single form will be presented and the same values will be passed in to each selected item (e.g. on a "Mark as arrived" user action that takes a storage area, all articles will be added to the same storage area).

The actions functionality assumes that all rows in the list are eligible for the same user action (e.g. by subtype, status etc) so keep that in mind when configuring. The entity in the first row is used to look up the available user actions, so check that first if no checkboxes are appearing.

density

`Boolean`

No

false

Adds controls to configure row height. The following options are available: Compressed view with row height 28 px; Standard view with row height 52 px

row

`RowConfig`

No


Per-row configuration options.

responsiveness

`table`
 (default) / 
`card`
 / 
`forcecard`

No


Mobile-responsive option for the list. When set to "card", table rows will turn into cards on mobile devices.

When set to 

`forcecard`
 responsiveness to be ignored and card view to be set for both mobile and desktop devices.

vAlign

`String`

No

`middle`

Vertical alignment of of the content within the list. Content can be aligned to the following:

  • `bottom`
  • `middle`
     / 
    `centre`
     / 
    `center`
  • `top`

rowComponent

`MystiqueComponentInstance | RowComponentDetailed`

No


Component or set of components to override the default list views.

loading

`String`

No


The property is useful when data processing is delayed, as it helps visualize the loading state.

The loading property acts as a template and, based on the provided parameters, returns a boolean value. If the value is true, a skeleton will appear in the cell to indicate loading, replacing the data until it's ready.

Template example:

`'{{ eq order.status "BOOKED" }}'`


Configuration example

1{
2 "component": "shared.components.material.DynamicList",
3 "dataSource": "orders",
4 "props": {
5   "title": "i18n:fc.om.orders.index.list.title",
6   "filter": {
7     "enabled": true,
8     "exclude": [ "workflowRef", "workflowVersion" ]
9   },
10   "row":{
11       "expansion":{
12           "toggle":true,
13           "component": "fc.button.bar",
14           "descendants": [
15           {
16               "component": "fc.button.print.download",
17               "props": {
18               "label": "Print",
19               "href": "string",
20               "filename": "string"
21               }
22           }
23           ],
24           "props": {
25           "title": "Title"
26           }
27       }
28   },
29   "density": {
30     "toggle": true,
31     "initial": "compressed"
32   },
33   "loading": "{{ eq order.status \"BOOKED\" }}",
34   "actions": [
35     { "type": "UserAction", "name": "FLAG_AS_URGENT" }
36   ],
37   "attributes": [
38     {
39       "label": "i18n:fc.om.orders.index.list.column.orderRef.heading",
40       "value": "{{node.ref}}",
41       "link": "#/orders/{{node.id}}"
42     },
43     {
44       "label": "i18n:fc.om.orders.index.list.column.image.heading",
45       "type": "image",
46       "value": "https://fluentcommerce.com/wp-content/uploads/2019/07/fluent-commerce-logo.svg"
47     },
48     {
49       "label": "i18n:fc.om.orders.index.list.column.customer.heading",
50       "value": "{{node.customer.firstName}} {{node.customer.lastName}}"
51     },
52     {
53       "label": "i18n:fc.om.orders.index.list.column.status.heading",
54       "value": "{{node.status}}"
55     },
56     {
57       "label": "i18n:fc.om.orders.index.list.column.orderType.heading",
58       "value": "{{node.type}}"
59     },
60     {
61       "label": "i18n:fc.om.orders.index.list.column.orderValue.heading",
62       "value": "${{node.totalPrice}}"
63     },
64     {
65       "label": "i18n:fc.om.orders.index.list.column.retailerName.heading",
66       "value": "{{node.retailer.tradingName}}"
67     }
68   ]
69 }
70}

Language: json

Version History

2023-07-31

v23.7.31

N/A

2024-07-22

24.7.22

The component extension with the

`rowComponentDetails`
.

2024-10-08

24.10.8

The component extension with the

`loading`
.

Recommended Placement

None

Copyright © 2024 Fluent Retail Pty Ltd (trading as Fluent Commerce). All rights reserved. No materials on this docs.fluentcommerce.com site may be used in any way and/or for any purpose without prior written authorisation from Fluent Commerce. Current customers and partners shall use these materials strictly in accordance with the terms and conditions of their written agreements with Fluent Commerce or its affiliates.

Fluent Logo