Skip to content

Commit 423542d

Browse files
author
vvo
committed
feat: multipleChoiceList => refinementList
fixes #64
1 parent a52fb6d commit 423542d

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ API is unstable. We welcome any idea.
1818
- [pagination](#pagination)
1919
- [hits](#hits)
2020
- [toggle](#toggle)
21-
- [multipleChoiceList](#multiplechoicelist)
21+
- [refinementList](#refinementlist)
2222
- [menu](#menu)
2323

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

250250

251-
### multipleChoiceList
251+
### refinementList
252252

253253
#### API
254254

@@ -278,7 +278,7 @@ search.addWidget(
278278

279279
```js
280280
search.addWidget(
281-
instantsearch.widgets.multipleChoiceList({
281+
instantsearch.widgets.refinementList({
282282
container: '#brands',
283283
facetName: 'brands',
284284
operator: 'or'

components/MultipleChoiceList.js renamed to components/RefinementList.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var React = require('react');
22

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

5-
class MultipleChoiceList extends React.Component {
5+
class RefinementList extends React.Component {
66
refine(value) {
77
this.props.toggleRefine(value);
88
}
@@ -58,7 +58,7 @@ class MultipleChoiceList extends React.Component {
5858
}
5959
}
6060

61-
MultipleChoiceList.propTypes = {
61+
RefinementList.propTypes = {
6262
rootClass: React.PropTypes.oneOfType([
6363
React.PropTypes.string,
6464
React.PropTypes.arrayOf(React.PropTypes.string)
@@ -75,4 +75,4 @@ MultipleChoiceList.propTypes = {
7575
toggleRefine: React.PropTypes.func.isRequired
7676
};
7777

78-
module.exports = MultipleChoiceList;
78+
module.exports = RefinementList;

example/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ search.addWidget(
5454
);
5555

5656
search.addWidget(
57-
instantsearch.widgets.multipleChoiceList({
57+
instantsearch.widgets.refinementList({
5858
container: '#brands',
5959
facetName: 'brand',
6060
operator: 'or',

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module.exports = {
44
hits: require('./widgets/hits'),
55
indexSelector: require('./widgets/index-selector'),
66
menu: require('./widgets/menu'),
7-
multipleChoiceList: require('./widgets/multiple-choice-list'),
7+
refinementList: require('./widgets/refinement-list'),
88
pagination: require('./widgets/pagination'),
99
searchBox: require('./widgets/search-box'),
1010
stats: require('./widgets/stats'),

widgets/menu.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function menu({
2929
}) {
3030
hierarchicalCounter++;
3131

32-
var MultipleChoiceList = require('../components/MultipleChoiceList');
32+
var RefinementList = require('../components/RefinementList');
3333

3434
var containerNode = utils.getContainerNode(container);
3535
var usage = 'Usage: menu({container, facetName, [sortBy, limit, rootClass, itemClass, template]})';
@@ -49,7 +49,7 @@ function menu({
4949
}),
5050
render: function(results, state, helper) {
5151
React.render(
52-
<MultipleChoiceList
52+
<RefinementList
5353
rootClass={cx(rootClass)}
5454
itemClass={cx(itemClass)}
5555
facetValues={getFacetValues(results, hierarchicalFacetName, sortBy, limit)}

widgets/multiple-choice-list.js renamed to widgets/refinement-list.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ var defaultTemplate = `<label>
2121
* to build radio based refinement lists for example.
2222
* @return {Object}
2323
*/
24-
function multipleChoiceList({
24+
function refinementList({
2525
container = null,
2626
facetName = null,
2727
operator = null,
@@ -32,10 +32,10 @@ function multipleChoiceList({
3232
template = defaultTemplate,
3333
singleRefine = false
3434
}) {
35-
var MultipleChoiceList = require('../components/MultipleChoiceList');
35+
var RefinementList = require('../components/RefinementList');
3636

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

4040
if (container === null ||
4141
facetName === null ||
@@ -57,7 +57,7 @@ function multipleChoiceList({
5757
}),
5858
render: function(results, state, helper) {
5959
React.render(
60-
<MultipleChoiceList
60+
<RefinementList
6161
rootClass={cx(rootClass)}
6262
itemClass={cx(itemClass)}
6363
facetValues={results.getFacetValues(facetName, {sortBy: sortBy}).slice(0, limit)}
@@ -80,4 +80,4 @@ function toggleRefine(helper, singleRefine, facetName, facetValue) {
8080
.search();
8181
}
8282

83-
module.exports = multipleChoiceList;
83+
module.exports = refinementList;

0 commit comments

Comments
 (0)