import { textAlign } from "../utils/styleProps.mjs"; import { FormEvent, FormHTMLAttributes, ReactNode } from "react"; export interface TableEditableCellProps { /** * Display content shown when the cell is not being edited. */ children: ReactNode; /** * Text that names the row for type to select and screen readers. Derived from * plain string or number content, so set it only for composite content in a * `rowHeader` column. */ textValue?: string; /** * Form field shown when editing. Must include `name` attribute for form data. * Supports input elements like TextField, Select, etc. */ field: ReactNode | (() => ReactNode); /** * Whether the cell is currently saving. Shows a loading indicator on the save button. * @default false */ saving?: boolean; /** * Called when the editing form is submitted, either via the save button or outside click. */ onSubmit?: (e: FormEvent) => void; /** * Called when the user cancels editing via the cancel button. */ onCancel?: () => void; /** * Whether editing is disabled. Hides the edit trigger button. * @default false */ disabled?: boolean; /** * The action to submit the form to. Supports React 19 form actions. */ action?: string | FormHTMLAttributes['action']; /** * Horizontal text alignment of the cell content. * @default 'left' */ alignX?: keyof typeof textAlign; /** * Text overflow behavior for this specific cell. Overrides the table-level overflow setting. * @default undefined (inherits from table) */ overflow?: 'truncate' | 'wrap'; }