@bimdata/design-system 2.1.0-rc.16 → 2.1.0-rc.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bimdata/design-system",
3
- "version": "2.1.0-rc.16",
3
+ "version": "2.1.0-rc.18",
4
4
  "main": "./src/BIMDataComponents/index.js",
5
5
  "module": "./src/BIMDataComponents/index.js",
6
6
  "files": [
@@ -48,11 +48,43 @@
48
48
  </template>
49
49
 
50
50
  <script>
51
- import { inject, ref, computed, watch, isRef } from "vue";
51
+ import { inject, ref, computed, watch, isRef, h } from "vue";
52
52
 
53
- import NodeChildren from "./NodeChildren.js";
53
+ let Node, NodeChildren;
54
54
 
55
- export default {
55
+ NodeChildren = {
56
+ inject: ["root"],
57
+ props: {
58
+ node: {
59
+ type: Object,
60
+ required: true,
61
+ validator: node => Number.isFinite(node?.id),
62
+ },
63
+ depth: {
64
+ type: Number,
65
+ default: 0,
66
+ },
67
+ },
68
+ render() {
69
+ const { node, depth, root } = this;
70
+
71
+ const state = root.state;
72
+
73
+ return node.children.map(child =>
74
+ h(Node, { node: child, depth, key: child.id }, () =>
75
+ root.$slots.node?.({
76
+ node: child,
77
+ depth,
78
+ selected: child.id === state.selectedId,
79
+ hovered: child.id === state.hoveredNode?.id,
80
+ ancestorSelected: state.hasAncestorSelected(child),
81
+ })
82
+ )
83
+ );
84
+ },
85
+ };
86
+
87
+ Node = {
56
88
  name: "Node",
57
89
  components: {
58
90
  NodeChildren,
@@ -144,6 +176,8 @@ export default {
144
176
  };
145
177
  },
146
178
  };
179
+
180
+ export default Node;
147
181
  </script>
148
182
 
149
183
  <style scoped lang="scss">
@@ -1,35 +0,0 @@
1
- import { h } from "vue";
2
-
3
- import Node from "./Node.vue";
4
-
5
- export default {
6
- inject: ["root"],
7
- props: {
8
- node: {
9
- type: Object,
10
- required: true,
11
- validator: node => Number.isFinite(node?.id),
12
- },
13
- depth: {
14
- type: Number,
15
- default: 0,
16
- },
17
- },
18
- render() {
19
- const { node, depth, root } = this;
20
-
21
- const state = root.state;
22
-
23
- return node.children.map(child =>
24
- h(Node, { node: child, depth, key: child.id }, () =>
25
- root.$slots.node?.({
26
- node: child,
27
- depth,
28
- selected: child.id === state.selectedId,
29
- hovered: child.id === state.hoveredNode?.id,
30
- ancestorSelected: state.hasAncestorSelected(child),
31
- })
32
- )
33
- );
34
- },
35
- };