@refinedev/antd 5.27.0 → 5.29.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 +72 -0
- package/dist/components/autoSaveIndicator/index.d.ts +4 -0
- package/dist/components/autoSaveIndicator/index.d.ts.map +1 -0
- package/dist/components/crud/edit/index.d.ts.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/hooks/form/useForm.d.ts +10 -4
- package/dist/hooks/form/useForm.d.ts.map +1 -1
- package/dist/iife/index.js +14 -6
- package/dist/iife/index.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/components/autoSaveIndicator/index.tsx +54 -0
- package/src/components/crud/edit/index.tsx +3 -0
- package/src/components/index.ts +1 -0
- package/src/hooks/form/useForm.ts +104 -7
@@ -1,5 +1,5 @@
|
|
1
|
-
import { FormInstance, FormProps } from "antd";
|
2
|
-
import {
|
1
|
+
import { FormInstance, FormProps, ButtonProps } from "antd";
|
2
|
+
import { AutoSaveProps } from "@refinedev/core";
|
3
3
|
import { HttpError, BaseRecord, UseFormReturnType as UseFormReturnTypeCore, UseFormProps as UseFormPropsCore, CreateResponse, UpdateResponse } from "@refinedev/core";
|
4
4
|
export declare type UseFormProps<TQueryFnData extends BaseRecord = BaseRecord, TError extends HttpError = HttpError, TVariables = {}, TData extends BaseRecord = TQueryFnData, TResponse extends BaseRecord = TData, TResponseError extends HttpError = TError> = UseFormPropsCore<TQueryFnData, TError, TVariables, TData, TResponse, TResponseError> & {
|
5
5
|
submitOnEnter?: boolean;
|
@@ -7,7 +7,13 @@ export declare type UseFormProps<TQueryFnData extends BaseRecord = BaseRecord, T
|
|
7
7
|
* Shows notification when unsaved changes exist
|
8
8
|
*/
|
9
9
|
warnWhenUnsavedChanges?: boolean;
|
10
|
-
|
10
|
+
/**
|
11
|
+
* Disables server-side validation
|
12
|
+
* @default false
|
13
|
+
* @see {@link https://refine.dev/docs/advanced-tutorials/forms/server-side-form-validation/}
|
14
|
+
*/
|
15
|
+
disableServerSideValidation?: boolean;
|
16
|
+
} & AutoSaveProps<TVariables>;
|
11
17
|
export declare type UseFormReturnType<TQueryFnData extends BaseRecord = BaseRecord, TError extends HttpError = HttpError, TVariables = {}, TData extends BaseRecord = TQueryFnData, TResponse extends BaseRecord = TData, TResponseError extends HttpError = TError> = UseFormReturnTypeCore<TQueryFnData, TError, TVariables, TData, TResponse, TResponseError> & {
|
12
18
|
form: FormInstance<TVariables>;
|
13
19
|
formProps: FormProps<TVariables>;
|
@@ -30,5 +36,5 @@ export declare type UseFormReturnType<TQueryFnData extends BaseRecord = BaseReco
|
|
30
36
|
*
|
31
37
|
*
|
32
38
|
*/
|
33
|
-
export declare const useForm: <TQueryFnData extends BaseRecord = BaseRecord, TError extends HttpError = HttpError, TVariables = {}, TData extends BaseRecord = TQueryFnData, TResponse extends BaseRecord = TData, TResponseError extends HttpError = TError>({ action, resource, onMutationSuccess: onMutationSuccessProp, onMutationError, submitOnEnter, warnWhenUnsavedChanges: warnWhenUnsavedChangesProp, redirect, successNotification, errorNotification, meta, metaData, queryMeta, mutationMeta, liveMode, liveParams, mutationMode, dataProviderName, onLiveEvent, invalidates, undoableTimeout, queryOptions, createMutationOptions, updateMutationOptions, id: idFromProps, overtimeOptions, }?: UseFormProps<TQueryFnData, TError, TVariables, TData, TResponse, TResponseError>) => UseFormReturnType<TQueryFnData, TError, TVariables, TData, TResponse, TResponseError>;
|
39
|
+
export declare const useForm: <TQueryFnData extends BaseRecord = BaseRecord, TError extends HttpError = HttpError, TVariables = {}, TData extends BaseRecord = TQueryFnData, TResponse extends BaseRecord = TData, TResponseError extends HttpError = TError>({ action, resource, onMutationSuccess: onMutationSuccessProp, onMutationError: onMutationErrorProp, autoSave, submitOnEnter, warnWhenUnsavedChanges: warnWhenUnsavedChangesProp, redirect, successNotification, errorNotification, meta, metaData, queryMeta, mutationMeta, liveMode, liveParams, mutationMode, dataProviderName, onLiveEvent, invalidates, undoableTimeout, queryOptions, createMutationOptions, updateMutationOptions, id: idFromProps, overtimeOptions, disableServerSideValidation: disableServerSideValidationProp, }?: UseFormProps<TQueryFnData, TError, TVariables, TData, TResponse, TResponseError>) => UseFormReturnType<TQueryFnData, TError, TVariables, TData, TResponse, TResponseError>;
|
34
40
|
//# sourceMappingURL=useForm.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useForm.d.ts","sourceRoot":"","sources":["../../../src/hooks/form/useForm.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAQ,MAAM,MAAM,CAAC;
|
1
|
+
{"version":3,"file":"useForm.d.ts","sourceRoot":"","sources":["../../../src/hooks/form/useForm.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAQ,WAAW,EAAE,MAAM,MAAM,CAAC;AAElE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EACH,SAAS,EACT,UAAU,EAEV,iBAAiB,IAAI,qBAAqB,EAE1C,YAAY,IAAI,gBAAgB,EAChC,cAAc,EACd,cAAc,EAIjB,MAAM,iBAAiB,CAAC;AAEzB,oBAAY,YAAY,CACpB,YAAY,SAAS,UAAU,GAAG,UAAU,EAC5C,MAAM,SAAS,SAAS,GAAG,SAAS,EACpC,UAAU,GAAG,EAAE,EACf,KAAK,SAAS,UAAU,GAAG,YAAY,EACvC,SAAS,SAAS,UAAU,GAAG,KAAK,EACpC,cAAc,SAAS,SAAS,GAAG,MAAM,IACzC,gBAAgB,CAChB,YAAY,EACZ,MAAM,EACN,UAAU,EACV,KAAK,EACL,SAAS,EACT,cAAc,CACjB,GAAG;IACA,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC;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