Comparing version 0.0.0-beta.27 to 0.0.0-beta.28
@@ -6,3 +6,3 @@ import React from 'react'; | ||
export default function (props) { | ||
const { prefix, className, option, onChange, expanded, checked, hasSelected, rowHeight, parentWidth } = props; | ||
const { prefix, className, option, onChange, expanded, checked, hasSelected, rowHeight, parentWidth, clickRow } = props; | ||
const { text, selectEnable, expandEnable, expandPlace, disabled, index, render, expandedIcon } = option; | ||
@@ -59,6 +59,11 @@ const cls = classNames(`${prefix}-item`, className, { | ||
} | ||
const contentProps = {}; | ||
if (clickRow) | ||
contentProps.onClick = expand; | ||
if (selectEnable) | ||
contentProps.onClick = select; | ||
return (React.createElement("div", { className: cls, style: style }, | ||
icon, | ||
selectEnable && React.createElement(Checkbox, { checked: checked, onChange: select, style: { lineHeight: `${rowHeight}px` } }), | ||
React.createElement("div", { className: `${prefix}-item-text`, style: textStyle }, content))); | ||
React.createElement("div", Object.assign({ className: `${prefix}-item-text`, style: textStyle }, contentProps), content))); | ||
} |
@@ -11,2 +11,3 @@ import React from 'react'; | ||
fixedTopBottom: boolean; | ||
clickRow: boolean; | ||
}; | ||
@@ -13,0 +14,0 @@ showColorKeys: Array<string | number>; |
@@ -206,7 +206,7 @@ var __rest = (this && this.__rest) || function (s, e) { | ||
this.renderItem = (type) => { | ||
const { prefix, rowHeight } = this.props; | ||
const { prefix, rowHeight, clickRow } = this.props; | ||
const options = this.state[type.toString()]; | ||
const { selectedKeys, expandedKeys, width } = this.state; | ||
return options.map(o => { | ||
return (React.createElement(Item, { key: `${o.value}-${o.index}`, prefix: prefix, option: o, parentWidth: width || 100, rowHeight: rowHeight || 22, hasSelected: this.showColorKeys.indexOf(o.value) > -1, expanded: (expandedKeys || []).indexOf(o.value) > -1, checked: (selectedKeys || []).indexOf(o.value) > -1, onChange: this.onChange(o) })); | ||
return (React.createElement(Item, { key: `${o.value}-${o.index}`, prefix: prefix, option: o, clickRow: clickRow, parentWidth: width || 100, rowHeight: rowHeight || 22, hasSelected: this.showColorKeys.indexOf(o.value) > -1, expanded: (expandedKeys || []).indexOf(o.value) > -1, checked: (selectedKeys || []).indexOf(o.value) > -1, onChange: this.onChange(o) })); | ||
}); | ||
@@ -296,4 +296,5 @@ }; | ||
rowHeight: 22, | ||
fixedTopBottom: true | ||
fixedTopBottom: true, | ||
clickRow: true | ||
}; | ||
export default Tree; |
@@ -24,2 +24,3 @@ export interface OptionProps { | ||
fixedTopBottom: boolean; | ||
clickRow?: boolean; | ||
} | ||
@@ -45,2 +46,3 @@ export interface State { | ||
onChange?: (type: string, value: boolean) => void; | ||
clickRow?: boolean; | ||
} | ||
@@ -47,0 +49,0 @@ export declare enum Scroll_Type { |
@@ -27,3 +27,4 @@ "use strict"; | ||
rowHeight = props.rowHeight, | ||
parentWidth = props.parentWidth; | ||
parentWidth = props.parentWidth, | ||
clickRow = props.clickRow; | ||
var text = option.text, | ||
@@ -103,2 +104,5 @@ selectEnable = option.selectEnable, | ||
var contentProps = {}; | ||
if (clickRow) contentProps.onClick = expand; | ||
if (selectEnable) contentProps.onClick = select; | ||
return _react["default"].createElement("div", { | ||
@@ -113,6 +117,6 @@ className: cls, | ||
} | ||
}), _react["default"].createElement("div", { | ||
}), _react["default"].createElement("div", Object.assign({ | ||
className: "".concat(prefix, "-item-text"), | ||
style: textStyle | ||
}, content)); | ||
}, contentProps), content)); | ||
} |
@@ -371,3 +371,4 @@ "use strict"; | ||
prefix = _this$props3.prefix, | ||
rowHeight = _this$props3.rowHeight; | ||
rowHeight = _this$props3.rowHeight, | ||
clickRow = _this$props3.clickRow; | ||
@@ -385,2 +386,3 @@ var options = _this.state[type.toString()]; | ||
option: o, | ||
clickRow: clickRow, | ||
parentWidth: width || 100, | ||
@@ -513,5 +515,6 @@ rowHeight: rowHeight || 22, | ||
rowHeight: 22, | ||
fixedTopBottom: true | ||
fixedTopBottom: true, | ||
clickRow: true | ||
}; | ||
var _default = Tree; | ||
exports["default"] = _default; |
{ | ||
"name": "frc-ui", | ||
"version": "0.0.0-beta.27", | ||
"version": "0.0.0-beta.28", | ||
"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
232905
5244