woocommerce/plugins/woocommerce-admin/client/components/search
Kelly Dwan 1c6fe0e970 Compare Filter: Wrap up compare card functionality (https://github.com/woocommerce/woocommerce-admin/pull/431)
* Disable compare button if less than 2 items are selected

* Add a placeholder prop to the Search component

* Pass a placeholder label from filter configs for Search

* Add support for a label in Search

* Add Clear All link to reset comparison card

* Add a label when compare button is disabled

* Abstract the conditional tooltip/disabled button logic to a new component

* Add helpText as a customizable label

* Add icon to the search field

* Remove the parameter from query by passing in undefined
2018-09-19 13:16:52 -04:00
..
autocompleters Add “product category” autocompleter (https://github.com/woocommerce/woocommerce-admin/pull/367) 2018-09-07 15:39:04 -04:00
README.md Search: move selected from state to props 2018-09-04 12:02:40 +12:00
autocomplete.js Components: Add a search component based on Autocomplete (https://github.com/woocommerce/woocommerce-admin/pull/322) 2018-08-28 15:15:24 -04:00
index.js Compare Filter: Wrap up compare card functionality (https://github.com/woocommerce/woocommerce-admin/pull/431) 2018-09-19 13:16:52 -04:00
style.scss Compare Filter: Wrap up compare card functionality (https://github.com/woocommerce/woocommerce-admin/pull/431) 2018-09-19 13:16:52 -04:00

README.md

Search

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.

Usage

import { Search } from '@woocommerce/components';

class MySearchBox extends Component {
	updateLocalValue( results ) {
		// Do whatever with results.
	}
	render() {
		return (
			<Search type="products" onChange={ this.updateLocalValue } />
		);
	}
}
  • onChange: Function called when selected results change, passed result list.
  • type (required): Which object type to search, can be one of customers, orders, or products.
  • selected: An array of objects describing selected values.