diff --git a/examples/demos/demo1.js b/examples/demos/demo1.js index f82ab5a..2f81775 100644 --- a/examples/demos/demo1.js +++ b/examples/demos/demo1.js @@ -1,8 +1,6 @@ import React, { Component } from 'react'; import ListBox from '../../src'; -const { ListItem, ListItemGroup } = ListBox - const dataset = []; var uuid = 100; diff --git a/lib/ListBox.js b/lib/ListBox.js index e938222..dcfbd3d 100644 --- a/lib/ListBox.js +++ b/lib/ListBox.js @@ -472,9 +472,7 @@ function (_React$Component) { var _this$props7 = this.props, className = _this$props7.className, - value = _this$props7.value, prefixCls = _this$props7.prefixCls, - items = _this$props7.items, width = _this$props7.width, height = _this$props7.height, tabIndex = _this$props7.tabIndex, @@ -503,9 +501,7 @@ function (_React$Component) { style.height = height; } - var classes = (0, _classnames.default)((_classNames = {}, (0, _defineProperty2.default)(_classNames, "".concat(prefixCls), true), (0, _defineProperty2.default)(_classNames, className, className), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-disabled"), disabled), _classNames)); // scrollViewBodyCls={`${prefixCls}-body`} - // scrollViewBodyStyle={scrollViewBodyStyle} - + var classes = (0, _classnames.default)((_classNames = {}, (0, _defineProperty2.default)(_classNames, "".concat(prefixCls), true), (0, _defineProperty2.default)(_classNames, className, className), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-disabled"), disabled), _classNames)); return _react.default.createElement(WrapperComponent, { ref: this.saveListView, tabIndex: tabIndex, diff --git a/lib/ListItem.js b/lib/ListItem.js index 1985256..d2726f9 100644 --- a/lib/ListItem.js +++ b/lib/ListItem.js @@ -70,9 +70,6 @@ function (_React$Component) { onDeselect && onDeselect(item, itemDOM); } }); - (0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "saveItem", function (dom) { - _this.node = dom; - }); return _this; } @@ -81,11 +78,6 @@ function (_React$Component) { value: function shouldComponentUpdate(nextProps, nextState) { return !(0, _shallowequal.default)(this.props, nextProps) || !(0, _shallowequal.default)(this.state, nextState); } - }, { - key: "getItemDOM", - value: function getItemDOM() { - return this.node; - } }, { key: "render", value: function render() { @@ -100,7 +92,6 @@ function (_React$Component) { onMouseLeave = _this$props2.onMouseLeave; var classes = (0, _classnames.default)((_classNames = {}, (0, _defineProperty2.default)(_classNames, "".concat(prefixCls), true), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-selected"), selected), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-disabled"), disabled), _classNames)); return _react.default.createElement("div", { - ref: this.saveItem, className: classes, onClick: this.handleItemClick, onMouseEnter: onMouseEnter, diff --git a/lib/index.js b/lib/index.js index ead0b41..6a5dc7a 100644 --- a/lib/index.js +++ b/lib/index.js @@ -6,33 +6,9 @@ var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequ Object.defineProperty(exports, "__esModule", { value: true }); -Object.defineProperty(exports, "ListBox", { - enumerable: true, - get: function get() { - return _ListBox.default; - } -}); -Object.defineProperty(exports, "ListItem", { - enumerable: true, - get: function get() { - return _ListItem.default; - } -}); -Object.defineProperty(exports, "ListItemGroup", { - enumerable: true, - get: function get() { - return _ListItemGroup.default; - } -}); exports.default = void 0; var _ListBox = _interopRequireDefault(require("./ListBox")); -var _ListItem = _interopRequireDefault(require("./ListItem")); - -var _ListItemGroup = _interopRequireDefault(require("./ListItemGroup")); - -_ListBox.default.ListItemGroup = _ListItemGroup.default; -_ListBox.default.ListItem = _ListItem.default; var _default = _ListBox.default; exports.default = _default; \ No newline at end of file diff --git a/src/ListBox.js b/src/ListBox.js index 2626f29..a4aa66c 100644 --- a/src/ListBox.js +++ b/src/ListBox.js @@ -490,9 +490,7 @@ export default class ListBox extends React.Component { render() { const { className, - value, prefixCls, - items, width, height, tabIndex, @@ -524,9 +522,6 @@ export default class ListBox extends React.Component { [`${prefixCls}-disabled`]: disabled, }); - // scrollViewBodyCls={`${prefixCls}-body`} - // scrollViewBodyStyle={scrollViewBodyStyle} - return ( { - this.node = dom; - } - - getItemDOM() { - return this.node; - } - render() { const { prefixCls, disabled, selected, children, onMouseEnter, onMouseLeave } = this.props; const classes = classNames({ @@ -63,7 +55,6 @@ export default class ListItem extends React.Component { }); return