@@ -503,47 +503,47 @@ export class MultipleSelectInstance {
503503 protected getListRows ( ) : HtmlStruct [ ] {
504504 const rows : HtmlStruct [ ] = [ ] ;
505505 this . updateData = [ ] ;
506- this . data ?. forEach ( ( row ) => rows . push ( ...this . initListItem ( row ) ) ) ;
506+ this . data ?. forEach ( ( dataRow ) => rows . push ( ...this . initListItem ( dataRow ) ) ) ;
507507 rows . push ( { tagName : 'li' , props : { className : 'ms-no-results' , textContent : this . formatNoMatchesFound ( ) , tabIndex : 0 } } ) ;
508508
509509 return rows ;
510510 }
511511
512- protected initListItem ( row : OptionRowData | OptGroupRowData , level = 0 ) : HtmlStruct [ ] {
513- const title = row ?. title || '' ;
512+ protected initListItem ( dataRow : OptionRowData | OptGroupRowData , level = 0 ) : HtmlStruct [ ] {
513+ const title = dataRow ?. title || '' ;
514514 const multiple = this . options . multiple ? 'multiple' : '' ;
515515 const type = this . options . single ? 'radio' : 'checkbox' ;
516516 let classes = '' ;
517517
518- if ( ! row ?. visible ) {
518+ if ( ! dataRow ?. visible ) {
519519 return [ ] ;
520520 }
521521
522- this . updateData . push ( row ) ;
522+ this . updateData . push ( dataRow ) ;
523523
524524 if ( this . options . single && ! this . options . singleRadio ) {
525525 classes = 'hide-radio ' ;
526526 }
527527
528- if ( row . selected ) {
528+ if ( dataRow . selected ) {
529529 classes += 'selected ' ;
530530 }
531531
532- if ( row . type === 'optgroup' ) {
532+ if ( dataRow . type === 'optgroup' ) {
533533 // - group option row -
534534 const htmlBlocks : HtmlStruct [ ] = [ ] ;
535535
536536 const itemOrGroupBlock : HtmlStruct =
537537 this . options . hideOptgroupCheckboxes || this . options . single
538- ? { tagName : 'span' , props : { dataset : { name : this . selectGroupName , key : row . _key } } }
538+ ? { tagName : 'span' , props : { dataset : { name : this . selectGroupName , key : dataRow . _key } } }
539539 : {
540540 tagName : 'input' ,
541541 props : {
542542 type : 'checkbox' ,
543- dataset : { name : this . selectGroupName , key : row . _key } ,
544- ariaChecked : String ( row . selected || false ) ,
545- checked : ! ! row . selected ,
546- disabled : row . disabled ,
543+ dataset : { name : this . selectGroupName , key : dataRow . _key } ,
544+ ariaChecked : String ( dataRow . selected || false ) ,
545+ checked : ! ! dataRow . selected ,
546+ disabled : dataRow . disabled ,
547547 tabIndex : - 1 ,
548548 } ,
549549 } ;
@@ -553,25 +553,24 @@ export class MultipleSelectInstance {
553553 }
554554
555555 const spanLabelBlock : HtmlStruct = { tagName : 'span' , props : { } } ;
556- this . applyAsTextOrHtmlWhenEnabled ( spanLabelBlock . props , ( row as OptGroupRowData ) . label ) ;
557-
556+ this . applyAsTextOrHtmlWhenEnabled ( spanLabelBlock . props , ( dataRow as OptGroupRowData ) . label ) ;
558557 const liBlock : HtmlStruct = {
559558 tagName : 'li' ,
560559 props : {
561560 className : `group ${ classes } ` . trim ( ) ,
562- tabIndex : classes . includes ( 'hide-radio' ) || row . disabled ? - 1 : 0 ,
561+ tabIndex : classes . includes ( 'hide-radio' ) || dataRow . disabled ? - 1 : 0 ,
563562 } ,
564563 children : [
565564 {
566565 tagName : 'label' ,
567- props : { className : `optgroup${ this . options . single || row . disabled ? ' disabled' : '' } ` } ,
566+ props : { className : `optgroup${ this . options . single || dataRow . disabled ? ' disabled' : '' } ` } ,
568567 children : [ itemOrGroupBlock , spanLabelBlock ] ,
569568 } ,
570569 ] ,
571570 } ;
572571
573- const customStyleRules = this . options . cssStyler ( row ) ;
574- const customStylerStr = String ( this . options . styler ( row ) || '' ) ; // deprecated
572+ const customStyleRules = this . options . cssStyler ( dataRow ) ;
573+ const customStylerStr = String ( this . options . styler ( dataRow ) || '' ) ; // deprecated
575574 if ( customStylerStr ) {
576575 liBlock . props . style = convertStringStyleToElementStyle ( customStylerStr ) ;
577576 }
@@ -580,52 +579,51 @@ export class MultipleSelectInstance {
580579 }
581580 htmlBlocks . push ( liBlock ) ;
582581
583- ( row as OptGroupRowData ) . children . forEach ( ( child ) => htmlBlocks . push ( ...this . initListItem ( child , 1 ) ) ) ;
582+ ( dataRow as OptGroupRowData ) . children . forEach ( ( child ) => htmlBlocks . push ( ...this . initListItem ( child , 1 ) ) ) ;
584583
585584 return htmlBlocks ;
586585 }
587586
588587 // - regular row -
589- classes += row . classes || '' ;
588+ classes += dataRow . classes || '' ;
590589
591590 if ( level && this . options . single ) {
592591 classes += `option-level-${ level } ` ;
593592 }
594593
595- if ( row . divider ) {
594+ if ( dataRow . divider ) {
596595 return [ { tagName : 'li' , props : { className : 'option-divider' } } as HtmlStruct ] ;
597596 }
598597
599598 const liClasses = multiple || classes ? ( multiple + classes ) . trim ( ) : '' ;
600- const labelClasses = `${ row . disabled ? 'disabled' : '' } ` ;
599+ const labelClasses = `${ dataRow . disabled ? 'disabled' : '' } ` ;
601600 const spanLabelBlock : HtmlStruct = { tagName : 'span' , props : { } } ;
602- this . applyAsTextOrHtmlWhenEnabled ( spanLabelBlock . props , ( row as OptionRowData ) . text ) ;
603-
601+ this . applyAsTextOrHtmlWhenEnabled ( spanLabelBlock . props , ( dataRow as OptionRowData ) . text ) ;
604602 const inputBlock : HtmlStruct = {
605603 tagName : 'input' ,
606604 props : {
607605 type,
608- value : encodeURI ( row . value as string ) ,
609- dataset : { key : row . _key , name : this . selectItemName } ,
610- ariaChecked : String ( row . selected || false ) ,
611- checked : ! ! row . selected ,
612- disabled : ! ! row . disabled ,
606+ value : encodeURI ( dataRow . value as string ) ,
607+ dataset : { key : dataRow . _key , name : this . selectItemName } ,
608+ ariaChecked : String ( dataRow . selected || false ) ,
609+ checked : ! ! dataRow . selected ,
610+ disabled : ! ! dataRow . disabled ,
613611 tabIndex : - 1 ,
614612 } ,
615613 } ;
616614
617- if ( row . selected ) {
615+ if ( dataRow . selected ) {
618616 inputBlock . attrs = { checked : 'checked' } ;
619617 }
620618
621619 const liBlock : HtmlStruct = {
622620 tagName : 'li' ,
623- props : { className : liClasses , title, tabIndex : row . disabled ? - 1 : 0 , dataset : { key : row . _key } } ,
621+ props : { className : liClasses , title, tabIndex : dataRow . disabled ? - 1 : 0 , dataset : { key : dataRow . _key } } ,
624622 children : [ { tagName : 'label' , props : { className : labelClasses } , children : [ inputBlock , spanLabelBlock ] } ] ,
625623 } ;
626624
627- const customStyleRules = this . options . cssStyler ( row ) ;
628- const customStylerStr = String ( this . options . styler ( row ) || '' ) ; // deprecated
625+ const customStyleRules = this . options . cssStyler ( dataRow ) ;
626+ const customStylerStr = String ( this . options . styler ( dataRow ) || '' ) ; // deprecated
629627 if ( customStylerStr ) {
630628 liBlock . props . style = convertStringStyleToElementStyle ( customStylerStr ) ;
631629 }
0 commit comments