import * as React from 'react'; import TextField from '../../lv1/forms/TextField'; import DigitsInput from '../formFields/DigitsInput'; import DateInput from '../formFields/DateInput'; import TextArea from '../../lv1/forms/TextArea'; import NumeralCodeInput from '../formFields/NumeralCodeInput'; import { ReadOnlyField } from '../../lv1'; declare type Values = { [key: string]: string | number | boolean | object | null; }; declare type FixedLengthBlock = [PropsListFormFieldDefinition] | [PropsListFormFieldDefinition, PropsListFormFieldDefinition]; declare type VariableLengthBlock = { numberOfColumns: number; definitions: Array>; }; declare type Errors = Partial>; declare type Props = { /** * フィールドの定義です。 */ blocks: Array | VariableLengthBlock>; /** * labelの幅(rem)を指定します。 * @default { label: 8 } */ width?: { label?: number; }; /** * readOnlyがtrueの場合、入力フィールドを表示しません。 * @default false */ readOnly: boolean; /** * 共通のonChangeイベントハンドラーです。 * fieldのonChangeイベントハンドラーが指定されていた場合は実行されません。 * `(values) => { console.log(values) }` */ onChange?: (values: T) => void; /** * 共通のonBlurイベントハンドラーです。
* fieldのonBlurイベントハンドラーが指定されていた場合は実行されません。
* `(values) => { console.log(values) }` */ onBlur?: (values: T) => void; /** * フィールドの値です。
* keyにはdefinitionのkeyを指定します。 */ values: T; /** * エラーの内容です。
* keyにはdefinitionのkeyを指定します。 */ errors?: Errors; }; export declare type PropsListFormFieldDefinition = { label: string; key: keyof T; help?: ((options: { readOnly: boolean; }) => React.ReactNode) | React.ReactNode; readOnlyValue?: ((options: { value: T[keyof T]; }) => React.ReactNode) | React.ReactNode; field?: PropsListFormFieldType; annotation?: ((options: { readOnly: boolean; }) => React.ReactNode) | React.ReactNode; required?: boolean; }; declare type OmitProps = Omit; declare type TextFieldProps = OmitProps>; declare type TextAreaProps = OmitProps>; declare type NumberFieldProps = OmitProps>; declare type DateFieldProps = OmitProps>; declare type NumeralCodeInputProps = OmitProps>; declare type ReadOnlyFieldProps = OmitProps>; export declare type PropsListFormFieldType = ({ factor: 'text'; } & TextFieldProps) | ({ factor: 'text-area'; } & TextAreaProps) | ({ factor: 'number'; } & NumberFieldProps) | ({ factor: 'date'; } & DateFieldProps) | ({ factor: 'numeral-code'; } & NumeralCodeInputProps) | ({ factor: 'read-only-text'; } & ReadOnlyFieldProps) | ((options: { id: string; value: V; }) => React.ReactNode); /** * フォームの定義をすることでフォームの一覧表示をすることができるコンポーネントです。
* DescriptionListとデザイン面で大きく異なるのは2カラム以上で表示することができ、一画面で多くの項目を表示できる点です。 */ declare const PropsListForm: (props: Props) => JSX.Element; export default PropsListForm;