@onehat/ui 0.4.21 → 0.4.23
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
|
@@ -53,7 +53,7 @@ function GridRow(props) {
|
|
|
53
53
|
hash = item?.hash || item;
|
|
54
54
|
return useMemo(() => {
|
|
55
55
|
|
|
56
|
-
let bg = props.bg || styles.GRID_ROW_BG,
|
|
56
|
+
let bg = rowProps.bg || props.bg || styles.GRID_ROW_BG,
|
|
57
57
|
mixWith;
|
|
58
58
|
if (isSelected) {
|
|
59
59
|
if (showHovers && isHovered) {
|
|
@@ -137,7 +137,7 @@ function GridRow(props) {
|
|
|
137
137
|
extraProps._web.style = {};
|
|
138
138
|
}
|
|
139
139
|
extraProps._web.style = {
|
|
140
|
-
userSelect: 'none',
|
|
140
|
+
// userSelect: 'none',
|
|
141
141
|
};
|
|
142
142
|
|
|
143
143
|
return <HStackNative
|
|
@@ -171,7 +171,7 @@ function GridRow(props) {
|
|
|
171
171
|
key={key}
|
|
172
172
|
overflow="hidden"
|
|
173
173
|
style={{
|
|
174
|
-
userSelect: 'none',
|
|
174
|
+
// userSelect: 'none',
|
|
175
175
|
...colStyle,
|
|
176
176
|
}}
|
|
177
177
|
minimizeForRow={true}
|
|
@@ -217,7 +217,7 @@ function GridRow(props) {
|
|
|
217
217
|
{...testProps('cell-' + config.fieldName)}
|
|
218
218
|
key={key}
|
|
219
219
|
style={{
|
|
220
|
-
userSelect: 'none',
|
|
220
|
+
// userSelect: 'none',
|
|
221
221
|
...colStyle,
|
|
222
222
|
}}
|
|
223
223
|
numberOfLines={1}
|
|
@@ -23,6 +23,7 @@ function ManagerScreen(props) {
|
|
|
23
23
|
title,
|
|
24
24
|
sideModeComponent,
|
|
25
25
|
fullModeComponent,
|
|
26
|
+
onChangeMode,
|
|
26
27
|
|
|
27
28
|
// withComponent
|
|
28
29
|
self,
|
|
@@ -33,6 +34,7 @@ function ManagerScreen(props) {
|
|
|
33
34
|
[isModeSet, setIsModeSet] = useState(false),
|
|
34
35
|
[allowSideBySide, setAllowSideBySide] = useState(false),
|
|
35
36
|
[mode, setModeRaw] = useState(MODE_FULL),
|
|
37
|
+
actualMode = (!allowSideBySide || mode === MODE_FULL) ? MODE_FULL : MODE_SIDE,
|
|
36
38
|
setMode = (newMode) => {
|
|
37
39
|
if (!allowSideBySide && newMode === MODE_SIDE) {
|
|
38
40
|
return;
|
|
@@ -44,6 +46,9 @@ function ManagerScreen(props) {
|
|
|
44
46
|
if (id) {
|
|
45
47
|
setSaved(id + '-mode', newMode);
|
|
46
48
|
}
|
|
49
|
+
if (onChangeMode) {
|
|
50
|
+
onChangeMode(newMode);
|
|
51
|
+
}
|
|
47
52
|
},
|
|
48
53
|
onLayout = (e) => {
|
|
49
54
|
if (sideModeComponent) {
|
|
@@ -74,14 +79,13 @@ function ManagerScreen(props) {
|
|
|
74
79
|
})();
|
|
75
80
|
}, [isRendered]);
|
|
76
81
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
whichComponent = fullModeComponent;
|
|
80
|
-
} else if (mode === MODE_SIDE) {
|
|
81
|
-
whichComponent = sideModeComponent;
|
|
82
|
+
if (self) {
|
|
83
|
+
self.mode = actualMode;
|
|
82
84
|
}
|
|
83
85
|
|
|
84
|
-
const
|
|
86
|
+
const
|
|
87
|
+
whichComponent = actualMode === MODE_FULL ? fullModeComponent : sideModeComponent,
|
|
88
|
+
textProps = {};
|
|
85
89
|
if (styles.MANAGER_SCREEN_TITLE) {
|
|
86
90
|
textProps.style = {
|
|
87
91
|
fontFamily: styles.MANAGER_SCREEN_TITLE,
|
|
@@ -104,7 +108,7 @@ function ManagerScreen(props) {
|
|
|
104
108
|
size: 'xl',
|
|
105
109
|
className: 'text-black',
|
|
106
110
|
}}
|
|
107
|
-
isDisabled={
|
|
111
|
+
isDisabled={actualMode === MODE_FULL}
|
|
108
112
|
onPress={() => setMode(MODE_FULL)}
|
|
109
113
|
tooltip="To full width"
|
|
110
114
|
className="ml-5"
|
|
@@ -116,7 +120,7 @@ function ManagerScreen(props) {
|
|
|
116
120
|
size: 'xl',
|
|
117
121
|
className: 'text-black',
|
|
118
122
|
}}
|
|
119
|
-
isDisabled={
|
|
123
|
+
isDisabled={actualMode === MODE_SIDE}
|
|
120
124
|
onPress={() => setMode(MODE_SIDE)}
|
|
121
125
|
tooltip="To side editor"
|
|
122
126
|
/>
|
|
@@ -121,6 +121,7 @@ function TreeComponent(props) {
|
|
|
121
121
|
initialSelection,
|
|
122
122
|
canRecordBeEdited,
|
|
123
123
|
onTreeLoad,
|
|
124
|
+
onLayout,
|
|
124
125
|
|
|
125
126
|
selectorId,
|
|
126
127
|
selectorSelected,
|
|
@@ -515,7 +516,7 @@ function TreeComponent(props) {
|
|
|
515
516
|
iconCollapsed: getNodeIcon(COLLAPSED, treeNode),
|
|
516
517
|
iconExpanded: getNodeIcon(EXPANDED, treeNode),
|
|
517
518
|
iconLeaf: getNodeIcon(LEAF, treeNode),
|
|
518
|
-
isExpanded: defaultToExpanded || isRoot, // all non-root treeNodes are collapsed by default
|
|
519
|
+
isExpanded: treeNode.isExpanded || defaultToExpanded || isRoot, // all non-root treeNodes are collapsed by default
|
|
519
520
|
isVisible: isRoot ? areRootsVisible : true,
|
|
520
521
|
isLoading: false,
|
|
521
522
|
children,
|
|
@@ -548,7 +549,7 @@ function TreeComponent(props) {
|
|
|
548
549
|
buildRowToDatumMap();
|
|
549
550
|
|
|
550
551
|
if (onTreeLoad) {
|
|
551
|
-
onTreeLoad();
|
|
552
|
+
onTreeLoad(self);
|
|
552
553
|
}
|
|
553
554
|
return treeNodeData;
|
|
554
555
|
},
|
|
@@ -1380,6 +1381,7 @@ function TreeComponent(props) {
|
|
|
1380
1381
|
return <VStackNative
|
|
1381
1382
|
{...testProps(self)}
|
|
1382
1383
|
className={className}
|
|
1384
|
+
onLayout={onLayout}
|
|
1383
1385
|
>
|
|
1384
1386
|
{topToolbar}
|
|
1385
1387
|
|
|
@@ -43,7 +43,7 @@ export default function TreeNode(props) {
|
|
|
43
43
|
|
|
44
44
|
return useMemo(() => {
|
|
45
45
|
const icon = hasChildren ? (isExpanded ? iconExpanded : iconCollapsed) : iconLeaf;
|
|
46
|
-
let bg = props.bg || styles.TREE_NODE_BG,
|
|
46
|
+
let bg = props.nodeProps?.bg || props.bg || styles.TREE_NODE_BG,
|
|
47
47
|
mixWith;
|
|
48
48
|
if (isSelected) {
|
|
49
49
|
if (isHovered) {
|