setupWidgetEditor Type documentation¶
TypeScript declaration¶
import { setupWidgetEditor } from '@siemens/dashboards-ng';setupWidgetEditor(widgetComponentFactory: WidgetComponentFactory, host: ViewContainerRef, injector: Injector, envInjector: EnvironmentInjector): Observable<ComponentRef<WidgetInstanceEditor>>
Types Documentation¶
Factory type that is either a WidgetComponentTypeFactory, FederatedModule, FederatedBridgeModule or WebComponent.import type { WidgetComponentFactory } 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. The hosting component of the widget instance editor sets the configuration after initialization. The editor component should use the configuration as input and persist all relevant changes within the config. The hosting component takes the config after adding of saving the widget instance and updates the dashboard. config : Optionally, emit updated widget configuration using an event emitter. configChange ? : Optionally, inform the hosting component about widget configuration status changes. statusChanges ? : import type { WidgetInstanceEditor } from '@siemens/dashboards-ng';
WidgetConfig | Omit<WidgetConfig, "id"> | InputSignal<WidgetConfig | Omit<WidgetConfig, "id">> ¶ Subject<WidgetConfig | Omit<WidgetConfig, "id">> | OutputEmitterRef<WidgetConfig | Omit<WidgetConfig, "id">> ¶ Subject<Partial<WidgetConfigStatus>> | OutputEmitterRef<Partial<WidgetConfigStatus>> ¶
import type { WidgetComponentTypeFactory } 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. FederatedModule
CommonFactoryFields & LoadRemoteModuleOptions & { factoryType: 'module-federation' | 'native-federation'; [index: string]: any; } ¶ import type { FederatedModule } from '@siemens/dashboards-ng';
WebComponent
CommonFactoryFields & { factoryType: 'web-component'; url: string; [index: string]: any; } ¶ import type { WebComponent } from '@siemens/dashboards-ng';
Use this when having native federation shell and remote module is using module federation. FederatedBridgeModule
CommonFactoryFields & LoadRemoteBridgeOptions & { factoryType: 'native-federation-module-bridge'; [index: string]: any; } ¶ import type { FederatedBridgeModule } 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. expandable ? : grid item header text. Icon name or a single-entry map of camelCase icon name to SVG data URI. headingIcon ? : 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. image ? : isNotRemovable ? : 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 setupPending ? : 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 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 { WidgetConfig } from '@siemens/dashboards-ng';
boolean ¶ string | Record<string, string> ¶ WidgetImage ¶ boolean ¶ false once the setup has been completed.boolean ¶ WidgetConfig and the widget instance component.
Object is used to inform the editor hosting component about configuration changes to configure (e.g. enable/disable) the control buttons accordingly.import type { WidgetConfigStatus } from '@siemens/dashboards-ng';
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 ? : 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; } ¶
string ¶
Use when component is not standalone and part of a module factoryType ? : moduleLoader : ModuleOptions
WidgetComponentTypeBaseConfig & { moduleName: string; moduleLoader: (name: string) => Promise<any>; componentLoader?: never; } ¶
"default" ¶ (name: string) => Promise<any> ¶
Use when component is standalone componentLoader : factoryType ? : moduleLoader ? : moduleName ? : StandaloneOptions
WidgetComponentTypeBaseConfig & { componentLoader: <T = unknown>(componentName: string) => Promise<Type<T>>; moduleName?: never; moduleLoader?: never; } ¶
<T = unknown>(componentName: string) => Promise<Type<T>> ¶ "default" ¶ undefined ¶ undefined ¶
The Remote Module definition is based on import type { LoadRemoteModuleOptions } from '@siemens/dashboards-ng';@angular-architects. We take it over into this file to prevent adding a hard dependency.
Definition is based on LoadRemoteBridgeOptions
{ id: string; options?: | { loadFactory?: boolean | undefined; from: 'build' | 'runtime'; } | undefined; } ¶ import type { LoadRemoteBridgeOptions } from '@siemens/dashboards-ng';@module-federation/enhanced loadRemote options. We take it over into this file to prevent adding a hard dependency.
Represents a translatable string. This can either be a translation key, e.g. import type { TranslatableString } from '@siemens/element-translate-ng/translate-types';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 { ViewType } from '@siemens/element-ng/content-action-bar';
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. objectPosition ? : The image URL (See <img>).import type { WidgetImage } from '@siemens/dashboards-ng';
string ¶
import type { AccentLineType } 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';
ObjectFit configuration options for a widget image. See: https://developer.mozilla.org/en-US/docs/Web/CSS/object-fitimport type { ObjectFit } from '@siemens/dashboards-ng';
import type { StatusType } from '@siemens/element-ng/common';
Except where otherwise noted, content on this site is licensed under MIT License.