treege 1.5.0 → 1.5.1
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/CHANGELOG.md +2 -3
- package/dist/features/Treege/Treege.d.ts +1 -1
- package/dist/features/Treege/context/TreegeProvider.d.ts +80 -2
- package/dist/hooks/useTreegeContext/useTreegeContext.d.ts +1 -1
- package/dist/main.d.ts +2 -2
- package/dist/main.js +1289 -1286
- package/dist/main.umd.cjs +24 -24
- package/package.json +1 -1
- package/dist/features/Treege/context/TreegeContext.d.ts +0 -81
- package/dist/features/Treege/index.d.ts +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { TreeNode } from '@tracktor/types-treege';
|
|
2
|
-
import {
|
|
1
|
+
import { CurrentTree, ModalType, TreeNode, TreePath } from '@tracktor/types-treege';
|
|
2
|
+
import { HierarchyPointNode } from 'd3-hierarchy';
|
|
3
|
+
import { ReactNode, ReducerAction, SetStateAction } from 'react';
|
|
3
4
|
import { BackendConfig } from '../../../src/features/Treege/Treege';
|
|
4
5
|
interface TreegeProviderProps {
|
|
5
6
|
children: ReactNode;
|
|
@@ -7,5 +8,82 @@ interface TreegeProviderProps {
|
|
|
7
8
|
initialTreeId?: string;
|
|
8
9
|
backendConfig?: BackendConfig;
|
|
9
10
|
}
|
|
11
|
+
export interface TreeDefaultValue {
|
|
12
|
+
/**
|
|
13
|
+
* This is the backend configuration
|
|
14
|
+
*/
|
|
15
|
+
backendConfig?: BackendConfig;
|
|
16
|
+
/**
|
|
17
|
+
* CurrentHierarchyPointNode is the current node selected
|
|
18
|
+
*/
|
|
19
|
+
currentHierarchyPointNode: null | HierarchyPointNode<TreeNode>;
|
|
20
|
+
/**
|
|
21
|
+
* This is the current tree information
|
|
22
|
+
* {
|
|
23
|
+
* "id": "treeId",
|
|
24
|
+
* "name": "Tree name"
|
|
25
|
+
* }
|
|
26
|
+
*/
|
|
27
|
+
currentTree: CurrentTree;
|
|
28
|
+
/**
|
|
29
|
+
* This is the tree node object
|
|
30
|
+
*/
|
|
31
|
+
tree: null | TreeNode;
|
|
32
|
+
/**
|
|
33
|
+
* This is the tree modal open state
|
|
34
|
+
*/
|
|
35
|
+
treeModalOpen: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* This is the tree path
|
|
38
|
+
* [
|
|
39
|
+
* {
|
|
40
|
+
* "label": "Tree name",
|
|
41
|
+
* "path": "uuid"
|
|
42
|
+
* }
|
|
43
|
+
* ]
|
|
44
|
+
*/
|
|
45
|
+
treePath: TreePath[] | [];
|
|
46
|
+
/**
|
|
47
|
+
* This is the modal open state
|
|
48
|
+
*/
|
|
49
|
+
modalOpen: ModalType;
|
|
50
|
+
/**
|
|
51
|
+
* This is the version of Treege
|
|
52
|
+
*/
|
|
53
|
+
version: string;
|
|
54
|
+
/**
|
|
55
|
+
* This is the tree node dispatch function
|
|
56
|
+
* @param state
|
|
57
|
+
*/
|
|
58
|
+
dispatchTree(state: ReducerAction<any>): void;
|
|
59
|
+
/**
|
|
60
|
+
* This is the function to set the modal open state
|
|
61
|
+
* @param state
|
|
62
|
+
*/
|
|
63
|
+
setCurrentHierarchyPointNode(state: SetStateAction<null | HierarchyPointNode<TreeNode>>): void;
|
|
64
|
+
/**
|
|
65
|
+
* This is the function to set the current tree information
|
|
66
|
+
* Not the node to display tree
|
|
67
|
+
* @param state
|
|
68
|
+
*/
|
|
69
|
+
setCurrentTree(state: SetStateAction<CurrentTree>): void;
|
|
70
|
+
/**
|
|
71
|
+
* This is the function to set the modal open state
|
|
72
|
+
* @param state
|
|
73
|
+
*/
|
|
74
|
+
setModalOpen(state: SetStateAction<ModalType>): void;
|
|
75
|
+
/**
|
|
76
|
+
* This is the function to set the modal open state
|
|
77
|
+
* @param state
|
|
78
|
+
*/
|
|
79
|
+
setTreeModalOpen(state: SetStateAction<boolean>): void;
|
|
80
|
+
/**
|
|
81
|
+
* This is the function to set the tree path
|
|
82
|
+
* @param state
|
|
83
|
+
*/
|
|
84
|
+
setTreePath(state: SetStateAction<TreePath[] | []>): void;
|
|
85
|
+
}
|
|
86
|
+
export declare const treeDefaultValue: TreeDefaultValue;
|
|
87
|
+
export declare const TreegeContext: import('react').Context<TreeDefaultValue>;
|
|
10
88
|
declare const TreegeProvider: ({ children, initialTree, initialTreeId, backendConfig }: TreegeProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
89
|
export default TreegeProvider;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const useTreegeContext: () => import('../../src/features/Treege/context/
|
|
1
|
+
declare const useTreegeContext: () => import('../../src/features/Treege/context/TreegeProvider').TreeDefaultValue;
|
|
2
2
|
export default useTreegeContext;
|
package/dist/main.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { default as Treege } from './src/features/Treege';
|
|
2
|
-
export * from './src/features/Treege';
|
|
1
|
+
export { default as Treege } from './src/features/Treege/Treege';
|
|
2
|
+
export * from './src/features/Treege/Treege';
|
|
3
3
|
export { default as TreePlusIcon } from './src/components/DataDisplay/Icons/TreePlusIcon';
|
|
4
4
|
export * from './src/components/DataDisplay/Icons/TreePlusIcon';
|