MCPcopy
hub / github.com/electerm/electerm / ItemListTree

Class ItemListTree

src/client/components/tree-list/tree-list.jsx:34–894  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32} from './tree-list-layout'
33
34export default class ItemListTree extends Component {
35 constructor (props) {
36 super(props)
37 this.state = {
38 ready: false,
39 keyword: '',
40 parentId: '',
41 showNewBookmarkGroupForm: false,
42 bookmarkGroupTitle: '',
43 bookmarkGroupColor: '',
44 categoryTitle: '',
45 categoryColor: '',
46 categoryId: '',
47 searchSelectedRowKey: ''
48 }
49 this.listRef = React.createRef()
50 }
51
52 onSubmit = false
53
54 onSubmitEdit = false
55
56 componentDidMount () {
57 this.timer = setTimeout(() => {
58 this.setState({
59 ready: true
60 })
61 }, 0)
62 }
63
64 componentWillUnmount () {
65 clearTimeout(this.timer)
66 }
67
68 scrollTreeToTop = () => {
69 const listWrap = this.listRef.current
70 if (listWrap) {
71 listWrap.scrollTop = 0
72 }
73 }
74
75 onCancelMoveItem = () => {
76 this.setState({
77 openMoveModal: false,
78 moveItem: null,
79 moveItemIsGroup: false
80 })
81 }
82
83 onExpandKey = group => {
84 const {
85 expandedKeys
86 } = window.store
87 expandedKeys.push(group.id)
88 this.onExpand()
89 }
90
91 onUnExpandKey = group => {

Callers

nothing calls this directly

Calls 13

buildVisibleTreeRowsFunction · 0.90
getRandomDefaultColorFunction · 0.90
uidFunction · 0.85
actionFunction · 0.85
findParentBySelFunction · 0.85
filterFunction · 0.85
pickFunction · 0.85
getDataMethod · 0.80
filterMethod · 0.80
funcFunction · 0.50
copyFunction · 0.50
addMethod · 0.45

Tested by

no test coverage detected