Class: Store
The form viewer settings. Internal use only.
Implements
Constructors
Constructor
new Store(
formViewerPropsStore
,componentStateFactory
,parentStore?
,getInitialData?
):Store
Creates form viewer settings.
Parameters
formViewerPropsStore
the form viewer store settings.
componentStateFactory
the factory for creating component states.
parentStore?
Store
the form viewer settings, used in templates.
getInitialData?
the function to get initial data for the Store.
Returns
Store
Properties
componentStateFactory
readonly
componentStateFactory:ComponentStateFactory
the factory for creating component states.
form
form:
Form
The form.
Implementation of
formLoadError?
optional
formLoadError:string
The loading form error.
formViewerPropsStore
formViewerPropsStore:
FormViewerPropsStore
the form viewer store settings.
getInitialData?
readonly
optional
getInitialData:GetInitialDataFn
the function to get initial data for the Store.
parentStore?
readonly
optional
parentStore:Store
the form viewer settings, used in templates.
selectedLanguage?
optional
selectedLanguage:Language
The currently selected language.
viewMode
viewMode:
ViewMode
='desktop'
Current display resolution type.
Accessors
commonActions
Get Signature
get commonActions():
ActionValues
Returns
the Record with the common actions.
displayedLanguage
Get Signature
get displayedLanguage():
Language
Returns
the current display language.
formData
Get Signature
get formData():
ComponentData
Returns
the IFormData with all the form data.
Implementation of
initialDataSlice
Get Signature
get initialDataSlice():
unknown
Returns
unknown
the slice of the initial data in accordance with the Store hierarchy. Internal use only.
Implementation of
showAllValidationErrors
Get Signature
get showAllValidationErrors():
undefined
|boolean
Returns
undefined
| boolean
true if all validation errors are to be displayed, false otherwise.
Implementation of
IStore
.showAllValidationErrors
Methods
applyPersistedForm()
applyPersistedForm(
persistedForm
):void
Populates the value of this store with the values of the saved form.
Parameters
persistedForm
saved form value.
Returns
void
applyStringForm()
applyStringForm(
text
):void
Populates the value of this store with the values of the saved form.
Parameters
text
string
saved form value.
Returns
void
clear()
clear():
void
Clears the form in Form Viewer.
Returns
void
createComponentData()
createComponentData(
componentStore
,deferFieldCalculation
):ComponentData
Creates the element for the component tree. Internal use only.
Parameters
componentStore
the component settings.
deferFieldCalculation
boolean
= false
if true, then the calculated field must be explicitly initialized.
Returns
the element for the component tree.
Implementation of
IComponentDataFactory
.createComponentData
dispose()
dispose():
void
Returns
void
Inherit Doc
Implementation of
findAction()
findAction(
actionData
):ActionDefinition
Searches for an action, returns definition for the found action.
Parameters
actionData
the action's data.
Returns
the action definition.
Throws
Error, if action was not found.
getAction()
getAction(
name
,type
):ActionDefinition
Returns an action by the specified action name and action type.
Parameters
name
string
the action name.
type
the action type.
Returns
the action.
getModel()
getModel(
type
):Model
<any
> |Model
<TemplateProps
> |Model
<InternalErrorProps
>
Returns model for the specified type.
Parameters
type
string
the component type.
Returns
Model
<any
> | Model
<TemplateProps
> | Model
<InternalErrorProps
>
the model for the specified type.
getValidationRules()
getValidationRules(
type
):FormViewerValidationRules
Returns the object with validators for the specified value type.
Parameters
type
keyof SchemaTypeMap
the value type.
Returns
the object with validators for the specified value type.
loadForm()
loadForm(
getForm?
,formName?
):void
Parameters
getForm?
(name?
) => string
| Promise
<string
>
the function that loads the form.
formName?
string
the form name.
Returns
void
Deprecated
Loads a form by form name and sets that form in the form viewer.
localizeComponent()
localizeComponent(
type
,formData
,componentStore
):Record
<string
,any
>
Localizes a component store based on the given localization type. If a custom localizer is available, it will be used.
Parameters
type
string
the type of localization.
formData
the form data.
componentStore
the component settings.
Returns
Record
<string
, any
>
the Record with the localized properties.
Implementation of
localizeErrorMessages()
localizeErrorMessages(
formData
,componentStore
,validationResults?
):undefined
|string
The function to localize the validation error message.
Parameters
formData
the form data.
componentStore
the component settings.
validationResults?
the results of the validation.
Returns
undefined
| string
the result of localization or undefined.
Implementation of
reduceScreen()
reduceScreen<
T
>(callback
,initialValue
):T
Type Parameters
T
T
the return value type.
Parameters
callback
(accumulator
, current
) => T
the function that calculates the value for the accumulator.
initialValue
T
the initial value for the accumulator.
Returns
T
the accumulated value.