import * as React from 'react'; import { providers } from '@logilab/cwclientlibjs'; import { EntityFormProps, EntityFormState, EntityForm } from './EntityForm'; import { ProvidersContext } from './commons'; /** * Component for rendering an entity */ export declare class DefaultEntityForm extends EntityForm { static contextType: React.Context; context: React.ContextType; static defaultProps: { className: string; editable: boolean; attributesWhiteList: null; relationsWhiteList: null; onClickGotoTarget: (eid: number) => void; onClickEdit: (data: providers.Entity, relations: providers.EntityRelationSchema[]) => void; getTargetLink: (eid: number) => string; renderElements: (component: EntityForm, data: providers.Entity, schema: providers.EntitySchema) => JSX.Element[]; renderAttributes: (component: EntityForm, data: providers.Entity, schema: providers.EntitySchema) => JSX.Element[]; onChangeAttribute: (entity: providers.Entity, attribute: providers.EntityAttributeSchema, required: boolean, value: any, rqlClient?: import("@logilab/cwclientlibjs/build/client").RqlClient | undefined) => null; renderAttribute: (component: EntityForm, data: providers.Entity, attribute: providers.EntityAttributeSchema) => JSX.Element; attributeHasBeenSaved: (entity: providers.Entity, attribute: providers.EntityAttributeSchema, value: any) => void; attributeSavingError: (entity: providers.Entity, attribute: providers.EntityAttributeSchema, value: any, error: string) => void; renderRelationsGroup: (component: EntityForm, data: providers.Entity, relations: providers.EntityRelationSchema[], entityIsSubject: boolean) => JSX.Element[]; renderDisplayValue: (entity: providers.Entity, schema: providers.EntitySchema) => JSX.Element; renderTitle: (component: EntityForm, data: providers.Entity, schema: providers.EntitySchema) => JSX.Element; renderLoading: (component: EntityForm) => JSX.Element; renderNoData: (component: EntityForm) => JSX.Element; renderOnError: (component: EntityForm) => JSX.Element; renderLoaded: (component: EntityForm, data: providers.Entity, schema: providers.EntitySchema) => JSX.Element; render: (component: EntityForm) => JSX.Element; }; state: EntityFormState; _isMounted: boolean; _currentLoadId: number; constructor(props: Readonly); componentDidMount(): void; componentWillUnmount(): void; componentDidUpdate(prevProps: EntityFormProps, prevState: EntityFormState, snapshot: any): void; /** * Loads the entity data and schema */ loadData: () => void; /** * Checks whether the current load operation must stop * A load operation may take time and thus it may become * dangerous, or superseded by another one in the following cases: * - the component has been unmounted, we cannot update the state anymore * - this is no longer the latest load operation, another one has been launched * @param loadId The identifier of the load operation * @returns true if the load operation must stop */ stopLoadOp: (loadId: number) => boolean; /** * Executes a load operation with the specified identifier * @param loadId The identifier of this load operation */ doLoad: (loadId: number) => Promise; render(): JSX.Element; }