2020-06-11 07:24:19 +00:00
|
|
|
import React from "react";
|
|
|
|
|
import styled from "styled-components";
|
|
|
|
|
|
2020-06-19 07:30:11 +00:00
|
|
|
const TreeStructureWrapper = styled.div`
|
|
|
|
|
li {
|
|
|
|
|
list-style: none;
|
|
|
|
|
}
|
2020-06-11 07:24:19 +00:00
|
|
|
|
2020-06-19 07:30:11 +00:00
|
|
|
.tree,
|
|
|
|
|
.tree ul {
|
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
margin-top: 0;
|
|
|
|
|
margin-left: 9px;
|
|
|
|
|
padding: 0;
|
|
|
|
|
list-style: none;
|
2023-04-06 16:49:12 +00:00
|
|
|
color: var(--ads-color-black-200);
|
2020-06-19 07:30:11 +00:00
|
|
|
position: relative;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.tree ul {
|
|
|
|
|
margin-left: 9px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.tree:before,
|
|
|
|
|
.tree ul:before {
|
|
|
|
|
content: "";
|
|
|
|
|
display: block;
|
|
|
|
|
width: 0;
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 0;
|
|
|
|
|
bottom: 0;
|
|
|
|
|
left: 0;
|
2023-04-06 16:49:12 +00:00
|
|
|
border-left: 1px solid;
|
|
|
|
|
border-color: var(--ads-color-black-200);
|
2020-06-19 07:30:11 +00:00
|
|
|
}
|
2020-06-11 07:24:19 +00:00
|
|
|
|
2020-06-19 07:30:11 +00:00
|
|
|
.tree li {
|
|
|
|
|
margin: 0;
|
2020-08-05 07:33:44 +00:00
|
|
|
padding-left: 6px;
|
2020-06-19 07:30:11 +00:00
|
|
|
line-height: 18px;
|
2023-04-06 16:49:12 +00:00
|
|
|
margin-top: 8px;
|
2020-06-19 07:30:11 +00:00
|
|
|
position: relative;
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-06 16:49:12 +00:00
|
|
|
.tree li div {
|
|
|
|
|
position: relative;
|
|
|
|
|
z-index: 10;
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-19 07:30:11 +00:00
|
|
|
.tree li:before {
|
|
|
|
|
content: "";
|
|
|
|
|
display: block;
|
|
|
|
|
width: 9px;
|
|
|
|
|
height: 0;
|
2023-04-06 16:49:12 +00:00
|
|
|
border-top: 1px solid;
|
|
|
|
|
margin-top: 0px;
|
2020-06-19 07:30:11 +00:00
|
|
|
position: absolute;
|
2023-04-06 16:49:12 +00:00
|
|
|
top: 14px;
|
2020-06-19 07:30:11 +00:00
|
|
|
left: 0;
|
2023-04-06 16:49:12 +00:00
|
|
|
border-color: var(--ads-color-black-200);
|
|
|
|
|
}
|
2020-06-19 07:30:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.tree li:last-child:before {
|
2023-04-06 16:49:12 +00:00
|
|
|
background: white;
|
2020-06-19 07:30:11 +00:00
|
|
|
height: auto;
|
|
|
|
|
bottom: 0;
|
|
|
|
|
}
|
2020-06-11 07:24:19 +00:00
|
|
|
`;
|
|
|
|
|
|
2020-06-19 07:30:11 +00:00
|
|
|
type TreeStructureProps = {
|
|
|
|
|
children: React.ReactNode;
|
|
|
|
|
};
|
|
|
|
|
|
2022-07-14 05:00:30 +00:00
|
|
|
const TreeStructure = React.forwardRef(
|
|
|
|
|
(props: TreeStructureProps, ref: any) => {
|
|
|
|
|
return (
|
|
|
|
|
<TreeStructureWrapper ref={ref}>{props.children}</TreeStructureWrapper>
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
);
|
2020-06-11 07:24:19 +00:00
|
|
|
|
|
|
|
|
export default TreeStructure;
|