Skip to content

Commit

Permalink
Modified docs/index.html
Browse files Browse the repository at this point in the history
Missing    docs/static/js/index.ed336b3c.js
Missing    docs/static/js/index.ed336b3c.js.map
Modified   examples/demos/demo1.js
Modified   lib/ListBox.js
Modified   package.json
Modified   src/ListBox.js
Add        docs/static/js/index.dcbccb8c.js
Add        docs/static/js/index.dcbccb8c.js.map
  • Loading branch information
bplok20010 committed Feb 22, 2019
1 parent 2fd2628 commit 67c7877
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
<body style="background:#F5F5F5">
<div class="demo" id="demo">
</div>
<script src="static\js\vendors.308b581e.chunk.js"></script><script src="static\js\index.ed336b3c.js"></script></body>
<script src="static\js\vendors.308b581e.chunk.js"></script><script src="static\js\index.dcbccb8c.js"></script></body>

</html>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/static/js/index.dcbccb8c.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion docs/static/js/index.ed336b3c.js.map

This file was deleted.

2 changes: 1 addition & 1 deletion examples/demos/demo1.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var uuid = 100;
for (let i = 0; i < 10; i++) {
const items = [];
const d = {
items,
children: items,
label: '分组' + (i + 1)
}

Expand Down
12 changes: 6 additions & 6 deletions lib/ListBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ function (_React$Component) {
var _this$props4 = this.props,
labelField = _this$props4.labelField,
valueField = _this$props4.valueField,
itemsField = _this$props4.itemsField,
childrenField = _this$props4.childrenField,
prefixCls = _this$props4.prefixCls,
disabled = _this$props4.disabled;
var itemsMap = this.state.itemsMap;
Expand All @@ -327,7 +327,7 @@ function (_React$Component) {
item = (_item = {}, (0, _defineProperty2.default)(_item, labelField, item), (0, _defineProperty2.default)(_item, valueField, item), _item);
}

var isGroup = item[itemsField];
var isGroup = item[childrenField];
var itemPrefixCls = "".concat(prefixCls, "-item");
var activeCls = "".concat(prefixCls, "-item-active");
var onMouseEnter = noop;
Expand Down Expand Up @@ -365,7 +365,7 @@ function (_React$Component) {
prefixCls: "".concat(itemPrefixCls, "-group"),
key: item[labelField],
label: item[labelField]
}, _this2.renderListItems(item[itemsField] || [], selectedMap));
}, _this2.renderListItems(item[childrenField] || [], selectedMap));
});
}
}, {
Expand All @@ -376,7 +376,7 @@ function (_React$Component) {
var _this$props5 = this.props,
labelField = _this$props5.labelField,
valueField = _this$props5.valueField,
itemsField = _this$props5.itemsField,
childrenField = _this$props5.childrenField,
prefixCls = _this$props5.prefixCls,
disabled = _this$props5.disabled;
var itemsMap = this.state.itemsMap;
Expand Down Expand Up @@ -563,7 +563,7 @@ exports.default = ListBox;
prefixCls: _propTypes.default.string,
valueField: _propTypes.default.string,
labelField: _propTypes.default.string,
itemsField: _propTypes.default.string,
childrenField: _propTypes.default.string,
items: _propTypes.default.array,
emptyLabel: _propTypes.default.any,
multiple: _propTypes.default.bool,
Expand All @@ -590,7 +590,7 @@ exports.default = ListBox;
prefixCls: 'rw-listbox',
valueField: 'value',
labelField: 'label',
itemsField: 'items',
childrenField: 'children',
labelInValue: false,
tabIndex: 0,
items: [],
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-widget-listbox",
"version": "1.0.2",
"version": "1.0.3",
"description": "",
"main": "index.js",
"repository": {
Expand Down Expand Up @@ -87,4 +87,4 @@
"transform-es": "^2.2.9",
"url-loader": "^1.1.2"
}
}
}
12 changes: 6 additions & 6 deletions src/ListBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default class ListBox extends React.Component {
prefixCls: PropTypes.string,
valueField: PropTypes.string,
labelField: PropTypes.string,
itemsField: PropTypes.string,
childrenField: PropTypes.string,
items: PropTypes.array,
emptyLabel: PropTypes.any,
multiple: PropTypes.bool,
Expand Down Expand Up @@ -54,7 +54,7 @@ export default class ListBox extends React.Component {
prefixCls: 'rw-listbox',
valueField: 'value',
labelField: 'label',
itemsField: 'items',
childrenField: 'children',
labelInValue: false,
tabIndex: 0,
items: [],
Expand Down Expand Up @@ -310,7 +310,7 @@ export default class ListBox extends React.Component {
}

renderListItems(items, selectedMap) {
const { labelField, valueField, itemsField, prefixCls, disabled } = this.props;
const { labelField, valueField, childrenField, prefixCls, disabled } = this.props;
const { itemsMap } = this.state;

return items.map(item => {
Expand All @@ -321,7 +321,7 @@ export default class ListBox extends React.Component {
}
}

const isGroup = item[itemsField];
const isGroup = item[childrenField];
const itemPrefixCls = `${prefixCls}-item`;
const activeCls = `${prefixCls}-item-active`;
let onMouseEnter = noop;
Expand Down Expand Up @@ -364,14 +364,14 @@ export default class ListBox extends React.Component {
key={item[labelField]}
label={item[labelField]}
>
{this.renderListItems(item[itemsField] || [], selectedMap)}
{this.renderListItems(item[childrenField] || [], selectedMap)}
</ListItemGroup>
);
});
}

renderListChild(children, selectedMap) {
const { labelField, valueField, itemsField, prefixCls, disabled } = this.props;
const { labelField, valueField, childrenField, prefixCls, disabled } = this.props;
const { itemsMap } = this.state;

const itemPrefixCls = `${prefixCls}-item`;
Expand Down

0 comments on commit 67c7877

Please sign in to comment.