SiGridComponent documentation¶
selector
si-grid
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.
Input Properties¶
Name | Type | Default | Description |
---|---|---|---|
dashboardId ¶ | string | An optional, but recommended dashboard id that is used in persistence and passed to the widget store for saving and loading data. | |
editable ¶ | boolean | false | Sets the grid into editable mode, in which the widget instances can be moved, resized, removed or new ones added. |
emitWidgetInstanceEditEvents ¶ | boolean | false | When the user clicks edit on a widget instance, an editor need to appear and the widget editor component need to be loaded. When the grid is used standalone, it takes care and opens a modal dialog and loads the configured widget editor component. When the grid is used in a container like the flexible dashboard, the container manages where the widget instance editor is displayed. In this case this options prevents the grid from showing the editor in the dialog, and emits on widgetInstanceEdit on clicking the widget edit action. |
hideProgressIndicator ¶ | boolean | false | Option to turn off the loading spinner on save and load operations. |
widgetCatalog ¶ | Widget [] | [] | Provides the available widgets to the grid. When loading the widget configurations from the storage, we need to have the widget definition available to be able to create the widget instances on the grid. |
widgetInstanceEditorDialogComponent ¶ | Type <SiWidgetInstanceEditorDialogComponent > | Option to configure a custom widget instance editor dialog component. The component provides the editor hosting and the buttons to save and cancel. |
Output Properties¶
Name | Type | Description |
---|---|---|
editableChange ¶ | boolean | Sets the grid into editable mode, in which the widget instances can be moved, resized, removed or new ones added. |
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 . |
widgetInstanceEdit ¶ | WidgetConfig | Emits to notify about edit events of widget instances. Only emits if emitWidgetInstanceEditEvents is set to true . |
Attributes and Methods¶
Name | Type | Default | Description |
---|---|---|---|
addWidgetInstance(...) ¶ | (widgetInstanceConfig: Omit <WidgetConfig , "id" >) => void | Adds a new widget instance configuration to the dashboard grid. It is not persisted yet and is added to the transient widget instances. Parameters
| |
cancel() ¶ | () => void | Cancel current changes and restore last saved state. | |
edit() ¶ | () => void | Set dashboard grid in editable mode to modify widget instances. | |
editWidgetInstance(...) ¶ | (widgetInstanceConfig: WidgetConfig ) => void | Opens the provided widget configuration in the related editor or emits on widgetInstanceEdit , if emitWidgetInstanceEditEvents is true. Parameters
| |
(readonly) gridConfig ¶ | InputSignal <(undefined | GridConfig )> | inject(SI_DASHBOARD_CONFIGURATION)?.grid | Configuration options for a grid instance. Default is the optional value from the SI_DASHBOARD_CONFIGURATION . |
(readonly) gridStackWrapper ¶ | Signal <SiGridstackWrapperComponent > | viewChild.required(SiGridstackWrapperComponent) | |
(readonly) isLoading ¶ | BehaviorSubject <boolean > | ... | Indication for load and save operations. |
removeWidgetInstance(...) ¶ | (widgetInstanceId: string ) => void | Removes a widget instance from the visible widgets and puts it in the markedForRemoval array. Parameters
| |
save() ¶ | () => void | Persists the current widget instances to the widget storage and changes the editable and isModified modes. | |
updateWidgetInstance(...) ¶ | (editedWidgetConfig: WidgetConfig ) => void | Updates the visible widgets with an updated configuration. Will update the user interface and emit on isModified . Parameters
| |
loadingService | SiLoadingService | inject(SiLoadingService) | Service used to indicate load and save indication. Deprecated: Use isLoading instead. |
Types Documentation¶
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. | |||||||||
---|---|---|---|---|---|---|---|---|---|
|
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. | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Configuration object for the si-grid component, including the options of gridstack. | ||
---|---|---|
|
Variable Injection token to configure dashboards. Use { provide: SI_DASHBOARD_CONFIGURATION, useValue: config } in your app configuration. |
---|
Dashboard configuration object. Inject globally using the SI_DASHBOARD_CONFIGURATION or configure individual dashboard instances. |
---|
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. | ||||
---|---|---|---|---|
|
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. |
---|
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. | ||||
---|---|---|---|---|
|
Image is used to configure an image to be displayed on a widget instance. | ||||||
---|---|---|---|---|---|---|
|
import imported from gridstack |
---|
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. | ||||||
---|---|---|---|---|---|---|
| ||||||
|
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. | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||
| |||||||||||||
|
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. | |||
---|---|---|---|
|
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 |
---|
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. |
---|
Reference to a modal dialog | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
| ||||||||||||
| ||||||||||||
|
Variable Deprecated: Will be removed in a future release. Use the string values directly. |
---|
|
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. |
---|
Translatable import imported from @siemens/element-translate-ng |
---|
Union type for all possible items in the dashboard toolbar. |
---|
|
|
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. | |||||
---|---|---|---|---|---|
|
|
Implement and provide this to an SiMenuFactoryComponent to receive trigger events. | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
Used in events emitted from SiLinkActionService | |||
---|---|---|---|
|
|
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 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 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. | ||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||
| |||||||||||||||||||||||||
|
| |||||||||||||||||||||
| |||||||||||||||||||||
|
| |||||||
| |||||||
|
Except where otherwise noted, content on this site is licensed under MIT License.