@antscorp/antsomi-ui 1.3.5-beta.778 → 1.3.5-beta.779
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3,16 +3,13 @@ import { Tree as AntdTree } from 'antd';
|
|
|
3
3
|
// styled
|
|
4
4
|
import { StyledTree, StyledTreeDirectory } from './styled';
|
|
5
5
|
// icon
|
|
6
|
-
import { ExpandMoreIcon } from '../../icons';
|
|
6
|
+
import { DraftDocumentIcon, ExpandMoreIcon, FolderCreateNewFolderIcon } from '../../icons';
|
|
7
7
|
const StandardTree = props => {
|
|
8
8
|
const { switcherIcon = _jsx(ExpandMoreIcon, { size: 20 }), ...restProps } = props;
|
|
9
9
|
return _jsx(StyledTree, { switcherIcon: switcherIcon, ...restProps });
|
|
10
10
|
// return <StyledTree switcherIcon={(props) => <ExpandMoreIcon size={20} />} {...restProps} />;
|
|
11
11
|
};
|
|
12
12
|
export const Tree = AntdTree;
|
|
13
|
-
const DirectoryTree = props => {
|
|
14
|
-
const { switcherIcon = _jsx(ExpandMoreIcon, { size: 20 }), ...restProps } = props;
|
|
15
|
-
return _jsx(StyledTreeDirectory, { switcherIcon: switcherIcon, ...restProps });
|
|
16
|
-
};
|
|
13
|
+
const DirectoryTree = props => (_jsx(StyledTreeDirectory, { switcherIcon: ({ expanded }) => (_jsx(ExpandMoreIcon, { size: 20, style: !expanded ? { transform: 'rotate(-90deg)' } : undefined })), icon: ({ isLeaf }) => (isLeaf ? _jsx(DraftDocumentIcon, {}) : _jsx(FolderCreateNewFolderIcon, {})), ...props }));
|
|
17
14
|
Tree.DirectoryTree = DirectoryTree;
|
|
18
15
|
Tree.Standard = StandardTree;
|