import React from "react"; import { Choice, MatrixColumn } from "./formDesign"; import { Schema } from "@mwater/expressions"; import ResponseRow from "./ResponseRow"; import { Answer, ResponseData } from "./response"; import { InnerFormContext } from "./formContext"; export interface MatrixColumnCellComponentProps { /** Column. See designSchema */ column: MatrixColumn; /** Current data of response (for roster entry if in roster) */ data: ResponseData; /** ResponseRow object (for roster entry if in roster) */ responseRow: ResponseRow; /** Answer of the cell */ answer?: Answer; /** Called with new answer of cell */ onAnswerChange: (answer: Answer) => void; /** True if invalid */ invalid?: boolean; /** Validation message */ invalidMessage?: string; /** Schema to use, including form */ schema: Schema; /** Form context */ formCtx: InnerFormContext; /** Id of the row of the fixed MatrixQuestion that the cell is in. Undefined for roster matrices, * which have no fixed rows and therefore ignore choice row restrictions. */ matrixRowId?: string; } export interface MatrixColumnCellComponentState { /** Status of visibility of choices */ choiceVisibility: { [choiceId: string]: boolean; }; } export default class MatrixColumnCellComponent extends React.Component { constructor(props: MatrixColumnCellComponentProps); componentDidMount(): void; componentDidUpdate(prevProps: MatrixColumnCellComponentProps): void; calculateChoiceVisibility(): Promise; handleValueChange: (value: any) => void; /** Renders an option for a stored answer that is not allowed in this row, so that the existing * answer remains visible (and correctable) instead of the dropdown appearing empty. */ renderIncompatibleStoredChoice(choices: Choice[], value: any): import("react/jsx-runtime").JSX.Element | null; render(): import("react/jsx-runtime").JSX.Element; }