@logilab/cwelements
Version:
Library of reusable React components for building web application with cubicweb
31 lines (30 loc) • 1.68 kB
TypeScript
import * as React from 'react';
import { providers } from '@logilab/cwclientlibjs';
import { EntityRelationProps, EntityRelationState, EntityRelation } from './EntityRelation';
import { ProvidersContext } from './commons';
/**
* Component for rendering an arbitrary entity relation
*/
export declare class DefaultEntityRelation extends EntityRelation<EntityRelationProps, EntityRelationState> {
static contextType: React.Context<import("./commons").ProvidersContextType>;
context: React.ContextType<typeof ProvidersContext>;
static defaultProps: {
editable: boolean;
className: string;
onClickGotoTarget: (eid: number) => void;
onClickEdit: (relation: providers.EntityRelationSchema) => void;
getTargetLink: (eid: number) => string;
renderDisplayValue: (entity: providers.Entity, schema: providers.EntitySchema) => JSX.Element;
renderTitle: (component: EntityRelation<EntityRelationProps, EntityRelationState>) => JSX.Element;
renderEditButton: (component: EntityRelation<EntityRelationProps, EntityRelationState>) => JSX.Element;
renderRelationItem: (component: EntityRelation<EntityRelationProps, EntityRelationState>, eid: number, index: number) => JSX.Element;
renderRelationValues: (component: EntityRelation<EntityRelationProps, EntityRelationState>) => JSX.Element;
render: (component: EntityRelation<EntityRelationProps, EntityRelationState>) => JSX.Element;
};
state: EntityRelationState;
_isMounted: boolean;
constructor(props: Readonly<EntityRelationProps>);
componentDidMount(): void;
componentWillUnmount(): void;
render(): JSX.Element;
}