Skip to content

Commit

Permalink
PATCH: feat(tree): add visibleRef to bimdata tree node
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasRichel committed Apr 17, 2024
1 parent da7cfa5 commit 248491d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"es6": true,
"jest": true
},
"extends": ["plugin:vue/essential", "eslint:recommended", "prettier"],
"extends": ["plugin:vue/vue3-essential", "eslint:recommended", "prettier"],
"plugins": ["prettier", "vue"],
"globals": {
"Atomics": "readonly",
Expand Down
10 changes: 10 additions & 0 deletions src/BIMDataComponents/BIMDataTree/Node.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<template>
<div
ref="nodeRef"
v-show="visible"
class="bimdata-tree__node"
:class="{
'bimdata-tree__node--selected': node.id === state.selectedId,
Expand Down Expand Up @@ -113,12 +114,20 @@ Node = {
setup(props) {
const state = inject("state");
let visible = null;
if (isRef(props.node.visibleRef)) {
visible = props.node.visibleRef;
} else {
visible = ref(true);
}
let expanded = null;
if (isRef(props.node.expandedRef)) {
expanded = props.node.expandedRef;
} else {
expanded = ref(false);
}
const nodeRef = ref(null);
let expandTimer = null;
Expand Down Expand Up @@ -181,6 +190,7 @@ Node = {
state,
nodeRef,
expanded,
visible,
dropHelperPosition,
hasAncestorSelected: state.hasAncestorSelected,
onMouseEnter,
Expand Down

0 comments on commit 248491d

Please sign in to comment.