2022-01-14 04:25:47 +00:00
|
|
|
<template>
|
2022-02-27 19:49:34 +00:00
|
|
|
<span class="row" v-for="(row, index) in unref(nodes)" :key="index" v-bind="$attrs">
|
2022-01-25 04:25:34 +00:00
|
|
|
<TreeNode
|
|
|
|
v-for="(node, nodeIndex) in row"
|
|
|
|
:key="nodeIndex"
|
2022-02-27 19:49:34 +00:00
|
|
|
v-bind="gatherNodeProps(node)"
|
2022-01-25 04:25:34 +00:00
|
|
|
/>
|
2022-01-14 04:25:47 +00:00
|
|
|
</span>
|
2022-02-27 19:49:34 +00:00
|
|
|
<span class="left-side-nodes" v-if="unref(leftSideNodes)">
|
2022-01-14 04:25:47 +00:00
|
|
|
<TreeNode
|
2022-02-27 19:49:34 +00:00
|
|
|
v-for="(node, nodeIndex) in unref(leftSideNodes)"
|
2022-01-14 04:25:47 +00:00
|
|
|
:key="nodeIndex"
|
2022-02-27 19:49:34 +00:00
|
|
|
v-bind="gatherNodeProps(node)"
|
2022-01-14 04:25:47 +00:00
|
|
|
small
|
|
|
|
/>
|
|
|
|
</span>
|
2022-02-27 19:49:34 +00:00
|
|
|
<span class="side-nodes" v-if="unref(rightSideNodes)">
|
2022-01-14 04:25:47 +00:00
|
|
|
<TreeNode
|
2022-02-27 19:49:34 +00:00
|
|
|
v-for="(node, nodeIndex) in unref(rightSideNodes)"
|
2022-01-14 04:25:47 +00:00
|
|
|
:key="nodeIndex"
|
2022-02-27 19:49:34 +00:00
|
|
|
v-bind="gatherNodeProps(node)"
|
2022-01-14 04:25:47 +00:00
|
|
|
small
|
|
|
|
/>
|
|
|
|
</span>
|
2022-03-20 18:57:45 +00:00
|
|
|
<Links v-if="branches" :links="unref(branches)" />
|
2022-01-14 04:25:47 +00:00
|
|
|
</template>
|
|
|
|
|
2022-01-25 04:23:30 +00:00
|
|
|
<script lang="ts">
|
2022-03-04 03:39:48 +00:00
|
|
|
import "components/common/table.css";
|
2022-03-20 18:57:45 +00:00
|
|
|
import { GenericTreeNode, TreeBranch } from "features/trees/tree";
|
2022-03-04 03:39:48 +00:00
|
|
|
import { processedPropType } from "util/vue";
|
2022-02-27 19:49:34 +00:00
|
|
|
import { defineComponent, unref } from "vue";
|
2022-01-14 04:25:47 +00:00
|
|
|
import TreeNode from "./TreeNode.vue";
|
2022-03-20 18:57:45 +00:00
|
|
|
import Links from "features/links/Links.vue";
|
2022-01-14 04:25:47 +00:00
|
|
|
|
2022-01-25 04:25:34 +00:00
|
|
|
export default defineComponent({
|
|
|
|
props: {
|
|
|
|
nodes: {
|
2022-02-27 19:49:34 +00:00
|
|
|
type: processedPropType<GenericTreeNode[][]>(Array),
|
2022-01-25 04:25:34 +00:00
|
|
|
required: true
|
|
|
|
},
|
2022-02-27 19:49:34 +00:00
|
|
|
leftSideNodes: processedPropType<GenericTreeNode[]>(Array),
|
2022-03-20 18:57:45 +00:00
|
|
|
rightSideNodes: processedPropType<GenericTreeNode[]>(Array),
|
|
|
|
branches: processedPropType<TreeBranch[]>(Array)
|
2022-01-25 04:25:34 +00:00
|
|
|
},
|
2022-03-20 18:57:45 +00:00
|
|
|
components: { TreeNode, Links },
|
2022-01-25 04:25:34 +00:00
|
|
|
setup() {
|
2022-02-27 19:49:34 +00:00
|
|
|
function gatherNodeProps(node: GenericTreeNode) {
|
|
|
|
const {
|
|
|
|
display,
|
|
|
|
visibility,
|
|
|
|
style,
|
|
|
|
classes,
|
|
|
|
onClick,
|
|
|
|
onHold,
|
|
|
|
color,
|
|
|
|
glowColor,
|
|
|
|
canClick,
|
|
|
|
mark,
|
|
|
|
id
|
|
|
|
} = node;
|
|
|
|
return {
|
|
|
|
display,
|
|
|
|
visibility,
|
|
|
|
style,
|
|
|
|
classes,
|
|
|
|
onClick,
|
|
|
|
onHold,
|
|
|
|
color,
|
|
|
|
glowColor,
|
|
|
|
canClick,
|
|
|
|
mark,
|
|
|
|
id
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
gatherNodeProps,
|
|
|
|
unref
|
|
|
|
};
|
2022-01-25 04:25:34 +00:00
|
|
|
}
|
2022-01-25 04:23:30 +00:00
|
|
|
});
|
2022-01-14 04:25:47 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.row {
|
|
|
|
margin: 50px auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
.left-side-nodes {
|
|
|
|
position: absolute;
|
|
|
|
left: 15px;
|
|
|
|
top: 65px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.side-nodes {
|
|
|
|
position: absolute;
|
|
|
|
right: 15px;
|
|
|
|
top: 65px;
|
|
|
|
}
|
|
|
|
</style>
|