c55c91d7e0
* Add initial category field component with new typeahead Move search logic to useCategorySearch hook Add initial add new category logic Add parent category field to add new category modal Adding some debug changes Update category control to make use of internal selectItem function of select control Add changelogs Update pagesize back to 100 Add placeholder Empty placeholder Fix input and icon sizes Fix input underline Add max height and scroll to category dropdown Add sorting of category items Auto open parents when traversing up the tree using arrow keys Add several comments Add some initial unit tests for the category field component Add tests for useCategorySearch hook and fixed minor bug Update styling and autoselect parent if child is selected Fix styling issues for the select control dropdown inside a modal Fix issue with creating new category with parent Add function comment and fixed border styling Prune out create new category logic Fix minor css issue with border Revert some of the select control changes and make use of the custom type Fix up some styling changes * Fix type conflict * Revert change in state reducer * Add cursor pointer * Fix styling errors * Fix broken category tests * Fix merge conflict |
||
---|---|---|
.. | ||
changelog | ||
src | ||
typings | ||
.eslintrc.js | ||
.gitignore | ||
.npmrc | ||
CHANGELOG.md | ||
PREVIOUS_CHANGELOG.md | ||
README.md | ||
babel.config.js | ||
composer.json | ||
composer.lock | ||
jest.config.json | ||
package.json | ||
tsconfig-cjs.json | ||
tsconfig.json |
README.md
Data
WooCommerce Admin data store and utilities.
Installation
Install the module
pnpm install @woocommerce/data --save
This package assumes that your code will run in an ES2015+ environment. If you're using an environment that has limited or no support for ES2015+ such as lower versions of IE then using core-js or @babel/polyfill will add support for these methods. Learn more about it in Babel docs.
Usage
import { SETTINGS_STORE_NAME } from '@woocommerce/data';
import { useSelect } from '@wordpress/data';
function MySettings() {
const settings = useSelect( select => {
return select( SETTINGS_STORE_NAME ).getSettings();
} );
return (
<ul>
{ settings.map( setting => (
<li>{ setting.name }</li>
) ) }
</ul>
);
}
// Rendered in the application:
//
// <MySettings />