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
|
|
|
|
-----
|
|
|
|
|
|
|
|
### `onChange`
|
|
|
|
|
|
|
|
- Type: Function
|
|
|
|
- Default: `noop`
|
|
|
|
|
|
|
|
Function called when selected results change, passed result list.
|
|
|
|
|
|
|
|
### `type`
|
|
|
|
|
|
|
|
- **Required**
|
2018-09-18 21:37:57 +00:00
|
|
|
- Type: One of: 'products', 'product_cats', 'orders', 'customers'
|
2018-08-31 20:13:20 +00:00
|
|
|
- Default: null
|
|
|
|
|
|
|
|
The object type to be used in searching.
|
|
|
|
|
2018-09-18 21:37:57 +00:00
|
|
|
### `selected`
|
|
|
|
|
|
|
|
- Type: Array
|
|
|
|
- id: Number
|
|
|
|
- label: String
|
|
|
|
- Default: `[]`
|
|
|
|
|
|
|
|
An array of objects describing selected values.
|
|
|
|
|