import * as React from 'react'; import { providers } from '@logilab/cwclientlibjs'; import { EntityRelationsGroupProps, EntityRelationsGroup } from './EntityRelationsGroup'; import { ProvidersContext } from './commons'; /** * The props for this component */ export interface MergedEntityRelationsGroupProps extends EntityRelationsGroupProps { /** * Renders the edit button for the group * @param component The current component (this) */ renderEditButton: (component: EntityRelationsGroup) => JSX.Element; /** * Renders the title for the group * @param component The current component (this) */ renderTitle: (component: EntityRelationsGroup) => JSX.Element; /** * Renders a particular relation value * @param component The current component (this) */ renderValue: (component: EntityRelationsGroup, index: number) => JSX.Element; } /** * State for this component */ export interface MergedEntityRelationsGroupState { /** * The starting index of values for a specific relation in the common arrays of values and names */ relationsStart: number[]; /** * The number of values of each specific relation in the common arrays of values and names */ relationsCount: number[]; /** * The EID of the related entities */ values: number[]; /** * The displayable names of the related entities */ displays: (JSX.Element | null)[]; } /** * Default props for a merged entity relations group */ export declare const MERGED_ENTITY_RELATIONS_GROUP_DEFAULT_PROPS: { renderEditButton: (component: EntityRelationsGroup) => JSX.Element; renderTitle: (component: EntityRelationsGroup) => JSX.Element; renderValue: (component: EntityRelationsGroup, index: number) => JSX.Element; render: (component: EntityRelationsGroup) => JSX.Element; editable: boolean; className: string; onClickGotoTarget: (eid: number) => void; onClickEdit: (relations: providers.EntityRelationSchema[]) => void; getTargetLink: (eid: number) => string; renderDisplayValue: (entity: providers.Entity, schema: providers.EntitySchema) => JSX.Element; renderRelation: (component: EntityRelationsGroup, relation: providers.EntityRelationSchema) => JSX.Element; }; /** * Component for rendering an arbitrary entity relation */ export declare class MergedEntityRelationsGroup extends EntityRelationsGroup { static contextType: React.Context; context: React.ContextType; static defaultProps: { renderEditButton: (component: EntityRelationsGroup) => JSX.Element; renderTitle: (component: EntityRelationsGroup) => JSX.Element; renderValue: (component: EntityRelationsGroup, index: number) => JSX.Element; render: (component: EntityRelationsGroup) => JSX.Element; editable: boolean; className: string; onClickGotoTarget: (eid: number) => void; onClickEdit: (relations: providers.EntityRelationSchema[]) => void; getTargetLink: (eid: number) => string; renderDisplayValue: (entity: providers.Entity, schema: providers.EntitySchema) => JSX.Element; renderRelation: (component: EntityRelationsGroup, relation: providers.EntityRelationSchema) => JSX.Element; }; state: MergedEntityRelationsGroupState; _isMounted: boolean; constructor(props: Readonly); componentDidMount(): void; componentWillUnmount(): void; render(): JSX.Element; }