@bigbinary/neeto-form-frontend 1.0.28 → 1.0.30
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/README.md +6 -2
- package/dist/index.cjs.js +1456 -1092
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +1457 -1093
- package/dist/index.js.map +1 -1
- package/index.d.ts +49 -28
- package/package.json +1 -2
package/index.d.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
2
|
import { ButtonProps, TypographyProps } from "@bigbinary/neetoui";
|
|
3
3
|
import React, { FormHTMLAttributes, HTMLAttributes } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
UseQueryResult,
|
|
6
|
+
UseMutationResult,
|
|
7
|
+
UseQueryOptions,
|
|
8
|
+
UseMutationOptions,
|
|
9
|
+
} from "react-query";
|
|
5
10
|
|
|
6
11
|
interface BuildFormProps {
|
|
7
12
|
id: string;
|
|
@@ -15,6 +20,22 @@ interface BuildFormProps {
|
|
|
15
20
|
submitButtonProps?: HTMLAttributes<HTMLButtonElement>;
|
|
16
21
|
cancelButtonProps?: HTMLAttributes<HTMLButtonElement>;
|
|
17
22
|
questionKinds?: KeyValuePair[];
|
|
23
|
+
isKindAlreadyActive?: (args: {
|
|
24
|
+
activeQuestions: KeyValuePair[];
|
|
25
|
+
kind: KeyValuePair;
|
|
26
|
+
}) => boolean;
|
|
27
|
+
getActiveKindDetails?: (args: {
|
|
28
|
+
allQuestionKinds: KeyValuePair[];
|
|
29
|
+
item: Item;
|
|
30
|
+
}) => {
|
|
31
|
+
kind: string;
|
|
32
|
+
label: string;
|
|
33
|
+
FieldComponent: React.FC;
|
|
34
|
+
FieldIcon: string | any;
|
|
35
|
+
isSingular: boolean;
|
|
36
|
+
};
|
|
37
|
+
showLoader?: boolean;
|
|
38
|
+
kindUniqueOn?: string[];
|
|
18
39
|
}
|
|
19
40
|
|
|
20
41
|
interface ExternalFormProps {
|
|
@@ -75,44 +96,38 @@ interface KeyValuePair {
|
|
|
75
96
|
[key: string]: any;
|
|
76
97
|
}
|
|
77
98
|
|
|
78
|
-
interface UpdateHookResponse<TData = unknown, TError = unknown>
|
|
79
|
-
mutate
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
mutateAsync: (args: {
|
|
84
|
-
id: string;
|
|
85
|
-
values: KeyValuePair
|
|
86
|
-
}) => Promise<TData>;
|
|
87
|
-
};
|
|
99
|
+
interface UpdateHookResponse<TData = unknown, TError = unknown>
|
|
100
|
+
extends Omit<UseMutationResult<TData, TError>, "mutate" | "mutateAsync"> {
|
|
101
|
+
mutate: (args: { id: string; values: KeyValuePair }) => Promise<TData>;
|
|
102
|
+
mutateAsync: (args: { id: string; values: KeyValuePair }) => Promise<TData>;
|
|
103
|
+
}
|
|
88
104
|
|
|
89
|
-
interface CreateHookResponse<TData = unknown, TError = unknown>
|
|
105
|
+
interface CreateHookResponse<TData = unknown, TError = unknown>
|
|
106
|
+
extends Omit<UseMutationResult<TData, TError>, "mutate" | "mutateAsync"> {
|
|
90
107
|
mutate: (values: KeyValuePair) => Promise<TData>;
|
|
91
108
|
mutateAsync: (values: KeyValuePair) => Promise<TData>;
|
|
92
|
-
}
|
|
109
|
+
}
|
|
93
110
|
|
|
94
|
-
interface DeleteHookResponse<TData = unknown, TError = unknown>
|
|
95
|
-
mutate
|
|
96
|
-
|
|
97
|
-
})=> Promise<TData>;
|
|
98
|
-
|
|
99
|
-
id: string;
|
|
100
|
-
})=> Promise<TData>;
|
|
101
|
-
};
|
|
111
|
+
interface DeleteHookResponse<TData = unknown, TError = unknown>
|
|
112
|
+
extends Omit<UseMutationResult<TData, TError>, "mutate" | "mutateAsync"> {
|
|
113
|
+
mutate: (args: { id: string }) => Promise<TData>;
|
|
114
|
+
mutateAsync: (args: { id: string }) => Promise<TData>;
|
|
115
|
+
}
|
|
102
116
|
|
|
103
117
|
interface FormHookOptions extends UseQueryOptions {
|
|
104
|
-
formId: string
|
|
105
|
-
preview?: boolean
|
|
118
|
+
formId: string;
|
|
119
|
+
preview?: boolean;
|
|
106
120
|
}
|
|
107
121
|
|
|
108
122
|
interface Item {
|
|
109
123
|
label: string;
|
|
110
124
|
isRequired: boolean;
|
|
111
125
|
optionsAttributes: KeyValuePair[];
|
|
112
|
-
metadata
|
|
126
|
+
metadata?: KeyValuePair[];
|
|
113
127
|
kind: string;
|
|
114
128
|
nodeId: string;
|
|
115
129
|
}
|
|
130
|
+
|
|
116
131
|
interface EmailProps {
|
|
117
132
|
name: string;
|
|
118
133
|
isRequired: boolean;
|
|
@@ -191,8 +206,14 @@ export const useFormSubmission: (args: {
|
|
|
191
206
|
isLoading: boolean;
|
|
192
207
|
};
|
|
193
208
|
|
|
194
|
-
export const useForms: (options
|
|
209
|
+
export const useForms: (options?: UseQueryOptions) => UseQueryResult;
|
|
195
210
|
export const useForm: (options?: FormHookOptions) => UseQueryResult;
|
|
196
|
-
export const useCreateForm: (
|
|
197
|
-
|
|
198
|
-
|
|
211
|
+
export const useCreateForm: (
|
|
212
|
+
options?: UseMutationOptions
|
|
213
|
+
) => CreateHookResponse;
|
|
214
|
+
export const useUpdateForm: (
|
|
215
|
+
options?: UseMutationOptions
|
|
216
|
+
) => UpdateHookResponse;
|
|
217
|
+
export const useDeleteForm: (
|
|
218
|
+
options?: UseMutationOptions
|
|
219
|
+
) => DeleteHookResponse;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-form-frontend",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.30",
|
|
4
4
|
"description": "Neeto Form Engine Frontend",
|
|
5
5
|
"author": "BigBinary",
|
|
6
6
|
"license": "MIT",
|
|
@@ -66,7 +66,6 @@
|
|
|
66
66
|
"eslint-plugin-import": "2.26.0",
|
|
67
67
|
"eslint-plugin-jam3": "0.2.3",
|
|
68
68
|
"eslint-plugin-json": "3.1.0",
|
|
69
|
-
"eslint-plugin-neeto": "^1.0.10",
|
|
70
69
|
"eslint-plugin-prettier": "4.0.0",
|
|
71
70
|
"eslint-plugin-promise": "6.0.0",
|
|
72
71
|
"eslint-plugin-react": "7.29.4",
|