2018-08-31 20:13:20 +00:00
|
|
|
`SummaryList` (component)
|
|
|
|
=========================
|
|
|
|
|
|
|
|
A container element for a list of SummaryNumbers. This component handles detecting & switching to
|
|
|
|
the mobile format on smaller screens.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Props
|
|
|
|
-----
|
|
|
|
|
|
|
|
### `children`
|
|
|
|
|
|
|
|
- **Required**
|
2019-01-30 18:51:03 +00:00
|
|
|
- Type: Function
|
2018-08-31 20:13:20 +00:00
|
|
|
- Default: null
|
|
|
|
|
2019-01-30 18:51:03 +00:00
|
|
|
A function returning a list of `<SummaryNumber />`s
|
2018-08-31 20:13:20 +00:00
|
|
|
|
|
|
|
### `label`
|
|
|
|
|
|
|
|
- Type: String
|
2019-03-13 17:14:02 +00:00
|
|
|
- Default: `__( 'Performance Indicators', 'woocommerce-admin' )`
|
2018-08-31 20:13:20 +00:00
|
|
|
|
2019-01-30 18:51:03 +00:00
|
|
|
An optional label of this group, read to screen reader users.
|
2018-08-31 20:13:20 +00:00
|
|
|
|
|
|
|
`SummaryNumber` (component)
|
|
|
|
===========================
|
|
|
|
|
|
|
|
A component to show a value, label, and an optional change percentage. Can also act as a link to a specific report focus.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Props
|
|
|
|
-----
|
|
|
|
|
|
|
|
### `delta`
|
|
|
|
|
|
|
|
- Type: Number
|
|
|
|
- Default: null
|
|
|
|
|
|
|
|
A number to represent the percentage change since the last comparison period - positive numbers will show
|
|
|
|
a green up arrow, negative numbers will show a red down arrow, and zero will show a flat right arrow.
|
|
|
|
If omitted, no change value will display.
|
|
|
|
|
|
|
|
### `href`
|
|
|
|
|
|
|
|
- Type: String
|
2019-01-30 18:51:03 +00:00
|
|
|
- Default: `''`
|
2018-08-31 20:13:20 +00:00
|
|
|
|
|
|
|
An internal link to the report focused on this number.
|
|
|
|
|
|
|
|
### `isOpen`
|
|
|
|
|
|
|
|
- Type: Boolean
|
|
|
|
- Default: `false`
|
|
|
|
|
|
|
|
Boolean describing whether the menu list is open. Only applies in mobile view,
|
|
|
|
and only applies to the toggle-able item (first in the list).
|
|
|
|
|
|
|
|
### `label`
|
|
|
|
|
|
|
|
- **Required**
|
|
|
|
- Type: String
|
|
|
|
- Default: null
|
|
|
|
|
|
|
|
A string description of this value, ex "Revenue", or "New Customers"
|
|
|
|
|
|
|
|
### `onToggle`
|
|
|
|
|
|
|
|
- Type: Function
|
|
|
|
- Default: null
|
|
|
|
|
|
|
|
A function used to switch the given SummaryNumber to a button, and called on click.
|
|
|
|
|
|
|
|
### `prevLabel`
|
|
|
|
|
|
|
|
- Type: String
|
2019-03-13 17:14:02 +00:00
|
|
|
- Default: `__( 'Previous Period:', 'woocommerce-admin' )`
|
2018-08-31 20:13:20 +00:00
|
|
|
|
|
|
|
A string description of the previous value's timeframe, ex "Previous Year:".
|
|
|
|
|
|
|
|
### `prevValue`
|
|
|
|
|
|
|
|
- Type: One of type: number, string
|
|
|
|
- Default: null
|
|
|
|
|
|
|
|
A string or number value to display - a string is allowed so we can accept currency formatting.
|
|
|
|
If omitted, this section won't display.
|
|
|
|
|
|
|
|
### `reverseTrend`
|
|
|
|
|
|
|
|
- Type: Boolean
|
|
|
|
- Default: `false`
|
|
|
|
|
|
|
|
A boolean used to indicate that a negative delta is "good", and should be styled like a positive (and vice-versa).
|
|
|
|
|
|
|
|
### `selected`
|
|
|
|
|
|
|
|
- Type: Boolean
|
|
|
|
- Default: `false`
|
|
|
|
|
|
|
|
A boolean used to show a highlight style on this number.
|
|
|
|
|
|
|
|
### `value`
|
|
|
|
|
|
|
|
- Type: One of type: number, string
|
|
|
|
- Default: null
|
|
|
|
|
|
|
|
A string or number value to display - a string is allowed so we can accept currency formatting.
|
|
|
|
|
2019-01-30 18:51:03 +00:00
|
|
|
### `onLinkClickCallback`
|
|
|
|
|
|
|
|
- Type: Function
|
|
|
|
- Default: `noop`
|
|
|
|
|
|
|
|
A function to be called after a SummaryNumber, rendered as a link, is clicked.
|
|
|
|
|
2018-09-18 21:37:57 +00:00
|
|
|
`SummaryListPlaceholder` (component)
|
|
|
|
====================================
|
|
|
|
|
|
|
|
`SummaryListPlaceholder` behaves like `SummaryList` but displays placeholder summary items instead of data.
|
|
|
|
This can be used while loading data.
|
|
|
|
|
|
|
|
Props
|
|
|
|
-----
|
|
|
|
|
|
|
|
### `numberOfItems`
|
|
|
|
|
|
|
|
- **Required**
|
|
|
|
- Type: Number
|
|
|
|
- Default: null
|
|
|
|
|
|
|
|
An integer with the number of summary items to display.
|
|
|
|
|
|
|
|
### `numberOfRows`
|
|
|
|
|
|
|
|
- Type: undefined
|
|
|
|
- Default: `5`
|
|
|
|
|
|
|
|
|