@onehat/ui 0.4.21 → 0.4.22

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.4.21",
3
+ "version": "0.4.22",
4
4
  "description": "Base UI for OneHat apps",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -33,6 +33,7 @@ function ManagerScreen(props) {
33
33
  [isModeSet, setIsModeSet] = useState(false),
34
34
  [allowSideBySide, setAllowSideBySide] = useState(false),
35
35
  [mode, setModeRaw] = useState(MODE_FULL),
36
+ actualMode = (!allowSideBySide || mode === MODE_FULL) ? MODE_FULL : MODE_SIDE,
36
37
  setMode = (newMode) => {
37
38
  if (!allowSideBySide && newMode === MODE_SIDE) {
38
39
  return;
@@ -74,14 +75,13 @@ function ManagerScreen(props) {
74
75
  })();
75
76
  }, [isRendered]);
76
77
 
77
- let whichComponent;
78
- if (!allowSideBySide || mode === MODE_FULL) {
79
- whichComponent = fullModeComponent;
80
- } else if (mode === MODE_SIDE) {
81
- whichComponent = sideModeComponent;
78
+ if (self) {
79
+ self.mode = actualMode;
82
80
  }
83
81
 
84
- const textProps = {};
82
+ const
83
+ whichComponent = actualMode === MODE_FULL ? fullModeComponent : sideModeComponent,
84
+ textProps = {};
85
85
  if (styles.MANAGER_SCREEN_TITLE) {
86
86
  textProps.style = {
87
87
  fontFamily: styles.MANAGER_SCREEN_TITLE,
@@ -104,7 +104,7 @@ function ManagerScreen(props) {
104
104
  size: 'xl',
105
105
  className: 'text-black',
106
106
  }}
107
- isDisabled={mode === MODE_FULL}
107
+ isDisabled={actualMode === MODE_FULL}
108
108
  onPress={() => setMode(MODE_FULL)}
109
109
  tooltip="To full width"
110
110
  className="ml-5"
@@ -116,7 +116,7 @@ function ManagerScreen(props) {
116
116
  size: 'xl',
117
117
  className: 'text-black',
118
118
  }}
119
- isDisabled={mode === MODE_SIDE}
119
+ isDisabled={actualMode === MODE_SIDE}
120
120
  onPress={() => setMode(MODE_SIDE)}
121
121
  tooltip="To side editor"
122
122
  />
@@ -548,7 +548,7 @@ function TreeComponent(props) {
548
548
  buildRowToDatumMap();
549
549
 
550
550
  if (onTreeLoad) {
551
- onTreeLoad();
551
+ onTreeLoad(self);
552
552
  }
553
553
  return treeNodeData;
554
554
  },