@@ -63,13 +63,13 @@ const panelClass = `overflow-hidden ${type === 'horizontal' ? 'h-full' : ''}`;
63
63
$container.style.setProperty('--pos', pos);
64
64
}
65
65
</script >
66
- <div class ={ panelClass } >
66
+ <div class ={ panelClass } data-id = " main-panel " >
67
67
<slot name =" a" />
68
68
</div >
69
69
{
70
70
hasSidePanel && (
71
71
<>
72
- <div class = { ` ${panelClass } ${sidePanelClass } ` } >
72
+ <div class = { ` ${panelClass } ${sidePanelClass } ` } data-id = " side-panel " >
73
73
<slot name = " b" />
74
74
</div >
75
75
<div
@@ -97,12 +97,16 @@ const panelClass = `overflow-hidden ${type === 'horizontal' ? 'h-full' : ''}`;
97
97
#dragging = false;
98
98
99
99
#container: HTMLElement;
100
+ #mainPanel: HTMLElement;
101
+ #sidePanel: HTMLElement | undefined;
100
102
#divider: HTMLElement | undefined;
101
103
102
104
constructor() {
103
105
super();
104
106
105
107
this.#container = this.querySelector(':scope > [data-id="container"]') as HTMLElement;
108
+ this.#mainPanel = this.#container.querySelector(':scope > [data-id="main-panel"]') as HTMLElement;
109
+ this.#sidePanel = this.#container.querySelector(':scope > [data-id="side-panel"]') as HTMLElement | undefined;
106
110
this.#divider = this.#container.querySelector(':scope > [data-id="divider"]') as HTMLElement | undefined;
107
111
108
112
this.#width = this.#container.clientWidth;
@@ -126,11 +130,11 @@ const panelClass = `overflow-hidden ${type === 'horizontal' ? 'h-full' : ''}`;
126
130
}
127
131
128
132
mainPanel(): HTMLElement {
129
- return this.#container.children[1] as HTMLElement ;
133
+ return this.#mainPanel ;
130
134
}
131
135
132
136
sidePanel(): HTMLElement | undefined {
133
- return this.#container.children[2] as HTMLElement | undefined ;
137
+ return this.#sidePanel ;
134
138
}
135
139
136
140
divider(): HTMLElement | undefined {
0 commit comments