@@ -11,7 +11,6 @@ import ActionsExample from "@components/examples/collapsible/ActionsExample.astr
1111import DecorationsExample from " @components/examples/collapsible/DecorationsExample.astro" ;
1212import ScrollableExample from " @components/examples/collapsible/ScrollableExample.astro" ;
1313import ToggleExample from " @components/examples/collapsible/ToggleExample.astro" ;
14- import CssBodyPartExample from " @components/examples/collapsible/CssBodyPartExample.astro" ;
1514
1615<Imports />
1716<PageSwitcher />
@@ -22,10 +21,10 @@ import CssBodyPartExample from "@components/examples/collapsible/CssBodyPartExam
2221 <BasicExample />
2322 <Fragment slot = " html" >
2423 ``` html
25- <vscode-collapsible title =" Basic example" open >
24+ <vscode-collapsible heading =" Basic example" open >
2625 <p >Open by default</p >
2726 </vscode-collapsible >
28- <vscode-collapsible title =" Basic example" >
27+ <vscode-collapsible heading =" Basic example" >
2928 <p >Suspendisse potenti. Maecenas eu egestas metus. Nulla eget placerat mi, et efficitur augue.</p >
3029 </vscode-collapsible >
3130 ```
@@ -41,13 +40,13 @@ import CssBodyPartExample from "@components/examples/collapsible/CssBodyPartExam
4140
4241## Toggle event
4342
44- A custom event is dispatched when the visibility of content changes.
43+ A custom event is dispatched when the visibility of content changes. Check the console log for the triggered events.
4544
4645<Demo >
4746 <ToggleExample />
4847 <Fragment slot = " html" >
4948 ``` html
50- <vscode-collapsible title =" Dispatch toggle event" id =" toggle-event-example" >
49+ <vscode-collapsible heading =" Dispatch toggle event" id =" toggle-event-example" >
5150 <p >Test content</p >
5251 </vscode-collapsible >
5352 ```
@@ -60,6 +59,7 @@ A custom event is dispatched when the visibility of content changes.
6059 console .log (ev);
6160 });
6261 ```
62+
6363 </Fragment >
6464</Demo >
6565
@@ -72,7 +72,7 @@ visible exclusively when the component is in the opened state.
7272 <ActionsExample />
7373 <Fragment slot = " html" >
7474 ``` html {2-15}
75- <vscode-collapsible title =" Actions example" class =" collapsible" open >
75+ <vscode-collapsible heading =" Actions example" class =" collapsible" open >
7676 <vscode-icon
7777 name =" file-add"
7878 action-icon
@@ -146,7 +146,7 @@ Elements in the `decorations` slot are always visible, in contrast to the `actio
146146 <DecorationsExample />
147147 <Fragment slot = " html" >
148148 ``` html {2}
149- <vscode-collapsible title =" Decorations example" class =" collapsible" >
149+ <vscode-collapsible heading =" Decorations example" class =" collapsible" >
150150 <vscode-badge variant =" counter" slot =" decorations" >99</vscode-badge >
151151 <p >
152152 Suspendisse potenti. Maecenas eu egestas metus. Nulla eget placerat mi, et
@@ -164,43 +164,6 @@ Elements in the `decorations` slot are always visible, in contrast to the `actio
164164 </Fragment >
165165</Demo >
166166
167- ## Overflown content
168-
169- The overflown content of the Collapsible component is hidden by default. Sometimes, this behavior
170- can be problematic. In such cases, it is useful that the Collapsible body is customizable.
171-
172- <Demo >
173- <CssBodyPartExample />
174- <Fragment slot = " html" >
175- ``` html
176- <vscode-collapsible title =" Customized CSS part example" class =" css-part-example" open >
177- <p >Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p >
178- <vscode-single-select >
179- <vscode-option >Lorem</vscode-option >
180- <vscode-option >Ipsum</vscode-option >
181- <vscode-option >Dolor</vscode-option >
182- <vscode-option >Sit</vscode-option >
183- <vscode-option >Et</vscode-option >
184- <vscode-option >Amur</vscode-option >
185- <vscode-option >Sadispcing</vscode-option >
186- </vscode-single-select >
187- <p >Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p >
188- </vscode-collapsible >
189- ```
190- </Fragment >
191- <Fragment slot = " css" >
192- ``` css
193- .css-part-example ::part(body ) {
194- overflow : visible ;
195- }
196-
197- .css-part-example p :last-child {
198- margin-bottom : 0 ;
199- }
200- ```
201- </Fragment >
202- </Demo >
203-
204167## Displaying large amounts of data
205168
206169Long content can be managed by the [ Scrollable] ( /components/scrollable ) component.
@@ -210,7 +173,7 @@ Long content can be managed by the [Scrollable](/components/scrollable) componen
210173 <Fragment slot = " html" >
211174 ``` html
212175 <vscode-collapsible
213- title =" Timeline"
176+ heading =" Timeline"
214177 description =" vscode-collapsible.ts"
215178 class =" collapsible complex-example"
216179 open
@@ -222,7 +185,17 @@ Long content can be managed by the [Scrollable](/components/scrollable) componen
222185 <vscode-icon name =" filter" action-icon slot =" actions" id =" filter-icon"
223186 ></vscode-icon >
224187 <vscode-scrollable >
225- <vscode-tree id =" tree-example" ></vscode-tree >
188+ <vscode-tree >
189+ <vscode-tree-item >
190+ <vscode-icon name =" circle-outline" slot =" icon-leaf" ></vscode-icon >
191+ File saved
192+ </vscode-tree-item >
193+ <vscode-tree-item >
194+ <vscode-icon name =" circle-outline" slot =" icon-leaf" ></vscode-icon >
195+ File saved
196+ </vscode-tree-item >
197+ ...
198+ </vscode-tree >
226199 </vscode-scrollable >
227200 </vscode-collapsible >
228201 ```
@@ -236,39 +209,18 @@ Long content can be managed by the [Scrollable](/components/scrollable) componen
236209 </Fragment >
237210 <Fragment slot = " js" >
238211 ``` javascript
239- const icons = {
240- leaf: " circle-outline" ,
241- };
242- const tree = document .getElementById (" tree-example" );
243212 document .getElementById (" pin-icon" ).addEventListener (" click" , (ev ) => {
213+ // Prevent collapsing of the component:
244214 ev .stopPropagation ();
245215 });
246216 document .getElementById (" refresh-icon" ).addEventListener (" click" , (ev ) => {
217+ // Prevent collapsing of the component:
247218 ev .stopPropagation ();
248219 });
249220 document .getElementById (" filter-icon" ).addEventListener (" click" , (ev ) => {
221+ // Prevent collapsing of the component:
250222 ev .stopPropagation ();
251223 });
252-
253- tree .data = [
254- { icons, label: " File Saved" },
255- { icons, label: " File Saved" },
256- { icons, label: " File Saved" },
257- { icons, label: " File Saved" },
258- { icons, label: " File Saved" },
259- { icons, label: " File Saved" },
260- { icons, label: " File Saved" },
261- { icons, label: " File Saved" },
262- { icons, label: " File Saved" },
263- { icons, label: " File Saved" },
264- { icons, label: " File Saved" },
265- { icons, label: " File Saved" },
266- { icons, label: " File Saved" },
267- { icons, label: " File Saved" },
268- { icons, label: " File Saved" },
269- { icons, label: " File Saved" },
270- ];
271224 ```
272-
273225 </Fragment >
274226</Demo >
0 commit comments