react-magma-dom 4.4.0-next.2 → 4.4.0-next.4
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/Tabs/TabScrollSpyPanel.d.ts +10 -0
- package/dist/components/Tabs/Tabs.stories.d.ts +2 -0
- package/dist/components/Tabs/TabsScrollSpyContainer.d.ts +9 -0
- package/dist/components/Tabs/index.d.ts +2 -0
- package/dist/components/Tabs/utils.d.ts +3 -0
- package/dist/components/TreeView/TreeView.stories.d.ts +14 -3
- package/dist/components/TreeView/TreeViewContext.d.ts +3 -3
- package/dist/components/TreeView/useTreeItem.d.ts +2 -2
- package/dist/components/TreeView/useTreeView.d.ts +6 -4
- package/dist/components/TreeView/utils.d.ts +7 -2
- package/dist/esm/index.js +440 -143
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/properties.json +80 -30
- package/dist/react-magma-dom.cjs.development.js +437 -142
- 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
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface TabScrollSpyPanelProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
icon?: React.ReactElement<any> | React.ReactElement<any>[];
|
|
4
|
+
tabLabel: string;
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
testId?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const TabScrollSpyPanel: React.ForwardRefExoticComponent<TabScrollSpyPanelProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -5,5 +5,7 @@ export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("
|
|
|
5
5
|
export declare const Icon: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, TabsProps>;
|
|
6
6
|
export declare const IconOnly: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, TabsProps>;
|
|
7
7
|
export declare const Scrolling: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, TabsProps>;
|
|
8
|
+
export declare const ScrollSpy: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, TabsProps>;
|
|
9
|
+
export declare const ScrollSpyIcons: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, TabsProps>;
|
|
8
10
|
export declare const Inverse: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, TabsProps>;
|
|
9
11
|
export declare const WithDropdown: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, TabsProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface TabsScrollSpyContainerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
isInverse?: boolean;
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
testId?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const TabsScrollSpyContainer: React.ForwardRefExoticComponent<TabsScrollSpyContainerProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TreeViewSelectable } from '.';
|
|
2
|
+
import { IndeterminateCheckboxStatus } from '../..';
|
|
2
3
|
declare const _default: import("@storybook/csf").ComponentAnnotations<import("@storybook/react/types-6-0").ReactFramework, import("@storybook/react/types-6-0").Args>;
|
|
3
4
|
export default _default;
|
|
4
5
|
export declare const Default: {
|
|
@@ -7,7 +8,10 @@ export declare const Default: {
|
|
|
7
8
|
selectable: TreeViewSelectable;
|
|
8
9
|
ariaLabel: string;
|
|
9
10
|
initialExpandedItems: string[];
|
|
10
|
-
initialSelectedItems:
|
|
11
|
+
initialSelectedItems: {
|
|
12
|
+
itemId: string;
|
|
13
|
+
checkedStatus: IndeterminateCheckboxStatus;
|
|
14
|
+
}[];
|
|
11
15
|
testId: string;
|
|
12
16
|
};
|
|
13
17
|
};
|
|
@@ -15,7 +19,10 @@ export declare const NoIcons: {
|
|
|
15
19
|
(args: any): JSX.Element;
|
|
16
20
|
args: {
|
|
17
21
|
initialExpandedItems: string[];
|
|
18
|
-
initialSelectedItems:
|
|
22
|
+
initialSelectedItems: {
|
|
23
|
+
itemId: string;
|
|
24
|
+
checkedStatus: IndeterminateCheckboxStatus;
|
|
25
|
+
}[];
|
|
19
26
|
};
|
|
20
27
|
};
|
|
21
28
|
export declare const Textbook: {
|
|
@@ -44,7 +51,10 @@ export declare const FirstItemLeaf: {
|
|
|
44
51
|
(args: any): JSX.Element;
|
|
45
52
|
args: {
|
|
46
53
|
initialExpandedItems: string[];
|
|
47
|
-
initialSelectedItems:
|
|
54
|
+
initialSelectedItems: {
|
|
55
|
+
itemId: string;
|
|
56
|
+
checkedStatus: IndeterminateCheckboxStatus;
|
|
57
|
+
}[];
|
|
48
58
|
};
|
|
49
59
|
parameters: {
|
|
50
60
|
controls: {
|
|
@@ -63,3 +73,4 @@ export declare const Flat: {
|
|
|
63
73
|
};
|
|
64
74
|
};
|
|
65
75
|
};
|
|
76
|
+
export declare const UnitTest: () => JSX.Element;
|
|
@@ -3,14 +3,14 @@ import { TreeViewSelectable } from './useTreeView';
|
|
|
3
3
|
export interface TreeViewContextInterface {
|
|
4
4
|
children?: React.ReactNode | React.ReactNode[];
|
|
5
5
|
hasIcons: boolean;
|
|
6
|
-
onSelectedItemChange?: (selectedItems:
|
|
6
|
+
onSelectedItemChange?: (selectedItems: Array<Object>) => void;
|
|
7
7
|
onExpandedChange?: (event: React.SyntheticEvent) => void;
|
|
8
8
|
selectable: TreeViewSelectable;
|
|
9
9
|
setHasIcons: React.Dispatch<React.SetStateAction<boolean>>;
|
|
10
|
-
selectedItems: Array<
|
|
10
|
+
selectedItems: Array<Object>;
|
|
11
11
|
setSelectedItems: React.Dispatch<React.SetStateAction<any>>;
|
|
12
12
|
initialExpandedItems: Array<string>;
|
|
13
|
-
initialSelectedItems: Array<
|
|
13
|
+
initialSelectedItems: Array<Object>;
|
|
14
14
|
treeItemRefArray?: React.MutableRefObject<React.MutableRefObject<Element>[]>;
|
|
15
15
|
registerTreeItem: (itemRefArray: React.MutableRefObject<React.MutableRefObject<Element>[]>, itemRef: React.MutableRefObject<Element>) => void;
|
|
16
16
|
}
|
|
@@ -67,11 +67,11 @@ export declare function useTreeItem(props: UseTreeItemProps, forwardedRef: any):
|
|
|
67
67
|
hasOwnTreeItems: boolean;
|
|
68
68
|
itemDepth: number;
|
|
69
69
|
itemId: string;
|
|
70
|
-
numberOfTreeItemChildren:
|
|
70
|
+
numberOfTreeItemChildren: number;
|
|
71
71
|
parentCheckedStatus: IndeterminateCheckboxStatus;
|
|
72
72
|
parentDepth: number;
|
|
73
73
|
ref: (node: any) => void;
|
|
74
|
-
selectedItems:
|
|
74
|
+
selectedItems: Object[];
|
|
75
75
|
setExpanded: React.Dispatch<React.SetStateAction<boolean>>;
|
|
76
76
|
updateCheckedStatusFromChild: (index: number, status: IndeterminateCheckboxStatus) => void;
|
|
77
77
|
treeItemChildren: (string | number | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any>) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal)[];
|
|
@@ -15,7 +15,7 @@ export interface UseTreeViewProps {
|
|
|
15
15
|
* Array list of itemIds of items that should be selected by default
|
|
16
16
|
* * @default [] (no items selected)
|
|
17
17
|
*/
|
|
18
|
-
initialSelectedItems?: Array<
|
|
18
|
+
initialSelectedItems?: Array<Object>;
|
|
19
19
|
isInverse?: boolean;
|
|
20
20
|
/**
|
|
21
21
|
* How many items can be selected in the tree view: single, multi, off
|
|
@@ -40,8 +40,10 @@ export interface UseTreeViewProps {
|
|
|
40
40
|
ariaLabelledBy?: string;
|
|
41
41
|
/**
|
|
42
42
|
* Action that fires when an item is selected
|
|
43
|
+
* Return an array of objects.
|
|
44
|
+
* Example: [ {itemId: 'item0',checkedStatus: IndeterminateCheckboxStatus.indeterminate}, {itemId: 'item0-child', checkedStatus: IndeterminateCheckboxStatus.checked} ]
|
|
43
45
|
*/
|
|
44
|
-
onSelectedItemChange?: (selectedItems:
|
|
46
|
+
onSelectedItemChange?: (selectedItems: Array<Object>) => void;
|
|
45
47
|
/**
|
|
46
48
|
* Action that fires when an item is expanded or collapsed
|
|
47
49
|
*/
|
|
@@ -50,14 +52,14 @@ export interface UseTreeViewProps {
|
|
|
50
52
|
export declare function useTreeView(props: UseTreeViewProps): {
|
|
51
53
|
contextValue: {
|
|
52
54
|
hasIcons: boolean;
|
|
53
|
-
onSelectedItemChange: (selectedItems:
|
|
55
|
+
onSelectedItemChange: (selectedItems: Object[]) => void;
|
|
54
56
|
onExpandedChange: (event: React.SyntheticEvent<Element, Event>) => void;
|
|
55
57
|
selectable: TreeViewSelectable;
|
|
56
58
|
setHasIcons: React.Dispatch<React.SetStateAction<boolean>>;
|
|
57
59
|
selectedItems: any[];
|
|
58
60
|
setSelectedItems: React.Dispatch<React.SetStateAction<any[]>>;
|
|
59
61
|
initialExpandedItems: string[];
|
|
60
|
-
initialSelectedItems:
|
|
62
|
+
initialSelectedItems: Object[];
|
|
61
63
|
treeItemRefArray: React.MutableRefObject<React.MutableRefObject<Element>[]>;
|
|
62
64
|
registerTreeItem: (refArray: React.MutableRefObject<React.MutableRefObject<Element>[]>, ref: React.MutableRefObject<Element>) => void;
|
|
63
65
|
};
|
|
@@ -12,16 +12,21 @@ export declare enum TreeNodeType {
|
|
|
12
12
|
* Branch node - 1st level has 8px of left padding.
|
|
13
13
|
* Each level after that adds 24px of left padding.
|
|
14
14
|
* 8, 32, 56, 80, 104, etc.
|
|
15
|
+
*
|
|
16
|
+
* The label element (the div inside the li) gets additional spacing.
|
|
17
|
+
* In order to highlight the entire line, we need to negate the value for margin.
|
|
15
18
|
*/
|
|
16
|
-
export declare function calculateOffset(type: TreeNodeType, depth?: number,
|
|
19
|
+
export declare function calculateOffset(type: TreeNodeType, depth?: number, labelElem?: boolean, negative?: boolean): string;
|
|
17
20
|
export declare function getTreeItemLabelColor(isInverse: boolean, disabled: boolean, theme: ThemeInterface): string;
|
|
18
21
|
export declare function getTreeItemWrapperCursor(disabled: boolean, selectable: TreeViewSelectable, nodeType: TreeNodeType): "not-allowed" | "pointer" | "default";
|
|
22
|
+
export declare function selectedItemsIncludesId(selectedItems: any, itemId: any): any;
|
|
19
23
|
export declare function getChildrenItemIds(children: any): any[];
|
|
20
24
|
export declare function getAllChildrenEnabled(children: any): boolean;
|
|
21
25
|
export declare function filterSelectedItems(selectedItems: any, childrenIds: any, itemId: any): any;
|
|
22
26
|
export declare function getMissingChildrenIds(selectedItems: any, childrenIds: any): any;
|
|
23
27
|
export declare function getChildrenCheckedStatus(childrenIds: any, status: any): any;
|
|
24
28
|
export declare function getEnabledTreeItemChildrenLength(treeItemChildren: any): any;
|
|
25
|
-
export declare function
|
|
29
|
+
export declare function getUpdatedSelectedItems(selectedItems: any, itemId: any, checkedStatus: any): any;
|
|
30
|
+
export declare function getUniqueSelectedItemsArray(prev: any, initialSelectedItems: any, childrenItemIds?: any[]): any[];
|
|
26
31
|
export declare function getSelectedItemsIndexes(selectedItems: any, treeItemChildren: any): any;
|
|
27
32
|
export declare function getLowestIndexItem(selectedItems: any, treeItemChildren: any): any;
|