@@ -6,18 +6,18 @@ import { Logger } from './logger.js';
66interface AnonymousSlot {
77 hasContent : boolean ;
88 elements : Element [ ] ;
9- slot : HTMLSlotElement | null ;
9+ slot : HTMLSlotElement | null ;
1010}
1111
1212interface NamedSlot extends AnonymousSlot {
1313 name : string ;
1414 initialized : true ;
1515}
1616
17- export type Slot = NamedSlot | AnonymousSlot ;
17+ export type Slot = NamedSlot | AnonymousSlot ;
1818
1919export interface SlotsConfig {
20- slots : ( string | null ) [ ] ;
20+ slots : ( string | null ) [ ] ;
2121 /**
2222 * Object mapping new slot name keys to deprecated slot name values
2323 * @example `pf-modal--header` is deprecated in favour of `header`
@@ -33,7 +33,7 @@ export interface SlotsConfig {
3333 deprecations ?: Record < string , string > ;
3434}
3535
36- function isObjectConfigSpread ( config : ( [ SlotsConfig ] | ( string | null ) [ ] ) ) : config is [ SlotsConfig ] {
36+ function isObjectConfigSpread ( config : ( [ SlotsConfig ] | ( string | null ) [ ] ) ) : config is [ SlotsConfig ] {
3737 return config . length === 1 && typeof config [ 0 ] === 'object' && config [ 0 ] !== null ;
3838}
3939
@@ -42,27 +42,27 @@ function isObjectConfigSpread(config: ([SlotsConfig]|(string|null)[])): config i
4242 * for the default slot, look for direct children not assigned to a slot
4343 */
4444const isSlot =
45- < T extends Element = Element > ( n : string | typeof SlotController . anonymous ) =>
45+ < T extends Element = Element > ( n : string | typeof SlotController . anonymous ) =>
4646 ( child : Element ) : child is T =>
4747 n === SlotController . anonymous ? ! child . hasAttribute ( 'slot' )
4848 : child . getAttribute ( 'slot' ) === n ;
4949
5050export class SlotController implements ReactiveController {
5151 public static anonymous = Symbol ( 'anonymous slot' ) ;
5252
53- private nodes = new Map < string | typeof SlotController . anonymous , Slot > ( ) ;
53+ private nodes = new Map < string | typeof SlotController . anonymous , Slot > ( ) ;
5454
5555 private logger : Logger ;
5656
5757 private firstUpdated = false ;
5858
5959 private mo = new MutationObserver ( this . onMutation ) ;
6060
61- private slotNames : ( string | null ) [ ] ;
61+ private slotNames : ( string | null ) [ ] ;
6262
6363 private deprecations : Record < string , string > = { } ;
6464
65- constructor ( public host : ReactiveElement , ...config : ( [ SlotsConfig ] | ( string | null ) [ ] ) ) {
65+ constructor ( public host : ReactiveElement , ...config : ( [ SlotsConfig ] | ( string | null ) [ ] ) ) {
6666 this . logger = new Logger ( this . host ) ;
6767
6868 if ( isObjectConfigSpread ( config ) ) {
@@ -163,12 +163,12 @@ export class SlotController implements ReactiveController {
163163 }
164164 }
165165
166- private getChildrenForSlot < T extends Element = Element > ( name : string | typeof SlotController . anonymous ) : T [ ] {
166+ private getChildrenForSlot < T extends Element = Element > ( name : string | typeof SlotController . anonymous ) : T [ ] {
167167 const children = Array . from ( this . host . children ) as T [ ] ;
168168 return children . filter ( isSlot ( name ) ) ;
169169 }
170170
171- @bound private initSlot ( slotName : string | null ) {
171+ @bound private initSlot ( slotName : string | null ) {
172172 const name = slotName || SlotController . anonymous ;
173173 const elements = this . nodes . get ( name ) ?. slot ?. assignedElements ?.( ) ?? this . getChildrenForSlot ( name ) ;
174174 const selector = slotName ? `slot[name="${ slotName } "]` : 'slot:not([name])' ;
0 commit comments