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 {
4545 readonly,
4646 preventSchemaEdits,
4747 selected,
48+ indeterminate,
4849 isDataLoaded,
4950 setSelectedObjectId,
5051 setCurrent,
@@ -61,7 +62,16 @@ export default class DataBrowserHeaderBar extends React.Component {
6162 style = { { position : 'sticky' , left : 0 , zIndex : 11 } }
6263 >
6364 { 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+ />
6575 ) }
6676 </ div > ,
6777 ] ;
Original file line number Diff line number Diff line change @@ -581,7 +581,18 @@ export default class BrowserTable extends React.Component {
581581 selected = {
582582 ! ! this . props . selection &&
583583 ! ! 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 !==
585596 this . props . data . length
586597 }
587598 selectAll = { checked =>
You can’t perform that action at this time.
0 commit comments