@uiw/react-tree
Advanced tools
Comparing version 4.21.14 to 5.0.0-bate-0
import React from 'react'; | ||
import { IconProps } from '@uiw/react-icon'; | ||
import { IProps, HTMLDivProps } from '@uiw/utils'; | ||
import './style/index.less'; | ||
export * from './style'; | ||
export declare type TreeRenderTitleNode = { | ||
@@ -53,3 +53,4 @@ selected?: boolean; | ||
} | ||
export declare const getChildKeys: (childs?: TreeData[], result?: TreeData['key'][], depth?: number | undefined) => TreeData['key'][]; | ||
export declare const getChildKeys: (childs?: TreeData[], result?: TreeData['key'][], depth?: number) => TreeData['key'][]; | ||
export default function Tree(props: TreeProps): JSX.Element; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -10,2 +10,5 @@ "use strict"; | ||
}); | ||
var _exportNames = { | ||
getChildKeys: true | ||
}; | ||
exports["default"] = Tree; | ||
@@ -28,4 +31,19 @@ exports.getChildKeys = void 0; | ||
var _index = require("./style/index"); | ||
var _jsxRuntime = require("react/jsx-runtime"); | ||
var _style = require("./style"); | ||
Object.keys(_style).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
if (key in exports && exports[key] === _style[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return _style[key]; | ||
} | ||
}); | ||
}); | ||
var _excluded = ["prefixCls", "icon", "data", "openKeys", "selectedKeys", "defaultExpandAll", "showLine", "iconAnimation", "isSelected", "checkStrictly", "multiple", "onExpand", "onSelected", "className", "autoExpandParent", "renderTitle", "onChange", "value"]; | ||
@@ -246,3 +264,3 @@ | ||
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", (0, _objectSpread2["default"])((0, _objectSpread2["default"])({ | ||
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TreeNodeStyleWrap, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({ | ||
className: cls | ||
@@ -249,0 +267,0 @@ }, elementProps), {}, { |
@@ -14,2 +14,3 @@ import React from 'react'; | ||
level: number; | ||
isOpen?: boolean; | ||
parent?: TreeData; | ||
@@ -27,1 +28,2 @@ icon?: T; | ||
export {}; | ||
//# sourceMappingURL=TreeNode.d.ts.map |
@@ -16,2 +16,4 @@ "use strict"; | ||
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); | ||
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties")); | ||
@@ -29,2 +31,4 @@ | ||
var _index = require("./style/index"); | ||
var _jsxRuntime = require("react/jsx-runtime"); | ||
@@ -84,3 +88,4 @@ | ||
}, []); | ||
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactTransitionGroup.CSSTransition, { | ||
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TreeNodeStyleCSSTransition, { | ||
as: _reactTransitionGroup.CSSTransition, | ||
nodeRef: node, | ||
@@ -95,4 +100,6 @@ classNames: prefixCls, | ||
onEntering: onEntering, | ||
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", { | ||
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TreeNodeStyleUl, { | ||
ref: node, | ||
isOpen: isOpen, | ||
level: level, | ||
className: [level !== 1 && isOpen ? ["".concat(prefixCls, "-open")] : null, level !== 1 && !isOpen ? ["".concat(prefixCls, "-close")] : null].filter(Boolean).join(' ').trim(), | ||
@@ -139,5 +146,5 @@ children: data.map(function (item, idx) { | ||
}, | ||
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", { | ||
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_index.TreeNodeStyleUlDiv, { | ||
className: "".concat(prefixCls, "-label"), | ||
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", { | ||
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TreeNodeStyleUlLidivSpan, { | ||
style: { | ||
@@ -150,7 +157,12 @@ display: noChild ? 'none' : 'auto' | ||
}, | ||
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIcon["default"], { | ||
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TreeNodeStyleUlLidivSpanIcon, { | ||
as: _reactIcon["default"], | ||
type: iconItem || 'caret-right', | ||
isIcon: (0, _typeof2["default"])(icon), | ||
isNoChild: noChild, | ||
isIconAnimation: iconAnimation, | ||
isItemIsOpen: itemIsOpen, | ||
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__*/(0, _jsxRuntime.jsx)("div", { | ||
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TreeNodeStyleUlLidivSpanDiv, { | ||
onClick: function onClick(evn) { | ||
@@ -161,2 +173,5 @@ var _disabledObj$onClick; | ||
}, | ||
judgeSelected: selected, | ||
judgeisSelected: isSelected, | ||
isDisabled: disabledObj.disabled, | ||
className: ["".concat(prefixCls, "-title"), selected && isSelected ? 'selected' : null, disabledObj.disabled, disabledObj.disabledMouse].filter(Boolean).join(' ').trim(), | ||
@@ -163,0 +178,0 @@ children: renderTitle ? renderTitle(item, { |
import React from 'react'; | ||
import { IconProps } from '@uiw/react-icon'; | ||
import { IProps, HTMLDivProps } from '@uiw/utils'; | ||
import './style/index.less'; | ||
export * from './style'; | ||
export declare type TreeRenderTitleNode = { | ||
@@ -53,3 +53,4 @@ selected?: boolean; | ||
} | ||
export declare const getChildKeys: (childs?: TreeData[], result?: TreeData['key'][], depth?: number | undefined) => TreeData['key'][]; | ||
export declare const getChildKeys: (childs?: TreeData[], result?: TreeData['key'][], depth?: number) => TreeData['key'][]; | ||
export default function Tree(props: TreeProps): JSX.Element; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -7,4 +7,5 @@ import _extends from "@babel/runtime/helpers/extends"; | ||
import TreeNode from './TreeNode'; | ||
import "./style/index.css"; | ||
import { TreeNodeStyleWrap } from './style/index'; | ||
import { jsx as _jsx } from "react/jsx-runtime"; | ||
export * from './style'; | ||
@@ -204,3 +205,3 @@ /** | ||
return /*#__PURE__*/_jsx("div", _extends({ | ||
return /*#__PURE__*/_jsx(TreeNodeStyleWrap, _extends({ | ||
className: cls | ||
@@ -207,0 +208,0 @@ }, elementProps, { |
@@ -14,2 +14,3 @@ import React from 'react'; | ||
level: number; | ||
isOpen?: boolean; | ||
parent?: TreeData; | ||
@@ -27,1 +28,2 @@ icon?: T; | ||
export {}; | ||
//# sourceMappingURL=TreeNode.d.ts.map |
@@ -9,2 +9,3 @@ import _extends from "@babel/runtime/helpers/extends"; | ||
import { getChildKeys } from './'; | ||
import { TreeNodeStyleCSSTransition, TreeNodeStyleUl, TreeNodeStyleUlDiv, TreeNodeStyleUlLidivSpan, TreeNodeStyleUlLidivSpanIcon, TreeNodeStyleUlLidivSpanDiv } from './style/index'; | ||
import { jsx as _jsx } from "react/jsx-runtime"; | ||
@@ -63,3 +64,4 @@ import { jsxs as _jsxs } from "react/jsx-runtime"; | ||
}, []); | ||
return /*#__PURE__*/_jsx(CSSTransition, { | ||
return /*#__PURE__*/_jsx(TreeNodeStyleCSSTransition, { | ||
as: CSSTransition, | ||
nodeRef: node, | ||
@@ -74,4 +76,6 @@ classNames: prefixCls, | ||
onEntering: onEntering, | ||
children: /*#__PURE__*/_jsx("ul", { | ||
children: /*#__PURE__*/_jsx(TreeNodeStyleUl, { | ||
ref: node, | ||
isOpen: isOpen, | ||
level: level, | ||
className: [level !== 1 && isOpen ? [prefixCls + "-open"] : null, level !== 1 && !isOpen ? [prefixCls + "-close"] : null].filter(Boolean).join(' ').trim(), | ||
@@ -114,5 +118,5 @@ children: data.map((item, idx) => { | ||
}, | ||
children: [/*#__PURE__*/_jsxs("div", { | ||
children: [/*#__PURE__*/_jsxs(TreeNodeStyleUlDiv, { | ||
className: prefixCls + "-label", | ||
children: [/*#__PURE__*/_jsx("span", { | ||
children: [/*#__PURE__*/_jsx(TreeNodeStyleUlLidivSpan, { | ||
style: { | ||
@@ -123,8 +127,16 @@ display: noChild ? 'none' : 'auto' | ||
onClick: evn => onItemClick(item, evn), | ||
children: /*#__PURE__*/_jsx(Icon, { | ||
children: /*#__PURE__*/_jsx(TreeNodeStyleUlLidivSpanIcon, { | ||
as: Icon, | ||
type: iconItem || 'caret-right', | ||
isIcon: typeof icon, | ||
isNoChild: noChild, | ||
isIconAnimation: iconAnimation, | ||
isItemIsOpen: itemIsOpen, | ||
className: [typeof icon === 'function' ? prefixCls + "-switcher-noop" : null, noChild ? 'no-child' : null, !iconAnimation ? 'no-animation' : null, itemIsOpen ? 'open' : null].filter(Boolean).join(' ').trim() | ||
}) | ||
}), /*#__PURE__*/_jsx("div", { | ||
}), /*#__PURE__*/_jsx(TreeNodeStyleUlLidivSpanDiv, { | ||
onClick: evn => disabledObj.onClick == null ? void 0 : disabledObj.onClick(item, evn), | ||
judgeSelected: selected, | ||
judgeisSelected: isSelected, | ||
isDisabled: disabledObj.disabled, | ||
className: [prefixCls + "-title", selected && isSelected ? 'selected' : null, disabledObj.disabled, disabledObj.disabledMouse].filter(Boolean).join(' ').trim(), | ||
@@ -131,0 +143,0 @@ children: renderTitle ? renderTitle(item, { |
{ | ||
"name": "@uiw/react-tree", | ||
"version": "4.21.14", | ||
"version": "5.0.0-bate-0", | ||
"description": "Tree component", | ||
@@ -44,9 +44,10 @@ "author": "Kenny Wong <wowohoo@qq.com>", | ||
"react": ">=16.9.0", | ||
"react-dom": ">=16.9.0" | ||
"react-dom": ">=16.9.0", | ||
"styled-components": ">=5.3.5" | ||
}, | ||
"dependencies": { | ||
"@uiw/react-icon": "^4.21.14", | ||
"@uiw/utils": "^4.21.14", | ||
"react-transition-group": "~4.4.2" | ||
"@uiw/react-icon": "^5.0.0-bate-0", | ||
"@uiw/utils": "^5.0.0-bate-0", | ||
"react-transition-group": "~4.4.5" | ||
} | ||
} |
@@ -18,5 +18,4 @@ Tree 树形控件 | ||
<!--rehype:bgWhite=true&codeSandbox=true&codePen=true--> | ||
```jsx | ||
import ReactDOM from 'react-dom'; | ||
```jsx mdx:preview&background=#fff&codeSandbox=true&codePen=true | ||
import React from 'react'; | ||
import { Tree, Card, Row, Col, } from 'uiw'; | ||
@@ -144,3 +143,3 @@ | ||
) | ||
ReactDOM.render(<Demo />, _mount_); | ||
export default Demo | ||
``` | ||
@@ -150,5 +149,4 @@ | ||
<!--rehype:bgWhite=true&codeSandbox=true&codePen=true--> | ||
```jsx | ||
import ReactDOM from 'react-dom'; | ||
```jsx mdx:preview&background=#fff&codeSandbox=true&codePen=true | ||
import React from 'react'; | ||
import { Tree, Card, Row, Col, Icon } from 'uiw'; | ||
@@ -287,3 +285,3 @@ | ||
) | ||
ReactDOM.render(<Demo />, _mount_); | ||
export default Demo | ||
``` | ||
@@ -295,6 +293,5 @@ | ||
<!--rehype:bgWhite=true&codeSandbox=true&codePen=true--> | ||
```jsx | ||
import ReactDOM from 'react-dom'; | ||
import { Tree, Card, Row, Col } from 'uiw'; | ||
```jsx mdx:preview&background=#fff&codeSandbox=true&codePen=true | ||
import React from 'react'; | ||
import { Tree, Card, Row, Col, Icon } from 'uiw'; | ||
@@ -404,3 +401,3 @@ const data = [ | ||
) | ||
ReactDOM.render(<Demo />, _mount_); | ||
export default Demo | ||
``` | ||
@@ -410,5 +407,4 @@ | ||
<!--rehype:bgWhite=true&codeSandbox=true&codePen=true--> | ||
```jsx | ||
import ReactDOM from 'react-dom'; | ||
```jsx mdx:preview&background=#fff&codeSandbox=true&codePen=true | ||
import React from 'react'; | ||
import { Tree, Card, Row, Col, Icon } from 'uiw'; | ||
@@ -533,3 +529,3 @@ | ||
) | ||
ReactDOM.render(<Demo />, _mount_); | ||
export default Demo | ||
``` | ||
@@ -541,5 +537,4 @@ | ||
<!--rehype:bgWhite=true&codeSandbox=true&codePen=true--> | ||
```jsx | ||
import ReactDOM from 'react-dom'; | ||
```jsx mdx:preview&background=#fff&codeSandbox=true&codePen=true | ||
import React from 'react'; | ||
import { Tree, Card, Row, Col } from 'uiw'; | ||
@@ -665,3 +660,3 @@ | ||
) | ||
ReactDOM.render(<Demo />, _mount_); | ||
export default Demo | ||
``` | ||
@@ -671,5 +666,4 @@ | ||
<!--rehype:bgWhite=true&codeSandbox=true&codePen=true--> | ||
```jsx | ||
import ReactDOM from 'react-dom'; | ||
```jsx mdx:preview&background=#fff&codeSandbox=true&codePen=true | ||
import React from 'react'; | ||
import { Tree, Card, Row, Col } from 'uiw'; | ||
@@ -788,3 +782,3 @@ | ||
) | ||
ReactDOM.render(<Demo />, _mount_); | ||
export default Demo | ||
``` | ||
@@ -795,5 +789,4 @@ | ||
<!--rehype:bgWhite=true&codeSandbox=true&codePen=true--> | ||
```jsx | ||
import ReactDOM from 'react-dom'; | ||
```jsx mdx:preview&background=#fff&codeSandbox=true&codePen=true | ||
import React from 'react'; | ||
import { Tree, Row, Col, Form, Button } from 'uiw'; | ||
@@ -921,3 +914,3 @@ | ||
} | ||
ReactDOM.render(<Demo />, _mount_); | ||
export default Demo | ||
``` | ||
@@ -924,0 +917,0 @@ |
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
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
178195
23
1752
6
1
948
+ Added@emotion/is-prop-valid@1.2.2(transitive)
+ Added@emotion/memoize@0.8.1(transitive)
+ Added@emotion/unitless@0.8.1(transitive)
+ Added@types/stylis@4.2.5(transitive)
+ Added@uiw/icons@2.6.1(transitive)
+ Added@uiw/react-icon@5.0.0-bate-9(transitive)
+ Added@uiw/utils@5.0.0-bate-9(transitive)
+ Addedcamelize@1.0.1(transitive)
+ Addedcss-color-keywords@1.0.0(transitive)
+ Addedcss-to-react-native@3.2.0(transitive)
+ Addednanoid@3.3.7(transitive)
+ Addedpicocolors@1.1.1(transitive)
+ Addedpostcss@8.4.38(transitive)
+ Addedpostcss-value-parser@4.2.0(transitive)
+ Addedshallowequal@1.1.0(transitive)
+ Addedsource-map-js@1.2.1(transitive)
+ Addedstyled-components@6.1.13(transitive)
+ Addedstylis@4.3.2(transitive)
+ Addedtslib@2.6.2(transitive)
- Removed@uiw/icons@2.6.10(transitive)
- Removed@uiw/react-icon@4.22.3(transitive)
- Removed@uiw/utils@4.22.3(transitive)
Updated@uiw/utils@^5.0.0-bate-0