2018-08-31 20:13:20 +00:00
|
|
|
`Search` (component)
|
|
|
|
====================
|
|
|
|
|
|
|
|
A search box which autocompletes results while typing, allowing for the user to select an existing object
|
|
|
|
(product, order, customer, etc). Currently only products are supported.
|
|
|
|
|
|
|
|
Props
|
|
|
|
-----
|
|
|
|
|
2018-11-04 21:25:00 +00:00
|
|
|
### `className`
|
|
|
|
|
|
|
|
- Type: String
|
|
|
|
- Default: null
|
|
|
|
|
|
|
|
Class name applied to parent div.
|
|
|
|
|
2018-08-31 20:13:20 +00:00
|
|
|
### `onChange`
|
|
|
|
|
|
|
|
- Type: Function
|
|
|
|
- Default: `noop`
|
|
|
|
|
|
|
|
Function called when selected results change, passed result list.
|
|
|
|
|
|
|
|
### `type`
|
|
|
|
|
|
|
|
- **Required**
|
2018-12-28 19:42:20 +00:00
|
|
|
- Type: One of: 'categories', 'countries', 'coupons', 'customers', 'downloadIps', 'emails', 'orders', 'products', 'taxes', 'usernames', 'variations'
|
2018-08-31 20:13:20 +00:00
|
|
|
- Default: null
|
|
|
|
|
|
|
|
The object type to be used in searching.
|
|
|
|
|
2018-09-21 15:19:05 +00:00
|
|
|
### `placeholder`
|
|
|
|
|
|
|
|
- Type: String
|
|
|
|
- Default: null
|
|
|
|
|
|
|
|
A placeholder for the search input.
|
|
|
|
|
2018-09-18 21:37:57 +00:00
|
|
|
### `selected`
|
|
|
|
|
|
|
|
- Type: Array
|
2018-12-11 01:50:26 +00:00
|
|
|
- id: One of type: number, string
|
2018-09-18 21:37:57 +00:00
|
|
|
- label: String
|
|
|
|
- Default: `[]`
|
|
|
|
|
2018-12-17 11:22:58 +00:00
|
|
|
An array of objects describing selected values. If the label of the selected
|
|
|
|
value is omitted, the Tag of that value will not be rendered inside the
|
|
|
|
search box.
|
2018-09-18 21:37:57 +00:00
|
|
|
|
2018-10-10 03:58:34 +00:00
|
|
|
### `inlineTags`
|
|
|
|
|
|
|
|
- Type: Boolean
|
|
|
|
- Default: `false`
|
|
|
|
|
2018-12-10 22:27:32 +00:00
|
|
|
Render tags inside input, otherwise render below input.
|
|
|
|
|
|
|
|
### `staticResults`
|
|
|
|
|
|
|
|
- Type: Boolean
|
|
|
|
- Default: `false`
|
|
|
|
|
|
|
|
Render results list positioned statically instead of absolutely.
|
2018-10-10 03:58:34 +00:00
|
|
|
|