File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ export default class DataBrowserHeaderBar extends React.Component {
45
45
readonly,
46
46
preventSchemaEdits,
47
47
selected,
48
+ indeterminate,
48
49
isDataLoaded,
49
50
setSelectedObjectId,
50
51
setCurrent,
@@ -61,7 +62,16 @@ export default class DataBrowserHeaderBar extends React.Component {
61
62
style = { { position : 'sticky' , left : 0 , zIndex : 11 } }
62
63
>
63
64
{ readonly ? null : (
64
- < input type = "checkbox" checked = { selected } onChange = { e => selectAll ( e . target . checked ) } />
65
+ < input
66
+ type = "checkbox"
67
+ checked = { selected }
68
+ ref = { input => {
69
+ if ( input ) {
70
+ input . indeterminate = indeterminate ;
71
+ }
72
+ } }
73
+ onChange = { e => selectAll ( e . target . checked ) }
74
+ />
65
75
) }
66
76
</ div > ,
67
77
] ;
Original file line number Diff line number Diff line change @@ -581,7 +581,18 @@ export default class BrowserTable extends React.Component {
581
581
selected = {
582
582
! ! this . props . selection &&
583
583
! ! this . props . data &&
584
- Object . values ( this . props . selection ) . filter ( checked => checked ) . length ===
584
+ this . props . data . length > 0 &&
585
+ ( ! ! this . props . selection [ '*' ] ||
586
+ Object . values ( this . props . selection ) . filter ( checked => checked ) . length ===
587
+ this . props . data . length )
588
+ }
589
+ indeterminate = {
590
+ ! ! this . props . selection &&
591
+ ! ! this . props . data &&
592
+ this . props . data . length > 0 &&
593
+ ! this . props . selection [ '*' ] &&
594
+ Object . values ( this . props . selection ) . filter ( checked => checked ) . length > 0 &&
595
+ Object . values ( this . props . selection ) . filter ( checked => checked ) . length !==
585
596
this . props . data . length
586
597
}
587
598
selectAll = { checked =>
You can’t perform that action at this time.
0 commit comments