Fluent Commerce Logo
Docs
Sign In

List Component

UI Component

Changed on:

8 May 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'`
 / 
`'centre'`
 / 
`'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 it's 

`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



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`

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   "actions": [
34     { "type": "UserAction", "name": "FLAG_AS_URGENT" }
35   ],
36   "attributes": [
37     {
38       "label": "i18n:fc.om.orders.index.list.column.orderRef.heading",
39       "value": "{{node.ref}}",
40       "link": "#/orders/{{node.id}}"
41     },
42     {
43       "label": "i18n:fc.om.orders.index.list.column.image.heading",
44       "type": "image",
45       "value": "https://fluentcommerce.com/wp-content/uploads/2019/07/fluent-commerce-logo.svg"
46     },
47     {
48       "label": "i18n:fc.om.orders.index.list.column.customer.heading",
49       "value": "{{node.customer.firstName}} {{node.customer.lastName}}"
50     },
51     {
52       "label": "i18n:fc.om.orders.index.list.column.status.heading",
53       "value": "{{node.status}}"
54     },
55     {
56       "label": "i18n:fc.om.orders.index.list.column.orderType.heading",
57       "value": "{{node.type}}"
58     },
59     {
60       "label": "i18n:fc.om.orders.index.list.column.orderValue.heading",
61       "value": "${{node.totalPrice}}"
62     },
63     {
64       "label": "i18n:fc.om.orders.index.list.column.retailerName.heading",
65       "value": "{{node.retailer.tradingName}}"
66     }
67   ]
68 }
69}

Language: json

Version History

2023-07-31

v23.7.31

N/A

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