Skip to content

WidgetInstanceEditorWizard Type documentation

TypeScript declaration

import type { WidgetInstanceEditorWizard } from '@siemens/dashboards-ng';

A widget instance editor component that shall support a multi-page widget configuration can implement this interface. The wizard-like page state WidgetInstanceEditorWizardState needs to be managed by the editor itself and is used to control wizard dialog buttons that are provided by the catalog and editor component.

Properties
Methods
  • next () => void

    Is invoked from the next button. Display next page as consequence. For web components, implementing next() requires adding an event listener for the next event on the element.

  • previous () => void

    Is invoked from the previous button. Display previous page as consequence. For web components, implementing previous() requires adding an event listener for the previous event on the element.

Types Documentation

import type { WidgetConfig } from '@siemens/dashboards-ng';

A WidgetConfig holds the configuration of a widget instance component that is visible on a dashboard. It can be persisted and used to restore a dashboards state.

Properties
  • Optional type of the accent line.

    accentLine?: AccentLineType

  • actionBarViewType?: ViewType

  • Defines whether the widget instance component can be expanded and enlarged over the dashboard.

    expandable?: boolean

  • grid item header text.

    heading?: TranslatableString

  • Icon name or a single-entry map of camelCase icon name to SVG data URI.

    headingIcon?: string | Record<string, string>

  • Height of the grid item, where number represents how many rows it takes. (default?: 1)

    height?: number

  • A unique id of a widget instance

    id: string

  • Optional configuration for an image to be displayed on the widget instance.

    image?: WidgetImage

  • immutable?: boolean

  • isNotRemovable?: boolean

  • minimum height allowed during resize/creation (default?: undefined = un-constrained)

    minHeight?: number

  • minimum width allowed during resize/creation (default?: undefined = un-constrained)

    minWidth?: number

  • A widget specific payload object. Placeholder to pass in additional configuration.

    payload?: any

  • If true, the widget host renders a placeholder and waits for explicit configuration before instantiating the widget instance component.

    Indicates that initial setup by the user is still pending. The flag flips to false once the setup has been completed.

    setupPending?: boolean

  • Optionally, the version widget description that was used to create the widget config.

    version?: string

  • The id of the widget descriptor that was used to instantiate the WidgetConfig and the widget instance component.

    widgetId: string

  • Width of the grid item, where number represents how many columns it spans (default?: 1)

    width?: number

  • Grid item position on x axis of the grid (default?: 0)

    x?: number

  • Grid item position on y axis of the grid (default?: 0)

    y?: number

import type { WidgetConfigStatus } from '@siemens/dashboards-ng';

Object is used to inform the editor hosting component about configuration changes to configure (e.g. enable/disable) the control buttons accordingly.

Properties
  • If true, save or add button will be disabled.

    invalid: boolean

  • Indicates that the configuration was changed. If true, canceling the editor will first show a dialog to confirm the discard.

    modified: boolean

import type { WidgetInstanceEditor } from '@siemens/dashboards-ng';

An editor component for a widget instance need to implement this interface. After initializing the instance editor component, with widget configuration is set. Optionally, the component can emit changes during editing to control e.g. the dialog behavior like disabling the save button.

Properties
import type { WidgetInstanceEditorWizardState } from '@siemens/dashboards-ng';

State to control the behavior of a widget instance editor wizard. The wizard state is used to control the behavior of the dialog buttons provided by the catalog and editor components.

import type { TranslatableString } from '@siemens/element-translate-ng/translate-types';

Represents a translatable string. This can either be a translation key, e.g. ACTIONS.EDIT that will be automatically translated when displayed on the UI or a pre-translated string, e.g. Edit. Equivalent to a normal string in usage and functionality.

ViewType

'collapsible' | 'expanded' | 'mobile'
type alias
import type { ViewType } from '@siemens/element-ng/content-action-bar';
import type { WidgetImage } from '@siemens/dashboards-ng';

Image is used to configure an image to be displayed on a widget instance.

Properties

AccentLineType

StatusType | 'caution' | 'primary' | 'inactive'
type alias
import type { AccentLineType } from '@siemens/element-ng/common';

ObjectFit

'contain' | 'cover' | 'fill' | 'none' | 'scale-down'
type alias
import type { ObjectFit } from '@siemens/dashboards-ng';

ObjectFit configuration options for a widget image.

See: https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit

StatusType

'success' | 'info' | 'warning' | 'danger' | 'caution' | 'critical'
type alias
import type { StatusType } from '@siemens/element-ng/common';

Except where otherwise noted, content on this site is licensed under MIT License.