@@ -58,7 +58,8 @@ import { NG_VALUE_ACCESSOR, ControlValueAccessor } from "@angular/forms";
5858 'bx--structured-list--border': border,
5959 'bx--structured-list--selection': selection,
6060 'bx--structured-list--condensed': condensed,
61- 'bx--structured-list-content--nowrap': nowrap
61+ 'bx--structured-list-content--nowrap': nowrap,
62+ 'bx--skeleton': skeleton
6263 }">
6364 <ng-content select="ibm-list-header"></ng-content>
6465 <div class="bx--structured-list-tbody">
@@ -99,6 +100,23 @@ export class StructuredList implements AfterContentInit, ControlValueAccessor {
99100 * Used when `selection = true` as the row radio group `name`
100101 */
101102 @Input ( ) name = `structured-list-${ StructuredList . listCount ++ } ` ;
103+
104+ /**
105+ * Sets the skeleton value for all `ListHeader` to the skeleton value of `StructuredList`.
106+ */
107+ @Input ( )
108+ set skeleton ( value : any ) {
109+ this . _skeleton = value ;
110+ this . updateChildren ( ) ;
111+ }
112+
113+ /**
114+ * Returns the skeleton value in the `StructuredList` if there is one.
115+ */
116+ get skeleton ( ) : any {
117+ return this . _skeleton ;
118+ }
119+
102120 /**
103121 * Emits an event when the row selection changes.
104122 *
@@ -116,6 +134,8 @@ export class StructuredList implements AfterContentInit, ControlValueAccessor {
116134 @ContentChildren ( ListRow ) rows : QueryList < ListRow > ;
117135 @ContentChildren ( ListHeader ) headers : QueryList < ListHeader > ;
118136
137+ protected _skeleton = false ;
138+
119139 onChange = ( _ : any ) => { } ;
120140
121141 onTouched = ( ) => { } ;
@@ -138,6 +158,7 @@ export class StructuredList implements AfterContentInit, ControlValueAccessor {
138158 this . onChange ( row . value ) ;
139159 } ) ;
140160 } ) ;
161+ this . updateChildren ( ) ;
141162 }
142163
143164 writeValue ( value : any ) {
@@ -158,4 +179,10 @@ export class StructuredList implements AfterContentInit, ControlValueAccessor {
158179 registerOnTouched ( fn : any ) {
159180 this . onTouched = fn ;
160181 }
182+
183+ protected updateChildren ( ) {
184+ if ( this . headers ) {
185+ this . headers . toArray ( ) . forEach ( child => child . skeleton = this . skeleton ) ;
186+ }
187+ }
161188}
0 commit comments