Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
be4f7b18
Commit
be4f7b18
authored
Oct 21, 2020
by
ioedeveloper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show expanded details
parent
4212cae3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
9 deletions
+24
-9
dropdown-panel.tsx
...mix-ui/debugger-ui/src/lib/vm-debugger/dropdown-panel.tsx
+13
-4
solidity-locals.tsx
...ix-ui/debugger-ui/src/lib/vm-debugger/solidity-locals.tsx
+0
-1
tree-view-item.tsx
...ix-ui/tree-view/src/lib/tree-view-item/tree-view-item.tsx
+7
-3
index.ts
libs/remix-ui/tree-view/src/types/index.ts
+4
-1
No files found.
libs/remix-ui/debugger-ui/src/lib/vm-debugger/dropdown-panel.tsx
View file @
be4f7b18
import
React
,
{
useState
,
use
Ref
,
use
Effect
}
from
'react'
import
React
,
{
useState
,
useEffect
}
from
'react'
import
{
TreeView
,
TreeViewItem
}
from
'@remix-ui/tree-view'
import
{
DropdownPanelProps
,
ExtractData
,
ExtractFunc
}
from
'../../types'
import
{
CopyToClipboard
}
from
'@remix-ui/clipboard'
...
...
@@ -57,7 +57,8 @@ export const DropdownPanel = (props: DropdownPanelProps) => {
},
copiableContent
:
''
,
updating
:
false
,
data
:
null
data
:
null
,
expandPath
:
[]
})
useEffect
(()
=>
{
...
...
@@ -81,6 +82,14 @@ export const DropdownPanel = (props: DropdownPanelProps) => {
})
}
const
handleExpand
=
(
keyPath
)
=>
{
if
(
!
state
.
expandPath
.
includes
(
keyPath
))
{
state
.
expandPath
.
push
(
keyPath
)
}
else
{
state
.
expandPath
=
state
.
expandPath
.
filter
(
path
=>
!
path
.
startsWith
(
keyPath
))
}
}
const
message
=
(
message
)
=>
{
if
(
message
===
state
.
message
.
innerText
)
return
setState
(
prevState
=>
{
...
...
@@ -148,14 +157,14 @@ export const DropdownPanel = (props: DropdownPanelProps) => {
if
(
children
&&
children
.
length
>
0
)
{
return
(
<
TreeViewItem
id=
{
`treeViewItem${key}`
}
key=
{
keyPath
}
label=
{
formatSelfFunc
?
formatSelfFunc
(
key
,
data
)
:
formatSelfDefault
(
key
,
data
)
}
>
<
TreeViewItem
id=
{
`treeViewItem${key}`
}
key=
{
keyPath
}
label=
{
formatSelfFunc
?
formatSelfFunc
(
key
,
data
)
:
formatSelfDefault
(
key
,
data
)
}
handleClick=
{
()
=>
handleExpand
(
keyPath
)
}
expand=
{
state
.
expandPath
.
includes
(
keyPath
)
}
>
<
TreeView
id=
{
`treeView${key}`
}
key=
{
keyPath
}
>
{
children
}
</
TreeView
>
</
TreeViewItem
>
)
}
else
{
return
<
TreeViewItem
id=
{
key
.
toString
()
}
key=
{
keyPath
}
label=
{
formatSelfFunc
?
formatSelfFunc
(
key
,
data
)
:
formatSelfDefault
(
key
,
data
)
}
/>
return
<
TreeViewItem
id=
{
key
.
toString
()
}
key=
{
keyPath
}
label=
{
formatSelfFunc
?
formatSelfFunc
(
key
,
data
)
:
formatSelfDefault
(
key
,
data
)
}
handleClick=
{
()
=>
handleExpand
(
keyPath
)
}
expand=
{
state
.
expandPath
.
includes
(
keyPath
)
}
/>
}
}
...
...
libs/remix-ui/debugger-ui/src/lib/vm-debugger/solidity-locals.tsx
View file @
be4f7b18
...
...
@@ -8,7 +8,6 @@ export const SolidityLocals = ({ data, message }) => {
const
[
calldata
,
setCalldata
]
=
useState
(
null
)
useEffect
(()
=>
{
console
.
log
(
'data: '
,
data
)
if
(
!
deepequal
(
calldata
,
data
))
setCalldata
(
data
)
},
[
data
])
...
...
libs/remix-ui/tree-view/src/lib/tree-view-item/tree-view-item.tsx
View file @
be4f7b18
import
React
,
{
useState
}
from
'react'
import
React
,
{
useState
,
useEffect
}
from
'react'
import
{
TreeViewItemProps
}
from
'../../types'
import
'./tree-view-item.css'
export
const
TreeViewItem
=
(
props
:
TreeViewItemProps
)
=>
{
const
{
id
,
children
,
label
,
...
otherProps
}
=
props
const
{
id
,
children
,
label
,
expand
,
handleClick
,
...
otherProps
}
=
props
const
[
isExpanded
,
setIsExpanded
]
=
useState
(
false
)
useEffect
(()
=>
{
setIsExpanded
(
expand
)
},
[
expand
])
return
(
<
li
key=
{
`treeViewLi${id}`
}
data
-
id=
{
`treeViewLi${id}`
}
className=
'li_tv'
{
...
otherProps
}
>
<
li
key=
{
`treeViewLi${id}`
}
data
-
id=
{
`treeViewLi${id}`
}
className=
'li_tv'
onClick=
{
handleClick
}
{
...
otherProps
}
>
<
div
key=
{
`treeViewDiv${id}`
}
data
-
id=
{
`treeViewDiv${id}`
}
className=
'd-flex flex-row align-items-center'
onClick=
{
()
=>
setIsExpanded
(
!
isExpanded
)
}
>
<
div
className=
{
isExpanded
?
'px-1 fas fa-caret-down caret caret_tv'
:
'px-1 fas fa-caret-right caret caret_tv'
}
style=
{
{
visibility
:
children
?
'visible'
:
'hidden'
}
}
></
div
>
<
span
className=
'w-100 pl-1'
>
...
...
libs/remix-ui/tree-view/src/types/index.ts
View file @
be4f7b18
...
...
@@ -6,5 +6,7 @@ export interface TreeViewProps {
export
interface
TreeViewItemProps
{
children
?:
React
.
ReactNode
,
id
:
string
,
label
:
string
|
number
|
React
.
ReactNode
label
:
string
|
number
|
React
.
ReactNode
,
expand
?:
boolean
,
handleClick
?:
(
e
)
=>
void
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment