File tree Expand file tree Collapse file tree 2 files changed +24
-4
lines changed Expand file tree Collapse file tree 2 files changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import { SyncDataLoaderFeatureDef } from "./features/sync-data-loader/types";
10
10
import { TreeFeatureDef } from "./features/tree/types" ;
11
11
import { PropMemoizationFeatureDef } from "./features/prop-memoization/types" ;
12
12
import { KeyboardDragAndDropFeatureDef } from "./features/keyboard-drag-and-drop/types" ;
13
+ import type { CheckboxesFeatureDef } from "./features/checkboxes/types" ;
13
14
14
15
export * from "." ;
15
16
@@ -167,3 +168,15 @@ export type TreeFeatureTreeInstance<T> = TreeFeatureDef<T>["treeInstance"];
167
168
/** @interface */
168
169
export type TreeFeatureItemInstance < T > = TreeFeatureDef < T > [ "itemInstance" ] ;
169
170
export type TreeFeatureHotkeys < T > = TreeFeatureDef < T > [ "hotkeys" ] ;
171
+
172
+ /** @interface */
173
+ export type CheckboxesFeatureConfig < T > = CheckboxesFeatureDef < T > [ "config" ] ;
174
+ /** @interface */
175
+ export type CheckboxesFeatureState < T > = CheckboxesFeatureDef < T > [ "state" ] ;
176
+ /** @interface */
177
+ export type CheckboxesFeatureTreeInstance < T > =
178
+ CheckboxesFeatureDef < T > [ "treeInstance" ] ;
179
+ /** @interface */
180
+ export type CheckboxesFeatureItemInstance < T > =
181
+ CheckboxesFeatureDef < T > [ "itemInstance" ] ;
182
+ export type CheckboxesFeatureHotkeys < T > = CheckboxesFeatureDef < T > [ "hotkeys" ] ;
Original file line number Diff line number Diff line change @@ -38,17 +38,24 @@ always be directly inferred from their leafs.
38
38
39
39
:::warning
40
40
41
- Trees with ` propagateCheckedState=true ` is currently only supported for synchronous trees, not trees using the Async
42
- Data Loader feature .
41
+ If you use asynchronous trees with ` propagateCheckedState=true ` , checking an item will trigger loading
42
+ children recursively for all descendants .
43
43
44
44
:::
45
45
46
- The default for ` propagateCheckedState ` is ` true ` for synchronous trees, and ` false ` for asynchronous trees.
47
-
48
46
Below, you can experiment with the behavior for various combinations of ` propagateCheckedState ` and ` canCheckFolders ` :
49
47
50
48
<DemoBox tags = { [" feature/checkbox" ]} initialStory = " react-checkboxes-configurability--configurability" />
51
49
50
+ ## Asynchronous checkbox propagation
51
+
52
+ You can also use checkbox propagation with trees that use async data loaders. If a checkbox is clicked, all nested
53
+ descendants IDs that are not yet loaded will be loaded via the ` getChildren ` or ` getChildrenWithData ` APIs, and
54
+ their checkbox state will be updated accordingly. While they are loading, the state variable ` loadingCheckPropagationItems `
55
+ can be used to render a loading spinner on checkboxes that are loading.
56
+
57
+ <DemoBox tags = { [" feature/checkbox" ]} initialStory = " react-checkboxes-async-configurability--async-configurability" />
58
+
52
59
## Further customizing checkbox behavior
53
60
54
61
Similar to other Headless Tree features, you can customize feature behavior by overwriting any of the publicly
You can’t perform that action at this time.
0 commit comments