File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
packages/chakra-ui/src/FieldTemplate Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 1+ import { Fieldset , Text } from '@chakra-ui/react' ;
12import {
23 FieldTemplateProps ,
34 FormContextType ,
@@ -18,13 +19,19 @@ export default function FieldTemplate<
1819 classNames,
1920 style,
2021 disabled,
22+ displayLabel,
2123 hidden,
2224 label,
2325 onDropPropertyClick,
2426 onKeyChange,
2527 readonly,
2628 registry,
2729 required,
30+ rawErrors = [ ] ,
31+ errors,
32+ help,
33+ description,
34+ rawDescription,
2835 schema,
2936 uiSchema,
3037 } = props ;
@@ -54,7 +61,12 @@ export default function FieldTemplate<
5461 uiSchema = { uiSchema }
5562 registry = { registry }
5663 >
57- { children }
64+ < Fieldset . Root disabled = { disabled } invalid = { rawErrors && rawErrors . length > 0 } >
65+ { displayLabel && rawDescription ? < Fieldset . Legend mt = { 2 } > { description } </ Fieldset . Legend > : null }
66+ { help && < Text > { help } </ Text > }
67+ < Fieldset . Content > { children } </ Fieldset . Content >
68+ { errors && < Fieldset . ErrorText > { errors } </ Fieldset . ErrorText > }
69+ </ Fieldset . Root >
5870 </ WrapIfAdditionalTemplate >
5971 ) ;
6072}
You can’t perform that action at this time.
0 commit comments