# WidgetInstanceEditorWizard Type documentation

## TypeScript declaration

### [WidgetInstanceEditorWizard](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L278-L301>)

**Kind:** interface

```
import type { WidgetInstanceEditorWizard } from '@siemens/dashboards-ng';
```

A widget instance editor component that shall support a multi-page widget configuration can implement this interface. The wizard-like page state [WidgetInstanceEditorWizardState](<index.html#t: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.

```
interface WidgetInstanceEditorWizard extends WidgetInstanceEditor
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [config](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L244-L245>) (inherited) | `WidgetConfig \| Omit<WidgetConfig, "id"> \| InputSignal<WidgetConfig \| Omit<WidgetConfig, "id">>` | 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.<br><br>Inherited from [WidgetInstanceEditor](<index.html#t:WidgetInstanceEditor>) |
| [configChange](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L249-L251>) (optional, inherited) | `Subject<WidgetConfig \| Omit<WidgetConfig, "id">> \| OutputEmitterRef<WidgetConfig \| Omit<WidgetConfig, "id">>` | Optionally, emit updated widget configuration using an event emitter.<br><br>Inherited from [WidgetInstanceEditor](<index.html#t:WidgetInstanceEditor>) |
| [state](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L283-L283>) | `WidgetInstanceEditorWizardState` | The current state of the multi-page widget instance editor. The state is access after `#next()` or `#previous()` is invoked. |
| [stateChange](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L287-L288>) (optional) | `Subject<WidgetInstanceEditorWizardState> \| OutputEmitterRef<WidgetInstanceEditorWizardState>` | Emit changes as needed during the user interaction with the editor. |
| [statusChanges](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L256-L257>) (optional, inherited) | `Subject<Partial<WidgetConfigStatus>> \| OutputEmitterRef<Partial<WidgetConfigStatus>>` | Optionally, inform the hosting component about widget configuration status changes.<br><br>Inherited from [WidgetInstanceEditor](<index.html#t:WidgetInstanceEditor>) |

#### Methods

##### next

[Source for next](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L294-L294>)

Is invoked from the next button. Display next page as consequence. For web components, implementing `next()` requires adding an event listener for the `next` event on the element.

```
next(): void
```

**Returns:** [void](<https://www.typescriptlang.org/docs/handbook/2/functions.html#void>)

##### previous

[Source for previous](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L300-L300>)

Is invoked from the previous button. Display previous page as consequence. For web components, implementing `previous()` requires adding an event listener for the `previous` event on the element.

```
previous(): void
```

**Returns:** [void](<https://www.typescriptlang.org/docs/handbook/2/functions.html#void>)

### Types Documentation

### [WidgetConfig](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L146-L211>)

**Kind:** interface

```
import type { WidgetConfig } from '@siemens/dashboards-ng';
```

A [WidgetConfig](<index.html#t: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.

```
interface WidgetConfig
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [accentLine](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L210-L210>) (optional) | `AccentLineType` | Optional type of the accent line. |
| [actionBarViewType](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L200-L200>) (optional) | `ViewType` |  |
| [expandable](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L189-L189>) (optional) | `boolean` | Defines whether the widget instance component can be expanded and enlarged over the dashboard. |
| [heading](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L185-L185>) (optional) | `TranslatableString` | grid item header text. |
| [headingIcon](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L187-L187>) (optional) | `string \| Record<string, string>` | Icon name or a single-entry map of camelCase icon name to SVG data URI. |
| [height](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L165-L165>) (optional) | `number` | Height of the grid item, where number represents how many rows it takes. (default?: 1) |
| [id](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L148-L148>) | `string` | A unique id of a widget instance |
| [image](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L206-L206>) (optional) | `WidgetImage` | Optional configuration for an image to be displayed on the widget instance. |
| [immutable](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L202-L202>) (optional) | `boolean` |  |
| [isNotRemovable](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L201-L201>) (optional) | `boolean` |  |
| [minHeight](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L181-L181>) (optional) | `number` | minimum height allowed during resize/creation (default?: undefined = un-constrained) |
| [minWidth](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L177-L177>) (optional) | `number` | minimum width allowed during resize/creation (default?: undefined = un-constrained) |
| [payload](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L191-L191>) (optional) | `any` | A widget specific payload object. Placeholder to pass in additional configuration. |
| [setupPending](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L199-L199>) (optional) | `boolean` | If true, the widget host renders a placeholder and waits for explicit configuration before instantiating the widget instance component.<br><br>Indicates that initial setup by the user is still pending. The flag flips to `false` once the setup has been completed. |
| [version](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L157-L157>) (optional) | `string` | Optionally, the version widget description that was used to create the widget config. |
| [widgetId](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L153-L153>) | `string` | The id of the widget descriptor that was used to instantiate the `WidgetConfig` and the widget instance component. |
| [width](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L161-L161>) (optional) | `number` | Width of the grid item, where number represents how many columns it spans (default?: 1) |
| [x](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L169-L169>) (optional) | `number` | Grid item position on x axis of the grid (default?: 0) |
| [y](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L173-L173>) (optional) | `number` | Grid item position on y axis of the grid (default?: 0) |

### [WidgetConfigStatus](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L217-L228>)

**Kind:** interface

```
import type { WidgetConfigStatus } from '@siemens/dashboards-ng';
```

Object is used to inform the editor hosting component about configuration changes to configure (e.g. enable/disable) the control buttons accordingly.

```
interface WidgetConfigStatus
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [invalid](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L227-L227>) | `boolean` | If true, save or add button will be disabled. |
| [modified](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L222-L222>) | `boolean` | Indicates that the configuration was changed. If true, canceling the editor will first show a dialog to confirm the discard. |

### [WidgetInstanceEditor](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L236-L258>)

**Kind:** interface

```
import type { WidgetInstanceEditor } 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.

```
interface WidgetInstanceEditor
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [config](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L244-L245>) | `WidgetConfig \| Omit<WidgetConfig, "id"> \| InputSignal<WidgetConfig \| Omit<WidgetConfig, "id">>` | 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. |
| [configChange](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L249-L251>) (optional) | `Subject<WidgetConfig \| Omit<WidgetConfig, "id">> \| OutputEmitterRef<WidgetConfig \| Omit<WidgetConfig, "id">>` | Optionally, emit updated widget configuration using an event emitter. |
| [statusChanges](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L256-L257>) (optional) | `Subject<Partial<WidgetConfigStatus>> \| OutputEmitterRef<Partial<WidgetConfigStatus>>` | Optionally, inform the hosting component about widget configuration status changes. |

### [WidgetInstanceEditorWizardState](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L265-L269>)

**Kind:** interface

```
import type { WidgetInstanceEditorWizardState } from '@siemens/dashboards-ng';
```

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.

```
interface WidgetInstanceEditorWizardState
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [disableNext](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L268-L268>) (optional) | `boolean` |  |
| [hasNext](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L266-L266>) | `boolean` |  |
| [hasPrevious](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L267-L267>) | `boolean` |  |

### [TranslatableString](<https://github.com/siemens/element/blob/main/projects/element-translate-ng/translate-types/global.types.ts#L18-L18>)

**Kind:** type alias

```
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.

```
type TranslatableString = string & Translatable
```

### [ViewType](<https://github.com/siemens/element/blob/main/projects/element-ng/content-action-bar/si-content-action-bar.model.ts#L13-L13>)

**Kind:** type alias

```
import type { ViewType } from '@siemens/element-ng/content-action-bar';
```

```
type ViewType = 'collapsible' | 'expanded' | 'mobile'
```

### [WidgetImage](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L118-L140>)

**Kind:** interface

```
import type { WidgetImage } from '@siemens/dashboards-ng';
```

Image is used to configure an image to be displayed on a widget instance.

```
interface WidgetImage
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [alt](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L127-L127>) | `string` | The HTMLImageElement property [alt](<https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#usage_notes>) provides fallback (alternate) text to display when the image specified by the \<img\> element is not loaded. |
| [dir](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L131-L131>) (optional) | `"horizontal" \| "vertical"` | Defines if an image is placed on top or start (left) of the card. |
| [objectFit](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L135-L135>) (optional) | `ObjectFit` | Sets the image [object-fit](<https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit>) CSS property. |
| [objectPosition](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L139-L139>) (optional) | `string` | Sets the image [object-position](<https://developer.mozilla.org/en-US/docs/Web/CSS/object-position>) CSS property. |
| [src](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L122-L122>) | `string` | The image URL (See [\<img\>](<https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#src>)). |

### [AccentLineType](<https://github.com/siemens/element/blob/main/projects/element-ng/common/models/status-type.model.ts#L10-L10>)

**Kind:** type alias

```
import type { AccentLineType } from '@siemens/element-ng/common';
```

```
type AccentLineType = StatusType | 'caution' | 'primary' | 'inactive'
```

### [ObjectFit](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L113-L113>)

**Kind:** type alias

```
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](<https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit>)

```
type ObjectFit = 'contain' | 'cover' | 'fill' | 'none' | 'scale-down'
```

### [StatusType](<https://github.com/siemens/element/blob/main/projects/element-ng/common/models/status-type.model.ts#L7-L7>)

**Kind:** type alias

```
import type { StatusType } from '@siemens/element-ng/common';
```

```
type StatusType = 'success' | 'info' | 'warning' | 'danger' | 'caution' | 'critical'
```
