Class: ComponentStore
Component settings for serialization in JSON.
Constructors
Constructor
new ComponentStore(
key,type):ComponentStore
Creates the component settings.
Parameters
key
string
the React component key.
type
string
the component type of the form viewer.
Returns
ComponentStore
Properties
children?
optionalchildren:ComponentStore[]
The array of child components.
css?
optionalcss:Css
The component CSS styles.
dataKey?
optionaldataKey:string
The component data key.
disableDataBinding?
optionaldisableDataBinding:ComponentProperty<boolean>
Disables data binding for the component.
events?
optionalevents:Record<string,ActionData[]>
The set of event handlers.
htmlAttributes?
optionalhtmlAttributes:HtmlAttribute[]
The set of arbitrary HTML attributes added to the component.
key
key:
string=''
The React component key.
modal?
optionalmodal:ModalComponentStore
The modal settings.
props
props:
Record<string,ComponentProperty> ={}
The component properties.
renderWhen?
optionalrenderWhen:ComponentProperty<any>
The expression or function to conditionally render a component.
schema?
optionalschema:BoundValueSchema
The component value validation settings.
slot?
optionalslot:string
The name of the occupied component property in the parent component.
slotCondition?
optionalslotCondition:string
The condition for binding a child element to a parent element.
style?
optionalstyle:ComponentStyle
The component styles for the style attribute.
tooltipProps?
optionaltooltipProps:Record<string,ComponentProperty<any>>
The tooltip settings.
type
type:
string=''
The component type of the form viewer.
wrapperCss?
optionalwrapperCss:Css
The component wrapper CSS styles.
wrapperStyle?
optionalwrapperStyle:ComponentStyle
The component wrapper styles for the style attribute.
Methods
addEventHandler()
staticaddEventHandler(store,eventName,data):void
Adds the event handler for component.
Parameters
store
ComponentStore
the target ComponentStore.
eventName
string
the target event name.
data
the ActionData.
Returns
void
addValidationRule()
staticaddValidationRule(store,key,type):void
Adds a validation rule to the component.
Parameters
store
ComponentStore
the component settings.
key
string
the validation key.
type
ValidatorType = 'internal'
the validation type.
Returns
void
clone()
staticclone(store):ComponentStore
Returns a clone of the specified component settings.
Parameters
store
ComponentStore
the component settings.
Returns
ComponentStore
the clone of the specified component settings.
createFromObject()
staticcreateFromObject(value):any
Correctly creates the ComponentStore from deserialized data.
Parameters
value
any
the deserialized data.
Returns
any
the component Store.
hasValidationRule()
statichasValidationRule(store,key):undefined|boolean
Returns true if the component has a validation rule.
Parameters
store
ComponentStore
the component settings.
key
string
the validation key.
Returns
undefined | boolean
true if the component has a validation rule, otherwise false.
removeValidationRule()
staticremoveValidationRule(store,key):void
Removes a validation rule from the component.
Parameters
store
ComponentStore
the component settings.
key
string
the validation key.
Returns
void