Module: @react-form-builder/core
Enumerations
Classes
- ActionDefinition
- ActionEventArgs
- Annotation
- AnnotationBuilder
- ArrayBuilder
- BaseBuilder
- BuilderOptions
- BuilderView
- CalculableResult
- ComponentData
- ComponentDataEvents
- ComponentKeyChangedEventArgs
- ComponentState
- ComponentStore
- ContainerAnnotation
- DataValidator
- Definer
- EventAnnotation
- EventStream
- Form
- FormViewerPropsStore
- Language
- LocalizationStore
- Meta
- Model
- ModuleAnnotation
- NodeAnnotationBuilder
- OneOfBuilder
- PropertyAnnotation
- QuantifierBuilder
- SomeOfBuilder
- Store
- StyleAnnotation
- SyncEvent
- TemplateField
- TypedBuilder
- View
Interfaces
- BaseCompilationResult
- BuilderComponent
- ComponentProperty
- ComponentTreeProps
- ErrorWrapperProps
- Field
- FormViewerProps
- FormViewerWrapperComponentProps
- IFormData
- IFormViewer
- IStore
- InternalErrorProps
- LabeledValue
- PersistedForm
- ScreenProps
- SuppressResizeObserverErrorsProps
- WrapperProps
Type Aliases
ActionData
Ƭ ActionData: Object
Action Storage. Used for add a new action, store information about it.
Type declaration
Name | Type | Description |
---|---|---|
[KeySymbol]? | string | The unique action key. |
args? | Arguments | The action arguments. |
name | string | The action name. |
type | ActionType | The action type. |
ActionEventHandler
Ƭ ActionEventHandler: (e
: ActionEventArgs
) => void
| Promise
<void
>
Type declaration
▸ (e
): void
| Promise
<void
>
Event handler function type.
Parameters
Name | Type | Description |
---|---|---|
e | ActionEventArgs | the action arguments. |
Returns
void
| Promise
<void
>
ActionHandler
Ƭ ActionHandler<T
>: (e
: ActionEventArgs
, params
: { [k in keyof T]: any }) => void
| Promise
<void
>
Type parameters
Name | Description |
---|---|
T | the type of action parameters. |
Type declaration
▸ (e
, params
): void
| Promise
<void
>
Action function type.
Parameters
Name | Type | Description |
---|---|---|
e | ActionEventArgs | the 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
Name | Type | Description |
---|---|---|
props | ComponentStore ["props" ] | the component's property settings. |
def | DefineActionHelper | the 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
Name | Type | Description |
---|---|---|
T | extends object | the 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
Name | Type | Description |
---|---|---|
autoValidate? | boolean | Flag, 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
Name | Type | Description |
---|---|---|
componentStore | ComponentStore | the component settings. |
language | Language | the 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
Name | Type | Description |
---|---|---|
componentData | ComponentData | the data required to display a component. |
componentProps | Record <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
Name | Type | Description |
---|---|---|
any? | DeviceStyle | CSS styles for arbitrary device. |
desktop? | DeviceStyle | CSS styles for desktop devices. |
mobile? | DeviceStyle | CSS styles for mobile devices. |
tablet? | DeviceStyle | CSS 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
Name | Type | Description |
---|---|---|
params? | ValidationRuleParameter [] | Metadata of validation rule parameters. |
validate | RuleValidator | The 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
Name | Description |
---|---|
T | the type of action parameter. |
Parameters
Name | Type | Description |
---|---|---|
name | string | the action name. |
func | ActionHandler <T > | the action handler. |
params? | ParameterDefinition <T >[] | the definition of action parameters. |
description? | string | the action description. |
Returns
the definition of an action.
DefinerData
Ƭ DefinerData<T
>: Object
Definer class data.
Type parameters
Name | Type | Description |
---|---|---|
T | extends object | React component property type. |
Type declaration
Name | Type | Description |
---|---|---|
actionsInitializer? | ActionsInitializer | The function that initializes an actions on a component (for internal use only). |
category? | string | The component category. |
component | ComponentType <T > | The React component. |
cssObject? | Annotations <CSSObject > | The CSS metadata. |
customPreview? | ReactNode | The custom component to display in the component list (unused). |
icon? | ComponentType | The component icon. |
kind? | ComponentKind | The component kind. |
name? | string | The component name. |
properties? | Annotations <T > | The property metadata. |
DeviceStyle
Ƭ DeviceStyle: Object
CSS styles for a device.
Type declaration
Name | Type | Description |
---|---|---|
object? | CSSObject | CSS styles defined in the general style settings. |
string? | string | CSS 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
Name | Type | Description |
---|---|---|
code? | string | The validation code. |
message? | string | The validation message. |
ErrorMessageLocalizer
Ƭ ErrorMessageLocalizer: (value
: ValidationResult
[] | undefined
) => string
| undefined
Type declaration
▸ (value
): string
| undefined
A function that localizes validation error messages.
Parameters
Name | Type | Description |
---|---|---|
value | ValidationResult [] | undefined | the 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
Name | Type |
---|---|
T | extends (...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
Name | Type | Description |
---|---|---|
data | Record <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
Name | Type | Description |
---|---|---|
custom? | CustomValidationRules | The set of custom validators. |
internal | ValidationRuleSet | The 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
Name | Type |
---|---|
...arg | any [] |
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
Name | Type |
---|---|
dispose | () => void |
LanguageFullCode
Ƭ LanguageFullCode: string
The full language code, e.g. 'en-US'.
LocalizationTestRequest
Ƭ LocalizationTestRequest: Object
Localization testing request.
Type declaration
Name | Type | Description |
---|---|---|
data | Record <string , FluentVariable > | The test form data. |
language | Language | The localization Language. |
localization | string | Localization value to be tested. |
localizationStringId | string | The 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
Name | Type | Description |
---|---|---|
actionDefinition | ActionDefinition | The definition of an action. |
name | string | The name of action definition. |
ParameterDefinition
Ƭ ParameterDefinition<T
>: [PropertyKey
<T
>, ParameterType
]
The type to describe the action parameter.
Type parameters
Name | Description |
---|---|
T | the 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
Name | Description |
---|---|
T | the 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
Name | Type | Description |
---|---|---|
value | any | the validated value. |
store | IStore | the 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
Name | Type | Description |
---|---|---|
T | any | the 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
Name | Type | Description |
---|---|---|
value | T | the value. |
store | IStore | the 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
Name | Description |
---|---|
T | the validation function factory arguments. |
Type declaration
▸ (value
): ResolvedValidator
The validation function factory.
Parameters
Name | Type | Description |
---|---|---|
value | T | the validated value. |
Returns
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
Name | Type | Description |
---|---|---|
array | any [] | The array. |
boolean | boolean | The boolean. |
date | Date | The date. |
enum | any | The enumeration. |
number | number | The number. |
object | object | The object. |
string | string | The string. |
Setter
Ƭ Setter<T
>: (value
: T
) => void
Type parameters
Name | Type | Description |
---|---|---|
T | any | the value type. |
Type declaration
▸ (value
): void
Value setting function type.
Parameters
Name | Type | Description |
---|---|---|
value | T | the value. |
Returns
void
SyncEventHandler
Ƭ SyncEventHandler<TSender
, TEventArgs
>: (source
: TSender
, eventArgs
: TEventArgs
) => void
Type parameters
Name | Description |
---|---|
TSender | the type of the event source. |
TEventArgs | the type of the event arguments. |
Type declaration
▸ (source
, eventArgs
): void
Represents a synchronous event handler.
Parameters
Name | Type |
---|---|
source | TSender |
eventArgs | TEventArgs |
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
Name | Type | Description |
---|---|---|
message? | string | The validation error message text. |
settings | ValidationRuleSettings | The validation rule settings. |
ValidationRule
Ƭ ValidationRule: Object
Validation rule metadata required to create a validation function.
Type declaration
Name | Type | Description |
---|---|---|
params? | ValidationRuleParameter [] | Metadata of validation rule parameters. |
validatorFactory | ValidatorFactory <any > | The validation function factory. |
ValidationRuleParameter
Ƭ ValidationRuleParameter: Object
Describes the settings of the validation rule parameter.
Type declaration
Name | Type | Description |
---|---|---|
default? | unknown | The default value. |
editorType? | string | The editor type of the setting value. |
key | string | The unique setting key of the parameter. |
required | boolean | Flag whether the setting value must be filled in. |
type | SchemaType | The type of value. |
ValidationRuleSet
Ƭ ValidationRuleSet: Record
<string
, ValidationRule
>
Describes a set of validation rules.
ValidationRuleSettings
Ƭ ValidationRuleSettings: Object
The validation rule settings.
Type declaration
Name | Type | Description |
---|---|---|
args? | Record <string , any > | Arguments of the validation rule. |
key | string | The unique key of the validation rule. The key is unique within the value type. |
type? | ValidatorType | The type of validator. |
ValidatorFactory
Ƭ ValidatorFactory<Params
>: (args
: Params
) => RuleValidator
Type parameters
Name | Description |
---|---|
Params | the factory arguments type. |
Type declaration
▸ (args
): RuleValidator
The validation function factory.
Parameters
Name | Type | Description |
---|---|---|
args | Params | the factory arguments. |
Returns
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 A user-defined key-value observable storage. Utilize it to store and share any custom data.\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
Name | Type |
---|---|
backgroundColor | AnnotationBuilder <unknown > |
color | AnnotationBuilder <unknown > |
height | AnnotationBuilder <unknown > |
marginBottom | AnnotationBuilder <unknown > |
marginLeft | AnnotationBuilder <unknown > |
marginRight | AnnotationBuilder <unknown > |
marginTop | AnnotationBuilder <unknown > |
width | AnnotationBuilder <unknown > |
containerStyles
• Const
containerStyles: Object
The annotations for generic CSS properties of a container component.
Type declaration
Name | Type |
---|---|
alignItems | OneOfBuilder <"start" | "center" | "baseline" | "end" | "stretch" > |
flexDirection | OneOfBuilder <"column" | "row" | "column-reverse" | "row-reverse" > |
flexWrap | OneOfBuilder <"wrap" | "nowrap" | "wrap-reverse" > |
gap | TypedBuilder <undefined | string > |
justifyContent | OneOfBuilder <"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
Name | Type |
---|---|
LTR | EmotionCache |
RTL | EmotionCache |
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
Name | Type |
---|---|
props | ProviderProps <ComponentData > |
Returns
null
| ReactElement
<any
, string
| JSXElementConstructor
<any
>>
ComponentTree
▸ ComponentTree(props
): Element
The React component that displays an array of ComponentData. Internal use only.
Parameters
Name | Type | Description |
---|---|---|
props | ComponentTreeProps | the React component properties. |
Returns
Element
the React element.
DefaultWrapper
▸ DefaultWrapper(props
, context?
): null
| ReactElement
<any
, any
>
The React component that wraps every component in a form.
Parameters
Name | Type |
---|---|
props | PropsWithChildren <{ 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
Name | Type | Description |
---|---|---|
props | FormViewerProps | the React component properties. |
Returns
Element
the React element.
SDiv
▸ SDiv(props
, context?
): null
| ReactElement
<any
, any
>
Parameters
Name | Type |
---|---|
props | PropsWithChildren <{ 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
Name | Type |
---|---|
props | ProviderProps <Store > |
Returns
null
| ReactElement
<any
, string
| JSXElementConstructor
<any
>>
SuppressResizeObserverErrors
▸ SuppressResizeObserverErrors(props
): Element
SuppressResizeObserverErrors component is used to suppress ResizeObserver errors. Internal use only.
Parameters
Name | Type | Description |
---|---|---|
props | SuppressResizeObserverErrorsProps | the component props. |
Returns
Element
the rendered child elements.
ViewerPropsProvider
▸ ViewerPropsProvider(props
): null
| ReactElement
<any
, string
| JSXElementConstructor
<any
>>
Internal use only.
Parameters
Name | Type |
---|---|
props | ProviderProps <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
Name | Type | Description |
---|---|---|
componentProperty | ComponentProperty | the component property. |
formViewerData | IFormData | the formViewerData data. |
Returns
the calculated value.
checkSlotCondition
▸ checkSlotCondition(childStore
, parentProps
): any
Performs the function of checking if the child component can be bound. Internal use only.
Parameters
Name | Type | Description |
---|---|---|
childStore | ComponentStore | the child component settings. |
parentProps | any | the 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
Name | Type | Description |
---|---|---|
obj | any | the input object. |
Returns
the converted ActionValues object.
createAnnotation
▸ createAnnotation<T
>(editor
): AnnotationBuilder
<T
>
Creates a component property metadata builder.
Type parameters
Name | Description |
---|---|
T | the property type. |
Parameters
Name | Type | Description |
---|---|---|
editor | string | the property editor type. |
Returns
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
Name | Type | Description |
---|---|---|
name | string | the 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
Name | Type | Description |
---|---|---|
editor | string | editor 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
Name | Type | Description |
---|---|---|
models | Model <any >[] | the components metadata. |
Returns
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
Name | Type |
---|---|
T | extends object |
Parameters
Name | Type | Description |
---|---|---|
component | ComponentType <T > | the React component. |
displayName? | string | the 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
Name | Type |
---|---|
T | extends Object |
Parameters
Name | Type | Default value | Description |
---|---|---|---|
value | T | undefined | the root of the tree. |
element? | T | undefined | the element to find the depth of. |
depth | number | 0 | the 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
Name | Type | Description |
---|---|---|
name | string | the 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
Name | Type | Description |
---|---|---|
prefix | string | the prefix. |
existingNames | Set <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
Name | Type | Description |
---|---|---|
annotations | Annotation [] | 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
Name | Type | Description |
---|---|---|
annotations | Annotation [] | 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
Name | Type | Description |
---|---|---|
rawId | string | some 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
Name | Type | Description |
---|---|---|
data | Record <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
Name | Type | Description |
---|---|---|
ruleKey | string | the 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
Name | Type | Description |
---|---|---|
array | T [] | the array of values. |
predicate | (value : T , index : number , array : T []) => string | the 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
Name | Type | Description |
---|---|---|
form | ComponentData | the 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
Name | Type | Description |
---|---|---|
value | Annotation | the 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
Name | Type | Description |
---|---|---|
componentProperty? | ComponentProperty | the 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
Name | Type | Description |
---|---|---|
componentProperty? | ComponentProperty | the 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
Name | Type |
---|---|
T | any |
Parameters
Name | Type | Description |
---|---|---|
value | any | the 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
Name | Type | Description |
---|---|---|
value | Annotation | the 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
Name | Type | Description |
---|---|---|
value | any | the 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
Name | Type | Description |
---|---|---|
value | string | the component key. |
store | IStore | the 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
Name | Type | Description |
---|---|---|
type | string | the 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
Name | Type | Description |
---|---|---|
id | string | the identifier of the resource. |
href | string | represents a URL to the resource. |
rel | string | the 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
Name | Type | Description |
---|---|---|
owner | string | the owner of the autorun. |
name | string | the name of the autorun. |
params | Record <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
Name | Type | Description |
---|---|---|
owner | string | the owner of the observable. |
params | Record <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
Name | Type |
---|---|
T | extends FunctionComponent <any , T > |
Parameters
Name | Type | Description |
---|---|---|
displayName | string | the displayName value of the React component. |
component | T | the 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
Name | Type |
---|---|
U | extends string | number |
Parameters
Name | Type |
---|---|
...values | U [] |
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
Name | Type |
---|---|
U | extends string | number |
Parameters
Name | Type |
---|---|
...values | U [] |
Returns
testFluentLocalization
▸ testFluentLocalization(request
): CalculableResult
Localization testing function. Internal use only.
Parameters
Name | Type | Description |
---|---|---|
request | LocalizationTestRequest | the localization testing request. |
Returns
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
Name | Type |
---|---|
T | extends object = any |
Parameters
Name | Type | Description |
---|---|---|
annotations? | Annotations <T > | the object containing component property metadata. |
setup | Partial <Partial <Omit <Annotation , "key" >> & Pick <Annotation , "editor" > & BuilderOptions > | the custom options for the component's property metadata builder. |
Returns
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
Name | Type | Default value | Description |
---|---|---|---|
items | string [] | LabeledValue [] | undefined | the array of elements. |
upper | boolean | true | if 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
Name | Type |
---|---|
T | extends Object |
Parameters
Name | Type | Description |
---|---|---|
tree | T | the root node of the tree. |
fn | (treeNode : T ) => void | the 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
Name | Type | Description |
---|---|---|
id | string | the ID of the resource to unload. |
Returns
void
useComponentData
▸ useComponentData(): ComponentData
Returns
the instance of the ComponentData of the currently rendered component.
useDisposable
▸ useDisposable<T
>(factory
): T
| undefined
Creates a disposable object and dispose the object when the React component is unmounted. Internal use only.
Type parameters
Name | Type |
---|---|
T | extends IDisposable |
Parameters
Name | Type | Description |
---|---|---|
factory | () => T | the factory function to create a disposable object. |
Returns
T
| undefined
the disposable object.
useErrorModel
▸ useErrorModel(): Model
<ErrorWrapperProps
>
Returns
the model of React component used to display the error.
useStore
▸ useStore(): Store
Internal use only.
Returns
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
>