Options
All
  • Public
  • Public/Protected
  • All
Menu

DORF Documentation

Index

Classes

Interfaces

Type aliases

Variables

Functions

Type aliases

InputType

InputType: "color" | "date" | "datetime" | "datetime-local" | "email" | "file" | "hidden" | "image" | "month" | "number" | "password" | "range" | "search" | "tel" | "text" | "time" | "url" | "week"

Represents all the possible input types.

NgDorfClassType

NgDorfClassType: string | IDorfCommonCssClasses | undefined

General type, used in DORF CSS interfaces. Classes should be passed as string values with spaces, but some definitions, like e.g. buttons, are nested within other definitions.

Variables

CHECKBOX

CHECKBOX: string = "dorf-checkbox"

Unique id for checkbox.

CONFIG_INTERFACE

CONFIG_INTERFACE: InjectionToken<string> = new InjectionToken<string>('config-interface')

Token which allows injecting an interface to the factory.

INPUT

INPUT: string = "dorf-input"

Unique id for input.

NESTED

NESTED: string = "dorf-nested-object"

Identifier for a nested object.

RADIO

RADIO: string = "dorf-radio"

Unique id for radio.

SELECT

SELECT: string = "dorf-select"

Unique id for select.

Functions

DorfCheckbox

  • annotation

    Assignes DorfCheckboxDefinition to a field. Field should be decorated with @DorfCheckbox() with parameters.

    example
    
     //
     @DorfObject()
     class TestDomainObject {
       @DorfCheckbox({
         label: "Is smart?",
         mapping: {
           trueValue: "yes",
           falseValue: "no"
         },
         updateModelOnChange: true
       })
       private _smart: string;
     }
    
    stable

    Parameters

    Returns (Anonymous function)

DorfForm

  • annotation

    Allows to render DORF form, which matches provided options. Adds additional behaviors like building metadata, reacting on changes, submitting the value. If no template/templateUrl specified in @Component(), it adds even a default template. @DorfForm() annotation should be added over @Component(), for the class which controls the form.

    example
    
     // order
     @DorfForm()
     @Component({selector: "test-domain-object-form"})
     class TestDomainObjectForm implements IDorfForm {
       @DorfObjectInput()
       private domainObject: Person;
    
       constructor(public config: DorfConfigService)
     }
    
    stable

    Parameters

    Returns (Anonymous function)

DorfInput

DorfNestedObject

DorfObject

  • DorfObject(): (Anonymous function)
  • annotation

    Adds information to the class, which is interpreted later by DORF mechanisms. Adds fieldDefinitions, based on property annotations. Results in something like DorfDomainObject extension.

    Class should be decorated with @DorfObject(). Then, chosen properties should be annotated as well.

    example
    
     //
     @DorfObject()
     class TestDomainObject {
       @DorfInput({
         type: "text",
         label: "Name",
         updateModelOnChange: true
       })
       private _name: string;
    
       @DorfSelect({
         optionsToSelect: [{
           key: 1,
           value: "red"
         }, {
           key: 2,
           value: "green"
         }, {
           key: 3,
           value: "blue"
         }],
         label: "Favourite color",
         updateModelOnChange: true
       })
       private _favColor: number;
    
       @DorfRadio({
         optionsToSelect: [{
           key: "m",
           value: "male"
         }, {
           key: "f",
           value: "female"
         }],
         label: "Gender",
         updateModelOnChange: true
       })
       private _gender: string;
    
       @DorfCheckbox({
         label: "Is smart?",
         mapping: {
           trueValue: "yes",
           falseValue: "no"
         },
         updateModelOnChange: true
       })
       private _smart: string;
     }
    
    stable

    Returns (Anonymous function)

DorfObjectInput

  • DorfObjectInput(): (Anonymous function)
  • annotation

    Wrapps [Angular's Input]{@link Input} and stores property name for future processing by DorfForm. One field should be decorated with @DorfObjectInput() within @DorfForm().

    example
    
     // order
     @DorfForm()
     @Component({selector: "test-domain-object-form"})
     class TestDomainObjectForm implements IDorfForm {
       @DorfObjectInput()
       private domainObject: Person;
    
       constructor(public config: DorfConfigService)
     }
    
    stable

    Returns (Anonymous function)

DorfRadio

  • annotation

    Assignes DorfRadioDefinition to a field. Field should be decorated with @DorfRadio() with parameters.

    example
    
     //
     @DorfObject()
     class TestDomainObject {
       @DorfRadio({
         optionsToSelect: [{
           key: "m",
           value: "male"
         }, {
           key: "f",
           value: "female"
         }],
         label: "Gender",
         updateModelOnChange: true
       })
       private _gender: string;
     }
    
    stable

    Parameters

    Returns (Anonymous function)

DorfSelect

  • annotation

    Assignes DorfSelectDefinition to a field. Field should be decorated with @DorfSelect() with parameters.

    example
    
     //
     @DorfObject()
     class TestDomainObject {
       @DorfSelect({
         optionsToSelect: [{
           key: 1,
           value: "red"
         }, {
           key: 2,
           value: "green"
         }, {
           key: 3,
           value: "blue"
         }],
         label: "Favourite color",
         updateModelOnChange: true
       })
       private _favColor: number;
     }
    
    stable

    Parameters

    Returns (Anonymous function)

configFactory

createPropertyDecorator

  • Helper for wrapping a property decorator. Should be used also for creating custom fields.

    example
    
     //
     export function CustomDecorator(options: IDorfCustomDefinition) {
       return createPropertyDecorator(new DorfCustomDefinition(options));
     }
    
    stable

    Parameters

    Returns (Anonymous function)

getBuiltInFields

getFieldForTagFromArray

groupMetadata

isObservable

  • isObservable(obj: any | Observable<any>): boolean
  • Determines if the argument is an Observable.

    Parameters

    • obj: any | Observable<any>

    Returns boolean

isPromise

  • isPromise(obj: any): boolean
  • Determines if the argument is shaped like a Promise.

    Parameters

    • obj: any

    Returns boolean

setFieldInArray

Generated using TypeDoc