Skip to content

Commit

Permalink
feat: multipleChoiceList => refinementList
Browse files Browse the repository at this point in the history
fixes #64
  • Loading branch information
vvo committed Sep 8, 2015
1 parent a52fb6d commit 423542d
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ API is unstable. We welcome any idea.
- [pagination](#pagination)
- [hits](#hits)
- [toggle](#toggle)
- [multipleChoiceList](#multiplechoicelist)
- [refinementList](#refinementlist)
- [menu](#menu)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->
Expand Down Expand Up @@ -248,7 +248,7 @@ search.addWidget(
```


### multipleChoiceList
### refinementList

#### API

Expand Down Expand Up @@ -278,7 +278,7 @@ search.addWidget(

```js
search.addWidget(
instantsearch.widgets.multipleChoiceList({
instantsearch.widgets.refinementList({
container: '#brands',
facetName: 'brands',
operator: 'or'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var React = require('react');

var Template = require('./Template');

class MultipleChoiceList extends React.Component {
class RefinementList extends React.Component {
refine(value) {
this.props.toggleRefine(value);
}
Expand Down Expand Up @@ -58,7 +58,7 @@ class MultipleChoiceList extends React.Component {
}
}

MultipleChoiceList.propTypes = {
RefinementList.propTypes = {
rootClass: React.PropTypes.oneOfType([
React.PropTypes.string,
React.PropTypes.arrayOf(React.PropTypes.string)
Expand All @@ -75,4 +75,4 @@ MultipleChoiceList.propTypes = {
toggleRefine: React.PropTypes.func.isRequired
};

module.exports = MultipleChoiceList;
module.exports = RefinementList;
2 changes: 1 addition & 1 deletion example/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ search.addWidget(
);

search.addWidget(
instantsearch.widgets.multipleChoiceList({
instantsearch.widgets.refinementList({
container: '#brands',
facetName: 'brand',
operator: 'or',
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
hits: require('./widgets/hits'),
indexSelector: require('./widgets/index-selector'),
menu: require('./widgets/menu'),
multipleChoiceList: require('./widgets/multiple-choice-list'),
refinementList: require('./widgets/refinement-list'),
pagination: require('./widgets/pagination'),
searchBox: require('./widgets/search-box'),
stats: require('./widgets/stats'),
Expand Down
4 changes: 2 additions & 2 deletions widgets/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function menu({
}) {
hierarchicalCounter++;

var MultipleChoiceList = require('../components/MultipleChoiceList');
var RefinementList = require('../components/RefinementList');

var containerNode = utils.getContainerNode(container);
var usage = 'Usage: menu({container, facetName, [sortBy, limit, rootClass, itemClass, template]})';
Expand All @@ -49,7 +49,7 @@ function menu({
}),
render: function(results, state, helper) {
React.render(
<MultipleChoiceList
<RefinementList
rootClass={cx(rootClass)}
itemClass={cx(itemClass)}
facetValues={getFacetValues(results, hierarchicalFacetName, sortBy, limit)}
Expand Down
10 changes: 5 additions & 5 deletions widgets/multiple-choice-list.js → widgets/refinement-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var defaultTemplate = `<label>
* to build radio based refinement lists for example.
* @return {Object}
*/
function multipleChoiceList({
function refinementList({
container = null,
facetName = null,
operator = null,
Expand All @@ -32,10 +32,10 @@ function multipleChoiceList({
template = defaultTemplate,
singleRefine = false
}) {
var MultipleChoiceList = require('../components/MultipleChoiceList');
var RefinementList = require('../components/RefinementList');

var containerNode = utils.getContainerNode(container);
var usage = 'Usage: multipleChoiceList({container, facetName, operator[sortBy, limit, rootClass, itemClass, template]})';
var usage = 'Usage: refinementList({container, facetName, operator[sortBy, limit, rootClass, itemClass, template]})';

if (container === null ||
facetName === null ||
Expand All @@ -57,7 +57,7 @@ function multipleChoiceList({
}),
render: function(results, state, helper) {
React.render(
<MultipleChoiceList
<RefinementList
rootClass={cx(rootClass)}
itemClass={cx(itemClass)}
facetValues={results.getFacetValues(facetName, {sortBy: sortBy}).slice(0, limit)}
Expand All @@ -80,4 +80,4 @@ function toggleRefine(helper, singleRefine, facetName, facetValue) {
.search();
}

module.exports = multipleChoiceList;
module.exports = refinementList;

0 comments on commit 423542d

Please sign in to comment.