
* feat: add readOnly flag on form * fix: resolve PR coments * fix: add flag disabled to fields that dont have effect on readonly attr
21 lines
513 B
Text
21 lines
513 B
Text
---
|
|
import type { FormGroup } from '../core/form-group';
|
|
import Field from './Field.astro';
|
|
|
|
export interface Props {
|
|
group: FormGroup;
|
|
showValidationHints: boolean;
|
|
readOnly?: boolean;
|
|
}
|
|
|
|
const { group, showValidationHints, readOnly = false } = Astro.props;
|
|
---
|
|
|
|
<fieldset id={group.name} name={group.name}>
|
|
{group.name && <legend>{group.name}</legend>}
|
|
{
|
|
group?.controls?.map((control) => (
|
|
<Field showValidationHints={showValidationHints} control={control} readOnly={readOnly} />
|
|
))
|
|
}
|
|
</fieldset>
|