deps: upgrade rc-tree

This commit is contained in:
Benjy Cui 2017-07-28 11:38:39 +08:00
parent bcb82a518b
commit fff756ff5f
4 changed files with 55 additions and 71 deletions

View File

@ -10,7 +10,7 @@ exports[`renders ./components/tree/demo/basic.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-noline_open" class="ant-tree-switcher ant-tree-switcher_open"
/> />
<span <span
class="ant-tree-checkbox ant-tree-checkbox-checked" class="ant-tree-checkbox ant-tree-checkbox-checked"
@ -37,7 +37,7 @@ exports[`renders ./components/tree/demo/basic.md correctly 1`] = `
class="ant-tree-treenode-disabled" class="ant-tree-treenode-disabled"
> >
<span <span
class="ant-tree-switcher ant-tree-noline_open ant-tree-switcher-disabled" class="ant-tree-switcher ant-tree-switcher_open ant-tree-switcher-disabled"
/> />
<span <span
class="ant-tree-checkbox ant-tree-checkbox-checked ant-tree-checkbox-disabled" class="ant-tree-checkbox ant-tree-checkbox-checked ant-tree-checkbox-disabled"
@ -64,10 +64,10 @@ exports[`renders ./components/tree/demo/basic.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-switcher-noop ant-tree-noline_docu" class="ant-tree-switcher ant-tree-switcher-noop"
/> />
<span <span
class="ant-tree-checkbox ant-tree-checkbox-disabled" class="ant-tree-checkbox ant-tree-checkbox-checked ant-tree-checkbox-disabled"
> >
<span <span
class="ant-tree-checkbox-inner" class="ant-tree-checkbox-inner"
@ -88,7 +88,7 @@ exports[`renders ./components/tree/demo/basic.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-switcher-noop ant-tree-noline_docu" class="ant-tree-switcher ant-tree-switcher-noop"
/> />
<span <span
class="ant-tree-checkbox ant-tree-checkbox-checked" class="ant-tree-checkbox ant-tree-checkbox-checked"
@ -114,7 +114,7 @@ exports[`renders ./components/tree/demo/basic.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-noline_open" class="ant-tree-switcher ant-tree-switcher_open"
/> />
<span <span
class="ant-tree-checkbox ant-tree-checkbox-checked" class="ant-tree-checkbox ant-tree-checkbox-checked"
@ -141,7 +141,7 @@ exports[`renders ./components/tree/demo/basic.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-switcher-noop ant-tree-noline_docu" class="ant-tree-switcher ant-tree-switcher-noop"
/> />
<span <span
class="ant-tree-checkbox ant-tree-checkbox-checked" class="ant-tree-checkbox ant-tree-checkbox-checked"
@ -182,7 +182,7 @@ exports[`renders ./components/tree/demo/basic-controlled.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-noline_open" class="ant-tree-switcher ant-tree-switcher_open"
/> />
<span <span
class="ant-tree-checkbox ant-tree-checkbox-indeterminate" class="ant-tree-checkbox ant-tree-checkbox-indeterminate"
@ -209,7 +209,7 @@ exports[`renders ./components/tree/demo/basic-controlled.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-noline_open" class="ant-tree-switcher ant-tree-switcher_open"
/> />
<span <span
class="ant-tree-checkbox ant-tree-checkbox-checked ant-tree-checkbox-disabled" class="ant-tree-checkbox ant-tree-checkbox-checked ant-tree-checkbox-disabled"
@ -236,7 +236,7 @@ exports[`renders ./components/tree/demo/basic-controlled.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-switcher-noop ant-tree-noline_docu" class="ant-tree-switcher ant-tree-switcher-noop"
/> />
<span <span
class="ant-tree-checkbox ant-tree-checkbox-checked" class="ant-tree-checkbox ant-tree-checkbox-checked"
@ -260,7 +260,7 @@ exports[`renders ./components/tree/demo/basic-controlled.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-switcher-noop ant-tree-noline_docu" class="ant-tree-switcher ant-tree-switcher-noop"
/> />
<span <span
class="ant-tree-checkbox ant-tree-checkbox-checked" class="ant-tree-checkbox ant-tree-checkbox-checked"
@ -284,7 +284,7 @@ exports[`renders ./components/tree/demo/basic-controlled.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-switcher-noop ant-tree-noline_docu" class="ant-tree-switcher ant-tree-switcher-noop"
/> />
<span <span
class="ant-tree-checkbox ant-tree-checkbox-checked" class="ant-tree-checkbox ant-tree-checkbox-checked"
@ -310,7 +310,7 @@ exports[`renders ./components/tree/demo/basic-controlled.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-noline_open" class="ant-tree-switcher ant-tree-switcher_open"
/> />
<span <span
class="ant-tree-checkbox" class="ant-tree-checkbox"
@ -337,7 +337,7 @@ exports[`renders ./components/tree/demo/basic-controlled.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-switcher-noop ant-tree-noline_docu" class="ant-tree-switcher ant-tree-switcher-noop"
/> />
<span <span
class="ant-tree-checkbox" class="ant-tree-checkbox"
@ -361,7 +361,7 @@ exports[`renders ./components/tree/demo/basic-controlled.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-switcher-noop ant-tree-noline_docu" class="ant-tree-switcher ant-tree-switcher-noop"
/> />
<span <span
class="ant-tree-checkbox" class="ant-tree-checkbox"
@ -385,7 +385,7 @@ exports[`renders ./components/tree/demo/basic-controlled.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-switcher-noop ant-tree-noline_docu" class="ant-tree-switcher ant-tree-switcher-noop"
/> />
<span <span
class="ant-tree-checkbox" class="ant-tree-checkbox"
@ -411,7 +411,7 @@ exports[`renders ./components/tree/demo/basic-controlled.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-switcher-noop ant-tree-noline_docu" class="ant-tree-switcher ant-tree-switcher-noop"
/> />
<span <span
class="ant-tree-checkbox" class="ant-tree-checkbox"
@ -437,7 +437,7 @@ exports[`renders ./components/tree/demo/basic-controlled.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-noline_close" class="ant-tree-switcher ant-tree-switcher_close"
/> />
<span <span
class="ant-tree-checkbox" class="ant-tree-checkbox"
@ -461,7 +461,7 @@ exports[`renders ./components/tree/demo/basic-controlled.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-switcher-noop ant-tree-noline_docu" class="ant-tree-switcher ant-tree-switcher-noop"
/> />
<span <span
class="ant-tree-checkbox" class="ant-tree-checkbox"
@ -494,7 +494,7 @@ exports[`renders ./components/tree/demo/customized-icon.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-roots_open" class="ant-tree-switcher ant-tree-switcher_open"
/> />
<span <span
class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-open" class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-open"
@ -517,7 +517,7 @@ exports[`renders ./components/tree/demo/customized-icon.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-center_open" class="ant-tree-switcher ant-tree-switcher_open"
/> />
<span <span
class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-open ant-tree-node-selected" class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-open ant-tree-node-selected"
@ -533,14 +533,14 @@ exports[`renders ./components/tree/demo/customized-icon.md correctly 1`] = `
</span> </span>
</span> </span>
<ul <ul
class="ant-tree-child-tree ant-tree-child-tree-open ant-tree-line" class="ant-tree-child-tree ant-tree-child-tree-open"
data-expanded="true" data-expanded="true"
> >
<li <li
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-switcher-noop ant-tree-center_docu" class="ant-tree-switcher ant-tree-switcher-noop"
/> />
<span <span
class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-normal" class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-normal"
@ -560,7 +560,7 @@ exports[`renders ./components/tree/demo/customized-icon.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-switcher-noop ant-tree-bottom_docu" class="ant-tree-switcher ant-tree-switcher-noop"
/> />
<span <span
class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-normal" class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-normal"
@ -582,7 +582,7 @@ exports[`renders ./components/tree/demo/customized-icon.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-center_open" class="ant-tree-switcher ant-tree-switcher_open"
/> />
<span <span
class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-open" class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-open"
@ -598,14 +598,14 @@ exports[`renders ./components/tree/demo/customized-icon.md correctly 1`] = `
</span> </span>
</span> </span>
<ul <ul
class="ant-tree-child-tree ant-tree-child-tree-open ant-tree-line" class="ant-tree-child-tree ant-tree-child-tree-open"
data-expanded="true" data-expanded="true"
> >
<li <li
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-switcher-noop ant-tree-bottom_docu" class="ant-tree-switcher ant-tree-switcher-noop"
/> />
<span <span
class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-normal" class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-normal"
@ -627,7 +627,7 @@ exports[`renders ./components/tree/demo/customized-icon.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-switcher-noop ant-tree-bottom_docu" class="ant-tree-switcher ant-tree-switcher-noop"
/> />
<span <span
class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-normal" class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-normal"
@ -658,7 +658,7 @@ exports[`renders ./components/tree/demo/draggable.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-noline_open" class="ant-tree-switcher ant-tree-switcher_open"
/> />
<span <span
aria-grabbed="true" aria-grabbed="true"
@ -680,7 +680,7 @@ exports[`renders ./components/tree/demo/draggable.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-noline_open" class="ant-tree-switcher ant-tree-switcher_open"
/> />
<span <span
aria-grabbed="true" aria-grabbed="true"
@ -702,7 +702,7 @@ exports[`renders ./components/tree/demo/draggable.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-switcher-noop ant-tree-noline_docu" class="ant-tree-switcher ant-tree-switcher-noop"
/> />
<span <span
aria-grabbed="true" aria-grabbed="true"
@ -721,7 +721,7 @@ exports[`renders ./components/tree/demo/draggable.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-switcher-noop ant-tree-noline_docu" class="ant-tree-switcher ant-tree-switcher-noop"
/> />
<span <span
aria-grabbed="true" aria-grabbed="true"
@ -740,7 +740,7 @@ exports[`renders ./components/tree/demo/draggable.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-switcher-noop ant-tree-noline_docu" class="ant-tree-switcher ant-tree-switcher-noop"
/> />
<span <span
aria-grabbed="true" aria-grabbed="true"
@ -761,7 +761,7 @@ exports[`renders ./components/tree/demo/draggable.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-noline_close" class="ant-tree-switcher ant-tree-switcher_close"
/> />
<span <span
aria-grabbed="true" aria-grabbed="true"
@ -780,7 +780,7 @@ exports[`renders ./components/tree/demo/draggable.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-switcher-noop ant-tree-noline_docu" class="ant-tree-switcher ant-tree-switcher-noop"
/> />
<span <span
aria-grabbed="true" aria-grabbed="true"
@ -801,7 +801,7 @@ exports[`renders ./components/tree/demo/draggable.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-noline_close" class="ant-tree-switcher ant-tree-switcher_close"
/> />
<span <span
aria-grabbed="true" aria-grabbed="true"
@ -820,7 +820,7 @@ exports[`renders ./components/tree/demo/draggable.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-switcher-noop ant-tree-noline_docu" class="ant-tree-switcher ant-tree-switcher-noop"
/> />
<span <span
aria-grabbed="true" aria-grabbed="true"
@ -856,7 +856,7 @@ exports[`renders ./components/tree/demo/line.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-roots_open" class="ant-tree-switcher ant-tree-switcher_open"
/> />
<span <span
class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-open" class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-open"
@ -876,7 +876,7 @@ exports[`renders ./components/tree/demo/line.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-center_open" class="ant-tree-switcher ant-tree-switcher_open"
/> />
<span <span
class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-open" class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-open"
@ -889,14 +889,14 @@ exports[`renders ./components/tree/demo/line.md correctly 1`] = `
</span> </span>
</span> </span>
<ul <ul
class="ant-tree-child-tree ant-tree-child-tree-open ant-tree-line" class="ant-tree-child-tree ant-tree-child-tree-open"
data-expanded="true" data-expanded="true"
> >
<li <li
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-switcher-noop ant-tree-center_docu" class="ant-tree-switcher ant-tree-switcher-noop"
/> />
<span <span
class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-normal" class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-normal"
@ -913,7 +913,7 @@ exports[`renders ./components/tree/demo/line.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-switcher-noop ant-tree-center_docu" class="ant-tree-switcher ant-tree-switcher-noop"
/> />
<span <span
class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-normal" class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-normal"
@ -930,7 +930,7 @@ exports[`renders ./components/tree/demo/line.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-switcher-noop ant-tree-bottom_docu" class="ant-tree-switcher ant-tree-switcher-noop"
/> />
<span <span
class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-normal" class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-normal"
@ -949,7 +949,7 @@ exports[`renders ./components/tree/demo/line.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-center_close" class="ant-tree-switcher ant-tree-switcher_close"
/> />
<span <span
class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-close" class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-close"
@ -966,7 +966,7 @@ exports[`renders ./components/tree/demo/line.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-bottom_close" class="ant-tree-switcher ant-tree-switcher_close"
/> />
<span <span
class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-close" class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-close"
@ -1012,7 +1012,7 @@ exports[`renders ./components/tree/demo/search.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-noline_close" class="ant-tree-switcher ant-tree-switcher_close"
/> />
<span <span
class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-close" class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-close"
@ -1034,7 +1034,7 @@ exports[`renders ./components/tree/demo/search.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-noline_close" class="ant-tree-switcher ant-tree-switcher_close"
/> />
<span <span
class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-close" class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-close"
@ -1056,7 +1056,7 @@ exports[`renders ./components/tree/demo/search.md correctly 1`] = `
class="" class=""
> >
<span <span
class="ant-tree-switcher ant-tree-switcher-noop ant-tree-noline_docu" class="ant-tree-switcher ant-tree-switcher-noop"
/> />
<span <span
class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-normal" class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-normal"

View File

@ -1,7 +1,6 @@
import React from 'react'; import React from 'react';
import RcTree, { TreeNode } from 'rc-tree'; import RcTree, { TreeNode } from 'rc-tree';
import animation from '../_util/openAnimation'; import animation from '../_util/openAnimation';
import classNames from 'classnames';
export interface AntTreeNodeProps { export interface AntTreeNodeProps {
disabled?: boolean; disabled?: boolean;
@ -97,15 +96,12 @@ export default class Tree extends React.Component<TreeProps, any> {
render() { render() {
const props = this.props; const props = this.props;
const { prefixCls, className, showLine } = props; const { prefixCls, className } = props;
let checkable = props.checkable; let checkable = props.checkable;
const classString = classNames({
[`${prefixCls}-show-line`]: !!showLine,
}, className);
return ( return (
<RcTree <RcTree
{...props} {...props}
className={classString} className={className}
checkable={checkable ? <span className={`${prefixCls}-checkbox-inner`} /> : checkable} checkable={checkable ? <span className={`${prefixCls}-checkbox-inner`} /> : checkable}
> >
{this.props.children} {this.props.children}

View File

@ -102,16 +102,10 @@
&.@{tree-prefix-cls}-switcher-noop { &.@{tree-prefix-cls}-switcher-noop {
cursor: default; cursor: default;
} }
&.@{tree-prefix-cls}-roots_open, &.@{tree-prefix-cls}-switcher_open {
&.@{tree-prefix-cls}-center_open,
&.@{tree-prefix-cls}-bottom_open,
&.@{tree-prefix-cls}-noline_open {
.antTreeSwitcherIcon(); .antTreeSwitcherIcon();
} }
&.@{tree-prefix-cls}-roots_close, &.@{tree-prefix-cls}-switcher_close {
&.@{tree-prefix-cls}-center_close,
&.@{tree-prefix-cls}-bottom_close,
&.@{tree-prefix-cls}-noline_close {
.antTreeSwitcherIcon(); .antTreeSwitcherIcon();
.ie-rotate(3); .ie-rotate(3);
&:after { &:after {
@ -174,17 +168,11 @@
&.@{tree-prefix-cls}-switcher-noop { &.@{tree-prefix-cls}-switcher-noop {
.antTreeShowLineIcon("tree-doc-icon"); .antTreeShowLineIcon("tree-doc-icon");
} }
&.@{tree-prefix-cls}-roots_open, &.@{tree-prefix-cls}-switcher_open {
&.@{tree-prefix-cls}-center_open,
&.@{tree-prefix-cls}-bottom_open,
&.@{tree-prefix-cls}-noline_open {
color: @tree-showline-icon-color; color: @tree-showline-icon-color;
.antTreeShowLineIcon("tree-showline-open-icon"); .antTreeShowLineIcon("tree-showline-open-icon");
} }
&.@{tree-prefix-cls}-roots_close, &.@{tree-prefix-cls}-switcher_close {
&.@{tree-prefix-cls}-center_close,
&.@{tree-prefix-cls}-bottom_close,
&.@{tree-prefix-cls}-noline_close {
color: @tree-showline-icon-color; color: @tree-showline-icon-color;
.antTreeShowLineIcon("tree-showline-close-icon"); .antTreeShowLineIcon("tree-showline-close-icon");
} }

View File

@ -68,7 +68,7 @@
"rc-tabs": "~8.0.0", "rc-tabs": "~8.0.0",
"rc-time-picker": "~2.4.1", "rc-time-picker": "~2.4.1",
"rc-tooltip": "~3.4.6", "rc-tooltip": "~3.4.6",
"rc-tree": "~1.6.0", "rc-tree": "~1.7.0",
"rc-tree-select": "~1.10.2", "rc-tree-select": "~1.10.2",
"rc-upload": "~2.3.7", "rc-upload": "~2.3.7",
"rc-util": "^4.0.4", "rc-util": "^4.0.4",