@@ -4,7 +4,6 @@ import { VirtualList, VirtualListHandle } from "./VirtualList";
4
4
5
5
// types ==================================
6
6
export type Id = string | number
7
- export type Checked = boolean | null
8
7
export interface Stat < T > {
9
8
id : Id ,
10
9
pid : Id | null ,
@@ -21,7 +20,7 @@ export interface Stat<T> {
21
20
siblingStats : Stat < T > [ ] ,
22
21
_isStat ?: boolean ,
23
22
open : boolean ,
24
- checked : Checked ,
23
+ checked : boolean ,
25
24
draggable : boolean ,
26
25
}
27
26
@@ -1020,7 +1019,7 @@ export function updateCheckedInFlatData<T extends Record<Id, any>>(
1020
1019
) {
1021
1020
const checkedIdSet = new Set ( checkedIds )
1022
1021
const idsToUpdate = Array . isArray ( idOrIds ) ? idOrIds : [ idOrIds ] ;
1023
- const all = new Map < Id , Checked > ( )
1022
+ const all = new Map < Id , boolean | null > ( )
1024
1023
const changedPids = new Set < Id > ( idsToUpdate )
1025
1024
const pidById : Record < Id , Id | null > = { }
1026
1025
const childIdsById = new Map < Id | null , Id [ ] > ( )
@@ -1057,7 +1056,7 @@ export function updateCheckedInFlatData<T extends Record<Id, any>>(
1057
1056
hasTrue = true
1058
1057
}
1059
1058
}
1060
- let checked : Checked
1059
+ let checked : boolean | null
1061
1060
if ( hasNull ) {
1062
1061
checked = null
1063
1062
} else if ( hasFalse && hasTrue ) {
@@ -1096,7 +1095,7 @@ export function updateCheckedInTreeData<T extends Record<Id, any>>(
1096
1095
const { idKey : ID , childrenKey : CHILDREN } = options
1097
1096
const checkedIdSet = new Set ( checkedIds )
1098
1097
const idsToUpdate = Array . isArray ( idOrIds ) ? idOrIds : [ idOrIds ] ;
1099
- const all = new Map < Id , Checked > ( )
1098
+ const all = new Map < Id , boolean | null > ( )
1100
1099
const changedPids = new Set < Id > ( idsToUpdate )
1101
1100
const pidById : Record < Id , Id | null > = { }
1102
1101
const childIdsById = new Map < Id | null , Id [ ] > ( )
@@ -1134,7 +1133,7 @@ export function updateCheckedInTreeData<T extends Record<Id, any>>(
1134
1133
hasTrue = true
1135
1134
}
1136
1135
}
1137
- let checked : Checked
1136
+ let checked : boolean | null
1138
1137
if ( hasNull ) {
1139
1138
checked = null
1140
1139
} else if ( hasFalse && hasTrue ) {
0 commit comments