@onehat/ui 0.3.384 → 0.3.385
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
|
@@ -77,6 +77,9 @@ function TreeComponent(props) {
|
|
|
77
77
|
}
|
|
78
78
|
return item[displayIx];
|
|
79
79
|
},
|
|
80
|
+
getNodeContent = (item) => { // extracts model/data and decides what the row content should be
|
|
81
|
+
return null;
|
|
82
|
+
},
|
|
80
83
|
getDisplayTextFromSearchResults = (item) => {
|
|
81
84
|
return item.id
|
|
82
85
|
},
|
|
@@ -460,6 +463,7 @@ function TreeComponent(props) {
|
|
|
460
463
|
datum = {
|
|
461
464
|
item: treeNode,
|
|
462
465
|
text: getNodeText(treeNode),
|
|
466
|
+
content: getNodeContent(treeNode),
|
|
463
467
|
iconCollapsed: getNodeIcon(COLLAPSED, treeNode),
|
|
464
468
|
iconExpanded: getNodeIcon(EXPANDED, treeNode),
|
|
465
469
|
iconLeaf: getNodeIcon(LEAF, treeNode),
|
|
@@ -33,6 +33,7 @@ export default function TreeNode(props) {
|
|
|
33
33
|
hasChildren = item.hasChildren,
|
|
34
34
|
depth = item.depth,
|
|
35
35
|
text = datum.text,
|
|
36
|
+
content = datum.content,
|
|
36
37
|
iconCollapsed = datum.iconCollapsed,
|
|
37
38
|
iconExpanded = datum.iconExpanded,
|
|
38
39
|
iconLeaf = datum.iconLeaf,
|
|
@@ -63,18 +64,20 @@ export default function TreeNode(props) {
|
|
|
63
64
|
{...testProps('expandBtn')}
|
|
64
65
|
/> : <Icon as={icon} px={2} />)}
|
|
65
66
|
|
|
66
|
-
<Text
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
67
|
+
{text ? <Text
|
|
68
|
+
overflow="hidden"
|
|
69
|
+
textOverflow="ellipsis"
|
|
70
|
+
alignSelf="center"
|
|
71
|
+
style={{ userSelect: 'none', }}
|
|
72
|
+
fontSize={styles.TREE_NODE_FONTSIZE}
|
|
73
|
+
px={styles.TREE_NODE_PX}
|
|
74
|
+
py={styles.TREE_NODE_PY}
|
|
75
|
+
numberOfLines={1}
|
|
76
|
+
ellipsizeMode="head"
|
|
77
|
+
{...propsToPass}
|
|
78
|
+
>{text}</Text> : null}
|
|
79
|
+
|
|
80
|
+
{content}
|
|
78
81
|
|
|
79
82
|
</Row>;
|
|
80
83
|
}, [
|
|
@@ -87,6 +90,7 @@ export default function TreeNode(props) {
|
|
|
87
90
|
hasChildren,
|
|
88
91
|
depth,
|
|
89
92
|
text,
|
|
93
|
+
content,
|
|
90
94
|
icon,
|
|
91
95
|
onToggle,
|
|
92
96
|
isLoading,
|