import type Form from "./Form.js"; import Title from "./Title.js"; export default function FormTemplate(this: Form) { return (
{this.hasHeader &&
{this.hasCustomHeader ? : {this.headerText} }
} { this.hasGroupItems ? groupedItemsLayout.call(this) : standaloneItemsLayout.call(this) }
); } function groupedItemsLayout(this: Form) { return
{ this.groupItemsInfo.map(groupItemInfo => { const groupItem = groupItemInfo.groupItem; return
{ groupItem.headerText &&
{groupItem.headerText}
} { this.accessibleMode === "Edit" ?
:
}
; })}
; } function standaloneItemsLayout(this: Form) { return ( this.accessibleMode === "Edit" ?
{ standaloneItemsLayoutContent.call(this) }
:
{ standaloneItemsLayoutContent.call(this) }
); } function standaloneItemsLayoutContent(this: Form) { return this.itemsInfo.map(itemInfo => { const item = itemInfo.item; return (
); }); }