@toolpad/core
Version:
Dashboard framework powered by Material UI.
47 lines • 1.33 kB
TypeScript
import * as React from 'react';
import { DataSourceCache } from "./cache.js";
import { type CRUDLocaleText } from "./localeText.js";
import type { DataModel, DataSource, OmitId } from './types';
export interface CreateProps<D extends DataModel> {
/**
* Server-side [data source](https://mui.com/toolpad/core/react-crud/#data-sources).
*/
dataSource?: DataSource<D> & Required<Pick<DataSource<D>, 'createOne'>>;
/**
* Initial form values.
* @default {}
*/
initialValues?: Partial<OmitId<D>>;
/**
* Callback fired when the form is successfully submitted.
*/
onSubmitSuccess?: (formValues: Partial<OmitId<D>>) => void | Promise<void>;
/**
* Whether the form fields should reset after the form is submitted.
* @default false
*/
resetOnSubmit?: boolean;
/**
* [Cache](https://mui.com/toolpad/core/react-crud/#data-caching) for the data source.
*/
dataSourceCache?: DataSourceCache | null;
/**
* Locale text for the component.
*/
localeText?: CRUDLocaleText;
}
/**
*
* Demos:
*
* - [CRUD](https://mui.com/toolpad/core/react-crud/)
*
* API:
*
* - [Create API](https://mui.com/toolpad/core/api/create)
*/
declare function Create<D extends DataModel>(props: CreateProps<D>): React.JSX.Element;
declare namespace Create {
var propTypes: any;
}
export { Create };