createWidgetConfig Type documentation¶
TypeScript declaration¶
Function creates a new WidgetConfig without id from a Widget and copies all default values into the WidgetConfig. Returns: The created WidgetConfig without id. Function creates a new WidgetConfig without id from a Widget and copies all default values into the WidgetConfig. Returns: The created WidgetConfig without id. • The source to create the new WidgetConfig from.import { createWidgetConfig } from '@siemens/dashboards-ng';createWidgetConfig(widget: Widget): Omit<WidgetConfig, "id">
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. Optional translatable badge text displayed next to the widget name in the catalog, for example, "Requires license" when creation is disabled with badge ? : 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 ? : 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. Maximum number of instances of this widget that can be added through the catalog. • • • @remarks: This limit applies to the catalog only. It does not restrict programmatic calls to maxInstances ? : 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 { Widget } from '@siemens/dashboards-ng';
maxInstances: 0. Consumer badges use the info style. The built-in added badge takes precedence when a positive instance limit has been reached.TranslatableString ¶ Pick<WidgetConfig, "width" | "height" | "minWidth" | "minHeight" | "heading" | "headingIcon" | "expandable" | "immutable" | "image" | "accentLine"> ¶ 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.addWidgetInstance().number = undefined ¶
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.
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.
Factory type that is either a WidgetComponentTypeFactory, FederatedModule, FederatedBridgeModule or WebComponent.import type { WidgetComponentFactory } from '@siemens/dashboards-ng';
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';
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';
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';
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.
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.