@@ -2800,26 +2800,25 @@ export class AppReport extends LitElement {
2800
2800
} )
2801
2801
2802
2802
if ( yellow + purple + red != 0 ) {
2803
+
2804
+ let redClassMap = classMap ( { 'indicator' : true , 'selected' : this . filterList . includes ( "required" ) } ) ;
2805
+ let yellowClassMap = classMap ( { 'indicator' : true , 'selected' : this . filterList . includes ( "recommended" ) } ) ;
2806
+ let purpleClassMap = classMap ( { 'indicator' : true , 'selected' : this . filterList . includes ( "enhancement" ) } ) ;
2807
+
2803
2808
return html `
2804
2809
< div id ="indicators-holder ">
2805
2810
${ red != 0 ?
2806
- this . filterList . includes ( "required" ) ?
2807
- html `< button type ="button " class ="indicator selected " tabindex ="0 " @click =${ ( e : Event ) => this . filterTodoItems ( "required" , e ) } > < img src =${ stop_white_src } alt ="invalid result icon"/> < p > ${ red } </ p > </ button > ` :
2808
- html `< button type ="button " class ="indicator " tabindex ="0 " @click =${ ( e : Event ) => this . filterTodoItems ( "required" , e ) } > < img src =${ stop_src } alt ="invalid result icon"/> < p > ${ red } </ p > </ button > `
2811
+ html `< button type ="button " class =${ redClassMap } tabindex ="0" @click=${ ( e : Event ) => this . filterTodoItems ( "required" , e ) } > < img src =${ this . filterList . includes ( "required" ) ? stop_white_src : stop_src } alt ="invalid result icon"/> < p > ${ red } </ p > </ button > `
2809
2812
: null
2810
2813
}
2811
2814
${ yellow != 0 ?
2812
- this . filterList . includes ( "recommended" ) || this . filterList . includes ( "optional" ) ?
2813
- html `< button type ="button " class ="indicator selected " tabindex ="0 " @click =${ ( e : Event ) => this . filterTodoItems ( "yellow" , e ) } > < img src =${ yield_white_src } alt ="yield result icon"/> < p > ${ yellow } </ p > </ button > ` :
2814
- html `< button type ="button " class ="indicator " tabindex ="0 " @click =${ ( e : Event ) => this . filterTodoItems ( "yellow" , e ) } > < img src =${ yield_src } alt ="yield result icon"/> < p > ${ yellow } </ p > </ button > `
2815
+ html `< button type ="button " class =${ yellowClassMap } tabindex ="0" @click=${ ( e : Event ) => this . filterTodoItems ( "yellow" , e ) } > < img src =${ this . filterList . includes ( "recommended" ) ? yield_white_src : yield_src } alt ="yield result icon"/> < p > ${ yellow } </ p > </ button > `
2815
2816
: null
2816
2817
}
2817
2818
${ purple != 0 ?
2818
- this . filterList . includes ( "enhancement" ) ?
2819
- html `< button type ="button " class ="indicator selected " tabindex ="0 " @click =${ ( e : Event ) => this . filterTodoItems ( "enhancement" , e ) } > < img src =${ enhancement_white_src } alt ="enhancement result icon"/> < p > ${ purple } </ p > </ button > ` :
2820
- html `< button type ="button " class ="indicator " tabindex ="0 " @click =${ ( e : Event ) => this . filterTodoItems ( "enhancement" , e ) } > < img src =${ enhancement_src } alt ="enhancement result icon"/> < p > ${ purple } </ p > </ button > `
2821
- : null
2822
- }
2819
+ html `< button type ="button " class =${ purpleClassMap } tabindex ="0" @click=${ ( e : Event ) => this . filterTodoItems ( "enhancement" , e ) } > < img src =${ this . filterList . includes ( "enhancement" ) ? enhancement_white_src : enhancement_src } alt ="enhancement result icon"/> < p > ${ purple } </ p > </ button > `
2820
+ : null
2821
+ }
2823
2822
</ div > `
2824
2823
}
2825
2824
return null ;
0 commit comments