import React, { FC } from 'react'; import { AnvilSelectOptionsProps } from '../AnvilSelect'; import { PopoverProps } from '../Popover'; import { PopperProps } from '../../internal'; export interface InlineEditPropsStrict { /** Сontrol component to be shown on edit */ control?: (controlProps: ControlProps, actionProps: ActionProps) => any; /** Custom content for the read mode, this will override value output */ content?: any; /** Value to be displayed on read mode */ value?: valueObject | string | number; /** Decoration on displayed value */ decoration?: InlineEditDecorationProps; /** If true, read content and control will show error state */ error?: boolean; /** Callback fired on save */ onSave?: (data?: any) => void; /** Callback fired on cancel */ onCancel?: () => void; /** Callback fired on click */ onClick?: (event?: React.MouseEvent) => void; /** Callback fired when a user changes the value */ onChange?: (event?: React.ChangeEvent, data?: any) => void; /** Position of the save and cancel action buttons. */ actionDirection?: PopoverProps['direction']; /** Layout option of the save and cancel action buttons. */ actionLayout?: 'none' | 'inline' | 'floating'; /** Adds one or more classnames for an element */ className?: string; /** If true, control will be displayed */ mode?: 'edit' | 'read' | string; /** width of the component */ width?: 'fluid' | number | string; /** If true, read content will show with the control during editing */ showContentOnEdit?: boolean; /** ID of the component */ id?: string; /** If true, control component will have autoFocus applied when edit mode */ autoFocusControl?: boolean; /** Custom placeholder text */ placeholder?: string; /** Props to be passed to the portaled div */ portalDataAttributes?: PopperProps['portalDataAttributes']; } interface valueObject extends AnvilSelectOptionsProps { title?: string; } interface ActionProps { save?: (event: React.ChangeEvent) => void; cancel?: (event: React.ChangeEvent) => void; open?: boolean; } interface ControlProps { id?: string; className?: string; tabIndex?: number; autoFocus?: boolean; ref?: React.Ref & React.LegacyRef & React.RefObject; error?: boolean; value?: any; onKeyDown?: (event: React.KeyboardEvent) => void; onChange?: (event: React.ChangeEvent, data: any) => void; } export interface InlineEditProps extends InlineEditPropsStrict { /** Unstrict Props */ [propName: string]: any; } export interface InlineEditDecorationProps { color?: boolean; underline?: boolean; icon?: boolean; } export declare const InlineEdit: FC; export {};