Properties#

PropertyPage#

Most widgets require configuration to function correctly. The widget configuration panels are exposed in the API, and can be leveraged and/or extended freely. To define a custom property panel, add a config.js file to the custom widget, and use the widget upload tool to bundle it.

The property page configuration file is a JavaScript file which is expected to return an extension on one of the objects in globally scoped object Pages.

Simplest form of the file would just return an existing configuration page (from one of the basic widgets), like so:

// Use the property page of Result List widget
return Pages.Search;

Extending the property page is done in same fashion as extending the base widget views:

// Extend the property page of Result List based custom widget
return Pages.Search.extend({
    customNormal: [
        {
            // Define the properties
        }
    ],
});
class PropertyPage()#
PropertyPage.customAdvanced#

type: Array.<PropertyDefinition>

Defines custom widget properties in the Visibility section

Examples:

customAdvanced: [
    {
        view: Properties.Bool,
        config: {
            inputName: 'myFlag',
            infoText: 'Use the flag',
        }
    }
]
PropertyPage.customApi#

type: Array.<PropertyDefinition>

Defines custom widget properties in the Developer Options section

Examples:

customApi: [
    {
        view: Properties.Bool,
        config: {
            inputName: 'myFlag',
            infoText: 'Use the flag',
        }
    }
]
PropertyPage.customNormal#

type: Array.<PropertyDefinition>

Defines custom widget properties in the Data section

Examples:

customNormal: [
    {
        view: Properties.Bool,
        config: {
            inputName: 'myFlag',
            infoText: 'Use the flag',
        }
    }
]
static PropertyPage.PropertyConfig()#
Arguments:
  • inputName (String) – field of the widget model the property will be serialized to

  • infoText (String) – short description of the property to be displayed in widget config

  • min (Number) – minimum value of a numeric property, if applicable

  • max (Number) – maximum value of a numeric property, if applicable

  • defaultValue (Number) – the default value of the property, if applicable

static PropertyPage.PropertyDefinition()#
Arguments:
  • view (object) – the property view (defines the type)

  • config (PropertyConfig) – the property configuration

Bool#

class Bool()#

A checkbox type property which serializes to a Bool

Code#

class Code()#

A multiline code editor which serializes to a String

Color#

class Color()#

A color picker property which serializes to a String

DateFormat#

class DateFormat()#

A property allowing the selection of a date format, serializes to a String (the format)

Dictionary#

class Dictionary()#

A property allowing configuring multiple strings, serializes to an array of Strings

Entity#

class Entity()#

An entity picker property which serializes to a String (entity identifier)

Facet#

class Facet()#

A property allowing the selection of a facet, serializes to a String (facet name)

JSON#

class JSON()#

A property represented by a JSON editor which serializes to a String

Language#

class Language()#

A language picker property which serializes to a String (language code)

MLWorkflow#

class MLWorkflow()#

A property allowing the selection of a ML workflow, serializes to a String (workflow identifier)

MultilineText#

class MultilineText()#

A property represented by a textfield (multiline) which serializes to a String

Multiselect#

class Multiselect()#
A property represented by a multiselect control which serializes to an array of Strings.

Expects an options parameter, which is an array of objects with label and value Strings, and a Bool optional default flag.

Number#

class Number()#

A property allowing the selection of a number, serializes to a Number

Percentage#

class Percentage()#

A property represented by a slider, serializes to a Number (the slider value from 0 to 100)

Query#

class Query()#
A wrapper property allowing query editing, serializes to a String.

Currently multi-line, however actual implementation can change to best fit query editing scenarios.

StaticHtml#

class StaticHtml()#

A property displaying static html which does not serialize

Text#

class Text()#

A text property represented by a textfield which serializes to a String

Trend#

class Trend()#

A trend picker property which serializes to a String (trend id)

URL#

class URL()#

A property allowing URL editing, serializes to a String.