@uiw/react-tree
Advanced tools
Comparing version 4.6.9 to 4.6.10
@@ -14,4 +14,2 @@ "use strict"; | ||
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); | ||
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray")); | ||
@@ -29,4 +27,2 @@ | ||
var _classnames4 = _interopRequireDefault(require("classnames")); | ||
var _reactTransitionGroup = require("react-transition-group"); | ||
@@ -247,3 +243,3 @@ | ||
currentKeys.push(item.key); | ||
evn.currentTarget.className = (0, _classnames4.default)(cls, 'open'); | ||
evn.currentTarget.className = [cls, 'open'].filter(Boolean).join(' ').trim(); | ||
expanded = true; | ||
@@ -266,4 +262,3 @@ } else { | ||
value: function renderTreeNode(data, level, parent) { | ||
var _classnames, | ||
_this2 = this; | ||
var _this2 = this; | ||
@@ -295,6 +290,4 @@ var _this$props3 = this.props, | ||
}, /*#__PURE__*/_react.default.createElement("ul", { | ||
className: (0, _classnames4.default)((_classnames = {}, (0, _defineProperty2.default)(_classnames, "".concat(prefixCls, "-open"), level !== 1 && isOpen), (0, _defineProperty2.default)(_classnames, "".concat(prefixCls, "-close"), level !== 1 && !isOpen), _classnames)) | ||
className: [level !== 1 && isOpen ? ["".concat(prefixCls, "-open")] : null, level !== 1 && !isOpen ? ["".concat(prefixCls, "-close")] : null].filter(Boolean).join(' ').trim() | ||
}, data.map(function (item, idx) { | ||
var _classnames2; | ||
item.parent = parent; | ||
@@ -318,3 +311,3 @@ var selected = !!(selectedKeys && selectedKeys.indexOf(item.key) > -1); | ||
}, /*#__PURE__*/_react.default.createElement("div", { | ||
className: (0, _classnames4.default)("".concat(prefixCls, "-label")) | ||
className: "".concat(prefixCls, "-label") | ||
}, /*#__PURE__*/_react.default.createElement("span", { | ||
@@ -325,9 +318,6 @@ className: "".concat(prefixCls, "-switcher"), | ||
type: iconItem || 'caret-right', | ||
className: (0, _classnames4.default)((_classnames2 = {}, (0, _defineProperty2.default)(_classnames2, "".concat(prefixCls, "-switcher-noop"), typeof icon === 'function'), (0, _defineProperty2.default)(_classnames2, 'no-child', noChild), (0, _defineProperty2.default)(_classnames2, 'no-animation', !iconAnimation), (0, _defineProperty2.default)(_classnames2, "open", itemIsOpen), _classnames2)) | ||
className: [typeof icon === 'function' ? "".concat(prefixCls, "-switcher-noop") : null, noChild ? 'no-child' : null, !iconAnimation ? 'no-animation' : null, itemIsOpen ? 'open' : null].filter(Boolean).join(' ').trim() | ||
})), /*#__PURE__*/_react.default.createElement("div", { | ||
onClick: _this2.onItemSelected.bind(_this2, item), | ||
className: (0, _classnames4.default)("".concat(prefixCls, "-title"), { | ||
selected: selected && isSelected, | ||
disabled: item.disabled | ||
}) | ||
className: ["".concat(prefixCls, "-title"), selected && isSelected ? 'selected' : null, item.disabled ? 'disabled' : null].filter(Boolean).join(' ').trim() | ||
}, renderTitle ? renderTitle(item, { | ||
@@ -362,3 +352,3 @@ selected: selected, | ||
elementProps = (0, _objectWithoutProperties2.default)(_this$props4, ["prefixCls", "className", "icon", "data", "openKeys", "selectedKeys", "isSelected", "autoExpandParent", "defaultExpandAll", "checkStrictly", "showLine", "iconAnimation", "renderTitle", "onExpand", "onSelected"]); | ||
var cls = (0, _classnames4.default)(className, prefixCls, (0, _defineProperty2.default)({}, "".concat(prefixCls, "-line"), showLine)); | ||
var cls = [className, prefixCls, showLine ? "".concat(prefixCls, "-line") : null].filter(Boolean).join(' ').trim(); | ||
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({ | ||
@@ -365,0 +355,0 @@ className: cls |
import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; | ||
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray"; | ||
@@ -10,3 +9,2 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; | ||
import React from 'react'; | ||
import classnames from 'classnames'; | ||
import { CSSTransition } from 'react-transition-group'; | ||
@@ -232,3 +230,3 @@ import Icon from '@uiw/react-icon'; | ||
currentKeys.push(item.key); | ||
evn.currentTarget.className = classnames(cls, 'open'); | ||
evn.currentTarget.className = [cls, 'open'].filter(Boolean).join(' ').trim(); | ||
expanded = true; | ||
@@ -251,4 +249,3 @@ } else { | ||
value: function renderTreeNode(data, level, parent) { | ||
var _classnames, | ||
_this2 = this; | ||
var _this2 = this; | ||
@@ -280,6 +277,4 @@ var _this$props3 = this.props, | ||
}, /*#__PURE__*/React.createElement("ul", { | ||
className: classnames((_classnames = {}, _defineProperty(_classnames, "".concat(prefixCls, "-open"), level !== 1 && isOpen), _defineProperty(_classnames, "".concat(prefixCls, "-close"), level !== 1 && !isOpen), _classnames)) | ||
className: [level !== 1 && isOpen ? ["".concat(prefixCls, "-open")] : null, level !== 1 && !isOpen ? ["".concat(prefixCls, "-close")] : null].filter(Boolean).join(' ').trim() | ||
}, data.map(function (item, idx) { | ||
var _classnames2; | ||
item.parent = parent; | ||
@@ -303,3 +298,3 @@ var selected = !!(selectedKeys && selectedKeys.indexOf(item.key) > -1); | ||
}, /*#__PURE__*/React.createElement("div", { | ||
className: classnames("".concat(prefixCls, "-label")) | ||
className: "".concat(prefixCls, "-label") | ||
}, /*#__PURE__*/React.createElement("span", { | ||
@@ -310,9 +305,6 @@ className: "".concat(prefixCls, "-switcher"), | ||
type: iconItem || 'caret-right', | ||
className: classnames((_classnames2 = {}, _defineProperty(_classnames2, "".concat(prefixCls, "-switcher-noop"), typeof icon === 'function'), _defineProperty(_classnames2, 'no-child', noChild), _defineProperty(_classnames2, 'no-animation', !iconAnimation), _defineProperty(_classnames2, "open", itemIsOpen), _classnames2)) | ||
className: [typeof icon === 'function' ? "".concat(prefixCls, "-switcher-noop") : null, noChild ? 'no-child' : null, !iconAnimation ? 'no-animation' : null, itemIsOpen ? 'open' : null].filter(Boolean).join(' ').trim() | ||
})), /*#__PURE__*/React.createElement("div", { | ||
onClick: _this2.onItemSelected.bind(_this2, item), | ||
className: classnames("".concat(prefixCls, "-title"), { | ||
selected: selected && isSelected, | ||
disabled: item.disabled | ||
}) | ||
className: ["".concat(prefixCls, "-title"), selected && isSelected ? 'selected' : null, item.disabled ? 'disabled' : null].filter(Boolean).join(' ').trim() | ||
}, renderTitle ? renderTitle(item, { | ||
@@ -348,3 +340,3 @@ selected: selected, | ||
var cls = classnames(className, prefixCls, _defineProperty({}, "".concat(prefixCls, "-line"), showLine)); | ||
var cls = [className, prefixCls, showLine ? "".concat(prefixCls, "-line") : null].filter(Boolean).join(' ').trim(); | ||
return /*#__PURE__*/React.createElement("div", _extends({ | ||
@@ -351,0 +343,0 @@ className: cls |
{ | ||
"name": "@uiw/react-tree", | ||
"version": "4.6.9", | ||
"version": "4.6.10", | ||
"description": "Tree component", | ||
@@ -45,5 +45,4 @@ "author": "Kenny Wong <wowohoo@qq.com>", | ||
"dependencies": { | ||
"@uiw/react-icon": "^4.6.9", | ||
"@uiw/utils": "^4.6.9", | ||
"classnames": "2.2.6", | ||
"@uiw/react-icon": "^4.6.10", | ||
"@uiw/utils": "^4.6.10", | ||
"react-transition-group": "^4.3.0" | ||
@@ -53,3 +52,2 @@ }, | ||
"@babel/runtime": "7.10.4", | ||
"@types/classnames": "2.2.10", | ||
"@types/jest": "25.2.1", | ||
@@ -62,3 +60,3 @@ "@types/react": "16.9.41", | ||
}, | ||
"gitHead": "aff63672294a768b0730a6eaed73463c3b5b3ace" | ||
"gitHead": "dd796bd87132b68aee9dfe1faeb73eccc378bc60" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
115620
5
7
1237
- Removedclassnames@2.2.6
- Removedclassnames@2.2.6(transitive)
Updated@uiw/react-icon@^4.6.10
Updated@uiw/utils@^4.6.10