Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ControlMapper<TControlBaseType, TClientControlSettings>

Type parameters

  • TControlBaseType

  • TClientControlSettings

Hierarchy

  • ControlMapper

Index

Constructors

constructor

  • new ControlMapper(_repository: BaseRepository, ControlBaseType: object, _clientControlSettingsFactory: function, _defaultControlType?: undefined | object, _defaultFieldSettingControlType?: undefined | object): ControlMapper
  • Parameters

    • _repository: BaseRepository
    • ControlBaseType: object
      • constructor: function
        • new __type(...args: any[]): TControlBaseType
    • _clientControlSettingsFactory: function
        • Parameters

          Returns TClientControlSettings

    • Optional _defaultControlType: undefined | object
    • Optional _defaultFieldSettingControlType: undefined | object

    Returns ControlMapper

Properties

ControlBaseType

ControlBaseType: object

Type declaration

  • constructor: function
    • new __type(...args: any[]): TControlBaseType

Methods

CreateClientSetting

  • CreateClientSetting<TFieldSetting>(fieldSetting: TFieldSetting): TClientControlSettings
  • Creates a ClientSetting from a specified FieldSetting based on the assigned Factory method

    Type parameters

    Parameters

    • fieldSetting: TFieldSetting

      The FieldSetting object that should be used for creating the new Setting entry

    Returns TClientControlSettings

    the created or transformed Client Setting

GetControlForContentField

  • GetControlForContentField<TContentType, TField>(contentType: object, fieldName: TField, actionName: ActionName): object
  • Type parameters

    • TContentType: IContent

    • TField: keyof TContentType

    Parameters

    • contentType: object

      The type of the content (e.g. ContentTypes.Task)

      • constructor: function
        • new __type(...args: any[]): TContentType
    • fieldName: TField

      The name of the field (must be one of the ContentType's fields), e.g. 'DisplayName'

    • actionName: ActionName

      The name of the Action (can be 'new' / 'edit' / 'view')

    Returns object

    The assigned Control constructor or the default Field control

    • constructor: function
      • new __type(...args: any[]): TControlBaseType

GetControlForContentType

  • GetControlForContentType<TContentType>(contentType: object): object
  • Type parameters

    Parameters

    • contentType: object
      • constructor: function
        • new __type(...args: any[]): TContentType

    Returns object

    The mapped control, Default if nothing is mapped.

    • constructor: function
      • new __type(...args: any[]): TControlBaseType

GetControlForFieldSetting

  • GetControlForFieldSetting<TFieldSettingType>(fieldSetting: TFieldSettingType): object
  • Type parameters

    Parameters

    • fieldSetting: TFieldSettingType

      The FieldSetting to get the control class.

    Returns object

    The specified FieldSetting control

    • constructor: function
      • new __type(...args: any[]): TControlBaseType

GetFullSchemaForContent

  • GetFullSchemaForContent<TContentType>(content: TContentType, actionName: ActionName): ControlSchema<TControlBaseType, TClientControlSettings>
  • Gets the full ControlSchema object for a specific Content

    Type parameters

    Parameters

    • content: TContentType
    • actionName: ActionName

      The name of the Action (can be 'new' / 'edit' / 'view')

    Returns ControlSchema<TControlBaseType, TClientControlSettings>

    the fully created ControlSchema

GetFullSchemaForContentType

  • GetFullSchemaForContentType<TContentType, K>(contentType: object, actionName: ActionName): ControlSchema<TControlBaseType, TClientControlSettings>
  • Gets the full ControlSchema object for a specific ContentType

    Type parameters

    • TContentType: IContent

    • K: keyof TContentType

    Parameters

    • contentType: object

      The type of the Content (e.g. ContentTypes.Task)

      • constructor: function
        • new __type(...args: any[]): TContentType
    • actionName: ActionName

      The name of the Action (can be 'new' / 'edit' / 'view')

    Returns ControlSchema<TControlBaseType, TClientControlSettings>

    the fully created ControlSchema

MapContentTypeToControl

  • MapContentTypeToControl(contentType: object, control: object): this
  • Maps a specified Control to a Content type

    Parameters

    • contentType: object
    • control: object

      The Control for the content

      • constructor: function
        • new __type(...args: any[]): TControlBaseType

    Returns this

SetClientControlFactory

  • SetClientControlFactory<TFieldSetting>(fieldSettingType: object, factoryMethod: function): this
  • Sets up a Factory method to create library-specific settings from FieldSettings per type

    Type parameters

    Parameters

    • fieldSettingType: object

      The type of the FieldSetting (e.g. FieldSettings.ShortTextFieldSetting)

      • constructor: function
        • new __type(...args: any[]): TFieldSetting
    • factoryMethod: function

      The factory method that constructs or transforms the Settings object

        • (setting: TFieldSetting): TClientControlSettings
        • Parameters

          • setting: TFieldSetting

          Returns TClientControlSettings

    Returns this

SetupFieldSettingDefault

  • SetupFieldSettingDefault<TFieldSettingType>(fieldSetting: object, setupControl: function): this
  • Type parameters

    Parameters

    • fieldSetting: object

      The FieldSetting to get the control for.

      • constructor: function
        • new __type(...args: any[]): TFieldSettingType
    • setupControl: function

      Callback method that returns a Control Type based on the provided FieldSetting

        • (fieldSetting: TFieldSettingType): object
        • Parameters

          • fieldSetting: TFieldSettingType

          Returns object

          • constructor: function
            • new __type(...args: any[]): TControlBaseType

    Returns this

    the Mapper instance (can be used fluently)

SetupFieldSettingForControl

  • SetupFieldSettingForControl<TFieldSettingType, TContentType, TField>(contentType: object, fieldName: TField, setupControl: function, fieldSetting?: undefined | object): this
  • Type parameters

    Parameters

    • contentType: object

      The Content Type

      • constructor: function
        • new __type(...args: any[]): TContentType
    • fieldName: TField

      The name of the field on the Content Type

    • setupControl: function

      The callback function that will setup the Control

        • (fieldSetting: TFieldSettingType): object
        • Parameters

          • fieldSetting: TFieldSettingType

          Returns object

          • constructor: function
            • new __type(...args: any[]): TControlBaseType
    • Optional fieldSetting: undefined | object

      Optional type hint for the FieldSetting

    Returns this

Generated using TypeDoc