Comparing version 0.0.0-beta.9 to 0.0.0-beta.10
@@ -81,3 +81,3 @@ var __rest = (this && this.__rest) || function (s, e) { | ||
return (type, flag) => { | ||
const { rowHeight } = this.props; | ||
const { rowHeight, onChange, onExpand } = this.props; | ||
const { height } = this.state; | ||
@@ -106,3 +106,7 @@ const { value } = option; | ||
this.showColorKeys = this.getSelectedPath(keys); | ||
this.setState({ selectedKeys: keys }); | ||
this.setState({ selectedKeys: keys }, () => { | ||
if (typeof onChange === 'function') { | ||
onChange(this.state.selectedKeys || []); | ||
} | ||
}); | ||
} | ||
@@ -115,3 +119,8 @@ else if (type === 'expand') { | ||
options = this.getOptions(keys); | ||
this.setState({ expandedKeys: keys, tops: [], bottoms: [], options }, this.handleResize); | ||
this.setState({ expandedKeys: keys, tops: [], bottoms: [], options }, () => { | ||
this.handleResize(); | ||
if (typeof onExpand === 'function') { | ||
onExpand(this.state.expandedKeys || []); | ||
} | ||
}); | ||
} | ||
@@ -118,0 +127,0 @@ } |
@@ -21,2 +21,4 @@ export interface OptionProps { | ||
rowHeight: number; | ||
onChange?: (selectedKeys: Array<string | number>) => void; | ||
onExpand?: (expandedKeys: Array<string | number>) => void; | ||
fixedTopBottom: boolean; | ||
@@ -23,0 +25,0 @@ } |
@@ -165,3 +165,6 @@ "use strict"; | ||
return function (type, flag) { | ||
var rowHeight = _this.props.rowHeight; | ||
var _this$props2 = _this.props, | ||
rowHeight = _this$props2.rowHeight, | ||
onChange = _this$props2.onChange, | ||
onExpand = _this$props2.onExpand; | ||
var height = _this.state.height; | ||
@@ -199,2 +202,6 @@ var value = option.value; | ||
selectedKeys: keys | ||
}, function () { | ||
if (typeof onChange === 'function') { | ||
onChange(_this.state.selectedKeys || []); | ||
} | ||
}); | ||
@@ -215,3 +222,9 @@ } else if (type === 'expand') { | ||
options: options | ||
}, _this.handleResize); | ||
}, function () { | ||
_this.handleResize(); | ||
if (typeof onExpand === 'function') { | ||
onExpand(_this.state.expandedKeys || []); | ||
} | ||
}); | ||
} | ||
@@ -292,5 +305,5 @@ } | ||
_this.renderItem = function (type) { | ||
var _this$props2 = _this.props, | ||
prefix = _this$props2.prefix, | ||
rowHeight = _this$props2.rowHeight; | ||
var _this$props3 = _this.props, | ||
prefix = _this$props3.prefix, | ||
rowHeight = _this$props3.rowHeight; | ||
@@ -376,5 +389,5 @@ var options = _this.state[type.toString()]; | ||
value: function render() { | ||
var _this$props3 = this.props, | ||
className = _this$props3.className, | ||
prefix = _this$props3.prefix; | ||
var _this$props4 = this.props, | ||
className = _this$props4.className, | ||
prefix = _this$props4.prefix; | ||
var cls = (0, _classnames["default"])("".concat(prefix), className); | ||
@@ -381,0 +394,0 @@ var fixedTop = "".concat(prefix, "-fixed-top"); |
{ | ||
"name": "frc-ui", | ||
"version": "0.0.0-beta.9", | ||
"version": "0.0.0-beta.10", | ||
"description": "React Web UI", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
135287
3372
0