import { MessageDescriptor } from 'react-intl' ; import { Form , FormItemTypes , MultiField , ExternalDataProvider , Repeater , Section , SubSection , DataProviderItem , DataProviderPermissionItem , } from '../types/Form' ; export function buildForm ( data ) { return { ... data , type : FormItemTypes . FORM } ; } export function buildMultiField ( data ) { return { ... data , type : FormItemTypes . MULTI_FIELD } ; } export function buildRepeater ( data ) { return { ... data , type : FormItemTypes . REPEATER } ; } export function buildSection ( data ) { return { ... data , type : FormItemTypes . SECTION } ; } export function buildSubSection ( data ) { return { ... data , type : FormItemTypes . SUB_SECTION } ; } export function buildExternalDataProvider ( data ) { return { ... data , isPartOfRepeater : false , children : undefined , type : FormItemTypes . EXTERNAL_DATA_PROVIDER , } ; } export function buildDataProviderItem ( data ) { return data ; } export function buildDataProviderPermissionItem ( data ) { return data ; }