Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "ui/EntityProperty"

Index

Variables

Const EntityProperty

EntityProperty: (Anonymous function) & object = injectMainStore(observer((props: EntityPropertyProps) =><EntityPropertyFormattedValue {...props}/>))

Const EntityPropertyFormattedValue

EntityPropertyFormattedValue: (Anonymous function) = observer((props: EntityPropertyProps) => {const {entityName,propertyName,value,showLabel = true,hideIfEmpty = true,mainStore,} = props;if (hideIfEmpty && value == null) {return null;}if (!showLabel) {return <div>{formatValue(toJS(value))}</div>;}// store not ready yetif (!mainStore || !mainStore.messages || !mainStore.metadata || !mainStore.enums) {return null;}const propertyFullName = entityName + '.' + propertyName;const label: string = mainStore.messages[propertyFullName];const propertyInfo: MetaPropertyInfo | null = getPropertyInfo(mainStore.metadata,entityName,propertyName);if (!propertyInfo) {throw new Error('Cannot find MetaPropertyInfo for property ' + propertyFullName);}const displayValue = propertyInfo.attributeType === 'ENUM'? getEnumCaption(value, propertyInfo, mainStore.enums): toDisplayValue(toJS(value), propertyInfo);return label != null? <div><strong>{label}:</strong> {formatValue(displayValue)}</div>: <div>{formatValue(displayValue)}</div>})

Functions

formatValue

  • formatValue(value: any): string

Generated using TypeDoc