Skip to content
Edit this page

SiFlexibleDashboardComponent documentation

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

The component implements a dashboard with adding, removing and resizing widgets. It consists and connects a toolbar, a grid with widgets, and a widget catalog.

Project si-inline-notification elements directly into this component to display dashboard-level notifications below the toolbar and above the widget grid in the dashboard view. Other element types are not accepted.

Input Properties

Name Type Default Description
config
Config | undefined inject(SI_DASHBOARD_CONFIGURATION)

Option to configure a dashboard instance. Default is the optional value from the SI_DASHBOARD_CONFIGURATION.

dashboardId
string | undefined

Optionally, but it is recommended to include an id for a dashboard. The id is utilized in the persistence calls on the SiWidgetStorage.

editable
boolean false

Input to change the dashboard editable state.

heading
string | undefined

Heading for the dashboard.

To show a custom header instead, e.g. with a description or page actions, project it using the header attribute. The heading is ignored in that case. While adding or editing widgets, the respective title is shown instead.

hideAddWidgetInstanceButton
boolean false

Option to remove the add widget instance button from the primary toolbar.

hideEditButton
boolean false

Option to hide the dashboard edit button.

hideProgressIndicator
boolean false

Option to turn off the loading spinner on save and load operations.

multiSelect
boolean false

Option to enable multi-select in the widget catalog. When enabled, the user can select multiple widgets to add to the dashboard at once.

primaryEditActions
DashboardToolbarItem[] []

Primary action menu items shown in the edit mode of the dashboard.

searchPlaceholder
TranslatableString $localize`:@@DASHBOARD.WIDGET_LIBRARY.SEARCH_PLACEHOLDER:Search…`

Placeholder text for the search input field in the widget catalog.

secondaryEditActions
DashboardToolbarItem[] []

Secondary action menu items shown in the edit mode of the dashboard.

showEditButtonLabel
boolean false

Option to display the edit button as a text button instead, only if the window is larger than xs SiResponsiveContainerDirective.

widgetCatalog
Widget[] []

Sets the available widgets for the widget catalog to the dashboard.

widgetCatalogComponent
Type<SiWidgetCatalogComponent> | undefined

Optionally, provide a custom subclass of the SiWidgetCatalogComponent to use your own catalog component.

widgetInstanceEditorDialogComponent
Type<SiWidgetInstanceEditorDialogComponent> | undefined

Optionally, provide a custom subclass of the SiWidgetInstanceEditorDialogComponent to use your own implementation.

Output Properties

Name Type Description
editableChange
boolean

Input to change the dashboard editable state.

isModified
boolean

Emits the modification state of the grid. It is unmodified when the visible state is equal to the loaded state from the widget storage. When the user modifies the dashboard by e.g. while moving the widgets, the dashboard is marked as modified and emits true and when the user persists the change by saving, or reverts the state by canceling, the state is unmodified again and emits false.

Attributes and Methods

Name Type Default Description
(readonly)dashboard
Signal<SiDashboardComponent> viewChild.required<SiDashboardComponent>('dashboard')

Property to access the dashboard component instance.

(readonly)grid
Signal<SiGridComponent> viewChild.required<SiGridComponent>('grid')

The grid component is the actual container for the widgets.

(readonly)isDashboardVisible
Signal<boolean> computed(() => this.viewState() === 'dashboard')

Returns: True, if the dashboard shows its widgets and not a catalog or and editor.

(readonly)pageTitle
Signal<string | undefined> ...

The page title of the dashboard, which is either SiFlexibleDashboardComponent.heading for the default widget view or DASHBOARD.WIDGET_EDITOR_DIALOG.TITLE or 'DASHBOARD.WIDGET_LIBRARY.TITLE' when adding new or editing widgets.

(readonly)primaryEditActions$
BehaviorSubject<(MenuItem | DashboardToolbarItem)[]> ...

The primary action menu items shown in the edit mode of the dashboard.

(readonly)secondaryEditActions$
BehaviorSubject<(MenuItem | DashboardToolbarItem)[]> new BehaviorSubject<(MenuItem | DashboardToolbarItem)[]>([])

The secondary action menu items shown in the edit mode of the dashboard. When all menu items are more than three, they will be placed in the secondary menu of the content action bar.

showWidgetCatalog()
() => void

Shows the widget catalog of the dashboard. If a widget instance is expanded it restores the widget instances before.

Types Documentation

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

Dashboard configuration object. Inject globally using the SI_DASHBOARD_CONFIGURATION or configure individual dashboard instances.

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

Union type for all possible items in the dashboard toolbar.

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.

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

Widgets describe the entries within the widget catalog and holds all default configuration and factory functionality to instantiate a widget instance, represented as WidgetConfig objects.

Properties
  • Optional translatable badge text displayed next to the widget name in the catalog, for example, "Requires license" when creation is disabled with maxInstances: 0. Consumer badges use the info style. The built-in added badge takes precedence when a positive instance limit has been reached.

    badge ? : TranslatableString

  • The factory to instantiate a widget instance component that is added to the dashboard.

    componentFactory : WidgetComponentFactory

  • Optional default values that can be set to widget instances.

    defaults ? : Pick<WidgetConfig, "width" | "height" | "minWidth" | "minHeight" | "heading" | "headingIcon" | "expandable" | "immutable" | "image" | "accentLine">

  • An optional description that is visible in the widget catalog.

    description ? : TranslatableString

  • A CSS icon class that specifies the widget icon, displayed in the catalog.

    iconClass ? : string

  • A unique id of the widget.

    id : string

  • Maximum number of instances of this widget that can be added through the catalog.

    • undefined (default): unlimited instances.

    • 0: creation is disabled, but the widget stays visible in the catalog.

    • n > 0: creation is allowed until n instances with the same widgetId exist on the dashboard. Once the limit is reached, the catalog entry is disabled and marked as added.

    @remarks: This limit applies to the catalog only. It does not restrict programmatic calls to addWidgetInstance().

    maxInstances ? : number = undefined

  • The name of the widget that is presented in the widget catalog.

    name : TranslatableString

  • Optional default payload object that is copied into every widget instance WidgetConfig.

    payload ? : any

  • An optional version string.

    version ? : string

import type { MenuItem } from '@siemens/element-ng/common';

The MenuItem is used to configure clickable items in menus. They support a name, link, icons and sub-menu items.

Deprecated: This interface should no longer be used. Use a corresponding alternative based on your use case:

• for SiMenuFactoryComponent use @siemens/element-ng/menu#MenuItem

• for SiContentActionBarComponent use @siemens/element-ng/menu#MenuItem and ContentActionBarMainItem

• for SiNavbarVerticalComponent use NavbarVerticalItem

• for @siemens/dashboards-ng#SiFlexibleDashboardComponent use @siemens/dashboards-ng#DashboardToolbarItem

Properties
  • A function that will be invoked when clicking on the menu item. When passed as a string, use together with SiLinkActionService to receive events. This is meant for repetitive things in lists/tables/etc.

    action ? : string | ((param?: any) => void | any) Inherited from Link

  • Defines the content of the optional badge. Should be a number or something like "100+". if undefined or empty string, no badge is displayed

    badge ? : string | number

  • Defines the background color of the badge. Default is specific to Element flavour.

    badgeColor ? : string

  • Show a dot badge without content?

    badgeDot ? : boolean

  • Defines the badge style

    badgeStyle ? : "" | "inline" | "dot"

  • Defines if custom content is chosen in account dropdown (otherwise accountItems are used)

    customContent ? : boolean

  • A boolean that lets the link know whether it is disabled or not.

    disabled ? : boolean Inherited from Link

  • Whether the menu items sub-menu should open upwards instead of downwards.

    dropUpwards ? : boolean

  • If the menu item has children you can specify if they are visible or not.

    expanded ? : boolean

  • Defines a href URI that the menu item will be linked to. Will be used to set the href attribute of the a element. Will only be used if link and function is not set.

    href ? : string Inherited from Link

  • The web font icon class name (e.g. element-settings-outline).

    icon ? : string

  • Defines if only the icon is shown in the default navigation bar.

    iconOnly ? : boolean

  • An optional id to uniquely identify the menu item.

    id ? : string

  • The value for an image src tag. Maybe a relative or absolute link to an jpg or gif image.

    image ? : string

  • A boolean that lets the link know whether it is active or not. It is useful when action() is executed instead of link route.

    isActive ? : boolean Inherited from Link

  • Whether the menu item should be displayed as a heading/title, will also disable links and actions.

    isHeading ? : boolean

  • A navigation bar item can have a sub-menu, if these items are set. They define the sub-menu content.

    items ? : MenuItem[]

  • The navigation extras provide additional routing options when using the router link.

    navigationExtras ? : NavigationExtras Inherited from Link

  • For single/multi choice items: the kind of icon to show.

    selectionState ? : "" | "check" | "radio"

  • The target attribute specifies where to open the linked document. If no target is specified, the link will open in the current tab.

    target ? : string Inherited from Link

  • The title of the menu item. Can be either the title to be displayed or the translation key.

    title ? : TranslatableString Inherited from Link

  • The optional tooltip of the link. Can be either the text to be displayed or the translation key.

    tooltip ? : TranslatableString Inherited from Link

  • Type to distinguish between check and radio menu items. Needs to be set for correct interaction and used for a11y.

    type ? : "check" | "radio"

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

Factory type that is either a WidgetComponentTypeFactory, FederatedModule, FederatedBridgeModule or WebComponent.

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 { GridConfig } from '@siemens/dashboards-ng';

Configuration object for the si-grid component, including the options of gridstack.

Properties

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

Interface representing an action item in the dashboard toolbar.

Properties

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

Interface representing a router link item in the dashboard toolbar.

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

Interface representing a link item in the dashboard toolbar.

import type { Link } from '@siemens/element-ng/link';

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

FederatedModule

CommonFactoryFields & LoadRemoteModuleOptions & { factoryType: 'module-federation' | 'native-federation'; [index: string]: any; }
type alias
import type { FederatedModule } from '@siemens/dashboards-ng';

Factory configuration for loading widget components from a federated module. Supports both Module Federation and Native Federation patterns for micro-frontend architectures. Use this when the widget component is hosted in a separate, independently deployed application.

WebComponent

CommonFactoryFields & { factoryType: 'web-component'; url: string; [index: string]: any; }
type alias
import type { WebComponent } from '@siemens/dashboards-ng';
Index Signatures

FederatedBridgeModule

CommonFactoryFields & LoadRemoteBridgeOptions & { factoryType: 'native-federation-module-bridge'; [index: string]: any; }
type alias
import type { FederatedBridgeModule } from '@siemens/dashboards-ng';

Use this when having native federation shell and remote module is using module federation.

Index Signatures

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';

CommonFactoryFields

{ componentName: string; editorComponentName?: string; /** * CSS class that is added to the modal dialog when component editor dialog is shown. * Provides the option to change the size if the dialog. */ editorModalClass?: string; }
type alias
Properties

ModuleOptions

WidgetComponentTypeBaseConfig & { moduleName: string; moduleLoader: (name: string) => Promise<any>; componentLoader?: never; }
type alias

Use when component is not standalone and part of a module

Properties

StandaloneOptions

WidgetComponentTypeBaseConfig & { componentLoader: <T = unknown>(componentName: string) => Promise<Type<T>>; moduleName?: never; moduleLoader?: never; }
type alias

Use when component is standalone

Properties

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

The Remote Module definition is based on @angular-architects. We take it over into this file to prevent adding a hard dependency.

LoadRemoteBridgeOptions

{ id: string; options?: | { loadFactory?: boolean | undefined; from: 'build' | 'runtime'; } | undefined; }
type alias
import type { LoadRemoteBridgeOptions } from '@siemens/dashboards-ng';

Definition is based on @module-federation/enhanced loadRemote options. We take it over into this file to prevent adding a hard dependency.

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';

WidgetComponentTypeBaseConfig

{ factoryType?: 'default'; [index: string]: any; }
type alias
Properties
Index Signatures

LoadRemoteModuleScriptOptions

{ type?: 'script'; remoteEntry?: string; remoteName: string; exposedModule: string; /** * Optional nonce value applied to the script element for Content Security Policy (CSP) support. * Supported in Module Federation v21.2.0+; safely ignored by earlier versions. */ nonce?: string; }
type alias
import type { LoadRemoteModuleScriptOptions } from '@siemens/dashboards-ng';

LoadRemoteModuleEsmOptions

{ type: 'module'; remoteEntry: string; exposedModule: string; }
type alias
import type { LoadRemoteModuleEsmOptions } from '@siemens/dashboards-ng';

LoadRemoteModuleManifestOptions

{ type: 'manifest'; remoteName: string; exposedModule: string; }
type alias
import type { LoadRemoteModuleManifestOptions } from '@siemens/dashboards-ng';


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