@onehat/ui 0.3.383 → 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onehat/ui",
3
- "version": "0.3.383",
3
+ "version": "0.3.385",
4
4
  "description": "Base UI for OneHat apps",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -31,7 +31,7 @@
31
31
  "@gluestack-ui/themed": "^1.1.26",
32
32
  "@hookform/resolvers": "^3.3.1",
33
33
  "@k-renwick/colour-mixer": "^1.2.1",
34
- "@onehat/data": "^1.21.18",
34
+ "@onehat/data": "^1.22.0",
35
35
  "@react-native-community/slider": "^4.5.2",
36
36
  "@reduxjs/toolkit": "^1.9.5",
37
37
  "inflector-js": "^1.0.1",
@@ -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
- overflow="hidden"
68
- textOverflow="ellipsis"
69
- alignSelf="center"
70
- style={{ userSelect: 'none', }}
71
- fontSize={styles.TREE_NODE_FONTSIZE}
72
- px={styles.TREE_NODE_PX}
73
- py={styles.TREE_NODE_PY}
74
- numberOfLines={1}
75
- ellipsizeMode="head"
76
- {...propsToPass}
77
- >{text}</Text>
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,