Skip to content

Commit

Permalink
feat(TreeView): remove react-treeview package to avoid using native…
Browse files Browse the repository at this point in the history
… `addEventListener` (#64)
  • Loading branch information
vovaspace authored Jan 15, 2024
1 parent a0a877b commit 48d0e4e
Show file tree
Hide file tree
Showing 5 changed files with 210 additions and 139 deletions.
137 changes: 76 additions & 61 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
"dependencies": {
"@gravity-ui/i18n": "^1.0.0",
"bem-cn-lite": "^4.1.0",
"react-list": "^0.8.17",
"react-treeview": "^0.4.7"
"react-list": "^0.8.17"
},
"devDependencies": {
"@babel/core": "^7.17.8",
Expand Down
16 changes: 11 additions & 5 deletions src/components/TreeView/TreeView.scss
Original file line number Diff line number Diff line change
Expand Up @@ -79,25 +79,31 @@ $step-offset: 24px;
align-items: center;
}

.tree-view_arrow {
&__arrow {
flex-shrink: 0;
width: 24px;
height: 24px;
padding: 0;
cursor: pointer;
border: none;

@include arrow-background(rgba(0, 0, 0, 0.85));

.g-root_theme_dark & {
@include arrow-background(rgba(255, 255, 255, 0.85));
}

&:not(.tree-view_arrow-collapsed) {
&:focus-visible {
outline: 2px solid var(--g-color-line-focus);
}

&:not(&_collapsed) {
transform: rotate(90deg);
}
}

&_no-arrow .tree-view_arrow {
visibility: hidden;
&_hidden {
visibility: hidden;
}
}

& & &__item {
Expand Down
Loading

0 comments on commit 48d0e4e

Please sign in to comment.