Skip to main content

Introducing Workflow Engine, try for FREE workflowengine.io.

Class: Model<T>

Represents component metadata for the form viewer.

Type Parameters

T = any

the type of React component properties.

Constructors

new Model()

new Model<T>(component, name?, actionsInitializer?, valued?, valueType?, defaultProps?, css?, wrapperCss?, typeName?, icon?, kind?, readOnly?, propsBindingTypes?): Model<T>

Creates component metadata for the form viewer.

Parameters

component: ComponentType<T>

the React component.

name?: string

the component name.

actionsInitializer?: ActionsInitializer

the function to initialize actions in the component.

valued?: string

the name of the component property where the component value is stored.

valueType?: keyof SchemaTypeMap

the type of the component value.

defaultProps?: Readonly<Record<string, any>>

the component's default property values.

css?: Css

the component's CSS values.

wrapperCss?: Css

the component's wrapper CSS values.

typeName?: string

the component type name.

icon?: ComponentType

the component icon.

kind?: ComponentKind = 'component'

the component kind.

readOnly?: string

the name of the component property that stores the read-only flag.

propsBindingTypes?: Readonly<Record<string, ComponentPropertyBindType>> = {}

the component property binding types.

Returns

Model<T>

Properties

actionsInitializer?

readonly optional actionsInitializer: ActionsInitializer

the function to initialize actions in the component.


component

readonly component: ComponentType<T>

The React component.


css?

readonly optional css: Css

the component's CSS values.


defaultProps?

readonly optional defaultProps: Readonly<Record<string, any>>

the component's default property values.


icon?

readonly optional icon: ComponentType

the component icon.


kind

readonly kind: ComponentKind = 'component'

the component kind.


propsBindingTypes

readonly propsBindingTypes: Readonly<Record<string, ComponentPropertyBindType>> = {}

the component property binding types.


readOnly?

readonly optional readOnly: string

the name of the component property that stores the read-only flag.


typeName?

readonly optional typeName: string

the component type name.


valueType?

readonly optional valueType: keyof SchemaTypeMap

the type of the component value.


valued?

readonly optional valued: string

the name of the component property where the component value is stored.


wrapperCss?

readonly optional wrapperCss: Css

the component's wrapper CSS values.

Accessors

name

Get Signature

get name(): string

Returns

string

the component name, or type if there is no component name.


type

Get Signature

get type(): string

Returns

string

the component type name.