File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ const renderService: ITreeViewRenderService = {
31
31
checkbox . id = `cb-${ node . nodeId } ` ;
32
32
checkbox . type = 'checkbox' ;
33
33
checkbox . checked = node . checked ;
34
+ checkbox . indeterminate = node . numVisibleEntities > 0 && ! node . checked ;
34
35
checkbox . style . pointerEvents = 'all' ;
35
36
if ( checkHandler ) checkbox . addEventListener ( 'change' , checkHandler ) ;
36
37
wrapperDiv . appendChild ( checkbox ) ;
@@ -124,12 +125,18 @@ const renderService: ITreeViewRenderService = {
124
125
isChecked : ( element : HTMLInputElement ) => {
125
126
return element . checked ;
126
127
} ,
127
- setCheckbox : ( nodeId , checked ) => {
128
+ setCheckbox : ( nodeId , checked , indeterminate = false ) => {
128
129
const checkbox = document . getElementById ( `cb-${ nodeId } ` ) as HTMLInputElement ;
129
130
if ( checkbox ) {
130
131
if ( checked !== checkbox . checked ) {
131
132
checkbox . checked = checked ;
132
133
}
134
+ if ( indeterminate !== checkbox . indeterminate ) {
135
+ checkbox . indeterminate = indeterminate ;
136
+ if ( indeterminate ) {
137
+ checkbox . checked = false ;
138
+ }
139
+ }
133
140
}
134
141
} ,
135
142
setXRayed : ( ) => {
You can’t perform that action at this time.
0 commit comments