@siemens/dashboards-ng 51.5.0 → 51.6.0
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.
|
@@ -1696,12 +1696,12 @@ class SiGridComponent {
|
|
|
1696
1696
|
* @param editedWidgetConfig - The config of the widget instance that was updated.
|
|
1697
1697
|
*/
|
|
1698
1698
|
updateWidgetInstance(editedWidgetConfig) {
|
|
1699
|
-
const
|
|
1699
|
+
const widgets = this.visibleWidgetInstances$.value;
|
|
1700
|
+
const index = widgets.findIndex(wc => wc.id === editedWidgetConfig.id);
|
|
1700
1701
|
if (index >= 0) {
|
|
1701
|
-
|
|
1702
|
+
const nextWidgets = [...widgets];
|
|
1702
1703
|
nextWidgets[index] = editedWidgetConfig;
|
|
1703
|
-
|
|
1704
|
-
this.visibleWidgetInstances$.next(nextWidgets);
|
|
1704
|
+
this.visibleWidgetInstances$.next(this.updateWidgetPositions(nextWidgets));
|
|
1705
1705
|
setTimeout(() => this.setModified(true), 0);
|
|
1706
1706
|
}
|
|
1707
1707
|
}
|
|
@@ -2162,6 +2162,10 @@ class SiFlexibleDashboardComponent {
|
|
|
2162
2162
|
...(ngDevMode ? [{ debugName: "editable" }] : /* istanbul ignore next */ []));
|
|
2163
2163
|
/**
|
|
2164
2164
|
* Heading for the dashboard.
|
|
2165
|
+
*
|
|
2166
|
+
* To show a custom header instead, e.g. with a description or page actions,
|
|
2167
|
+
* project it using the `header` attribute. The heading is ignored in that case.
|
|
2168
|
+
* While adding or editing widgets, the respective title is shown instead.
|
|
2165
2169
|
*/
|
|
2166
2170
|
heading = input(/* @ts-ignore */
|
|
2167
2171
|
...(ngDevMode ? [undefined, { debugName: "heading" }] : /* istanbul ignore next */ []));
|
|
@@ -2386,19 +2390,18 @@ class SiFlexibleDashboardComponent {
|
|
|
2386
2390
|
...this.secondaryEditActions(),
|
|
2387
2391
|
...this.globalEditActions.secondary
|
|
2388
2392
|
];
|
|
2393
|
+
const storageMenuItems = primaryEditActions.length && secondaryEditActions.length
|
|
2394
|
+
? undefined
|
|
2395
|
+
: this.widgetStorage.getToolbarMenuItems?.(this.dashboardId());
|
|
2389
2396
|
const primaryMenuItems = primaryEditActions.length
|
|
2390
2397
|
? of(primaryEditActions)
|
|
2391
|
-
:
|
|
2392
|
-
? this.widgetStorage.getToolbarMenuItems(this.dashboardId()).primary
|
|
2393
|
-
: of([]);
|
|
2398
|
+
: (storageMenuItems?.primary ?? of([]));
|
|
2394
2399
|
combineLatest([primaryMenuItems, this.hideAddWidgetInstanceButton$])
|
|
2395
2400
|
.pipe(takeUntil(this.dashboardId$))
|
|
2396
2401
|
.subscribe(([items, hideAddButton]) => this.setupPrimaryMenuItems(items, hideAddButton));
|
|
2397
2402
|
const secondaryMenuItems = secondaryEditActions.length
|
|
2398
2403
|
? of(secondaryEditActions)
|
|
2399
|
-
:
|
|
2400
|
-
? this.widgetStorage.getToolbarMenuItems(this.dashboardId()).secondary
|
|
2401
|
-
: undefined;
|
|
2404
|
+
: storageMenuItems?.secondary;
|
|
2402
2405
|
if (secondaryMenuItems) {
|
|
2403
2406
|
secondaryMenuItems
|
|
2404
2407
|
.pipe(takeUntil(this.dashboardId$))
|
|
@@ -2439,11 +2442,18 @@ class SiFlexibleDashboardComponent {
|
|
|
2439
2442
|
return this.widgetCatalog().find(widget => widget.id === id);
|
|
2440
2443
|
}
|
|
2441
2444
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiFlexibleDashboardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2442
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
2445
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: SiFlexibleDashboardComponent, isStandalone: true, selector: "si-flexible-dashboard", inputs: { editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null }, heading: { classPropertyName: "heading", publicName: "heading", isSignal: true, isRequired: false, transformFunction: null }, widgetCatalogComponent: { classPropertyName: "widgetCatalogComponent", publicName: "widgetCatalogComponent", isSignal: true, isRequired: false, transformFunction: null }, widgetInstanceEditorDialogComponent: { classPropertyName: "widgetInstanceEditorDialogComponent", publicName: "widgetInstanceEditorDialogComponent", isSignal: true, isRequired: false, transformFunction: null }, dashboardId: { classPropertyName: "dashboardId", publicName: "dashboardId", isSignal: true, isRequired: false, transformFunction: null }, widgetCatalog: { classPropertyName: "widgetCatalog", publicName: "widgetCatalog", isSignal: true, isRequired: false, transformFunction: null }, hideAddWidgetInstanceButton: { classPropertyName: "hideAddWidgetInstanceButton", publicName: "hideAddWidgetInstanceButton", isSignal: true, isRequired: false, transformFunction: null }, hideEditButton: { classPropertyName: "hideEditButton", publicName: "hideEditButton", isSignal: true, isRequired: false, transformFunction: null }, showEditButtonLabel: { classPropertyName: "showEditButtonLabel", publicName: "showEditButtonLabel", isSignal: true, isRequired: false, transformFunction: null }, hideProgressIndicator: { classPropertyName: "hideProgressIndicator", publicName: "hideProgressIndicator", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, primaryEditActions: { classPropertyName: "primaryEditActions", publicName: "primaryEditActions", isSignal: true, isRequired: false, transformFunction: null }, secondaryEditActions: { classPropertyName: "secondaryEditActions", publicName: "secondaryEditActions", isSignal: true, isRequired: false, transformFunction: null }, multiSelect: { classPropertyName: "multiSelect", publicName: "multiSelect", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { editable: "editableChange", isModified: "isModified" }, viewQueries: [{ propertyName: "grid", first: true, predicate: ["grid"], descendants: true, isSignal: true }, { propertyName: "dashboard", first: true, predicate: ["dashboard"], descendants: true, isSignal: true }, { propertyName: "catalogHost", first: true, predicate: ["catalogHost"], descendants: true, read: ViewContainerRef, isSignal: true }, { propertyName: "toolbar", first: true, predicate: ["toolbar"], descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "<si-dashboard #dashboard [sticky]=\"true\">\n <!--\n Do not replace the default title below with [heading]=\"pageTitle()\" on si-dashboard.\n Forwarding the header slot always fills it, even if no custom header is supplied. Angular then\n never renders the heading fallback of si-dashboard, so the default title is rendered here.\n -->\n <ng-container header>\n @if (isDashboardVisible()) {\n <ng-content select=\"[header]\">\n <ng-container *ngTemplateOutlet=\"pageHeader\" />\n </ng-content>\n } @else {\n <ng-container *ngTemplateOutlet=\"pageHeader\" />\n }\n </ng-container>\n <si-dashboard-toolbar\n #toolbar\n menubar\n [class.d-none]=\"!isDashboardVisible()\"\n [primaryEditActions]=\"(primaryEditActions$ | async) ?? []\"\n [secondaryEditActions]=\"(secondaryEditActions$ | async) ?? []\"\n [disabled]=\"(grid.isLoading | async) ?? false\"\n [hideEditButton]=\"hideEditButton()\"\n [showEditButtonLabel]=\"showEditButtonLabel()\"\n [grid]=\"grid\"\n [(editable)]=\"editable\"\n (save)=\"grid.save()\"\n >\n <ng-content select=\"[filters-slot]\" filters-slot />\n </si-dashboard-toolbar>\n\n <div dashboard class=\"d-contents\">\n <si-grid\n #grid\n [class.d-none]=\"!isDashboardVisible()\"\n [gridConfig]=\"config()?.grid\"\n [dashboardId]=\"dashboardId()\"\n [widgetCatalog]=\"widgetCatalog()\"\n [hideProgressIndicator]=\"hideProgressIndicator()\"\n [widgetInstanceEditorDialogComponent]=\"widgetInstanceEditorDialogComponent()\"\n [emitWidgetInstanceEditEvents]=\"true\"\n [(editable)]=\"editable\"\n (isModified)=\"onModified($event)\"\n (widgetInstanceEdit)=\"editWidgetInstance($event)\"\n >\n <ng-content select=\"[empty-state]\" empty-state />\n </si-grid>\n <ng-container #catalogHost />\n </div>\n</si-dashboard>\n\n<ng-template #pageHeader>\n @if (pageTitle()) {\n <div class=\"si-layout-header\">\n <h2 class=\"si-layout-title si-layout-top-element\">{{ pageTitle() | translate }}</h2>\n </div>\n }\n</ng-template>\n", styles: [":host{display:flex;flex:1 1 0;flex-direction:column}\n"], dependencies: [{ kind: "component", type: SiDashboardComponent, selector: "si-dashboard", inputs: ["heading", "enableExpandInteractions", "sticky", "hideMenubar"] }, { kind: "component", type: SiDashboardToolbarComponent, selector: "si-dashboard-toolbar", inputs: ["primaryEditActions", "secondaryEditActions", "disableSaveButton", "disabled", "editable", "hideEditButton", "showEditButtonLabel", "grid"], outputs: ["disableSaveButtonChange", "editableChange", "save"] }, { kind: "component", type: SiGridComponent, selector: "si-grid", inputs: ["gridConfig", "editable", "dashboardId", "widgetCatalog", "emitWidgetInstanceEditEvents", "hideProgressIndicator", "widgetInstanceEditorDialogComponent"], outputs: ["editableChange", "isModified", "widgetInstanceEdit"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
2443
2446
|
}
|
|
2444
2447
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiFlexibleDashboardComponent, decorators: [{
|
|
2445
2448
|
type: Component,
|
|
2446
|
-
args: [{ selector: 'si-flexible-dashboard', imports: [
|
|
2449
|
+
args: [{ selector: 'si-flexible-dashboard', imports: [
|
|
2450
|
+
SiDashboardComponent,
|
|
2451
|
+
SiDashboardToolbarComponent,
|
|
2452
|
+
SiGridComponent,
|
|
2453
|
+
AsyncPipe,
|
|
2454
|
+
NgTemplateOutlet,
|
|
2455
|
+
SiTranslatePipe
|
|
2456
|
+
], changeDetection: ChangeDetectionStrategy.Eager, template: "<si-dashboard #dashboard [sticky]=\"true\">\n <!--\n Do not replace the default title below with [heading]=\"pageTitle()\" on si-dashboard.\n Forwarding the header slot always fills it, even if no custom header is supplied. Angular then\n never renders the heading fallback of si-dashboard, so the default title is rendered here.\n -->\n <ng-container header>\n @if (isDashboardVisible()) {\n <ng-content select=\"[header]\">\n <ng-container *ngTemplateOutlet=\"pageHeader\" />\n </ng-content>\n } @else {\n <ng-container *ngTemplateOutlet=\"pageHeader\" />\n }\n </ng-container>\n <si-dashboard-toolbar\n #toolbar\n menubar\n [class.d-none]=\"!isDashboardVisible()\"\n [primaryEditActions]=\"(primaryEditActions$ | async) ?? []\"\n [secondaryEditActions]=\"(secondaryEditActions$ | async) ?? []\"\n [disabled]=\"(grid.isLoading | async) ?? false\"\n [hideEditButton]=\"hideEditButton()\"\n [showEditButtonLabel]=\"showEditButtonLabel()\"\n [grid]=\"grid\"\n [(editable)]=\"editable\"\n (save)=\"grid.save()\"\n >\n <ng-content select=\"[filters-slot]\" filters-slot />\n </si-dashboard-toolbar>\n\n <div dashboard class=\"d-contents\">\n <si-grid\n #grid\n [class.d-none]=\"!isDashboardVisible()\"\n [gridConfig]=\"config()?.grid\"\n [dashboardId]=\"dashboardId()\"\n [widgetCatalog]=\"widgetCatalog()\"\n [hideProgressIndicator]=\"hideProgressIndicator()\"\n [widgetInstanceEditorDialogComponent]=\"widgetInstanceEditorDialogComponent()\"\n [emitWidgetInstanceEditEvents]=\"true\"\n [(editable)]=\"editable\"\n (isModified)=\"onModified($event)\"\n (widgetInstanceEdit)=\"editWidgetInstance($event)\"\n >\n <ng-content select=\"[empty-state]\" empty-state />\n </si-grid>\n <ng-container #catalogHost />\n </div>\n</si-dashboard>\n\n<ng-template #pageHeader>\n @if (pageTitle()) {\n <div class=\"si-layout-header\">\n <h2 class=\"si-layout-title si-layout-top-element\">{{ pageTitle() | translate }}</h2>\n </div>\n }\n</ng-template>\n", styles: [":host{display:flex;flex:1 1 0;flex-direction:column}\n"] }]
|
|
2447
2457
|
}], propDecorators: { editable: [{ type: i0.Input, args: [{ isSignal: true, alias: "editable", required: false }] }, { type: i0.Output, args: ["editableChange"] }], heading: [{ type: i0.Input, args: [{ isSignal: true, alias: "heading", required: false }] }], widgetCatalogComponent: [{ type: i0.Input, args: [{ isSignal: true, alias: "widgetCatalogComponent", required: false }] }], widgetInstanceEditorDialogComponent: [{ type: i0.Input, args: [{ isSignal: true, alias: "widgetInstanceEditorDialogComponent", required: false }] }], dashboardId: [{ type: i0.Input, args: [{ isSignal: true, alias: "dashboardId", required: false }] }], widgetCatalog: [{ type: i0.Input, args: [{ isSignal: true, alias: "widgetCatalog", required: false }] }], hideAddWidgetInstanceButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideAddWidgetInstanceButton", required: false }] }], hideEditButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideEditButton", required: false }] }], showEditButtonLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "showEditButtonLabel", required: false }] }], hideProgressIndicator: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideProgressIndicator", required: false }] }], config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], primaryEditActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "primaryEditActions", required: false }] }], secondaryEditActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryEditActions", required: false }] }], multiSelect: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiSelect", required: false }] }], grid: [{ type: i0.ViewChild, args: ['grid', { isSignal: true }] }], dashboard: [{ type: i0.ViewChild, args: ['dashboard', { isSignal: true }] }], catalogHost: [{ type: i0.ViewChild, args: ['catalogHost', { ...{ read: ViewContainerRef }, isSignal: true }] }], isModified: [{ type: i0.Output, args: ["isModified"] }], toolbar: [{ type: i0.ViewChild, args: ['toolbar', { isSignal: true }] }] } });
|
|
2448
2458
|
|
|
2449
2459
|
/**
|