Class: Model<T>
Represents component metadata for the form viewer.
Type Parameters
T
T = any
the type of React component properties.
Constructors
Constructor
new Model<
T>(component,name?,actionsInitializer?,valued?,valueType?,defaultProps?,css?,wrapperCss?,typeName?,kind?,readOnly?,propsBindingTypes?,uncontrolledValue?,disabled?,dataBindingType?,features?):Model<T>
Creates component metadata for the form viewer.
Parameters
component
ComponentType<T>
the React component.
name?
string
the component name.
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?
the component's CSS values.
wrapperCss?
the component's wrapper CSS values.
typeName?
string
the component type name.
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.
uncontrolledValue?
unknown
the value for the uncontrolled (undefined) state.
disabled?
string
the name of the component property that stores the disabled flag.
dataBindingType?
DataBindingType = 'none'
the type of component data binding.
features?
ComponentFeatures = {}
the component features that provide additional information about component's characteristic.
Returns
Model<T>
Properties
actionsInitializer?
readonlyoptionalactionsInitializer:ActionsInitializer
the function to initialize actions in the component.
component
readonlycomponent:ComponentType<T>
The React component.
css?
readonlyoptionalcss:Css
the component's CSS values.
dataBindingType
readonlydataBindingType:DataBindingType='none'
the type of component data binding.
defaultProps?
readonlyoptionaldefaultProps:Readonly<Record<string,any>>
the component's default property values.
disabled?
readonlyoptionaldisabled:string
the name of the component property that stores the disabled flag.
features
readonlyfeatures:ComponentFeatures={}
the component features that provide additional information about component's characteristic.
kind
readonlykind:ComponentKind='component'
the component kind.
propsBindingTypes
readonlypropsBindingTypes:Readonly<Record<string,ComponentPropertyBindType>> ={}
the component property binding types.
readOnly?
readonlyoptionalreadOnly:string
the name of the component property that stores the read-only flag.
typeName?
readonlyoptionaltypeName:string
the component type name.
uncontrolledValue?
readonlyoptionaluncontrolledValue:unknown
the value for the uncontrolled (undefined) state.
valued?
readonlyoptionalvalued:string
the name of the component property where the component value is stored.
valueType?
readonlyoptionalvalueType: keyof SchemaTypeMap
the type of the component value.
wrapperCss?
readonlyoptionalwrapperCss: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.
Methods
hasComponentRole()
hasComponentRole(
value):boolean
Returns true if the role is defined in the component's roles, false otherwise.
Parameters
value
string
the component role.
Returns
boolean
true if the role is defined in the component's roles, false otherwise.
hasFeatureValue()
hasFeatureValue(
name,value):boolean
Returns true if feature is present in the component feature set and equals value, false otherwise.
Parameters
name
string
the feature name.
value
unknown
the feature value.
Returns
boolean
true if feature is present in the component feature set and equals value, false otherwise.
isFeatureEnabled()
isFeatureEnabled(
name):boolean
Returns true if feature is present in the component feature set and equals true, false otherwise.
Parameters
name
string
the feature name.
Returns
boolean
true if feature is present in the component feature set and equals true, false otherwise.