Saltar al contenido principal

SmartFormElement

Todos los formularios de Totalum se hace con el Smart Form


import { DataStructure, DataValues, fieldValuesEnabled, StructureProperty } from './data-structure';
import { PageStructure } from './page-structure';
export interface SmartFormElement {
index: number,
inputs: SmartFormInput[],
pageStructure: PageStructure,
typeDefinition: DataStructure,
elementReference: DataValues | any,
insertedId?: string,
structureLevelspropertyId?: string
}

export interface SmartFormInput {
propertyDefinition: StructureProperty,
key: string,
value: fieldValuesEnabled | any | SmartFormInputFileValue,
specialInputType?: string,
index?: number,
fatherIndex?: number,
temporalObjectReferences?: {[nameProperty: string]: string[]}, // saves temporaly the object references of the inputs with type 'objectReference' of an object that is still not created
}

export interface SmartFormInputFileValue {
file?: any,
name?: string,
type?: string,
previousFilename?: string // this one is to compare if file changed and to delete the old one
}

export interface SmartFormConfig {
formType?: 'fastDataEditor' | 'objectDetails';
formulasConfig?: any,
returnTheForm?: boolean,
resetFormWhenSubmit?: boolean,
onlyRequired?: boolean,
selectInputs?: boolean,
elementReferences?: any,
objDetailsForm?: boolean,
disableRequiredToSubmit?: boolean
}

export interface SubmitButtonDataUpdated {
disabled: boolean,
isFormSaving: boolean
}