treege 0.14.0 → 0.16.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.
- package/CHANGELOG.md +2 -3
- package/dist/main.js +3084 -2852
- package/dist/main.umd.cjs +37 -37
- package/dist/src/constants/fields.d.ts +7 -0
- package/dist/src/features/Treege/components/DynamicSelectFieldFromTree/DynamicSelectFieldFromTree.d.ts +8 -0
- package/dist/src/features/Treege/components/DynamicSelectFieldFromTree/index.d.ts +3 -0
- package/dist/src/features/Treege/components/DynamicSelectWarning/DynamicSelectWarning.d.ts +5 -0
- package/dist/src/features/Treege/components/DynamicSelectWarning/index.d.ts +3 -0
- package/dist/src/features/Treege/components/FieldSelect/useFieldSelect.d.ts +7 -0
- package/dist/src/features/Treege/components/Forms/FormTreeCardMutation/useFormTreeCardMutation.d.ts +9 -2
- package/dist/src/features/Treege/type/TreeNode.d.ts +3 -1
- package/dist/src/locales/en/form-en.d.ts +11 -0
- package/dist/src/locales/en/translation-en.d.ts +2 -0
- package/dist/src/locales/fr/form-fr.d.ts +11 -0
- package/dist/src/locales/fr/translation-fr.d.ts +2 -0
- package/dist/src/utils/tree/appendNode/appendNode.d.ts +3 -1
- package/package.json +1 -1
|
@@ -19,6 +19,7 @@ declare const fields: readonly [{
|
|
|
19
19
|
}, {
|
|
20
20
|
readonly isBooleanField: false;
|
|
21
21
|
readonly isDecisionField: false;
|
|
22
|
+
readonly isMultiple: false;
|
|
22
23
|
readonly isRepeatableDisabled: false;
|
|
23
24
|
readonly isRequiredDisabled: false;
|
|
24
25
|
readonly type: "file";
|
|
@@ -106,5 +107,11 @@ declare const fields: readonly [{
|
|
|
106
107
|
readonly isRepeatableDisabled: true;
|
|
107
108
|
readonly isRequiredDisabled: false;
|
|
108
109
|
readonly type: "autocomplete";
|
|
110
|
+
}, {
|
|
111
|
+
readonly isBooleanField: false;
|
|
112
|
+
readonly isDecisionField: false;
|
|
113
|
+
readonly isRepeatableDisabled: false;
|
|
114
|
+
readonly isRequiredDisabled: false;
|
|
115
|
+
readonly type: "dynamicSelect";
|
|
109
116
|
}];
|
|
110
117
|
export default fields;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SelectChangeEvent } from "@tracktor/design-system";
|
|
2
|
+
interface DynamicSelectFieldFromTreeProps {
|
|
3
|
+
value: string | null;
|
|
4
|
+
onChange?: (event: SelectChangeEvent<string | undefined>, newValue: string | undefined) => void;
|
|
5
|
+
currentName: string;
|
|
6
|
+
}
|
|
7
|
+
declare const DynamicSelectFieldFromTree: ({ value, onChange, currentName }: DynamicSelectFieldFromTreeProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default DynamicSelectFieldFromTree;
|
|
@@ -20,6 +20,7 @@ declare const useFieldSelect: () => {
|
|
|
20
20
|
} | {
|
|
21
21
|
readonly isBooleanField: false;
|
|
22
22
|
readonly isDecisionField: false;
|
|
23
|
+
readonly isMultiple: false;
|
|
23
24
|
readonly isRepeatableDisabled: false;
|
|
24
25
|
readonly isRequiredDisabled: false;
|
|
25
26
|
readonly type: "file";
|
|
@@ -107,6 +108,12 @@ declare const useFieldSelect: () => {
|
|
|
107
108
|
readonly isRepeatableDisabled: true;
|
|
108
109
|
readonly isRequiredDisabled: false;
|
|
109
110
|
readonly type: "autocomplete";
|
|
111
|
+
} | {
|
|
112
|
+
readonly isBooleanField: false;
|
|
113
|
+
readonly isDecisionField: false;
|
|
114
|
+
readonly isRepeatableDisabled: false;
|
|
115
|
+
readonly isRequiredDisabled: false;
|
|
116
|
+
readonly type: "dynamicSelect";
|
|
110
117
|
})[];
|
|
111
118
|
};
|
|
112
119
|
export default useFieldSelect;
|
package/dist/src/features/Treege/components/Forms/FormTreeCardMutation/useFormTreeCardMutation.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SelectChangeEvent } from "@tracktor/design-system";
|
|
2
2
|
import { ChangeEvent, FormEvent, MouseEvent, SyntheticEvent } from "react";
|
|
3
|
-
import type {
|
|
3
|
+
import type { Params, Route, TreeNodeField } from '../../../../../features/Treege/type/TreeNode';
|
|
4
4
|
declare const useFormTreeCardMutation: () => {
|
|
5
5
|
getDisabledValueField: (index: number) => boolean;
|
|
6
6
|
handleAddParams: () => void;
|
|
@@ -10,11 +10,13 @@ declare const useFormTreeCardMutation: () => {
|
|
|
10
10
|
handleChangeIsDecisionField: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
11
11
|
handleChangeLabel: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
12
12
|
handleChangeMessage: (nameMessage: "on" | "off") => (event: ChangeEvent<HTMLInputElement>) => void;
|
|
13
|
+
handleChangeMultiple: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
13
14
|
handleChangeName: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
14
15
|
handleChangeOptionLabel: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
15
16
|
handleChangeOptionMessage: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
16
17
|
handleChangeOptionValue: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
17
18
|
handleChangeParam: (index: number, property: keyof Params, event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
19
|
+
handleChangeParentRef: (_: SelectChangeEvent<string | undefined>, newValue: string | undefined) => void;
|
|
18
20
|
handleChangePath: <T extends HTMLInputElement | HTMLTextAreaElement>(property: string, event: ChangeEvent<T>) => void;
|
|
19
21
|
handleChangeRepeatable: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
20
22
|
handleChangeRequired: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
@@ -27,6 +29,7 @@ declare const useFormTreeCardMutation: () => {
|
|
|
27
29
|
handleChangeTreeSelect: (event: SelectChangeEvent) => void;
|
|
28
30
|
handleChangeType: (event: SelectChangeEvent<TreeNodeField["type"]>) => void;
|
|
29
31
|
handleChangeUrl: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
32
|
+
handleChangeUrlSelect: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
30
33
|
handleDeleteParam: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
31
34
|
handleDeleteValue: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
32
35
|
handleSubmit: (e: FormEvent) => Promise<void>;
|
|
@@ -36,9 +39,12 @@ declare const useFormTreeCardMutation: () => {
|
|
|
36
39
|
isBooleanField: boolean;
|
|
37
40
|
isDecision: boolean;
|
|
38
41
|
isDecisionField: boolean;
|
|
42
|
+
isDynamicSelect: boolean;
|
|
39
43
|
isEditModal: boolean;
|
|
40
44
|
isHiddenField: boolean;
|
|
41
45
|
isLeaf: boolean;
|
|
46
|
+
isMultiple: boolean;
|
|
47
|
+
isMultiplePossible: boolean;
|
|
42
48
|
isRepeatableDisabled: boolean;
|
|
43
49
|
isRequiredDisabled: boolean;
|
|
44
50
|
isTreeField: boolean;
|
|
@@ -49,13 +55,14 @@ declare const useFormTreeCardMutation: () => {
|
|
|
49
55
|
on: string;
|
|
50
56
|
};
|
|
51
57
|
name: string;
|
|
58
|
+
parentRef: string | null;
|
|
52
59
|
repeatable: boolean;
|
|
53
60
|
required: boolean;
|
|
54
61
|
route: Route;
|
|
55
62
|
step: string;
|
|
56
63
|
tag: string | null;
|
|
57
64
|
treeSelected: string;
|
|
58
|
-
type: "number" | "text" | "address" | "select" | "time" | "switch" | "hidden" | "email" | "file" | "password" | "tel" | "url" | "date" | "dateRange" | "checkbox" | "tree" | "radio" | "autocomplete";
|
|
65
|
+
type: "number" | "text" | "address" | "select" | "time" | "switch" | "hidden" | "email" | "file" | "password" | "tel" | "url" | "date" | "dateRange" | "checkbox" | "tree" | "radio" | "autocomplete" | "dynamicSelect";
|
|
59
66
|
uniqueNameErrorMessage: string;
|
|
60
67
|
values: {
|
|
61
68
|
id: string;
|
|
@@ -21,7 +21,7 @@ export interface PathKey {
|
|
|
21
21
|
}
|
|
22
22
|
export interface Route {
|
|
23
23
|
url: string;
|
|
24
|
-
searchKey
|
|
24
|
+
searchKey?: string;
|
|
25
25
|
pathKey?: PathKey;
|
|
26
26
|
params?: Params[];
|
|
27
27
|
}
|
|
@@ -50,6 +50,7 @@ export interface TreeNode extends Omit<RawNodeDatum, "attributes" | "children">
|
|
|
50
50
|
repeatable?: boolean;
|
|
51
51
|
hiddenValue?: string;
|
|
52
52
|
route?: Route;
|
|
53
|
+
parentRef?: string;
|
|
53
54
|
} | {
|
|
54
55
|
depth: number;
|
|
55
56
|
tag?: string;
|
|
@@ -70,6 +71,7 @@ export interface TreeNode extends Omit<RawNodeDatum, "attributes" | "children">
|
|
|
70
71
|
repeatable?: never;
|
|
71
72
|
hiddenValue?: never;
|
|
72
73
|
route?: Route;
|
|
74
|
+
parentRef?: string;
|
|
73
75
|
};
|
|
74
76
|
children: TreeNode[];
|
|
75
77
|
treeId?: string;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
declare const FORM_EN: {
|
|
2
|
+
readonly additionalParams: "Additional parameters";
|
|
3
|
+
readonly ancestor: "Ancestor";
|
|
2
4
|
readonly apiRoute: "Api route";
|
|
5
|
+
readonly dataMapping: "Data mapping";
|
|
3
6
|
readonly decisionField: "Decision field";
|
|
4
7
|
readonly helperText: "Helper text";
|
|
5
8
|
readonly hiddenValue: "Hidden value";
|
|
6
9
|
readonly label: "Label";
|
|
7
10
|
readonly mustBeUnique: "Must be unique";
|
|
8
11
|
readonly newTree: "Nouvel arbre";
|
|
12
|
+
readonly noAncestorFound: "No parents found";
|
|
9
13
|
readonly offMessage: "Message (disable)";
|
|
10
14
|
readonly onMessage: "Message (enable)";
|
|
11
15
|
readonly repeatable: "Repeatable";
|
|
@@ -19,6 +23,7 @@ declare const FORM_EN: {
|
|
|
19
23
|
readonly checkbox: "Checkbox";
|
|
20
24
|
readonly date: "Date";
|
|
21
25
|
readonly dateRange: "Date range";
|
|
26
|
+
readonly dynamicSelect: "Dynamic select";
|
|
22
27
|
readonly email: "Email";
|
|
23
28
|
readonly file: "File";
|
|
24
29
|
readonly hidden: "Hidden field";
|
|
@@ -33,11 +38,17 @@ declare const FORM_EN: {
|
|
|
33
38
|
readonly tree: "Tree";
|
|
34
39
|
readonly url: "URL";
|
|
35
40
|
};
|
|
41
|
+
readonly urlConstruction: "URL construction";
|
|
36
42
|
readonly value: "Value";
|
|
37
43
|
readonly values: "Values";
|
|
38
44
|
readonly warningApiAutocomplete: {
|
|
39
45
|
readonly response: "should have as a response";
|
|
40
46
|
readonly url: "The API Route";
|
|
41
47
|
};
|
|
48
|
+
readonly warningApiSelect: {
|
|
49
|
+
readonly response: "at the location specified in the API URL.";
|
|
50
|
+
readonly url: "To automatically include the parent value in the API URL: add";
|
|
51
|
+
readonly warning: "{{}}";
|
|
52
|
+
};
|
|
42
53
|
};
|
|
43
54
|
export default FORM_EN;
|
|
@@ -10,7 +10,9 @@ declare const TRANSLATION_EN: {
|
|
|
10
10
|
readonly isATree: "Is a tree";
|
|
11
11
|
readonly isTheRoot: "Is the root";
|
|
12
12
|
readonly label: "Label";
|
|
13
|
+
readonly multiple: "Multiple";
|
|
13
14
|
readonly name: "Name";
|
|
15
|
+
readonly parentRef: "Parent element";
|
|
14
16
|
readonly remove: "Remove";
|
|
15
17
|
readonly required: "Required";
|
|
16
18
|
readonly save: "Save";
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
declare const FORM_FR: {
|
|
2
|
+
readonly additionalParams: "Paramètres additionnels";
|
|
3
|
+
readonly ancestor: "Ancêtre";
|
|
2
4
|
readonly apiRoute: "Api route";
|
|
5
|
+
readonly dataMapping: "Mapping de données";
|
|
3
6
|
readonly decisionField: "Champs de décision";
|
|
4
7
|
readonly helperText: "Texte d'information";
|
|
5
8
|
readonly hiddenValue: "Valeur caché";
|
|
6
9
|
readonly label: "Label";
|
|
7
10
|
readonly mustBeUnique: "Doit être unique";
|
|
8
11
|
readonly newTree: "Nouvel arbre";
|
|
12
|
+
readonly noAncestorFound: "Aucun parent trouvé";
|
|
9
13
|
readonly offMessage: "Message (désactiver)";
|
|
10
14
|
readonly onMessage: "Message (activer)";
|
|
11
15
|
readonly repeatable: "Répétable";
|
|
@@ -19,6 +23,7 @@ declare const FORM_FR: {
|
|
|
19
23
|
readonly checkbox: "Case à cocher";
|
|
20
24
|
readonly date: "Date";
|
|
21
25
|
readonly dateRange: "Plage de dates";
|
|
26
|
+
readonly dynamicSelect: "Sélection dynamique";
|
|
22
27
|
readonly email: "Email";
|
|
23
28
|
readonly file: "Fichier";
|
|
24
29
|
readonly hidden: "Champs caché";
|
|
@@ -33,11 +38,17 @@ declare const FORM_FR: {
|
|
|
33
38
|
readonly tree: "Arbre";
|
|
34
39
|
readonly url: "URL";
|
|
35
40
|
};
|
|
41
|
+
readonly urlConstruction: "Construction de l'URL";
|
|
36
42
|
readonly value: "Valeur";
|
|
37
43
|
readonly values: "Valeurs";
|
|
38
44
|
readonly warningApiAutocomplete: {
|
|
39
45
|
readonly response: "dois avoir comme réponse";
|
|
40
46
|
readonly url: "La route de l'API";
|
|
41
47
|
};
|
|
48
|
+
readonly warningApiSelect: {
|
|
49
|
+
readonly response: "à l'emplacement de votre variable.";
|
|
50
|
+
readonly url: "Pour intégrer automatiquement la valeur du parent dans l'URL";
|
|
51
|
+
readonly warning: "placez {{}}";
|
|
52
|
+
};
|
|
42
53
|
};
|
|
43
54
|
export default FORM_FR;
|
|
@@ -10,7 +10,9 @@ declare const TRANSLATION_FR: {
|
|
|
10
10
|
readonly isATree: "Est un arbre";
|
|
11
11
|
readonly isTheRoot: "Est la racine";
|
|
12
12
|
readonly label: "Label";
|
|
13
|
+
readonly multiple: "Multiple";
|
|
13
14
|
readonly name: "Nom";
|
|
15
|
+
readonly parentRef: "Element parent";
|
|
14
16
|
readonly remove: "Supprimer";
|
|
15
17
|
readonly required: "Requis";
|
|
16
18
|
readonly save: "Enregistrer";
|
|
@@ -27,7 +27,7 @@ declare const appendNode: ({ tree, path, name, child }: AppendChildParams) => Tr
|
|
|
27
27
|
label: string;
|
|
28
28
|
required?: boolean | undefined;
|
|
29
29
|
step?: string | undefined;
|
|
30
|
-
type: "number" | "text" | "address" | "select" | "time" | "switch" | "hidden" | "email" | "file" | "password" | "tel" | "url" | "date" | "dateRange" | "checkbox" | "tree" | "radio" | "autocomplete";
|
|
30
|
+
type: "number" | "text" | "address" | "select" | "time" | "switch" | "hidden" | "email" | "file" | "password" | "tel" | "url" | "date" | "dateRange" | "checkbox" | "tree" | "radio" | "autocomplete" | "dynamicSelect";
|
|
31
31
|
value?: undefined;
|
|
32
32
|
values?: import('../../../features/Treege/type/TreeNode').TreeValues[] | undefined;
|
|
33
33
|
message?: undefined;
|
|
@@ -36,6 +36,7 @@ declare const appendNode: ({ tree, path, name, child }: AppendChildParams) => Tr
|
|
|
36
36
|
repeatable?: boolean | undefined;
|
|
37
37
|
hiddenValue?: string | undefined;
|
|
38
38
|
route?: import('../../../features/Treege/type/TreeNode').Route | undefined;
|
|
39
|
+
parentRef?: string | undefined;
|
|
39
40
|
} | {
|
|
40
41
|
isLeaf: boolean;
|
|
41
42
|
isRoot: boolean;
|
|
@@ -56,6 +57,7 @@ declare const appendNode: ({ tree, path, name, child }: AppendChildParams) => Tr
|
|
|
56
57
|
repeatable?: undefined;
|
|
57
58
|
hiddenValue?: undefined;
|
|
58
59
|
route?: import('../../../features/Treege/type/TreeNode').Route | undefined;
|
|
60
|
+
parentRef?: string | undefined;
|
|
59
61
|
};
|
|
60
62
|
name: string;
|
|
61
63
|
children: TreeNode[];
|