File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,21 @@ export class AccordionPanel {
8080 this . _deferredContentAware . contentVisible . set ( this . visible ( ) ) ;
8181 } ) ;
8282 }
83+
84+ /** Expands this item. */
85+ expand ( ) {
86+ this . accordionTrigger ( ) ?. expansionControl . open ( ) ;
87+ }
88+
89+ /** Collapses this item. */
90+ collapse ( ) {
91+ this . accordionTrigger ( ) ?. expansionControl . close ( ) ;
92+ }
93+
94+ /** Toggles the expansion state of this item. */
95+ toggle ( ) {
96+ this . accordionTrigger ( ) ?. expansionControl . toggle ( ) ;
97+ }
8398}
8499
85100/**
@@ -145,6 +160,21 @@ export class AccordionTrigger {
145160 accordionGroup : computed ( ( ) => this . _accordionGroup . _pattern ) ,
146161 accordionPanel : this . accordionPanel ,
147162 } ) ;
163+
164+ /** Expands this item. */
165+ expand ( ) {
166+ this . _pattern . expansionControl . open ( ) ;
167+ }
168+
169+ /** Collapses this item. */
170+ collapse ( ) {
171+ this . _pattern . expansionControl . close ( ) ;
172+ }
173+
174+ /** Toggles the expansion state of this item. */
175+ toggle ( ) {
176+ this . _pattern . expansionControl . toggle ( ) ;
177+ }
148178}
149179
150180/**
@@ -214,6 +244,16 @@ export class AccordionGroup {
214244 }
215245 } ) ;
216246 }
247+
248+ /** Expands all accordion panels if multi-expandable. */
249+ expandAll ( ) {
250+ this . _pattern . expansionManager . openAll ( ) ;
251+ }
252+
253+ /** Collapses all accordion panels. */
254+ collapseAll ( ) {
255+ this . _pattern . expansionManager . closeAll ( ) ;
256+ }
217257}
218258
219259/**
You can’t perform that action at this time.
0 commit comments