Interface PropertyApi

This API pertains to page/toolbar control properties in SAS Visual Investigator.

Accessed from the window at window.sas.vi.property.

window.sas.vi.property.registerPropertyLocalizer(localizer);
interface PropertyApi {
    getChildObjectMetadata(propertyConfig: PropertyConfig<any>, propertyKey: string, control: Control<TypeAttributes>): undefined | PageTemplateMetadata;
    registerCustomEditor(elementName: string, type: string, validatorFn?: ((propertyConfig: PropertyConfig<any>, propertyKey: string, control: Control<TypeAttributes> | ToolbarPropertyControl) => boolean), metadataFn?: ((propertyConfig: PropertyConfig<any>, propertyKey: string, control: Control<TypeAttributes> | ToolbarPropertyControl) => PageTemplateMetadata)): void;
    registerPropertyLocalizer(localizer: ControlPropertyLocalizer): void;
    validateChildObjectDataSource(propertyConfig: PropertyConfig<any>, propertyKey: string, control: Control<TypeAttributes>): undefined | boolean;
}

Methods

  • Parameters

    • propertyConfig: PropertyConfig<any>

      Configuration details relating to the property type. For example, required, type, and so on.

    • propertyKey: string

      Key where this property's value is stored.

    • control: Control<TypeAttributes>

      The control.

    Returns undefined | PageTemplateMetadata

    Get metadata for the child object data source property editor. Typically passed as a function reference to registerCustomEditor() instead of being called directly.

    window.sas.vi.property.registerCustomEditor(
    name,
    type,
    window.sas.vi.property.validateChildObjectDataSource,
    window.sas.vi.property.getChildObjectMetadata)
  • Parameters

    Returns void

    Registers a custom element to be rendered as the property editor. The element is rendered as a custom web component. The element is passed selectedNode, property, propertyKey, and categoryKey as attributes. Throws a console error if the type is already used by another registered editor.

  • Register a localizer to manage internationalization resources for control properties of a given type. Properties will be localized unless they they are explicitly configured with localizable=false (see PropertyConfig)

    Parameters

    • localizer: ControlPropertyLocalizer

      property localizer which defines resource keys to be saved, and parses the same keys to localize the properties.

    Returns void

  • Parameters

    • propertyConfig: PropertyConfig<any>

      Configuration details relating to the property type. For example, required, type, and so on.

    • propertyKey: string

      Key where this property's value is stored.

    • control: Control<TypeAttributes>

      The control.

    Returns undefined | boolean

    Determines whether the child object data source property editor is valid. Typically passed as a function reference to registerCustomEditor() instead of being called directly.

    window.sas.vi.property.registerCustomEditor(
    name,
    type,
    window.sas.vi.property.validateChildObjectDataSource,
    window.sas.vi.property.getChildObjectMetadata)