@siemens/dashboards-ng 47.8.0 → 48.0.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/siemens-dashboards-ng-module-federation.mjs.map +1 -1
- package/fesm2022/siemens-dashboards-ng.mjs +81 -83
- package/fesm2022/siemens-dashboards-ng.mjs.map +1 -1
- package/index.d.ts +1070 -3
- package/module-federation/index.d.ts +3 -1
- package/package.json +5 -5
- package/translate/index.d.ts +43 -2
- package/components/dashboard-toolbar/si-dashboard-toolbar.component.d.ts +0 -80
- package/components/flexible-dashboard/si-flexible-dashboard.component.d.ts +0 -151
- package/components/grid/si-grid.component.d.ts +0 -189
- package/components/gridstack-wrapper/si-gridstack-wrapper.component.d.ts +0 -70
- package/components/web-component-wrapper/si-web-component-editor-wrapper.component.d.ts +0 -27
- package/components/web-component-wrapper/si-web-component-wrapper-base.component.d.ts +0 -18
- package/components/web-component-wrapper/si-web-component-wrapper.component.d.ts +0 -27
- package/components/widget-catalog/si-widget-catalog.component.d.ts +0 -101
- package/components/widget-host/si-widget-host.component.d.ts +0 -80
- package/components/widget-instance-editor-dialog/si-widget-instance-editor-dialog.component.d.ts +0 -73
- package/model/configuration.d.ts +0 -22
- package/model/gridstack.model.d.ts +0 -15
- package/model/si-dashboard-toolbar.model.d.ts +0 -37
- package/model/si-widget-storage.d.ts +0 -78
- package/model/widgets.model.d.ts +0 -316
- package/public-api.d.ts +0 -16
- package/public-api.module.d.ts +0 -38
- package/services/si-grid.service.d.ts +0 -17
- package/translate/si-translatable-keys.interface.d.ts +0 -35
- package/translate/si-translatable-overrides.provider.d.ts +0 -7
- package/widget-loader.d.ts +0 -18
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Siemens 2016 - 2025
|
|
3
|
-
* SPDX-License-Identifier: MIT
|
|
4
|
-
*/
|
|
5
|
-
import { OnDestroy, OnInit, ViewContainerRef } from '@angular/core';
|
|
6
|
-
import { Widget, WidgetConfig } from '../../model/widgets.model';
|
|
7
|
-
import * as i0 from "@angular/core";
|
|
8
|
-
/**
|
|
9
|
-
* Default widget catalog implementation to show all available widgets that can be added
|
|
10
|
-
* to a dashboard. It consists of a list view, that lists all available widgets and after
|
|
11
|
-
* selection, a host in which the widget specific editor is loaded. Applications can either
|
|
12
|
-
* stay with the default catalog or implement their own by extending this class.
|
|
13
|
-
*/
|
|
14
|
-
export declare class SiWidgetCatalogComponent implements OnInit, OnDestroy {
|
|
15
|
-
/**
|
|
16
|
-
* Placeholder text for the search input field in the widget catalog.
|
|
17
|
-
*
|
|
18
|
-
* @defaultValue
|
|
19
|
-
* ```
|
|
20
|
-
* $localize`:@@DASHBOARD.WIDGET_LIBRARY.SEARCH_PLACEHOLDER:Search widget`
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
readonly searchPlaceholder: import("@angular/core").InputSignal<import("@siemens/element-translate-ng/translate").TranslatableString>;
|
|
24
|
-
/**
|
|
25
|
-
* Emits when the catalog is `closed`, either by canceling or by adding or saving
|
|
26
|
-
* a widget configuration. On cancel `undefined` is emitted, otherwise the related
|
|
27
|
-
* widget configuration is emitted.
|
|
28
|
-
*/
|
|
29
|
-
readonly closed: import("@angular/core").OutputEmitterRef<Omit<WidgetConfig, "id"> | undefined>;
|
|
30
|
-
/**
|
|
31
|
-
* View defines if the catalog widget list or the widget editor is visible.
|
|
32
|
-
*
|
|
33
|
-
* @internal
|
|
34
|
-
* @defaultValue 'list'
|
|
35
|
-
*/
|
|
36
|
-
readonly view: import("@angular/core").WritableSignal<"list" | "editor" | "editor-only">;
|
|
37
|
-
protected readonly editorHost: import("@angular/core").Signal<ViewContainerRef>;
|
|
38
|
-
/**
|
|
39
|
-
* Property to provide the available widgets to the catalog. The flexible
|
|
40
|
-
* dashboard creates the catalog by Angular's `createComponent()` method
|
|
41
|
-
* and sets the available widgets to this attribute.
|
|
42
|
-
*
|
|
43
|
-
* @defaultValue [] */
|
|
44
|
-
widgetCatalog: Widget[];
|
|
45
|
-
/**
|
|
46
|
-
* Holds the search term from the catalog to be visible when going back
|
|
47
|
-
* by pressing the previous button from the widget edit view.
|
|
48
|
-
*/
|
|
49
|
-
protected searchTerm: string;
|
|
50
|
-
/**
|
|
51
|
-
* Array used to hold the search result on the widget catalog.
|
|
52
|
-
* @defaultValue [] */
|
|
53
|
-
protected filteredWidgetCatalog: Widget[];
|
|
54
|
-
protected readonly selected: import("@angular/core").WritableSignal<Widget | undefined>;
|
|
55
|
-
private widgetConfig?;
|
|
56
|
-
private readonly hasEditor;
|
|
57
|
-
protected labelCancel: import("@siemens/element-translate-ng/translate").TranslatableString;
|
|
58
|
-
protected labelPrevious: import("@siemens/element-translate-ng/translate").TranslatableString;
|
|
59
|
-
protected labelNext: import("@siemens/element-translate-ng/translate").TranslatableString;
|
|
60
|
-
protected labelAdd: import("@siemens/element-translate-ng/translate").TranslatableString;
|
|
61
|
-
protected labelEmpty: import("@siemens/element-translate-ng/translate").TranslatableString;
|
|
62
|
-
protected labelDialogHeading: import("@siemens/element-translate-ng/translate").TranslatableString;
|
|
63
|
-
protected labelDialogCancel: import("@siemens/element-translate-ng/translate").TranslatableString;
|
|
64
|
-
protected labelDialogMessage: import("@siemens/element-translate-ng/translate").TranslatableString;
|
|
65
|
-
protected labelDialogDiscard: import("@siemens/element-translate-ng/translate").TranslatableString;
|
|
66
|
-
protected readonly showAddButton: import("@angular/core").Signal<boolean>;
|
|
67
|
-
protected readonly showNextButton: import("@angular/core").Signal<boolean>;
|
|
68
|
-
protected readonly showPreviousButton: import("@angular/core").Signal<boolean>;
|
|
69
|
-
protected readonly disableAddButton: import("@angular/core").Signal<boolean>;
|
|
70
|
-
protected readonly disableNextButton: import("@angular/core").Signal<boolean>;
|
|
71
|
-
/** Indicates if the current config is valid or not. If invalid, the add button is disabled. */
|
|
72
|
-
private readonly invalidConfig;
|
|
73
|
-
/**
|
|
74
|
-
* Marks the widget configuration as modified. Is set when widget editor instance
|
|
75
|
-
* emits configChange events. Triggers edit discard confirmation dialog when widget config
|
|
76
|
-
* is modified but not added to the dashboard.
|
|
77
|
-
* */
|
|
78
|
-
private widgetConfigModified;
|
|
79
|
-
private widgetInstanceEditor?;
|
|
80
|
-
private readonly editorWizardState;
|
|
81
|
-
private widgetInstanceEditorRef?;
|
|
82
|
-
private subscriptions;
|
|
83
|
-
private dialogService;
|
|
84
|
-
private injector;
|
|
85
|
-
private envInjector;
|
|
86
|
-
ngOnInit(): void;
|
|
87
|
-
ngOnDestroy(): void;
|
|
88
|
-
protected onSearch(searchTerm?: string): void;
|
|
89
|
-
protected onCancel(): void;
|
|
90
|
-
protected onNext(): void;
|
|
91
|
-
protected onPrevious(): void;
|
|
92
|
-
private setupWidgetInstanceEditor;
|
|
93
|
-
private tearDownEditor;
|
|
94
|
-
private setupCatalog;
|
|
95
|
-
protected onAddWidget(): void;
|
|
96
|
-
protected selectWidget(widget?: Widget): void;
|
|
97
|
-
private isEditorWizdard;
|
|
98
|
-
private handleStatusChanges;
|
|
99
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<SiWidgetCatalogComponent, never>;
|
|
100
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SiWidgetCatalogComponent, "si-widget-catalog", never, { "searchPlaceholder": { "alias": "searchPlaceholder"; "required": false; "isSignal": true; }; }, { "closed": "closed"; }, never, never, true, never>;
|
|
101
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { ComponentRef, OnChanges, OnDestroy, OnInit, SimpleChanges, TemplateRef, ViewContainerRef } from '@angular/core';
|
|
2
|
-
import type { MenuItem as MenuItemLegacy } from '@siemens/element-ng/common';
|
|
3
|
-
import { ContentActionBarMainItem, ViewType } from '@siemens/element-ng/content-action-bar';
|
|
4
|
-
import { SiDashboardCardComponent } from '@siemens/element-ng/dashboard';
|
|
5
|
-
import { MenuItem } from '@siemens/element-ng/menu';
|
|
6
|
-
import { WidgetConfig, WidgetConfigEvent, WidgetInstance } from '../../model/widgets.model';
|
|
7
|
-
import * as i0 from "@angular/core";
|
|
8
|
-
export declare class SiWidgetHostComponent implements OnInit, OnDestroy, OnChanges {
|
|
9
|
-
private siModal;
|
|
10
|
-
private gridService;
|
|
11
|
-
private injector;
|
|
12
|
-
private envInjector;
|
|
13
|
-
private unsubscribe;
|
|
14
|
-
readonly widgetConfig: import("@angular/core").InputSignal<WidgetConfig>;
|
|
15
|
-
readonly remove: import("@angular/core").OutputEmitterRef<string>;
|
|
16
|
-
readonly edit: import("@angular/core").OutputEmitterRef<WidgetConfig>;
|
|
17
|
-
readonly initCompleted: import("@angular/core").OutputEmitterRef<void>;
|
|
18
|
-
readonly card: import("@angular/core").Signal<SiDashboardCardComponent>;
|
|
19
|
-
readonly widgetHost: import("@angular/core").Signal<ViewContainerRef>;
|
|
20
|
-
protected labelEdit: import("@siemens/element-translate-ng/translate-types").TranslatableString;
|
|
21
|
-
protected labelRemove: import("@siemens/element-translate-ng/translate-types").TranslatableString;
|
|
22
|
-
protected labelExpand: import("@siemens/element-translate-ng/translate-types").TranslatableString;
|
|
23
|
-
protected labelRestore: import("@siemens/element-translate-ng/translate-types").TranslatableString;
|
|
24
|
-
protected labelDialogMessage: import("@siemens/element-translate-ng/translate-types").TranslatableString;
|
|
25
|
-
protected labelDialogHeading: import("@siemens/element-translate-ng/translate-types").TranslatableString;
|
|
26
|
-
protected labelDialogRemove: import("@siemens/element-translate-ng/translate-types").TranslatableString;
|
|
27
|
-
protected labelDialogCancel: import("@siemens/element-translate-ng/translate-types").TranslatableString;
|
|
28
|
-
widgetInstance?: WidgetInstance;
|
|
29
|
-
widgetRef?: ComponentRef<WidgetInstance>;
|
|
30
|
-
/** @defaultValue [] */
|
|
31
|
-
primaryActions: (MenuItemLegacy | ContentActionBarMainItem)[];
|
|
32
|
-
/** @defaultValue [] */
|
|
33
|
-
secondaryActions: (MenuItemLegacy | MenuItem)[];
|
|
34
|
-
/** @defaultValue 'expanded' */
|
|
35
|
-
actionBarViewType: ViewType;
|
|
36
|
-
editable$: import("rxjs").BehaviorSubject<boolean>;
|
|
37
|
-
/** @defaultValue [] */
|
|
38
|
-
editablePrimaryActions: (MenuItemLegacy | ContentActionBarMainItem)[];
|
|
39
|
-
/** @defaultValue [] */
|
|
40
|
-
editableSecondaryActions: (MenuItemLegacy | MenuItem)[];
|
|
41
|
-
/**
|
|
42
|
-
* @defaultValue
|
|
43
|
-
* ```
|
|
44
|
-
* {
|
|
45
|
-
* type: 'action',
|
|
46
|
-
* label: this.labelEdit,
|
|
47
|
-
* icon: 'element-edit',
|
|
48
|
-
* iconOnly: true,
|
|
49
|
-
* action: () => this.onEdit()
|
|
50
|
-
* }
|
|
51
|
-
* ```
|
|
52
|
-
*/
|
|
53
|
-
editAction: ContentActionBarMainItem;
|
|
54
|
-
/**
|
|
55
|
-
* @defaultValue
|
|
56
|
-
* ```
|
|
57
|
-
* {
|
|
58
|
-
* type: 'action',
|
|
59
|
-
* label: this.labelRemove,
|
|
60
|
-
* icon: 'element-delete',
|
|
61
|
-
* iconOnly: true,
|
|
62
|
-
* action: () => this.onRemove()
|
|
63
|
-
* }
|
|
64
|
-
* ```
|
|
65
|
-
*/
|
|
66
|
-
removeAction: ContentActionBarMainItem;
|
|
67
|
-
protected widgetInstanceFooter?: TemplateRef<unknown>;
|
|
68
|
-
protected get accentLine(): string;
|
|
69
|
-
ngOnChanges(changes: SimpleChanges): void;
|
|
70
|
-
ngOnInit(): void;
|
|
71
|
-
ngOnDestroy(): void;
|
|
72
|
-
private attachWidgetInstance;
|
|
73
|
-
setupEditable(editable: boolean, widgetConfig?: WidgetConfigEvent): void;
|
|
74
|
-
private doRemove;
|
|
75
|
-
private isEditable;
|
|
76
|
-
onEdit(): void;
|
|
77
|
-
onRemove(): void;
|
|
78
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<SiWidgetHostComponent, never>;
|
|
79
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SiWidgetHostComponent, "si-widget-host", never, { "widgetConfig": { "alias": "widgetConfig"; "required": true; "isSignal": true; }; }, { "remove": "remove"; "edit": "edit"; "initCompleted": "initCompleted"; }, never, never, true, never>;
|
|
80
|
-
}
|
package/components/widget-instance-editor-dialog/si-widget-instance-editor-dialog.component.d.ts
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Siemens 2016 - 2025
|
|
3
|
-
* SPDX-License-Identifier: MIT
|
|
4
|
-
*/
|
|
5
|
-
import { OnDestroy, OnInit, ViewContainerRef } from '@angular/core';
|
|
6
|
-
import { Widget, WidgetConfig } from '../../model/widgets.model';
|
|
7
|
-
import * as i0 from "@angular/core";
|
|
8
|
-
/**
|
|
9
|
-
* The Dialog component is utilized when editing a widget instance within a dashboard.
|
|
10
|
-
* It dynamically loads and creates the associated widget editor and incorporates it
|
|
11
|
-
* into its content. The dialog component is accountable for interacting with the dashboard
|
|
12
|
-
* and offers options for saving changes or terminating the editing process.
|
|
13
|
-
*/
|
|
14
|
-
export declare class SiWidgetInstanceEditorDialogComponent implements OnInit, OnDestroy {
|
|
15
|
-
/**
|
|
16
|
-
* Input for the widget instance configuration. It is used to populate the
|
|
17
|
-
* widget editor.
|
|
18
|
-
*/
|
|
19
|
-
readonly widgetConfig: import("@angular/core").ModelSignal<WidgetConfig>;
|
|
20
|
-
/**
|
|
21
|
-
* Input for the widget definition. It is required to retrieve the component
|
|
22
|
-
* factory to instantiate the widget editor.
|
|
23
|
-
*/
|
|
24
|
-
readonly widget: import("@angular/core").InputSignal<Widget>;
|
|
25
|
-
/**
|
|
26
|
-
* Emits the edited widget instance configuration if the user confirms by
|
|
27
|
-
* saving, or `undefined` if the user cancels the dialog.
|
|
28
|
-
*/
|
|
29
|
-
readonly closed: import("@angular/core").OutputEmitterRef<WidgetConfig | undefined>;
|
|
30
|
-
/**
|
|
31
|
-
* Emits when the editor instantiation is completed.
|
|
32
|
-
*/
|
|
33
|
-
readonly editorSetupCompleted: import("@angular/core").OutputEmitterRef<void>;
|
|
34
|
-
protected readonly editorHost: import("@angular/core").Signal<ViewContainerRef>;
|
|
35
|
-
/** Indicates if the current config is valid or not. If invalid, the save button will be disabled. */
|
|
36
|
-
protected readonly invalidConfig: import("@angular/core").WritableSignal<boolean>;
|
|
37
|
-
protected readonly showNextButton: import("@angular/core").Signal<boolean>;
|
|
38
|
-
protected readonly disableNextButton: import("@angular/core").Signal<boolean>;
|
|
39
|
-
protected readonly showPreviousButton: import("@angular/core").Signal<boolean>;
|
|
40
|
-
protected readonly disablePreviousButton: import("@angular/core").Signal<boolean>;
|
|
41
|
-
protected labelSave: import("@siemens/element-translate-ng/translate").TranslatableString;
|
|
42
|
-
protected labelCancel: import("@siemens/element-translate-ng/translate").TranslatableString;
|
|
43
|
-
protected labelPrevious: import("@siemens/element-translate-ng/translate").TranslatableString;
|
|
44
|
-
protected labelNext: import("@siemens/element-translate-ng/translate").TranslatableString;
|
|
45
|
-
protected labelDialogMessage: import("@siemens/element-translate-ng/translate").TranslatableString;
|
|
46
|
-
protected labelDialogHeading: import("@siemens/element-translate-ng/translate").TranslatableString;
|
|
47
|
-
protected labelDialogSave: import("@siemens/element-translate-ng/translate").TranslatableString;
|
|
48
|
-
protected labelDialogDiscard: import("@siemens/element-translate-ng/translate").TranslatableString;
|
|
49
|
-
protected labelDialogCancel: import("@siemens/element-translate-ng/translate").TranslatableString;
|
|
50
|
-
/**
|
|
51
|
-
* Marks the widget configuration as modified. Is set when widget editor instance
|
|
52
|
-
* emits configChange events. Triggers edit discard confirmation dialog when widget config
|
|
53
|
-
* is modified but not dialog is canceled.
|
|
54
|
-
* */
|
|
55
|
-
private readonly widgetConfigModified;
|
|
56
|
-
private widgetInstanceEditor?;
|
|
57
|
-
private readonly editorWizardState;
|
|
58
|
-
private subscriptions;
|
|
59
|
-
private injector;
|
|
60
|
-
private envInjector;
|
|
61
|
-
private dialogService;
|
|
62
|
-
ngOnInit(): void;
|
|
63
|
-
ngOnDestroy(): void;
|
|
64
|
-
protected onCancel(): void;
|
|
65
|
-
protected onNext(): void;
|
|
66
|
-
protected onPrevious(): void;
|
|
67
|
-
protected onSave(): void;
|
|
68
|
-
private tearDownEditor;
|
|
69
|
-
private isEditorWizdard;
|
|
70
|
-
private handleStatusChanges;
|
|
71
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<SiWidgetInstanceEditorDialogComponent, never>;
|
|
72
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SiWidgetInstanceEditorDialogComponent, "si-widget-instance-editor-dialog", never, { "widgetConfig": { "alias": "widgetConfig"; "required": true; "isSignal": true; }; "widget": { "alias": "widget"; "required": true; "isSignal": true; }; }, { "widgetConfig": "widgetConfigChange"; "closed": "closed"; "editorSetupCompleted": "editorSetupCompleted"; }, never, never, true, never>;
|
|
73
|
-
}
|
package/model/configuration.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Siemens 2016 - 2025
|
|
3
|
-
* SPDX-License-Identifier: MIT
|
|
4
|
-
*/
|
|
5
|
-
import { InjectionToken } from '@angular/core';
|
|
6
|
-
import { GridConfig } from './gridstack.model';
|
|
7
|
-
/**
|
|
8
|
-
* Dashboard configuration object. Inject globally using the {@link SI_DASHBOARD_CONFIGURATION}
|
|
9
|
-
* or configure individual dashboard instances.
|
|
10
|
-
*/
|
|
11
|
-
export type Config = {
|
|
12
|
-
grid?: GridConfig;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Injection token to configure dashboards. Use `{ provide: SI_DASHBOARD_CONFIGURATION, useValue: config }`
|
|
16
|
-
* in your app configuration.
|
|
17
|
-
*/
|
|
18
|
-
export declare const SI_DASHBOARD_CONFIGURATION: InjectionToken<Config>;
|
|
19
|
-
/**
|
|
20
|
-
* @deprecated Use SI_DASHBOARD_CONFIGURATION instead.
|
|
21
|
-
*/
|
|
22
|
-
export declare const CONFIG_TOKEN: InjectionToken<Config>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { GridStackOptions } from 'gridstack';
|
|
2
|
-
/**
|
|
3
|
-
* Configuration object for the si-grid component, including
|
|
4
|
-
* the options of gridstack.
|
|
5
|
-
*/
|
|
6
|
-
export interface GridConfig {
|
|
7
|
-
/**
|
|
8
|
-
* The configuration options of gridstack.
|
|
9
|
-
*/
|
|
10
|
-
gridStackOptions?: GridStackOptions;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* The default gridstack configuration options.
|
|
14
|
-
*/
|
|
15
|
-
export declare const DEFAULT_GRIDSTACK_OPTIONS: GridStackOptions;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Siemens 2016 - 2025
|
|
3
|
-
* SPDX-License-Identifier: MIT
|
|
4
|
-
*/
|
|
5
|
-
import type { NavigationExtras } from '@angular/router';
|
|
6
|
-
import { TranslatableString } from '@siemens/element-translate-ng/translate';
|
|
7
|
-
import { SiGridComponent } from '../components/grid/si-grid.component';
|
|
8
|
-
/** Interface representing an action item in the dashboard toolbar. */
|
|
9
|
-
export interface DashboardToolbarItemAction {
|
|
10
|
-
type: 'action';
|
|
11
|
-
/** Label that is shown to the user. */
|
|
12
|
-
label: TranslatableString;
|
|
13
|
-
/** Action that called when the item is triggered. */
|
|
14
|
-
action: (grid: SiGridComponent) => void;
|
|
15
|
-
}
|
|
16
|
-
/** Interface representing a router link item in the dashboard toolbar. */
|
|
17
|
-
export interface DashboardToolbarItemRouterLink {
|
|
18
|
-
type: 'router-link';
|
|
19
|
-
/** Label that is shown to the user. */
|
|
20
|
-
label: TranslatableString;
|
|
21
|
-
/** Link for the angular router. Accepts the same values as {@link RouterLink}. */
|
|
22
|
-
routerLink: string | any[];
|
|
23
|
-
/** Navigation extras that are passed to the {@link RouterLink}. */
|
|
24
|
-
extras?: NavigationExtras;
|
|
25
|
-
}
|
|
26
|
-
/** Interface representing a link item in the dashboard toolbar. */
|
|
27
|
-
export interface DashboardToolbarItemLink {
|
|
28
|
-
type: 'link';
|
|
29
|
-
/** Label that is shown to the user. */
|
|
30
|
-
label: TranslatableString;
|
|
31
|
-
/** The href property of the anchor. */
|
|
32
|
-
href: string;
|
|
33
|
-
/** The target property of the anchor. */
|
|
34
|
-
target?: string;
|
|
35
|
-
}
|
|
36
|
-
/** Union type for all possible items in the dashboard toolbar. */
|
|
37
|
-
export type DashboardToolbarItem = DashboardToolbarItemAction | DashboardToolbarItemRouterLink | DashboardToolbarItemLink;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Siemens 2016 - 2025
|
|
3
|
-
* SPDX-License-Identifier: MIT
|
|
4
|
-
*/
|
|
5
|
-
import { InjectionToken } from '@angular/core';
|
|
6
|
-
import { MenuItem } from '@siemens/element-ng/common';
|
|
7
|
-
import { Observable } from 'rxjs';
|
|
8
|
-
import { DashboardToolbarItem } from './si-dashboard-toolbar.model';
|
|
9
|
-
import { WidgetConfig } from './widgets.model';
|
|
10
|
-
/**
|
|
11
|
-
* Injection token to configure your widget store implementation. Use
|
|
12
|
-
* `{ provide: SI_WIDGET_STORE, useClass: AppWidgetStorage }` in your app configuration.
|
|
13
|
-
*/
|
|
14
|
-
export declare const SI_WIDGET_STORE: InjectionToken<SiWidgetStorage>;
|
|
15
|
-
/**
|
|
16
|
-
* Widget storage api to provide the persistence layer of the widgets of a dashboard
|
|
17
|
-
* (typically from a web service). The dashboard grid uses this API to load and save
|
|
18
|
-
* the widget configurations. Applications using siemens-dashboard needs to implement
|
|
19
|
-
* this abstract class and provide it in the module configuration.
|
|
20
|
-
*/
|
|
21
|
-
export declare abstract class SiWidgetStorage {
|
|
22
|
-
/**
|
|
23
|
-
* Returns an observable with the dashboard widget configuration. The dashboard subscribes to the
|
|
24
|
-
* observable and updates when a new value emits.
|
|
25
|
-
*/
|
|
26
|
-
abstract load(dashboardId?: string): Observable<WidgetConfig[]>;
|
|
27
|
-
/**
|
|
28
|
-
* Saves the given widget configuration. Existing widgets have a `id`. New widgets have no `id`
|
|
29
|
-
* and it is in the responsibility of the implementor to set the ids of the new widgets. In addition,
|
|
30
|
-
* the implementor needs to check if objects that have been available before are missing. These
|
|
31
|
-
* widgets have been removed by the user. As a result of this method, the observables returned
|
|
32
|
-
* by the `load()` method should emit the new widget config objects, before also returning them.
|
|
33
|
-
* @param widgets - The existing and new widget config objects to be saved.
|
|
34
|
-
*/
|
|
35
|
-
abstract save(widgets: (WidgetConfig | Omit<WidgetConfig, 'id'>)[], removedWidgets?: WidgetConfig[], dashboardId?: string): Observable<WidgetConfig[]>;
|
|
36
|
-
/**
|
|
37
|
-
* Optional method to provide primary and secondary toolbar menu items.
|
|
38
|
-
* @param dashboardId - The id of the dashboard if present to allow dashboard specific menu items.
|
|
39
|
-
*/
|
|
40
|
-
getToolbarMenuItems?: (dashboardId?: string) => {
|
|
41
|
-
primary: Observable<(MenuItem | DashboardToolbarItem)[]>;
|
|
42
|
-
secondary: Observable<(MenuItem | DashboardToolbarItem)[]>;
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* The {@link SiDefaultWidgetStorage} uses this key to persist the dashboard
|
|
47
|
-
* configurations in the session of local storage.
|
|
48
|
-
*/
|
|
49
|
-
export declare const STORAGE_KEY = "dashboard-store";
|
|
50
|
-
/**
|
|
51
|
-
* Injection token to optionally inject the {@link Storage} implementation
|
|
52
|
-
* that will be used by the {@link SiDefaultWidgetStorage}. The default implementation
|
|
53
|
-
* is {@link sessionStorage}.
|
|
54
|
-
*
|
|
55
|
-
* @example
|
|
56
|
-
* The following shows how to provide the localStorage.
|
|
57
|
-
* ```
|
|
58
|
-
* providers: [..., { provide: DEFAULT_WIDGET_STORAGE_TOKEN, useValue: localStorage }]
|
|
59
|
-
* ```
|
|
60
|
-
*
|
|
61
|
-
*/
|
|
62
|
-
export declare const DEFAULT_WIDGET_STORAGE_TOKEN: InjectionToken<Storage>;
|
|
63
|
-
/**
|
|
64
|
-
* Default implementation of {@link SiWidgetStorage} that uses the
|
|
65
|
-
* {@link Storage} implementation provided by the {@link DEFAULT_WIDGET_STORAGE_TOKEN}.
|
|
66
|
-
* In general, it persists the dashboard's configurations in the Browser's session or local
|
|
67
|
-
* storage. *
|
|
68
|
-
*/
|
|
69
|
-
export declare class SiDefaultWidgetStorage extends SiWidgetStorage {
|
|
70
|
-
storage: Storage;
|
|
71
|
-
private map;
|
|
72
|
-
private widgets?;
|
|
73
|
-
constructor();
|
|
74
|
-
load(dashboardId?: string): Observable<WidgetConfig[]>;
|
|
75
|
-
save(widgets: (WidgetConfig | Omit<WidgetConfig, 'id'>)[], removedWidgets?: WidgetConfig[], dashboardId?: string): Observable<WidgetConfig[]>;
|
|
76
|
-
protected update(newConfigs: WidgetConfig[], dashboardId?: string): void;
|
|
77
|
-
protected loadFromStorage(dashboardId?: string): WidgetConfig[];
|
|
78
|
-
}
|