treege 0.18.0 → 0.20.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.
@@ -1,5 +1,6 @@
1
1
  interface ViewerJSONProps {
2
- value: any;
2
+ value: unknown;
3
+ onChange?: (value: any) => void;
3
4
  }
4
- declare const ViewerJSON: ({ value }: ViewerJSONProps) => import("react/jsx-runtime").JSX.Element;
5
+ declare const ViewerJSON: ({ value, onChange }: ViewerJSONProps) => import("react/jsx-runtime").JSX.Element;
5
6
  export default ViewerJSON;
@@ -1,4 +1,5 @@
1
1
  declare const useViewerJSONAction: () => {
2
+ copyToClipboard: (value: unknown) => () => void;
2
3
  formatJSON: (value: any) => string;
3
4
  getDownloadLink: (value: any) => string;
4
5
  handleClose: () => void;
@@ -65,6 +65,12 @@ declare const fields: readonly [{
65
65
  readonly isRepeatableDisabled: false;
66
66
  readonly isRequiredDisabled: false;
67
67
  readonly type: "time";
68
+ }, {
69
+ readonly isBooleanField: false;
70
+ readonly isDecisionField: false;
71
+ readonly isRepeatableDisabled: false;
72
+ readonly isRequiredDisabled: false;
73
+ readonly type: "timeRange";
68
74
  }, {
69
75
  readonly isBooleanField: true;
70
76
  readonly isDecisionField: false;
@@ -66,6 +66,12 @@ declare const useFieldSelect: () => {
66
66
  readonly isRepeatableDisabled: false;
67
67
  readonly isRequiredDisabled: false;
68
68
  readonly type: "time";
69
+ } | {
70
+ readonly isBooleanField: false;
71
+ readonly isDecisionField: false;
72
+ readonly isRepeatableDisabled: false;
73
+ readonly isRequiredDisabled: false;
74
+ readonly type: "timeRange";
69
75
  } | {
70
76
  readonly isBooleanField: true;
71
77
  readonly isDecisionField: false;
@@ -64,7 +64,7 @@ declare const useFormTreeCardMutation: () => {
64
64
  step: string;
65
65
  tag: string | null;
66
66
  treeSelected: string;
67
- type: "number" | "text" | "address" | "select" | "time" | "switch" | "hidden" | "email" | "file" | "password" | "tel" | "url" | "date" | "dateRange" | "checkbox" | "tree" | "radio" | "autocomplete" | "dynamicSelect";
67
+ type: "number" | "text" | "address" | "select" | "time" | "switch" | "hidden" | "email" | "file" | "password" | "tel" | "url" | "date" | "dateRange" | "timeRange" | "checkbox" | "tree" | "radio" | "autocomplete" | "dynamicSelect";
68
68
  uniqueNameErrorMessage: string;
69
69
  values: {
70
70
  id: string;
@@ -2,6 +2,7 @@ declare const useTreeGrid: () => {
2
2
  closeModal: () => void;
3
3
  getTitleModalDelete: () => "Are you sure to delete « {{name}} »";
4
4
  getTitleModalMutation: () => "Add a field" | "Add a field to « {{name}} »" | "Edit field « {{name}} »";
5
+ handleChangeTree: (tree: any) => false | undefined;
5
6
  isDeleteModal: boolean;
6
7
  isModalMutationOpen: boolean;
7
8
  };
@@ -1,5 +1,6 @@
1
1
  declare const BUTTON_EN: {
2
2
  readonly close: "Close";
3
+ readonly copyToClipboard: "Copy tree to clipboard";
3
4
  readonly createTree: "Create Tree";
4
5
  readonly downloadJSONFile: "Download JSON File";
5
6
  readonly reset: "Reset";
@@ -35,6 +35,7 @@ declare const FORM_EN: {
35
35
  readonly tel: "Tel";
36
36
  readonly text: "Text";
37
37
  readonly time: "Time";
38
+ readonly timeRange: "Time range";
38
39
  readonly tree: "Tree";
39
40
  readonly url: "URL";
40
41
  };
@@ -5,6 +5,7 @@ declare const SNACK_MESSAGE_EN: {
5
5
  readonly updateTree: "An error has occurred. Please try again";
6
6
  };
7
7
  readonly success: {
8
+ readonly copyToClipboard: "Copied to clipboard";
8
9
  readonly saveTree: "Tree registered";
9
10
  readonly updateTree: "Tree updated";
10
11
  };
@@ -1,5 +1,6 @@
1
1
  declare const BUTTON_FR: {
2
2
  readonly close: "Fermer";
3
+ readonly copyToClipboard: "Copier l'arbre dans le presse-papiers";
3
4
  readonly createTree: "Créer un arbre";
4
5
  readonly downloadJSONFile: "Télécharger le fichier JSON";
5
6
  readonly reset: "Réinitialiser";
@@ -35,6 +35,7 @@ declare const FORM_FR: {
35
35
  readonly tel: "Téléphone";
36
36
  readonly text: "Texte";
37
37
  readonly time: "Temps";
38
+ readonly timeRange: "Plage de temps";
38
39
  readonly tree: "Arbre";
39
40
  readonly url: "URL";
40
41
  };
@@ -5,6 +5,7 @@ declare const SNACK_MESSAGE_FR: {
5
5
  readonly updateTree: "Une erreur est survenue veuillez réessayer";
6
6
  };
7
7
  readonly success: {
8
+ readonly copyToClipboard: "Copié dans le presse-papiers";
8
9
  readonly saveTree: "Arbre enregistré";
9
10
  readonly updateTree: "Arbre mis à jour";
10
11
  };
@@ -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" | "dynamicSelect";
30
+ type: "number" | "text" | "address" | "select" | "time" | "switch" | "hidden" | "email" | "file" | "password" | "tel" | "url" | "date" | "dateRange" | "timeRange" | "checkbox" | "tree" | "radio" | "autocomplete" | "dynamicSelect";
31
31
  value?: undefined;
32
32
  values?: import('../../../features/Treege/type/TreeNode').TreeValues[] | undefined;
33
33
  message?: undefined;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "treege",
3
3
  "description": "Form decision tree generator",
4
4
  "license": "ISC",
5
- "version": "0.18.0",
5
+ "version": "0.20.0",
6
6
  "type": "module",
7
7
  "types": "./dist/main.d.ts",
8
8
  "main": "./dist/main.umd.cjs",