/** @module @airtable/blocks/ui: CellRenderer */ /** */ import * as PropTypes from "prop-types"; import * as React from "react"; import Sdk from "../sdk"; import Record from "../models/record"; import Field from "../models/field"; import { MaxWidthProps, MinWidthProps, WidthProps, FlexItemSetProps, PositionSetProps, MarginProps } from "./system"; import { OptionalResponsiveProp } from "./system/utils/types"; import { TooltipAnchorProps } from "./types/tooltip_anchor_props"; /** * Style props for the {@link CellRenderer} component. Also accepts: * * {@link FlexItemSetProps} * * {@link MarginProps} * * {@link MaxWidthProps} * * {@link MinWidthProps} * * {@link PositionSetProps} * * {@link WidthProps} * * @noInheritDoc */ interface CellRendererStyleProps extends FlexItemSetProps, MarginProps, MaxWidthProps, MinWidthProps, PositionSetProps, WidthProps { /** Defines the display type of an element, which consists of the two basic qualities of how an element generates boxes — the outer display type defining how the box participates in flow layout, and the inner display type defining how the children of the box are laid out. */ display?: OptionalResponsiveProp<"block" | "inline" | "inline-block">; } export declare const cellRendererStylePropTypes: { [x: string]: PropTypes.Validator; }; /** * Props for the {@link CellRenderer} component. Also accepts: * * {@link CellRendererStyleProps} * * @docsPath UI/components/CellRenderer * @noInheritDoc */ interface CellRendererProps extends CellRendererStyleProps, TooltipAnchorProps { /** The {@link Record} from which to render a cell. Either `record` or `cellValue` must be provided to the CellRenderer. If both are provided, `record` will be used. */ record?: Record | null | undefined; /** The cell value to render. Either `record` or `cellValue` must be provided to the CellRenderer. If both are provided, `record` will be used. */ cellValue?: unknown; /** The {@link Field} for a given {@link Record} being rendered as a cell. */ field: Field; /** Whether to wrap cell contents. Defaults to true. */ shouldWrap?: boolean; /** Additional class names to apply to the cell renderer container, separated by spaces. */ className?: string; /** Additional styles to apply to the cell renderer container. */ style?: React.CSSProperties; /** Additional class names to apply to the cell itself, separated by spaces. */ cellClassName?: string; /** Additional styles to apply to the cell itself. */ cellStyle?: React.CSSProperties; /** Render function if provided and validation fails. */ renderInvalidCellValue?: (cellValue: unknown, field: Field) => React.ReactElement; /** @internal injected by withHooks */ sdk: Sdk; } /** * Displays the contents of a cell given a field and record. * * [[ Story id="cellrenderer--example" title="Cell renderer example" ]] * * @component * @docsPath UI/components/CellRenderer */ export declare class CellRenderer extends React.Component { /** @hidden */ static propTypes: { onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>; onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>; onClick: PropTypes.Requireable<(...args: any[]) => any>; hasOnClick: PropTypes.Requireable; record: PropTypes.Requireable; cellValue: PropTypes.Requireable; field: PropTypes.Validator; shouldWrap: PropTypes.Requireable; className: PropTypes.Requireable; style: PropTypes.Requireable; cellClassName: PropTypes.Requireable; cellStyle: PropTypes.Requireable; renderInvalidCellValue: PropTypes.Requireable<(...args: any[]) => any>; }; /** @hidden */ static defaultProps: { shouldWrap: boolean; }; /** @hidden */ constructor(props: CellRendererProps); /** @hidden */ UNSAFE_componentWillReceiveProps(nextProps: CellRendererProps): void; /** @internal */ _validateProps(props: CellRendererProps): void; /** @hidden */ render(): JSX.Element | null; } declare const _default: React.RefForwardingComponent & React.RefAttributes>; export default _default;