Class: Model<T>
@react-form-builder/core.Model
Represents component metadata for the form viewer.
Type parameters
Name | Type | Description |
---|---|---|
T | any | the 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
Name | Type | Description |
---|---|---|
T | any | the type of React component properties. |
Parameters
Name | Type | Default value | Description |
---|---|---|---|
component | ComponentType <T > | undefined | the React component. |
name? | string | undefined | the component name. |
actionsInitializer? | ActionsInitializer | undefined | the function to initialize actions in the component. |
valued? | string | undefined | the name of the component property where the component value is stored. |
valueType? | keyof SchemaTypeMap | undefined | the type of the component value. |
defaultProps? | Readonly <Record <string , any >> | undefined | the component's default property values. |
css? | Css | undefined | the component's CSS values. |
wrapperCss? | Css | undefined | the component's wrapper CSS values. |
typeName? | string | undefined | the component type name. |
icon? | ComponentType | undefined | the component icon. |
kind | ComponentKind | '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.