@xh/hoist 79.0.0-SNAPSHOT.1766097863558 → 79.0.0-SNAPSHOT.1766100504431
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.
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Copyright © 2025 Extremely Heavy Industries Inc.
|
|
6
6
|
*/
|
|
7
|
+
import {omit} from 'lodash';
|
|
7
8
|
import {DragEvent} from 'react';
|
|
8
9
|
import ReactGridLayout, {
|
|
9
10
|
type LayoutItem,
|
|
@@ -66,8 +67,15 @@ export const [DashCanvas, dashCanvas] = hoistCmp.withFactory<DashCanvasProps>({
|
|
|
66
67
|
render({className, model, rglOptions, testId}, ref) {
|
|
67
68
|
const isDraggable = !model.layoutLocked,
|
|
68
69
|
isResizable = !model.layoutLocked,
|
|
69
|
-
[padX, padY] = model.containerPadding
|
|
70
|
-
|
|
70
|
+
[padX, padY] = model.containerPadding,
|
|
71
|
+
topLevelRglOptions: Partial<GridLayoutProps> = omit(rglOptions ?? {}, [
|
|
72
|
+
'gridConfig',
|
|
73
|
+
'dragConfig',
|
|
74
|
+
'resizeConfig',
|
|
75
|
+
'dropConfig'
|
|
76
|
+
]),
|
|
77
|
+
{width, containerRef, mounted} = useContainerWidth();
|
|
78
|
+
|
|
71
79
|
return refreshContextView({
|
|
72
80
|
model: model.refreshContextModel,
|
|
73
81
|
item: div({
|
|
@@ -88,27 +96,31 @@ export const [DashCanvas, dashCanvas] = hoistCmp.withFactory<DashCanvasProps>({
|
|
|
88
96
|
cols: model.columns,
|
|
89
97
|
rowHeight: model.rowHeight,
|
|
90
98
|
margin: model.margin,
|
|
91
|
-
maxRows: model.maxRows
|
|
99
|
+
maxRows: model.maxRows,
|
|
100
|
+
...(rglOptions?.gridConfig ?? {})
|
|
92
101
|
},
|
|
93
102
|
dragConfig: {
|
|
94
103
|
enabled: isDraggable,
|
|
95
104
|
handle: '.xh-dash-tab.xh-panel > .xh-panel__content > .xh-panel-header',
|
|
96
105
|
cancel: '.xh-button',
|
|
97
|
-
bounded: true
|
|
106
|
+
bounded: true,
|
|
107
|
+
...(rglOptions?.dragConfig ?? {})
|
|
98
108
|
},
|
|
99
109
|
resizeConfig: {
|
|
100
|
-
enabled: isResizable
|
|
110
|
+
enabled: isResizable,
|
|
111
|
+
...(rglOptions?.resizeConfig ?? {})
|
|
101
112
|
},
|
|
102
113
|
dropConfig: {
|
|
103
114
|
enabled: model.contentLocked ? false : model.droppable,
|
|
104
|
-
defaultItem: {w: 6, h: 6}
|
|
115
|
+
defaultItem: {w: 6, h: 6},
|
|
116
|
+
...(rglOptions?.dropConfig ?? {})
|
|
105
117
|
},
|
|
106
118
|
compactor: model.compact ? verticalCompactor : noCompactor,
|
|
107
119
|
onLayoutChange: (layout: LayoutItem[]) =>
|
|
108
120
|
model.onRglLayoutChange(layout),
|
|
109
121
|
onResizeStart: () => (model.isResizing = true),
|
|
110
122
|
onResizeStop: () => (model.isResizing = false),
|
|
111
|
-
|
|
123
|
+
children: model.viewModels.map(vm =>
|
|
112
124
|
div({
|
|
113
125
|
key: vm.id,
|
|
114
126
|
item: dashCanvasView({model: vm})
|
|
@@ -117,7 +129,7 @@ export const [DashCanvas, dashCanvas] = hoistCmp.withFactory<DashCanvasProps>({
|
|
|
117
129
|
onDropDragOver: (evt: DragEvent) => model.onDropDragOver(evt),
|
|
118
130
|
onDrop: (layout: LayoutItem[], layoutItem: LayoutItem, evt: Event) =>
|
|
119
131
|
model.onDrop(layout, layoutItem, evt),
|
|
120
|
-
...
|
|
132
|
+
...topLevelRglOptions
|
|
121
133
|
}),
|
|
122
134
|
emptyContainerOverlay({omit: !model.showAddViewButtonWhenEmpty})
|
|
123
135
|
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xh/hoist",
|
|
3
|
-
"version": "79.0.0-SNAPSHOT.
|
|
3
|
+
"version": "79.0.0-SNAPSHOT.1766100504431",
|
|
4
4
|
"description": "Hoist add-on for building and deploying React Applications.",
|
|
5
5
|
"repository": "github:xh/hoist-react",
|
|
6
6
|
"homepage": "https://xh.io",
|