@@ -4,7 +4,6 @@ import { VirtualList, VirtualListHandle } from "./VirtualList";
44
55// types ==================================
66export type Id = string | number
7- export type Checked = boolean | null
87export interface Stat < T > {
98 id : Id ,
109 pid : Id | null ,
@@ -21,7 +20,7 @@ export interface Stat<T> {
2120 siblingStats : Stat < T > [ ] ,
2221 _isStat ?: boolean ,
2322 open : boolean ,
24- checked : Checked ,
23+ checked : boolean ,
2524 draggable : boolean ,
2625}
2726
@@ -1020,7 +1019,7 @@ export function updateCheckedInFlatData<T extends Record<Id, any>>(
10201019) {
10211020 const checkedIdSet = new Set ( checkedIds )
10221021 const idsToUpdate = Array . isArray ( idOrIds ) ? idOrIds : [ idOrIds ] ;
1023- const all = new Map < Id , Checked > ( )
1022+ const all = new Map < Id , boolean | null > ( )
10241023 const changedPids = new Set < Id > ( idsToUpdate )
10251024 const pidById : Record < Id , Id | null > = { }
10261025 const childIdsById = new Map < Id | null , Id [ ] > ( )
@@ -1057,7 +1056,7 @@ export function updateCheckedInFlatData<T extends Record<Id, any>>(
10571056 hasTrue = true
10581057 }
10591058 }
1060- let checked : Checked
1059+ let checked : boolean | null
10611060 if ( hasNull ) {
10621061 checked = null
10631062 } else if ( hasFalse && hasTrue ) {
@@ -1096,7 +1095,7 @@ export function updateCheckedInTreeData<T extends Record<Id, any>>(
10961095 const { idKey : ID , childrenKey : CHILDREN } = options
10971096 const checkedIdSet = new Set ( checkedIds )
10981097 const idsToUpdate = Array . isArray ( idOrIds ) ? idOrIds : [ idOrIds ] ;
1099- const all = new Map < Id , Checked > ( )
1098+ const all = new Map < Id , boolean | null > ( )
11001099 const changedPids = new Set < Id > ( idsToUpdate )
11011100 const pidById : Record < Id , Id | null > = { }
11021101 const childIdsById = new Map < Id | null , Id [ ] > ( )
@@ -1134,7 +1133,7 @@ export function updateCheckedInTreeData<T extends Record<Id, any>>(
11341133 hasTrue = true
11351134 }
11361135 }
1137- let checked : Checked
1136+ let checked : boolean | null
11381137 if ( hasNull ) {
11391138 checked = null
11401139 } else if ( hasFalse && hasTrue ) {
0 commit comments