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 | |
| 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 |
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 |
| (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.
-
The factory to instantiate a widget instance component that is added to the dashboard.
-
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.
-
A CSS icon class that specifies the widget icon, displayed in the catalog.
-
A unique id of the widget.
-
The name of the widget that is presented in the widget catalog.
-
Optional default payload object that is copied into every widget instance WidgetConfig.
-
An optional 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
-
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
-
Defines the background color of the badge. Default is specific to Element flavour.
-
Show a dot badge without content?
-
Defines the badge style
badgeStyle?:
"" | "inline" | "dot"¶ -
Defines if custom content is chosen in account dropdown (otherwise accountItems are used)
-
A boolean that lets the link know whether it is disabled or not.
-
Whether the menu items sub-menu should open upwards instead of downwards.
-
If the menu item has children you can specify if they are visible or not.
-
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.
-
The web font icon class name (e.g. element-settings-outline).
-
Defines if only the icon is shown in the default navigation bar.
-
An optional id to uniquely identify the menu item.
-
The value for an image src tag. Maybe a relative or absolute link to an jpg or gif image.
-
A boolean that lets the link know whether it is active or not. It is useful when action() is executed instead of link route.
-
Whether the menu item should be displayed as a heading/title, will also disable links and actions.
-
A navigation bar item can have a sub-menu, if these items are set. They define the sub-menu content.
-
Defines the link of the menu item within the application using the angular router link concept. Accepts an array of
anyas per [routerLink API definition]https://angular.dev/api/router/RouterLink. -
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.
-
The title of the menu item. Can be either the title to be displayed or the translation key.
title?:
TranslatableStringInherited from Link¶ -
The optional tooltip of the link. Can be either the text to be displayed or the translation key.
tooltip?:
TranslatableStringInherited from Link¶ -
Type to distinguish between check and radio menu items. Needs to be set for correct interaction and used for a11y.
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.
-
Optional type of the accent line.
-
Defines whether the widget instance component can be expanded and enlarged over the dashboard.
-
grid item header text.
-
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)
-
A unique id of a widget instance
-
Optional configuration for an image to be displayed on the widget instance.
-
minimum height allowed during resize/creation (default?: undefined = un-constrained)
-
minimum width allowed during resize/creation (default?: undefined = un-constrained)
-
A widget specific payload object. Placeholder to pass in additional configuration.
-
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
falseonce the setup has been completed. -
Optionally, the version widget description that was used to create the widget config.
-
The id of the widget descriptor that was used to instantiate the
WidgetConfigand the widget instance component. -
Width of the grid item, where number represents how many columns it spans (default?: 1)
-
Grid item position on x axis of the grid (default?: 0)
-
Grid item position on y axis of the grid (default?: 0)
import type { GridConfig } from '@siemens/dashboards-ng';Configuration object for the si-grid component, including the options of gridstack.
-
The configuration options of gridstack.
import type { DashboardToolbarItemAction } from '@siemens/dashboards-ng';Interface representing an action item in the dashboard toolbar.
-
Action that called when the item is triggered.
action:
(grid: SiGridComponent) => void¶ -
Label that is shown to the user.
import type { DashboardToolbarItemRouterLink } from '@siemens/dashboards-ng';Interface representing a router link item in the dashboard toolbar.
-
Navigation extras that are passed to the RouterLink.
-
Label that is shown to the user.
-
Link for the angular router. Accepts the same values as RouterLink.
routerLink:
string | any[]¶
import type { DashboardToolbarItemLink } from '@siemens/dashboards-ng';Interface representing a link item in the dashboard toolbar.
import type { Link } from '@siemens/element-ng/link'; -
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.
-
A boolean that lets the link know whether it is disabled or not.
-
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.
-
A boolean that lets the link know whether it is active or not. It is useful when action() is executed instead of link route.
-
Defines the link of the menu item within the application using the angular router link concept. Accepts an array of
anyas per [routerLink API definition]https://angular.dev/api/router/RouterLink. -
The target attribute specifies where to open the linked document. If no target is specified, the link will open in the current tab.
-
The title of the menu item. Can be either the title to be displayed or the translation key.
-
The optional tooltip of the link. Can be either the text to be displayed or the translation key.
import type { WidgetComponentTypeFactory } from '@siemens/dashboards-ng'; FederatedModule
CommonFactoryFields & LoadRemoteModuleOptions & { factoryType: 'module-federation' | 'native-federation'; [index: string]: any; } ¶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; } ¶import type { WebComponent } from '@siemens/dashboards-ng'; FederatedBridgeModule
CommonFactoryFields & LoadRemoteBridgeOptions & { factoryType: 'native-federation-module-bridge'; [index: string]: any; } ¶import type { FederatedBridgeModule } from '@siemens/dashboards-ng';Use this when having native federation shell and remote module is using module federation.
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.
-
The HTMLImageElement property alt provides fallback (alternate) text to display when the image specified by the <img> element is not loaded.
-
Defines if an image is placed on top or start (left) of the card.
-
Sets the image object-fit CSS property.
-
Sets the image object-position CSS property.
-
The image URL (See <img>).
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; } ¶-
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.
ModuleOptions
WidgetComponentTypeBaseConfig & { moduleName: string; moduleLoader: (name: string) => Promise<any>; componentLoader?: never; } ¶Use when component is not standalone and part of a module
-
factoryType?:
"default"¶ -
moduleLoader:
(name: string) => Promise<any>¶
StandaloneOptions
WidgetComponentTypeBaseConfig & { componentLoader: <T = unknown>(componentName: string) => Promise<Type<T>>; moduleName?: never; moduleLoader?: never; } ¶Use when component is standalone
-
componentLoader:
<T = unknown>(componentName: string) => Promise<Type<T>>¶ -
factoryType?:
"default"¶
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; } ¶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.
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
import type { StatusType } from '@siemens/element-ng/common'; -
factoryType?:
"default"¶
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; } ¶import type { LoadRemoteModuleScriptOptions } from '@siemens/dashboards-ng'; import type { LoadRemoteModuleEsmOptions } from '@siemens/dashboards-ng'; import type { LoadRemoteModuleManifestOptions } from '@siemens/dashboards-ng'; Except where otherwise noted, content on this site is licensed under MIT License.