UNPKG

@rjsf/core

Version:

A simple React component capable of building HTML forms out of a JSON schema.

18 lines (17 loc) 939 B
import { jsx as _jsx } from "react/jsx-runtime"; import { getTemplate, getUiOptions, titleId, } from '@rjsf/utils'; /** The `ArrayFieldTitleTemplate` component renders a `TitleFieldTemplate` with an `id` derived from * the `fieldPathId`. * * @param props - The `ArrayFieldTitleProps` for the component */ export default function ArrayFieldTitleTemplate(props) { const { fieldPathId, title, schema, uiSchema, required, registry, optionalDataControl } = props; const options = getUiOptions(uiSchema, registry.globalUiOptions); const { label: displayLabel = true } = options; if (!title || !displayLabel) { return null; } const TitleFieldTemplate = getTemplate('TitleFieldTemplate', registry, options); return (_jsx(TitleFieldTemplate, { id: titleId(fieldPathId), title: title, required: required, schema: schema, uiSchema: uiSchema, registry: registry, optionalDataControl: optionalDataControl })); }