Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "ui/form/Form"

Index

Type aliases

AssociationOptionsReactionData

AssociationOptionsReactionData: [string[], IObservableArray<MetaClassInfo> | undefined, boolean | undefined]

EnumFieldProps

EnumFieldProps: MainStoreInjected & SelectProps<SelectValue> & object

FormFieldComponentProps

FormFieldComponentProps: SelectProps<SelectValue> | InputProps | InputNumberProps | CheckboxProps | DatePickerProps | TimePickerProps | FileUploadProps | NestedEntityFieldProps | NestedEntitiesTableFieldProps

FormFieldProps

FormFieldProps: MainStoreInjected & object & FormFieldComponentProps

Variables

Const EntityEditor

EntityEditor: FunctionComponent<object & object> & object = injectIntl<'intl', EntityEditorProps>(EntityEditorComponent)

Const EnumField

EnumField: (Anonymous function) & object = injectMainStore(observer(({enumClass, mainStore, ...rest}: EnumFieldProps) => {let enumValues: EnumValueInfo[] = [];if (mainStore!.enums != null) {const enumInfo = mainStore!.enums.find((enm: EnumInfo) => enm.name === enumClass);if (enumInfo != null) {enumValues = enumInfo.values;}}return <Select {...rest} >{enumValues.map(enumValue =><Select.Option key={enumValue.name} value={enumValue.name}>{enumValue.caption}</Select.Option>)}</Select>}))

Const Field

Field: (Anonymous function) & object = injectMainStore(observer((props: FieldProps) => {const {entityName, propertyName, optionsContainer, mainStore, componentProps,nestedEntityView, parentEntityInstanceId, disabled, formItemProps} = props;return (<FieldPermissionContainer entityName={entityName} propertyName={propertyName} renderField={(isReadOnly: boolean) => {return <Form.Item {...{...getDefaultFormItemProps(mainStore?.metadata, entityName, propertyName), ...formItemProps}}><FormField entityName={entityName}propertyName={propertyName}disabled={isReadOnly || disabled}optionsContainer={optionsContainer}nestedEntityView={nestedEntityView}parentEntityInstanceId={parentEntityInstanceId}{...componentProps}/></Form.Item>}}/>);}))

Const FormField

FormField: ForwardRefExoticComponent<MainStoreInjected & object & FileUploadProps & RefAttributes<unknown> | MainStoreInjected & object & InputNumberProps & RefAttributes<unknown> | MainStoreInjected & object & InputProps & RefAttributes<unknown> | MainStoreInjected & object & SelectProps<string | number | LabeledValue | (string | number)[] | LabeledValue[]> & RefAttributes<unknown> | MainStoreInjected & object & CheckboxProps & RefAttributes<unknown> | MainStoreInjected & object & object & object & RefAttributes<unknown> | MainStoreInjected & object & object & object & RefAttributes<unknown> | MainStoreInjected & object & object & object & RefAttributes<unknown> | MainStoreInjected & object & TimePickerProps & RefAttributes<unknown> | MainStoreInjected & object & NestedEntityFieldProps & RefAttributes<unknown> | MainStoreInjected & object & NestedEntitiesTableFieldProps & RefAttributes<unknown>> & object = injectMainStore(observer(React.forwardRef((props: FormFieldProps, _ref: any) => {const {entityName, propertyName, optionsContainer, mainStore, nestedEntityView, parentEntityInstanceId,...rest} = props;if (mainStore == null || mainStore.metadata == null) {return <Input {...(rest as InputProps)}/>;}const propertyInfo = getPropertyInfo(mainStore!.metadata, entityName, propertyName);if (propertyInfo == null) {return <Input {...(rest as InputProps)}/>}if (isFileProperty(propertyInfo)) {return <FileUpload {...(rest as FileUploadProps)}/>;}switch (propertyInfo.attributeType) {case 'ENUM':return <EnumField enumClass={propertyInfo.type} allowClear={getAllowClear(propertyInfo)} {...rest as SelectProps<SelectValue> & MainStoreInjected}/>;case 'ASSOCIATION':const mode = getSelectMode(propertyInfo.cardinality);return <EntitySelectField {...{mode, optionsContainer}} allowClear={getAllowClear(propertyInfo)} {...rest}/>;case 'COMPOSITION':if (nestedEntityView) {const nestedEntityName = mainStore.metadata.find((metaClass: MetaClassInfo) => metaClass.entityName === entityName)?.properties.find((property: MetaPropertyInfo) => property.name === propertyName)?.type;if (nestedEntityName) {if (propertyInfo.cardinality === 'ONE_TO_ONE') {return <NestedEntityField nestedEntityName={nestedEntityName}nestedEntityView={nestedEntityView}{...(rest as NestedEntityFieldProps)}/>;}if (propertyInfo.cardinality === 'ONE_TO_MANY') {return <NestedEntitiesTableField nestedEntityName={nestedEntityName}nestedEntityView={nestedEntityView}parentEntityName={entityName}parentEntityInstanceId={parentEntityInstanceId}{...(rest as NestedEntitiesTableFieldProps)}/>;}}}return null;}switch (propertyInfo.type as PropertyType) {case 'boolean':return <Checkbox {...(rest as CheckboxProps)}/>;case 'date':case 'localDate':return <DatePicker {...(rest as DatePickerProps)}/>;case 'dateTime':case 'localDateTime':case 'offsetDateTime':return <DatePicker showTime={true} {...(rest as DatePickerProps & {showTime?: boolean | object})}/>;case 'time':case 'localTime':case 'offsetTime':return <TimePicker {...(rest as TimePickerProps)}/>;case 'int':return <IntegerInput {...(rest as InputNumberProps)}/>;case 'double':return <DoubleInput {...(rest as InputNumberProps)}/>;case 'long':return <LongInput {...(rest as InputNumberProps)}/>;case 'decimal':return <BigDecimalInput {...(rest as InputNumberProps)}/>;case 'uuid':return <UuidInput {...(rest as InputProps)}/>}return <Input {...(rest as InputProps)}/>;})))

Const NestedEntitiesTableField

NestedEntitiesTableField: ForwardRefExoticComponent<object & object & RefAttributes<any>> & object = injectIntl(NestedEntitiesTableFieldComponent)

Const NestedEntityField

NestedEntityField: ForwardRefExoticComponent<object & object & RefAttributes<any>> & object = injectIntl(NestedEntityFieldComponent)

Functions

Const defaultHandleFinish

  • defaultHandleFinish<E>(values: Record<string, any>, dataInstance: DataInstanceStore<E>, intl: IntlShape, formInstance: FormInstance, commitMode?: CommitMode): Promise<object>
  • Type parameters

    • E: unknown

    Parameters

    • values: Record<string, any>
    • dataInstance: DataInstanceStore<E>
    • intl: IntlShape
    • formInstance: FormInstance
    • Optional commitMode: CommitMode

    Returns Promise<object>

getAllowClear

  • getAllowClear(propertyInfo: MetaPropertyInfo): boolean

getDefaultFormItemProps

  • getDefaultFormItemProps(metadata: MetaClassInfo[] | undefined, entityName: string, propertyName: string): FormItemProps

getEntityProperties

  • getEntityProperties(entityName: string, fields: string[], metadata: MetaClassInfo[]): MetaPropertyInfo[]

getSelectMode

  • getSelectMode(cardinality: Cardinality): "default" | "multiple"

isDisplayedProperty

  • isDisplayedProperty(property: MetaPropertyInfo): boolean

Generated using TypeDoc