react-magma-dom 4.14.0-next.1 → 4.14.0-next.3
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.
- package/dist/components/Checkbox/index.d.ts +1 -1
- package/dist/components/IndeterminateCheckbox/index.d.ts +1 -1
- package/dist/components/TreeView/TreeViewSelectionContext.d.ts +5 -0
- package/dist/components/TreeView/useTreeItem.d.ts +1 -1
- package/dist/components/TreeView/useTreeView.d.ts +2 -1
- package/dist/esm/index.js +347 -249
- package/dist/esm/index.js.map +1 -1
- package/dist/properties.json +140 -131
- package/dist/react-magma-dom.cjs.development.js +346 -248
- package/dist/react-magma-dom.cjs.development.js.map +1 -1
- package/dist/react-magma-dom.cjs.production.min.js +1 -1
- package/dist/react-magma-dom.cjs.production.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -95,4 +95,4 @@ export declare const StyledFakeInput: import("@emotion/styled").StyledComponent<
|
|
|
95
95
|
textPosition?: CheckboxTextPosition;
|
|
96
96
|
theme?: ThemeInterface;
|
|
97
97
|
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
98
|
-
export declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement
|
|
98
|
+
export declare const Checkbox: React.MemoExoticComponent<React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>>;
|
|
@@ -21,4 +21,4 @@ export declare enum IndeterminateCheckboxStatus {
|
|
|
21
21
|
indeterminate = "indeterminate",
|
|
22
22
|
unchecked = "unchecked"
|
|
23
23
|
}
|
|
24
|
-
export declare const IndeterminateCheckbox: React.ForwardRefExoticComponent<IndeterminateCheckboxProps & React.RefAttributes<HTMLInputElement
|
|
24
|
+
export declare const IndeterminateCheckbox: React.MemoExoticComponent<React.ForwardRefExoticComponent<IndeterminateCheckboxProps & React.RefAttributes<HTMLInputElement>>>;
|
|
@@ -16,6 +16,11 @@ export interface TreeViewItemInterface {
|
|
|
16
16
|
}
|
|
17
17
|
export interface TreeViewSelectionContextInterface {
|
|
18
18
|
items: TreeViewItemInterface[];
|
|
19
|
+
/**
|
|
20
|
+
* O(1) item lookup map keyed by itemId. Built once per items update so
|
|
21
|
+
* TreeItem instances avoid an O(N) `items.find(...)` per render.
|
|
22
|
+
*/
|
|
23
|
+
itemsById: Map<string, TreeViewItemInterface>;
|
|
19
24
|
selectedItems: Array<TreeItemSelectedInterface>;
|
|
20
25
|
selectItem: (data: Pick<TreeViewItemInterface, 'itemId' | 'checkedStatus'>) => void;
|
|
21
26
|
onSelectedItemChange?: (selectedItems: Array<TreeItemSelectedInterface>) => void;
|
|
@@ -83,6 +83,6 @@ export declare function useTreeItem(props: UseTreeItemProps, forwardedRef: any):
|
|
|
83
83
|
treeItemChildren: (string | number | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any>) | (new (props: any) => React.Component<any, any, any>)> | Iterable<React.ReactNode> | React.ReactPortal)[];
|
|
84
84
|
isDisabled: boolean;
|
|
85
85
|
};
|
|
86
|
-
handleClick: (event:
|
|
86
|
+
handleClick: (event: React.SyntheticEvent | React.ChangeEvent, clickedItemId: string) => void;
|
|
87
87
|
handleKeyDown: (event: React.KeyboardEvent) => void;
|
|
88
88
|
};
|
|
@@ -125,6 +125,7 @@ interface ExpandIconStylesProps {
|
|
|
125
125
|
export declare function useTreeView(props: UseTreeViewProps): {
|
|
126
126
|
selectionContextValue: {
|
|
127
127
|
items: TreeViewItemInterface[];
|
|
128
|
+
itemsById: Map<string, TreeViewItemInterface>;
|
|
128
129
|
selectedItems: TreeViewItemInterface[];
|
|
129
130
|
selectItem: ({ itemId, checkedStatus, }: Pick<TreeViewItemInterface, 'itemId'> & Partial<Pick<TreeViewItemInterface, 'checkedStatus'>>) => void;
|
|
130
131
|
onSelectedItemChange: (selectedItems: TreeItemSelectedInterface[]) => void;
|
|
@@ -138,7 +139,7 @@ export declare function useTreeView(props: UseTreeViewProps): {
|
|
|
138
139
|
initialExpandedItems: any[];
|
|
139
140
|
};
|
|
140
141
|
configContextValue: {
|
|
141
|
-
hasIcons:
|
|
142
|
+
hasIcons: boolean;
|
|
142
143
|
selectable: TreeViewSelectable;
|
|
143
144
|
checkParents: boolean;
|
|
144
145
|
checkChildren: boolean;
|