import React from 'react'; import { Field, TypedField } from '../../../lib/data/field.js'; import { ValueProps, ValueEditableUnion } from '../value/value.js'; import { FieldErrors, FormValidator, Validator } from '../../../lib/form/validation.js'; type AttributeListProps = Omit, "onChange"> & { /** The object to show object attributes of. */ object: T; /** The number of columns to span for each field, 12 means 1 pair per row. */ colSpan?: number; /** Whether to decorate the value, if applicable. */ decorate?: boolean; /** Error messages, applied to automatically rendered field. */ errors?: FieldErrors | Partial>; /** The fields in object to show. */ fields: Array | TypedField>; /** A title for the attribute list. */ title?: string; /** An optional id for the title. */ titleId?: string; /** The number of columns to span for the title. */ titleSpan?: number; /** A validation function. */ validate?: FormValidator; /** If set, use this custom set of `Validator`s. */ validators?: Validator[]; /** Props for Value. */ valueProps?: Partial; /** Gets called when a value is edited. */ onEdit?: (value: T) => void; } & Pick, // TODO: Drop of TypedField<,F>, test multiple valiators and getErrorFromErrors // TODO: Drop of TypedField<,F>, test multiple valiators and getErrorFromErrors "editable" | "editing" | "labelEdit" | "onChange" | "formControlProps">; /** * AttributeList Component * * Shows key/value pairs, optionally grouped by `title`. * * @typeParam T - The shape of a single item. */ declare const AttributeList: ({ colSpan, object, editable, editing, decorate, errors, fields, formControlProps, labelEdit, title, titleId, titleSpan, onBlur, onChange, onEdit, validate, validators, valueProps, ...props }: AttributeListProps) => React.JSX.Element; type AttributePairProps = { object: T; field: Field | TypedField; decorate?: boolean; error?: string; valueProps?: Partial; onEdit?: (value: T) => void; } & Pick; /** * A single attribute in an AttributeList */ declare const AttributePair: ({ object, field, formControlProps, editable, editing, decorate, error, labelEdit, valueProps, onBlur, onChange, onEdit, }: AttributePairProps) => React.JSX.Element; export { AttributeList, AttributePair }; export type { AttributeListProps, AttributePairProps };