@iamevan/react-resizable-panels 3.0.6 → 3.0.7
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/dist/declarations/src/Panel.d.ts +2 -1
- package/dist/declarations/src/PanelGroup.d.ts +1 -0
- package/dist/iamevan-react-resizable-panels.browser.development.js +4 -0
- package/dist/iamevan-react-resizable-panels.browser.js +4 -0
- package/dist/iamevan-react-resizable-panels.development.edge-light.js +4 -0
- package/dist/iamevan-react-resizable-panels.development.js +4 -0
- package/dist/iamevan-react-resizable-panels.edge-light.js +4 -0
- package/dist/iamevan-react-resizable-panels.js +4 -0
- package/package.json +1 -1
|
@@ -24,6 +24,7 @@ export type PanelData = {
|
|
|
24
24
|
export type ImperativePanelHandle = {
|
|
25
25
|
collapse: () => void;
|
|
26
26
|
expand: (minSize?: number) => void;
|
|
27
|
+
getElement: () => HTMLElement | null;
|
|
27
28
|
getId(): string;
|
|
28
29
|
getSize(): number;
|
|
29
30
|
isCollapsed: () => boolean;
|
|
@@ -51,7 +52,7 @@ export declare function PanelWithForwardedRef({ children, className: classNameFr
|
|
|
51
52
|
export declare namespace PanelWithForwardedRef {
|
|
52
53
|
var displayName: string;
|
|
53
54
|
}
|
|
54
|
-
export declare const Panel: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<
|
|
55
|
+
export declare const Panel: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLElement | HTMLObjectElement | HTMLAnchorElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLButtonElement | HTMLCanvasElement | HTMLTableCaptionElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDivElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLFormElement | HTMLHeadingElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLImageElement | HTMLInputElement | HTMLLabelElement | HTMLLegendElement | HTMLLIElement | HTMLLinkElement | HTMLMapElement | HTMLMenuElement | HTMLMetaElement | HTMLMeterElement | HTMLOListElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLParagraphElement | HTMLPictureElement | HTMLPreElement | HTMLProgressElement | HTMLScriptElement | HTMLSelectElement | HTMLSlotElement | HTMLSourceElement | HTMLSpanElement | HTMLStyleElement | HTMLTableElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTemplateElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLUListElement | HTMLVideoElement>, "id" | "onResize"> & {
|
|
55
56
|
className?: string;
|
|
56
57
|
collapsedSize?: number | undefined;
|
|
57
58
|
collapsible?: boolean | undefined;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CSSProperties, HTMLAttributes, PropsWithChildren } from "react";
|
|
2
2
|
import { Direction } from "./types.js";
|
|
3
3
|
export type ImperativePanelGroupHandle = {
|
|
4
|
+
getElement: () => HTMLElement | null;
|
|
4
5
|
getId: () => string;
|
|
5
6
|
getLayout: () => number[];
|
|
6
7
|
setLayout: (layout: number[]) => void;
|
|
@@ -71,6 +71,7 @@ function PanelWithForwardedRef({
|
|
|
71
71
|
unregisterPanel
|
|
72
72
|
} = context;
|
|
73
73
|
const panelId = useUniqueId(idFromProps);
|
|
74
|
+
const panelElementRef = useRef(null);
|
|
74
75
|
const panelDataRef = useRef({
|
|
75
76
|
callbacks: {
|
|
76
77
|
onCollapse,
|
|
@@ -137,6 +138,7 @@ function PanelWithForwardedRef({
|
|
|
137
138
|
expand: minSize => {
|
|
138
139
|
expandPanel(panelDataRef.current, minSize);
|
|
139
140
|
},
|
|
141
|
+
getElement: () => panelElementRef.current,
|
|
140
142
|
getId() {
|
|
141
143
|
return panelId;
|
|
142
144
|
},
|
|
@@ -159,6 +161,7 @@ function PanelWithForwardedRef({
|
|
|
159
161
|
children,
|
|
160
162
|
className: classNameFromProps,
|
|
161
163
|
id: panelId,
|
|
164
|
+
ref: panelElementRef,
|
|
162
165
|
style: {
|
|
163
166
|
...style,
|
|
164
167
|
...styleFromProps
|
|
@@ -1735,6 +1738,7 @@ function PanelGroupWithForwardedRef({
|
|
|
1735
1738
|
prevPanelIds: []
|
|
1736
1739
|
});
|
|
1737
1740
|
useImperativeHandle(forwardedRef, () => ({
|
|
1741
|
+
getElement: () => panelGroupElementRef.current,
|
|
1738
1742
|
getId: () => committedValuesRef.current.id,
|
|
1739
1743
|
getLayout: () => {
|
|
1740
1744
|
const {
|
|
@@ -71,6 +71,7 @@ function PanelWithForwardedRef({
|
|
|
71
71
|
unregisterPanel
|
|
72
72
|
} = context;
|
|
73
73
|
const panelId = useUniqueId(idFromProps);
|
|
74
|
+
const panelElementRef = useRef(null);
|
|
74
75
|
const panelDataRef = useRef({
|
|
75
76
|
callbacks: {
|
|
76
77
|
onCollapse,
|
|
@@ -131,6 +132,7 @@ function PanelWithForwardedRef({
|
|
|
131
132
|
expand: minSize => {
|
|
132
133
|
expandPanel(panelDataRef.current, minSize);
|
|
133
134
|
},
|
|
135
|
+
getElement: () => panelElementRef.current,
|
|
134
136
|
getId() {
|
|
135
137
|
return panelId;
|
|
136
138
|
},
|
|
@@ -153,6 +155,7 @@ function PanelWithForwardedRef({
|
|
|
153
155
|
children,
|
|
154
156
|
className: classNameFromProps,
|
|
155
157
|
id: panelId,
|
|
158
|
+
ref: panelElementRef,
|
|
156
159
|
style: {
|
|
157
160
|
...style,
|
|
158
161
|
...styleFromProps
|
|
@@ -1671,6 +1674,7 @@ function PanelGroupWithForwardedRef({
|
|
|
1671
1674
|
prevPanelIds: []
|
|
1672
1675
|
});
|
|
1673
1676
|
useImperativeHandle(forwardedRef, () => ({
|
|
1677
|
+
getElement: () => panelGroupElementRef.current,
|
|
1674
1678
|
getId: () => committedValuesRef.current.id,
|
|
1675
1679
|
getLayout: () => {
|
|
1676
1680
|
const {
|
|
@@ -69,6 +69,7 @@ function PanelWithForwardedRef({
|
|
|
69
69
|
unregisterPanel
|
|
70
70
|
} = context;
|
|
71
71
|
const panelId = useUniqueId(idFromProps);
|
|
72
|
+
const panelElementRef = useRef(null);
|
|
72
73
|
const panelDataRef = useRef({
|
|
73
74
|
callbacks: {
|
|
74
75
|
onCollapse,
|
|
@@ -107,6 +108,7 @@ function PanelWithForwardedRef({
|
|
|
107
108
|
expand: minSize => {
|
|
108
109
|
expandPanel(panelDataRef.current, minSize);
|
|
109
110
|
},
|
|
111
|
+
getElement: () => panelElementRef.current,
|
|
110
112
|
getId() {
|
|
111
113
|
return panelId;
|
|
112
114
|
},
|
|
@@ -129,6 +131,7 @@ function PanelWithForwardedRef({
|
|
|
129
131
|
children,
|
|
130
132
|
className: classNameFromProps,
|
|
131
133
|
id: panelId,
|
|
134
|
+
ref: panelElementRef,
|
|
132
135
|
style: {
|
|
133
136
|
...style,
|
|
134
137
|
...styleFromProps
|
|
@@ -1575,6 +1578,7 @@ function PanelGroupWithForwardedRef({
|
|
|
1575
1578
|
prevPanelIds: []
|
|
1576
1579
|
});
|
|
1577
1580
|
useImperativeHandle(forwardedRef, () => ({
|
|
1581
|
+
getElement: () => panelGroupElementRef.current,
|
|
1578
1582
|
getId: () => committedValuesRef.current.id,
|
|
1579
1583
|
getLayout: () => {
|
|
1580
1584
|
const {
|
|
@@ -73,6 +73,7 @@ function PanelWithForwardedRef({
|
|
|
73
73
|
unregisterPanel
|
|
74
74
|
} = context;
|
|
75
75
|
const panelId = useUniqueId(idFromProps);
|
|
76
|
+
const panelElementRef = useRef(null);
|
|
76
77
|
const panelDataRef = useRef({
|
|
77
78
|
callbacks: {
|
|
78
79
|
onCollapse,
|
|
@@ -144,6 +145,7 @@ function PanelWithForwardedRef({
|
|
|
144
145
|
expand: minSize => {
|
|
145
146
|
expandPanel(panelDataRef.current, minSize);
|
|
146
147
|
},
|
|
148
|
+
getElement: () => panelElementRef.current,
|
|
147
149
|
getId() {
|
|
148
150
|
return panelId;
|
|
149
151
|
},
|
|
@@ -166,6 +168,7 @@ function PanelWithForwardedRef({
|
|
|
166
168
|
children,
|
|
167
169
|
className: classNameFromProps,
|
|
168
170
|
id: panelId,
|
|
171
|
+
ref: panelElementRef,
|
|
169
172
|
style: {
|
|
170
173
|
...style,
|
|
171
174
|
...styleFromProps
|
|
@@ -1742,6 +1745,7 @@ function PanelGroupWithForwardedRef({
|
|
|
1742
1745
|
prevPanelIds: []
|
|
1743
1746
|
});
|
|
1744
1747
|
useImperativeHandle(forwardedRef, () => ({
|
|
1748
|
+
getElement: () => panelGroupElementRef.current,
|
|
1745
1749
|
getId: () => committedValuesRef.current.id,
|
|
1746
1750
|
getLayout: () => {
|
|
1747
1751
|
const {
|
|
@@ -69,6 +69,7 @@ function PanelWithForwardedRef({
|
|
|
69
69
|
unregisterPanel
|
|
70
70
|
} = context;
|
|
71
71
|
const panelId = useUniqueId(idFromProps);
|
|
72
|
+
const panelElementRef = useRef(null);
|
|
72
73
|
const panelDataRef = useRef({
|
|
73
74
|
callbacks: {
|
|
74
75
|
onCollapse,
|
|
@@ -96,6 +97,7 @@ function PanelWithForwardedRef({
|
|
|
96
97
|
expand: minSize => {
|
|
97
98
|
expandPanel(panelDataRef.current, minSize);
|
|
98
99
|
},
|
|
100
|
+
getElement: () => panelElementRef.current,
|
|
99
101
|
getId() {
|
|
100
102
|
return panelId;
|
|
101
103
|
},
|
|
@@ -118,6 +120,7 @@ function PanelWithForwardedRef({
|
|
|
118
120
|
children,
|
|
119
121
|
className: classNameFromProps,
|
|
120
122
|
id: panelId,
|
|
123
|
+
ref: panelElementRef,
|
|
121
124
|
style: {
|
|
122
125
|
...style,
|
|
123
126
|
...styleFromProps
|
|
@@ -1516,6 +1519,7 @@ function PanelGroupWithForwardedRef({
|
|
|
1516
1519
|
prevPanelIds: []
|
|
1517
1520
|
});
|
|
1518
1521
|
useImperativeHandle(forwardedRef, () => ({
|
|
1522
|
+
getElement: () => panelGroupElementRef.current,
|
|
1519
1523
|
getId: () => committedValuesRef.current.id,
|
|
1520
1524
|
getLayout: () => {
|
|
1521
1525
|
const {
|
|
@@ -73,6 +73,7 @@ function PanelWithForwardedRef({
|
|
|
73
73
|
unregisterPanel
|
|
74
74
|
} = context;
|
|
75
75
|
const panelId = useUniqueId(idFromProps);
|
|
76
|
+
const panelElementRef = useRef(null);
|
|
76
77
|
const panelDataRef = useRef({
|
|
77
78
|
callbacks: {
|
|
78
79
|
onCollapse,
|
|
@@ -133,6 +134,7 @@ function PanelWithForwardedRef({
|
|
|
133
134
|
expand: minSize => {
|
|
134
135
|
expandPanel(panelDataRef.current, minSize);
|
|
135
136
|
},
|
|
137
|
+
getElement: () => panelElementRef.current,
|
|
136
138
|
getId() {
|
|
137
139
|
return panelId;
|
|
138
140
|
},
|
|
@@ -155,6 +157,7 @@ function PanelWithForwardedRef({
|
|
|
155
157
|
children,
|
|
156
158
|
className: classNameFromProps,
|
|
157
159
|
id: panelId,
|
|
160
|
+
ref: panelElementRef,
|
|
158
161
|
style: {
|
|
159
162
|
...style,
|
|
160
163
|
...styleFromProps
|
|
@@ -1673,6 +1676,7 @@ function PanelGroupWithForwardedRef({
|
|
|
1673
1676
|
prevPanelIds: []
|
|
1674
1677
|
});
|
|
1675
1678
|
useImperativeHandle(forwardedRef, () => ({
|
|
1679
|
+
getElement: () => panelGroupElementRef.current,
|
|
1676
1680
|
getId: () => committedValuesRef.current.id,
|
|
1677
1681
|
getLayout: () => {
|
|
1678
1682
|
const {
|
package/package.json
CHANGED