treege 0.1.0 → 0.3.0

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.
Files changed (64) hide show
  1. package/CHANGELOG.md +2 -3
  2. package/README.md +20 -0
  3. package/dist/components/Layouts/Action/Action.d.ts +6 -0
  4. package/dist/components/Layouts/Header/Header.d.ts +6 -0
  5. package/dist/components/Layouts/Main/Main.d.ts +6 -0
  6. package/dist/components/Layouts/MosaicLayout/MosaicLayout.d.ts +6 -0
  7. package/dist/components/Layouts/Sidebar/Sidebar.d.ts +6 -0
  8. package/dist/components/Theme/DarkTheme/DarkTheme.d.ts +6 -0
  9. package/dist/components/UI/Logo/Logo.d.ts +3 -0
  10. package/dist/components/UI/MainModal/MainModal.d.ts +10 -0
  11. package/dist/components/UI/TreeCard/TreeCard.d.ts +15 -0
  12. package/dist/components/UI/TreeForm/TreeForm.d.ts +12 -0
  13. package/dist/components/UI/TreeForm/useTreeForm.d.ts +12 -0
  14. package/dist/components/UI/TreeModal/TreeModal.d.ts +13 -0
  15. package/dist/components/UI/ViewerJSON/ViewerJSON.d.ts +6 -0
  16. package/dist/components/UI/ViewerJSON/useViewerJSON.d.ts +4 -0
  17. package/dist/components/UI/ViewerJSONAction/ViewerJSONAction.d.ts +8 -0
  18. package/dist/components/UI/ViewerJSONAction/useViewerJSONAction.d.ts +5 -0
  19. package/dist/constants/TreeData.d.ts +7 -0
  20. package/dist/constants/fields.d.ts +77 -0
  21. package/dist/constants/theme.d.ts +2 -0
  22. package/dist/favicon.png +0 -0
  23. package/dist/features/Treege/Treege.d.ts +3 -0
  24. package/dist/features/Treege/components/ButtonCreateTree/ButtonCreateTree.d.ts +3 -0
  25. package/dist/features/Treege/components/ButtonCreateTree/useButtonCreateTree.d.ts +4 -0
  26. package/dist/features/Treege/components/Forms/FormTreeCardDelete/FormTreeCardDelete.d.ts +6 -0
  27. package/dist/features/Treege/components/Forms/FormTreeCardDelete/useFormTreeCardDelete.d.ts +5 -0
  28. package/dist/features/Treege/components/Forms/FormTreeCardMutation/FormTreeCardMutation.d.ts +6 -0
  29. package/dist/features/Treege/components/Forms/FormTreeCardMutation/useFormTreeCardMutation.d.ts +45 -0
  30. package/dist/features/Treege/components/TreeCardContainer/TreeCardContainer.d.ts +4 -0
  31. package/dist/features/Treege/components/TreeCardContainer/useTreeCardContainer.d.ts +10 -0
  32. package/dist/features/Treege/components/TreeGrid/TreeGrid.d.ts +3 -0
  33. package/dist/features/Treege/components/TreeGrid/useTreeGrid.d.ts +9 -0
  34. package/dist/features/Treege/context/TreegeContext.d.ts +23 -0
  35. package/dist/features/Treege/context/TreegeProvider.d.ts +6 -0
  36. package/dist/features/Treege/index.d.ts +2 -0
  37. package/dist/features/Treege/reducer/treeReducer.d.ts +25 -0
  38. package/dist/features/Treege/type/TreeNode.d.ts +58 -0
  39. package/dist/locales/en/button.json +5 -0
  40. package/dist/locales/en/form.json +30 -0
  41. package/dist/locales/en/modal.json +6 -0
  42. package/dist/locales/en/translation.json +19 -0
  43. package/dist/locales/fr/button.json +5 -0
  44. package/dist/locales/fr/form.json +30 -0
  45. package/dist/locales/fr/modal.json +6 -0
  46. package/dist/locales/fr/translation.json +19 -0
  47. package/dist/main.d.ts +3 -0
  48. package/dist/main.js +5118 -0
  49. package/dist/main.umd.cjs +103 -0
  50. package/dist/manifest.json +10 -0
  51. package/dist/robots.txt +3 -0
  52. package/dist/types/vite-env.d.ts +3 -0
  53. package/dist/utils/array/index.d.ts +1 -0
  54. package/dist/utils/array/isUniqueArrayItem/isUniqueArrayItem.d.ts +2 -0
  55. package/dist/utils/tree/appendNode/appendNode.d.ts +9 -0
  56. package/dist/utils/tree/getNode/getNode.d.ts +3 -0
  57. package/dist/utils/tree/getNodeByNameInCurrentTree/getNodeByNameInCurrentTree.d.ts +3 -0
  58. package/dist/utils/tree/getNodeNames/getNodeNames.d.ts +3 -0
  59. package/dist/utils/tree/getParentNodeByNameInCurrentTree/getParentNodeByNameInCurrentTree.d.ts +3 -0
  60. package/dist/utils/tree/getTree/getTree.d.ts +3 -0
  61. package/dist/utils/tree/index.d.ts +9 -0
  62. package/dist/utils/tree/removeNode/removeNode.d.ts +8 -0
  63. package/dist/utils/tree/updatedNode/updatedNode.d.ts +9 -0
  64. package/package.json +5 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,4 @@
1
1
  # [Versions](https://github.com/Tracktor/treege/releases)
2
2
 
3
- ## v0.1.0
4
-
5
- - Treege as library
3
+ ## v0.3.0
4
+ - Fix style for library mode
package/README.md CHANGED
@@ -6,6 +6,8 @@
6
6
  <video src="https://user-images.githubusercontent.com/108873902/184317603-61ceafc6-a326-49b2-b0de-ffda9cf9c75e.mov"></video>
7
7
 
8
8
  - [Features](#Features)
9
+ - [Installation](#Installation)
10
+ - [Usage](#Usage)
9
11
  - [Embed Treege anywhere](#Embed-Treege-anywhere)
10
12
  - [Provide data to iframe](#Provide-data-to-iframe)
11
13
  - [Listen Treege event](#Listen-Treege-event)
@@ -31,6 +33,24 @@
31
33
  locally
32
34
  - 🐶 **[Husky](https://typicode.github.io/husky)** - Modern native git hooks made easy
33
35
 
36
+ ## Installation
37
+
38
+ ```console
39
+ yarn add treege
40
+ ```
41
+
42
+ ## Usage
43
+
44
+ ```typescript jsx
45
+ import { Treege } from "treege";
46
+
47
+ const App = () => {
48
+ return <Treege />;
49
+ };
50
+
51
+ export default App;
52
+ ```
53
+
34
54
  ## Embed Treege anywhere
35
55
 
36
56
  #### Treege can be easily embed in any HTML page.
@@ -0,0 +1,6 @@
1
+ import type { ReactNode } from "react";
2
+ interface ActionProps {
3
+ children?: ReactNode;
4
+ }
5
+ declare const Action: ({ children }: ActionProps) => JSX.Element;
6
+ export default Action;
@@ -0,0 +1,6 @@
1
+ import type { ReactNode } from "react";
2
+ interface HeaderProps {
3
+ children?: ReactNode;
4
+ }
5
+ declare const Header: ({ children }: HeaderProps) => JSX.Element;
6
+ export default Header;
@@ -0,0 +1,6 @@
1
+ import type { ReactNode } from "react";
2
+ interface MainProps {
3
+ children?: ReactNode;
4
+ }
5
+ declare const Main: ({ children }: MainProps) => JSX.Element;
6
+ export default Main;
@@ -0,0 +1,6 @@
1
+ import { ReactElement } from "react";
2
+ interface GridLayoutProps {
3
+ children: ReactElement<any, any>[];
4
+ }
5
+ declare const MosaicLayout: ({ children }: GridLayoutProps) => JSX.Element;
6
+ export default MosaicLayout;
@@ -0,0 +1,6 @@
1
+ import type { ReactNode } from "react";
2
+ interface SidebarProps {
3
+ children?: ReactNode;
4
+ }
5
+ declare const Sidebar: ({ children }: SidebarProps) => JSX.Element;
6
+ export default Sidebar;
@@ -0,0 +1,6 @@
1
+ import type { ReactNode } from "react";
2
+ interface DarkThemeProps {
3
+ children?: ReactNode;
4
+ }
5
+ declare const DarkTheme: ({ children }: DarkThemeProps) => JSX.Element;
6
+ export default DarkTheme;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const Logo: () => JSX.Element;
3
+ export default Logo;
@@ -0,0 +1,10 @@
1
+ import type { ReactNode } from "react";
2
+ interface TreeModalProps {
3
+ children?: ReactNode;
4
+ description?: string;
5
+ title?: string;
6
+ open: boolean;
7
+ onClose?(): void;
8
+ }
9
+ declare const MainModal: ({ children, description, open, onClose, title }: TreeModalProps) => JSX.Element;
10
+ export default MainModal;
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ import type { HierarchyPointNode } from "d3-hierarchy";
3
+ import type { CustomNodeElementProps, TreeNodeDatum } from "react-d3-tree/lib/types/common";
4
+ import type { TreeNode } from '../../../features/Treege/type/TreeNode';
5
+ interface TreeCardProps extends Omit<CustomNodeElementProps, "nodeDatum" | "hierarchyPointNode"> {
6
+ nodeDatum: TreeNode | TreeNodeDatum;
7
+ size?: number;
8
+ onAddChildren?(hierarchyPointNode: HierarchyPointNode<TreeNode>): void;
9
+ onEditChildren?(hierarchyPointNode: HierarchyPointNode<TreeNode>): void;
10
+ onDeleteChildren?(hierarchyPointNode: HierarchyPointNode<TreeNode>): void;
11
+ onOpenTreeModal?(hierarchyPointNode: HierarchyPointNode<TreeNode>): void;
12
+ hierarchyPointNode: HierarchyPointNode<TreeNode>;
13
+ }
14
+ declare const _default: import("react").MemoExoticComponent<({ nodeDatum, onAddChildren, onEditChildren, onDeleteChildren, onOpenTreeModal, hierarchyPointNode, size, }: TreeCardProps) => JSX.Element>;
15
+ export default _default;
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import type { TreeRenderCustomNodeElementFn } from '../../../features/Treege/type/TreeNode';
3
+ interface TreeFormProps {
4
+ data: any;
5
+ nodeSize?: {
6
+ x: number;
7
+ y: number;
8
+ };
9
+ renderCustomNodeElement?: TreeRenderCustomNodeElementFn;
10
+ }
11
+ declare const _default: import("react").MemoExoticComponent<({ data, renderCustomNodeElement, nodeSize, }: TreeFormProps) => JSX.Element | null>;
12
+ export default _default;
@@ -0,0 +1,12 @@
1
+ declare const useTreeForm: () => {
2
+ dimensions: {
3
+ height: number;
4
+ width: number;
5
+ };
6
+ refContainer: (ref: null | Element) => Element | null;
7
+ translate: {
8
+ x: number;
9
+ y: number;
10
+ };
11
+ };
12
+ export default useTreeForm;
@@ -0,0 +1,13 @@
1
+ import { TransitionProps } from "design-system-tracktor";
2
+ import { ReactElement, ReactNode } from "react";
3
+ interface TreeModalProps {
4
+ children?: ReactNode;
5
+ title?: string;
6
+ open: boolean;
7
+ onClose?(): void;
8
+ }
9
+ export declare const TransitionRef: import("react").ForwardRefExoticComponent<{
10
+ children: ReactElement;
11
+ } & TransitionProps & import("react").RefAttributes<unknown>>;
12
+ declare const TreeModal: ({ children, open, onClose, title }: TreeModalProps) => JSX.Element;
13
+ export default TreeModal;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ interface ViewerJSONProps {
3
+ value: any;
4
+ }
5
+ declare const ViewerJSON: ({ value }: ViewerJSONProps) => JSX.Element;
6
+ export default ViewerJSON;
@@ -0,0 +1,4 @@
1
+ declare const useViewerJSON: () => {
2
+ formatJSON: (value: any) => string;
3
+ };
4
+ export default useViewerJSON;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ interface ViewerJSONProps {
3
+ value: any;
4
+ downloadedFileName?: string;
5
+ onSave?(): void;
6
+ }
7
+ declare const ViewerJSONAction: ({ downloadedFileName, onSave, value }: ViewerJSONProps) => JSX.Element;
8
+ export default ViewerJSONAction;
@@ -0,0 +1,5 @@
1
+ declare const useViewerJSONAction: () => {
2
+ formatJSON: (value: any) => string;
3
+ getDownloadLink: (value: any) => string;
4
+ };
5
+ export default useViewerJSONAction;
@@ -0,0 +1,7 @@
1
+ import type { TreeNode } from '../features/Treege/type/TreeNode';
2
+ declare const TreeData: {
3
+ id: string;
4
+ label: string;
5
+ value: TreeNode;
6
+ }[];
7
+ export default TreeData;
@@ -0,0 +1,77 @@
1
+ declare const fields: readonly [{
2
+ readonly isBooleanField: false;
3
+ readonly isDecisionField: false;
4
+ readonly isRequiredDisabled: false;
5
+ readonly type: "text";
6
+ }, {
7
+ readonly isBooleanField: false;
8
+ readonly isDecisionField: false;
9
+ readonly isRequiredDisabled: false;
10
+ readonly type: "number";
11
+ }, {
12
+ readonly isBooleanField: false;
13
+ readonly isDecisionField: false;
14
+ readonly isRequiredDisabled: false;
15
+ readonly type: "email";
16
+ }, {
17
+ readonly isBooleanField: false;
18
+ readonly isDecisionField: false;
19
+ readonly isRequiredDisabled: false;
20
+ readonly type: "file";
21
+ }, {
22
+ readonly isBooleanField: false;
23
+ readonly isDecisionField: false;
24
+ readonly isRequiredDisabled: false;
25
+ readonly type: "password";
26
+ }, {
27
+ readonly isBooleanField: false;
28
+ readonly isDecisionField: false;
29
+ readonly isRequiredDisabled: false;
30
+ readonly type: "tel";
31
+ }, {
32
+ readonly isBooleanField: false;
33
+ readonly isDecisionField: false;
34
+ readonly isRequiredDisabled: false;
35
+ readonly type: "address";
36
+ }, {
37
+ readonly isBooleanField: false;
38
+ readonly isDecisionField: false;
39
+ readonly isRequiredDisabled: false;
40
+ readonly type: "url";
41
+ }, {
42
+ readonly isBooleanField: false;
43
+ readonly isDecisionField: false;
44
+ readonly isRequiredDisabled: false;
45
+ readonly type: "date";
46
+ }, {
47
+ readonly isBooleanField: false;
48
+ readonly isDecisionField: false;
49
+ readonly isRequiredDisabled: false;
50
+ readonly type: "time";
51
+ }, {
52
+ readonly isBooleanField: true;
53
+ readonly isDecisionField: false;
54
+ readonly isRequiredDisabled: true;
55
+ readonly type: "switch";
56
+ }, {
57
+ readonly isBooleanField: true;
58
+ readonly isDecisionField: false;
59
+ readonly isRequiredDisabled: true;
60
+ readonly type: "checkbox";
61
+ }, {
62
+ readonly isBooleanField: false;
63
+ readonly isDecisionField: true;
64
+ readonly isRequiredDisabled: false;
65
+ readonly type: "radio";
66
+ }, {
67
+ readonly isBooleanField: false;
68
+ readonly isDecisionField: true;
69
+ readonly isRequiredDisabled: false;
70
+ readonly type: "select";
71
+ }, {
72
+ readonly isBooleanField: false;
73
+ readonly isDecisionField: false;
74
+ readonly isRequiredDisabled: true;
75
+ readonly type: "tree";
76
+ }];
77
+ export default fields;
@@ -0,0 +1,2 @@
1
+ declare const darkTheme: import("design-system-tracktor").Theme;
2
+ export default darkTheme;
Binary file
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const Treege: () => JSX.Element;
3
+ export default Treege;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const ButtonCreateTree: () => JSX.Element;
3
+ export default ButtonCreateTree;
@@ -0,0 +1,4 @@
1
+ declare const useButtonCreateTree: () => {
2
+ handleClick: () => void;
3
+ };
4
+ export default useButtonCreateTree;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ interface FormTreeCardMutationProps {
3
+ onClose?(): void;
4
+ }
5
+ declare const FormTreeCardDelete: ({ onClose }: FormTreeCardMutationProps) => JSX.Element;
6
+ export default FormTreeCardDelete;
@@ -0,0 +1,5 @@
1
+ import { FormEvent } from "react";
2
+ declare const useFormTreeCardDelete: () => {
3
+ handleSubmit: (e: FormEvent) => void;
4
+ };
5
+ export default useFormTreeCardDelete;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ interface FormTreeCardMutationProps {
3
+ onClose?(): void;
4
+ }
5
+ declare const FormTreeCardMutation: ({ onClose }: FormTreeCardMutationProps) => JSX.Element;
6
+ export default FormTreeCardMutation;
@@ -0,0 +1,45 @@
1
+ import type { SelectChangeEvent } from "design-system-tracktor";
2
+ import { ChangeEvent, FormEvent } from "react";
3
+ import type { TreeNodeField } from '../../../../../features/Treege/type/TreeNode';
4
+ declare const useFormTreeCardMutation: () => {
5
+ getDisabledValueField: (index: number) => boolean;
6
+ handleAddValue: () => void;
7
+ handleChangeHelperText: (event: ChangeEvent<HTMLInputElement>) => void;
8
+ handleChangeIsDecisionField: (event: ChangeEvent<HTMLInputElement>) => void;
9
+ handleChangeLabel: (event: ChangeEvent<HTMLInputElement>) => void;
10
+ handleChangeMessage: (nameMessage: "on" | "off") => (event: ChangeEvent<HTMLInputElement>) => void;
11
+ handleChangeName: (event: ChangeEvent<HTMLInputElement>) => void;
12
+ handleChangeOptionLabel: (event: ChangeEvent<HTMLInputElement>) => void;
13
+ handleChangeOptionMessage: (event: ChangeEvent<HTMLInputElement>) => void;
14
+ handleChangeOptionValue: (event: ChangeEvent<HTMLInputElement>) => void;
15
+ handleChangeRequired: (event: ChangeEvent<HTMLInputElement>) => void;
16
+ handleChangeStep: (event: ChangeEvent<HTMLInputElement>) => void;
17
+ handleChangeTreeSelect: (event: SelectChangeEvent<string>) => void;
18
+ handleChangeType: (event: SelectChangeEvent<TreeNodeField["type"]>) => void;
19
+ handleDeleteValue: (idToDelete: string) => void;
20
+ handleSubmit: (e: FormEvent) => void;
21
+ helperText: string;
22
+ isBooleanField: boolean;
23
+ isDecision: boolean;
24
+ isDecisionField: boolean;
25
+ isRequiredDisabled: boolean;
26
+ isTree: boolean;
27
+ label: string;
28
+ messages: {
29
+ off: string;
30
+ on: string;
31
+ };
32
+ name: string;
33
+ required: boolean;
34
+ step: string;
35
+ treeSelect: string;
36
+ type: "number" | "text" | "email" | "file" | "password" | "tel" | "address" | "url" | "date" | "time" | "switch" | "checkbox" | "radio" | "select" | "tree";
37
+ uniqueNameErrorMessage: string;
38
+ values: {
39
+ id: string;
40
+ label: string;
41
+ value: string;
42
+ message?: string | undefined;
43
+ }[];
44
+ };
45
+ export default useFormTreeCardMutation;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import type { TreeCustomNodeElementProps } from '../../../../features/Treege/type/TreeNode';
3
+ declare const TreeCardContainer: ({ nodeDatum, hierarchyPointNode, toggleNode, onNodeClick, onNodeMouseOver, onNodeMouseOut, }: TreeCustomNodeElementProps) => JSX.Element;
4
+ export default TreeCardContainer;
@@ -0,0 +1,10 @@
1
+ import type { HierarchyPointNode } from "d3-hierarchy";
2
+ import type { TreeNode } from '../../../../features/Treege/type/TreeNode';
3
+ declare const useTreeCardContainer: () => {
4
+ handleAddChildren: (hierarchyPointNode: HierarchyPointNode<TreeNode>) => void;
5
+ handleCloseTreeModal: () => void;
6
+ handleDeleteChildren: (hierarchyPointNode: HierarchyPointNode<TreeNode>) => void;
7
+ handleEditChildren: (hierarchyPointNode: HierarchyPointNode<TreeNode>) => void;
8
+ handleOpenTreeModal: (hierarchyPointNode: HierarchyPointNode<TreeNode>) => void;
9
+ };
10
+ export default useTreeCardContainer;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const TreeGrid: () => JSX.Element;
3
+ export default TreeGrid;
@@ -0,0 +1,9 @@
1
+ declare const useTreeGrid: () => {
2
+ closeModal: () => void;
3
+ getTitleModalDelete: () => string;
4
+ getTitleModalMutation: () => string;
5
+ handleOnSave: () => void;
6
+ isDeleteModal: boolean;
7
+ isModalMutationOpen: boolean;
8
+ };
9
+ export default useTreeGrid;
@@ -0,0 +1,23 @@
1
+ import type { HierarchyPointNode } from "d3-hierarchy";
2
+ import { ReducerAction, SetStateAction } from "react";
3
+ import type { TreeNode } from '../../../features/Treege/type/TreeNode';
4
+ declare type ModalType = "add" | "edit" | "delete" | null;
5
+ declare type TreePath = {
6
+ path: string;
7
+ label: string;
8
+ };
9
+ export interface TreeDefaultValue {
10
+ currentHierarchyPointNode: null | HierarchyPointNode<TreeNode>;
11
+ dispatchTree(state: ReducerAction<any>): void;
12
+ modalOpen: ModalType;
13
+ setCurrentHierarchyPointNode(state: SetStateAction<null | HierarchyPointNode<TreeNode>>): void;
14
+ setModalOpen(state: SetStateAction<ModalType>): void;
15
+ setTreeModalOpen(state: SetStateAction<boolean>): void;
16
+ setTreePath(state: SetStateAction<TreePath[] | []>): void;
17
+ treeModalOpen: boolean;
18
+ treePath: TreePath[] | [];
19
+ tree: null | TreeNode;
20
+ }
21
+ export declare const treeDefaultValue: TreeDefaultValue;
22
+ export declare const TreegeContext: import("react").Context<TreeDefaultValue>;
23
+ export {};
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from "react";
2
+ interface TreegeProviderProps {
3
+ children: ReactNode;
4
+ }
5
+ declare const TreegeProvider: ({ children }: TreegeProviderProps) => JSX.Element;
6
+ export default TreegeProvider;
@@ -0,0 +1,2 @@
1
+ import Treege from "./Treege";
2
+ export default Treege;
@@ -0,0 +1,25 @@
1
+ import type { TreeNode } from '../../../features/Treege/type/TreeNode';
2
+ export declare const treeReducerActionType: {
3
+ readonly appendTreeCard: "appendTreeCard";
4
+ readonly deleteTreeCard: "deleteTreeCard";
5
+ readonly replaceTreeCard: "replaceTreeCard";
6
+ };
7
+ export declare const appendTreeCard: (path: string | null, name: string, children: TreeNode) => {
8
+ children: TreeNode;
9
+ name: string;
10
+ path: string | null;
11
+ type: "appendTreeCard";
12
+ };
13
+ export declare const replaceTreeCard: (path: string | null, name: string, children: TreeNode) => {
14
+ children: TreeNode;
15
+ name: string;
16
+ path: string | null;
17
+ type: "replaceTreeCard";
18
+ };
19
+ export declare const deleteTreeCard: (path: string | "", name: string) => {
20
+ name: string;
21
+ path: string;
22
+ type: "deleteTreeCard";
23
+ };
24
+ declare const treeReducer: (tree: TreeNode, action: any) => any;
25
+ export default treeReducer;
@@ -0,0 +1,58 @@
1
+ /// <reference types="react" />
2
+ import type { HierarchyPointNode } from "d3-hierarchy";
3
+ import type { CustomNodeElementProps, RawNodeDatum } from "react-d3-tree/lib/types/common";
4
+ import type fields from '../../../constants/fields';
5
+ export interface TreeValues {
6
+ id: string;
7
+ label: string;
8
+ value: string;
9
+ message?: string;
10
+ }
11
+ export interface TreeNodeField {
12
+ depth: number;
13
+ helperText?: string;
14
+ messages?: {
15
+ on?: string;
16
+ off?: string;
17
+ };
18
+ isDecision?: boolean;
19
+ isLeaf?: boolean;
20
+ isRoot?: boolean;
21
+ label: string;
22
+ required?: boolean;
23
+ step?: string;
24
+ type: typeof fields[number]["type"];
25
+ value?: never;
26
+ values?: TreeValues[];
27
+ message?: never;
28
+ tree?: TreeNode;
29
+ treePath?: string;
30
+ }
31
+ export interface TreeNodeValues {
32
+ depth: number;
33
+ helperText?: string;
34
+ messages?: never;
35
+ isDecision?: never;
36
+ isLeaf?: boolean;
37
+ isRoot?: never;
38
+ label: string;
39
+ required?: never;
40
+ step?: never;
41
+ type?: never;
42
+ value: string;
43
+ values?: never;
44
+ message?: string;
45
+ tree?: never;
46
+ treePath?: never;
47
+ }
48
+ export declare type TreeNodeAttributes = TreeNodeField | TreeNodeValues;
49
+ export interface TreeNode extends Omit<RawNodeDatum, "attributes" | "children"> {
50
+ name: string;
51
+ attributes: TreeNodeAttributes;
52
+ children: TreeNode[];
53
+ treeId?: string;
54
+ }
55
+ export interface TreeCustomNodeElementProps extends Omit<CustomNodeElementProps, "hierarchyPointNode"> {
56
+ hierarchyPointNode: HierarchyPointNode<TreeNode>;
57
+ }
58
+ export declare type TreeRenderCustomNodeElementFn = (rd3tNodeProps: TreeCustomNodeElementProps) => JSX.Element;
@@ -0,0 +1,5 @@
1
+ {
2
+ "createTree": "Create Tree",
3
+ "downloadJSONFile": "Download JSON File",
4
+ "save": "Save"
5
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "decisionFields": "Decision fields",
3
+ "helperText": "Helper text",
4
+ "label": "Label",
5
+ "mustBeUnique": "Must be unique",
6
+ "offMessage": "Message (disable)",
7
+ "onMessage": "Message (enable)",
8
+ "staticFields": "Static fields",
9
+ "step": "Step",
10
+ "tree": "Tree",
11
+ "type": {
12
+ "address": "Address",
13
+ "checkbox": "Checkbox",
14
+ "date": "Date",
15
+ "email": "Email",
16
+ "file": "File",
17
+ "number": "Number",
18
+ "password": "Password",
19
+ "radio": "Radio",
20
+ "select": "Select",
21
+ "switch": "Switch",
22
+ "tel": "Tel",
23
+ "time": "Time",
24
+ "text": "Text",
25
+ "tree": "Tree",
26
+ "url": "URL"
27
+ },
28
+ "value": "Value",
29
+ "values": "Values"
30
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "addFirstTitle": "Add a field",
3
+ "addTitle": "Add a field to « {{name}} »",
4
+ "deleteTitle": "Are you sure to delete « {{name}} »",
5
+ "editTitle": "Edit field « {{name}} »"
6
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "add": "Add",
3
+ "cancel": "Cancel",
4
+ "disabled": "Disabled",
5
+ "edit": "Edit",
6
+ "isALeaf": "Is a leaf",
7
+ "isABranch": "Is a branch",
8
+ "isATree": "Is a tree",
9
+ "isTheRoot": "Is the root",
10
+ "label": "Label",
11
+ "name": "Name",
12
+ "remove": "Remove",
13
+ "required": "Required",
14
+ "show": "Show",
15
+ "type": "Type",
16
+ "validate": "Validate",
17
+ "value": "Value",
18
+ "values": "Values"
19
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "createTree": "Créer un arbre",
3
+ "downloadJSONFile": "Télécharger le fichier JSON",
4
+ "save": "Enregistrer"
5
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "decisionField": "Champs de décision",
3
+ "helperText": "Texte d'information",
4
+ "label": "Label",
5
+ "mustBeUnique": "Doit être unique",
6
+ "offMessage": "Message (désactiver)",
7
+ "onMessage": "Message (activer)",
8
+ "staticFields": "Champs statiques",
9
+ "step": "Étape",
10
+ "tree": "Arbre",
11
+ "type": {
12
+ "address": "Adresse",
13
+ "checkbox": "Case à cocher",
14
+ "date": "Date",
15
+ "email": "Email",
16
+ "file": "Fichier",
17
+ "number": "Nombre",
18
+ "password": "Mot de passe",
19
+ "radio": "Radio",
20
+ "select": "Select",
21
+ "switch": "Switch",
22
+ "tel": "Téléphone",
23
+ "time": "Temps",
24
+ "text": "Texte",
25
+ "tree": "Arbre",
26
+ "url": "URL"
27
+ },
28
+ "value": "Valeur",
29
+ "values": "Valeurs"
30
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "addFirstTitle": "Ajouter un champ",
3
+ "addTitle": "Ajouter un champ à « {{name}} »",
4
+ "deleteTitle": "Voulez vraiment supprimer « {{name}} »",
5
+ "editTitle": "Éditer le champ « {{name}} »"
6
+ }