@depup/react-resizable-panels 4.7.3-depup.0
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.md +21 -0
- package/README.md +25 -0
- package/changes.json +5 -0
- package/dist/react-resizable-panels.cjs +2 -0
- package/dist/react-resizable-panels.cjs.map +1 -0
- package/dist/react-resizable-panels.d.ts +477 -0
- package/dist/react-resizable-panels.js +2104 -0
- package/dist/react-resizable-panels.js.map +1 -0
- package/package.json +141 -0
|
@@ -0,0 +1,477 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { Dispatch } from 'react';
|
|
3
|
+
import { HTMLAttributes } from 'react';
|
|
4
|
+
import { JSX } from 'react/jsx-runtime';
|
|
5
|
+
import { ReactNode } from 'react';
|
|
6
|
+
import { Ref } from 'react';
|
|
7
|
+
import { RefObject } from 'react';
|
|
8
|
+
import { SetStateAction } from 'react';
|
|
9
|
+
|
|
10
|
+
declare type BasePanelAttributes = Omit<HTMLAttributes<HTMLDivElement>, "onResize">;
|
|
11
|
+
|
|
12
|
+
declare type BaseSeparatorAttributes = Omit<HTMLAttributes<HTMLDivElement>, "role" | "tabIndex">;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* A Group wraps a set of resizable Panel components.
|
|
16
|
+
* Group content can be resized _horizontally_ or _vertically_.
|
|
17
|
+
*
|
|
18
|
+
* Group elements always include the following attributes:
|
|
19
|
+
*
|
|
20
|
+
* ```html
|
|
21
|
+
* <div data-group data-testid="group-id-prop" id="group-id-prop">
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* ℹ️ [Test id](https://testing-library.com/docs/queries/bytestid/) can be used to narrow selection when unit testing.
|
|
25
|
+
*/
|
|
26
|
+
export declare function Group({ children, className, defaultLayout, disableCursor, disabled, elementRef: elementRefProp, groupRef, id: idProp, onLayoutChange: onLayoutChangeUnstable, onLayoutChanged: onLayoutChangedUnstable, orientation, resizeTargetMinimumSize, style, ...rest }: GroupProps): JSX.Element;
|
|
27
|
+
|
|
28
|
+
export declare namespace Group {
|
|
29
|
+
var displayName: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Imperative Group API.
|
|
34
|
+
*
|
|
35
|
+
* ℹ️ The `useGroupRef` and `useGroupCallbackRef` hooks are exported for convenience use in TypeScript projects.
|
|
36
|
+
*/
|
|
37
|
+
export declare interface GroupImperativeHandle {
|
|
38
|
+
/**
|
|
39
|
+
* Get the Group's current layout as a map of Panel id to percentage (0..100)
|
|
40
|
+
*
|
|
41
|
+
* @return Map of Panel id to percentages (specified as numbers ranging between 0..100)
|
|
42
|
+
*/
|
|
43
|
+
getLayout: () => {
|
|
44
|
+
[panelId: string]: number;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Set a new layout for the Group
|
|
48
|
+
*
|
|
49
|
+
* @param layout Map of Panel id to percentage (a number between 0..100)
|
|
50
|
+
* @return Applied layout (after validation)
|
|
51
|
+
*/
|
|
52
|
+
setLayout: (layout: {
|
|
53
|
+
[panelId: string]: number;
|
|
54
|
+
}) => Layout;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export declare type GroupProps = HTMLAttributes<HTMLDivElement> & {
|
|
58
|
+
/**
|
|
59
|
+
* Panel and Separator components that comprise this group.
|
|
60
|
+
*/
|
|
61
|
+
children?: ReactNode | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* CSS class name.
|
|
64
|
+
*/
|
|
65
|
+
className?: string | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Default layout for the Group.
|
|
68
|
+
*
|
|
69
|
+
* ℹ️ This value allows layouts to be remembered between page reloads.
|
|
70
|
+
*
|
|
71
|
+
* ⚠️ Refer to the documentation for how to avoid layout shift when using server components.
|
|
72
|
+
*/
|
|
73
|
+
defaultLayout?: Layout | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* This library sets custom mouse cursor styles to indicate drag state.
|
|
76
|
+
* Use this prop to disable that behavior for Panels and Separators in this group.
|
|
77
|
+
*/
|
|
78
|
+
disableCursor?: boolean | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* Disable resize functionality.
|
|
81
|
+
*/
|
|
82
|
+
disabled?: boolean | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* Ref attached to the root `HTMLDivElement`.
|
|
85
|
+
*/
|
|
86
|
+
elementRef?: Ref<HTMLDivElement | null> | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* Exposes the following imperative API:
|
|
89
|
+
* - `getLayout(): Layout`
|
|
90
|
+
* - `setLayout(layout: Layout): void`
|
|
91
|
+
*
|
|
92
|
+
* ℹ️ The `useGroupRef` and `useGroupCallbackRef` hooks are exported for convenience use in TypeScript projects.
|
|
93
|
+
*/
|
|
94
|
+
groupRef?: Ref<GroupImperativeHandle | null> | undefined;
|
|
95
|
+
/**
|
|
96
|
+
* Uniquely identifies this group within an application.
|
|
97
|
+
* Falls back to `useId` when not provided.
|
|
98
|
+
*
|
|
99
|
+
* ℹ️ This value will also be assigned to the `data-group` attribute.
|
|
100
|
+
*/
|
|
101
|
+
id?: string | number | undefined;
|
|
102
|
+
/**
|
|
103
|
+
* Called when the Group's layout is changing.
|
|
104
|
+
*
|
|
105
|
+
* ⚠️ For layout changes caused by pointer events, this method is called each time the pointer is moved.
|
|
106
|
+
* For most cases, it is recommended to use the `onLayoutChanged` callback instead.
|
|
107
|
+
*/
|
|
108
|
+
onLayoutChange?: (layout: Layout) => void | undefined;
|
|
109
|
+
/**
|
|
110
|
+
* Called after the Group's layout has been changed.
|
|
111
|
+
*
|
|
112
|
+
* ℹ️ For layout changes caused by pointer events, this method is not called until the pointer has been released.
|
|
113
|
+
* This method is recommended when saving layouts to some storage api.
|
|
114
|
+
*/
|
|
115
|
+
onLayoutChanged?: (layout: Layout) => void | undefined;
|
|
116
|
+
/**
|
|
117
|
+
* Minimum size of the resizable hit target area (either `Separator` or `Panel` edge)
|
|
118
|
+
* This threshold ensures are large enough to avoid mis-clicks.
|
|
119
|
+
*
|
|
120
|
+
* - Coarse inputs (typically a finger on a touchscreen) have reduced accuracy;
|
|
121
|
+
* to ensure accessibility and ease of use, hit targets should be larger to prevent mis-clicks.
|
|
122
|
+
* - Fine inputs (typically a mouse) can be smaller
|
|
123
|
+
*
|
|
124
|
+
* ℹ️ [Apple interface guidelines](https://developer.apple.com/design/human-interface-guidelines/accessibility) suggest `20pt` (`27px`) on desktops and `28pt` (`37px`) for touch devices
|
|
125
|
+
* In practice this seems to be much larger than many of their own applications use though.
|
|
126
|
+
*/
|
|
127
|
+
resizeTargetMinimumSize?: {
|
|
128
|
+
coarse: number;
|
|
129
|
+
fine: number;
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* Specifies the resizable orientation ("horizontal" or "vertical"); defaults to "horizontal"
|
|
133
|
+
*/
|
|
134
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
135
|
+
/**
|
|
136
|
+
* CSS properties.
|
|
137
|
+
*
|
|
138
|
+
* ⚠️ The following styles cannot be overridden: `display`, `flex-direction`, `flex-wrap`, and `overflow`.
|
|
139
|
+
*/
|
|
140
|
+
style?: CSSProperties | undefined;
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Caches and returns matchMedia()'s computed value for "pointer:coarse"
|
|
145
|
+
*/
|
|
146
|
+
export declare function isCoarsePointer(): boolean;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Map of Panel id to flexGrow value;
|
|
150
|
+
*/
|
|
151
|
+
export declare type Layout = {
|
|
152
|
+
[id: string]: number;
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
export declare type LayoutStorage = Pick<Storage, "getItem" | "setItem">;
|
|
156
|
+
|
|
157
|
+
export declare type OnGroupLayoutChange = GroupProps["onLayoutChange"];
|
|
158
|
+
|
|
159
|
+
export declare type OnPanelResize = PanelProps["onResize"];
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Panel group orientation loosely relates to the `aria-orientation` attribute.
|
|
163
|
+
* It determines how panels are are laid out within the group group and the direction they can be resized in.
|
|
164
|
+
*/
|
|
165
|
+
export declare type Orientation = "horizontal" | "vertical";
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* A Panel wraps resizable content and can be configured with min/max size constraints and collapsible behavior.
|
|
169
|
+
*
|
|
170
|
+
* Panel size props can be in the following formats:
|
|
171
|
+
* - Percentage of the parent Group (0..100)
|
|
172
|
+
* - Pixels
|
|
173
|
+
* - Relative font units (em, rem)
|
|
174
|
+
* - Viewport relative units (vh, vw)
|
|
175
|
+
*
|
|
176
|
+
* ℹ️ Numeric values are assumed to be pixels.
|
|
177
|
+
* Strings without explicit units are assumed to be percentages (0%..100%).
|
|
178
|
+
* Percentages may also be specified as strings ending with "%" (e.g. "33%")
|
|
179
|
+
* Pixels may also be specified as strings ending with the unit "px".
|
|
180
|
+
* Other units should be specified as strings ending with their CSS property units (e.g. 1rem, 50vh)
|
|
181
|
+
*
|
|
182
|
+
* Panel elements always include the following attributes:
|
|
183
|
+
*
|
|
184
|
+
* ```html
|
|
185
|
+
* <div data-panel data-testid="panel-id-prop" id="panel-id-prop">
|
|
186
|
+
* ```
|
|
187
|
+
*
|
|
188
|
+
* ℹ️ [Test id](https://testing-library.com/docs/queries/bytestid/) can be used to narrow selection when unit testing.
|
|
189
|
+
*
|
|
190
|
+
* ⚠️ Panel elements must be direct DOM children of their parent Group elements.
|
|
191
|
+
*/
|
|
192
|
+
export declare function Panel({ children, className, collapsedSize, collapsible, defaultSize, disabled, elementRef: elementRefProp, groupResizeBehavior, id: idProp, maxSize, minSize, onResize: onResizeUnstable, panelRef, style, ...rest }: PanelProps): JSX.Element;
|
|
193
|
+
|
|
194
|
+
export declare namespace Panel {
|
|
195
|
+
var displayName: string;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Imperative Panel API
|
|
200
|
+
*
|
|
201
|
+
* ℹ️ The `usePanelRef` and `usePanelCallbackRef` hooks are exported for convenience use in TypeScript projects.
|
|
202
|
+
*/
|
|
203
|
+
export declare interface PanelImperativeHandle {
|
|
204
|
+
/**
|
|
205
|
+
* Collapse the Panel to it's `collapsedSize`.
|
|
206
|
+
*
|
|
207
|
+
* ⚠️ This method will do nothing if the Panel is not `collapsible` or if it is already collapsed.
|
|
208
|
+
*/
|
|
209
|
+
collapse: () => void;
|
|
210
|
+
/**
|
|
211
|
+
* Expand a collapsed Panel to its most recent size.
|
|
212
|
+
*
|
|
213
|
+
* ⚠️ This method will do nothing if the Panel is not currently collapsed.
|
|
214
|
+
*/
|
|
215
|
+
expand: () => void;
|
|
216
|
+
/**
|
|
217
|
+
* Get the current size of the Panel in pixels as well as a percentage of the parent group (0..100).
|
|
218
|
+
*
|
|
219
|
+
* @return Panel size (in pixels and as a percentage of the parent group)
|
|
220
|
+
*/
|
|
221
|
+
getSize: () => {
|
|
222
|
+
asPercentage: number;
|
|
223
|
+
inPixels: number;
|
|
224
|
+
};
|
|
225
|
+
/**
|
|
226
|
+
* The Panel is currently collapsed.
|
|
227
|
+
*/
|
|
228
|
+
isCollapsed: () => boolean;
|
|
229
|
+
/**
|
|
230
|
+
* Update the Panel's size.
|
|
231
|
+
*
|
|
232
|
+
* Size can be in the following formats:
|
|
233
|
+
* - Percentage of the parent Group (0..100)
|
|
234
|
+
* - Pixels
|
|
235
|
+
* - Relative font units (em, rem)
|
|
236
|
+
* - Viewport relative units (vh, vw)
|
|
237
|
+
*
|
|
238
|
+
* ℹ️ Numeric values are assumed to be pixels.
|
|
239
|
+
* Strings without explicit units are assumed to be percentages (0%..100%).
|
|
240
|
+
* Percentages may also be specified as strings ending with "%" (e.g. "33%")
|
|
241
|
+
* Pixels may also be specified as strings ending with the unit "px".
|
|
242
|
+
* Other units should be specified as strings ending with their CSS property units (e.g. 1rem, 50vh)
|
|
243
|
+
*
|
|
244
|
+
* @param size New panel size
|
|
245
|
+
* @return Applied size (after validation)
|
|
246
|
+
*/
|
|
247
|
+
resize: (size: number | string) => void;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export declare type PanelProps = BasePanelAttributes & {
|
|
251
|
+
/**
|
|
252
|
+
* CSS class name.
|
|
253
|
+
*
|
|
254
|
+
* ⚠️ Class is applied to nested `HTMLDivElement` to avoid styles that interfere with Flex layout.
|
|
255
|
+
*/
|
|
256
|
+
className?: string | undefined;
|
|
257
|
+
/**
|
|
258
|
+
* Panel size when collapsed; defaults to 0%.
|
|
259
|
+
*/
|
|
260
|
+
collapsedSize?: number | string | undefined;
|
|
261
|
+
/**
|
|
262
|
+
* This panel can be collapsed.
|
|
263
|
+
*
|
|
264
|
+
* ℹ️ A collapsible panel will collapse when it's size is less than of the specified `minSize`
|
|
265
|
+
*/
|
|
266
|
+
collapsible?: boolean | undefined;
|
|
267
|
+
/**
|
|
268
|
+
* Default size of Panel within its parent group; default is auto-assigned based on the total number of Panels.
|
|
269
|
+
*/
|
|
270
|
+
defaultSize?: number | string | undefined;
|
|
271
|
+
/**
|
|
272
|
+
* When disabled, a panel cannot be resized either directly or indirectly (by resizing another panel).
|
|
273
|
+
*/
|
|
274
|
+
disabled?: boolean | undefined;
|
|
275
|
+
/**
|
|
276
|
+
* Ref attached to the root `HTMLDivElement`.
|
|
277
|
+
*/
|
|
278
|
+
elementRef?: Ref<HTMLDivElement | null> | undefined;
|
|
279
|
+
/**
|
|
280
|
+
* How should this Panel behave if the parent Group is resized?
|
|
281
|
+
* Defaults to `preserve-relative-size`.
|
|
282
|
+
*
|
|
283
|
+
* - `preserve-relative-size`: Retain the current relative size (as a percentage of the Group)
|
|
284
|
+
* - `preserve-pixel-size`: Retain its current size (in pixels)
|
|
285
|
+
*
|
|
286
|
+
* ℹ️ Panel min/max size constraints may impact this behavior.
|
|
287
|
+
*
|
|
288
|
+
* ⚠️ A Group must contain at least one Panel with `preserve-relative-size` resize behavior.
|
|
289
|
+
*/
|
|
290
|
+
groupResizeBehavior?: "preserve-relative-size" | "preserve-pixel-size" | undefined;
|
|
291
|
+
/**
|
|
292
|
+
* Uniquely identifies this panel within the parent group.
|
|
293
|
+
* Falls back to `useId` when not provided.
|
|
294
|
+
*
|
|
295
|
+
* ℹ️ This prop is used to associate persisted group layouts with the original panel.
|
|
296
|
+
*
|
|
297
|
+
* ℹ️ This value will also be assigned to the `data-panel` attribute.
|
|
298
|
+
*/
|
|
299
|
+
id?: string | number | undefined;
|
|
300
|
+
/**
|
|
301
|
+
* Maximum size of Panel within its parent group; defaults to 100%.
|
|
302
|
+
*/
|
|
303
|
+
maxSize?: number | string | undefined;
|
|
304
|
+
/**
|
|
305
|
+
* Minimum size of Panel within its parent group; defaults to 0%.
|
|
306
|
+
*/
|
|
307
|
+
minSize?: number | string | undefined;
|
|
308
|
+
/**
|
|
309
|
+
* Called when panel sizes change.
|
|
310
|
+
*
|
|
311
|
+
* @param panelSize Panel size (both as a percentage of the parent Group and in pixels)
|
|
312
|
+
* @param id Panel id (if one was provided as a prop)
|
|
313
|
+
* @param prevPanelSize Previous panel size (will be undefined on mount)
|
|
314
|
+
*/
|
|
315
|
+
onResize?: ((panelSize: PanelSize, id: string | number | undefined, prevPanelSize: PanelSize | undefined) => void) | undefined;
|
|
316
|
+
/**
|
|
317
|
+
* Exposes the following imperative API:
|
|
318
|
+
* - `collapse(): void`
|
|
319
|
+
* - `expand(): void`
|
|
320
|
+
* - `getSize(): number`
|
|
321
|
+
* - `isCollapsed(): boolean`
|
|
322
|
+
* - `resize(size: number): void`
|
|
323
|
+
*
|
|
324
|
+
* ℹ️ The `usePanelRef` and `usePanelCallbackRef` hooks are exported for convenience use in TypeScript projects.
|
|
325
|
+
*/
|
|
326
|
+
panelRef?: Ref<PanelImperativeHandle | null> | undefined;
|
|
327
|
+
/**
|
|
328
|
+
* CSS properties.
|
|
329
|
+
*
|
|
330
|
+
* ⚠️ Style is applied to nested `HTMLDivElement` to avoid styles that interfere with Flex layout.
|
|
331
|
+
*/
|
|
332
|
+
style?: CSSProperties | undefined;
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
export declare type PanelSize = {
|
|
336
|
+
asPercentage: number;
|
|
337
|
+
inPixels: number;
|
|
338
|
+
};
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Separators are not _required_ but they are _recommended_ as they improve keyboard accessibility.
|
|
342
|
+
*
|
|
343
|
+
* ⚠️ Separator elements must be direct DOM children of their parent Group elements.
|
|
344
|
+
*
|
|
345
|
+
* Separator elements always include the following attributes:
|
|
346
|
+
*
|
|
347
|
+
* ```html
|
|
348
|
+
* <div data-separator data-testid="separator-id-prop" id="separator-id-prop" role="separator">
|
|
349
|
+
* ```
|
|
350
|
+
*
|
|
351
|
+
* ℹ️ [Test id](https://testing-library.com/docs/queries/bytestid/) can be used to narrow selection when unit testing.
|
|
352
|
+
*
|
|
353
|
+
* ℹ️ In addition to the attributes shown above, separator also renders all required [WAI-ARIA properties](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/separator_role#associated_wai-aria_roles_states_and_properties).
|
|
354
|
+
*/
|
|
355
|
+
export declare function Separator({ children, className, disabled, elementRef: elementRefProp, id: idProp, style, ...rest }: SeparatorProps): JSX.Element;
|
|
356
|
+
|
|
357
|
+
export declare namespace Separator {
|
|
358
|
+
var displayName: string;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
export declare type SeparatorProps = BaseSeparatorAttributes & {
|
|
362
|
+
/**
|
|
363
|
+
* CSS class name.
|
|
364
|
+
*
|
|
365
|
+
* ℹ️ Use the `data-separator` attribute for custom _hover_ and _active_ styles
|
|
366
|
+
*
|
|
367
|
+
* ⚠️ The following properties cannot be overridden: `flex-grow`, `flex-shrink`
|
|
368
|
+
*/
|
|
369
|
+
className?: string | undefined;
|
|
370
|
+
/**
|
|
371
|
+
* When disabled, the separator cannot be used to resize its neighboring panels.
|
|
372
|
+
*
|
|
373
|
+
* ℹ️ The panels may still be resized indirectly (while other panels are being resized).
|
|
374
|
+
* To prevent a panel from being resized at all, it needs to also be disabled.
|
|
375
|
+
*/
|
|
376
|
+
disabled?: boolean | undefined;
|
|
377
|
+
/**
|
|
378
|
+
* Ref attached to the root `HTMLDivElement`.
|
|
379
|
+
*/
|
|
380
|
+
elementRef?: Ref<HTMLDivElement> | undefined;
|
|
381
|
+
/**
|
|
382
|
+
* Uniquely identifies the separator within the parent group.
|
|
383
|
+
* Falls back to `useId` when not provided.
|
|
384
|
+
*
|
|
385
|
+
* ℹ️ This value will also be assigned to the `data-separator` attribute.
|
|
386
|
+
*/
|
|
387
|
+
id?: string | number | undefined;
|
|
388
|
+
/**
|
|
389
|
+
* CSS properties.
|
|
390
|
+
*
|
|
391
|
+
* ℹ️ Use the `data-separator` attribute for custom _hover_ and _active_ styles
|
|
392
|
+
*
|
|
393
|
+
* ⚠️ The following properties cannot be overridden: `flex-grow`, `flex-shrink`
|
|
394
|
+
*/
|
|
395
|
+
style?: CSSProperties | undefined;
|
|
396
|
+
};
|
|
397
|
+
|
|
398
|
+
export declare type SizeUnit = "px" | "%" | "em" | "rem" | "vh" | "vw";
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* Saves and restores group layouts between page loads.
|
|
402
|
+
* It can be configured to store values using `localStorage`, `sessionStorage`, cookies, or any other persistence layer that makes sense for your application.
|
|
403
|
+
*/
|
|
404
|
+
export declare function useDefaultLayout({ debounceSaveMs, panelIds, storage, ...rest }: {
|
|
405
|
+
/**
|
|
406
|
+
* Debounce save operation by the specified number of milliseconds; defaults to 100ms
|
|
407
|
+
*
|
|
408
|
+
* @deprecated Use the {@link onLayoutChanged} callback instead; it does not require debouncing
|
|
409
|
+
*/
|
|
410
|
+
debounceSaveMs?: number;
|
|
411
|
+
/**
|
|
412
|
+
* For Groups that contain conditionally-rendered Panels, this prop can be used to save and restore multiple layouts.
|
|
413
|
+
*
|
|
414
|
+
* ℹ️ This prevents layout shift for server-rendered apps.
|
|
415
|
+
*
|
|
416
|
+
* ⚠️ Panel ids must match the Panels rendered within the Group during mount or the initial layout will be incorrect.
|
|
417
|
+
*/
|
|
418
|
+
panelIds?: string[] | undefined;
|
|
419
|
+
/**
|
|
420
|
+
* Storage implementation; supports localStorage, sessionStorage, and custom implementations
|
|
421
|
+
* Refer to documentation site for example integrations.
|
|
422
|
+
*
|
|
423
|
+
*/
|
|
424
|
+
storage?: LayoutStorage;
|
|
425
|
+
} & ({
|
|
426
|
+
/**
|
|
427
|
+
* Group id; must be unique in order for layouts to be saved separately.
|
|
428
|
+
* @deprecated Use the {@link id} param instead
|
|
429
|
+
*/
|
|
430
|
+
groupId: string;
|
|
431
|
+
} | {
|
|
432
|
+
/**
|
|
433
|
+
* Uniquely identifies a specific group/layout.
|
|
434
|
+
*/
|
|
435
|
+
id: string;
|
|
436
|
+
})): {
|
|
437
|
+
/**
|
|
438
|
+
* Pass this value to `Group` as the `defaultLayout` prop.
|
|
439
|
+
*/
|
|
440
|
+
defaultLayout: Layout | undefined;
|
|
441
|
+
/**
|
|
442
|
+
* Attach this callback on the `Group` as the `onLayoutChange` prop.
|
|
443
|
+
*
|
|
444
|
+
* @deprecated Use the {@link onLayoutChanged} prop instead.
|
|
445
|
+
*/
|
|
446
|
+
onLayoutChange: (layout: Layout) => void | undefined;
|
|
447
|
+
/**
|
|
448
|
+
* Attach this callback on the `Group` as the `onLayoutChanged` prop.
|
|
449
|
+
*/
|
|
450
|
+
onLayoutChanged: (layout: Layout) => void | undefined;
|
|
451
|
+
};
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* Convenience hook to return a properly typed ref callback for the Group component.
|
|
455
|
+
*
|
|
456
|
+
* Use this hook when you need to share the ref with another component or hook.
|
|
457
|
+
*/
|
|
458
|
+
export declare function useGroupCallbackRef(): [GroupImperativeHandle | null, Dispatch<SetStateAction<GroupImperativeHandle | null>>];
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* Convenience hook to return a properly typed ref for the Group component.
|
|
462
|
+
*/
|
|
463
|
+
export declare function useGroupRef(): RefObject<GroupImperativeHandle | null>;
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* Convenience hook to return a properly typed ref callback for the Panel component.
|
|
467
|
+
*
|
|
468
|
+
* Use this hook when you need to share the ref with another component or hook.
|
|
469
|
+
*/
|
|
470
|
+
export declare function usePanelCallbackRef(): [PanelImperativeHandle | null, Dispatch<SetStateAction<PanelImperativeHandle | null>>];
|
|
471
|
+
|
|
472
|
+
/**
|
|
473
|
+
* Convenience hook to return a properly typed ref for the Panel component.
|
|
474
|
+
*/
|
|
475
|
+
export declare function usePanelRef(): RefObject<PanelImperativeHandle | null>;
|
|
476
|
+
|
|
477
|
+
export { }
|