@sguisse/react-grid-layout 2.2.3-sguisse.3
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/LICENSE +21 -0
- package/README.md +125 -0
- package/css/styles.css +120 -0
- package/dist/ResponsiveGridLayout-B_6TXsWM.d.ts +80 -0
- package/dist/ResponsiveGridLayout-Bin5MBC3.d.mts +80 -0
- package/dist/calculate-CoBSgofg.d.mts +196 -0
- package/dist/calculate-K0IBpu53.d.ts +196 -0
- package/dist/chunk-7BT7XXIT.js +74 -0
- package/dist/chunk-G3PAJYGP.mjs +72 -0
- package/dist/chunk-ITLZ7N2R.mjs +456 -0
- package/dist/chunk-J4LTYI7L.js +485 -0
- package/dist/chunk-KKV4ZCG4.mjs +583 -0
- package/dist/chunk-LQOPWRJR.js +623 -0
- package/dist/chunk-O3KX3VYW.mjs +1 -0
- package/dist/chunk-STBCV65G.js +3159 -0
- package/dist/chunk-UZL6BMXQ.mjs +3146 -0
- package/dist/chunk-ZJHF4QM5.js +2 -0
- package/dist/core.d.mts +160 -0
- package/dist/core.d.ts +160 -0
- package/dist/core.js +268 -0
- package/dist/core.mjs +3 -0
- package/dist/extras.d.mts +208 -0
- package/dist/extras.d.ts +208 -0
- package/dist/extras.js +388 -0
- package/dist/extras.mjs +380 -0
- package/dist/index.d.mts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +152 -0
- package/dist/index.mjs +5 -0
- package/dist/legacy.d.mts +163 -0
- package/dist/legacy.d.ts +163 -0
- package/dist/legacy.js +331 -0
- package/dist/legacy.mjs +319 -0
- package/dist/position-BeP60S5h.d.ts +316 -0
- package/dist/position-CeG3Nr4z.d.mts +316 -0
- package/dist/react.d.mts +214 -0
- package/dist/react.d.ts +214 -0
- package/dist/react.js +94 -0
- package/dist/react.mjs +5 -0
- package/dist/responsive-D4zBXLkH.d.ts +145 -0
- package/dist/responsive-DQi_9rBi.d.mts +145 -0
- package/dist/types-Dbg8jAWj.d.mts +458 -0
- package/dist/types-Dbg8jAWj.d.ts +458 -0
- package/index-dev.js +23 -0
- package/index.js +8 -0
- package/package.json +238 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React__default, { ComponentType } from 'react';
|
|
3
|
+
import { a as GridLayoutProps, b as ResponsiveGridLayoutProps } from './ResponsiveGridLayout-Bin5MBC3.mjs';
|
|
4
|
+
import { L as Layout, d as LayoutItem, C as CompactType, R as ResizeHandleAxis, B as Breakpoint, a as Breakpoints, e as ResponsiveLayouts } from './types-Dbg8jAWj.mjs';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Legacy props interface for backwards compatibility with v1 API.
|
|
8
|
+
* These flat props are converted to composable interfaces internally.
|
|
9
|
+
*/
|
|
10
|
+
interface LegacyReactGridLayoutProps {
|
|
11
|
+
children: React__default.ReactNode;
|
|
12
|
+
width: number;
|
|
13
|
+
cols?: number;
|
|
14
|
+
rowHeight?: number;
|
|
15
|
+
maxRows?: number;
|
|
16
|
+
margin?: readonly [number, number];
|
|
17
|
+
containerPadding?: readonly [number, number] | null;
|
|
18
|
+
layout?: Layout;
|
|
19
|
+
droppingItem?: LayoutItem;
|
|
20
|
+
compactType?: CompactType;
|
|
21
|
+
preventCollision?: boolean;
|
|
22
|
+
allowOverlap?: boolean;
|
|
23
|
+
/** @deprecated Use compactType instead */
|
|
24
|
+
verticalCompact?: boolean;
|
|
25
|
+
isDraggable?: boolean;
|
|
26
|
+
isBounded?: boolean;
|
|
27
|
+
draggableHandle?: string;
|
|
28
|
+
draggableCancel?: string;
|
|
29
|
+
isResizable?: boolean;
|
|
30
|
+
resizeHandles?: ResizeHandleAxis[];
|
|
31
|
+
resizeHandle?: React__default.ReactElement | ((axis: ResizeHandleAxis, ref: React__default.Ref<HTMLElement>) => React__default.ReactElement);
|
|
32
|
+
isDroppable?: boolean;
|
|
33
|
+
useCSSTransforms?: boolean;
|
|
34
|
+
transformScale?: number;
|
|
35
|
+
autoSize?: boolean;
|
|
36
|
+
className?: string;
|
|
37
|
+
style?: React__default.CSSProperties;
|
|
38
|
+
innerRef?: React__default.Ref<HTMLDivElement>;
|
|
39
|
+
onLayoutChange?: (layout: Layout) => void;
|
|
40
|
+
onDragStart?: GridLayoutProps["onDragStart"];
|
|
41
|
+
onDrag?: GridLayoutProps["onDrag"];
|
|
42
|
+
onDragStop?: GridLayoutProps["onDragStop"];
|
|
43
|
+
onResizeStart?: GridLayoutProps["onResizeStart"];
|
|
44
|
+
onResize?: GridLayoutProps["onResize"];
|
|
45
|
+
onResizeStop?: GridLayoutProps["onResizeStop"];
|
|
46
|
+
onDrop?: (layout: Layout, item: LayoutItem | undefined, e: Event) => void;
|
|
47
|
+
onDropDragOver?: (e: React__default.DragEvent) => {
|
|
48
|
+
w?: number;
|
|
49
|
+
h?: number;
|
|
50
|
+
} | false | void;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* ReactGridLayout - Legacy wrapper component
|
|
54
|
+
*
|
|
55
|
+
* Converts v1 flat props to v2 composable interfaces for backwards compatibility.
|
|
56
|
+
*/
|
|
57
|
+
declare function ReactGridLayout(props: LegacyReactGridLayoutProps): react_jsx_runtime.JSX.Element;
|
|
58
|
+
declare namespace ReactGridLayout {
|
|
59
|
+
var displayName: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Legacy props interface for backwards compatibility with v1 API.
|
|
64
|
+
* These flat props are converted to composable interfaces internally.
|
|
65
|
+
*/
|
|
66
|
+
interface LegacyResponsiveReactGridLayoutProps<B extends Breakpoint = string> {
|
|
67
|
+
children: React__default.ReactNode;
|
|
68
|
+
width: number;
|
|
69
|
+
breakpoint?: B;
|
|
70
|
+
breakpoints?: Breakpoints<B>;
|
|
71
|
+
cols?: Breakpoints<B>;
|
|
72
|
+
layouts?: ResponsiveLayouts<B>;
|
|
73
|
+
onBreakpointChange?: (newBreakpoint: B, cols: number) => void;
|
|
74
|
+
onLayoutChange?: (layout: Layout, layouts: ResponsiveLayouts<B>) => void;
|
|
75
|
+
onWidthChange?: (containerWidth: number, margin: readonly [number, number], cols: number, containerPadding: readonly [number, number] | null) => void;
|
|
76
|
+
rowHeight?: number;
|
|
77
|
+
maxRows?: number;
|
|
78
|
+
margin?: readonly [number, number] | Partial<Record<B, readonly [number, number]>>;
|
|
79
|
+
containerPadding?: readonly [number, number] | Partial<Record<B, readonly [number, number] | null>> | null;
|
|
80
|
+
droppingItem?: LayoutItem;
|
|
81
|
+
compactType?: CompactType;
|
|
82
|
+
preventCollision?: boolean;
|
|
83
|
+
allowOverlap?: boolean;
|
|
84
|
+
/** @deprecated Use compactType instead */
|
|
85
|
+
verticalCompact?: boolean;
|
|
86
|
+
isDraggable?: boolean;
|
|
87
|
+
isBounded?: boolean;
|
|
88
|
+
draggableHandle?: string;
|
|
89
|
+
draggableCancel?: string;
|
|
90
|
+
isResizable?: boolean;
|
|
91
|
+
resizeHandles?: ResizeHandleAxis[];
|
|
92
|
+
resizeHandle?: React__default.ReactElement | ((axis: ResizeHandleAxis, ref: React__default.Ref<HTMLElement>) => React__default.ReactElement);
|
|
93
|
+
isDroppable?: boolean;
|
|
94
|
+
useCSSTransforms?: boolean;
|
|
95
|
+
transformScale?: number;
|
|
96
|
+
autoSize?: boolean;
|
|
97
|
+
className?: string;
|
|
98
|
+
style?: React__default.CSSProperties;
|
|
99
|
+
innerRef?: React__default.Ref<HTMLDivElement>;
|
|
100
|
+
onDragStart?: ResponsiveGridLayoutProps<B>["onDragStart"];
|
|
101
|
+
onDrag?: ResponsiveGridLayoutProps<B>["onDrag"];
|
|
102
|
+
onDragStop?: ResponsiveGridLayoutProps<B>["onDragStop"];
|
|
103
|
+
onResizeStart?: ResponsiveGridLayoutProps<B>["onResizeStart"];
|
|
104
|
+
onResize?: ResponsiveGridLayoutProps<B>["onResize"];
|
|
105
|
+
onResizeStop?: ResponsiveGridLayoutProps<B>["onResizeStop"];
|
|
106
|
+
onDrop?: (layout: Layout, item: LayoutItem | undefined, e: Event) => void;
|
|
107
|
+
onDropDragOver?: (e: React__default.DragEvent) => {
|
|
108
|
+
w?: number;
|
|
109
|
+
h?: number;
|
|
110
|
+
} | false | void;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* ResponsiveReactGridLayout - Legacy wrapper component
|
|
114
|
+
*
|
|
115
|
+
* Converts v1 flat props to v2 composable interfaces for backwards compatibility.
|
|
116
|
+
*/
|
|
117
|
+
declare function ResponsiveReactGridLayout<B extends Breakpoint = string>(props: LegacyResponsiveReactGridLayoutProps<B>): react_jsx_runtime.JSX.Element;
|
|
118
|
+
declare namespace ResponsiveReactGridLayout {
|
|
119
|
+
var displayName: string;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* WidthProvider HOC
|
|
124
|
+
*
|
|
125
|
+
* A Higher-Order Component that provides width measurement to grid layouts.
|
|
126
|
+
* This wraps any component and provides the container width as a prop.
|
|
127
|
+
*/
|
|
128
|
+
|
|
129
|
+
interface WidthProviderProps {
|
|
130
|
+
/** If true, will not render children until mounted */
|
|
131
|
+
measureBeforeMount?: boolean;
|
|
132
|
+
/** Additional class name */
|
|
133
|
+
className?: string;
|
|
134
|
+
/** Additional styles */
|
|
135
|
+
style?: React__default.CSSProperties;
|
|
136
|
+
}
|
|
137
|
+
type WithWidthProps<P> = Omit<P, "width"> & WidthProviderProps;
|
|
138
|
+
/**
|
|
139
|
+
* WidthProvider - HOC that provides container width
|
|
140
|
+
*
|
|
141
|
+
* A simple HOC that provides facility for listening to container resizes.
|
|
142
|
+
* Wraps the provided component and passes down a `width` prop.
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* ```tsx
|
|
146
|
+
* import { GridLayout, WidthProvider } from 'react-grid-layout';
|
|
147
|
+
*
|
|
148
|
+
* const GridLayoutWithWidth = WidthProvider(GridLayout);
|
|
149
|
+
*
|
|
150
|
+
* function MyGrid() {
|
|
151
|
+
* return (
|
|
152
|
+
* <GridLayoutWithWidth cols={12} rowHeight={30}>
|
|
153
|
+
* <div key="a">a</div>
|
|
154
|
+
* </GridLayoutWithWidth>
|
|
155
|
+
* );
|
|
156
|
+
* }
|
|
157
|
+
* ```
|
|
158
|
+
*/
|
|
159
|
+
declare function WidthProvider<P extends {
|
|
160
|
+
width: number;
|
|
161
|
+
}>(ComposedComponent: ComponentType<P>): ComponentType<WithWidthProps<P>>;
|
|
162
|
+
|
|
163
|
+
export { Breakpoint, Breakpoints, CompactType, Layout, LayoutItem, type LegacyReactGridLayoutProps, type LegacyResponsiveReactGridLayoutProps, ReactGridLayout, ResizeHandleAxis, ResponsiveReactGridLayout as Responsive, ResponsiveLayouts, ResponsiveReactGridLayout, WidthProvider, ReactGridLayout as default };
|
package/dist/legacy.d.ts
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React__default, { ComponentType } from 'react';
|
|
3
|
+
import { a as GridLayoutProps, b as ResponsiveGridLayoutProps } from './ResponsiveGridLayout-B_6TXsWM.js';
|
|
4
|
+
import { L as Layout, d as LayoutItem, C as CompactType, R as ResizeHandleAxis, B as Breakpoint, a as Breakpoints, e as ResponsiveLayouts } from './types-Dbg8jAWj.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Legacy props interface for backwards compatibility with v1 API.
|
|
8
|
+
* These flat props are converted to composable interfaces internally.
|
|
9
|
+
*/
|
|
10
|
+
interface LegacyReactGridLayoutProps {
|
|
11
|
+
children: React__default.ReactNode;
|
|
12
|
+
width: number;
|
|
13
|
+
cols?: number;
|
|
14
|
+
rowHeight?: number;
|
|
15
|
+
maxRows?: number;
|
|
16
|
+
margin?: readonly [number, number];
|
|
17
|
+
containerPadding?: readonly [number, number] | null;
|
|
18
|
+
layout?: Layout;
|
|
19
|
+
droppingItem?: LayoutItem;
|
|
20
|
+
compactType?: CompactType;
|
|
21
|
+
preventCollision?: boolean;
|
|
22
|
+
allowOverlap?: boolean;
|
|
23
|
+
/** @deprecated Use compactType instead */
|
|
24
|
+
verticalCompact?: boolean;
|
|
25
|
+
isDraggable?: boolean;
|
|
26
|
+
isBounded?: boolean;
|
|
27
|
+
draggableHandle?: string;
|
|
28
|
+
draggableCancel?: string;
|
|
29
|
+
isResizable?: boolean;
|
|
30
|
+
resizeHandles?: ResizeHandleAxis[];
|
|
31
|
+
resizeHandle?: React__default.ReactElement | ((axis: ResizeHandleAxis, ref: React__default.Ref<HTMLElement>) => React__default.ReactElement);
|
|
32
|
+
isDroppable?: boolean;
|
|
33
|
+
useCSSTransforms?: boolean;
|
|
34
|
+
transformScale?: number;
|
|
35
|
+
autoSize?: boolean;
|
|
36
|
+
className?: string;
|
|
37
|
+
style?: React__default.CSSProperties;
|
|
38
|
+
innerRef?: React__default.Ref<HTMLDivElement>;
|
|
39
|
+
onLayoutChange?: (layout: Layout) => void;
|
|
40
|
+
onDragStart?: GridLayoutProps["onDragStart"];
|
|
41
|
+
onDrag?: GridLayoutProps["onDrag"];
|
|
42
|
+
onDragStop?: GridLayoutProps["onDragStop"];
|
|
43
|
+
onResizeStart?: GridLayoutProps["onResizeStart"];
|
|
44
|
+
onResize?: GridLayoutProps["onResize"];
|
|
45
|
+
onResizeStop?: GridLayoutProps["onResizeStop"];
|
|
46
|
+
onDrop?: (layout: Layout, item: LayoutItem | undefined, e: Event) => void;
|
|
47
|
+
onDropDragOver?: (e: React__default.DragEvent) => {
|
|
48
|
+
w?: number;
|
|
49
|
+
h?: number;
|
|
50
|
+
} | false | void;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* ReactGridLayout - Legacy wrapper component
|
|
54
|
+
*
|
|
55
|
+
* Converts v1 flat props to v2 composable interfaces for backwards compatibility.
|
|
56
|
+
*/
|
|
57
|
+
declare function ReactGridLayout(props: LegacyReactGridLayoutProps): react_jsx_runtime.JSX.Element;
|
|
58
|
+
declare namespace ReactGridLayout {
|
|
59
|
+
var displayName: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Legacy props interface for backwards compatibility with v1 API.
|
|
64
|
+
* These flat props are converted to composable interfaces internally.
|
|
65
|
+
*/
|
|
66
|
+
interface LegacyResponsiveReactGridLayoutProps<B extends Breakpoint = string> {
|
|
67
|
+
children: React__default.ReactNode;
|
|
68
|
+
width: number;
|
|
69
|
+
breakpoint?: B;
|
|
70
|
+
breakpoints?: Breakpoints<B>;
|
|
71
|
+
cols?: Breakpoints<B>;
|
|
72
|
+
layouts?: ResponsiveLayouts<B>;
|
|
73
|
+
onBreakpointChange?: (newBreakpoint: B, cols: number) => void;
|
|
74
|
+
onLayoutChange?: (layout: Layout, layouts: ResponsiveLayouts<B>) => void;
|
|
75
|
+
onWidthChange?: (containerWidth: number, margin: readonly [number, number], cols: number, containerPadding: readonly [number, number] | null) => void;
|
|
76
|
+
rowHeight?: number;
|
|
77
|
+
maxRows?: number;
|
|
78
|
+
margin?: readonly [number, number] | Partial<Record<B, readonly [number, number]>>;
|
|
79
|
+
containerPadding?: readonly [number, number] | Partial<Record<B, readonly [number, number] | null>> | null;
|
|
80
|
+
droppingItem?: LayoutItem;
|
|
81
|
+
compactType?: CompactType;
|
|
82
|
+
preventCollision?: boolean;
|
|
83
|
+
allowOverlap?: boolean;
|
|
84
|
+
/** @deprecated Use compactType instead */
|
|
85
|
+
verticalCompact?: boolean;
|
|
86
|
+
isDraggable?: boolean;
|
|
87
|
+
isBounded?: boolean;
|
|
88
|
+
draggableHandle?: string;
|
|
89
|
+
draggableCancel?: string;
|
|
90
|
+
isResizable?: boolean;
|
|
91
|
+
resizeHandles?: ResizeHandleAxis[];
|
|
92
|
+
resizeHandle?: React__default.ReactElement | ((axis: ResizeHandleAxis, ref: React__default.Ref<HTMLElement>) => React__default.ReactElement);
|
|
93
|
+
isDroppable?: boolean;
|
|
94
|
+
useCSSTransforms?: boolean;
|
|
95
|
+
transformScale?: number;
|
|
96
|
+
autoSize?: boolean;
|
|
97
|
+
className?: string;
|
|
98
|
+
style?: React__default.CSSProperties;
|
|
99
|
+
innerRef?: React__default.Ref<HTMLDivElement>;
|
|
100
|
+
onDragStart?: ResponsiveGridLayoutProps<B>["onDragStart"];
|
|
101
|
+
onDrag?: ResponsiveGridLayoutProps<B>["onDrag"];
|
|
102
|
+
onDragStop?: ResponsiveGridLayoutProps<B>["onDragStop"];
|
|
103
|
+
onResizeStart?: ResponsiveGridLayoutProps<B>["onResizeStart"];
|
|
104
|
+
onResize?: ResponsiveGridLayoutProps<B>["onResize"];
|
|
105
|
+
onResizeStop?: ResponsiveGridLayoutProps<B>["onResizeStop"];
|
|
106
|
+
onDrop?: (layout: Layout, item: LayoutItem | undefined, e: Event) => void;
|
|
107
|
+
onDropDragOver?: (e: React__default.DragEvent) => {
|
|
108
|
+
w?: number;
|
|
109
|
+
h?: number;
|
|
110
|
+
} | false | void;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* ResponsiveReactGridLayout - Legacy wrapper component
|
|
114
|
+
*
|
|
115
|
+
* Converts v1 flat props to v2 composable interfaces for backwards compatibility.
|
|
116
|
+
*/
|
|
117
|
+
declare function ResponsiveReactGridLayout<B extends Breakpoint = string>(props: LegacyResponsiveReactGridLayoutProps<B>): react_jsx_runtime.JSX.Element;
|
|
118
|
+
declare namespace ResponsiveReactGridLayout {
|
|
119
|
+
var displayName: string;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* WidthProvider HOC
|
|
124
|
+
*
|
|
125
|
+
* A Higher-Order Component that provides width measurement to grid layouts.
|
|
126
|
+
* This wraps any component and provides the container width as a prop.
|
|
127
|
+
*/
|
|
128
|
+
|
|
129
|
+
interface WidthProviderProps {
|
|
130
|
+
/** If true, will not render children until mounted */
|
|
131
|
+
measureBeforeMount?: boolean;
|
|
132
|
+
/** Additional class name */
|
|
133
|
+
className?: string;
|
|
134
|
+
/** Additional styles */
|
|
135
|
+
style?: React__default.CSSProperties;
|
|
136
|
+
}
|
|
137
|
+
type WithWidthProps<P> = Omit<P, "width"> & WidthProviderProps;
|
|
138
|
+
/**
|
|
139
|
+
* WidthProvider - HOC that provides container width
|
|
140
|
+
*
|
|
141
|
+
* A simple HOC that provides facility for listening to container resizes.
|
|
142
|
+
* Wraps the provided component and passes down a `width` prop.
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* ```tsx
|
|
146
|
+
* import { GridLayout, WidthProvider } from 'react-grid-layout';
|
|
147
|
+
*
|
|
148
|
+
* const GridLayoutWithWidth = WidthProvider(GridLayout);
|
|
149
|
+
*
|
|
150
|
+
* function MyGrid() {
|
|
151
|
+
* return (
|
|
152
|
+
* <GridLayoutWithWidth cols={12} rowHeight={30}>
|
|
153
|
+
* <div key="a">a</div>
|
|
154
|
+
* </GridLayoutWithWidth>
|
|
155
|
+
* );
|
|
156
|
+
* }
|
|
157
|
+
* ```
|
|
158
|
+
*/
|
|
159
|
+
declare function WidthProvider<P extends {
|
|
160
|
+
width: number;
|
|
161
|
+
}>(ComposedComponent: ComponentType<P>): ComponentType<WithWidthProps<P>>;
|
|
162
|
+
|
|
163
|
+
export { Breakpoint, Breakpoints, CompactType, Layout, LayoutItem, type LegacyReactGridLayoutProps, type LegacyResponsiveReactGridLayoutProps, ReactGridLayout, ResizeHandleAxis, ResponsiveReactGridLayout as Responsive, ResponsiveLayouts, ResponsiveReactGridLayout, WidthProvider, ReactGridLayout as default };
|
package/dist/legacy.js
ADDED
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var chunkSTBCV65G_js = require('./chunk-STBCV65G.js');
|
|
6
|
+
var chunkLQOPWRJR_js = require('./chunk-LQOPWRJR.js');
|
|
7
|
+
require('./chunk-J4LTYI7L.js');
|
|
8
|
+
var react = require('react');
|
|
9
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
10
|
+
var clsx = require('clsx');
|
|
11
|
+
|
|
12
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
|
|
14
|
+
var clsx__default = /*#__PURE__*/_interopDefault(clsx);
|
|
15
|
+
|
|
16
|
+
function ReactGridLayout(props) {
|
|
17
|
+
const {
|
|
18
|
+
// Required
|
|
19
|
+
children,
|
|
20
|
+
width,
|
|
21
|
+
// Grid measurement
|
|
22
|
+
cols = 12,
|
|
23
|
+
rowHeight = 150,
|
|
24
|
+
maxRows = Infinity,
|
|
25
|
+
margin = [10, 10],
|
|
26
|
+
containerPadding = null,
|
|
27
|
+
// Layout data
|
|
28
|
+
layout,
|
|
29
|
+
droppingItem,
|
|
30
|
+
// Compaction
|
|
31
|
+
compactType: compactTypeProp,
|
|
32
|
+
preventCollision = false,
|
|
33
|
+
allowOverlap = false,
|
|
34
|
+
verticalCompact,
|
|
35
|
+
// Drag behavior
|
|
36
|
+
isDraggable = true,
|
|
37
|
+
isBounded = false,
|
|
38
|
+
draggableHandle,
|
|
39
|
+
draggableCancel,
|
|
40
|
+
// Resize behavior
|
|
41
|
+
isResizable = true,
|
|
42
|
+
resizeHandles = ["se"],
|
|
43
|
+
resizeHandle,
|
|
44
|
+
// Drop behavior
|
|
45
|
+
isDroppable = false,
|
|
46
|
+
// Position
|
|
47
|
+
useCSSTransforms = true,
|
|
48
|
+
transformScale = 1,
|
|
49
|
+
// Container props
|
|
50
|
+
autoSize,
|
|
51
|
+
className,
|
|
52
|
+
style,
|
|
53
|
+
innerRef,
|
|
54
|
+
// Callbacks
|
|
55
|
+
onLayoutChange,
|
|
56
|
+
onDragStart,
|
|
57
|
+
onDrag,
|
|
58
|
+
onDragStop,
|
|
59
|
+
onResizeStart,
|
|
60
|
+
onResize,
|
|
61
|
+
onResizeStop,
|
|
62
|
+
onDrop,
|
|
63
|
+
onDropDragOver
|
|
64
|
+
} = props;
|
|
65
|
+
let compactType = compactTypeProp === void 0 ? "vertical" : compactTypeProp;
|
|
66
|
+
if (verticalCompact === false) {
|
|
67
|
+
if (process.env["NODE_ENV"] !== "production") {
|
|
68
|
+
console.warn(
|
|
69
|
+
'`verticalCompact` on <ReactGridLayout> is deprecated and will be removed soon. Use `compactType`: "horizontal" | "vertical" | null.'
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
compactType = null;
|
|
73
|
+
}
|
|
74
|
+
const gridConfig = {
|
|
75
|
+
cols,
|
|
76
|
+
rowHeight,
|
|
77
|
+
maxRows,
|
|
78
|
+
margin,
|
|
79
|
+
containerPadding
|
|
80
|
+
};
|
|
81
|
+
const dragConfig = {
|
|
82
|
+
enabled: isDraggable,
|
|
83
|
+
bounded: isBounded,
|
|
84
|
+
handle: draggableHandle,
|
|
85
|
+
cancel: draggableCancel,
|
|
86
|
+
// Set threshold to 0 for backwards compatibility with v1 API
|
|
87
|
+
// v2 API defaults to 3px threshold (fixes #1341, #1401)
|
|
88
|
+
threshold: 0
|
|
89
|
+
};
|
|
90
|
+
const resizeConfig = {
|
|
91
|
+
enabled: isResizable,
|
|
92
|
+
handles: resizeHandles,
|
|
93
|
+
handleComponent: resizeHandle
|
|
94
|
+
};
|
|
95
|
+
const dropConfig = {
|
|
96
|
+
enabled: isDroppable
|
|
97
|
+
};
|
|
98
|
+
let positionStrategy;
|
|
99
|
+
if (!useCSSTransforms) {
|
|
100
|
+
positionStrategy = chunkLQOPWRJR_js.absoluteStrategy;
|
|
101
|
+
} else if (transformScale !== 1) {
|
|
102
|
+
positionStrategy = chunkLQOPWRJR_js.createScaledStrategy(transformScale);
|
|
103
|
+
} else {
|
|
104
|
+
positionStrategy = chunkLQOPWRJR_js.transformStrategy;
|
|
105
|
+
}
|
|
106
|
+
const compactor = chunkLQOPWRJR_js.getCompactor(compactType, allowOverlap, preventCollision);
|
|
107
|
+
const constraints = isBounded ? [...chunkLQOPWRJR_js.defaultConstraints, chunkLQOPWRJR_js.containerBounds] : chunkLQOPWRJR_js.defaultConstraints;
|
|
108
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
109
|
+
chunkSTBCV65G_js.GridLayout,
|
|
110
|
+
{
|
|
111
|
+
width,
|
|
112
|
+
gridConfig,
|
|
113
|
+
dragConfig,
|
|
114
|
+
resizeConfig,
|
|
115
|
+
dropConfig,
|
|
116
|
+
positionStrategy,
|
|
117
|
+
compactor,
|
|
118
|
+
constraints,
|
|
119
|
+
layout,
|
|
120
|
+
droppingItem,
|
|
121
|
+
autoSize,
|
|
122
|
+
className,
|
|
123
|
+
style,
|
|
124
|
+
innerRef,
|
|
125
|
+
onLayoutChange,
|
|
126
|
+
onDragStart,
|
|
127
|
+
onDrag,
|
|
128
|
+
onDragStop,
|
|
129
|
+
onResizeStart,
|
|
130
|
+
onResize,
|
|
131
|
+
onResizeStop,
|
|
132
|
+
onDrop,
|
|
133
|
+
onDropDragOver,
|
|
134
|
+
children
|
|
135
|
+
}
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
ReactGridLayout.displayName = "ReactGridLayout";
|
|
139
|
+
var ReactGridLayout_default = ReactGridLayout;
|
|
140
|
+
function ResponsiveReactGridLayout(props) {
|
|
141
|
+
const {
|
|
142
|
+
// Required
|
|
143
|
+
children,
|
|
144
|
+
width,
|
|
145
|
+
// Responsive-specific
|
|
146
|
+
breakpoint,
|
|
147
|
+
breakpoints,
|
|
148
|
+
cols,
|
|
149
|
+
layouts,
|
|
150
|
+
onBreakpointChange,
|
|
151
|
+
onLayoutChange,
|
|
152
|
+
onWidthChange,
|
|
153
|
+
// Grid measurement
|
|
154
|
+
rowHeight,
|
|
155
|
+
maxRows,
|
|
156
|
+
margin,
|
|
157
|
+
containerPadding,
|
|
158
|
+
// Layout data
|
|
159
|
+
droppingItem,
|
|
160
|
+
// Compaction
|
|
161
|
+
compactType: compactTypeProp,
|
|
162
|
+
preventCollision = false,
|
|
163
|
+
allowOverlap = false,
|
|
164
|
+
verticalCompact,
|
|
165
|
+
// Drag behavior
|
|
166
|
+
isDraggable = true,
|
|
167
|
+
isBounded = false,
|
|
168
|
+
draggableHandle,
|
|
169
|
+
draggableCancel,
|
|
170
|
+
// Resize behavior
|
|
171
|
+
isResizable = true,
|
|
172
|
+
resizeHandles = ["se"],
|
|
173
|
+
resizeHandle,
|
|
174
|
+
// Drop behavior
|
|
175
|
+
isDroppable = false,
|
|
176
|
+
// Position
|
|
177
|
+
useCSSTransforms = true,
|
|
178
|
+
transformScale = 1,
|
|
179
|
+
// Container props
|
|
180
|
+
autoSize,
|
|
181
|
+
className,
|
|
182
|
+
style,
|
|
183
|
+
innerRef,
|
|
184
|
+
// Callbacks
|
|
185
|
+
onDragStart,
|
|
186
|
+
onDrag,
|
|
187
|
+
onDragStop,
|
|
188
|
+
onResizeStart,
|
|
189
|
+
onResize,
|
|
190
|
+
onResizeStop,
|
|
191
|
+
onDrop,
|
|
192
|
+
onDropDragOver
|
|
193
|
+
} = props;
|
|
194
|
+
let compactType = compactTypeProp === void 0 ? "vertical" : compactTypeProp;
|
|
195
|
+
if (verticalCompact === false) {
|
|
196
|
+
if (process.env["NODE_ENV"] !== "production") {
|
|
197
|
+
console.warn(
|
|
198
|
+
'`verticalCompact` on <ResponsiveReactGridLayout> is deprecated and will be removed soon. Use `compactType`: "horizontal" | "vertical" | null.'
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
compactType = null;
|
|
202
|
+
}
|
|
203
|
+
const dragConfig = {
|
|
204
|
+
enabled: isDraggable,
|
|
205
|
+
bounded: isBounded,
|
|
206
|
+
handle: draggableHandle,
|
|
207
|
+
cancel: draggableCancel
|
|
208
|
+
};
|
|
209
|
+
const resizeConfig = {
|
|
210
|
+
enabled: isResizable,
|
|
211
|
+
handles: resizeHandles,
|
|
212
|
+
handleComponent: resizeHandle
|
|
213
|
+
};
|
|
214
|
+
const dropConfig = {
|
|
215
|
+
enabled: isDroppable
|
|
216
|
+
};
|
|
217
|
+
let positionStrategy;
|
|
218
|
+
if (!useCSSTransforms) {
|
|
219
|
+
positionStrategy = chunkLQOPWRJR_js.absoluteStrategy;
|
|
220
|
+
} else if (transformScale !== 1) {
|
|
221
|
+
positionStrategy = chunkLQOPWRJR_js.createScaledStrategy(transformScale);
|
|
222
|
+
} else {
|
|
223
|
+
positionStrategy = chunkLQOPWRJR_js.transformStrategy;
|
|
224
|
+
}
|
|
225
|
+
const compactor = chunkLQOPWRJR_js.getCompactor(compactType, allowOverlap, preventCollision);
|
|
226
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
227
|
+
chunkSTBCV65G_js.ResponsiveGridLayout,
|
|
228
|
+
{
|
|
229
|
+
width,
|
|
230
|
+
breakpoint,
|
|
231
|
+
breakpoints,
|
|
232
|
+
cols,
|
|
233
|
+
layouts,
|
|
234
|
+
rowHeight,
|
|
235
|
+
maxRows,
|
|
236
|
+
margin,
|
|
237
|
+
containerPadding,
|
|
238
|
+
compactor,
|
|
239
|
+
dragConfig,
|
|
240
|
+
resizeConfig,
|
|
241
|
+
dropConfig,
|
|
242
|
+
positionStrategy,
|
|
243
|
+
droppingItem,
|
|
244
|
+
autoSize,
|
|
245
|
+
className,
|
|
246
|
+
style,
|
|
247
|
+
innerRef,
|
|
248
|
+
onBreakpointChange,
|
|
249
|
+
onLayoutChange,
|
|
250
|
+
onWidthChange,
|
|
251
|
+
onDragStart,
|
|
252
|
+
onDrag,
|
|
253
|
+
onDragStop,
|
|
254
|
+
onResizeStart,
|
|
255
|
+
onResize,
|
|
256
|
+
onResizeStop,
|
|
257
|
+
onDrop,
|
|
258
|
+
onDropDragOver,
|
|
259
|
+
children
|
|
260
|
+
}
|
|
261
|
+
);
|
|
262
|
+
}
|
|
263
|
+
ResponsiveReactGridLayout.displayName = "ResponsiveReactGridLayout";
|
|
264
|
+
var ResponsiveReactGridLayout_default = ResponsiveReactGridLayout;
|
|
265
|
+
var layoutClassName = "react-grid-layout";
|
|
266
|
+
function WidthProvider(ComposedComponent) {
|
|
267
|
+
function WidthProviderWrapper(props) {
|
|
268
|
+
const { measureBeforeMount = false, className, style, ...rest } = props;
|
|
269
|
+
const [width, setWidth] = react.useState(1280);
|
|
270
|
+
const [mounted, setMounted] = react.useState(false);
|
|
271
|
+
const elementRef = react.useRef(null);
|
|
272
|
+
const resizeObserverRef = react.useRef(null);
|
|
273
|
+
react.useEffect(() => {
|
|
274
|
+
setMounted(true);
|
|
275
|
+
}, []);
|
|
276
|
+
react.useEffect(() => {
|
|
277
|
+
const node = elementRef.current;
|
|
278
|
+
if (!(node instanceof HTMLElement)) return;
|
|
279
|
+
let rafId = null;
|
|
280
|
+
const observer = new ResizeObserver((entries) => {
|
|
281
|
+
if (entries[0]) {
|
|
282
|
+
const newWidth = entries[0].contentRect.width;
|
|
283
|
+
if (rafId !== null) {
|
|
284
|
+
cancelAnimationFrame(rafId);
|
|
285
|
+
}
|
|
286
|
+
rafId = requestAnimationFrame(() => {
|
|
287
|
+
setWidth(newWidth);
|
|
288
|
+
rafId = null;
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
observer.observe(node);
|
|
293
|
+
resizeObserverRef.current = observer;
|
|
294
|
+
return () => {
|
|
295
|
+
if (rafId !== null) {
|
|
296
|
+
cancelAnimationFrame(rafId);
|
|
297
|
+
}
|
|
298
|
+
observer.unobserve(node);
|
|
299
|
+
observer.disconnect();
|
|
300
|
+
};
|
|
301
|
+
}, [mounted]);
|
|
302
|
+
if (measureBeforeMount && !mounted) {
|
|
303
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
304
|
+
"div",
|
|
305
|
+
{
|
|
306
|
+
className: clsx__default.default(className, layoutClassName),
|
|
307
|
+
style,
|
|
308
|
+
ref: elementRef
|
|
309
|
+
}
|
|
310
|
+
);
|
|
311
|
+
}
|
|
312
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
313
|
+
ComposedComponent,
|
|
314
|
+
{
|
|
315
|
+
innerRef: elementRef,
|
|
316
|
+
className,
|
|
317
|
+
style,
|
|
318
|
+
...rest,
|
|
319
|
+
width
|
|
320
|
+
}
|
|
321
|
+
);
|
|
322
|
+
}
|
|
323
|
+
WidthProviderWrapper.displayName = `WidthProvider(${ComposedComponent.displayName || ComposedComponent.name || "Component"})`;
|
|
324
|
+
return WidthProviderWrapper;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
exports.ReactGridLayout = ReactGridLayout;
|
|
328
|
+
exports.Responsive = ResponsiveReactGridLayout_default;
|
|
329
|
+
exports.ResponsiveReactGridLayout = ResponsiveReactGridLayout;
|
|
330
|
+
exports.WidthProvider = WidthProvider;
|
|
331
|
+
exports.default = ReactGridLayout_default;
|