@onehat/ui 0.3.223 → 0.3.225
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 +1 -1
- package/src/Components/Container/Splitter.js +10 -1
- package/src/Components/Grid/GridHeaderRow.js +1 -1
- package/src/Components/Grid/HeaderReorderHandle.js +10 -1
- package/src/Components/Grid/HeaderResizeHandle.js +10 -1
- package/src/Components/Hoc/Secondary/withSecondaryEditor.js +3 -2
- package/src/Components/Hoc/withEditor.js +3 -2
- package/src/Components/Tree/TreeNode.js +10 -1
package/package.json
CHANGED
|
@@ -45,6 +45,15 @@ function Splitter(props) {
|
|
|
45
45
|
</Column>;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
function withAdditionalProps(WrappedComponent) {
|
|
49
|
+
return (props) => {
|
|
50
|
+
return <WrappedComponent
|
|
51
|
+
isDraggable={true}
|
|
52
|
+
{...props}
|
|
53
|
+
/>;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
48
57
|
// Need a hoc to specifically deliver the 'getParentNode' prop
|
|
49
58
|
function withParentNode(WrappedComponent) {
|
|
50
59
|
return (props) => {
|
|
@@ -58,4 +67,4 @@ function withParentNode(WrappedComponent) {
|
|
|
58
67
|
};
|
|
59
68
|
}
|
|
60
69
|
|
|
61
|
-
export default withParentNode(withDraggable(Splitter));
|
|
70
|
+
export default withParentNode(withAdditionalProps(withDraggable(Splitter)));
|
|
@@ -26,4 +26,13 @@ function HeaderReorderHandle(props) {
|
|
|
26
26
|
</Column>;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
function withAdditionalProps(WrappedComponent) {
|
|
30
|
+
return (props) => {
|
|
31
|
+
return <WrappedComponent
|
|
32
|
+
isDraggable={true}
|
|
33
|
+
{...props}
|
|
34
|
+
/>;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export default withAdditionalProps(withDraggable(HeaderReorderHandle));
|
|
@@ -26,4 +26,13 @@ function HeaderResizeHandle(props) {
|
|
|
26
26
|
</Column>;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
function withAdditionalProps(WrappedComponent) {
|
|
30
|
+
return (props) => {
|
|
31
|
+
return <WrappedComponent
|
|
32
|
+
isDraggable={true}
|
|
33
|
+
{...props}
|
|
34
|
+
/>;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export default withAdditionalProps(withDraggable(HeaderResizeHandle));
|
|
@@ -305,8 +305,9 @@ export default function withSecondaryEditor(WrappedComponent, isTree = false) {
|
|
|
305
305
|
const
|
|
306
306
|
entity = secondarySelection[0],
|
|
307
307
|
idProperty = SecondaryRepository.getSchema().model.idProperty,
|
|
308
|
-
rawValues = _.omit(entity.getOriginalData(), idProperty)
|
|
309
|
-
|
|
308
|
+
rawValues = _.omit(entity.getOriginalData(), idProperty);
|
|
309
|
+
rawValues.id = null; // unset the id of the duplicate
|
|
310
|
+
const duplicate = await SecondaryRepository.add(rawValues, false, true);
|
|
310
311
|
setSecondaryIsIgnoreNextSelectionChange(true);
|
|
311
312
|
secondarySetSelection([duplicate]);
|
|
312
313
|
secondarySetEditorMode(EDITOR_MODE__EDIT);
|
|
@@ -302,8 +302,9 @@ export default function withEditor(WrappedComponent, isTree = false) {
|
|
|
302
302
|
const
|
|
303
303
|
entity = selection[0],
|
|
304
304
|
idProperty = Repository.getSchema().model.idProperty,
|
|
305
|
-
rawValues = _.omit(entity.getOriginalData(), idProperty)
|
|
306
|
-
|
|
305
|
+
rawValues = _.omit(entity.getOriginalData(), idProperty);
|
|
306
|
+
rawValues.id = null; // unset the id of the duplicate
|
|
307
|
+
const duplicate = await Repository.add(rawValues, false, true);
|
|
307
308
|
setIsIgnoreNextSelectionChange(true);
|
|
308
309
|
setSelection([duplicate]);
|
|
309
310
|
setEditorMode(EDITOR_MODE__EDIT);
|
|
@@ -87,4 +87,13 @@ export default function TreeNode(props) {
|
|
|
87
87
|
]);
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
function withAdditionalProps(WrappedComponent) {
|
|
91
|
+
return (props) => {
|
|
92
|
+
return <WrappedComponent
|
|
93
|
+
isDraggable={true}
|
|
94
|
+
{...props}
|
|
95
|
+
/>;
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export const DraggableTreeNode = withAdditionalProps(withDraggable(TreeNode));
|