Skip to main content

Module: @react-form-builder/core

Enumerations

Classes

Interfaces

Type Aliases

ActionData

Ƭ ActionData: Object

Action Storage. Used for add a new action, store information about it.

Type declaration

NameTypeDescription
[KeySymbol]?stringThe unique action key.
args?ArgumentsThe action arguments.
namestringThe action name.
typeActionTypeThe action type.

ActionEventHandler

Ƭ ActionEventHandler: (e: ActionEventArgs) => void | Promise<void>

Type declaration

▸ (e): void | Promise<void>

Event handler function type.

Parameters
NameTypeDescription
eActionEventArgsthe action arguments.
Returns

void | Promise<void>


ActionHandler

Ƭ ActionHandler<T>: (e: ActionEventArgs, params: { [k in keyof T]: any }) => void | Promise<void>

Type parameters

NameDescription
Tthe type of action parameters.

Type declaration

▸ (e, params): void | Promise<void>

Action function type.

Parameters
NameTypeDescription
eActionEventArgsthe action arguments.
params{ [k in keyof T]: any }the action parameters.
Returns

void | Promise<void>


ActionParameters

Ƭ ActionParameters: Record<ParameterName, ParameterType>

Represents a set of action parameters.


ActionType

Ƭ ActionType: "common" | "code" | "custom"

Action type.


ActionValues

Ƭ ActionValues: Record<string, ActionDefinition>

Represents a set of action definitions.


ActionsInitializer

Ƭ ActionsInitializer: (props: ComponentStore["props"], def: DefineActionHelper) => Record<EventName, ActionEventHandler | ActionDefinition>

Type declaration

▸ (props, def): Record<EventName, ActionEventHandler | ActionDefinition>

The type of function that initializes an actions on a component. Internal use only.

Parameters
NameTypeDescription
propsComponentStore["props"]the component's property settings.
defDefineActionHelperthe helper to create an action event handler.
Returns

Record<EventName, ActionEventHandler | ActionDefinition>

the Record with action event handlers.


AnnotationType

Ƭ AnnotationType: "Property" | "Container" | "Event" | "Module" | "Style"

Type of component property description in the form builder.


Annotations

Ƭ Annotations<T>: { [key in keyof T]: BaseBuilder<T[key]> | undefined }

The type-safe description of the component's metadata property builders.

Type parameters

NameTypeDescription
Textends objectthe component property name type.

ArgumentValue

Ƭ ArgumentValue: string | number | boolean

The type of the argument value of the function.


Arguments

Ƭ Arguments: Record<ParameterName, ArgumentValue>

It will be transformed in arguments before passing in action.


BoundValueSchema

Ƭ BoundValueSchema: Object

Value validation rules.

Type declaration

NameTypeDescription
autoValidate?booleanFlag, if true then automatic validation of the value works, false otherwise.
validations?ValidationRuleSettings[]The array of validation rule settings.

BuilderSetup

Ƭ BuilderSetup: Partial<PreAnnotation & BuilderOptions>

The type representing custom options for the component's property metadata builder.


ComponentKey

Ƭ ComponentKey: string

The component key.


ComponentKind

Ƭ ComponentKind: "container" | "component" | "slot" | "template"

The component kind type.


ComponentLocalizer

Ƭ ComponentLocalizer: (componentStore: ComponentStore, language: Language) => Record<string, any>

Type declaration

▸ (componentStore, language): Record<string, any>

The function to localize the properties of a component.

Parameters
NameTypeDescription
componentStoreComponentStorethe component settings.
languageLanguagethe language selected in the form viewer.
Returns

Record<string, any>

the Record with the localized properties of a component.


ComponentPropertyComputeType

Ƭ ComponentPropertyComputeType: "function" | "localization"

The component property value type.


ComponentPropertyName

Ƭ ComponentPropertyName: string

The component property name.


ComponentPropsLocalization

Ƭ ComponentPropsLocalization: Record<ComponentPropertyName, string>

A record containing localizations for the component properties.


ComponentsLocalization

Ƭ ComponentsLocalization: Record<ComponentKey, TypedLocalization>

A record containing localizations grouped by component key.


ComputeChildren

Ƭ ComputeChildren: (componentData: ComponentData, componentProps: Record<string, any>) => Record<string, any>

Type declaration

▸ (componentData, componentProps): Record<string, any>

Function that calculates all child properties of a component. Internal use only.

Parameters
NameTypeDescription
componentDataComponentDatathe data required to display a component.
componentPropsRecord<string, any>the calculated properties of the component.
Returns

Record<string, any>

the Record with calculated child properties.


Css

Ƭ Css: Object

The type for the CSS property of a React component.

Type declaration

NameTypeDescription
any?DeviceStyleCSS styles for arbitrary device.
desktop?DeviceStyleCSS styles for desktop devices.
mobile?DeviceStyleCSS styles for mobile devices.
tablet?DeviceStyleCSS styles for tablet devices.

CssLoaderType

Ƭ CssLoaderType: BiDi | "common"

Represents the type of CSS loader. Can be either BiDi or common for both BiDi.


CssPart

Ƭ CssPart: "css" | "wrapperCss"

The part of the CSS properties of a component.


CustomActions

Ƭ CustomActions: Record<string, ActionDefinition | ActionEventHandler>

Custom actions for the form viewer.


CustomValidationRuleSettings

Ƭ CustomValidationRuleSettings: Object

Custom validation rule settings.

Type declaration

NameTypeDescription
params?ValidationRuleParameter[]Metadata of validation rule parameters.
validateRuleValidatorThe function that validates the value.

CustomValidationRules

Ƭ CustomValidationRules: Record<string, CustomValidationRuleSettings>

A set of metadata of custom validation rules, grouped by rule name.


DefineActionHelper

Ƭ DefineActionHelper: <T>(name: string, func: ActionHandler<T>, params?: ParameterDefinition<T>[], description?: string) => ActionDefinition

Type declaration

▸ <T>(name, func, params?, description?): ActionDefinition

The defineAction helper type. Internal use only.

Type parameters
NameDescription
Tthe type of action parameter.
Parameters
NameTypeDescription
namestringthe action name.
funcActionHandler<T>the action handler.
params?ParameterDefinition<T>[]the definition of action parameters.
description?stringthe action description.
Returns

ActionDefinition

the definition of an action.


DefinerData

Ƭ DefinerData<T>: Object

Definer class data.

Type parameters

NameTypeDescription
Textends objectReact component property type.

Type declaration

NameTypeDescription
actionsInitializer?ActionsInitializerThe function that initializes an actions on a component (for internal use only).
category?stringThe component category.
componentComponentType<T>The React component.
cssObject?Annotations<CSSObject>The CSS metadata.
customPreview?ReactNodeThe custom component to display in the component list (unused).
icon?ComponentTypeThe component icon.
kind?ComponentKindThe component kind.
name?stringThe component name.
properties?Annotations<T>The property metadata.

DeviceStyle

Ƭ DeviceStyle: Object

CSS styles for a device.

Type declaration

NameTypeDescription
object?CSSObjectCSS styles defined in the general style settings.
string?stringCSS styles defined in the style code editor.

Disposer

Ƭ Disposer: () => void

Type declaration

▸ (): void

Type for the function that disposes resources.

Returns

void


EditorType

Ƭ EditorType: string

A type that denotes the name of the property editor.


ErrorMap

Ƭ ErrorMap: Object

The result of validating a component property in the form builder.

Type declaration

NameTypeDescription
code?stringThe validation code.
message?stringThe validation message.

ErrorMessageLocalizer

Ƭ ErrorMessageLocalizer: (value: ValidationResult[] | undefined) => string | undefined

Type declaration

▸ (value): string | undefined

A function that localizes validation error messages.

Parameters
NameTypeDescription
valueValidationResult[] | undefinedthe results of the validation.
Returns

string | undefined

the localization result or undefined.


EventName

Ƭ EventName: string

The type for the event name.


FirstParameter

Ƭ FirstParameter<T>: Parameters<T>[0]

The generic type that returns the first parameter of the generic type T. Internal use only.

Type parameters

NameType
Textends (...args: any) => any

FormValidator

Ƭ FormValidator: (data: Record<string, unknown>) => Promise<Record<string, string> | undefined>

Type declaration

▸ (data): Promise<Record<string, string> | undefined>

Represents a function that validate the form data.

Parameters
NameTypeDescription
dataRecord<string, unknown>the form data.
Returns

Promise<Record<string, string> | undefined>

the Record with form field errors.


FormValidators

Ƭ FormValidators: FormValidator[]

Represents an array of functions that validate the form data.


FormViewerValidationRules

Ƭ FormViewerValidationRules: Object

Validation rules for FormViewer.

Type declaration

NameTypeDescription
custom?CustomValidationRulesThe set of custom validators.
internalValidationRuleSetThe set of internal validators.

FormViewerWrapper

Ƭ FormViewerWrapper: ComponentType<FormViewerWrapperComponentProps>

Represents a form viewer Wrapper component.


Func

Ƭ Func: (...arg: any[]) => void | Promise<void>

Type declaration

▸ (...arg): void | Promise<void>

The type of arbitrary function that returns void or Promise<void>.

Parameters
NameType
...argany[]
Returns

void | Promise<void>


HtmlAttribute

Ƭ HtmlAttribute: Record<string, string>

The arbitrary HTML attributes for the component.


IDisposable

Ƭ IDisposable: Object

Type of disposable object.

Type declaration

NameType
dispose() => void

LanguageFullCode

Ƭ LanguageFullCode: string

The full language code, e.g. 'en-US'.


LocalizationTestRequest

Ƭ LocalizationTestRequest: Object

Localization testing request.

Type declaration

NameTypeDescription
dataRecord<string, FluentVariable>The test form data.
languageLanguageThe localization Language.
localizationstringLocalization value to be tested.
localizationStringIdstringThe identifier of the localization string.

LocalizationType

Ƭ LocalizationType: "component" | "tooltip" | string

Represents the type of localization. The localization can be for a component, tooltip or for validator.


LocalizationValue

Ƭ LocalizationValue: Record<LanguageFullCode, ComponentsLocalization>

The format in which localization is stored.

Example

{
* "en-US" :
* {
* "componentKey:
* {
* "property" : "This {$value} is localized!"
* }
* }
* }

NamedActionDefinition

Ƭ NamedActionDefinition: Object

Represents a named action definition.

Type declaration

NameTypeDescription
actionDefinitionActionDefinitionThe definition of an action.
namestringThe name of action definition.

ParameterDefinition

Ƭ ParameterDefinition<T>: [PropertyKey<T>, ParameterType]

The type to describe the action parameter.

Type parameters

NameDescription
Tthe type of action parameter.

ParameterName

Ƭ ParameterName: string

The type for the parameter name.


ParameterType

Ƭ ParameterType: "string" | "number" | "boolean"

Parameter type.


PreAnnotation

Ƭ PreAnnotation: Partial<Omit<Annotation, "key">> & Pick<Annotation, "editor">

Type for component property metadata without the 'key' property, but with the 'editor' property.


PropertyBlockType

Ƭ PropertyBlockType: "component" | "tooltip" | string

Represents the type of property block.


PropertyKey

Ƭ PropertyKey<T>: keyof T & string

Component property key type.

Type parameters

NameDescription
Tthe type of action parameter

Rel

Ƭ Rel: "stylesheet" | string

Represents a relationship attribute value used in HTML.


ResolvedValidator

Ƭ ResolvedValidator: (value: any, store: IStore) => Promise<ValidationResult[] | undefined>

Type declaration

▸ (value, store): Promise<ValidationResult[] | undefined>

The function that validates a value and returns the validation result.

Parameters
NameTypeDescription
valueanythe validated value.
storeIStorethe form viewer settings.
Returns

Promise<ValidationResult[] | undefined>

the Promise with the results of the validation.


RuleValidator

Ƭ RuleValidator<T>: (value: T, store: IStore, args?: Record<string, unknown>) => RuleValidatorResult | Promise<RuleValidatorResult>

Type parameters

NameTypeDescription
Tanythe value type.

Type declaration

▸ (value, store, args?): RuleValidatorResult | Promise<RuleValidatorResult>

The function that checks the value and returns the result of the rule validation, see RuleValidatorResult.

Parameters
NameTypeDescription
valueTthe value.
storeIStorethe form viewer settings
args?Record<string, unknown>the rule arguments.
Returns

RuleValidatorResult | Promise<RuleValidatorResult>


RuleValidatorResult

Ƭ RuleValidatorResult: string | boolean

The result of validation of a single rule, true means validation was successful, false means validation failed, string means error message.


SchemaResolver

Ƭ SchemaResolver<T>: (value: T) => ResolvedValidator

Type parameters

NameDescription
Tthe validation function factory arguments.

Type declaration

▸ (value): ResolvedValidator

The validation function factory.

Parameters
NameTypeDescription
valueTthe validated value.
Returns

ResolvedValidator

the function that validates a value.


SchemaType

Ƭ SchemaType: keyof SchemaTypeMap

The value type name.


SchemaTypeMap

Ƭ SchemaTypeMap: Object

Describes the mapping of a value type name to a type.

Type declaration

NameTypeDescription
arrayany[]The array.
booleanbooleanThe boolean.
dateDateThe date.
enumanyThe enumeration.
numbernumberThe number.
objectobjectThe object.
stringstringThe string.

Setter

Ƭ Setter<T>: (value: T) => void

Type parameters

NameTypeDescription
Tanythe value type.

Type declaration

▸ (value): void

Value setting function type.

Parameters
NameTypeDescription
valueTthe value.
Returns

void


SyncEventHandler

Ƭ SyncEventHandler<TSender, TEventArgs>: (source: TSender, eventArgs: TEventArgs) => void

Type parameters

NameDescription
TSenderthe type of the event source.
TEventArgsthe type of the event arguments.

Type declaration

▸ (source, eventArgs): void

Represents a synchronous event handler.

Parameters
NameType
sourceTSender
eventArgsTEventArgs
Returns

void


TypedLocalization

Ƭ TypedLocalization: Partial<Record<LocalizationType, ComponentPropsLocalization>>

A record containing localizations grouped by localization type.


ValidationResult

Ƭ ValidationResult: Object

The result of the validation.

Type declaration

NameTypeDescription
message?stringThe validation error message text.
settingsValidationRuleSettingsThe validation rule settings.

ValidationRule

Ƭ ValidationRule: Object

Validation rule metadata required to create a validation function.

Type declaration

NameTypeDescription
params?ValidationRuleParameter[]Metadata of validation rule parameters.
validatorFactoryValidatorFactory<any>The validation function factory.

ValidationRuleParameter

Ƭ ValidationRuleParameter: Object

Describes the settings of the validation rule parameter.

Type declaration

NameTypeDescription
default?unknownThe default value.
editorType?stringThe editor type of the setting value.
keystringThe unique setting key of the parameter.
requiredbooleanFlag whether the setting value must be filled in.
typeSchemaTypeThe type of value.

ValidationRuleSet

Ƭ ValidationRuleSet: Record<string, ValidationRule>

Describes a set of validation rules.


ValidationRuleSettings

Ƭ ValidationRuleSettings: Object

The validation rule settings.

Type declaration

NameTypeDescription
args?Record<string, any>Arguments of the validation rule.
keystringThe unique key of the validation rule. The key is unique within the value type.
type?ValidatorTypeThe type of validator.

ValidatorFactory

Ƭ ValidatorFactory<Params>: (args: Params) => RuleValidator

Type parameters

NameDescription
Paramsthe factory arguments type.

Type declaration

▸ (args): RuleValidator

The validation function factory.

Parameters
NameTypeDescription
argsParamsthe factory arguments.
Returns

RuleValidator

the function that checks the value and returns the result of the rule validation


ValidatorType

Ƭ ValidatorType: "internal" | "custom"

The type of validator.


Validators

Ƭ Validators: Partial<Record<SchemaType, CustomValidationRules>>

The set of metadata of custom validation rules, grouped by the type of value being validated.


ViewMode

Ƭ ViewMode: "desktop" | "mobile" | "tablet"

Display resolution type.

Variables

ActionEventArgsDeclaration

Const ActionEventArgsDeclaration: "\n/**\n * Arguments passed to the event handler.\n */\ndeclare class ActionEventArgs {\n\n /**\n * The event type.\n */\n readonly type: string\n\n /**\n * The component that triggered the event.\n */\n readonly sender: ComponentData\n \n /**\n * The component properties that were used to render the sender component.\n */\n readonly renderedProps: Record<string, any>\n \n /**\n * Sets current props of component.\n */\n readonly setUserDefinedProps: (props: Record<string, any>) => void\n\n /**\n * The form viewer settings.\n */\n readonly store: Store\n\n /**\n * The event arguments.\n */\n readonly args: any[]\n\n /**\n * @returns the event handled by the event handler.\n */\n get event(): SyntheticEvent | null\n\n /**\n * @returns the first element of the event argument array, which is treated as a value.\n */\n get value(): any\n \n /**\n * @returns the object for reading and changing form data.\n */\n get data(): Record<string, unknown>\n}\n"

Description of the event argument type for the code editor.


AsyncFunction

Const AsyncFunction: Function

Asynchronous function constructor.


DidMountEvent

Const DidMountEvent: "onDidMount"

The DidMountEvent event name.


IFormDataDeclaration

Const IFormDataDeclaration: "declare interface IFormData {\n /**\n * @returns the {@link Record} with all the form data.\n */\n get data(): Record<string, unknown>\n\n /**\n * @returns the {@link Record} with all validation error messages.\n */\n get errors(): Record<string, unknown>\n\n /**\n * true if the form contains errors, otherwise false.\n */\n get hasErrors(): boolean\n\n /**\n * @returns the user defined observable state.\n */\n get state(): Record<string, unknown>\n\n /**\n * Sets the validation error message for all form data fields.\n * @param message the validation error message.\n */\n setAllErrors(message?: string): void\n\n /**\n * Validates the data in the form.\n */\n validate(): Promise<void>\n \n /**\n * Returns the validation results without triggering an events and changing the state of the form.\n * @returns the validation results.\n */\n getValidationResult: () => Promise<ValidationMessages>\n\n /**\n * If true, then validation is in progress.\n */\n get isValidating(): boolean\n\n /**\n * Sets the form to its default value.\n */\n reset(): void\n\n /**\n * Clears the form data.\n */\n clear(): void\n}"

Description of the form data for the code editor.


KeySymbol

Const KeySymbol: typeof KeySymbol

The unique Symbol for the key property.


StoreContext

StoreContext: Context<null | Store>

Internal use only.


WillUnmountEvent

Const WillUnmountEvent: "onWillUnmount"

The WillUnmountEvent event name.


array

Const array: ArrayBuilder<undefined | unknown[]>

The annotation builder for a component property with type 'Array'.


boolean

Const boolean: TypedBuilder<undefined | boolean>

The annotation builder for a component property with type 'boolean'.


className

Const className: Annotation

The annotation builder for the component property containing the CSS class name.


color

Const color: TypedBuilder<undefined | string>

The annotation builder for a component property with type 'color' (e.g. rgba(71, 167, 122, 0.72)).


commonStyles

Const commonStyles: Object

The annotations for generic CSS properties of a component.

Type declaration

NameType
backgroundColorAnnotationBuilder<unknown>
colorAnnotationBuilder<unknown>
heightAnnotationBuilder<unknown>
marginBottomAnnotationBuilder<unknown>
marginLeftAnnotationBuilder<unknown>
marginRightAnnotationBuilder<unknown>
marginTopAnnotationBuilder<unknown>
widthAnnotationBuilder<unknown>

containerStyles

Const containerStyles: Object

The annotations for generic CSS properties of a container component.

Type declaration

NameType
alignItemsOneOfBuilder<"start" | "center" | "baseline" | "end" | "stretch">
flexDirectionOneOfBuilder<"column" | "row" | "column-reverse" | "row-reverse">
flexWrapOneOfBuilder<"wrap" | "nowrap" | "wrap-reverse">
gapTypedBuilder<undefined | string>
justifyContentOneOfBuilder<"left" | "right" | "start" | "center" | "end" | "flex-start" | "flex-end" | "space-between" | "space-around" | "space-evenly">

date

Const date: TypedBuilder<undefined | Date>

The annotation builder for a component property with type 'Date'.


emotionCache

Const emotionCache: Object

The CSS style cache. Internal use only.

Type declaration

NameType
LTREmotionCache
RTLEmotionCache

emptyComponentStore

Const emptyComponentStore: ComponentStore

The empty component settings object. Internal use only.


errorMessageModel

Const errorMessageModel: Model<ErrorWrapperProps>

The component metadata for error message. Internal use only.


event

Const event: AnnotationBuilder<Function>

The annotation builder for a component property with type 'event' (or event handler, or just a function).


htmlAttributes

Const htmlAttributes: AnnotationBuilder<unknown>

The annotation builder for the 'key' property of a component.


internalErrorModel

Const internalErrorModel: Model<InternalErrorProps>

Form viewer internal error metadata. Internal use only.


key

Const key: Annotation

The annotation for the 'key' property of the component.


node

Const node: NodeAnnotationBuilder<ReactNode>

The annotation builder for a component property with type 'ReactNode'.


number

Const number: TypedBuilder<undefined | number>

The annotation builder for a component property with type 'number'.


renderWhen

Const renderWhen: TypedBuilder<undefined | boolean>

The annotation builder for the synthetic 'renderWhen' property of the component.


screenModel

Const screenModel: Model<{ as?: ElementType<any> ; theme?: Theme } & ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement>>

Form viewer screen metadata. Internal use only.


size

Const size: TypedBuilder<undefined | string>

The annotation builder for a component property with type 'CSS unit' (width, height, etc.).


slotModel

Const slotModel: Model<any>

Form viewer slot metadata. Internal use only.


string

Const string: TypedBuilder<undefined | string>

The annotation builder for a component property with type 'string'.


tooltipProps

Const tooltipProps: AnnotationBuilder<unknown>

The annotation builder for component tooltip properties.


tooltipType

Const tooltipType: TypedBuilder<undefined | string>

The annotation builder for the form property describing the type of form tooltip.


validation

Const validation: AnnotationBuilder<unknown>

The annotation builder for arbitrary HTML attributes of a component.

Functions

ComponentDataProvider

ComponentDataProvider(props): null | ReactElement<any, string | JSXElementConstructor<any>>

Context provider for the useComponentData hook. Internal use only.

Parameters

NameType
propsProviderProps<ComponentData>

Returns

null | ReactElement<any, string | JSXElementConstructor<any>>


ComponentTree

ComponentTree(«destructured»): Element

The React component that displays an array of ComponentData. Internal use only.

Parameters

NameType
«destructured»ComponentTreeProps

Returns

Element


DefaultWrapper

DefaultWrapper(props, context?): null | ReactElement<any, any>

The React component that wraps every component in a form.

Parameters

NameType
propsPropsWithChildren<{ as?: ElementType<any> ; theme?: Theme } & ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement>>
context?any

Returns

null | ReactElement<any, any>


FormViewer

FormViewer(props): Element

The main React component of the form viewer.

Parameters

NameType
propsFormViewerProps

Returns

Element

the React element.


SDiv

SDiv(props, context?): null | ReactElement<any, any>

Parameters

NameType
propsPropsWithChildren<{ as?: ElementType<any> ; theme?: Theme } & ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement>>
context?any

Returns

null | ReactElement<any, any>


StoreProvider

StoreProvider(props): null | ReactElement<any, string | JSXElementConstructor<any>>

Internal use only.

Parameters

NameType
propsProviderProps<Store>

Returns

null | ReactElement<any, string | JSXElementConstructor<any>>


SuppressResizeObserverErrors

SuppressResizeObserverErrors(props): Element

SuppressResizeObserverErrors component is used to suppress ResizeObserver errors. Internal use only.

Parameters

NameTypeDescription
propsSuppressResizeObserverErrorsPropsthe component props.

Returns

Element

the rendered child elements.


ViewerPropsProvider

ViewerPropsProvider(props): null | ReactElement<any, string | JSXElementConstructor<any>>

Internal use only.

Parameters

NameType
propsProviderProps<Readonly<FormViewerProps>>

Returns

null | ReactElement<any, string | JSXElementConstructor<any>>


calculatePropertyValue

calculatePropertyValue(componentProperty, formViewerData): CalculableResult

Calculates the value for the component property. Internal use only.

Parameters

NameTypeDescription
componentPropertyComponentPropertythe component property.
formViewerDataIFormDatathe formViewerData data.

Returns

CalculableResult

the calculated value.


checkSlotCondition

checkSlotCondition(childStore, parentProps): any

Performs the function of checking if the child component can be bound. Internal use only.

Parameters

NameTypeDescription
childStoreComponentStorethe child component settings.
parentPropsanythe parent component properties.

Returns

any

true, if the child component can be bound, false otherwise.


createActionValuesFromObject

createActionValuesFromObject(obj): ActionValues

Converts the input object to an ActionValues object. Internal use only.

Parameters

NameTypeDescription
objanythe input object.

Returns

ActionValues

the converted ActionValues object.


createAnnotation

createAnnotation<T>(editor): AnnotationBuilder<T>

Creates a component property metadata builder.

Type parameters

NameDescription
Tthe property type.

Parameters

NameTypeDescription
editorstringthe property editor type.

Returns

AnnotationBuilder<T>

the component property metadata builder.


createNonNullableContext

createNonNullableContext<T>(name): [() => T, Provider<T>, Context<T | null>]

Creates non-nullable React context. Internal use only.

Type parameters

Name
T

Parameters

NameTypeDescription
namestringthe context name.

Returns

[() => T, Provider<T>, Context<T | null>]

the tuple [hook, provider, and common context] for interactions with a non-nullable context.


createProperty

createProperty(editor): AnnotationBuilder<unknown>

Creates an instance of the builder class to define the property's metadata.

Parameters

NameTypeDescription
editorstringeditor type for editing the property.

Returns

AnnotationBuilder<unknown>

the instance of the builder class to define the property's metadata.


createView

createView(models): View

Static wrapper for the View constructor.

Parameters

NameTypeDescription
modelsModel<any>[]the components metadata.

Returns

View

the View instance.


define

define<T>(component, displayName?): Definer<T>

Static method to create an instance of the component's metadata builder class.

Type parameters

NameType
Textends object

Parameters

NameTypeDescription
componentComponentType<T>the React component.
displayName?stringthe display name for the anonymous component.

Returns

Definer<T>

the instance of the Definer class.


findTreeElementDepth

findTreeElementDepth<T>(value, element?, depth?): number | undefined

Finds the depth of a given element in a tree. Internal use only.

Type parameters

NameType
Textends Object

Parameters

NameTypeDefault valueDescription
valueTundefinedthe root of the tree.
element?Tundefinedthe element to find the depth of.
depthnumber0the current depth of the tree (optional, default is 0).

Returns

number | undefined

the depth of the element in the tree, or undefined if the element is not found.


generateTemplateTypeName

generateTemplateTypeName(name): string

Generates the template type name from the specified template name. Internal use only.

Parameters

NameTypeDescription
namestringthe template name.

Returns

string

the template type name.


generateUniqueName

generateUniqueName(prefix, existingNames): string

Generates a unique name with the specified prefix. Internal use only.

Parameters

NameTypeDescription
prefixstringthe prefix.
existingNamesSet<string>the set of existing names to match with which uniqueness will be checked.

Returns

string

the generated name.


getDefault

getDefault(annotations): Readonly<Record<string, any>>

Extracts component properties default values from annotations . Internal use only.

Parameters

NameTypeDescription
annotationsAnnotation[]the array of component annotations.

Returns

Readonly<Record<string, any>>

the object containing component properties default values.


getDefaultCss

getDefaultCss(annotations): Readonly<Record<string, any>>

Extracts CSS properties default values from annotations . Internal use only.

Parameters

NameTypeDescription
annotationsAnnotation[]the array of component annotations.

Returns

Readonly<Record<string, any>>

the object with CSS properties default values.


getFluentCompatibleId

getFluentCompatibleId(rawId): string

Converts the raw id to a Fluent compatible id, i.e. replaces all the spaces with underscores. Internal use only.

Parameters

NameTypeDescription
rawIdstringsome raw id.

Returns

string

the Fluent compatible id.


getFluentData

getFluentData(data): Record<string, FluentVariable>

Converts the form data to a Fluent compatible. Internal use only.

Parameters

NameTypeDescription
dataRecord<string, unknown>the form data.

Returns

Record<string, FluentVariable>

all the form data that is of the FluentVariable type. Additionally, the keys of the returned object are converted to the snake case.


getKey

getKey(): string

Generates the random string. Internal use only.

Returns

string

the generated random string.


getValidatorPropertyBlockType

getValidatorPropertyBlockType(ruleKey): string

Retrieves the property block type for a given rule key. Internal use only.

Parameters

NameTypeDescription
ruleKeystringthe rule key.

Returns

string

the property block type. Validator property block types are prefixed with 'validator-'.


groupBy

groupBy<T>(array, predicate): Record<string, T[]>

Groups the array of values by function predicate. Internal use only.

Type parameters

Name
T

Parameters

NameTypeDescription
arrayT[]the array of values.
predicate(value: T, index: number, array: T[]) => stringthe function that returns a string to group the values of the array.

Returns

Record<string, T[]>

the Record with grouped values.


initFormFields

initFormFields(form): Record<string, unknown>

Replaces empty form fields with an empty string. Internal use only.

Parameters

NameTypeDescription
formComponentDatathe form.

Returns

Record<string, unknown>

all form data where empty fields are filled with empty strings.


isContainer

isContainer(value): value is ContainerAnnotation

Type predicate, asserts that the value is an instance of ContainerAnnotation. Internal use only.

Parameters

NameTypeDescription
valueAnnotationthe value.

Returns

value is ContainerAnnotation

true if the value is an instance of ContainerAnnotation, false otherwise.


isFunctionalProperty

isFunctionalProperty(componentProperty?): boolean

Returns true if the property value is calculated by the function, otherwise false. Internal use only.

Parameters

NameTypeDescription
componentProperty?ComponentPropertythe component property.

Returns

boolean

true if the property value is calculated by the function, otherwise false.


isLocalizedProperty

isLocalizedProperty(componentProperty?): boolean

Returns true if the property value is localized, otherwise false. Internal use only.

Parameters

NameTypeDescription
componentProperty?ComponentPropertythe component property.

Returns

boolean

true if the property value is localized, otherwise false.


isPromise

isPromise<T>(value): value is Promise<T>

Type predicate, asserts that the value is a Promise. Internal use only.

Type parameters

NameType
Tany

Parameters

NameTypeDescription
valueanythe value.

Returns

value is Promise<T>

true if the value is a Promise, false otherwise.


isProperty

isProperty(value): value is PropertyAnnotation

Type predicate, asserts that the value is an instance of PropertyAnnotation. Internal use only.

Parameters

NameTypeDescription
valueAnnotationthe value.

Returns

value is PropertyAnnotation

true if the value is an instance of PropertyAnnotation, false otherwise.


isString

isString(value): value is string

Type predicate, asserts that the value is a string. Internal use only.

Parameters

NameTypeDescription
valueanythe value.

Returns

value is string

true if the value is a string, false otherwise.


isUniqueKey

isUniqueKey(value, store, args?): RuleValidatorResult | Promise<RuleValidatorResult>

Returns true if the component key is unique across the entire component tree. Internal use only.

Parameters

NameTypeDescription
valuestringthe component key.
storeIStorethe form viewer settings.
args?Record<string, unknown>-

Returns

RuleValidatorResult | Promise<RuleValidatorResult>

true if the component key is unique across the entire component tree.


isValidatorPropertyBlockType

isValidatorPropertyBlockType(type): boolean

Determines if the given type is a validator property block type. Internal use only.

Parameters

NameTypeDescription
typestringthe type to be checked.

Returns

boolean

the boolean value indicating if the type is a validator property block type.


loadResource

loadResource(id, href, rel): Promise<void>

Loads a resource into the document head asynchronously. Internal use only.

Parameters

NameTypeDescription
idstringthe identifier of the resource.
hrefstringrepresents a URL to the resource.
relstringthe relationship of the resource to the document.

Returns

Promise<void>

the promise that resolves when the resource has been loaded successfully.


nameAutorun

nameAutorun(owner, name, params?): string

Computes the autorun name based on the owner, name, and parameters. Internal use only.

Parameters

NameTypeDescription
ownerstringthe owner of the autorun.
namestringthe name of the autorun.
paramsRecord<string, any>the parameters for specific autorun.

Returns

string

the computed autorun name.


nameObservable

nameObservable(owner, params?): string

Computes the observable name based on the owner, name, and parameters. Internal use only.

Parameters

NameTypeDescription
ownerstringthe owner of the observable.
paramsRecord<string, any>the parameters for specific observable.

Returns

string

the computed observable name.


namedObserver

namedObserver<T>(displayName, component): T

Creates the observable React component. Internal use only.

Type parameters

NameType
Textends FunctionComponent<any, T>

Parameters

NameTypeDescription
displayNamestringthe displayName value of the React component.
componentTthe React component.

Returns

T

the observable React component.


oneOf

oneOf<U>(...values): OneOfBuilder<U>

The annotation builder for a component property with type 'enum', the property value can only be one of enum.

Type parameters

NameType
Uextends string | number

Parameters

NameType
...valuesU[]

Returns

OneOfBuilder<U>


someOf

someOf<U>(...values): SomeOfBuilder<U>

The annotation builder for a component property with type 'enum', the property value can contain multiple enum values.

Type parameters

NameType
Uextends string | number

Parameters

NameType
...valuesU[]

Returns

SomeOfBuilder<U>


testFluentLocalization

testFluentLocalization(request): CalculableResult

Localization testing function. Internal use only.

Parameters

NameTypeDescription
requestLocalizationTestRequestthe localization testing request.

Returns

CalculableResult

the localization testing result.


toArray

toArray<T>(annotations?, setup?): Annotation[]

Converts the object containing component property metadata into an array. Internal use only.

Type parameters

NameType
Textends object = any

Parameters

NameTypeDescription
annotations?Annotations<T>the object containing component property metadata.
setupPartial<Partial<Omit<Annotation, "key">> & Pick<Annotation, "editor"> & BuilderOptions>the custom options for the component's property metadata builder.

Returns

Annotation[]

the metadata array of the component properties.


toLabeledValues

toLabeledValues(items, upper?): { label: undefined | string ; value: string | number }[]

Converts the array of elements into the array of LabeledValue elements.

Parameters

NameTypeDefault valueDescription
itemsstring[] | LabeledValue[]undefinedthe array of elements.
upperbooleantrueif true, the first character in label will be capitalized.

Returns

{ label: undefined | string ; value: string | number }[]

the array of LabeledValue elements.


treeForEach

treeForEach<T>(tree, fn): void

Executes a given function on each node of a tree. Internal use only.

Type parameters

NameType
Textends Object

Parameters

NameTypeDescription
treeTthe root node of the tree.
fn(treeNode: T) => voidthe function to be executed on each node of the tree.

Returns

void


unloadResource

unloadResource(id): void

Unloads a resource from the DOM based on its ID. Internal use only.

Parameters

NameTypeDescription
idstringthe ID of the resource to unload.

Returns

void


useComponentData

useComponentData(): ComponentData

Returns

ComponentData

the instance of the ComponentData of the currently rendered component.


useDisposable

useDisposable<T>(factory, deps): T | undefined

Creates a disposable object with the useMemo hook and dispose the object when the React component is unmounted. Internal use only.

Type parameters

NameType
Textends IDisposable

Parameters

NameTypeDescription
factory() => Tthe factory function to create a disposable object.
depsundefined | DependencyListthe dependencies for the useMemo hook.

Returns

T | undefined

the disposable object.


useErrorModel

useErrorModel(): Model<ErrorWrapperProps>

Returns

Model<ErrorWrapperProps>

the model of React component used to display the error.


useForwardRef

useForwardRef<T>(value?, ref?): void

Sets the forwarded ref value.

Type parameters

NameDescription
Tthe type of value.

Parameters

NameTypeDescription
value?Tthe value of ref.
ref?ForwardedRef<T>the forwarded ref.

Returns

void


useStore

useStore(): Store

Internal use only.

Returns

Store


useTooltipType

useTooltipType(): undefined | string

Returns

undefined | string

the type of React component used to display the tooltip. Internal use only.


useViewerProps

useViewerProps(): Readonly<FormViewerProps>

Internal use only.

Returns

Readonly<FormViewerProps>