SiFlexibleDashboardComponent documentation¶
selector
si-flexible-dashboard
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.
Input Properties¶
Name | Type | Default | Description |
---|---|---|---|
config ¶ | Config | inject(SI_DASHBOARD_CONFIGURATION) | Option to configure a dashboard instance. Default is the optional value from the SI_DASHBOARD_CONFIGURATION . |
dashboardId ¶ | string | 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 | Heading for the dashboard. | |
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. |
searchPlaceholder ¶ | TranslatableString | $localize`:@@DASHBOARD.WIDGET_LIBRARY.SEARCH_PLACEHOLDER:Search widget` | Placeholder text for the search input field in the widget catalog. |
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 > | Optionally, provide a custom subclass of the SiWidgetCatalogComponent to use your own catalog component. | |
widgetInstanceEditorDialogComponent ¶ | Type <SiWidgetInstanceEditorDialogComponent > | 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 > | ... | Property to access the dashboard component instance. |
(readonly) grid ¶ | Signal <SiGridComponent > | ... | The grid component is the actual container for the widgets. |
(readonly) isDashboardVisible ¶ | Signal <boolean > | ... | Returns True, if the dashboard shows its widgets and not a catalog or and editor. |
(readonly) pageTitle ¶ | Signal <(undefined | string )> | ... | 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 )[]> | ... | The secondary action menu items shown in the edit mode of the dashboard. When all menu items are more than three, they will be places 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¶
Dashboard configuration object. Inject globally using the SI_DASHBOARD_CONFIGURATION or configure individual dashboard instances. |
---|
Variable Injection token to configure dashboards. Use { provide: SI_DASHBOARD_CONFIGURATION, useValue: config } in your app configuration. |
---|
Widget storage api to provide the persistence layer of the widgets of a dashboard (typically from a web service). The dashboard grid uses this API to load and save the widget configurations. Applications using siemens-dashboard needs to implement this abstract class and provide it in the module configuration. | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||
| |||||||||||||
|
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. |
---|
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. | |||||||||
---|---|---|---|---|---|---|---|---|---|
|
Union type for all possible items in the dashboard toolbar. |
---|
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. | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
|
Represents a menu item that navigates using the Angular Router. Requires a configured Angular Router. | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
Interface representing an action item in the dashboard toolbar. | ||||
---|---|---|---|---|
|
Interface representing a router link item in the dashboard toolbar. | |||||
---|---|---|---|---|---|
|
Interface representing a link item in the dashboard toolbar. | |||||
---|---|---|---|---|---|
|
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. | ||||
---|---|---|---|---|
|
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. | ||||
---|---|---|---|---|
|
|
Configuration object for the si-grid component, including the options of gridstack. | ||
---|---|---|
|
|
Image is used to configure an image to be displayed on a widget instance. | ||||||
---|---|---|---|---|---|---|
|
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. | ||||||
---|---|---|---|---|---|---|
| ||||||
|
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. |
---|
Implement and provide this to an SiMenuFactoryComponent to receive trigger events. | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
The Remote Module definition is based on @angular-architects . We take it over into this file to prevent adding a hard dependency. |
---|
Object is used to inform the editor hosting component about configuration changes to configure (e.g. enable/disable) the control buttons accordingly. | |||
---|---|---|---|
|
import imported from gridstack |
---|
Translatable import imported from @siemens/element-translate-ng |
---|
ObjectFit configuration options for a widget image. See https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit |
---|
Returns the return value type for the given action dialog type |
---|
Reference to a modal dialog | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
| ||||||||||||
| ||||||||||||
|
All possible action dialogs. |
---|
An action dialog showing an alert | ||||||||
---|---|---|---|---|---|---|---|---|
|
An action dialog for a confirmation. | |||||||||
---|---|---|---|---|---|---|---|---|---|
|
An action dialog for an edit/discard prompt. | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
An action dialog for a delete confirmation. | |||||||||
---|---|---|---|---|---|---|---|---|---|
|
|
Variable Deprecated: Will be removed in a future release. Use the string values directly. |
---|
Variable Deprecated: Will be removed in a future release. Use the string values directly. |
---|
Variable Deprecated: Will be removed in a future release. Use the string values directly. |
---|
|
Variable Deprecated: Will be removed in a future release. Use the string values directly. |
---|
Used in events emitted from SiLinkActionService | |||
---|---|---|---|
|
|
Default widget catalog implementation to show all available widgets that can be added to a dashboard. It consists of a list view, that lists all available widgets and after selection, a host in which the widget specific editor is loaded. Applications can either stay with the default catalog or implement their own by extending this class. | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||
|
The Dialog component is utilized when editing a widget instance within a dashboard. It dynamically loads and creates the associated widget editor and incorporates it into its content. The dialog component is accountable for interacting with the dashboard and offers options for saving changes or terminating the editing process. | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||
| |||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
|
The grid component is the actual component on which the widget instances are placed and visualized. You can think of a headless dashboard, without a title, toolbar or edit buttons. | |||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||
|
The service provides convenient methods to show common modal dialogs. All return an observable, which emit the dialog results. After emitting, the observables complete. Therefore, clients do not need to unsubscribe. | ||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
|
| |||||||||||
| |||||||||||
|
A service wrapping ResizeObserver . This is a service for those reasons: - only one ResizeObserver should be used for performance reason. - For Angular change detection to work, explicit ngZone calls are necessary - Observable stream | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Gets the width of the scrollbar. Nesc for windows http://stackoverflow.com/a/13382873/888165 | |||
---|---|---|---|
| |||
| |||
|
| |||
| |||
|
| |||||||||||||||||||||||||
| |||||||||||||||||||||||||
|
| ||||||||||||||
|
| |||||||||||||||||||||
| |||||||||||||||||||||
|
| |||||||
| |||||||
|
Except where otherwise noted, content on this site is licensed under MIT License.