@xh/hoist 76.0.0-SNAPSHOT.1757949377824 → 76.0.0-SNAPSHOT.1757966316621

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/CHANGELOG.md CHANGED
@@ -23,6 +23,8 @@
23
23
  practice. App maintainers should ensure that all global views are appropriate and well
24
24
  organized enough to be shown immediately to new users in the view menu.
25
25
  * New constraint rule: `validEmails` - to validate one or more email addresses in an input field.
26
+ * `DashCanvas` accepts a new prop `rglOptions` to pass additional options to the underlying
27
+ `react-grid-layout`.
26
28
 
27
29
  ### 🐞 Bug Fixes
28
30
 
@@ -1,9 +1,18 @@
1
1
  import { HoistProps, TestSupportProps } from '@xh/hoist/core';
2
2
  import '@xh/hoist/desktop/register';
3
+ import type { ReactGridLayoutProps } from 'react-grid-layout';
3
4
  import { DashCanvasModel } from './DashCanvasModel';
4
5
  import 'react-grid-layout/css/styles.css';
5
6
  import './DashCanvas.scss';
6
- export type DashCanvasProps = HoistProps<DashCanvasModel> & TestSupportProps;
7
+ export interface DashCanvasProps extends HoistProps<DashCanvasModel>, TestSupportProps {
8
+ /**
9
+ * Optional additional configuration options to pass through to the underlying ReactGridLayout component.
10
+ * See the RGL documentation for details:
11
+ * {@link https://www.npmjs.com/package/react-grid-layout#grid-layout-props}
12
+ * Note that some ReactGridLayout props are managed directly by DashCanvas and will be overridden if provided here.
13
+ */
14
+ rglOptions?: ReactGridLayoutProps;
15
+ }
7
16
  /**
8
17
  * Dashboard-style container that allows users to drag-and-drop child widgets into flexible layouts.
9
18
  *
@@ -21,6 +21,7 @@ import {Classes, overlay} from '@xh/hoist/kit/blueprint';
21
21
  import {consumeEvent, TEST_ID} from '@xh/hoist/utils/js';
22
22
  import classNames from 'classnames';
23
23
  import ReactGridLayout, {WidthProvider} from 'react-grid-layout';
24
+ import type {ReactGridLayoutProps} from 'react-grid-layout';
24
25
  import {DashCanvasModel} from './DashCanvasModel';
25
26
  import {dashCanvasContextMenu} from './impl/DashCanvasContextMenu';
26
27
  import {dashCanvasView} from './impl/DashCanvasView';
@@ -28,7 +29,15 @@ import {dashCanvasView} from './impl/DashCanvasView';
28
29
  import 'react-grid-layout/css/styles.css';
29
30
  import './DashCanvas.scss';
30
31
 
31
- export type DashCanvasProps = HoistProps<DashCanvasModel> & TestSupportProps;
32
+ export interface DashCanvasProps extends HoistProps<DashCanvasModel>, TestSupportProps {
33
+ /**
34
+ * Optional additional configuration options to pass through to the underlying ReactGridLayout component.
35
+ * See the RGL documentation for details:
36
+ * {@link https://www.npmjs.com/package/react-grid-layout#grid-layout-props}
37
+ * Note that some ReactGridLayout props are managed directly by DashCanvas and will be overridden if provided here.
38
+ */
39
+ rglOptions?: ReactGridLayoutProps;
40
+ }
32
41
 
33
42
  /**
34
43
  * Dashboard-style container that allows users to drag-and-drop child widgets into flexible layouts.
@@ -46,7 +55,7 @@ export const [DashCanvas, dashCanvas] = hoistCmp.withFactory<DashCanvasProps>({
46
55
  className: 'xh-dash-canvas',
47
56
  model: uses(DashCanvasModel),
48
57
 
49
- render({className, model, testId}, ref) {
58
+ render({className, model, rglOptions, testId}, ref) {
50
59
  const isDraggable = !model.layoutLocked,
51
60
  isResizable = !model.layoutLocked,
52
61
  [padX, padY] = model.containerPadding;
@@ -86,7 +95,8 @@ export const [DashCanvas, dashCanvas] = hoistCmp.withFactory<DashCanvasProps>({
86
95
  key: vm.id,
87
96
  item: dashCanvasView({model: vm})
88
97
  })
89
- )
98
+ ),
99
+ ...rglOptions
90
100
  }),
91
101
  emptyContainerOverlay()
92
102
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist",
3
- "version": "76.0.0-SNAPSHOT.1757949377824",
3
+ "version": "76.0.0-SNAPSHOT.1757966316621",
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",
@@ -96,6 +96,7 @@
96
96
  "@ag-grid-community/react": "31.x",
97
97
  "@types/react": "18.x",
98
98
  "@types/react-dom": "18.x",
99
+ "@types/react-grid-layout": "1.3.5",
99
100
  "@xh/hoist-dev-utils": "11.x",
100
101
  "csstype": "3.x",
101
102
  "eslint": "9.x",