Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Classes

Interfaces

Type aliases

Variables

Functions

Type aliases

DataContainerError

DataContainerError: "COMMIT_ERROR" | "LOAD_ERROR"

DataContainerStatus

DataContainerStatus: "CLEAN" | "LOADING" | "DONE" | "ERROR"

WithId

WithId: { id?: string | object }

Type declaration

  • Optional id?: string | object

WithName

WithName: { name?: string }

Type declaration

  • Optional name?: string

Variables

Const Collection

Collection: typeof CollectionComponent = ...

Const DEFAULT_DATE_FORMAT

DEFAULT_DATE_FORMAT: "YYYY-MM-DD" = 'YYYY-MM-DD'

Const DEFAULT_DATE_TIME_DATA_TRANSFER_FORMAT

DEFAULT_DATE_TIME_DATA_TRANSFER_FORMAT: "YYYY-MM-DDTHH:mm:ss.SSS" = 'YYYY-MM-DDTHH:mm:ss.SSS'

Const DEFAULT_DATE_TIME_DISPLAY_FORMAT

DEFAULT_DATE_TIME_DISPLAY_FORMAT: "YYYY-MM-DD HH:mm:ss" = 'YYYY-MM-DD HH:mm:ss'

Const DEFAULT_TIME_FORMAT

DEFAULT_TIME_FORMAT: "HH:mm:ss" = 'HH:mm:ss'

Const Instance

Instance: typeof InstanceComponent = ...

Const JmixAppProvider

JmixAppProvider: React.FC<JmixAppProviderProps> = ...

Const OFFSET_DATE_TIME_DATE_TRANSFER_FORMAT

OFFSET_DATE_TIME_DATE_TRANSFER_FORMAT: "YYYY-MM-DDTHH:mm:ss.SSSZ" = 'YYYY-MM-DDTHH:mm:ss.SSSZ'

Const OFFSET_DATE_TIME_DISPLAY_FORMAT

OFFSET_DATE_TIME_DISPLAY_FORMAT: "YYYY-MM-DD HH:mm:ss" = 'YYYY-MM-DD HH:mm:ss'

Const OFFSET_TIME_DATA_TRANSFER_FORMAT

OFFSET_TIME_DATA_TRANSFER_FORMAT: "HH:mm:ssZ" = 'HH:mm:ssZ'

Const OFFSET_TIME_DISPLAY_FORMAT

OFFSET_TIME_DISPLAY_FORMAT: "HH:mm:ss" = 'HH:mm:ss'

Const TEMPORARY_ENTITY_ID_PREFIX

TEMPORARY_ENTITY_ID_PREFIX: "_CUBA_TEMPORARY_ENTITY_ID_" = '_CUBA_TEMPORARY_ENTITY_ID_'

Const defaultDataTransferFormats

defaultDataTransferFormats: Partial<Record<PropertyType, string>> = ...

Const defaultDisplayFormats

defaultDisplayFormats: Partial<Record<PropertyType, string>> = ...

Const defaultOpts

defaultOpts: DataCollectionOptions = ...

Functions

Const AccessControl

  • This component can be used to conditionally render other components (which we call access-controlled components) based on user permissions and other conditions.

    This component is intended to be used in complex cases (such as when requirements includes multiple types of permissions, e.g. an entity permission and a specific permission). In most cases simpler components should be used instead: EntityPermAccessControl when condition involves a single entity CRUD permission, AttrPermAccessControl when condition involves a single entity attribute permission.

    Parameters

    Returns null | Element

Const AttrPermAccessControl

  • AttrPermAccessControl(props: PropsWithChildren<AttrPermAccessControlProps>): Element
  • This component can be used to conditionally render other components (which we call access-controlled components) based on a single entity attribute permission.

    Parameters

    • props: PropsWithChildren<AttrPermAccessControlProps>

    Returns Element

Const EntityPermAccessControl

  • EntityPermAccessControl(props: PropsWithChildren<EntityPermAccessControlProps>): Element
  • This component can be used to conditionally render other components (which we call access-controlled components) based on a single entity (CRUD) permission.

    Parameters

    • props: PropsWithChildren<EntityPermAccessControlProps>

    Returns Element

applyDataTransferFormat

  • applyDataTransferFormat(value: Moment, type: PropertyType): string

applyDisplayFormat

  • applyDisplayFormat(value: Moment, type: PropertyType): string

assertNever

  • assertNever(argumentName: string, argument: never): never
  • To be used in (supposedly) unreachable code after exhaustive check of argument.

    remarks

    Will cause a compile-time error if argument was not exhaustively checked. Will cause a runtime error if reached.

    Parameters

    • argumentName: string
    • argument: never

    Returns never

Const clientSideCollection

Const collection

data

  • data<T>(containers: T): DataContext<T>

defaultCompare

  • defaultCompare(valA: any, valB: any, sortOrderModifier?: -1 | 1): number

extractName

  • extractName(fileRef: string): string
  • Extracts file name from FileRef string

    Parameters

    • fileRef: string

    Returns string

formFieldsToInstanceItem

  • formFieldsToInstanceItem<T>(formFields: Record<string, any>, entityName: string, metadata: MetaClassInfo[], stringIdName?: string): Record<string, any>
  • Transforms the antd Form fields values into format expected by Instance item, which is generally the same as the format expected by REST API, except that Instance item may have the following properties that are stripped before the commit:

    • a temporary id created client-side
    • read-only attributes

    Type parameters

    • T

    Parameters

    Returns Record<string, any>

fromRestModel

  • fromRestModel<T>(items: SerializedEntity<T>[], stringIdName?: string): SerializedEntity<T>[]
  • Type parameters

    • T

    Parameters

    • items: SerializedEntity<T>[]
    • Optional stringIdName: string

    Returns SerializedEntity<T>[]

Const generateTemporaryEntityId

  • generateTemporaryEntityId(): string

getDataTransferFormat

  • getDataTransferFormat(type: PropertyType): string | undefined

getDisplayFormat

  • getDisplayFormat(type: PropertyType): string | undefined

getEnumCaption

  • getEnumCaption(enumValueName: string, propertyInfo: MetaPropertyInfo, enums: EnumInfo[]): string | undefined
  • Parameters

    • enumValueName: string
    • propertyInfo: MetaPropertyInfo
    • enums: EnumInfo[]

    Returns string | undefined

getJmixAppConfig

getJmixREST

  • getJmixREST(): JmixRestConnection | undefined

getMainStore

getMenuItems

getPropertyCaption

  • getPropertyCaption(propertyName: string, entityName: string, messages: EntityMessages): string
  • Parameters

    • propertyName: string
    • entityName: string
    • messages: EntityMessages

    Returns string

    localized entity property caption

getPropertyInfo

  • getPropertyInfo(metadata: MetaClassInfo[], entityName: string, propertyName: string): MetaPropertyInfo | null
  • Parameters

    • metadata: MetaClassInfo[]
    • entityName: string
    • propertyName: string

    Returns MetaPropertyInfo | null

getPropertyInfoNN

  • getPropertyInfoNN(propertyName: string, entityName: string, metadata: MetaClassInfo[]): MetaPropertyInfo
  • A non-nullable version of getPropertyInfo

    throws

    Error when propertyInfo is null

    Parameters

    • propertyName: string
    • entityName: string
    • metadata: MetaClassInfo[]

    Returns MetaPropertyInfo

injectMainStore

  • injectMainStore<T>(target: T): T & IWrappedComponent<T>
  • Type parameters

    • T: IReactComponent<any>

    Parameters

    • target: T

    Returns T & IWrappedComponent<T>

instance

instanceItemToFormFields

  • instanceItemToFormFields<T>(item: Record<string, any> | undefined, entityName: string, metadata: MetaClassInfo[], displayedProperties?: string[], stringIdName?: string): Record<string, any>
  • Transforms the provided item into the format expected by Ant Design Form fields.

    Type parameters

    • T

      entity type.

    Parameters

    • item: Record<string, any> | undefined

      entity instance to be transformed.

    • entityName: string
    • metadata: MetaClassInfo[]

      entities metadata.

    • Optional displayedProperties: string[]

      entity properties that should be included in the result. If not provided, all properties will be included.

    • Optional stringIdName: string

    Returns Record<string, any>

isAnyDateProperty

  • isAnyDateProperty(propertyInfo: MetaPropertyInfo): boolean

isAnyDateTimeProperty

  • isAnyDateTimeProperty(propertyInfo: MetaPropertyInfo): boolean

isAnyTimeProperty

  • isAnyTimeProperty(propertyInfo: MetaPropertyInfo): boolean

isAssociation

  • isAssociation(__namedParameters: MetaPropertyInfo): boolean

isByteArray

  • isByteArray(__namedParameters: MetaPropertyInfo): boolean

isComposition

  • isComposition(__namedParameters: MetaPropertyInfo): boolean

isDateProperty

  • isDateProperty(__namedParameters: MetaPropertyInfo): boolean

isDateTimeProperty

  • isDateTimeProperty(__namedParameters: MetaPropertyInfo): boolean

isFileProperty

  • isFileProperty(__namedParameters: MetaPropertyInfo): boolean

isLocalDateProperty

  • isLocalDateProperty(__namedParameters: MetaPropertyInfo): boolean

isLocalDateTimeProperty

  • isLocalDateTimeProperty(__namedParameters: MetaPropertyInfo): boolean

isLocalTimeProperty

  • isLocalTimeProperty(__namedParameters: MetaPropertyInfo): boolean

isManyToManyAssociation

  • isManyToManyAssociation(propertyInfo: MetaPropertyInfo): boolean

isManyToManyRelation

  • isManyToManyRelation(__namedParameters: MetaPropertyInfo): boolean

isManyToOneAssociation

  • isManyToOneAssociation(propertyInfo: MetaPropertyInfo): boolean

isManyToOneRelation

  • isManyToOneRelation(__namedParameters: MetaPropertyInfo): boolean

isOffsetDateTimeProperty

  • isOffsetDateTimeProperty(__namedParameters: MetaPropertyInfo): boolean

isOffsetTimeProperty

  • isOffsetTimeProperty(__namedParameters: MetaPropertyInfo): boolean

isOneToManyAssociation

  • isOneToManyAssociation(propertyInfo: MetaPropertyInfo): boolean

isOneToManyComposition

  • isOneToManyComposition(propertyInfo: MetaPropertyInfo): boolean

isOneToManyRelation

  • isOneToManyRelation(__namedParameters: MetaPropertyInfo): boolean

isOneToOneAssociation

  • isOneToOneAssociation(propertyInfo: MetaPropertyInfo): boolean

isOneToOneComposition

  • isOneToOneComposition(propertyInfo: MetaPropertyInfo): boolean

isOneToOneRelation

  • isOneToOneRelation(__namedParameters: MetaPropertyInfo): boolean

isPropertyTypeSupported

  • isPropertyTypeSupported(propertyInfo: MetaPropertyInfo): boolean

isRelationProperty

  • isRelationProperty(propertyInfo: MetaPropertyInfo): boolean

isTemporalProperty

  • isTemporalProperty(propertyInfo: MetaPropertyInfo): boolean

isTimeProperty

  • isTimeProperty(__namedParameters: MetaPropertyInfo): boolean

isToManyAssociation

  • isToManyAssociation(propertyInfo: MetaPropertyInfo): boolean

isToManyRelation

  • isToManyRelation(__namedParameters: MetaPropertyInfo): boolean

isToOneAssociation

  • isToOneAssociation(propertyInfo: MetaPropertyInfo): boolean

isToOneRelation

  • isToOneRelation(__namedParameters: MetaPropertyInfo): boolean

Const loadAllAssociationOptions

  • loadAllAssociationOptions(entityProperties: MetaPropertyInfo[], entityName: string, getAttributePermission: (entityName: string, attributeName: string) => EntityAttrPermissionValue, opts?: DataCollectionOptions): Map<string, undefined | DataCollectionStore<Partial<WithId & SerializedEntityProps>>>
  • Invokes Generic REST API to retrieve the lists of possible options for each Association attribute of a given entity (possible options meaning entity instances that can be used as a value of that attribute). Requests will be sent only for the attributes that the user is permitted to read. Returns a Map where keys are associated entity names and values are DataCollectionStore instances (see CUBA React Core API Reference) or undefined if the user doesn't have a permission to read the attribute. The map is returned immediately, but each DataCollectionStore will only contain the retrieved options once the corresponding request to Generic REST API is complete. Upon successfull request, a DataCollectionStore will contain the retrieved options as its items property (MobX observable).

    Parameters

    • entityProperties: MetaPropertyInfo[]

      entity properties metadata

    • entityName: string
    • getAttributePermission: (entityName: string, attributeName: string) => EntityAttrPermissionValue

      function returning user's permission for a given entity attribute

        • (entityName: string, attributeName: string): EntityAttrPermissionValue
        • Parameters

          • entityName: string
          • attributeName: string

          Returns EntityAttrPermissionValue

    • Optional opts: DataCollectionOptions

      DataCollectionStore configuration options

    Returns Map<string, undefined | DataCollectionStore<Partial<WithId & SerializedEntityProps>>>

    a Map where keys are associated entity names and values are DataCollectionStore instances that will (once the requests to Generic REST API are complete) contain the retrieved options as their items property (MobX observable). If the user doesn't have a permission to read some of the attributes, the corresponding values will contain undefined.

Const loadAssociationOptions

  • loadAssociationOptions<E>(parentEntityName: string, attributeName: string, nestedEntityName: string, getAttributePermission: (entityName: string, attributeName: string) => EntityAttrPermissionValue, opts?: DataCollectionOptions): undefined | DataCollectionStore<E>
  • Invokes Generic REST API to retrieve the possible options for an Association attribute (i.e. entity instances that can be used as a value of that attribute). The request will be sent only if the user has a permission to read that attribute. Returns a DataCollectionStore instance (see CUBA React Core API Reference) or undefined if the user doesn't have a permission to read the attribute. The instance is returned immediately, but it will only contain the retrieved options once the request to Generic REST API is complete. The instance will contain the retrieved options as its items property (MobX observable).

    Type parameters

    • E

    Parameters

    • parentEntityName: string

      name of the entity containing an Association attribute

    • attributeName: string

      name of the Association attribute

    • nestedEntityName: string

      name of the entity contained in the Association attribute

    • getAttributePermission: (entityName: string, attributeName: string) => EntityAttrPermissionValue

      function returning user's permission for a given entity attribute

        • (entityName: string, attributeName: string): EntityAttrPermissionValue
        • Parameters

          • entityName: string
          • attributeName: string

          Returns EntityAttrPermissionValue

    • opts: DataCollectionOptions = ...

      DataCollectionStore configuration options

    Returns undefined | DataCollectionStore<E>

    a DataCollectionStore instance that will (once the request to Generic REST API is complete) contain the retrieved options as its items property (MobX observable). If the user doesn't have a permission to read the attribute, an undefined will be returned instead.

sortEntityInstances

  • sortEntityInstances<T>(items: SerializedEntity<T>[], sort: string | undefined): SerializedEntity<T>[]
  • Performs client-side sorting of entities, mimicking the way sorting is performed by REST API

    Type parameters

    • T

    Parameters

    • items: SerializedEntity<T>[]

      entity instances array

    • sort: string | undefined

      REST API parameter representing sort field and order

    Returns SerializedEntity<T>[]

stripMilliseconds

  • stripMilliseconds<P, R>(momentInstance: P): R
  • Type parameters

    • P: undefined | null | Moment

    • R = P extends Moment ? Moment : undefined

    Parameters

    • momentInstance: P

    Returns R

    a clone of provided Moment instance with milliseconds set to zero, or undefined if a nullish value was provided.

stripTemporaryIds

  • stripTemporaryIds(item: Record<string, any>): Record<string, any>
  • deprecated

    To be removed from public API

    Parameters

    • item: Record<string, any>

    Returns Record<string, any>

Const useCollection

Const useInstance

Const useMainStore

Const useReaction

  • useReaction<T>(expression: (reactionObject: IReactionPublic) => T, effect: (expressionResult: T, prevExpressionResult: T, reactionObject: IReactionPublic) => void, options?: IReactionOptions): void
  • A simple convenience hook that creates a reaction with provided expression, effect and options. Reaction will be created only once (will not be disposed/recreated between renders). Reaction will be automatically disposed when the component is unmounted. If this reaction creates other reactions, those reactions will NOT be disposed. In that case create a reaction manually inside a useEffect hook as described in mobx-react documentation.

    Type parameters

    • T: unknown

    Parameters

    • expression: (reactionObject: IReactionPublic) => T
        • (reactionObject: IReactionPublic): T
        • Parameters

          • reactionObject: IReactionPublic

          Returns T

    • effect: (expressionResult: T, prevExpressionResult: T, reactionObject: IReactionPublic) => void
        • (expressionResult: T, prevExpressionResult: T, reactionObject: IReactionPublic): void
        • Parameters

          • expressionResult: T
          • prevExpressionResult: T
          • reactionObject: IReactionPublic

          Returns void

    • Optional options: IReactionOptions

    Returns void

Const withDataCollection

  • withDataCollection(entityName: string, opts?: DataCollectionOptions): <T>(target: T) => T & IWrappedComponent<unknown>
  • Parameters

    Returns <T>(target: T) => T & IWrappedComponent<unknown>

      • <T>(target: T): T & IWrappedComponent<unknown>
      • Type parameters

        • T: IReactComponent<any>

        Parameters

        • target: T

        Returns T & IWrappedComponent<unknown>

Const withDataInstance

  • withDataInstance(entityName: string, opts?: DataInstanceOptions): <T>(target: T) => T & IWrappedComponent<unknown>
  • Parameters

    Returns <T>(target: T) => T & IWrappedComponent<unknown>

      • <T>(target: T): T & IWrappedComponent<unknown>
      • Type parameters

        • T: IReactComponent<any>

        Parameters

        • target: T

        Returns T & IWrappedComponent<unknown>

Generated using TypeDoc