Skip to main content

Introducing Workflow Engine, try for FREE workflowengine.io.

Class: Model<T>

@react-form-builder/core.Model

Represents component metadata for the form viewer.

Type parameters

NameTypeDescription
Tanythe type of React component properties.

Constructors

constructor

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

Creates component metadata for the form viewer.

Type parameters

NameTypeDescription
Tanythe type of React component properties.

Parameters

NameTypeDefault valueDescription
componentComponentType<T>undefinedthe React component.
name?stringundefinedthe component name.
actionsInitializer?ActionsInitializerundefinedthe function to initialize actions in the component.
valued?stringundefinedthe name of the component property where the component value is stored.
valueType?keyof SchemaTypeMapundefinedthe type of the component value.
defaultProps?Readonly<Record<string, any>>undefinedthe component's default property values.
css?Cssundefinedthe component's CSS values.
wrapperCss?Cssundefinedthe component's wrapper CSS values.
typeName?stringundefinedthe component type name.
icon?ComponentTypeundefinedthe component icon.
kindComponentKind'component'the component kind.

Properties

actionsInitializer

Optional Readonly actionsInitializer: ActionsInitializer

the function to initialize actions in the component.


component

Readonly component: ComponentType<T>

The React component.


css

Optional Readonly css: Css

the component's CSS values.


defaultProps

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

the component's default property values.


icon

Optional Readonly icon: ComponentType

the component icon.


kind

Readonly kind: ComponentKind = 'component'

the component kind.


typeName

Optional Readonly typeName: string

the component type name.


valueType

Optional Readonly valueType: keyof SchemaTypeMap

the type of the component value.


valued

Optional Readonly valued: string

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


wrapperCss

Optional Readonly wrapperCss: Css

the component's wrapper CSS values.

Accessors

name

get name(): string

Returns

string

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


type

get type(): string

Returns

string

the component type name.