import * as React from 'react'; import { GlobalDefaultTheme, PartialGlobalDefaultTheme } from '../../utils/useTheme'; import { COMPONENTS_NAMESPACES } from '../../constants'; import { LineType, StepPosition } from './constants'; import { CustomRender, CustomEventHandler } from '../../commonTypes'; export interface StatusItem { /** Any custom property of item */ [x: string]: any; } export interface ItemProps { /** Child elements */ children?: React.ReactNode; /** Element classes in string. Classes separated by space */ className?: string; } export interface IconProps { /** Element classes in string. Classes separated by space */ className?: string; /** Click handler */ onClick?: CustomEventHandler>; } export interface LabelProps { /** Child elements */ children?: React.ReactNode; /** Element classes in string. Classes separated by space */ className?: string; } export declare type LineProps = { /** Child elements */ children?: React.ReactNode; /** Element classes in string. Classes separated by space */ className?: string; /** Inline element styles */ style?: React.CSSProperties; }; export interface StatusBarProps extends Omit, 'onClick'> { /** Percentage of completion of current step */ currentStepProgress?: number; /** Array of objects or strings that represent steps */ data: StatusItem[] | string[]; /** Customizing appearance of icon */ iconRender?: CustomRender; /** Customizing entire StatusBarItem appearance */ itemRender?: CustomRender; /** Customizing appearance of label, if not passed, then "span" is used as wrappers */ labelRender?: CustomRender; /** Customizing appearance of line */ lineRender?: CustomRender; /** Click handler */ onClick?: CustomEventHandler; /** References to DOM elements of component */ ref?: React.Ref; /** Field from which label text is extracted works only if there are objects in data */ textField?: string; /** Component theme */ theme?: PartialGlobalDefaultTheme[typeof COMPONENTS_NAMESPACES.statusBar]; /** Field from which contents for tooltip are extracted works only if there are objects in data */ tooltipField?: string; /** Field from which step type is extracted works only if there are objects in data */ typeField?: string; /** Current step is ignored if StatusItem contains type */ value?: StatusItem | string; } export interface StatusBarItemClickEvent { target: { /** Step index in data */ index: number; /** Step name or description of custom step */ item: string | StatusItem; }; } export interface StatusBarItemProps { /** Element classes in string. Classes separated by space */ className?: string; /** Percentage of completion of current step */ currentStepProgress?: number; /** Customizing appearance of icon */ iconRender?: CustomRender; /** Step index in data */ index: number; /** Flag shows if item is first */ isFirst: boolean; /** Flag shows if item is last */ isLast: boolean; /** Step name or description of custom step */ item: string | StatusItem; /** Customizing entire StatusBarItem appearance */ itemRender?: CustomRender; /** Item number from left to right. Count starts from 0 */ key: string; /** Customizing appearance of label, if not passed, then "span" is used as wrappers */ labelRender?: CustomRender; /** Label of item */ labelText: string; /** Customizing appearance of line */ lineRender?: CustomRender; /** Type of line */ lineType: LineType | null; /** Click handler */ onClick?: CustomEventHandler; /** Step position */ position: StepPosition | null; /** Component theme */ theme: GlobalDefaultTheme[typeof COMPONENTS_NAMESPACES.statusBar]; /** Content for tooltip. Accepted as string, html, JSX */ tooltip?: React.ReactNode | null; /** Step type */ type: string | null; } export interface StatusBarRefCurrent { /** Reference to wrapper of component */ wrapper: HTMLDivElement | null; } export declare type GetLineTypeProps = { /** Progress of current step */ currentStepProgress?: number; /** Position of current step */ position: StepPosition | null; }; export declare type GetStepTypeProps = { /** Indicates whether step is custom */ isCustomChildren: boolean; /** Step name or description of custom step */ item?: string | StatusItem; /** Step position */ position: StepPosition | null; /** Name of step property indicating its type */ typeField?: string; };