@bigbinary/neeto-form-frontend 1.0.29 → 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/dist/index.cjs.js +123 -102
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +123 -102
- package/dist/index.js.map +1 -1
- package/index.d.ts +33 -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;
|
|
@@ -91,44 +96,38 @@ interface KeyValuePair {
|
|
|
91
96
|
[key: string]: any;
|
|
92
97
|
}
|
|
93
98
|
|
|
94
|
-
interface UpdateHookResponse<TData = unknown, TError = unknown>
|
|
95
|
-
mutate
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
mutateAsync: (args: {
|
|
100
|
-
id: string;
|
|
101
|
-
values: KeyValuePair
|
|
102
|
-
}) => Promise<TData>;
|
|
103
|
-
};
|
|
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
|
+
}
|
|
104
104
|
|
|
105
|
-
interface CreateHookResponse<TData = unknown, TError = unknown>
|
|
105
|
+
interface CreateHookResponse<TData = unknown, TError = unknown>
|
|
106
|
+
extends Omit<UseMutationResult<TData, TError>, "mutate" | "mutateAsync"> {
|
|
106
107
|
mutate: (values: KeyValuePair) => Promise<TData>;
|
|
107
108
|
mutateAsync: (values: KeyValuePair) => Promise<TData>;
|
|
108
|
-
}
|
|
109
|
+
}
|
|
109
110
|
|
|
110
|
-
interface DeleteHookResponse<TData = unknown, TError = unknown>
|
|
111
|
-
mutate
|
|
112
|
-
|
|
113
|
-
})=> Promise<TData>;
|
|
114
|
-
|
|
115
|
-
id: string;
|
|
116
|
-
})=> Promise<TData>;
|
|
117
|
-
};
|
|
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
|
+
}
|
|
118
116
|
|
|
119
117
|
interface FormHookOptions extends UseQueryOptions {
|
|
120
|
-
formId: string
|
|
121
|
-
preview?: boolean
|
|
118
|
+
formId: string;
|
|
119
|
+
preview?: boolean;
|
|
122
120
|
}
|
|
123
121
|
|
|
124
122
|
interface Item {
|
|
125
123
|
label: string;
|
|
126
124
|
isRequired: boolean;
|
|
127
125
|
optionsAttributes: KeyValuePair[];
|
|
128
|
-
metadata
|
|
126
|
+
metadata?: KeyValuePair[];
|
|
129
127
|
kind: string;
|
|
130
128
|
nodeId: string;
|
|
131
129
|
}
|
|
130
|
+
|
|
132
131
|
interface EmailProps {
|
|
133
132
|
name: string;
|
|
134
133
|
isRequired: boolean;
|
|
@@ -207,8 +206,14 @@ export const useFormSubmission: (args: {
|
|
|
207
206
|
isLoading: boolean;
|
|
208
207
|
};
|
|
209
208
|
|
|
210
|
-
export const useForms: (options
|
|
209
|
+
export const useForms: (options?: UseQueryOptions) => UseQueryResult;
|
|
211
210
|
export const useForm: (options?: FormHookOptions) => UseQueryResult;
|
|
212
|
-
export const useCreateForm: (
|
|
213
|
-
|
|
214
|
-
|
|
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",
|