react-magma-dom 4.6.0-next.4 → 4.6.0-next.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,5 +24,7 @@ export interface TreeViewContextInterface {
24
24
  setSelectedItemsChanged: React.Dispatch<React.SetStateAction<any>>;
25
25
  treeItemRefArray?: React.MutableRefObject<React.MutableRefObject<Element>[]>;
26
26
  itemToFocus?: string;
27
+ checkParents: boolean;
28
+ checkChildren: boolean;
27
29
  }
28
30
  export declare const TreeViewContext: React.Context<TreeViewContextInterface>;
@@ -49,6 +49,19 @@ export interface UseTreeViewProps {
49
49
  * Example: [ {itemId: 'item0', checkedStatus: IndeterminateCheckboxStatus.indeterminate}, {itemId: 'item0-child', checkedStatus: IndeterminateCheckboxStatus.checked} ]
50
50
  */
51
51
  onSelectedItemChange?: (selectedItems: Array<Object>) => void;
52
+ /**
53
+ * Only affects if selectable mode is TreeViewSelectable.multi.
54
+ * Determines if the parent checkbox will get selected when the user selects all its children checkboxes.
55
+ * When checkParents is enabled, the TreeView displays the indeterminate state of the parent checkboxes too.
56
+ * @default true
57
+ */
58
+ checkParents?: boolean;
59
+ /**
60
+ * Only affects if selectable mode is TreeViewSelectable.multi.
61
+ * Determines if the child checkboxes get selected when the user selects parent checkbox.
62
+ * @default true
63
+ */
64
+ checkChildren?: boolean;
52
65
  children?: React.ReactNode[];
53
66
  }
54
67
  export declare function useTreeView(props: UseTreeViewProps): {
@@ -70,6 +83,8 @@ export declare function useTreeView(props: UseTreeViewProps): {
70
83
  setInitialExpandedItemsNeedUpdate: React.Dispatch<React.SetStateAction<boolean>>;
71
84
  selectedItemsChanged: boolean;
72
85
  setSelectedItemsChanged: React.Dispatch<React.SetStateAction<boolean>>;
86
+ checkChildren: boolean;
87
+ checkParents: boolean;
73
88
  };
74
89
  };
75
90
  export declare type UseTreeViewReturn = ReturnType<typeof useTreeView>;