File tree Expand file tree Collapse file tree 3 files changed +21
-10
lines changed Expand file tree Collapse file tree 3 files changed +21
-10
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @equinor/workspace-filter" ,
3
- "version" : " 4.0.8 " ,
3
+ "version" : " 4.0.9 " ,
4
4
"type" : " module" ,
5
5
"sideEffects" : false ,
6
6
"license" : " MIT" ,
Original file line number Diff line number Diff line change @@ -6,13 +6,24 @@ export function getFilterHeaderText(
6
6
name : string ,
7
7
checkedValues : string [ ]
8
8
) : string | JSX . Element {
9
- if ( isAllChecked || checkedValues . length === 0 ) return < StyledNormalText > { name } </ StyledNormalText > ;
9
+ const selectedCount = checkedValues . length ;
10
10
11
- return (
12
- < div style = { { color : tokens . colors . interactive . primary__resting . hex } } >
13
- { checkedValues . length - 1 > 0
14
- ? `${ checkedValues [ 0 ] ?? '(Blank)' } (+${ checkedValues . length - 1 } )`
15
- : `${ checkedValues [ 0 ] } ` } { ' ' }
16
- </ div >
17
- ) ;
11
+ const hasBlank = checkedValues . includes ( '(Blank)' ) ;
12
+ const nonBlankCount = hasBlank ? selectedCount - 1 : selectedCount ;
13
+
14
+ if ( hasBlank && nonBlankCount > 0 ) {
15
+ return < StyledNormalText > { `${ name } (Blank) (+${ nonBlankCount } )` } </ StyledNormalText > ;
16
+ }
17
+
18
+ if ( selectedCount === 1 && hasBlank ) {
19
+ return < StyledNormalText > { `${ name } (Blank)` } </ StyledNormalText > ;
20
+ }
21
+
22
+ const displayText = selectedCount > 0 ? `${ name } (+${ selectedCount } )` : name ;
23
+
24
+ if ( isAllChecked || selectedCount === 0 ) {
25
+ return < StyledNormalText > { displayText } </ StyledNormalText > ;
26
+ }
27
+
28
+ return < div style = { { color : tokens . colors . interactive . primary__resting . hex } } > { displayText } </ div > ;
18
29
}
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @equinor/workspace-fusion" ,
3
- "version" : " 9.0.22 " ,
3
+ "version" : " 9.0.23 " ,
4
4
"type" : " module" ,
5
5
"sideEffects" : false ,
6
6
"license" : " MIT" ,
You can’t perform that action at this time.
0 commit comments