@claspo/renderer
Core Web Components rendering engine providing base classes (WcElement, WcControlledElement), action system, form management, services, and view routing for Claspo widgets.
@claspo/renderer / action/SysActionTypes
action/SysActionTypes
default
Enumeration Members
@claspo/renderer / common/ConfigService
common/ConfigService
default
Service for managing widget configuration. Provides access to widget initialization settings with default values.
Constructors
Constructor
new default(config): default;Creates a new ConfigService instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
config | WidgetInitConfigI | Widget initialization configuration |
Returns
Methods
getConfig()
Call Signature
getConfig<K>(key): WidgetInitConfigI[K];Gets a configuration value by key or the entire configuration object.
Type Parameters
| Type Parameter |
|---|
K extends keyof WidgetInitConfigI |
Parameters
| Parameter | Type | Description |
|---|---|---|
key | K | Optional configuration key to retrieve |
Returns
WidgetInitConfigI[K]
The value for the specified key, or the entire config if no key provided
Call Signature
getConfig(): WidgetInitConfigI;Gets a configuration value by key or the entire configuration object.
Returns
WidgetInitConfigI
The value for the specified key, or the entire config if no key provided
Properties
@claspo/renderer / common/DefaultState
common/DefaultState
default
Simple state management class for storing component state.
Constructors
Constructor
new default(initialState?): default;Creates a new DefaultState instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
initialState? | DefaultStateI | Optional initial state values |
Returns
Methods
getState()
getState(): DefaultStateI;Gets the current state object.
Returns
The current state
setState()
setState(obj): void;Merges new values into the current state.
Parameters
| Parameter | Type | Description |
|---|---|---|
obj | Partial<DefaultStateI> | Partial state object to merge |
Returns
void
destroy()
destroy(): void;Cleans up the state instance.
Returns
void
Properties
| Property | Type | Description |
|---|---|---|
state | DefaultStateI | Current state object |
DefaultStateI
Interface for state object with dynamic keys.
Indexable
[key: string]: any@claspo/renderer / common/SysEventTypes
common/SysEventTypes
default
Enumeration Members
@claspo/renderer / document-model/DocumentModelService
document-model/DocumentModelService
default
Service for managing the document model. Provides access to views, shared settings, and component data.
Extends
default
Constructors
Constructor
new default(json): default;Creates a new DocumentModelService instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
json | any | Document model JSON |
Returns
Overrides
DefaultEventEmitter.constructorMethods
setComponentRef()
setComponentRef(targetComponentId, componentRef): void;Sets a component reference in the model.
Parameters
| Parameter | Type | Description |
|---|---|---|
targetComponentId | string | Component ID |
componentRef | any | Component reference to set |
Returns
void
getModel()
getModel(): ClDocumentI;Gets the flattened document model.
Returns
ClDocumentI
Document model
getView()
getView(index): ClBaseComponentI;Gets a view by index.
Parameters
| Parameter | Type | Description |
|---|---|---|
index | number | View index |
Returns
ClBaseComponentI
View component
getViews()
getViews(): ClBaseComponentI[];Gets all views.
Returns
ClBaseComponentI[]
Array of view components
getShared()
getShared(): ClDocumentSharedI;Gets shared document settings.
Returns
ClDocumentSharedI
Shared settings object
iterateViewModelAndExecute()
iterateViewModelAndExecute(viewIndex, callback): void;Iterates through view components and executes callback.
Parameters
| Parameter | Type | Description |
|---|---|---|
viewIndex | number | View index to iterate |
callback | (node) => void | Function to execute for each component |
Returns
void
destroy()
destroy(): void;Cleans up the service.
Returns
void
Overrides
DefaultEventEmitter.destroydestroyView()
destroyView(viewIndex): void;Destroys a specific view.
Parameters
| Parameter | Type | Description |
|---|---|---|
viewIndex | number | View index to destroy |
Returns
void
Properties
EditorToWidgetEventType
const EditorToWidgetEventType: {
COMPONENT_INSERT: string;
COMPONENT_REMOVE: string;
COMPONENT_MOVE: string;
COMPONENT_UPDATE: string;
COMPONENT_PROPS_UPDATE: string;
REMOVE_FOCUS: string;
SET_FOCUS: string;
SHARED_UPDATE: string;
MOBILE_BREAKPOINT_UPDATE: string;
ENVIRONMENT_UPDATE: string;
TEXT_CLASS_ADDED: string;
TEXT_CLASS_UPDATED: string;
TEXT_CLASS_REMOVED: string;
HEADER_FONT_FAMILY_UPDATE: string;
TEXT_FONT_FAMILY_UPDATE: string;
SHARED_UPDATE_ALL: string;
COLOR_SCHEMA_UPDATE: string;
THEME_UPDATE: string;
};Event types for document model updates
Type Declaration
@claspo/renderer / document-model/MergeAdaptiveStylesWithEnvIndependentStyles
document-model/MergeAdaptiveStylesWithEnvIndependentStyles
default()
function default<T>(adaptiveStyles, envIndependentStyles): BaseComponentAdaptiveStylesI;Merges environment-independent styles with platform-specific adaptive styles. Applies env-independent styles to both desktop and mobile style sets.
Type Parameters
| Type Parameter | Description |
|---|---|
T extends ClBaseComponentElementParamsI | Element params type extending ClBaseComponentElementParamsI |
Parameters
| Parameter | Type | Description |
|---|---|---|
adaptiveStyles | BaseComponentAdaptiveStylesI | Platform-specific styles (desktop/mobile) |
envIndependentStyles | T[] | Styles that apply to all platforms |
Returns
BaseComponentAdaptiveStylesI
Merged adaptive styles with env-independent styles applied
@claspo/renderer / form/FormControl.interface
form/FormControl.interface
FormControlConfigI
Configuration options for creating a form control.
Properties
| Property | Type | Description |
|---|---|---|
name | string | Unique name identifier for the control |
componentId? | string | Associated component ID |
viewIdx? | number | View index for multi-view forms |
defaultValue? | any | Initial default value |
debounceValue? | number | Debounce delay in milliseconds for value changes |
triggerEvent? | string | DOM event that triggers value updates |
validation? | ValidationConfigI | Validation configuration |
SetValueOptionsI
Options for setting a form control's value.
Properties
TrackingServiceI
Service interface for analytics and tracking.
Methods
send()
send(message): void;Sends a tracking message.
Parameters
| Parameter | Type | Description |
|---|---|---|
message | string | Message to send |
Returns
void
trackTargetAction()
trackTargetAction(countAsTargetAction?): void;Tracks a target action event.
Parameters
| Parameter | Type | Description |
|---|---|---|
countAsTargetAction? | boolean | Whether to count as a target action |
Returns
void
@claspo/renderer / form/FormControl
form/FormControl
FormControl
Represents a single form control with validation, state management, and event handling. Manages input value, validation state, and user interaction tracking.
Extends
default
Constructors
Constructor
new FormControl(
config,
elementRef,
customValidators?,
asyncCustomValidators?,
tracking?): FormControl;Creates a new FormControl instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
config | FormControlConfigI | Control configuration |
elementRef | HTMLInputElement | Reference to the HTML input element |
customValidators? | SyncValidatorsMapI | Custom synchronous validators |
asyncCustomValidators? | AsyncValidatorsMapI | Custom asynchronous validators |
tracking? | TrackingServiceI | Tracking service for analytics |
Returns
Overrides
DefaultEventEmitter.constructorMethods
inputElementValueChanged()
inputElementValueChanged(value): void;Handles value change from the input element.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | any | New input value |
Returns
void
setDisabled()
setDisabled(): void;Disables the form control and its associated input element.
Returns
void
setEnabled()
setEnabled(): void;Enables the form control and its associated input element.
Returns
void
setPending()
setPending(value): void;Sets the pending state for async validation.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Pending state |
Returns
void
getName()
getName(): string;Gets the control name.
Returns
string
Control name
getValue()
getValue(): any;Gets the current control value.
Returns
any
Current value
getComponentId()
getComponentId(): string;Gets the component identifier.
Returns
string
Component ID
setValue()
setValue(value, options): void;Sets the control value with optional configuration.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | any | New value to set |
options | SetValueOptionsI | Options for value setting behavior |
Returns
void
isValid()
isValid(): boolean;Checks if the control is valid.
Returns
boolean
True if valid
isPending()
isPending(): boolean;Checks if async validation is pending.
Returns
boolean
True if validation is in progress
validate()
validate(options): Promise<boolean>;Validates the control value.
Parameters
| Parameter | Type | Description |
|---|---|---|
options | SetValueOptionsI | Validation options |
Returns
Promise<boolean>
Promise resolving to validation result
markAsTouched()
markAsTouched(): void;Marks the control as touched by the user.
Returns
void
isTouched()
isTouched(): boolean;Checks if the control has been touched.
Returns
boolean
True if touched
getErrorKeys()
getErrorKeys(): string[];Gets the current validation error keys.
Returns
string[]
Array of error keys
destroy()
destroy(): void;Cleans up the form control.
Returns
void
Overrides
DefaultEventEmitter.destroyProperties
| Property | Type | Description |
|---|---|---|
componentId | string | Component identifier |
viewIdx | number | View index where control is rendered |
name | string | Control name used as form field key |
defaultValue | any | Initial default value |
value | any | Current control value |
validator | default | Validator instance for this control |
errorKeys | string[] | Current validation error keys |
valid | boolean | Whether the control is valid |
disabled | boolean | Whether the control is disabled |
pending | boolean | Whether async validation is in progress |
debounceValue | number | Debounce delay for validation in milliseconds |
tracking | TrackingServiceI | Tracking service for analytics |
touched | boolean | Whether the control has been touched by user |
valueChanged | boolean | Whether the value has changed |
elementRef | HTMLInputElement | Reference to the HTML input element |
debouncedValidate | (options?) => void | Promise<boolean> | Debounced validation function |
@claspo/renderer / form/FormControlEvents
form/FormControlEvents
FormControlEventsI
Interface defining form control event names.
Extended by
Properties
FormControlEventT
type FormControlEventT = FormControlEventsI[keyof FormControlEventsI];Union type of all form control event names.
default
const default: FormControlEventsI;Event names for form control state changes.
@claspo/renderer / form/FormControlValidator.interface
form/FormControlValidator.interface
ValidationResultI
Result of a validation operation.
Extended by
Properties
AsyncValidationResultI
Result of an async validation operation.
Extends
Properties
| Property | Type | Description | Overrides | Inherited from |
|---|---|---|---|---|
isValid | boolean | Whether the value passed validation | - | ValidationResultI.isValid |
errorKey | string | Error key for failed validation, null if valid | - | ValidationResultI.errorKey |
value? | any | The validated value | ValidationResultI.value | - |
SyncValidatorsMapI
Map of synchronous validators indexed by validator name.
Indexable
[key: string]: SyncValidatorFnValidator function keyed by name
AsyncValidatorsMapI
Map of asynchronous validators indexed by validator name.
Indexable
[key: string]: AsyncValidatorFnAsync validator function keyed by name
ValidationConfigI
Configuration for form control validation.
Properties
FormControlLikeI
Minimal interface for form control-like objects.
Methods
setValue()
setValue(value, options?): void;Sets the control's value.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | any | New value to set |
options? | Record<string, any> | Optional settings for the value change |
Returns
void
SyncValidatorFn()
type SyncValidatorFn = (value) => ValidationResultI;Synchronous validator function type.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | any | Value to validate |
Returns
Validation result
AsyncValidatorFn()
type AsyncValidatorFn = (value, errorKeys) => Promise<AsyncValidationResultI>;Asynchronous validator function type.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | any | Value to validate |
errorKeys | string[] | Available error keys for the validator |
Returns
Promise<AsyncValidationResultI>
Promise resolving to validation result
@claspo/renderer / form/FormControlValidator
form/FormControlValidator
default
Handles validation for form controls. Supports both synchronous and asynchronous validators.
Constructors
Constructor
new default(
control,
validation,
customValidatorsMap?,
asyncCustomValidators?): default;Creates a new FormControlValidator instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
control | FormControlLikeI | Form control to validate |
validation | ValidationConfigI | Validation configuration |
customValidatorsMap? | SyncValidatorsMapI | Custom synchronous validators |
asyncCustomValidators? | AsyncValidatorsMapI | Custom asynchronous validators |
Returns
Methods
isValid()
isValid(value): Promise<boolean>;Checks if a value is valid.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | any | Value to validate |
Returns
Promise<boolean>
Promise resolving to true if valid
getErrorKeys()
getErrorKeys(value): Promise<string[]>;Gets all validation error keys for a value. Runs both sync and async validators.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | any | Value to validate |
Returns
Promise<string[]>
Promise resolving to array of error keys
getSyncErrorKeys()
getSyncErrorKeys(value): string[];Gets synchronous validation error keys for a value.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | any | Value to validate |
Returns
string[]
Array of error keys from sync validators
Properties
| Property | Type | Description |
|---|---|---|
control | FormControlLikeI | Reference to the form control being validated |
customValidatorsMap | SyncValidatorsMapI | Custom synchronous validators |
asyncCustomValidators | AsyncValidatorsMapI | Custom asynchronous validators |
required | boolean | Whether the field is required |
validator | string | Name of the validator to use |
@claspo/renderer / form/FormGroup.interface
form/FormGroup.interface
FormControlsMapI
Map of form controls indexed by control name.
Indexable
[name: string]: FormControlForm control instance keyed by name
FormValuesMapI
Map of form values indexed by control name.
Indexable
[name: string]: anyForm value keyed by control name
@claspo/renderer / form/FormGroup
form/FormGroup
default
Manages a group of form controls with collective validation and state. Provides methods for registering, updating, and validating form controls.
Extends
default
Constructors
Constructor
new default(tracking): default;Creates a new FormGroup instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
tracking | TrackingServiceI | Tracking service for analytics |
Returns
Overrides
DefaultEventEmitter.constructorMethods
registerControl()
registerControl(
config,
elementRef,
customValidators?,
asyncCustomValidators?): FormControl;Registers a new form control in the group.
Parameters
| Parameter | Type | Description |
|---|---|---|
config | FormControlConfigI | Control configuration |
elementRef | HTMLInputElement | Reference to HTML input element |
customValidators? | SyncValidatorsMapI | Custom synchronous validators |
asyncCustomValidators? | AsyncValidatorsMapI | Custom asynchronous validators |
Returns
The registered FormControl instance
updateControl()
updateControl(
config,
elementRef,
customValidators?,
asyncCustomValidators?): FormControl;Updates an existing form control with new configuration.
Parameters
| Parameter | Type | Description |
|---|---|---|
config | FormControlConfigI | Updated control configuration |
elementRef | HTMLInputElement | Reference to HTML input element |
customValidators? | SyncValidatorsMapI | Custom synchronous validators |
asyncCustomValidators? | AsyncValidatorsMapI | Custom asynchronous validators |
Returns
The updated FormControl instance
getControl()
getControl(name): FormControl;Gets a form control by name.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | Control name |
Returns
The FormControl instance
hasControl()
hasControl(name): boolean;Checks if a control exists in the group.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | Control name |
Returns
boolean
True if control exists
removeControl()
removeControl(name): void;Removes a control from the group.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | Control name to remove |
Returns
void
setControlValue()
setControlValue(name, value): void;Sets the value of a control by name.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | Control name |
value | any | Value to set |
Returns
void
setPreventSubmit()
setPreventSubmit(value): void;Sets whether form submission is prevented.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Prevent submit flag |
Returns
void
destroy()
destroy(): void;Cleans up the form group and all controls.
Returns
void
Overrides
DefaultEventEmitter.destroyisValid()
isValid(): boolean;Checks if all controls in the group are valid.
Returns
boolean
True if all controls are valid
waitForPendingValidationAndCheckIfValid()
waitForPendingValidationAndCheckIfValid(): Promise<boolean>;Resolves the form's current validity. If validation is pending (e.g. async
validator still running), waits for the next validationChecked event
before resolving. Used by actions that must not proceed until the form
has a stable validity state.
Returns
Promise<boolean>
isPending()
isPending(): boolean;Checks if any control has pending async validation.
Returns
boolean
True if any control is pending
getControlsMap()
getControlsMap(): FormValuesMapI;Gets a map of control names to their current values.
Returns
Map of control values
getControlsAsArray()
getControlsAsArray(): FormControl[];Gets all controls as an array.
Returns
Array of FormControl instances
setDisabledAll()
setDisabledAll(): void;Disables all controls in the group.
Returns
void
setEnabledAll()
setEnabledAll(): void;Enables all controls in the group.
Returns
void
markAsTouched()
markAsTouched(): void;Marks all controls as touched.
Returns
void
isTouched()
isTouched(): boolean;Checks if all controls have been touched.
Returns
boolean
True if all controls are touched
Properties
| Property | Type | Description |
|---|---|---|
controls | FormControlsMapI | Map of registered form controls by name |
tracking | TrackingServiceI | Tracking service for analytics |
submitQueuedAfterPending | boolean | Whether submit is queued after pending validation |
preventSubmit | boolean | Whether form submission is prevented |
@claspo/renderer / form/FormGroupEvents
form/FormGroupEvents
FormGroupEventsI
Interface defining form group event names. Extends form control events with group-specific events.
Extends
Properties
| Property | Type | Description | Overrides |
|---|---|---|---|
validationChecked | "validationChecked" | Emitted when form validation is checked | - |
controlRegistered | "controlRegistered" | Emitted when a new control is registered | - |
valueChanged | "valueChanged" | Emitted when any control value changes | FormControlEventsI.valueChanged |
validationStatusChanged | "validationStatusChanged" | Emitted when validation status changes | FormControlEventsI.validationStatusChanged |
touchedStatusChanged | "touchedStatusChanged" | Emitted when touched status changes | FormControlEventsI.touchedStatusChanged |
FormGroupEventT
type FormGroupEventT = FormGroupEventsI[keyof FormGroupEventsI];Union type of all form group event names.
default
const default: FormGroupEventsI;Event names for form group state changes. Includes all form control events plus group-specific events.
@claspo/renderer / renderer/RenderConstants
renderer/RenderConstants
applySysClassPrefix()
function applySysClassPrefix(str): string;Adds the system class prefix to a string.
Parameters
| Parameter | Type | Description |
|---|---|---|
str | string | String to prefix |
Returns
string
Prefixed class name (e.g., 'cl-button')
applySysAttrPrefix()
function applySysAttrPrefix(str): string;Adds the system attribute prefix to a string.
Parameters
| Parameter | Type | Description |
|---|---|---|
str | string | String to prefix |
Returns
string
Prefixed attribute name (e.g., 'cl-element')
RenderConstants
const RenderConstants: {
SYSTEM_CLASS_PREFIX: "cl-";
SYSTEM_ATTRIBUTE_PREFIX: "cl-";
};Constants for the rendering system.
Type Declaration
@claspo/renderer / renderer/style/DefaultMediaQueryListener
renderer/style/DefaultMediaQueryListener
default
Listens for viewport changes and emits events when crossing mobile breakpoint. Uses CSS media queries for efficient viewport monitoring.
Extends
default
Constructors
Constructor
new default(documentModel, config): default;Creates a new DefaultMediaQueryListener instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
documentModel | default | Document model service |
config | WidgetInitConfigI | Widget configuration |
Returns
Overrides
DefaultEventEmitter.constructorMethods
handleMobileBreakpoint()
handleMobileBreakpoint(mobileBreakpointWidth): void;Sets up media query listener for the specified breakpoint.
Parameters
| Parameter | Type | Description |
|---|---|---|
mobileBreakpointWidth | string | number | Breakpoint width value |
Returns
void
isMobile()
isMobile(): boolean;Checks if the current viewport is mobile.
Returns
boolean
True if mobile viewport or forceMobileEnv is set
listener()
listener(mediaQueryListEvent): void;Media query change event handler.
Parameters
| Parameter | Type | Description |
|---|---|---|
mediaQueryListEvent | MediaQueryListEvent | Browser media query event |
Returns
void
destroy()
destroy(): void;Cleans up the listener and removes event handlers.
Returns
void
Overrides
DefaultEventEmitter.destroyProperties
EnvironmentUpdatePayloadI
Payload for environment update events.
Properties
@claspo/renderer / resource-management/ComponentResourceManager
resource-management/ComponentResourceManager
default
Manages resource loading for a single component. Tracks pending resources and emits events when loading completes or fails.
Constructors
Constructor
new default(
componentId,
systemEventEmitter,
isStaticEntryModule): default;Creates a new ComponentResourceManager instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
componentId | string | Component identifier |
systemEventEmitter | DefaultEventEmitter | Event emitter for system events |
isStaticEntryModule | boolean | Whether in static mode |
Returns
Methods
getPending()
getPending(): default;Gets the pending resources counter.
Returns
Pending counter instance
onCounterStateUpdate()
onCounterStateUpdate(count): void;Handles counter state updates. Emits resource loaded event when pending count reaches 0.
Parameters
| Parameter | Type | Description |
|---|---|---|
count | number | Current count value |
Returns
void
onResourceLoadFailure()
onResourceLoadFailure(src): void;Handles resource load failure.
Parameters
| Parameter | Type | Description |
|---|---|---|
src | string | Source URL that failed to load |
Returns
void
Properties
| Property | Type | Description |
|---|---|---|
componentId | string | Component identifier |
systemEventEmitter | DefaultEventEmitter | System event emitter for broadcasting resource events |
isStaticEntryModule | boolean | Whether running in static entry module mode |
counters | ResourceCountersI | Resource counters |
ResourceCountersI
Interface for resource counters
Properties
| Property | Type |
|---|---|
pending | default |
@claspo/renderer / resource-management/Counter
resource-management/Counter
default
Simple counter class for tracking resource loading state. Notifies via callback when count changes.
Constructors
Constructor
new default(onUpdateCb): default;Creates a new Counter instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
onUpdateCb | CounterUpdateCallbackT | Callback invoked when count changes |
Returns
Methods
increment()
increment(): void;Increments the counter by 1 and notifies callback.
Returns
void
decrement()
decrement(): void;Decrements the counter by 1 (minimum 0) and notifies callback.
Returns
void
count()
count(): number;Gets the current count value.
Returns
number
Current count
Properties
| Property | Type | Description |
|---|---|---|
_count | number | Current count value |
onUpdateCb | CounterUpdateCallbackT | Callback invoked on count change |
CounterUpdateCallbackT()
type CounterUpdateCallbackT = (count) => void;Callback function called when counter value changes
Parameters
| Parameter | Type |
|---|---|
count | number |
Returns
void
@claspo/renderer / resource-management/ViewResourcesManager
resource-management/ViewResourcesManager
default
Manages resource loading for all components in a view. Tracks when all component resources are loaded.
Constructors
Constructor
new default(systemEventEmitter): default;Creates a new ViewResourcesManager instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
systemEventEmitter | any | Event emitter for system events |
Returns
Methods
registerComponent()
registerComponent(id, componentResourceManager): void;Registers a component's resource manager.
Parameters
| Parameter | Type | Description |
|---|---|---|
id | any | Component identifier |
componentResourceManager | any | The component's resource manager |
Returns
void
_onComponentResourcesLoaded()
_onComponentResourcesLoaded(componentId): void;Handles component resource load completion. Emits view loaded event when all components are ready.
Parameters
| Parameter | Type | Description |
|---|---|---|
componentId | any | ID of component that finished loading |
Returns
void
viewHasPendingResources()
viewHasPendingResources(): boolean;Checks if any components have pending resources.
Returns
boolean
True if resources are still loading
Properties
@claspo/renderer / sdk/ColorUtils
sdk/ColorUtils
changeAlpha()
function changeAlpha(color, value): string;Parameters
| Parameter | Type |
|---|---|
color | string |
value | number |
Returns
string
getAlpha()
function getAlpha(color): number;Parameters
| Parameter | Type |
|---|---|
color | string |
Returns
number
lighten()
function lighten(color, value): string;Parameters
| Parameter | Type |
|---|---|
color | string |
value | number |
Returns
string
darken()
function darken(color, value): string;Parameters
| Parameter | Type |
|---|---|
color | string |
value | number |
Returns
string
getContrastRatio()
function getContrastRatio(color1, color2): number;Parameters
| Parameter | Type |
|---|---|
color1 | string |
color2 | string |
Returns
number
whiteColor
const whiteColor: "rgb(255, 255, 255)" = 'rgb(255, 255, 255)';blackColor
const blackColor: "rgb(0, 0, 0)" = 'rgb(0, 0, 0)';@claspo/renderer / sdk/ComponentType
sdk/ComponentType
default
const default: {
CONTAINER: string;
TEXT: string;
INPUT: string;
BUTTON: string;
IMAGE: string;
VIDEO: string;
COLUMN: string;
};Type Declaration
@claspo/renderer / sdk/FormUtils
sdk/FormUtils
setValidStyles()
function setValidStyles(inputElement, tooltipElement): void;Parameters
| Parameter | Type |
|---|---|
inputElement | HTMLElement |
tooltipElement | HTMLElement |
Returns
void
setInvalidStyle()
function setInvalidStyle(
inputElement,
tooltipElement,
error,
htmlDocumentObject?): void;Parameters
| Parameter | Type |
|---|---|
inputElement | HTMLElement |
tooltipElement | HTMLElement |
error | string |
htmlDocumentObject? | Document |
Returns
void
setPendingStyle()
function setPendingStyle(inputElement, tooltipElement): void;Parameters
| Parameter | Type |
|---|---|
inputElement | HTMLElement |
tooltipElement | HTMLElement |
Returns
void
@claspo/renderer / sdk/HtmlStyleUtils
sdk/HtmlStyleUtils
setStylesToElement()
function setStylesToElement(element, style): void;Parameters
| Parameter | Type |
|---|---|
element | HTMLElement |
style | Record<string, string> |
Returns
void
getStylesFromElement()
function getStylesFromElement(element, properties): Record<string, string>;Parameters
| Parameter | Type |
|---|---|
element | HTMLElement |
properties | string[] |
Returns
Record<string, string>
getLabelParamsFromProps()
function getLabelParamsFromProps(props, env): LabelParamsI;Parameters
| Parameter | Type |
|---|---|
props | ClBaseComponentPropsI |
env | PlatformEnvT |
Returns
applyInputLabelStyles()
function applyInputLabelStyles(
props,
env,
rootElement,
selector): void;Parameters
| Parameter | Type |
|---|---|
props | ClBaseComponentPropsI |
env | PlatformEnvT |
rootElement | Element | ShadowRoot |
selector | string |
Returns
void
resizeElementTextToFitContainer()
Call Signature
function resizeElementTextToFitContainer(params): void;Parameters
| Parameter | Type |
|---|---|
params | ResizeTextParamsI |
Returns
void
Call Signature
function resizeElementTextToFitContainer(
childElement,
parentElement,
paddings?): void;Parameters
| Parameter | Type |
|---|---|
childElement | HTMLElement |
parentElement | HTMLElement |
paddings? | PaddingsI |
Returns
void
setInputHostSize()
function setInputHostSize(
props,
env,
hostElement,
inputElement,
labelElement): void;Parameters
| Parameter | Type |
|---|---|
props | ClBaseComponentPropsI |
env | PlatformEnvT |
hostElement | HTMLElement |
inputElement | HTMLElement |
labelElement | HTMLElement |
Returns
void
setFocusOutline()
function setFocusOutline(element, elementToApplyVariable?): string;Parameters
| Parameter | Type |
|---|---|
element | HTMLElement |
elementToApplyVariable? | HTMLElement |
Returns
string
LabelParamsI
Properties
PaddingsI
Properties
ResizeTextParamsI
Properties
| Property | Type |
|---|---|
childElement | HTMLElement |
parentElement | HTMLElement |
paddings? | PaddingsI |
allowMultiline? | boolean |
@claspo/renderer / sdk/ManifestUtils
sdk/ManifestUtils
cloneControlsToAllEnvs()
function cloneControlsToAllEnvs<T>(controls): InferGroupType<T>;Type Parameters
| Type Parameter |
|---|
T extends | BasePropertyPaneManifestModelI[] | BaseContextMenuManifestModelI[] | BaseFloatingControlManifestModelI[] |
Parameters
| Parameter | Type |
|---|---|
controls | T |
Returns
InferGroupType<T>
@claspo/renderer / sdk/ModelStyleUtils
sdk/ModelStyleUtils
getAdaptiveStylesForPlatform()
function getAdaptiveStylesForPlatform(
adaptiveStyles,
platform,
element): ClBaseComponentElementParamsI;Parameters
| Parameter | Type |
|---|---|
adaptiveStyles | BaseComponentAdaptiveStylesI |
platform | PlatformEnvT |
element | string |
Returns
ClBaseComponentElementParamsI
cloneAdaptiveStyles()
function cloneAdaptiveStyles(adaptiveStyles): ClBaseComponentElementParamsI[];Parameters
| Parameter | Type |
|---|---|
adaptiveStyles | ClBaseComponentElementParamsI[] |
Returns
ClBaseComponentElementParamsI[]
replaceStyleAttributes()
function replaceStyleAttributes(
adaptiveStyles,
platform,
element,
styles): BaseComponentAdaptiveStylesI;Parameters
| Parameter | Type |
|---|---|
adaptiveStyles | BaseComponentAdaptiveStylesI |
platform | PlatformEnvT |
element | string |
styles | ClComponentStyleAttributesI |
Returns
BaseComponentAdaptiveStylesI
patchStyleAttributes()
function patchStyleAttributes(
adaptiveStyles,
platform,
element,
styles): BaseComponentAdaptiveStylesI;Parameters
| Parameter | Type |
|---|---|
adaptiveStyles | BaseComponentAdaptiveStylesI |
platform | PlatformEnvT |
element | string |
styles | ClComponentStyleAttributesI |
Returns
BaseComponentAdaptiveStylesI
cloneStylesToAllEnvs()
function cloneStylesToAllEnvs(value): BaseComponentAdaptiveStylesI;Parameters
| Parameter | Type |
|---|---|
value | ClBaseComponentElementParamsI[] |
Returns
BaseComponentAdaptiveStylesI
applySharedClasses()
function applySharedClasses(elementModel, shared): ClBaseComponentElementParamsI;Parameters
| Parameter | Type |
|---|---|
elementModel | ClBaseComponentElementParamsI |
shared | ClDocumentSharedI |
Returns
ClBaseComponentElementParamsI
getPlaceholderColor()
function getPlaceholderColor(
props,
env,
shared): string;Parameters
| Parameter | Type |
|---|---|
props | { adaptiveStyles: BaseComponentAdaptiveStylesI; } |
props.adaptiveStyles | BaseComponentAdaptiveStylesI |
env | PlatformEnvT |
shared | ClDocumentSharedI |
Returns
string
@claspo/renderer / sdk/OverlayUtils
sdk/OverlayUtils
getMenuOverlayContentClassName()
function getMenuOverlayContentClassName(): string;Returns
string
createBackdrop()
function createBackdrop(isBackdropDisabledOnUI?): HTMLDivElement;Parameters
| Parameter | Type |
|---|---|
isBackdropDisabledOnUI? | boolean |
Returns
HTMLDivElement
createMenuOverlay()
function createMenuOverlay(params): MenuOverlayResultI;Parameters
| Parameter | Type |
|---|---|
params | MenuOverlayParamsI |
Returns
getOverlayMenuPlacementData()
function getOverlayMenuPlacementData(
triggerElement,
overlayContent,
offset,
positionByDefault?,
isHorizontallyCentered?,
htmlDocumentObject?): OverlayPlacementDataI;Parameters
| Parameter | Type |
|---|---|
triggerElement | HTMLElement |
overlayContent | HTMLElement |
offset | number |
positionByDefault? | OverlayPositionT |
isHorizontallyCentered? | boolean |
htmlDocumentObject? | Document |
Returns
getOverlayBackgroundColor()
function getOverlayBackgroundColor(backgroundColor, textColor): string;Parameters
| Parameter | Type |
|---|---|
backgroundColor | string |
textColor | string |
Returns
string
getOverlayBorderRadius()
function getOverlayBorderRadius(triggerHeight, overlayStyles): number;Parameters
| Parameter | Type |
|---|---|
triggerHeight | string | number |
overlayStyles | CSSStyleDeclaration |
Returns
number
getMenuItemHoverColor()
function getMenuItemHoverColor(backgroundColor): string;Parameters
| Parameter | Type |
|---|---|
backgroundColor | string |
Returns
string
MenuOverlayParamsI
Properties
| Property | Type |
|---|---|
triggerElement | HTMLElement |
overlayStyles | string |
createOverlayContent | (backdrop, overlayContent) => void |
overlayWidth? | number |
overlayHeight? | number |
offset? | number |
onDestroy? | () => void |
positionByDefault? | OverlayPositionT |
isHorizontallyCentered? | boolean |
isBackdropDisabledOnUI? | boolean |
htmlDocumentObject? | Document |
MenuOverlayResultI
Properties
OverlayPlacementDataI
Properties
| Property | Type |
|---|---|
coordinates | Record<string, string> |
position | OverlayPositionT |
HorizontalOffsetDataI
Extended by
Properties
VerticalOffsetDataI
Extended by
Properties
OverlayPositionDataI
Extends
Properties
| Property | Type | Inherited from |
|---|---|---|
horizontalOffset | number | HorizontalOffsetDataI.horizontalOffset |
contentWidth | number | HorizontalOffsetDataI.contentWidth |
availableSpaceToTheLeftSideOfTheTrigger | number | HorizontalOffsetDataI.availableSpaceToTheLeftSideOfTheTrigger |
availableSpaceToTheRightSideOfTheTrigger | number | HorizontalOffsetDataI.availableSpaceToTheRightSideOfTheTrigger |
verticalOffset | number | VerticalOffsetDataI.verticalOffset |
contentHeight | number | VerticalOffsetDataI.contentHeight |
availableSpaceAboveTriggerElem | number | VerticalOffsetDataI.availableSpaceAboveTriggerElem |
availableSpaceBelowTriggerElem | number | VerticalOffsetDataI.availableSpaceBelowTriggerElem |
position | OverlayPositionT | - |
OverlayPositionT
type OverlayPositionT = "top" | "bottom" | "left" | "right" | "undefined";@claspo/renderer / sdk/PayloadEvent
sdk/PayloadEvent
PayloadEvent
Custom event class with payload data. Extends native Event to include a detail property for passing data.
Extends
Event
Constructors
Constructor
new PayloadEvent(
type,
detail,
init): PayloadEvent;Creates a new PayloadEvent.
Parameters
| Parameter | Type | Description |
|---|---|---|
type | any | Event type name |
detail | any | Payload data to attach to the event |
init | any | Event initialization options |
Returns
Overrides
Event.constructorProperties
@claspo/renderer / sdk/PreviewMode
sdk/PreviewMode
PreviewMode
const PreviewMode: {
CABINET_PREVIEW: "previewMode";
EDITOR_PREVIEW: "editorPreviewMode";
DEMO: "demoMode";
};Type Declaration
@claspo/renderer / sdk/TooltipUtils
sdk/TooltipUtils
setTooltipPosition()
function setTooltipPosition(params): void;Parameters
| Parameter | Type |
|---|---|
params | TooltipPositionParamsI |
Returns
void
createTooltipText()
function createTooltipText(text): HTMLDivElement;Parameters
| Parameter | Type |
|---|---|
text | string |
Returns
HTMLDivElement
addTooltipStyles()
function addTooltipStyles(htmlDocumentObject?): void;Parameters
| Parameter | Type |
|---|---|
htmlDocumentObject? | Document |
Returns
void
removeTooltipStyles()
function removeTooltipStyles(htmlDocumentObject?): void;Parameters
| Parameter | Type |
|---|---|
htmlDocumentObject? | Document |
Returns
void
TooltipPositionParamsI
Properties
@claspo/renderer / sdk/TranslationUtils
sdk/TranslationUtils
getWidgetLanguages()
function getWidgetLanguages(configService): string[];Parameters
| Parameter | Type |
|---|---|
configService | default |
Returns
string[]
getTranslationsMap()
function getTranslationsMap(translationsMapByLanguage, languages): TranslationsMapResultI;Parameters
| Parameter | Type |
|---|---|
translationsMapByLanguage | Record<string, Record<string, string>> |
languages | string[] |
Returns
normalizeLanguage()
function normalizeLanguage(lang): string;Parameters
| Parameter | Type |
|---|---|
lang | string |
Returns
string
getTranslation()
function getTranslation(
configService,
i18n,
keyName): string;Parameters
| Parameter | Type |
|---|---|
configService | default |
i18n | Record<string, Record<string, string>> |
keyName | string |
Returns
string
TranslationsMapResultI
Properties
@claspo/renderer / sdk/WcControlledElement
sdk/WcControlledElement
default
Extended WcElement for form control components. Provides form control creation, validation, and status handling.
Extends
Constructors
Constructor
new default(): default;Creates a new WcElement instance and attaches a shadow DOM.
Returns
Inherited from
Methods
_createControl()
_createControl(config, ...restControlArgs): FormControl;Parameters
| Parameter | Type |
|---|---|
config | CreateControlConfigI |
...restControlArgs | any[] |
Returns
createControlWithValidation()
createControlWithValidation(validators, options): FormControl;Parameters
| Parameter | Type |
|---|---|
validators | ValidatorFnT[] |
options | ControlValidationOptionsI |
Returns
_prepareAsyncValidators()
_prepareAsyncValidators(validators): AsyncValidatorsMapI;Parameters
| Parameter | Type |
|---|---|
validators | ValidatorFnT[] |
Returns
_handleControlStatusChange()
_handleControlStatusChange(params): void;Parameters
| Parameter | Type |
|---|---|
params | ControlStatusHandlerParamsI |
Returns
void
_handleValidationStatus()
_handleValidationStatus(params, status): void;Parameters
| Parameter | Type |
|---|---|
params | ControlStatusHandlerParamsI |
status | ControlStatusT |
Returns
void
construct()
construct(): void;Initializes the component by requesting props, setting up observers, subscriptions, state management, and event listeners. Called automatically by connectedCallback.
Returns
void
Inherited from
connectedCallback()
connectedCallback(): void;Web Component lifecycle callback invoked when the element is added to the DOM. Initializes the component and registers resource management.
Returns
void
Inherited from
disconnectedCallback()
disconnectedCallback(): void;Web Component lifecycle callback invoked when the element is removed from the DOM. Cleans up observers, subscriptions, state, and event emitters.
Returns
void
Inherited from
attachHandlers()
attachHandlers(): void;Attaches event handlers defined in the component's props. Handlers are activated with access to state, event emitter, and host element.
Returns
void
Inherited from
postponeHandlers()
postponeHandlers(): void;Temporarily pauses all active handlers. Used when handlers need to be suspended without full deactivation.
Returns
void
Inherited from
releaseHandlers()
releaseHandlers(): void;Releases all postponed handlers, allowing them to resume operation.
Returns
void
Inherited from
getProps()
getProps(): ClBaseComponentPropsI;Returns the component's current props.
Returns
ClBaseComponentPropsI
The component props or undefined if model is not available
Inherited from
getShared()
getShared(): ClDocumentSharedI;Returns the shared document state.
Returns
ClDocumentSharedI
The shared document configuration and state
Inherited from
getEnvironment()
getEnvironment(): PlatformEnvT;Returns the current platform environment based on viewport size.
Returns
'mobile' or 'desktop' based on current breakpoint
Inherited from
isStaticRenderMode()
isStaticRenderMode(): boolean;Checks if the component is in static render mode.
Returns
boolean
True if rendering for end-user display
Inherited from
isUpdatingRenderMode()
isUpdatingRenderMode(): boolean;Checks if the component is in updating/editor render mode.
Returns
boolean
True if rendering in editor context with live updates
Inherited from
getRootElement()
getRootElement(): ShadowRoot | default;Returns the root element for DOM queries (shadow root or host element).
Returns
ShadowRoot | default
The shadow root if available, otherwise the host element
Inherited from
getHostElement()
getHostElement(): this;Returns the host element (the custom element itself).
Returns
this
The WcElement instance
Inherited from
observeProps()
observeProps(cb): void;Registers a callback to observe props changes. The callback is immediately invoked with null as previous props and current props.
Parameters
| Parameter | Type | Description |
|---|---|---|
cb | (prevProps, props) => void | Callback function receiving previous and current props |
Returns
void
Inherited from
observeShared()
observeShared(cb): void;Registers a callback to observe shared document state changes. The callback is immediately invoked with current shared state.
Parameters
| Parameter | Type | Description |
|---|---|---|
cb | (shared) => void | Callback function receiving the shared state |
Returns
void
Inherited from
observeEnvironment()
observeEnvironment(cb): void;Registers a callback to observe environment (desktop/mobile) changes. The callback is immediately invoked with null as previous env and current env.
Parameters
| Parameter | Type | Description |
|---|---|---|
cb | (prevEnv, env) => void | Callback function receiving previous and current environment |
Returns
void
Inherited from
getElements()
getElements(): HTMLElement[];Returns all styleable elements within the component including the host.
Returns
HTMLElement[]
Array of HTML elements marked with cl-element attribute
Inherited from
getElement()
getElement(name, id?): HTMLElement;Finds a specific element by its cl-element attribute name and optional id.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | The value of the cl-element attribute to match |
id? | string | Optional element id for more specific matching |
Returns
HTMLElement
The matching HTML element or undefined if not found
Inherited from
applyAutoAdaptiveStyles()
applyAutoAdaptiveStyles(adaptiveStyles?, envIndependentStyles?): void;Applies adaptive styles to all elements based on current environment. Merges environment-independent styles with platform-specific styles.
Parameters
| Parameter | Type | Description |
|---|---|---|
adaptiveStyles? | BaseComponentAdaptiveStylesI | Platform-specific styles (desktop/mobile) |
envIndependentStyles? | ClBaseComponentElementParamsI[] | Styles that apply regardless of platform |
Returns
void
Inherited from
default.applyAutoAdaptiveStyles
registerComponentResourceManagement()
registerComponentResourceManagement(): void;Registers this component's resource manager with the view-level resource manager. Enables tracking of resource loading states across the widget.
Returns
void
Inherited from
default.registerComponentResourceManagement
applyStyles()
applyStyles(container, styles): boolean;Applies inline styles to a container element.
Parameters
| Parameter | Type | Description |
|---|---|---|
container | HTMLElement | The target HTML element |
styles | Record<string, string> | Object mapping style property names to values |
Returns
boolean
True if styles were applied, false if container is invalid
Inherited from
applyStylesToElement()
applyStylesToElement(
htmlElement,
elementModel,
commonStyleElement): void;Applies comprehensive styles to an element including hover, placeholder, and animation styles. Handles background image loading and color schema.
Parameters
| Parameter | Type | Description |
|---|---|---|
htmlElement | HTMLElement | The target element to style |
elementModel | ClBaseComponentElementParamsI | Model containing style definitions |
commonStyleElement | HTMLStyleElement | Style element for CSS rule injection |
Returns
void
Inherited from
applySharedClassesToElementModel()
applySharedClassesToElementModel(elementModel): ClBaseComponentElementParamsI;Applies shared CSS classes from document state to an element model.
Parameters
| Parameter | Type | Description |
|---|---|---|
elementModel | ClBaseComponentElementParamsI | The element model to enhance with shared classes |
Returns
ClBaseComponentElementParamsI
The element model with shared classes applied
Inherited from
default.applySharedClassesToElementModel
getModel()
getModel(): ClBaseComponentI;Returns the component's model containing type, id, props, and configuration.
Returns
ClBaseComponentI
The component model
Inherited from
_addStylesToStyleElement()
_addStylesToStyleElement(
styleElement,
elementName,
styleAttributes,
selector,
addImportant?): void;Parameters
| Parameter | Type |
|---|---|
styleElement | HTMLStyleElement |
elementName | string |
styleAttributes | ClComponentStyleAttributesI |
selector | string |
addImportant? | boolean |
Returns
void
Inherited from
default._addStylesToStyleElement
_addFontStylesToStyleElement()
_addFontStylesToStyleElement(styleElement, shared): void;Parameters
| Parameter | Type |
|---|---|
styleElement | HTMLStyleElement |
shared | ClDocumentSharedI |
Returns
void
Inherited from
default._addFontStylesToStyleElement
_addLinkColor()
_addLinkColor(styleElement, shared): void;Parameters
| Parameter | Type |
|---|---|
styleElement | HTMLStyleElement |
shared | ClDocumentSharedI |
Returns
void
Inherited from
_setClassAttributes()
_setClassAttributes(htmlElement, elementModel): void;Parameters
| Parameter | Type |
|---|---|
htmlElement | HTMLElement |
elementModel | ClBaseComponentElementParamsI |
Returns
void
Inherited from
getParentComponent()
getParentComponent(): Node;Finds the parent component by traversing up the DOM tree.
Returns
Node
The parent component node or null if not found
Inherited from
getWidgetContainerNode()
getWidgetContainerNode(): Node;Finds the widget container node by traversing up the DOM tree.
Returns
Node
The widget container node or null if not found
Inherited from
default.getWidgetContainerNode
getWidgetLanguages()
getWidgetLanguages(): string[];Returns the list of languages configured for the widget.
Returns
string[]
Array of language codes in order of preference
Inherited from
getPreferredWidgetLanguage()
getPreferredWidgetLanguage(): string;Returns the primary/preferred language for the widget.
Returns
string
The first language code from the configured languages
Inherited from
default.getPreferredWidgetLanguage
getTranslationsMap()
getTranslationsMap(translationsMapByLanguage): TranslationsMapResultI;Resolves translations for the widget based on configured languages.
Parameters
| Parameter | Type | Description |
|---|---|---|
translationsMapByLanguage | Record<string, Record<string, string>> | Map of language codes to translation dictionaries |
Returns
The resolved translations and language, or null if not found
Inherited from
stylesAppliedToElement()
stylesAppliedToElement(
htmlElement,
elementModel,
commonStyleElement): void;Hook method called after styles are applied to an element. Override in child classes to perform additional styling operations.
Parameters
| Parameter | Type | Description |
|---|---|---|
htmlElement | HTMLElement | The styled element |
elementModel | ClBaseComponentElementParamsI | The element model with style definitions |
commonStyleElement | HTMLStyleElement | The style element for CSS injection |
Returns
void
Inherited from
default.stylesAppliedToElement
_resolveTogglableStylesForElementModel()
static _resolveTogglableStylesForElementModel(elementModel): ClBaseComponentElementParamsI;Parameters
| Parameter | Type |
|---|---|
elementModel | ClBaseComponentElementParamsI |
Returns
ClBaseComponentElementParamsI
Inherited from
default._resolveTogglableStylesForElementModel
_resolveTogglableStyles()
static _resolveTogglableStyles(styles): ClComponentStyleAttributesI;Parameters
| Parameter | Type |
|---|---|
styles | ClComponentStyleAttributesI |
Returns
ClComponentStyleAttributesI
Inherited from
default._resolveTogglableStyles
updateContext()
updateContext(): void;Updates the component's context record with current label and view index. Used to keep context data in sync with component state.
Returns
void
Inherited from
addContextRecord()
addContextRecord(): void;Adds a new context record for this component. Registers the component's form control data in the context system.
Returns
void
Inherited from
getContextRecordLabel()
getContextRecordLabel(props): string;Generates a display label for the context record based on component props. Uses control name, content label, placeholder, or integration name.
Parameters
| Parameter | Type | Description |
|---|---|---|
props | ClBaseComponentPropsI | The component props to extract label from |
Returns
string
The generated label or undefined if no suitable source found
Inherited from
capitalizeFirstLetter()
capitalizeFirstLetter(string): string;Capitalizes the first letter of a string.
Parameters
| Parameter | Type | Description |
|---|---|---|
string | string | The input string to capitalize |
Returns
string
The string with its first character uppercased
Inherited from
getContextRecordExampleValue()
getContextRecordExampleValue(props): string;Generates an example value for the context record based on control type. Used for previewing merge tags in editor mode.
Parameters
| Parameter | Type | Description |
|---|---|---|
props | ClBaseComponentPropsI | The component props containing control configuration |
Returns
string
An appropriate example value for the control type
Inherited from
default.getContextRecordExampleValue
completeSubmitAction()
completeSubmitAction(params?): void;Executes the form submit action with optional override parameters. Uses registered submit action if available, otherwise falls back to default request action.
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | Record<string, any> | Optional parameters to override the submit action configuration |
Returns
void
Inherited from
getHandlers()
getHandlers(): ClDocumentHandlerI[];Returns the list of event handlers defined in the component's props.
Returns
ClDocumentHandlerI[]
Array of handler configurations
Inherited from
assets()
assets(path): string;Generates the URL for a component asset file.
Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | Optional path relative to the component's assets directory |
Returns
string
The full URL to the asset
Inherited from
Properties
| Property | Modifier | Type | Description | Inherited from |
|---|---|---|---|---|
manifest | public | ComponentManifestI | Component manifest containing metadata, properties, and configuration | default.manifest |
observers | public | ObserversI | Collection of observers for props, shared state, and environment changes | default.observers |
subscriptions | public | SubscriptionsI | Collection of active subscriptions for cleanup on disconnect | default.subscriptions |
state | public | default | Component-local state management instance | default.state |
componentEventEmitter | public | DefaultEventEmitter | Event emitter scoped to this component instance | default.componentEventEmitter |
componentResourceManager | public | default | Manager for tracking component resource loading states | default.componentResourceManager |
mergeTagsProcessor | public | default | Processor for merge tags (dynamic content placeholders) | default.mergeTagsProcessor |
prevProps | public | ClBaseComponentPropsI | Previous props value for change detection | default.prevProps |
prevEnvironment | public | PlatformEnvT | Previous environment value for change detection | default.prevEnvironment |
model | public | ClBaseComponentI | Component model containing type, id, props, and configuration | default.model |
services | public | ServicesI | Injected services including eventEmitter, config, form, and context | default.services |
documentModel | public | default | Service for managing document model updates and subscriptions | default.documentModel |
resizeListener | public | default | Listener for responsive breakpoint changes | default.resizeListener |
viewResourceManager | public | default | Manager for view-level resource tracking | default.viewResourceManager |
layoutType | public | string | Current layout type identifier | default.layoutType |
handlers | public | HandlerInstanceI[] | Array of active event handlers for this component | default.handlers |
htmlDocumentObject | public | Document | Reference to the HTML document object | default.htmlDocumentObject |
skipGameBlur | public | boolean | Whether this component should skip blur effect when a game starts | default.skipGameBlur |
define | static | { name: string; model: string; manifest: ComponentManifestI; } | Static component definition used for component registration. - name: The custom element tag name (e.g., 'sys-button') - model: The component class name (e.g., 'SysButtonComponent') - manifest: The component manifest configuration | default.define |
define.name | public | string | - | - |
define.model | public | string | - | - |
define.manifest | public | ComponentManifestI | - | - |
ValidatorResultI
Result of a validator function
Properties
CreateControlConfigI
Configuration for creating a control
Indexable
[key: string]: anyProperties
ControlValidationOptionsI
Options for control validation setup
Indexable
[key: string]: anyProperties
| Property | Type |
|---|---|
element? | HTMLElement |
tooltipElement? | HTMLElement |
validCallback? | () => void |
invalidCallback? | () => void |
pendingCallback? | () => void |
elementToListen? | HTMLElement |
validationMap? | Record<string, ValidatorFnT> |
listenStatusChange? | boolean |
errorMessageMapper? | (errorKey, translatedValue) => string |
ControlStatusHandlerParamsI
Parameters for control status change handler
Properties
| Property | Type |
|---|---|
control | FormControl |
element | HTMLElement |
tooltipElement | HTMLElement |
configService | default |
i18n | Record<string, Record<string, string>> |
validCallback? | () => void |
invalidCallback? | () => void |
pendingCallback? | () => void |
errorMessageMapper? | (errorKey, translatedValue) => string |
AsyncValidatorsMapI
Map of async validator functions
Indexable
[key: string]: (value, control?) => Promise<ValidatorResultI>ControlStatusT
type ControlStatusT = typeof ControlStatus[keyof typeof ControlStatus];Control status type
ValidatorFnT()
type ValidatorFnT = (value, control?) =>
| ValidatorResultI
| Promise<ValidatorResultI>;Validator function type
Parameters
| Parameter | Type |
|---|---|
value | any |
control? | FormControl |
Returns
| ValidatorResultI
| Promise<ValidatorResultI>
ControlStatus
const ControlStatus: {
PENDING: "pending";
VALID: "valid";
INVALID: "invalid";
};Control validation status constants
Type Declaration
@claspo/renderer / sdk/WcElement
sdk/WcElement
default
Base class for all Widget Components. Provides lifecycle management, styling, event handling, and service integration.
Extends
HTMLElement
Extended by
Constructors
Constructor
new default(): default;Creates a new WcElement instance and attaches a shadow DOM.
Returns
Overrides
HTMLElement.constructorMethods
construct()
construct(): void;Initializes the component by requesting props, setting up observers, subscriptions, state management, and event listeners. Called automatically by connectedCallback.
Returns
void
connectedCallback()
connectedCallback(): void;Web Component lifecycle callback invoked when the element is added to the DOM. Initializes the component and registers resource management.
Returns
void
disconnectedCallback()
disconnectedCallback(): void;Web Component lifecycle callback invoked when the element is removed from the DOM. Cleans up observers, subscriptions, state, and event emitters.
Returns
void
attachHandlers()
attachHandlers(): void;Attaches event handlers defined in the component's props. Handlers are activated with access to state, event emitter, and host element.
Returns
void
postponeHandlers()
postponeHandlers(): void;Temporarily pauses all active handlers. Used when handlers need to be suspended without full deactivation.
Returns
void
releaseHandlers()
releaseHandlers(): void;Releases all postponed handlers, allowing them to resume operation.
Returns
void
getProps()
getProps(): ClBaseComponentPropsI;Returns the component's current props.
Returns
ClBaseComponentPropsI
The component props or undefined if model is not available
getShared()
getShared(): ClDocumentSharedI;Returns the shared document state.
Returns
ClDocumentSharedI
The shared document configuration and state
getEnvironment()
getEnvironment(): PlatformEnvT;Returns the current platform environment based on viewport size.
Returns
'mobile' or 'desktop' based on current breakpoint
isStaticRenderMode()
isStaticRenderMode(): boolean;Checks if the component is in static render mode.
Returns
boolean
True if rendering for end-user display
isUpdatingRenderMode()
isUpdatingRenderMode(): boolean;Checks if the component is in updating/editor render mode.
Returns
boolean
True if rendering in editor context with live updates
getRootElement()
getRootElement(): ShadowRoot | default;Returns the root element for DOM queries (shadow root or host element).
Returns
ShadowRoot | default
The shadow root if available, otherwise the host element
getHostElement()
getHostElement(): this;Returns the host element (the custom element itself).
Returns
this
The WcElement instance
observeProps()
observeProps(cb): void;Registers a callback to observe props changes. The callback is immediately invoked with null as previous props and current props.
Parameters
| Parameter | Type | Description |
|---|---|---|
cb | (prevProps, props) => void | Callback function receiving previous and current props |
Returns
void
observeShared()
observeShared(cb): void;Registers a callback to observe shared document state changes. The callback is immediately invoked with current shared state.
Parameters
| Parameter | Type | Description |
|---|---|---|
cb | (shared) => void | Callback function receiving the shared state |
Returns
void
observeEnvironment()
observeEnvironment(cb): void;Registers a callback to observe environment (desktop/mobile) changes. The callback is immediately invoked with null as previous env and current env.
Parameters
| Parameter | Type | Description |
|---|---|---|
cb | (prevEnv, env) => void | Callback function receiving previous and current environment |
Returns
void
getElements()
getElements(): HTMLElement[];Returns all styleable elements within the component including the host.
Returns
HTMLElement[]
Array of HTML elements marked with cl-element attribute
getElement()
getElement(name, id?): HTMLElement;Finds a specific element by its cl-element attribute name and optional id.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | The value of the cl-element attribute to match |
id? | string | Optional element id for more specific matching |
Returns
HTMLElement
The matching HTML element or undefined if not found
applyAutoAdaptiveStyles()
applyAutoAdaptiveStyles(adaptiveStyles?, envIndependentStyles?): void;Applies adaptive styles to all elements based on current environment. Merges environment-independent styles with platform-specific styles.
Parameters
| Parameter | Type | Description |
|---|---|---|
adaptiveStyles? | BaseComponentAdaptiveStylesI | Platform-specific styles (desktop/mobile) |
envIndependentStyles? | ClBaseComponentElementParamsI[] | Styles that apply regardless of platform |
Returns
void
registerComponentResourceManagement()
registerComponentResourceManagement(): void;Registers this component's resource manager with the view-level resource manager. Enables tracking of resource loading states across the widget.
Returns
void
applyStyles()
applyStyles(container, styles): boolean;Applies inline styles to a container element.
Parameters
| Parameter | Type | Description |
|---|---|---|
container | HTMLElement | The target HTML element |
styles | Record<string, string> | Object mapping style property names to values |
Returns
boolean
True if styles were applied, false if container is invalid
applyStylesToElement()
applyStylesToElement(
htmlElement,
elementModel,
commonStyleElement): void;Applies comprehensive styles to an element including hover, placeholder, and animation styles. Handles background image loading and color schema.
Parameters
| Parameter | Type | Description |
|---|---|---|
htmlElement | HTMLElement | The target element to style |
elementModel | ClBaseComponentElementParamsI | Model containing style definitions |
commonStyleElement | HTMLStyleElement | Style element for CSS rule injection |
Returns
void
applySharedClassesToElementModel()
applySharedClassesToElementModel(elementModel): ClBaseComponentElementParamsI;Applies shared CSS classes from document state to an element model.
Parameters
| Parameter | Type | Description |
|---|---|---|
elementModel | ClBaseComponentElementParamsI | The element model to enhance with shared classes |
Returns
ClBaseComponentElementParamsI
The element model with shared classes applied
getModel()
getModel(): ClBaseComponentI;Returns the component's model containing type, id, props, and configuration.
Returns
ClBaseComponentI
The component model
_addStylesToStyleElement()
_addStylesToStyleElement(
styleElement,
elementName,
styleAttributes,
selector,
addImportant?): void;Parameters
| Parameter | Type |
|---|---|
styleElement | HTMLStyleElement |
elementName | string |
styleAttributes | ClComponentStyleAttributesI |
selector | string |
addImportant? | boolean |
Returns
void
_addFontStylesToStyleElement()
_addFontStylesToStyleElement(styleElement, shared): void;Parameters
| Parameter | Type |
|---|---|
styleElement | HTMLStyleElement |
shared | ClDocumentSharedI |
Returns
void
_addLinkColor()
_addLinkColor(styleElement, shared): void;Parameters
| Parameter | Type |
|---|---|
styleElement | HTMLStyleElement |
shared | ClDocumentSharedI |
Returns
void
_setClassAttributes()
_setClassAttributes(htmlElement, elementModel): void;Parameters
| Parameter | Type |
|---|---|
htmlElement | HTMLElement |
elementModel | ClBaseComponentElementParamsI |
Returns
void
getParentComponent()
getParentComponent(): Node;Finds the parent component by traversing up the DOM tree.
Returns
Node
The parent component node or null if not found
getWidgetContainerNode()
getWidgetContainerNode(): Node;Finds the widget container node by traversing up the DOM tree.
Returns
Node
The widget container node or null if not found
getWidgetLanguages()
getWidgetLanguages(): string[];Returns the list of languages configured for the widget.
Returns
string[]
Array of language codes in order of preference
getPreferredWidgetLanguage()
getPreferredWidgetLanguage(): string;Returns the primary/preferred language for the widget.
Returns
string
The first language code from the configured languages
getTranslationsMap()
getTranslationsMap(translationsMapByLanguage): TranslationsMapResultI;Resolves translations for the widget based on configured languages.
Parameters
| Parameter | Type | Description |
|---|---|---|
translationsMapByLanguage | Record<string, Record<string, string>> | Map of language codes to translation dictionaries |
Returns
The resolved translations and language, or null if not found
stylesAppliedToElement()
stylesAppliedToElement(
htmlElement,
elementModel,
commonStyleElement): void;Hook method called after styles are applied to an element. Override in child classes to perform additional styling operations.
Parameters
| Parameter | Type | Description |
|---|---|---|
htmlElement | HTMLElement | The styled element |
elementModel | ClBaseComponentElementParamsI | The element model with style definitions |
commonStyleElement | HTMLStyleElement | The style element for CSS injection |
Returns
void
_resolveTogglableStylesForElementModel()
static _resolveTogglableStylesForElementModel(elementModel): ClBaseComponentElementParamsI;Parameters
| Parameter | Type |
|---|---|
elementModel | ClBaseComponentElementParamsI |
Returns
ClBaseComponentElementParamsI
_resolveTogglableStyles()
static _resolveTogglableStyles(styles): ClComponentStyleAttributesI;Parameters
| Parameter | Type |
|---|---|
styles | ClComponentStyleAttributesI |
Returns
ClComponentStyleAttributesI
updateContext()
updateContext(): void;Updates the component's context record with current label and view index. Used to keep context data in sync with component state.
Returns
void
addContextRecord()
addContextRecord(): void;Adds a new context record for this component. Registers the component's form control data in the context system.
Returns
void
getContextRecordLabel()
getContextRecordLabel(props): string;Generates a display label for the context record based on component props. Uses control name, content label, placeholder, or integration name.
Parameters
| Parameter | Type | Description |
|---|---|---|
props | ClBaseComponentPropsI | The component props to extract label from |
Returns
string
The generated label or undefined if no suitable source found
capitalizeFirstLetter()
capitalizeFirstLetter(string): string;Capitalizes the first letter of a string.
Parameters
| Parameter | Type | Description |
|---|---|---|
string | string | The input string to capitalize |
Returns
string
The string with its first character uppercased
getContextRecordExampleValue()
getContextRecordExampleValue(props): string;Generates an example value for the context record based on control type. Used for previewing merge tags in editor mode.
Parameters
| Parameter | Type | Description |
|---|---|---|
props | ClBaseComponentPropsI | The component props containing control configuration |
Returns
string
An appropriate example value for the control type
completeSubmitAction()
completeSubmitAction(params?): void;Executes the form submit action with optional override parameters. Uses registered submit action if available, otherwise falls back to default request action.
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | Record<string, any> | Optional parameters to override the submit action configuration |
Returns
void
getHandlers()
getHandlers(): ClDocumentHandlerI[];Returns the list of event handlers defined in the component's props.
Returns
ClDocumentHandlerI[]
Array of handler configurations
assets()
assets(path): string;Generates the URL for a component asset file.
Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | Optional path relative to the component's assets directory |
Returns
string
The full URL to the asset
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
manifest | public | ComponentManifestI | Component manifest containing metadata, properties, and configuration |
observers | public | ObserversI | Collection of observers for props, shared state, and environment changes |
subscriptions | public | SubscriptionsI | Collection of active subscriptions for cleanup on disconnect |
state | public | default | Component-local state management instance |
componentEventEmitter | public | DefaultEventEmitter | Event emitter scoped to this component instance |
componentResourceManager | public | default | Manager for tracking component resource loading states |
mergeTagsProcessor | public | default | Processor for merge tags (dynamic content placeholders) |
prevProps | public | ClBaseComponentPropsI | Previous props value for change detection |
prevEnvironment | public | PlatformEnvT | Previous environment value for change detection |
model | public | ClBaseComponentI | Component model containing type, id, props, and configuration |
services | public | ServicesI | Injected services including eventEmitter, config, form, and context |
documentModel | public | default | Service for managing document model updates and subscriptions |
resizeListener | public | default | Listener for responsive breakpoint changes |
viewResourceManager | public | default | Manager for view-level resource tracking |
layoutType | public | string | Current layout type identifier |
handlers | public | HandlerInstanceI[] | Array of active event handlers for this component |
htmlDocumentObject | public | Document | Reference to the HTML document object |
skipGameBlur | public | boolean | Whether this component should skip blur effect when a game starts |
define | static | { name: string; model: string; manifest: ComponentManifestI; } | Static component definition used for component registration. - name: The custom element tag name (e.g., 'sys-button') - model: The component class name (e.g., 'SysButtonComponent') - manifest: The component manifest configuration |
define.name | public | string | - |
define.model | public | string | - |
define.manifest | public | ComponentManifestI | - |
ActionConfigI
Configuration for an action
Indexable
[key: string]: anyProperties
ControlConfigI
Configuration for a form control
Indexable
[key: string]: anyProperties
| Property | Type |
|---|---|
name | string |
defaultValue? | string |
integrationName? | string |
validation? | ValidationConfigI |
ValidationConfigI
Configuration for validation rules
Indexable
[key: string]: anyProperties
ServicesI
Services injected into components
Indexable
[key: string]: anyProperties
| Property | Type |
|---|---|
eventEmitter | DefaultEventEmitter |
config | default |
mergeTagsProcessorFactory | MergeTagsProcessorFactory |
form | default |
context | default |
ActionFactoryI
Factory for creating action instances
Methods
get()
get(config): ActionInstanceI;Parameters
| Parameter | Type |
|---|---|
config | ActionConfigI |
Returns
ActionInstanceI
Interface for executable actions
Indexable
[key: string]: anyMethods
execute()
execute(
event?,
target?,
isComplete?,
overrideParams?): void;Parameters
| Parameter | Type |
|---|---|
event? | Event |
target? | HTMLElement |
isComplete? | boolean |
overrideParams? | Record<string, any> |
Returns
void
Properties
HandlerInstanceI
Interface for event handlers
Methods
activate()
activate(
state,
eventEmitter,
getHostElement): void;Parameters
| Parameter | Type |
|---|---|
state | default |
eventEmitter | DefaultEventEmitter |
getHostElement | () => HTMLElement |
Returns
void
postpone()
postpone(): void;Returns
void
release()
release(): void;Returns
void
TranslationsMapResultI
Result of translations lookup
Properties
PlatformEnvT
type PlatformEnvT = "desktop" | "mobile";Platform environment type
@claspo/renderer / sdk/accessor/StyleAttributeAccessor
sdk/accessor/StyleAttributeAccessor
default
Constructors
Constructor
new default(): default;Returns
Methods
set()
static set(htmlElement, elementModel): void;Parameters
| Parameter | Type |
|---|---|
htmlElement | any |
elementModel | any |
Returns
void
Properties
@claspo/renderer / sdk/context/ContextData
sdk/context/ContextData
default
Storage container for context records. Provides CRUD operations for managing context data.
Constructors
Constructor
new default(): default;Creates a new ContextData instance with empty records.
Returns
Methods
getRecord()
getRecord(key): default;Gets a record by key.
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | Record key |
Returns
The record or undefined if not found
addRecord()
addRecord(key, value): default;Adds a new record to the context.
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | Unique record key |
value | ContextRecordValueI | Record value data |
Returns
The created Record instance
deleteRecord()
deleteRecord(key): default;Deletes a record by key.
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | Record key to delete |
Returns
The deleted record or undefined
getRecordsMap()
getRecordsMap(): {
[key: string]: default;
};Gets all records as a map.
Returns
{
[key: string]: default;
}Map of record keys to Record instances
getKVMap()
getKVMap(): {
[key: string]: string;
};Gets all records as a key-value map using record IDs as keys.
Returns
{
[key: string]: string;
}Map of record IDs to string values
Properties
| Property | Type | Description |
|---|---|---|
records | { [key: string]: default; } | Map of records indexed by key |
ContextRecordValueI
Value structure for a context record.
Indexable
[key: string]: anyAdditional dynamic properties
Properties
@claspo/renderer / sdk/context/ContextEvents
sdk/context/ContextEvents
ContextEventT
type ContextEventT = typeof ContextEvents[keyof typeof ContextEvents];Union type of all context event names.
ContextEvents
const ContextEvents: {
RECORD_ADDED: "RECORD_ADDED";
RECORD_UPDATED: "RECORD_UPDATED";
RECORD_DELETED: "RECORD_DELETED";
};Event names for context data changes.
Type Declaration
@claspo/renderer / sdk/context/ContextSDK
sdk/context/ContextSDK
default
SDK for managing context data and source subscriptions. Handles record management and source synchronization.
Extends
default
Constructors
Constructor
new default(
sourceRegistry,
contextData,
isStaticMode): default;Creates a new ContextSDK instance.
Parameters
Returns
Overrides
DefaultEventEmitter.constructorMethods
getRegistry()
getRegistry(): default;Gets the source registry.
Returns
The source registry instance
addRecord()
addRecord(key, params): void;Adds a new record to the context.
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | Unique record key |
params | ContextRecordValueI | Record value parameters |
Returns
void
updateRecord()
updateRecord(key, params): void;Updates an existing record.
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | Record key to update |
params | Partial<ContextRecordValueI> | Partial parameters to merge |
Returns
void
deleteRecord()
deleteRecord(key): void;Deletes a record from the context. In static mode, records are preserved for cross-view data access.
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | Record key to delete |
Returns
void
getRecord()
getRecord(key): default;Gets a record by key.
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | Record key to retrieve |
Returns
The record or undefined if not found
getRecordsMap()
getRecordsMap(): {
[key: string]: default;
};Gets all records as a map.
Returns
{
[key: string]: default;
}Map of record keys to Record instances
getKVMap()
getKVMap(): {
[key: string]: string;
};Gets all records as a key-value map.
Returns
{
[key: string]: string;
}Map of record keys to string values
initSources()
initSources(): void;Initializes data sources and populates initial records.
Returns
void
subscribeToSource()
subscribeToSource(params): void;Subscribes to a data source for updates.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | ContextRecordValueI | Record parameters containing source ID |
Returns
void
Properties
SourceUpdateDataI
Data for source update events.
Properties
@claspo/renderer / sdk/context/Record
sdk/context/Record
default
Represents a single context data record. Stores a key-value pair with change detection.
Constructors
Constructor
new default(key, value): default;Creates a new Record instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | Unique record key |
value | ContextRecordValueI | Initial record value |
Returns
Methods
getKey()
getKey(): string;Gets the record key.
Returns
string
The record's unique key
getValue()
getValue(): ContextRecordValueI;Gets the current record value.
Returns
The record's value data
update()
update(nextValue): boolean;Updates the record with new values. Uses JSON comparison for deep equality check.
Parameters
| Parameter | Type | Description |
|---|---|---|
nextValue | Partial<ContextRecordValueI> | Partial values to merge into current value |
Returns
boolean
True if the value changed, false otherwise
Properties
| Property | Type | Description |
|---|---|---|
key | string | Unique record identifier |
value | ContextRecordValueI | Record value data |
@claspo/renderer / sdk/getComponentCountOnView
sdk/getComponentCountOnView
default()
function default(viewModel, componentName): number;Parameters
| Parameter | Type |
|---|---|
viewModel | ClBaseComponentI |
componentName | string |
Returns
number
@claspo/renderer / sdk/getParentHostElement
sdk/getParentHostElement
default()
function default(element): any;Parameters
| Parameter | Type |
|---|---|
element | any |
Returns
any
@claspo/renderer / sdk/merge-tags/AbstractMergeTagsProcessor
sdk/merge-tags/AbstractMergeTagsProcessor
default
Extended by
Constructors
Constructor
new default(context, configService): default;Parameters
Returns
Methods
destroy()
destroy(): void;Returns
void
process()
process(
element,
mergeTags,
componentId): void;Parameters
| Parameter | Type |
|---|---|
element | HTMLElement |
mergeTags | MergeTagsMapI |
componentId | string |
Returns
void
processSingleMergeTag()
processSingleMergeTag(containerElement, mergeTag): void;Parameters
| Parameter | Type |
|---|---|
containerElement | HTMLElement |
mergeTag | MergeTagI |
Returns
void
Properties
| Property | Type |
|---|---|
context | default |
configService | default |
element | HTMLElement |
mergeTags | MergeTagsMapI |
componentId | string |
MergeTagI
Indexable
[key: string]: anyProperties
MergeTagsMapI
Indexable
[id: string]: MergeTagI@claspo/renderer / sdk/merge-tags/MergeTagsProcessorFactory
sdk/merge-tags/MergeTagsProcessorFactory
MergeTagsProcessorFactory
Constructors
Constructor
new MergeTagsProcessorFactory(
isStaticMode,
context,
configService): MergeTagsProcessorFactory;Parameters
Returns
Methods
create()
create(): default;Returns
Properties
@claspo/renderer / sdk/merge-tags/StaticMergeTagsProcessor
sdk/merge-tags/StaticMergeTagsProcessor
default
Extends
Constructors
Constructor
new default(context, configService): default;Parameters
Returns
Inherited from
Methods
destroy()
destroy(): void;Returns
void
Inherited from
process()
process(
element,
mergeTags,
componentId): void;Parameters
| Parameter | Type |
|---|---|
element | HTMLElement |
mergeTags | MergeTagsMapI |
componentId | string |
Returns
void
Inherited from
processSingleMergeTag()
processSingleMergeTag(tagContainerElement, mergeTag): void;Parameters
| Parameter | Type |
|---|---|
tagContainerElement | HTMLElement |
mergeTag | MergeTagI |
Returns
void
Overrides
Properties
| Property | Type | Inherited from |
|---|---|---|
context | default | default.context |
configService | default | default.configService |
element | HTMLElement | default.element |
mergeTags | MergeTagsMapI | default.mergeTags |
componentId | string | default.componentId |
@claspo/renderer / sdk/merge-tags/UpdatingMergeTagsProcessor
sdk/merge-tags/UpdatingMergeTagsProcessor
default
Extends
Constructors
Constructor
new default(context, configService): default;Parameters
| Parameter | Type |
|---|---|
context | any |
configService | any |
Returns
Overrides
Methods
process()
process(
element,
mergeTags,
componentId): void;Parameters
| Parameter | Type |
|---|---|
element | HTMLElement |
mergeTags | MergeTagsMapI |
componentId | string |
Returns
void
Inherited from
destroy()
destroy(): void;Returns
void
Overrides
processSingleMergeTag()
processSingleMergeTag(tagContainerElement, mergeTag): void;Parameters
| Parameter | Type |
|---|---|
tagContainerElement | any |
mergeTag | any |
Returns
void
Overrides
_setMergeTagValidity()
_setMergeTagValidity(
contextRecord,
mergeTag,
tagContainerElement): void;Parameters
| Parameter | Type |
|---|---|
contextRecord | any |
mergeTag | any |
tagContainerElement | any |
Returns
void
_handleContextEvents()
_handleContextEvents(record): void;Parameters
| Parameter | Type |
|---|---|
record | any |
Returns
void
Properties
| Property | Type | Inherited from |
|---|---|---|
context | default | default.context |
configService | default | default.configService |
element | HTMLElement | default.element |
mergeTags | MergeTagsMapI | default.mergeTags |
componentId | string | default.componentId |
contextSubscriptions | any | - |
@claspo/renderer / sdk/source/Source
sdk/source/Source
default
Represents a data source for context records. Provides subscription and value access through a subscription entry.
Constructors
Constructor
new default(
id,
subscriptionEntry,
config): default;Creates a new Source instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Unique source identifier |
subscriptionEntry | SubscriptionEntryI | Entry for data access |
config | SourceConfigI | Optional configuration |
Returns
Methods
subscribe()
subscribe(cb): void;Subscribes to source updates.
Parameters
| Parameter | Type | Description |
|---|---|---|
cb | (data) => void | Callback for update notifications |
Returns
void
getValue()
getValue(key?): any;Gets the current source value.
Parameters
| Parameter | Type | Description |
|---|---|---|
key? | string | Optional key for specific value |
Returns
any
The current value
getSessionHistory()
getSessionHistory(): string[];Returns the session URL search history, delegating to the subscription entry.
Returns
string[]
Session history, or current page URL wrapped in array if not supported
isSubscribed()
isSubscribed(): boolean;Checks if the source has active subscriptions.
Returns
boolean
True if subscribed
Properties
| Property | Type | Description |
|---|---|---|
id | string | Unique source identifier |
subscriptionEntry | SubscriptionEntryI | Entry point for subscription and data access |
config | SourceConfigI | Source configuration |
subscribed | boolean | Whether the source has active subscriptions |
SubscriptionEntryI
Interface for subscription entry providing data access and updates.
Methods
subscribe()
subscribe(cb): void;Subscribes to data updates.
Parameters
| Parameter | Type | Description |
|---|---|---|
cb | (data) => void | Callback for update notifications |
Returns
void
getValue()
getValue(key?): any;Gets the current value.
Parameters
| Parameter | Type | Description |
|---|---|---|
key? | string | Optional key for specific value |
Returns
any
The current value
getSessionHistory()?
optional getSessionHistory(): string[];Returns the session URL search history if this source tracks it.
Returns
string[]
SourceConfigI
Configuration options for a source.
Indexable
[key: string]: anyDynamic configuration properties
@claspo/renderer / sdk/source/SourceRegistry
sdk/source/SourceRegistry
default
Registry for managing data sources. Provides registration, lookup, and initialization of sources.
Constructors
Constructor
new default(form, config): default;Creates a new SourceRegistry with default sources.
Parameters
| Parameter | Type | Description |
|---|---|---|
form | default | Form group for form source |
config | SourceRegistryConfigI | Configuration for sources |
Returns
Methods
registerSource()
registerSource(source): default;Registers a source in the registry.
Parameters
| Parameter | Type | Description |
|---|---|---|
source | default | Source to register |
Returns
The registered source
Throws
Error if source with same ID already registered
getSource()
getSource(id): default;Gets a source by ID.
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Source identifier |
Returns
The source or undefined if not found
getSources()
getSources(): default[];Gets all registered sources.
Returns
default[]
Array of registered sources
registerInitialSources()
registerInitialSources(): default[];Registers all default sources.
Returns
default[]
Array of registered sources
Properties
SourceRegistryConfigI
Configuration for the source registry.
Extends
Indexable
[key: string]: anyAdditional configuration properties
Properties
| Property | Type | Description | Inherited from |
|---|---|---|---|
instanceName? | string | Global instance name for variable access | JSApiVariablesConfigI.instanceName |
sessionUrlSearchParams? | string[] | Session URL search params history | UrlQueryParamsConfigI.sessionUrlSearchParams |
@claspo/renderer / sdk/source/sources/CookieSource
sdk/source/sources/CookieSource
default
Extends
default
Constructors
Constructor
new default(): default;Returns
Inherited from
DefaultEventEmitter.constructorMethods
subscribe()
subscribe(cb): void;Parameters
| Parameter | Type |
|---|---|
cb | (data) => void |
Returns
void
getValue()
getValue(key?): Record<string, never> | CookieProcessorResultI;Parameters
| Parameter | Type |
|---|---|
key? | string |
Returns
Record<string, never> | CookieProcessorResultI
Properties
@claspo/renderer / sdk/source/sources/DataLayerSource
sdk/source/sources/DataLayerSource
default
Data source for accessing Google Tag Manager dataLayer. Provides access to dataLayer events and properties.
Extends
default
Constructors
Constructor
new default(): default;Creates a new DataLayerSource instance.
Returns
Overrides
DefaultEventEmitter.constructorMethods
subscribe()
subscribe(cb): void;Subscribes to data layer updates.
Parameters
| Parameter | Type | Description |
|---|---|---|
cb | (data) => void | Callback for updates (not used for dataLayer) |
Returns
void
getValue()
getValue(key?):
| DataLayerProcessorResultI
| Record<string, never>;Gets a processor for accessing dataLayer values.
Parameters
| Parameter | Type | Description |
|---|---|---|
key? | string | Optional key (not used) |
Returns
| DataLayerProcessorResultI
| Record<string, never>
Processor result or empty object
processModel()
static processModel(model, returnRawValue?): any;Processes a model to extract data from dataLayer.
Parameters
| Parameter | Type | Description |
|---|---|---|
model | DataLayerModelI | Data layer model configuration |
returnRawValue? | boolean | If true, returns raw array values instead of joined strings |
Returns
any
Extracted value or empty string
getValueByPropPath()
static getValueByPropPath(
dataLayerEvent,
propPathArray,
model,
returnRawValue?): any;Gets a value from dataLayer event by property path.
Parameters
| Parameter | Type | Description |
|---|---|---|
dataLayerEvent | Record<string, any> | DataLayer event object |
propPathArray | string[] | Array of property path segments |
model | DataLayerModelI | Model configuration for error logging |
returnRawValue? | boolean | If true, returns raw array values |
Returns
any
Extracted value or empty string on error
Properties
DataLayerModelI
Model configuration for data layer access.
Indexable
[key: string]: anyAdditional model properties
Properties
| Property | Type | Description |
|---|---|---|
arguments? | DataLayerArgumentI[] | Arguments for data layer query |
DataLayerArgumentI
Argument for data layer query.
Properties
DataLayerProcessorResultI
Result containing a processor function for data layer values.
Properties
@claspo/renderer / sdk/source/sources/FormSource
sdk/source/sources/FormSource
default
Data source that provides form field values. Subscribes to form changes and emits updates.
Constructors
Constructor
new default(formService): default;Creates a new FormSource instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
formService | default | Form group to source data from |
Returns
Methods
subscribe()
subscribe(cb): void;Subscribes to form value changes.
Parameters
| Parameter | Type | Description |
|---|---|---|
cb | (data) => void | Callback for value change notifications |
Returns
void
getValue()
getValue(key?): string | Record<string, any>;Gets form control value(s).
Parameters
| Parameter | Type | Description |
|---|---|---|
key? | string | Optional control name for specific value |
Returns
string | Record<string, any>
Single value if key provided, or map of all values
Properties
| Property | Type | Description |
|---|---|---|
formService | default | Form group service |
@claspo/renderer / sdk/source/sources/JSApiVariablesSource
sdk/source/sources/JSApiVariablesSource
default
Data source for accessing JavaScript API variables. Reads variables from a global window instance.
Extends
default
Constructors
Constructor
new default(config): default;Creates a new JSApiVariablesSource instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
config | JSApiVariablesConfigI | Configuration options |
Returns
Overrides
DefaultEventEmitter.constructorMethods
subscribe()
subscribe(cb): void;Subscribes to variable updates.
Parameters
| Parameter | Type | Description |
|---|---|---|
cb | (data) => void | Callback for updates (not used) |
Returns
void
getValue()
getValue(key?):
| Record<string, never>
| JSApiVariablesProcessorResultI;Gets a processor for accessing JS API variables.
Parameters
| Parameter | Type | Description |
|---|---|---|
key? | string | Optional key (not used) |
Returns
| Record<string, never>
| JSApiVariablesProcessorResultI
Processor result or empty object
processModel()
static processModel(model, instanceName?): string;Processes a model to extract JS API variable value.
Parameters
| Parameter | Type | Description |
|---|---|---|
model | JSApiVariablesModelI | JS API variables model configuration |
instanceName? | string | Global instance name |
Returns
string
Extracted variable value or empty string
Properties
JSApiVariablesModelI
Model configuration for JS API variable access.
Indexable
[key: string]: anyAdditional model properties
Properties
| Property | Type | Description |
|---|---|---|
arguments? | JSApiVariablesArgumentI[] | Arguments for variable lookup |
JSApiVariablesArgumentI
Argument for JS API variable lookup.
Properties
JSApiVariablesConfigI
Configuration for JS API variables source.
Extended by
Indexable
[key: string]: anyAdditional config properties
Properties
JSApiVariablesProcessorResultI
Result containing a processor function for JS API variables.
Properties
@claspo/renderer / sdk/source/sources/LocalStorageSource
sdk/source/sources/LocalStorageSource
default
Extends
default
Constructors
Constructor
new default(): default;Returns
Inherited from
DefaultEventEmitter.constructorMethods
subscribe()
subscribe(cb): void;Parameters
| Parameter | Type |
|---|---|
cb | (data) => void |
Returns
void
getValue()
getValue(key?): Record<string, never> | LocalStorageProcessorResultI;Parameters
| Parameter | Type |
|---|---|
key? | string |
Returns
Record<string, never> | LocalStorageProcessorResultI
Properties
@claspo/renderer / sdk/source/sources/UrlQueryParamsSource
sdk/source/sources/UrlQueryParamsSource
default
Data source for accessing URL query parameters. Extracts values from current URL or session history.
Extends
default
Constructors
Constructor
new default(config): default;Creates a new UrlQueryParamsSource instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
config | UrlQueryParamsConfigI | Configuration options |
Returns
Overrides
DefaultEventEmitter.constructorMethods
subscribe()
subscribe(cb): void;Subscribes to URL parameter updates.
Parameters
| Parameter | Type | Description |
|---|---|---|
cb | (data) => void | Callback for updates (not used) |
Returns
void
getSessionHistory()
getSessionHistory(): string[];Returns the session URL search history, falling back to the current page URL.
Returns
string[]
getValue()
getValue(key?):
| Record<string, never>
| UrlQueryParamsProcessorResultI;Gets a processor for accessing URL query parameters.
Parameters
| Parameter | Type | Description |
|---|---|---|
key? | string | Optional key (not used) |
Returns
| Record<string, never>
| UrlQueryParamsProcessorResultI
Processor result or empty object
processModel()
static processModel(model, sessionUrlSearchParams?): string;Processes a model to extract URL query parameter value.
Parameters
| Parameter | Type | Description |
|---|---|---|
model | UrlQueryParamsModelI | URL query params model configuration |
sessionUrlSearchParams? | string[] | Session URL params history |
Returns
string
Extracted parameter value or empty string
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
sourceId | static | string | Source identifier |
config | public | UrlQueryParamsConfigI | Source configuration |
UrlQueryParamsModelI
Model configuration for URL query parameter access.
Indexable
[key: string]: anyAdditional model properties
Properties
| Property | Type | Description |
|---|---|---|
arguments? | UrlQueryParamsArgumentI[] | Arguments for query parameter lookup |
UrlQueryParamsArgumentI
Argument for URL query parameter lookup.
Properties
UrlQueryParamsConfigI
Configuration for URL query params source.
Extended by
Indexable
[key: string]: anyAdditional config properties
Properties
UrlQueryParamsProcessorResultI
Result containing a processor function for URL query params.
Properties
@claspo/renderer / sdk/validators/required
sdk/validators/required
required()
function required(errorKey): {
(value): {
isValid: any;
errorKey: string;
};
[REQUIRED_SYMBOL]: boolean;
};Creates a required field validator. Validates that a value is present and non-empty.
Parameters
| Parameter | Type | Description |
|---|---|---|
errorKey | string | Error key to return on validation failure |
Returns
Validator function that checks if value is required
(value): {
isValid: any;
errorKey: string;
};Parameters
| Parameter | Type |
|---|---|
value | any |
Returns
{
isValid: any;
errorKey: string;
}| Name | Type |
|---|---|
isValid | any |
errorKey | string |
| Name | Type |
|---|---|
[REQUIRED_SYMBOL] | boolean |
Example
const validator = required('FIELD_REQUIRED');
validator(''); // { isValid: false, errorKey: 'FIELD_REQUIRED' }
validator('hello'); // { isValid: true, errorKey: null }REQUIRED_SYMBOL
const REQUIRED_SYMBOL: typeof REQUIRED_SYMBOL;Symbol to identify required validators
@claspo/renderer / wc-renderer/observers/createObservers
wc-renderer/observers/createObservers
default()
function default(...types): ObserversI;Creates an observers registry for managing callbacks by type.
Parameters
| Parameter | Type | Description |
|---|---|---|
...types | string[] | Observer type names to initialize |
Returns
Observers instance with get and clear methods
Example
const observers = createObservers('props', 'shared', 'environment');
observers.get('props').push(callback);ObserversI
Interface for managing observer callbacks by type.
Methods
get()
get(type): ObserverCallbackT[];Gets all observer callbacks for a specific type.
Parameters
| Parameter | Type | Description |
|---|---|---|
type | string | The observer type |
Returns
Array of observer callbacks
clear()
clear(): ObserversI;Clears all observers and returns a fresh instance.
Returns
New observers instance with same types but empty callback arrays
ObserverCallbackT()
type ObserverCallbackT = (...args) => void;Callback function type for observer notifications.
Parameters
| Parameter | Type | Description |
|---|---|---|
...args | any[] | Arguments passed to the observer |
Returns
void
@claspo/renderer / wc-renderer/observers/observerType
wc-renderer/observers/observerType
default
const default: {
PROPS: string;
SHARED: string;
ENVIRONMENT: string;
};Observer type constants for component state observation. Used to categorize different types of state changes.
Type Declaration
@claspo/renderer / wc-renderer/subscriptions/createSubscriptions
wc-renderer/subscriptions/createSubscriptions
default()
function default(): SubscriptionsI;Creates a subscription manager for tracking and bulk cleanup.
Returns
Subscriptions instance for managing multiple subscriptions
Example
const subs = createSubscriptions();
subs.push(eventEmitter.on('event', handler));
// Later, clean up all:
subs.off();SubscriptionI
Interface for a single subscription with cleanup capability.
Methods
off()
off(): void;Unsubscribes and cleans up the subscription
Returns
void
SubscriptionsI
Interface for managing multiple subscriptions.
Methods
push()
push(subscription): void;Adds a subscription to the collection.
Parameters
| Parameter | Type | Description |
|---|---|---|
subscription | SubscriptionI | Subscription to track |
Returns
void
off()
off(): void;Unsubscribes all tracked subscriptions
Returns
void
@claspo/renderer / wc-renderer/utils/platforms
wc-renderer/utils/platforms
PLATFORMS
const PLATFORMS: {
DESKTOP: string;
MOBILE: string;
};Platform identifiers for adaptive rendering.
Type Declaration
PRIMARY_PLATFORM
const PRIMARY_PLATFORM: string = PLATFORMS.MOBILE;The primary/default platform used when no specific platform is set. Mobile is primary to ensure mobile-first design approach.
Updated 1 day ago
