@siemens/dashboards-ng 49.6.0 → 49.8.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.
- package/fesm2022/siemens-dashboards-ng-module-federation.mjs +5 -0
- package/fesm2022/siemens-dashboards-ng-module-federation.mjs.map +1 -1
- package/fesm2022/siemens-dashboards-ng-native-federation-mf-bridge.mjs +5 -0
- package/fesm2022/siemens-dashboards-ng-native-federation-mf-bridge.mjs.map +1 -1
- package/fesm2022/siemens-dashboards-ng-native-federation.mjs +5 -0
- package/fesm2022/siemens-dashboards-ng-native-federation.mjs.map +1 -1
- package/fesm2022/siemens-dashboards-ng.mjs +193 -267
- package/fesm2022/siemens-dashboards-ng.mjs.map +1 -1
- package/package.json +5 -4
- package/types/siemens-dashboards-ng.d.ts +51 -55
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { NgTemplateOutlet, AsyncPipe } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { InjectionToken, inject, input, model, output, viewChild, computed, Component, Injectable,
|
|
3
|
+
import { InjectionToken, inject, input, model, output, viewChild, computed, Component, Injectable, ElementRef, Renderer2, DOCUMENT, Directive, EventEmitter, createNgModule, Injector, EnvironmentInjector, DestroyRef, ViewContainerRef, isSignal, signal, NgZone, IterableDiffers, inputBinding, outputBinding, NgModule } from '@angular/core';
|
|
4
4
|
import { SiDashboardCardComponent, SiDashboardComponent } from '@siemens/element-ng/dashboard';
|
|
5
|
-
import { t, SiTranslatePipe } from '@siemens/element-translate-ng/translate';
|
|
5
|
+
import { t, SiTranslatePipe, injectSiTranslateService } from '@siemens/element-translate-ng/translate';
|
|
6
6
|
import { BehaviorSubject, of, Subject, throwError, ReplaySubject, combineLatest } from 'rxjs';
|
|
7
7
|
import { take, takeUntil } from 'rxjs/operators';
|
|
8
8
|
import { BOOTSTRAP_BREAKPOINTS, SiResponsiveContainerDirective } from '@siemens/element-ng/resize-observer';
|
|
@@ -222,11 +222,6 @@ class SiDashboardToolbarComponent {
|
|
|
222
222
|
* Emits on save button click.
|
|
223
223
|
*/
|
|
224
224
|
save = output();
|
|
225
|
-
/**
|
|
226
|
-
* Emits on cancel button click.
|
|
227
|
-
*/
|
|
228
|
-
// eslint-disable-next-line @angular-eslint/no-output-native
|
|
229
|
-
cancel = output();
|
|
230
225
|
labelEdit = t(() => $localize `:@@DASHBOARD.EDIT:Edit`);
|
|
231
226
|
labelCancel = t(() => $localize `:@@DASHBOARD.CANCEL:Cancel`);
|
|
232
227
|
labelSave = t(() => $localize `:@@DASHBOARD.SAVE:Save`);
|
|
@@ -253,7 +248,7 @@ class SiDashboardToolbarComponent {
|
|
|
253
248
|
}
|
|
254
249
|
onCancel() {
|
|
255
250
|
if (this.editable()) {
|
|
256
|
-
this.
|
|
251
|
+
this.editable.set(false);
|
|
257
252
|
}
|
|
258
253
|
}
|
|
259
254
|
isToolbarItem(item) {
|
|
@@ -269,7 +264,7 @@ class SiDashboardToolbarComponent {
|
|
|
269
264
|
return item;
|
|
270
265
|
}
|
|
271
266
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiDashboardToolbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
272
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: SiDashboardToolbarComponent, isStandalone: true, selector: "si-dashboard-toolbar", inputs: { primaryEditActions: { classPropertyName: "primaryEditActions", publicName: "primaryEditActions", isSignal: true, isRequired: false, transformFunction: null }, secondaryEditActions: { classPropertyName: "secondaryEditActions", publicName: "secondaryEditActions", isSignal: true, isRequired: false, transformFunction: null }, disableSaveButton: { classPropertyName: "disableSaveButton", publicName: "disableSaveButton", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", 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 }, grid: { classPropertyName: "grid", publicName: "grid", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { disableSaveButton: "disableSaveButtonChange", editable: "editableChange", save: "save"
|
|
267
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: SiDashboardToolbarComponent, isStandalone: true, selector: "si-dashboard-toolbar", inputs: { primaryEditActions: { classPropertyName: "primaryEditActions", publicName: "primaryEditActions", isSignal: true, isRequired: false, transformFunction: null }, secondaryEditActions: { classPropertyName: "secondaryEditActions", publicName: "secondaryEditActions", isSignal: true, isRequired: false, transformFunction: null }, disableSaveButton: { classPropertyName: "disableSaveButton", publicName: "disableSaveButton", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", 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 }, grid: { classPropertyName: "grid", publicName: "grid", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { disableSaveButton: "disableSaveButtonChange", editable: "editableChange", save: "save" }, host: { classAttribute: "d-flex flex-column flex-grow-1" }, viewQueries: [{ propertyName: "dashboardToolbarContainer", first: true, predicate: SiResponsiveContainerDirective, descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"row mb-3\" siResponsiveContainer>\n <div class=\"col-12 d-flex justify-content-between\">\n @if (!editable()) {\n <ng-content select=\"[filters-slot]\" />\n @if (!hideEditButton()) {\n @let showEditButtonLabelDesktop = this.showEditButtonLabelDesktop();\n <button\n type=\"button\"\n class=\"btn ms-auto\"\n [class]=\"\n showEditButtonLabelDesktop ? 'btn-secondary' : 'btn-icon btn-tertiary element-edit'\n \"\n [attr.aria-label]=\"labelEdit | translate\"\n [siTooltip]=\"labelEdit\"\n [isDisabled]=\"showEditButtonLabelDesktop\"\n [disabled]=\"disabled()\"\n (click)=\"onEdit()\"\n >\n @if (showEditButtonLabelDesktop) {\n {{ labelEdit | translate }}\n }\n </button>\n }\n } @else {\n @if (showContentActionBar()) {\n <si-content-action-bar\n toggleItemLabel=\"toggle\"\n viewType=\"expanded\"\n [disabled]=\"disabled()\"\n [primaryActions]=\"primaryEditActionsComputed()\"\n [secondaryActions]=\"secondaryEditActionsComputed()\"\n />\n } @else {\n <div>\n @for (action of editActions(); track $index) {\n @if (isToolbarItem(action)) {\n @if (disabled()) {\n <!-- Links do not support disabled, so we need to render a button instead in this case. -->\n <button type=\"button\" class=\"btn btn-secondary me-4\" disabled>\n {{ action.label! | translate }}\n </button>\n } @else {\n @switch (action.type) {\n @case ('action') {\n <button\n type=\"button\"\n class=\"btn btn-secondary me-4\"\n (click)=\"action.action(grid())\"\n >\n {{ action.label! | translate }}\n </button>\n }\n @case ('router-link') {\n <a\n class=\"btn btn-secondary me-4\"\n [routerLink]=\"action.routerLink\"\n [queryParams]=\"action.extras?.queryParams\"\n [queryParamsHandling]=\"action.extras?.queryParamsHandling\"\n [fragment]=\"action.extras?.fragment\"\n [state]=\"action.extras?.state\"\n [relativeTo]=\"action.extras?.relativeTo ?? activatedRoute\"\n [preserveFragment]=\"action.extras?.preserveFragment\"\n [skipLocationChange]=\"action.extras?.skipLocationChange\"\n [replaceUrl]=\"action.extras?.replaceUrl\"\n >\n {{ action.label! | translate }}\n </a>\n }\n @case ('link') {\n <a class=\"btn btn-secondary me-4\" [href]=\"action.href\" [target]=\"action.target\">\n {{ action.label! | translate }}\n </a>\n }\n }\n }\n } @else {\n <button\n type=\"button\"\n class=\"btn btn-secondary me-4\"\n [disabled]=\"disabled()\"\n [siLink]=\"action\"\n >\n {{ action.title! | translate }}\n </button>\n }\n }\n </div>\n }\n <div>\n <button\n type=\"button\"\n class=\"btn btn-secondary me-4\"\n [disabled]=\"disabled()\"\n (click)=\"onCancel()\"\n >\n {{ labelCancel | translate }}\n </button>\n <si-loading-button\n class=\"align-top\"\n buttonClass=\"btn btn-primary\"\n [disabled]=\"disableSaveButton()\"\n [loading]=\"disabled()\"\n (click)=\"onSave()\"\n >\n {{ labelSave | translate }}\n </si-loading-button>\n </div>\n }\n </div>\n</div>\n", dependencies: [{ kind: "component", type: SiContentActionBarComponent, selector: "si-content-action-bar", inputs: ["primaryActions", "secondaryActions", "actionParam", "viewType", "toggleItemLabel", "preventIconsInDropdownMenus", "disabled"] }, { kind: "directive", type: SiLinkDirective, selector: "[siLink]", inputs: ["siLink", "siLinkDefaultTarget", "actionParam", "activeClass", "exactMatch", "ariaCurrent"], outputs: ["activeChange"], exportAs: ["siLink"] }, { kind: "component", type: SiLoadingButtonComponent, selector: "si-loading-button", inputs: ["disabled", "loading", "type", "ariaLabel", "ariaLabelledBy", "buttonClass"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: SiResponsiveContainerDirective, selector: "[siResponsiveContainer]", inputs: ["resizeThrottle", "breakpoints"], exportAs: ["siResponsiveContainer"] }, { kind: "directive", type: SiTooltipDirective, selector: "[siTooltip]", inputs: ["siTooltip", "placement", "isDisabled", "tooltipScrollStrategy", "tooltipContext"] }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }] });
|
|
273
268
|
}
|
|
274
269
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiDashboardToolbarComponent, decorators: [{
|
|
275
270
|
type: Component,
|
|
@@ -284,7 +279,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
284
279
|
], host: {
|
|
285
280
|
class: 'd-flex flex-column flex-grow-1'
|
|
286
281
|
}, template: "<div class=\"row mb-3\" siResponsiveContainer>\n <div class=\"col-12 d-flex justify-content-between\">\n @if (!editable()) {\n <ng-content select=\"[filters-slot]\" />\n @if (!hideEditButton()) {\n @let showEditButtonLabelDesktop = this.showEditButtonLabelDesktop();\n <button\n type=\"button\"\n class=\"btn ms-auto\"\n [class]=\"\n showEditButtonLabelDesktop ? 'btn-secondary' : 'btn-icon btn-tertiary element-edit'\n \"\n [attr.aria-label]=\"labelEdit | translate\"\n [siTooltip]=\"labelEdit\"\n [isDisabled]=\"showEditButtonLabelDesktop\"\n [disabled]=\"disabled()\"\n (click)=\"onEdit()\"\n >\n @if (showEditButtonLabelDesktop) {\n {{ labelEdit | translate }}\n }\n </button>\n }\n } @else {\n @if (showContentActionBar()) {\n <si-content-action-bar\n toggleItemLabel=\"toggle\"\n viewType=\"expanded\"\n [disabled]=\"disabled()\"\n [primaryActions]=\"primaryEditActionsComputed()\"\n [secondaryActions]=\"secondaryEditActionsComputed()\"\n />\n } @else {\n <div>\n @for (action of editActions(); track $index) {\n @if (isToolbarItem(action)) {\n @if (disabled()) {\n <!-- Links do not support disabled, so we need to render a button instead in this case. -->\n <button type=\"button\" class=\"btn btn-secondary me-4\" disabled>\n {{ action.label! | translate }}\n </button>\n } @else {\n @switch (action.type) {\n @case ('action') {\n <button\n type=\"button\"\n class=\"btn btn-secondary me-4\"\n (click)=\"action.action(grid())\"\n >\n {{ action.label! | translate }}\n </button>\n }\n @case ('router-link') {\n <a\n class=\"btn btn-secondary me-4\"\n [routerLink]=\"action.routerLink\"\n [queryParams]=\"action.extras?.queryParams\"\n [queryParamsHandling]=\"action.extras?.queryParamsHandling\"\n [fragment]=\"action.extras?.fragment\"\n [state]=\"action.extras?.state\"\n [relativeTo]=\"action.extras?.relativeTo ?? activatedRoute\"\n [preserveFragment]=\"action.extras?.preserveFragment\"\n [skipLocationChange]=\"action.extras?.skipLocationChange\"\n [replaceUrl]=\"action.extras?.replaceUrl\"\n >\n {{ action.label! | translate }}\n </a>\n }\n @case ('link') {\n <a class=\"btn btn-secondary me-4\" [href]=\"action.href\" [target]=\"action.target\">\n {{ action.label! | translate }}\n </a>\n }\n }\n }\n } @else {\n <button\n type=\"button\"\n class=\"btn btn-secondary me-4\"\n [disabled]=\"disabled()\"\n [siLink]=\"action\"\n >\n {{ action.title! | translate }}\n </button>\n }\n }\n </div>\n }\n <div>\n <button\n type=\"button\"\n class=\"btn btn-secondary me-4\"\n [disabled]=\"disabled()\"\n (click)=\"onCancel()\"\n >\n {{ labelCancel | translate }}\n </button>\n <si-loading-button\n class=\"align-top\"\n buttonClass=\"btn btn-primary\"\n [disabled]=\"disableSaveButton()\"\n [loading]=\"disabled()\"\n (click)=\"onSave()\"\n >\n {{ labelSave | translate }}\n </si-loading-button>\n </div>\n }\n </div>\n</div>\n" }]
|
|
287
|
-
}], propDecorators: { primaryEditActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "primaryEditActions", required: false }] }], secondaryEditActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryEditActions", required: false }] }], disableSaveButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableSaveButton", required: false }] }, { type: i0.Output, args: ["disableSaveButtonChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], editable: [{ type: i0.Input, args: [{ isSignal: true, alias: "editable", required: false }] }, { type: i0.Output, args: ["editableChange"] }], hideEditButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideEditButton", required: false }] }], showEditButtonLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "showEditButtonLabel", required: false }] }], grid: [{ type: i0.Input, args: [{ isSignal: true, alias: "grid", required: true }] }], save: [{ type: i0.Output, args: ["save"] }],
|
|
282
|
+
}], propDecorators: { primaryEditActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "primaryEditActions", required: false }] }], secondaryEditActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryEditActions", required: false }] }], disableSaveButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableSaveButton", required: false }] }, { type: i0.Output, args: ["disableSaveButtonChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], editable: [{ type: i0.Input, args: [{ isSignal: true, alias: "editable", required: false }] }, { type: i0.Output, args: ["editableChange"] }], hideEditButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideEditButton", required: false }] }], showEditButtonLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "showEditButtonLabel", required: false }] }], grid: [{ type: i0.Input, args: [{ isSignal: true, alias: "grid", required: true }] }], save: [{ type: i0.Output, args: ["save"] }], dashboardToolbarContainer: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SiResponsiveContainerDirective), { isSignal: true }] }] } });
|
|
288
283
|
|
|
289
284
|
/**
|
|
290
285
|
* Copyright (c) Siemens 2016 - 2026
|
|
@@ -334,31 +329,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
334
329
|
args: [{ providedIn: 'root' }]
|
|
335
330
|
}] });
|
|
336
331
|
|
|
337
|
-
/**
|
|
338
|
-
* Copyright (c) Siemens 2016 - 2026
|
|
339
|
-
* SPDX-License-Identifier: MIT
|
|
340
|
-
*/
|
|
341
|
-
class SiGridService {
|
|
342
|
-
/** @defaultValue [] */
|
|
343
|
-
widgetCatalog = signal([], ...(ngDevMode ? [{ debugName: "widgetCatalog" }] : []));
|
|
344
|
-
widgetCatalogMap = computed(() => new Map(this.widgetCatalog().map(widget => [widget.id, widget])), ...(ngDevMode ? [{ debugName: "widgetCatalogMap" }] : []));
|
|
345
|
-
/**
|
|
346
|
-
* Observable that emits true if si-grid is set to editable.
|
|
347
|
-
* The owner of the editable state is the si-grid component.
|
|
348
|
-
* This subject is used to propagate these state changes via
|
|
349
|
-
* the si-widget-host components to the widgets.
|
|
350
|
-
*/
|
|
351
|
-
editable$ = new BehaviorSubject(false);
|
|
352
|
-
getWidget(id) {
|
|
353
|
-
return this.widgetCatalogMap().get(id);
|
|
354
|
-
}
|
|
355
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiGridService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
356
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiGridService });
|
|
357
|
-
}
|
|
358
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiGridService, decorators: [{
|
|
359
|
-
type: Injectable
|
|
360
|
-
}] });
|
|
361
|
-
|
|
362
332
|
/**
|
|
363
333
|
* Copyright (c) Siemens 2016 - 2026
|
|
364
334
|
* SPDX-License-Identifier: MIT
|
|
@@ -604,11 +574,20 @@ const loadAndAttachWebComponentWrapper = (factory, componentName, host) => {
|
|
|
604
574
|
*/
|
|
605
575
|
class SiWidgetHostComponent {
|
|
606
576
|
siModal = inject(SiActionDialogService);
|
|
607
|
-
gridService = inject(SiGridService);
|
|
608
577
|
injector = inject(Injector);
|
|
609
578
|
envInjector = inject(EnvironmentInjector);
|
|
610
579
|
destroyRef = inject(DestroyRef);
|
|
611
580
|
widgetConfig = input.required(...(ngDevMode ? [{ debugName: "widgetConfig" }] : []));
|
|
581
|
+
/**
|
|
582
|
+
* The component factory for this widget's type.
|
|
583
|
+
*/
|
|
584
|
+
componentFactory = input(...(ngDevMode ? [undefined, { debugName: "componentFactory" }] : []));
|
|
585
|
+
/**
|
|
586
|
+
* Sets the widget host into editable mode.
|
|
587
|
+
*
|
|
588
|
+
* @defaultValue false
|
|
589
|
+
*/
|
|
590
|
+
editable = input(false, ...(ngDevMode ? [{ debugName: "editable" }] : []));
|
|
612
591
|
remove = output();
|
|
613
592
|
edit = output();
|
|
614
593
|
card = viewChild.required('card');
|
|
@@ -629,7 +608,6 @@ class SiWidgetHostComponent {
|
|
|
629
608
|
secondaryActions = [];
|
|
630
609
|
/** @defaultValue 'expanded' */
|
|
631
610
|
actionBarViewType = 'expanded';
|
|
632
|
-
editable$ = this.gridService.editable$;
|
|
633
611
|
/** @defaultValue [] */
|
|
634
612
|
editablePrimaryActions = [];
|
|
635
613
|
/** @defaultValue [] */
|
|
@@ -673,10 +651,10 @@ class SiWidgetHostComponent {
|
|
|
673
651
|
action: () => this.onRemove()
|
|
674
652
|
};
|
|
675
653
|
widgetInstanceFooter;
|
|
676
|
-
|
|
677
|
-
const
|
|
678
|
-
return
|
|
679
|
-
}
|
|
654
|
+
accentLine = computed(() => {
|
|
655
|
+
const { accentLine } = this.widgetConfig();
|
|
656
|
+
return accentLine ? 'accent-' + accentLine : '';
|
|
657
|
+
}, ...(ngDevMode ? [{ debugName: "accentLine" }] : []));
|
|
680
658
|
ngOnChanges(changes) {
|
|
681
659
|
if (changes.widgetConfig) {
|
|
682
660
|
if (this.widgetRef) {
|
|
@@ -688,17 +666,17 @@ class SiWidgetHostComponent {
|
|
|
688
666
|
}
|
|
689
667
|
}
|
|
690
668
|
}
|
|
669
|
+
if (changes.editable && !changes.editable.firstChange) {
|
|
670
|
+
this.setupEditable(this.editable());
|
|
671
|
+
}
|
|
691
672
|
}
|
|
692
673
|
ngOnInit() {
|
|
693
674
|
this.attachWidgetInstance();
|
|
694
|
-
this.editable$
|
|
695
|
-
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
696
|
-
.subscribe(editable => this.setupEditable(editable));
|
|
697
675
|
}
|
|
698
676
|
attachWidgetInstance() {
|
|
699
|
-
const
|
|
700
|
-
if (
|
|
701
|
-
setupWidgetInstance(
|
|
677
|
+
const componentFactory = this.componentFactory();
|
|
678
|
+
if (componentFactory) {
|
|
679
|
+
setupWidgetInstance(componentFactory, this.widgetHost(), this.injector, this.envInjector).subscribe({
|
|
702
680
|
next: (widgetRef) => {
|
|
703
681
|
this.widgetInstance = widgetRef.instance;
|
|
704
682
|
this.widgetRef = widgetRef;
|
|
@@ -708,7 +686,7 @@ class SiWidgetHostComponent {
|
|
|
708
686
|
// to the DOM.
|
|
709
687
|
this.widgetInstance.configChange
|
|
710
688
|
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
711
|
-
.subscribe(event => setTimeout(() => this.setupEditable(this.editable
|
|
689
|
+
.subscribe(event => setTimeout(() => this.setupEditable(this.editable(), event)));
|
|
712
690
|
}
|
|
713
691
|
if (isSignal(this.widgetInstance.config)) {
|
|
714
692
|
this.widgetRef.setInput('config', this.widgetConfig());
|
|
@@ -717,7 +695,7 @@ class SiWidgetHostComponent {
|
|
|
717
695
|
this.widgetInstance.config = this.widgetConfig();
|
|
718
696
|
}
|
|
719
697
|
this.widgetInstanceFooter = this.widgetInstance.footer;
|
|
720
|
-
this.setupEditable(this.
|
|
698
|
+
this.setupEditable(this.editable());
|
|
721
699
|
},
|
|
722
700
|
error: error => console.error('Error: ', error)
|
|
723
701
|
});
|
|
@@ -784,8 +762,7 @@ class SiWidgetHostComponent {
|
|
|
784
762
|
}
|
|
785
763
|
isEditable() {
|
|
786
764
|
const widgetConfig = this.widgetConfig();
|
|
787
|
-
return
|
|
788
|
-
!!this.gridService.getWidget(widgetConfig.widgetId)?.componentFactory?.editorComponentName);
|
|
765
|
+
return !widgetConfig.immutable && !!this.componentFactory()?.editorComponentName;
|
|
789
766
|
}
|
|
790
767
|
onEdit() {
|
|
791
768
|
this.edit.emit(this.widgetConfig());
|
|
@@ -806,14 +783,14 @@ class SiWidgetHostComponent {
|
|
|
806
783
|
});
|
|
807
784
|
}
|
|
808
785
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiWidgetHostComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
809
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: SiWidgetHostComponent, isStandalone: true, selector: "si-widget-host", inputs: { widgetConfig: { classPropertyName: "widgetConfig", publicName: "widgetConfig", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { remove: "remove", edit: "edit" }, host: { classAttribute: "grid-stack-item" }, viewQueries: [{ propertyName: "card", first: true, predicate: ["card"], descendants: true, isSignal: true }, { propertyName: "widgetHost", first: true, predicate: ["widgetHost"], descendants: true, read: ViewContainerRef, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"grid-stack-item-content p-4\">\n @if (editable
|
|
786
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: SiWidgetHostComponent, isStandalone: true, selector: "si-widget-host", inputs: { widgetConfig: { classPropertyName: "widgetConfig", publicName: "widgetConfig", isSignal: true, isRequired: true, transformFunction: null }, componentFactory: { classPropertyName: "componentFactory", publicName: "componentFactory", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { remove: "remove", edit: "edit" }, host: { classAttribute: "grid-stack-item" }, viewQueries: [{ propertyName: "card", first: true, predicate: ["card"], descendants: true, isSignal: true }, { propertyName: "widgetHost", first: true, predicate: ["widgetHost"], descendants: true, read: ViewContainerRef, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"grid-stack-item-content p-4\">\n @if (editable()) {\n <div class=\"resize-handle\">\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <g>\n <path d=\"M16 16H18V18H16V16Z\" fill=\"currentColor\" />\n <path d=\"M11 16H13V18H11V16Z\" fill=\"currentColor\" />\n <path d=\"M11 11H13V13H11V11Z\" fill=\"currentColor\" />\n <path d=\"M6 16H8V18H6V16Z\" fill=\"currentColor\" />\n <path d=\"M16 11H18V13H16V11Z\" fill=\"currentColor\" />\n <path d=\"M16 6H18V8H16V6Z\" fill=\"currentColor\" />\n </g>\n </svg>\n </div>\n <div class=\"draggable-overlay\"></div>\n }\n <si-dashboard-card\n #card\n class=\"h-100 dragging-card\"\n [class]=\"accentLine()\"\n [expandText]=\"labelExpand\"\n [restoreText]=\"labelRestore\"\n [heading]=\"widgetConfig().heading\"\n [primaryActions]=\"primaryActions\"\n [secondaryActions]=\"secondaryActions\"\n [actionBarViewType]=\"actionBarViewType\"\n [enableExpandInteraction]=\"widgetConfig().expandable\"\n [imgAlt]=\"widgetConfig().image?.alt\"\n [imgDir]=\"widgetConfig().image?.dir\"\n [imgObjectFit]=\"widgetConfig().image?.objectFit\"\n [imgObjectPosition]=\"widgetConfig().image?.objectPosition\"\n [imgSrc]=\"widgetConfig().image?.src\"\n >\n <div class=\"card-body overflow-auto\" body>\n <ng-container #widgetHost />\n </div>\n\n @if (widgetInstanceFooter) {\n <div class=\"card-footer\" footer>\n <ng-container *ngTemplateOutlet=\"widgetInstanceFooter\" />\n </div>\n }\n </si-dashboard-card>\n</div>\n", styles: [":host{display:flex}::ng-deep body:not(:has(.ui-draggable-dragging)) .draggable-overlay{cursor:grab}::ng-deep si-content-action-bar{z-index:500}::ng-deep .ui-droppable.ui-droppable-over>*:not(.ui-droppable){cursor:move!important;pointer-events:inherit!important}::ng-deep .ui-draggable-dragging .dragging-card,::ng-deep .ui-resizable-resizing .dragging-card{box-shadow:0 0 8px var(--element-box-shadow-color-1),0 8px 8px var(--element-box-shadow-color-2)!important}::ng-deep .ui-draggable-dragging>.grid-stack-item-content,::ng-deep .ui-resizable-resizing>.grid-stack-item-content{box-shadow:none;opacity:1}::ng-deep .ui-resizable-handle{display:block!important}::ng-deep .ui-resizable-se{background-image:none!important;transform:none!important;inset-block-end:6px!important;inset-inline-end:6px!important}.resize-handle{inset-block-end:6px;color:var(--element-ui-2);pointer-events:none;position:absolute;inset-inline-end:6px;text-align:center;z-index:10}.draggable-overlay{inset:8px;position:absolute;z-index:100}\n"], dependencies: [{ kind: "component", type: SiDashboardCardComponent, selector: "si-dashboard-card", inputs: ["restoreText", "expandText", "enableExpandInteraction", "showMenubar"], outputs: ["expandChange"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
810
787
|
}
|
|
811
788
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiWidgetHostComponent, decorators: [{
|
|
812
789
|
type: Component,
|
|
813
|
-
args: [{ selector: 'si-widget-host', imports: [SiDashboardCardComponent,
|
|
790
|
+
args: [{ selector: 'si-widget-host', imports: [SiDashboardCardComponent, NgTemplateOutlet], host: {
|
|
814
791
|
class: 'grid-stack-item'
|
|
815
|
-
}, template: "<div class=\"grid-stack-item-content p-4\">\n @if (editable
|
|
816
|
-
}], propDecorators: { widgetConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "widgetConfig", required: true }] }], remove: [{ type: i0.Output, args: ["remove"] }], edit: [{ type: i0.Output, args: ["edit"] }], card: [{ type: i0.ViewChild, args: ['card', { isSignal: true }] }], widgetHost: [{ type: i0.ViewChild, args: ['widgetHost', { ...{ read: ViewContainerRef }, isSignal: true }] }] } });
|
|
792
|
+
}, template: "<div class=\"grid-stack-item-content p-4\">\n @if (editable()) {\n <div class=\"resize-handle\">\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <g>\n <path d=\"M16 16H18V18H16V16Z\" fill=\"currentColor\" />\n <path d=\"M11 16H13V18H11V16Z\" fill=\"currentColor\" />\n <path d=\"M11 11H13V13H11V11Z\" fill=\"currentColor\" />\n <path d=\"M6 16H8V18H6V16Z\" fill=\"currentColor\" />\n <path d=\"M16 11H18V13H16V11Z\" fill=\"currentColor\" />\n <path d=\"M16 6H18V8H16V6Z\" fill=\"currentColor\" />\n </g>\n </svg>\n </div>\n <div class=\"draggable-overlay\"></div>\n }\n <si-dashboard-card\n #card\n class=\"h-100 dragging-card\"\n [class]=\"accentLine()\"\n [expandText]=\"labelExpand\"\n [restoreText]=\"labelRestore\"\n [heading]=\"widgetConfig().heading\"\n [primaryActions]=\"primaryActions\"\n [secondaryActions]=\"secondaryActions\"\n [actionBarViewType]=\"actionBarViewType\"\n [enableExpandInteraction]=\"widgetConfig().expandable\"\n [imgAlt]=\"widgetConfig().image?.alt\"\n [imgDir]=\"widgetConfig().image?.dir\"\n [imgObjectFit]=\"widgetConfig().image?.objectFit\"\n [imgObjectPosition]=\"widgetConfig().image?.objectPosition\"\n [imgSrc]=\"widgetConfig().image?.src\"\n >\n <div class=\"card-body overflow-auto\" body>\n <ng-container #widgetHost />\n </div>\n\n @if (widgetInstanceFooter) {\n <div class=\"card-footer\" footer>\n <ng-container *ngTemplateOutlet=\"widgetInstanceFooter\" />\n </div>\n }\n </si-dashboard-card>\n</div>\n", styles: [":host{display:flex}::ng-deep body:not(:has(.ui-draggable-dragging)) .draggable-overlay{cursor:grab}::ng-deep si-content-action-bar{z-index:500}::ng-deep .ui-droppable.ui-droppable-over>*:not(.ui-droppable){cursor:move!important;pointer-events:inherit!important}::ng-deep .ui-draggable-dragging .dragging-card,::ng-deep .ui-resizable-resizing .dragging-card{box-shadow:0 0 8px var(--element-box-shadow-color-1),0 8px 8px var(--element-box-shadow-color-2)!important}::ng-deep .ui-draggable-dragging>.grid-stack-item-content,::ng-deep .ui-resizable-resizing>.grid-stack-item-content{box-shadow:none;opacity:1}::ng-deep .ui-resizable-handle{display:block!important}::ng-deep .ui-resizable-se{background-image:none!important;transform:none!important;inset-block-end:6px!important;inset-inline-end:6px!important}.resize-handle{inset-block-end:6px;color:var(--element-ui-2);pointer-events:none;position:absolute;inset-inline-end:6px;text-align:center;z-index:10}.draggable-overlay{inset:8px;position:absolute;z-index:100}\n"] }]
|
|
793
|
+
}], propDecorators: { widgetConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "widgetConfig", required: true }] }], componentFactory: [{ type: i0.Input, args: [{ isSignal: true, alias: "componentFactory", required: false }] }], editable: [{ type: i0.Input, args: [{ isSignal: true, alias: "editable", required: false }] }], remove: [{ type: i0.Output, args: ["remove"] }], edit: [{ type: i0.Output, args: ["edit"] }], card: [{ type: i0.ViewChild, args: ['card', { isSignal: true }] }], widgetHost: [{ type: i0.ViewChild, args: ['widgetHost', { ...{ read: ViewContainerRef }, isSignal: true }] }] } });
|
|
817
794
|
|
|
818
795
|
/**
|
|
819
796
|
* Copyright (c) Siemens 2016 - 2026
|
|
@@ -836,6 +813,12 @@ class SiGridstackWrapperComponent {
|
|
|
836
813
|
* Module configuration
|
|
837
814
|
*/
|
|
838
815
|
gridConfig = input(...(ngDevMode ? [undefined, { debugName: "gridConfig" }] : []));
|
|
816
|
+
/**
|
|
817
|
+
* Map of widget id to widget definition, passed through to widget hosts.
|
|
818
|
+
*
|
|
819
|
+
* @defaultValue new Map()
|
|
820
|
+
*/
|
|
821
|
+
widgetCatalogMap = input(new Map(), ...(ngDevMode ? [{ debugName: "widgetCatalogMap" }] : []));
|
|
839
822
|
/**
|
|
840
823
|
* Emits dashboard grid events.
|
|
841
824
|
*/
|
|
@@ -913,22 +896,23 @@ class SiGridstackWrapperComponent {
|
|
|
913
896
|
});
|
|
914
897
|
}
|
|
915
898
|
}
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
899
|
+
/**
|
|
900
|
+
*
|
|
901
|
+
* Returns the position of a specific widget in the grid.
|
|
902
|
+
*/
|
|
903
|
+
getWidgetLayout(widgetId) {
|
|
904
|
+
const gridItem = this.gridItemsMap().get(widgetId);
|
|
905
|
+
if (!gridItem) {
|
|
906
|
+
return undefined;
|
|
907
|
+
}
|
|
908
|
+
const element = gridItem.component.location.nativeElement;
|
|
909
|
+
return {
|
|
910
|
+
id: widgetId,
|
|
911
|
+
x: Number(element.getAttribute('gs-x')) || 0,
|
|
912
|
+
y: Number(element.getAttribute('gs-y')) || 0,
|
|
913
|
+
width: Number(element.getAttribute('gs-w')) || 0,
|
|
914
|
+
height: Number(element.getAttribute('gs-h')) || 0
|
|
915
|
+
};
|
|
932
916
|
}
|
|
933
917
|
updateLayout(widgets) {
|
|
934
918
|
const widgetConfigMap = new Map(widgets.map(w => [w.id, { ...w, w: w.width, h: w.height }]));
|
|
@@ -946,9 +930,12 @@ class SiGridstackWrapperComponent {
|
|
|
946
930
|
addToView(item) {
|
|
947
931
|
const configSignal = signal(item, ...(ngDevMode ? [{ debugName: "configSignal" }] : []));
|
|
948
932
|
this.widgetConfigSignals.set(item.id, configSignal);
|
|
933
|
+
const componentFactory = computed(() => this.widgetCatalogMap().get(item.widgetId)?.componentFactory, ...(ngDevMode ? [{ debugName: "componentFactory" }] : []));
|
|
949
934
|
const componentRef = this.gridstackContainer().createComponent(SiWidgetHostComponent, {
|
|
950
935
|
bindings: [
|
|
951
936
|
inputBinding('widgetConfig', configSignal),
|
|
937
|
+
inputBinding('editable', this.editable),
|
|
938
|
+
inputBinding('componentFactory', componentFactory),
|
|
952
939
|
outputBinding('remove', widgetId => {
|
|
953
940
|
this.widgetInstanceRemove.emit(widgetId);
|
|
954
941
|
}),
|
|
@@ -1012,12 +999,89 @@ class SiGridstackWrapperComponent {
|
|
|
1012
999
|
});
|
|
1013
1000
|
}
|
|
1014
1001
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiGridstackWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1015
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.8", type: SiGridstackWrapperComponent, isStandalone: true, selector: "si-gridstack-wrapper", inputs: { widgetConfigs: { classPropertyName: "widgetConfigs", publicName: "widgetConfigs", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null }, gridConfig: { classPropertyName: "gridConfig", publicName: "gridConfig", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { gridEvent: "gridEvent", widgetInstanceRemove: "widgetInstanceRemove", widgetInstanceEdit: "widgetInstanceEdit" }, viewQueries: [{ propertyName: "gridstackContainer", first: true, predicate: ["gridstackContainer"], descendants: true, read: ViewContainerRef, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"grid-stack\">\n <ng-container #gridstackContainer />\n</div>\n", styles: ["::ng-deep .si-grid-stack-placeholder{background-color:var(--element-base-information);opacity:.3}:host{display:flex;flex:1 1 0;flex-direction:column;margin-inline-start:-8px;margin-inline-end:-8px;margin-block-start:-8px}.grid-stack{display:block}\n"] });
|
|
1002
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.8", type: SiGridstackWrapperComponent, isStandalone: true, selector: "si-gridstack-wrapper", inputs: { widgetConfigs: { classPropertyName: "widgetConfigs", publicName: "widgetConfigs", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null }, gridConfig: { classPropertyName: "gridConfig", publicName: "gridConfig", isSignal: true, isRequired: false, transformFunction: null }, widgetCatalogMap: { classPropertyName: "widgetCatalogMap", publicName: "widgetCatalogMap", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { gridEvent: "gridEvent", widgetInstanceRemove: "widgetInstanceRemove", widgetInstanceEdit: "widgetInstanceEdit" }, viewQueries: [{ propertyName: "gridstackContainer", first: true, predicate: ["gridstackContainer"], descendants: true, read: ViewContainerRef, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"grid-stack\">\n <ng-container #gridstackContainer />\n</div>\n", styles: ["::ng-deep .si-grid-stack-placeholder{background-color:var(--element-base-information);opacity:.3}:host{display:flex;flex:1 1 0;flex-direction:column;margin-inline-start:-8px;margin-inline-end:-8px;margin-block-start:-8px}.grid-stack{display:block}\n"] });
|
|
1016
1003
|
}
|
|
1017
1004
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiGridstackWrapperComponent, decorators: [{
|
|
1018
1005
|
type: Component,
|
|
1019
1006
|
args: [{ selector: 'si-gridstack-wrapper', template: "<div class=\"grid-stack\">\n <ng-container #gridstackContainer />\n</div>\n", styles: ["::ng-deep .si-grid-stack-placeholder{background-color:var(--element-base-information);opacity:.3}:host{display:flex;flex:1 1 0;flex-direction:column;margin-inline-start:-8px;margin-inline-end:-8px;margin-block-start:-8px}.grid-stack{display:block}\n"] }]
|
|
1020
|
-
}], propDecorators: { widgetConfigs: [{ type: i0.Input, args: [{ isSignal: true, alias: "widgetConfigs", required: false }] }], editable: [{ type: i0.Input, args: [{ isSignal: true, alias: "editable", required: false }] }], gridConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "gridConfig", required: false }] }], gridEvent: [{ type: i0.Output, args: ["gridEvent"] }], widgetInstanceRemove: [{ type: i0.Output, args: ["widgetInstanceRemove"] }], widgetInstanceEdit: [{ type: i0.Output, args: ["widgetInstanceEdit"] }], gridstackContainer: [{ type: i0.ViewChild, args: ['gridstackContainer', { ...{ read: ViewContainerRef }, isSignal: true }] }] } });
|
|
1007
|
+
}], propDecorators: { widgetConfigs: [{ type: i0.Input, args: [{ isSignal: true, alias: "widgetConfigs", required: false }] }], editable: [{ type: i0.Input, args: [{ isSignal: true, alias: "editable", required: false }] }], gridConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "gridConfig", required: false }] }], widgetCatalogMap: [{ type: i0.Input, args: [{ isSignal: true, alias: "widgetCatalogMap", required: false }] }], gridEvent: [{ type: i0.Output, args: ["gridEvent"] }], widgetInstanceRemove: [{ type: i0.Output, args: ["widgetInstanceRemove"] }], widgetInstanceEdit: [{ type: i0.Output, args: ["widgetInstanceEdit"] }], gridstackContainer: [{ type: i0.ViewChild, args: ['gridstackContainer', { ...{ read: ViewContainerRef }, isSignal: true }] }] } });
|
|
1008
|
+
|
|
1009
|
+
/**
|
|
1010
|
+
* Copyright (c) Siemens 2016 - 2026
|
|
1011
|
+
* SPDX-License-Identifier: MIT
|
|
1012
|
+
*/
|
|
1013
|
+
/**
|
|
1014
|
+
* Base class encapsulating common widget editor lifecycle management.
|
|
1015
|
+
* Both `SiWidgetCatalogComponent` and `SiWidgetInstanceEditorDialogComponent`
|
|
1016
|
+
* extend this class to share editor setup, teardown, and status handling logic.
|
|
1017
|
+
*/
|
|
1018
|
+
class SiWidgetEditorBase {
|
|
1019
|
+
/** Indicates if the current config is valid or not. */
|
|
1020
|
+
invalidConfig = signal(false, ...(ngDevMode ? [{ debugName: "invalidConfig" }] : []));
|
|
1021
|
+
/** Marks the widget configuration as modified. */
|
|
1022
|
+
widgetConfigModified = signal(false, ...(ngDevMode ? [{ debugName: "widgetConfigModified" }] : []));
|
|
1023
|
+
editorWizardState = signal(undefined, ...(ngDevMode ? [{ debugName: "editorWizardState" }] : []));
|
|
1024
|
+
widgetInstanceEditor;
|
|
1025
|
+
subscriptions = [];
|
|
1026
|
+
editorHost = viewChild.required('editorHost', { read: ViewContainerRef });
|
|
1027
|
+
injector = inject(Injector);
|
|
1028
|
+
envInjector = inject(EnvironmentInjector);
|
|
1029
|
+
ngOnDestroy() {
|
|
1030
|
+
this.tearDownEditor();
|
|
1031
|
+
}
|
|
1032
|
+
loadWidgetEditor(widgetComponentFactory, host) {
|
|
1033
|
+
return setupWidgetEditor(widgetComponentFactory, host, this.injector, this.envInjector);
|
|
1034
|
+
}
|
|
1035
|
+
initializeEditor(componentRef, config) {
|
|
1036
|
+
this.widgetInstanceEditor = componentRef.instance;
|
|
1037
|
+
if (isSignal(this.widgetInstanceEditor.config)) {
|
|
1038
|
+
componentRef.setInput('config', config);
|
|
1039
|
+
}
|
|
1040
|
+
else {
|
|
1041
|
+
this.widgetInstanceEditor.config = config;
|
|
1042
|
+
}
|
|
1043
|
+
// To be used by webcomponent wrapper
|
|
1044
|
+
if ('statusChangesHandler' in this.widgetInstanceEditor) {
|
|
1045
|
+
this.widgetInstanceEditor.statusChangesHandler = this.handleStatusChanges.bind(this);
|
|
1046
|
+
}
|
|
1047
|
+
if (this.widgetInstanceEditor.statusChanges) {
|
|
1048
|
+
this.subscriptions.push(this.widgetInstanceEditor.statusChanges.subscribe(statusChanges => this.handleStatusChanges(statusChanges)));
|
|
1049
|
+
}
|
|
1050
|
+
else if (this.widgetInstanceEditor.configChange) {
|
|
1051
|
+
this.subscriptions.push(this.widgetInstanceEditor.configChange.subscribe(() => this.widgetConfigModified.set(true)));
|
|
1052
|
+
}
|
|
1053
|
+
if (this.isEditorWizard(this.widgetInstanceEditor)) {
|
|
1054
|
+
this.editorWizardState.set(this.widgetInstanceEditor.state);
|
|
1055
|
+
if (this.widgetInstanceEditor.stateChange) {
|
|
1056
|
+
this.subscriptions.push(this.widgetInstanceEditor.stateChange.subscribe(state => this.editorWizardState.set(state)));
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
tearDownEditor() {
|
|
1061
|
+
this.invalidConfig.set(false);
|
|
1062
|
+
this.widgetConfigModified.set(false);
|
|
1063
|
+
this.editorWizardState.set(undefined);
|
|
1064
|
+
this.widgetInstanceEditor = undefined;
|
|
1065
|
+
this.subscriptions.forEach(s => s.unsubscribe());
|
|
1066
|
+
this.subscriptions = [];
|
|
1067
|
+
}
|
|
1068
|
+
isEditorWizard(editor) {
|
|
1069
|
+
return !!editor && 'state' in editor;
|
|
1070
|
+
}
|
|
1071
|
+
handleStatusChanges(statusChanges) {
|
|
1072
|
+
if (statusChanges.invalid !== undefined) {
|
|
1073
|
+
this.invalidConfig.set(statusChanges.invalid);
|
|
1074
|
+
}
|
|
1075
|
+
if (statusChanges.modified !== undefined) {
|
|
1076
|
+
this.widgetConfigModified.set(statusChanges.modified);
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiWidgetEditorBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1080
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.0.8", type: SiWidgetEditorBase, isStandalone: true, viewQueries: [{ propertyName: "editorHost", first: true, predicate: ["editorHost"], descendants: true, read: ViewContainerRef, isSignal: true }], ngImport: i0 });
|
|
1081
|
+
}
|
|
1082
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiWidgetEditorBase, decorators: [{
|
|
1083
|
+
type: Directive
|
|
1084
|
+
}], propDecorators: { editorHost: [{ type: i0.ViewChild, args: ['editorHost', { ...{ read: ViewContainerRef }, isSignal: true }] }] } });
|
|
1021
1085
|
|
|
1022
1086
|
/**
|
|
1023
1087
|
* Copyright (c) Siemens 2016 - 2026
|
|
@@ -1029,7 +1093,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
1029
1093
|
* into its content. The dialog component is accountable for interacting with the dashboard
|
|
1030
1094
|
* and offers options for saving changes or terminating the editing process.
|
|
1031
1095
|
*/
|
|
1032
|
-
class SiWidgetInstanceEditorDialogComponent {
|
|
1096
|
+
class SiWidgetInstanceEditorDialogComponent extends SiWidgetEditorBase {
|
|
1033
1097
|
/**
|
|
1034
1098
|
* Input for the widget instance configuration. It is used to populate the
|
|
1035
1099
|
* widget editor.
|
|
@@ -1049,9 +1113,6 @@ class SiWidgetInstanceEditorDialogComponent {
|
|
|
1049
1113
|
* Emits when the editor instantiation is completed.
|
|
1050
1114
|
*/
|
|
1051
1115
|
editorSetupCompleted = output();
|
|
1052
|
-
editorHost = viewChild.required('editorHost', { read: ViewContainerRef });
|
|
1053
|
-
/** Indicates if the current config is valid or not. If invalid, the save button will be disabled. */
|
|
1054
|
-
invalidConfig = signal(false, ...(ngDevMode ? [{ debugName: "invalidConfig" }] : []));
|
|
1055
1116
|
showNextButton = computed(() => this.editorWizardState() !== undefined ? true : false, ...(ngDevMode ? [{ debugName: "showNextButton" }] : []));
|
|
1056
1117
|
disableNextButton = computed(() => {
|
|
1057
1118
|
const wizardState = this.editorWizardState();
|
|
@@ -1082,51 +1143,13 @@ class SiWidgetInstanceEditorDialogComponent {
|
|
|
1082
1143
|
labelDialogSave = t(() => $localize `:@@DASHBOARD.WIDGET_EDITOR_DIALOG.DISCARD_CONFIG_CHANGE_DIALOG.SAVE:Save`);
|
|
1083
1144
|
labelDialogDiscard = t(() => $localize `:@@DASHBOARD.WIDGET_EDITOR_DIALOG.DISCARD_CONFIG_CHANGE_DIALOG.DISCARD:Discard`);
|
|
1084
1145
|
labelDialogCancel = t(() => $localize `:@@DASHBOARD.WIDGET_EDITOR_DIALOG.DISCARD_CONFIG_CHANGE_DIALOG.CANCEL:Cancel`);
|
|
1085
|
-
/**
|
|
1086
|
-
* Marks the widget configuration as modified. Is set when widget editor instance
|
|
1087
|
-
* emits configChange events. Triggers edit discard confirmation dialog when widget config
|
|
1088
|
-
* is modified but not dialog is canceled.
|
|
1089
|
-
* */
|
|
1090
|
-
widgetConfigModified = signal(false, ...(ngDevMode ? [{ debugName: "widgetConfigModified" }] : []));
|
|
1091
|
-
widgetInstanceEditor;
|
|
1092
|
-
editorWizardState = signal(undefined, ...(ngDevMode ? [{ debugName: "editorWizardState" }] : []));
|
|
1093
|
-
subscriptions = [];
|
|
1094
|
-
injector = inject(Injector);
|
|
1095
|
-
envInjector = inject(EnvironmentInjector);
|
|
1096
1146
|
dialogService = inject(SiActionDialogService);
|
|
1097
1147
|
ngOnInit() {
|
|
1098
|
-
|
|
1099
|
-
this.
|
|
1100
|
-
if (isSignal(this.widgetInstanceEditor.config)) {
|
|
1101
|
-
componentRef.setInput('config', this.widgetConfig());
|
|
1102
|
-
}
|
|
1103
|
-
else {
|
|
1104
|
-
this.widgetInstanceEditor.config = this.widgetConfig();
|
|
1105
|
-
}
|
|
1106
|
-
// To be used by webcomponent wrapper
|
|
1107
|
-
if ('statusChangesHandler' in this.widgetInstanceEditor) {
|
|
1108
|
-
this.widgetInstanceEditor.statusChangesHandler = this.handleStatusChanges.bind(this);
|
|
1109
|
-
}
|
|
1110
|
-
if (this.widgetInstanceEditor.statusChanges) {
|
|
1111
|
-
this.subscriptions.push(this.widgetInstanceEditor.statusChanges.subscribe(statusChanges => this.handleStatusChanges(statusChanges)));
|
|
1112
|
-
}
|
|
1113
|
-
else if (this.widgetInstanceEditor.configChange) {
|
|
1114
|
-
this.subscriptions.push(this.widgetInstanceEditor.configChange.subscribe(() => this.widgetConfigModified.set(true)));
|
|
1115
|
-
}
|
|
1116
|
-
if (this.isEditorWizard(this.widgetInstanceEditor)) {
|
|
1117
|
-
this.editorWizardState.set(this.widgetInstanceEditor.state);
|
|
1118
|
-
if (this.widgetInstanceEditor.stateChange) {
|
|
1119
|
-
this.subscriptions.push(this.widgetInstanceEditor.stateChange.subscribe(state => {
|
|
1120
|
-
this.editorWizardState.set(state);
|
|
1121
|
-
}));
|
|
1122
|
-
}
|
|
1123
|
-
}
|
|
1148
|
+
this.loadWidgetEditor(this.widget().componentFactory, this.editorHost()).subscribe(componentRef => {
|
|
1149
|
+
this.initializeEditor(componentRef, this.widgetConfig());
|
|
1124
1150
|
this.editorSetupCompleted.emit();
|
|
1125
1151
|
});
|
|
1126
1152
|
}
|
|
1127
|
-
ngOnDestroy() {
|
|
1128
|
-
this.tearDownEditor();
|
|
1129
|
-
}
|
|
1130
1153
|
onCancel() {
|
|
1131
1154
|
if (!this.widgetConfigModified()) {
|
|
1132
1155
|
this.closed.emit(undefined);
|
|
@@ -1180,30 +1203,13 @@ class SiWidgetInstanceEditorDialogComponent {
|
|
|
1180
1203
|
}
|
|
1181
1204
|
this.closed.emit(this.widgetConfig());
|
|
1182
1205
|
}
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
this.widgetInstanceEditor = undefined;
|
|
1186
|
-
this.subscriptions.forEach(s => s.unsubscribe());
|
|
1187
|
-
this.subscriptions = [];
|
|
1188
|
-
}
|
|
1189
|
-
isEditorWizard(editor) {
|
|
1190
|
-
return !!editor && 'state' in editor;
|
|
1191
|
-
}
|
|
1192
|
-
handleStatusChanges(statusChanges) {
|
|
1193
|
-
if (statusChanges.invalid !== undefined) {
|
|
1194
|
-
this.invalidConfig.set(statusChanges.invalid);
|
|
1195
|
-
}
|
|
1196
|
-
if (statusChanges.modified !== undefined) {
|
|
1197
|
-
this.widgetConfigModified.set(statusChanges.modified);
|
|
1198
|
-
}
|
|
1199
|
-
}
|
|
1200
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiWidgetInstanceEditorDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1201
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: SiWidgetInstanceEditorDialogComponent, isStandalone: true, selector: "si-widget-instance-editor-dialog", inputs: { widgetConfig: { classPropertyName: "widgetConfig", publicName: "widgetConfig", isSignal: true, isRequired: true, transformFunction: null }, widget: { classPropertyName: "widget", publicName: "widget", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { widgetConfig: "widgetConfigChange", closed: "closed", editorSetupCompleted: "editorSetupCompleted" }, viewQueries: [{ propertyName: "editorHost", first: true, predicate: ["editorHost"], descendants: true, read: ViewContainerRef, isSignal: true }], ngImport: i0, template: "<div class=\"si-layout-fixed-height mb-8 mx-0 overflow-auto px-2 pt-2\">\n <ng-container #editorHost />\n</div>\n\n<div class=\"editor-footer px-2\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"onCancel()\">{{\n labelCancel | translate\n }}</button>\n\n @if (showPreviousButton()) {\n <button\n type=\"button\"\n class=\"btn btn-secondary\"\n [disabled]=\"disablePreviousButton()\"\n (click)=\"onPrevious()\"\n >{{ labelPrevious | translate }}</button\n >\n }\n @if (showNextButton()) {\n <button\n type=\"button\"\n class=\"btn btn-secondary\"\n [disabled]=\"disableNextButton()\"\n (click)=\"onNext()\"\n >{{ labelNext | translate }}</button\n >\n }\n\n <button type=\"button\" class=\"btn btn-primary\" [disabled]=\"invalidConfig()\" (click)=\"onSave()\">{{\n labelSave | translate\n }}</button>\n</div>\n", styles: [":host{display:flex;flex:1 1 0;flex-direction:column;margin-inline:-4px;margin-block-start:-4px}.editor-footer{align-items:center;display:flex;flex-shrink:0;flex-wrap:wrap;justify-content:flex-end}.editor-footer>*{margin-inline-start:16px}\n"], dependencies: [{ kind: "pipe", type: SiTranslatePipe, name: "translate" }] });
|
|
1206
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiWidgetInstanceEditorDialogComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1207
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: SiWidgetInstanceEditorDialogComponent, isStandalone: true, selector: "si-widget-instance-editor-dialog", inputs: { widgetConfig: { classPropertyName: "widgetConfig", publicName: "widgetConfig", isSignal: true, isRequired: true, transformFunction: null }, widget: { classPropertyName: "widget", publicName: "widget", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { widgetConfig: "widgetConfigChange", closed: "closed", editorSetupCompleted: "editorSetupCompleted" }, usesInheritance: true, ngImport: i0, template: "<div class=\"si-layout-fixed-height mb-8 mx-0 overflow-auto px-2 pt-2\">\n <ng-container #editorHost />\n</div>\n\n<div class=\"editor-footer px-2\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"onCancel()\">{{\n labelCancel | translate\n }}</button>\n\n @if (showPreviousButton()) {\n <button\n type=\"button\"\n class=\"btn btn-secondary\"\n [disabled]=\"disablePreviousButton()\"\n (click)=\"onPrevious()\"\n >{{ labelPrevious | translate }}</button\n >\n }\n @if (showNextButton()) {\n <button\n type=\"button\"\n class=\"btn btn-secondary\"\n [disabled]=\"disableNextButton()\"\n (click)=\"onNext()\"\n >{{ labelNext | translate }}</button\n >\n }\n\n <button type=\"button\" class=\"btn btn-primary\" [disabled]=\"invalidConfig()\" (click)=\"onSave()\">{{\n labelSave | translate\n }}</button>\n</div>\n", styles: [":host{display:flex;flex:1 1 0;flex-direction:column;margin-inline:-4px;margin-block-start:-4px}.editor-footer{align-items:center;display:flex;flex-shrink:0;flex-wrap:wrap;justify-content:flex-end}.editor-footer>*{margin-inline-start:16px}\n"], dependencies: [{ kind: "pipe", type: SiTranslatePipe, name: "translate" }] });
|
|
1202
1208
|
}
|
|
1203
1209
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiWidgetInstanceEditorDialogComponent, decorators: [{
|
|
1204
1210
|
type: Component,
|
|
1205
1211
|
args: [{ selector: 'si-widget-instance-editor-dialog', imports: [SiTranslatePipe], template: "<div class=\"si-layout-fixed-height mb-8 mx-0 overflow-auto px-2 pt-2\">\n <ng-container #editorHost />\n</div>\n\n<div class=\"editor-footer px-2\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"onCancel()\">{{\n labelCancel | translate\n }}</button>\n\n @if (showPreviousButton()) {\n <button\n type=\"button\"\n class=\"btn btn-secondary\"\n [disabled]=\"disablePreviousButton()\"\n (click)=\"onPrevious()\"\n >{{ labelPrevious | translate }}</button\n >\n }\n @if (showNextButton()) {\n <button\n type=\"button\"\n class=\"btn btn-secondary\"\n [disabled]=\"disableNextButton()\"\n (click)=\"onNext()\"\n >{{ labelNext | translate }}</button\n >\n }\n\n <button type=\"button\" class=\"btn btn-primary\" [disabled]=\"invalidConfig()\" (click)=\"onSave()\">{{\n labelSave | translate\n }}</button>\n</div>\n", styles: [":host{display:flex;flex:1 1 0;flex-direction:column;margin-inline:-4px;margin-block-start:-4px}.editor-footer{align-items:center;display:flex;flex-shrink:0;flex-wrap:wrap;justify-content:flex-end}.editor-footer>*{margin-inline-start:16px}\n"] }]
|
|
1206
|
-
}], propDecorators: { widgetConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "widgetConfig", required: true }] }, { type: i0.Output, args: ["widgetConfigChange"] }], widget: [{ type: i0.Input, args: [{ isSignal: true, alias: "widget", required: true }] }], closed: [{ type: i0.Output, args: ["closed"] }], editorSetupCompleted: [{ type: i0.Output, args: ["editorSetupCompleted"] }]
|
|
1212
|
+
}], propDecorators: { widgetConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "widgetConfig", required: true }] }, { type: i0.Output, args: ["widgetConfigChange"] }], widget: [{ type: i0.Input, args: [{ isSignal: true, alias: "widget", required: true }] }], closed: [{ type: i0.Output, args: ["closed"] }], editorSetupCompleted: [{ type: i0.Output, args: ["editorSetupCompleted"] }] } });
|
|
1207
1213
|
|
|
1208
1214
|
/**
|
|
1209
1215
|
* Copyright (c) Siemens 2016 - 2026
|
|
@@ -1215,7 +1221,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
1215
1221
|
*/
|
|
1216
1222
|
class SiGridComponent {
|
|
1217
1223
|
storeSubscription;
|
|
1218
|
-
gridService = inject(SiGridService);
|
|
1219
1224
|
modalService = inject(SiModalService);
|
|
1220
1225
|
widgetStorage = inject(SI_WIDGET_STORE);
|
|
1221
1226
|
widgetIdProvider = inject(SI_WIDGET_ID_PROVIDER);
|
|
@@ -1233,14 +1238,6 @@ class SiGridComponent {
|
|
|
1233
1238
|
* @defaultValue false
|
|
1234
1239
|
*/
|
|
1235
1240
|
editable = model(false, ...(ngDevMode ? [{ debugName: "editable" }] : []));
|
|
1236
|
-
/**
|
|
1237
|
-
* This is the internal owner of the current editable state and is used to track if
|
|
1238
|
-
* editable or not. Not editable can be changed by either calling the `edit()` api
|
|
1239
|
-
* method or by setting the `editable` input. When setting the input, the `ngOnChanges(...)`
|
|
1240
|
-
* hook is used to call the `edit()` method. Similar, to get from editable to not editable,
|
|
1241
|
-
* `cancel()` or `save()` is used and can be triggered from `ngOnChanges(...)`.
|
|
1242
|
-
*/
|
|
1243
|
-
editableInternal = false;
|
|
1244
1241
|
/**
|
|
1245
1242
|
* An optional, but recommended dashboard id that is used in persistence and passed
|
|
1246
1243
|
* to the widget store for saving and loading data.
|
|
@@ -1253,6 +1250,7 @@ class SiGridComponent {
|
|
|
1253
1250
|
*
|
|
1254
1251
|
* @defaultValue [] */
|
|
1255
1252
|
widgetCatalog = input([], ...(ngDevMode ? [{ debugName: "widgetCatalog" }] : []));
|
|
1253
|
+
widgetCatalogMap = computed(() => new Map(this.widgetCatalog().map(widget => [widget.id, widget])), ...(ngDevMode ? [{ debugName: "widgetCatalogMap" }] : []));
|
|
1256
1254
|
/**
|
|
1257
1255
|
* When the user clicks edit on a widget instance, an editor need to appear and the
|
|
1258
1256
|
* widget editor component need to be loaded. When the grid is used standalone, it
|
|
@@ -1341,19 +1339,15 @@ class SiGridComponent {
|
|
|
1341
1339
|
}
|
|
1342
1340
|
if (changes.editable) {
|
|
1343
1341
|
if (changes.editable.currentValue) {
|
|
1344
|
-
this.
|
|
1342
|
+
this.resetEditState();
|
|
1345
1343
|
}
|
|
1346
1344
|
else {
|
|
1347
|
-
this.
|
|
1345
|
+
this.restoreSavedState();
|
|
1348
1346
|
}
|
|
1349
1347
|
}
|
|
1350
|
-
if (changes.widgetCatalog) {
|
|
1351
|
-
this.gridService.widgetCatalog.set(this.widgetCatalog());
|
|
1352
|
-
}
|
|
1353
1348
|
}
|
|
1354
1349
|
ngOnInit() {
|
|
1355
1350
|
queueMicrotask(() => this.loadAndSubscribeWidgets());
|
|
1356
|
-
this.gridService.widgetCatalog.set(this.widgetCatalog());
|
|
1357
1351
|
}
|
|
1358
1352
|
ngOnDestroy() {
|
|
1359
1353
|
this.storeSubscription?.unsubscribe();
|
|
@@ -1363,13 +1357,9 @@ class SiGridComponent {
|
|
|
1363
1357
|
* Set dashboard grid in editable mode to modify widget instances.
|
|
1364
1358
|
*/
|
|
1365
1359
|
edit() {
|
|
1366
|
-
if (!this.
|
|
1367
|
-
this.transientWidgetInstances = [];
|
|
1368
|
-
this.markedForRemoval = [];
|
|
1369
|
-
this.setModified(false);
|
|
1370
|
-
this.editableInternal = true;
|
|
1360
|
+
if (!this.editable()) {
|
|
1371
1361
|
this.editable.set(true);
|
|
1372
|
-
this.
|
|
1362
|
+
this.resetEditState();
|
|
1373
1363
|
}
|
|
1374
1364
|
}
|
|
1375
1365
|
/**
|
|
@@ -1377,7 +1367,7 @@ class SiGridComponent {
|
|
|
1377
1367
|
* changes the editable and isModified modes.
|
|
1378
1368
|
*/
|
|
1379
1369
|
save() {
|
|
1380
|
-
if (!this.
|
|
1370
|
+
if (!this.editable()) {
|
|
1381
1371
|
return;
|
|
1382
1372
|
}
|
|
1383
1373
|
this.isLoading.next(true);
|
|
@@ -1392,9 +1382,7 @@ class SiGridComponent {
|
|
|
1392
1382
|
.subscribe({
|
|
1393
1383
|
next: (value) => {
|
|
1394
1384
|
this.setModified(false);
|
|
1395
|
-
this.editableInternal = false;
|
|
1396
1385
|
this.editable.set(false);
|
|
1397
|
-
this.gridService.editable$.next(this.editableInternal);
|
|
1398
1386
|
this.isLoading.next(false);
|
|
1399
1387
|
},
|
|
1400
1388
|
error: (err) => {
|
|
@@ -1407,18 +1395,10 @@ class SiGridComponent {
|
|
|
1407
1395
|
* Cancel current changes and restore last saved state.
|
|
1408
1396
|
*/
|
|
1409
1397
|
cancel() {
|
|
1410
|
-
if (!this.editableInternal) {
|
|
1411
|
-
return;
|
|
1412
|
-
}
|
|
1413
|
-
if (this.modified) {
|
|
1414
|
-
this.visibleWidgetInstances$.next([...this.persistedWidgetInstances]);
|
|
1415
|
-
this.setModified(false);
|
|
1416
|
-
}
|
|
1417
|
-
this.editableInternal = false;
|
|
1418
1398
|
if (this.editable()) {
|
|
1419
1399
|
this.editable.set(false);
|
|
1400
|
+
this.restoreSavedState();
|
|
1420
1401
|
}
|
|
1421
|
-
this.gridService.editable$.next(this.editableInternal);
|
|
1422
1402
|
}
|
|
1423
1403
|
/**
|
|
1424
1404
|
* Adds a new widget instance configuration to the dashboard grid. It is not
|
|
@@ -1467,7 +1447,7 @@ class SiGridComponent {
|
|
|
1467
1447
|
this.widgetInstanceEdit.emit(widgetConfigClone);
|
|
1468
1448
|
}
|
|
1469
1449
|
else {
|
|
1470
|
-
const widget = this.
|
|
1450
|
+
const widget = this.widgetCatalogMap().get(widgetConfigClone.widgetId);
|
|
1471
1451
|
const config = {
|
|
1472
1452
|
animated: true,
|
|
1473
1453
|
keyboard: true,
|
|
@@ -1507,6 +1487,14 @@ class SiGridComponent {
|
|
|
1507
1487
|
}
|
|
1508
1488
|
handleGridEvent(event) {
|
|
1509
1489
|
const relevantEventTypes = ['added', 'removed', 'dragstop', 'resizestop'];
|
|
1490
|
+
// When widgets without explicit x/y are first added, GridStack auto-positions them.
|
|
1491
|
+
// Capture these resolved positions so cancel() can restore the exact layout
|
|
1492
|
+
// instead of re-triggering auto-positioning which may produce a different result.
|
|
1493
|
+
if (event.event.type === 'added' &&
|
|
1494
|
+
!this.editable() &&
|
|
1495
|
+
this.persistedWidgetInstances.some(w => w.x === undefined || w.y === undefined)) {
|
|
1496
|
+
this.persistedWidgetInstances = this.updateWidgetPositions(this.persistedWidgetInstances);
|
|
1497
|
+
}
|
|
1510
1498
|
if (this.editable() && relevantEventTypes.includes(event.event.type)) {
|
|
1511
1499
|
// Make sure the widget config always holds the latest position information
|
|
1512
1500
|
const widgets = this.updateWidgetPositions(this.visibleWidgetInstances$.value);
|
|
@@ -1542,9 +1530,9 @@ class SiGridComponent {
|
|
|
1542
1530
|
});
|
|
1543
1531
|
}
|
|
1544
1532
|
updateWidgetPositions(widgetConfigs) {
|
|
1545
|
-
const
|
|
1533
|
+
const wrapper = this.gridStackWrapper();
|
|
1546
1534
|
const widgets = widgetConfigs.map(widget => {
|
|
1547
|
-
const position =
|
|
1535
|
+
const position = wrapper.getWidgetLayout(widget.id);
|
|
1548
1536
|
if (position &&
|
|
1549
1537
|
(widget.x !== position.x ||
|
|
1550
1538
|
widget.y !== position.y ||
|
|
@@ -1564,6 +1552,17 @@ class SiGridComponent {
|
|
|
1564
1552
|
});
|
|
1565
1553
|
return widgets || [];
|
|
1566
1554
|
}
|
|
1555
|
+
resetEditState() {
|
|
1556
|
+
this.transientWidgetInstances = [];
|
|
1557
|
+
this.markedForRemoval = [];
|
|
1558
|
+
this.setModified(false);
|
|
1559
|
+
}
|
|
1560
|
+
restoreSavedState() {
|
|
1561
|
+
if (this.modified) {
|
|
1562
|
+
this.visibleWidgetInstances$.next([...this.persistedWidgetInstances]);
|
|
1563
|
+
this.setModified(false);
|
|
1564
|
+
}
|
|
1565
|
+
}
|
|
1567
1566
|
setModified(modified) {
|
|
1568
1567
|
if (this.modified !== modified) {
|
|
1569
1568
|
this.modified = modified;
|
|
@@ -1571,11 +1570,11 @@ class SiGridComponent {
|
|
|
1571
1570
|
}
|
|
1572
1571
|
}
|
|
1573
1572
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiGridComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1574
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: SiGridComponent, isStandalone: true, selector: "si-grid", inputs: { gridConfig: { classPropertyName: "gridConfig", publicName: "gridConfig", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", 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 }, emitWidgetInstanceEditEvents: { classPropertyName: "emitWidgetInstanceEditEvents", publicName: "emitWidgetInstanceEditEvents", isSignal: true, isRequired: false, transformFunction: null }, hideProgressIndicator: { classPropertyName: "hideProgressIndicator", publicName: "hideProgressIndicator", isSignal: true, isRequired: false, transformFunction: null }, widgetInstanceEditorDialogComponent: { classPropertyName: "widgetInstanceEditorDialogComponent", publicName: "widgetInstanceEditorDialogComponent", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { editable: "editableChange", isModified: "isModified", widgetInstanceEdit: "widgetInstanceEdit" },
|
|
1573
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: SiGridComponent, isStandalone: true, selector: "si-grid", inputs: { gridConfig: { classPropertyName: "gridConfig", publicName: "gridConfig", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", 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 }, emitWidgetInstanceEditEvents: { classPropertyName: "emitWidgetInstanceEditEvents", publicName: "emitWidgetInstanceEditEvents", isSignal: true, isRequired: false, transformFunction: null }, hideProgressIndicator: { classPropertyName: "hideProgressIndicator", publicName: "hideProgressIndicator", isSignal: true, isRequired: false, transformFunction: null }, widgetInstanceEditorDialogComponent: { classPropertyName: "widgetInstanceEditorDialogComponent", publicName: "widgetInstanceEditorDialogComponent", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { editable: "editableChange", isModified: "isModified", widgetInstanceEdit: "widgetInstanceEdit" }, viewQueries: [{ propertyName: "gridStackWrapper", first: true, predicate: SiGridstackWrapperComponent, descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "@if (showEmptyState) {\n <ng-content select=\"[empty-state]\" />\n}\n<si-gridstack-wrapper\n [widgetConfigs]=\"(visibleWidgetInstances$ | async) ?? []\"\n [gridConfig]=\"gridConfig()\"\n [editable]=\"editable()\"\n [widgetCatalogMap]=\"widgetCatalogMap()\"\n [siLoading]=\"!hideProgressIndicator() && initialLoad && (isLoading | async)!\"\n [blocking]=\"false\"\n (gridEvent)=\"handleGridEvent($event)\"\n (widgetInstanceRemove)=\"removeWidgetInstance($event)\"\n (widgetInstanceEdit)=\"editWidgetInstance($event)\"\n/>\n", styles: [":host{display:flex;flex:1 1 0;flex-direction:column}::ng-deep .grid-stack-animate,::ng-deep .grid-stack-animate .grid-stack-item{transition-property:inset-inline-start,inset-block-start}\n"], dependencies: [{ kind: "component", type: SiGridstackWrapperComponent, selector: "si-gridstack-wrapper", inputs: ["widgetConfigs", "editable", "gridConfig", "widgetCatalogMap"], outputs: ["gridEvent", "widgetInstanceRemove", "widgetInstanceEdit"] }, { kind: "directive", type: SiLoadingSpinnerDirective, selector: "[siLoading]", inputs: ["siLoading", "blocking", "initialDelay"] }, { kind: "pipe", type: AsyncPipe, name: "async" }] });
|
|
1575
1574
|
}
|
|
1576
1575
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiGridComponent, decorators: [{
|
|
1577
1576
|
type: Component,
|
|
1578
|
-
args: [{ selector: 'si-grid', imports: [SiGridstackWrapperComponent, SiLoadingSpinnerDirective, AsyncPipe],
|
|
1577
|
+
args: [{ selector: 'si-grid', imports: [SiGridstackWrapperComponent, SiLoadingSpinnerDirective, AsyncPipe], template: "@if (showEmptyState) {\n <ng-content select=\"[empty-state]\" />\n}\n<si-gridstack-wrapper\n [widgetConfigs]=\"(visibleWidgetInstances$ | async) ?? []\"\n [gridConfig]=\"gridConfig()\"\n [editable]=\"editable()\"\n [widgetCatalogMap]=\"widgetCatalogMap()\"\n [siLoading]=\"!hideProgressIndicator() && initialLoad && (isLoading | async)!\"\n [blocking]=\"false\"\n (gridEvent)=\"handleGridEvent($event)\"\n (widgetInstanceRemove)=\"removeWidgetInstance($event)\"\n (widgetInstanceEdit)=\"editWidgetInstance($event)\"\n/>\n", styles: [":host{display:flex;flex:1 1 0;flex-direction:column}::ng-deep .grid-stack-animate,::ng-deep .grid-stack-animate .grid-stack-item{transition-property:inset-inline-start,inset-block-start}\n"] }]
|
|
1579
1578
|
}], propDecorators: { gridConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "gridConfig", required: false }] }], editable: [{ type: i0.Input, args: [{ isSignal: true, alias: "editable", required: false }] }, { type: i0.Output, args: ["editableChange"] }], dashboardId: [{ type: i0.Input, args: [{ isSignal: true, alias: "dashboardId", required: false }] }], widgetCatalog: [{ type: i0.Input, args: [{ isSignal: true, alias: "widgetCatalog", required: false }] }], emitWidgetInstanceEditEvents: [{ type: i0.Input, args: [{ isSignal: true, alias: "emitWidgetInstanceEditEvents", required: false }] }], hideProgressIndicator: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideProgressIndicator", required: false }] }], widgetInstanceEditorDialogComponent: [{ type: i0.Input, args: [{ isSignal: true, alias: "widgetInstanceEditorDialogComponent", required: false }] }], isModified: [{ type: i0.Output, args: ["isModified"] }], widgetInstanceEdit: [{ type: i0.Output, args: ["widgetInstanceEdit"] }], gridStackWrapper: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SiGridstackWrapperComponent), { isSignal: true }] }] } });
|
|
1580
1579
|
|
|
1581
1580
|
/**
|
|
@@ -1606,7 +1605,7 @@ const createWidgetConfig = (widget) => {
|
|
|
1606
1605
|
* selection, a host in which the widget specific editor is loaded. Applications can either
|
|
1607
1606
|
* stay with the default catalog or implement their own by extending this class.
|
|
1608
1607
|
*/
|
|
1609
|
-
class SiWidgetCatalogComponent {
|
|
1608
|
+
class SiWidgetCatalogComponent extends SiWidgetEditorBase {
|
|
1610
1609
|
/**
|
|
1611
1610
|
* Placeholder text for the search input field in the widget catalog.
|
|
1612
1611
|
*
|
|
@@ -1629,7 +1628,6 @@ class SiWidgetCatalogComponent {
|
|
|
1629
1628
|
* @defaultValue 'list'
|
|
1630
1629
|
*/
|
|
1631
1630
|
view = signal('list', ...(ngDevMode ? [{ debugName: "view" }] : []));
|
|
1632
|
-
editorHost = viewChild.required('editorHost', { read: ViewContainerRef });
|
|
1633
1631
|
/**
|
|
1634
1632
|
* Property to provide the available widgets to the catalog. The flexible
|
|
1635
1633
|
* dashboard creates the catalog by Angular's `createComponent()` method
|
|
@@ -1649,6 +1647,7 @@ class SiWidgetCatalogComponent {
|
|
|
1649
1647
|
selected = signal(undefined, ...(ngDevMode ? [{ debugName: "selected" }] : []));
|
|
1650
1648
|
widgetConfig;
|
|
1651
1649
|
hasEditor = computed(() => !!this.selected()?.componentFactory.editorComponentName, ...(ngDevMode ? [{ debugName: "hasEditor" }] : []));
|
|
1650
|
+
translateService = injectSiTranslateService();
|
|
1652
1651
|
labelCancel = t(() => $localize `:@@DASHBOARD.WIDGET_LIBRARY.CANCEL:Cancel`);
|
|
1653
1652
|
labelPrevious = t(() => $localize `:@@DASHBOARD.WIDGET_LIBRARY.PREVIOUS:Previous`);
|
|
1654
1653
|
labelNext = t(() => $localize `:@@DASHBOARD.WIDGET_LIBRARY.NEXT:Next`);
|
|
@@ -1681,21 +1680,7 @@ class SiWidgetCatalogComponent {
|
|
|
1681
1680
|
return false;
|
|
1682
1681
|
}
|
|
1683
1682
|
}, ...(ngDevMode ? [{ debugName: "disableNextButton" }] : []));
|
|
1684
|
-
/** Indicates if the current config is valid or not. If invalid, the add button is disabled. */
|
|
1685
|
-
invalidConfig = signal(false, ...(ngDevMode ? [{ debugName: "invalidConfig" }] : []));
|
|
1686
|
-
/**
|
|
1687
|
-
* Marks the widget configuration as modified. Is set when widget editor instance
|
|
1688
|
-
* emits configChange events. Triggers edit discard confirmation dialog when widget config
|
|
1689
|
-
* is modified but not added to the dashboard.
|
|
1690
|
-
* */
|
|
1691
|
-
widgetConfigModified = false;
|
|
1692
|
-
widgetInstanceEditor;
|
|
1693
|
-
editorWizardState = signal(undefined, ...(ngDevMode ? [{ debugName: "editorWizardState" }] : []));
|
|
1694
|
-
widgetInstanceEditorRef;
|
|
1695
|
-
subscriptions = [];
|
|
1696
1683
|
dialogService = inject(SiActionDialogService);
|
|
1697
|
-
injector = inject(Injector);
|
|
1698
|
-
envInjector = inject(EnvironmentInjector);
|
|
1699
1684
|
widgetCdkListbox = viewChild((CdkListbox), ...(ngDevMode ? [{ debugName: "widgetCdkListbox" }] : []));
|
|
1700
1685
|
ngOnInit() {
|
|
1701
1686
|
this.filteredWidgetCatalog = this.widgetCatalog;
|
|
@@ -1703,9 +1688,6 @@ class SiWidgetCatalogComponent {
|
|
|
1703
1688
|
this.selectWidget(this.widgetCatalog[0]);
|
|
1704
1689
|
}
|
|
1705
1690
|
}
|
|
1706
|
-
ngOnDestroy() {
|
|
1707
|
-
this.tearDownEditor();
|
|
1708
|
-
}
|
|
1709
1691
|
onSearch(searchTerm) {
|
|
1710
1692
|
if (!searchTerm || searchTerm.trim().length === 0) {
|
|
1711
1693
|
this.searchTerm = '';
|
|
@@ -1713,7 +1695,11 @@ class SiWidgetCatalogComponent {
|
|
|
1713
1695
|
}
|
|
1714
1696
|
else {
|
|
1715
1697
|
this.searchTerm = searchTerm;
|
|
1716
|
-
|
|
1698
|
+
const term = searchTerm.trim().toLowerCase();
|
|
1699
|
+
this.filteredWidgetCatalog = this.widgetCatalog.filter(wd => {
|
|
1700
|
+
const name = this.translateService.translateSync(wd.name);
|
|
1701
|
+
return name.toLowerCase().includes(term);
|
|
1702
|
+
});
|
|
1717
1703
|
}
|
|
1718
1704
|
if (this.filteredWidgetCatalog.length > 0) {
|
|
1719
1705
|
this.selectWidget(this.filteredWidgetCatalog[0]);
|
|
@@ -1723,7 +1709,7 @@ class SiWidgetCatalogComponent {
|
|
|
1723
1709
|
}
|
|
1724
1710
|
}
|
|
1725
1711
|
onCancel() {
|
|
1726
|
-
if (!this.widgetConfigModified) {
|
|
1712
|
+
if (!this.widgetConfigModified()) {
|
|
1727
1713
|
this.closed.emit(undefined);
|
|
1728
1714
|
}
|
|
1729
1715
|
else {
|
|
@@ -1759,7 +1745,7 @@ class SiWidgetCatalogComponent {
|
|
|
1759
1745
|
this.widgetInstanceEditor.previous();
|
|
1760
1746
|
this.editorWizardState.set(this.widgetInstanceEditor.state);
|
|
1761
1747
|
}
|
|
1762
|
-
else if (!this.widgetConfigModified) {
|
|
1748
|
+
else if (!this.widgetConfigModified()) {
|
|
1763
1749
|
this.setupCatalog();
|
|
1764
1750
|
}
|
|
1765
1751
|
else {
|
|
@@ -1787,56 +1773,15 @@ class SiWidgetCatalogComponent {
|
|
|
1787
1773
|
this.tearDownEditor();
|
|
1788
1774
|
this.view.set('editor');
|
|
1789
1775
|
this.widgetConfig = createWidgetConfig(selected);
|
|
1790
|
-
|
|
1776
|
+
this.loadWidgetEditor(selected.componentFactory, this.editorHost()).subscribe({
|
|
1791
1777
|
next: componentRef => {
|
|
1792
|
-
this.
|
|
1793
|
-
this.widgetInstanceEditor = componentRef.instance;
|
|
1794
|
-
if (isSignal(this.widgetInstanceEditor.config)) {
|
|
1795
|
-
this.widgetInstanceEditorRef.setInput('config', this.widgetConfig);
|
|
1796
|
-
}
|
|
1797
|
-
else {
|
|
1798
|
-
this.widgetInstanceEditor.config = this.widgetConfig;
|
|
1799
|
-
}
|
|
1800
|
-
// To be used by webcomponent wrapper
|
|
1801
|
-
if ('statusChangesHandler' in this.widgetInstanceEditor) {
|
|
1802
|
-
this.widgetInstanceEditor.statusChangesHandler = this.handleStatusChanges.bind(this);
|
|
1803
|
-
}
|
|
1804
|
-
let hasStatusChangesEmitter = false;
|
|
1805
|
-
if (this.widgetInstanceEditor.statusChanges) {
|
|
1806
|
-
hasStatusChangesEmitter = true;
|
|
1807
|
-
this.subscriptions.push(this.widgetInstanceEditor.statusChanges.subscribe(statusChanges => {
|
|
1808
|
-
this.handleStatusChanges(statusChanges);
|
|
1809
|
-
}));
|
|
1810
|
-
}
|
|
1811
|
-
if (this.widgetInstanceEditor.configChange) {
|
|
1812
|
-
this.subscriptions.push(this.widgetInstanceEditor.configChange.subscribe(config => {
|
|
1813
|
-
if (!hasStatusChangesEmitter) {
|
|
1814
|
-
this.widgetConfigModified = true;
|
|
1815
|
-
}
|
|
1816
|
-
}));
|
|
1817
|
-
}
|
|
1818
|
-
if (this.isEditorWizard(this.widgetInstanceEditor)) {
|
|
1819
|
-
this.editorWizardState.set(this.widgetInstanceEditor.state);
|
|
1820
|
-
if (this.widgetInstanceEditor.stateChange) {
|
|
1821
|
-
this.subscriptions.push(this.widgetInstanceEditor.stateChange.subscribe(state => {
|
|
1822
|
-
this.editorWizardState.set(state);
|
|
1823
|
-
}));
|
|
1824
|
-
}
|
|
1825
|
-
}
|
|
1778
|
+
this.initializeEditor(componentRef, this.widgetConfig);
|
|
1826
1779
|
},
|
|
1827
1780
|
error: error => {
|
|
1828
1781
|
console.error(error);
|
|
1829
1782
|
}
|
|
1830
1783
|
});
|
|
1831
1784
|
}
|
|
1832
|
-
tearDownEditor() {
|
|
1833
|
-
this.invalidConfig.set(false);
|
|
1834
|
-
this.widgetConfigModified = false;
|
|
1835
|
-
this.editorWizardState.set(undefined);
|
|
1836
|
-
this.widgetInstanceEditor = undefined;
|
|
1837
|
-
this.subscriptions.forEach(s => s.unsubscribe());
|
|
1838
|
-
this.subscriptions = [];
|
|
1839
|
-
}
|
|
1840
1785
|
setupCatalog() {
|
|
1841
1786
|
this.editorHost().clear();
|
|
1842
1787
|
this.tearDownEditor();
|
|
@@ -1871,19 +1816,8 @@ class SiWidgetCatalogComponent {
|
|
|
1871
1816
|
});
|
|
1872
1817
|
}
|
|
1873
1818
|
}
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
}
|
|
1877
|
-
handleStatusChanges(statusChanges) {
|
|
1878
|
-
if (statusChanges.invalid !== undefined) {
|
|
1879
|
-
this.invalidConfig.set(statusChanges.invalid);
|
|
1880
|
-
}
|
|
1881
|
-
if (statusChanges.modified !== undefined) {
|
|
1882
|
-
this.widgetConfigModified = statusChanges.modified;
|
|
1883
|
-
}
|
|
1884
|
-
}
|
|
1885
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiWidgetCatalogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1886
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: SiWidgetCatalogComponent, isStandalone: true, selector: "si-widget-catalog", inputs: { searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closed: "closed" }, viewQueries: [{ propertyName: "editorHost", first: true, predicate: ["editorHost"], descendants: true, read: ViewContainerRef, isSignal: true }, { propertyName: "widgetCdkListbox", first: true, predicate: (CdkListbox), descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"si-layout-fixed-height mb-8 mx-0 overflow-auto px-2 pt-2\">\n @if (view() === 'list') {\n <div class=\"si-layout-fixed-height\">\n <div class=\"mx-0\">\n <si-search-bar\n class=\"w-100\"\n colorVariant=\"base-1\"\n showIcon=\"true\"\n [placeholder]=\"searchPlaceholder() | translate\"\n [value]=\"searchTerm\"\n (searchChange)=\"onSearch($event)\"\n />\n </div>\n <div\n class=\"si-layout-fixed-height text-pre-wrap text-break overflow-y-auto widget-list mt-6 bg-base-1\"\n >\n @if (filteredWidgetCatalog.length > 0) {\n <span id=\"widget-catalog-list-description\" class=\"visually-hidden\">\n {{ labelWidgetCatalogList | translate }}\n </span>\n <ul\n class=\"si-layout-fixed-height list-group\"\n aria-labelledby=\"widget-catalog-list-description\"\n cdkListbox\n [cdkListboxValue]=\"[]\"\n (cdkListboxValueChange)=\"selectWidget($event.value[0])\"\n >\n @for (widget of filteredWidgetCatalog; track $index) {\n <li\n class=\"list-group-item list-group-item-action d-flex\"\n [cdkOption]=\"widget\"\n [class.active]=\"selected() === widget\"\n >\n <si-circle-status class=\"my-n4 me-5\" [icon]=\"widget.iconClass\" />\n <div class=\"d-flex flex-column align-items-start\">\n <span class=\"si-h5\">{{ widget.name }}</span>\n <span class=\"si-body\">{{ widget.description?.trim() }}</span>\n </div>\n </li>\n }\n </ul>\n } @else {\n <div>\n <si-empty-state icon=\"element-report\" [heading]=\"labelEmpty\" />\n </div>\n }\n </div>\n </div>\n }\n <ng-container #editorHost />\n</div>\n\n<div class=\"catalog-footer py-0 px-2\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"onCancel()\">{{\n labelCancel | translate\n }}</button>\n @if (showPreviousButton()) {\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"onPrevious()\">{{\n labelPrevious | translate\n }}</button>\n }\n @if (showNextButton()) {\n <button\n type=\"button\"\n class=\"btn\"\n [class.btn-primary]=\"view() === 'list'\"\n [class.btn-secondary]=\"view() !== 'list'\"\n [disabled]=\"disableNextButton()\"\n (click)=\"onNext()\"\n >{{ labelNext | translate }}</button\n >\n }\n @if (showAddButton()) {\n <button\n type=\"button\"\n class=\"btn btn-primary\"\n [disabled]=\"disableAddButton()\"\n (click)=\"onAddWidget()\"\n >{{ labelAdd | translate }}</button\n >\n }\n</div>\n", styles: [":host{display:flex;flex:1 1 0;flex-direction:column;margin-inline:-4px;margin-block-start:-4px}.widget-list{background-color:var(--element-base-1);border:1px solid var(--element-ui-4);border-radius:var(--element-radius-2);overflow-x:auto}.list-group-item{border-inline-color:transparent;border-radius:0;cursor:pointer}.catalog-footer{align-items:center;display:flex;flex-shrink:0;flex-wrap:wrap;justify-content:flex-end}.catalog-footer>*{margin-inline-start:16px}\n"], dependencies: [{ kind: "component", type: SiSearchBarComponent, selector: "si-search-bar", inputs: ["debounceTime", "prohibitedCharacters", "placeholder", "showIcon", "tabbable", "value", "readonly", "colorVariant", "disabled", "clearButtonAriaLabel"], outputs: ["searchChange"] }, { kind: "component", type: SiCircleStatusComponent, selector: "si-circle-status", inputs: ["status", "color", "icon", "size", "eventOut", "eventIcon", "blink", "blinkPulse", "ariaLabel"] }, { kind: "component", type: SiEmptyStateComponent, selector: "si-empty-state", inputs: ["icon", "heading", "content"] }, { kind: "directive", type: CdkListbox, selector: "[cdkListbox]", inputs: ["id", "tabindex", "cdkListboxValue", "cdkListboxMultiple", "cdkListboxDisabled", "cdkListboxUseActiveDescendant", "cdkListboxOrientation", "cdkListboxCompareWith", "cdkListboxNavigationWrapDisabled", "cdkListboxNavigatesDisabledOptions"], outputs: ["cdkListboxValueChange"], exportAs: ["cdkListbox"] }, { kind: "directive", type: CdkOption, selector: "[cdkOption]", inputs: ["id", "cdkOption", "cdkOptionTypeaheadLabel", "cdkOptionDisabled", "tabindex"], exportAs: ["cdkOption"] }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }] });
|
|
1819
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiWidgetCatalogComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1820
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: SiWidgetCatalogComponent, isStandalone: true, selector: "si-widget-catalog", inputs: { searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closed: "closed" }, viewQueries: [{ propertyName: "widgetCdkListbox", first: true, predicate: (CdkListbox), descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"si-layout-fixed-height mb-8 mx-0 overflow-auto px-2 pt-2\">\n @if (view() === 'list') {\n <div class=\"si-layout-fixed-height\">\n <div class=\"mx-0\">\n <si-search-bar\n class=\"w-100\"\n colorVariant=\"base-1\"\n showIcon=\"true\"\n [placeholder]=\"searchPlaceholder() | translate\"\n [value]=\"searchTerm\"\n (searchChange)=\"onSearch($event)\"\n />\n </div>\n <div class=\"si-layout-fixed-height text-pre-wrap text-break mt-6 bg-base-1 rounded-2\">\n @if (filteredWidgetCatalog.length > 0) {\n <span id=\"widget-catalog-list-description\" class=\"visually-hidden\">\n {{ labelWidgetCatalogList | translate }}\n </span>\n <ul\n class=\"si-layout-fixed-height list-group overflow-auto mb-0\"\n aria-labelledby=\"widget-catalog-list-description\"\n cdkListbox\n [cdkListboxValue]=\"[]\"\n (cdkListboxValueChange)=\"selectWidget($event.value[0])\"\n >\n @for (widget of filteredWidgetCatalog; track $index) {\n <li\n class=\"list-group-item list-group-item-action d-flex\"\n [cdkOption]=\"widget\"\n [class.active]=\"selected() === widget\"\n >\n <si-circle-status class=\"my-n4 me-5\" [icon]=\"widget.iconClass\" />\n <div class=\"d-flex flex-column align-items-start align-self-center\">\n <span class=\"si-h5\">{{ widget.name | translate }}</span>\n <span class=\"si-body\">{{ widget.description?.trim() | translate }}</span>\n </div>\n </li>\n }\n </ul>\n } @else {\n <div>\n <si-empty-state icon=\"element-report\" [heading]=\"labelEmpty\" />\n </div>\n }\n </div>\n </div>\n }\n <ng-container #editorHost />\n</div>\n\n<div class=\"catalog-footer pb-4 px-2\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"onCancel()\">{{\n labelCancel | translate\n }}</button>\n @if (showPreviousButton()) {\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"onPrevious()\">{{\n labelPrevious | translate\n }}</button>\n }\n @if (showNextButton()) {\n <button\n type=\"button\"\n class=\"btn\"\n [class.btn-primary]=\"view() === 'list'\"\n [class.btn-secondary]=\"view() !== 'list'\"\n [disabled]=\"disableNextButton()\"\n (click)=\"onNext()\"\n >{{ labelNext | translate }}</button\n >\n }\n @if (showAddButton()) {\n <button\n type=\"button\"\n class=\"btn btn-primary\"\n [disabled]=\"disableAddButton()\"\n (click)=\"onAddWidget()\"\n >{{ labelAdd | translate }}</button\n >\n }\n</div>\n", styles: [":host{display:flex;flex:1 1 0;flex-direction:column;margin-inline:-4px;margin-block-start:-4px}.list-group-item{cursor:pointer}.catalog-footer{align-items:center;display:flex;flex-shrink:0;flex-wrap:wrap;justify-content:flex-end}.catalog-footer>*{margin-inline-start:16px}\n"], dependencies: [{ kind: "component", type: SiSearchBarComponent, selector: "si-search-bar", inputs: ["debounceTime", "prohibitedCharacters", "placeholder", "showIcon", "tabbable", "value", "readonly", "colorVariant", "disabled", "maxlength", "clearButtonAriaLabel"], outputs: ["searchChange"] }, { kind: "component", type: SiCircleStatusComponent, selector: "si-circle-status", inputs: ["status", "color", "icon", "size", "eventOut", "eventIcon", "blink", "blinkPulse", "ariaLabel"] }, { kind: "component", type: SiEmptyStateComponent, selector: "si-empty-state", inputs: ["icon", "heading", "content"] }, { kind: "directive", type: CdkListbox, selector: "[cdkListbox]", inputs: ["id", "tabindex", "cdkListboxValue", "cdkListboxMultiple", "cdkListboxDisabled", "cdkListboxUseActiveDescendant", "cdkListboxOrientation", "cdkListboxCompareWith", "cdkListboxNavigationWrapDisabled", "cdkListboxNavigatesDisabledOptions"], outputs: ["cdkListboxValueChange"], exportAs: ["cdkListbox"] }, { kind: "directive", type: CdkOption, selector: "[cdkOption]", inputs: ["id", "cdkOption", "cdkOptionTypeaheadLabel", "cdkOptionDisabled", "tabindex"], exportAs: ["cdkOption"] }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }] });
|
|
1887
1821
|
}
|
|
1888
1822
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiWidgetCatalogComponent, decorators: [{
|
|
1889
1823
|
type: Component,
|
|
@@ -1894,8 +1828,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
1894
1828
|
SiTranslatePipe,
|
|
1895
1829
|
CdkListbox,
|
|
1896
1830
|
CdkOption
|
|
1897
|
-
], template: "<div class=\"si-layout-fixed-height mb-8 mx-0 overflow-auto px-2 pt-2\">\n @if (view() === 'list') {\n <div class=\"si-layout-fixed-height\">\n <div class=\"mx-0\">\n <si-search-bar\n class=\"w-100\"\n colorVariant=\"base-1\"\n showIcon=\"true\"\n [placeholder]=\"searchPlaceholder() | translate\"\n [value]=\"searchTerm\"\n (searchChange)=\"onSearch($event)\"\n />\n </div>\n <div
|
|
1898
|
-
}], propDecorators: { searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], closed: [{ type: i0.Output, args: ["closed"] }],
|
|
1831
|
+
], template: "<div class=\"si-layout-fixed-height mb-8 mx-0 overflow-auto px-2 pt-2\">\n @if (view() === 'list') {\n <div class=\"si-layout-fixed-height\">\n <div class=\"mx-0\">\n <si-search-bar\n class=\"w-100\"\n colorVariant=\"base-1\"\n showIcon=\"true\"\n [placeholder]=\"searchPlaceholder() | translate\"\n [value]=\"searchTerm\"\n (searchChange)=\"onSearch($event)\"\n />\n </div>\n <div class=\"si-layout-fixed-height text-pre-wrap text-break mt-6 bg-base-1 rounded-2\">\n @if (filteredWidgetCatalog.length > 0) {\n <span id=\"widget-catalog-list-description\" class=\"visually-hidden\">\n {{ labelWidgetCatalogList | translate }}\n </span>\n <ul\n class=\"si-layout-fixed-height list-group overflow-auto mb-0\"\n aria-labelledby=\"widget-catalog-list-description\"\n cdkListbox\n [cdkListboxValue]=\"[]\"\n (cdkListboxValueChange)=\"selectWidget($event.value[0])\"\n >\n @for (widget of filteredWidgetCatalog; track $index) {\n <li\n class=\"list-group-item list-group-item-action d-flex\"\n [cdkOption]=\"widget\"\n [class.active]=\"selected() === widget\"\n >\n <si-circle-status class=\"my-n4 me-5\" [icon]=\"widget.iconClass\" />\n <div class=\"d-flex flex-column align-items-start align-self-center\">\n <span class=\"si-h5\">{{ widget.name | translate }}</span>\n <span class=\"si-body\">{{ widget.description?.trim() | translate }}</span>\n </div>\n </li>\n }\n </ul>\n } @else {\n <div>\n <si-empty-state icon=\"element-report\" [heading]=\"labelEmpty\" />\n </div>\n }\n </div>\n </div>\n }\n <ng-container #editorHost />\n</div>\n\n<div class=\"catalog-footer pb-4 px-2\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"onCancel()\">{{\n labelCancel | translate\n }}</button>\n @if (showPreviousButton()) {\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"onPrevious()\">{{\n labelPrevious | translate\n }}</button>\n }\n @if (showNextButton()) {\n <button\n type=\"button\"\n class=\"btn\"\n [class.btn-primary]=\"view() === 'list'\"\n [class.btn-secondary]=\"view() !== 'list'\"\n [disabled]=\"disableNextButton()\"\n (click)=\"onNext()\"\n >{{ labelNext | translate }}</button\n >\n }\n @if (showAddButton()) {\n <button\n type=\"button\"\n class=\"btn btn-primary\"\n [disabled]=\"disableAddButton()\"\n (click)=\"onAddWidget()\"\n >{{ labelAdd | translate }}</button\n >\n }\n</div>\n", styles: [":host{display:flex;flex:1 1 0;flex-direction:column;margin-inline:-4px;margin-block-start:-4px}.list-group-item{cursor:pointer}.catalog-footer{align-items:center;display:flex;flex-shrink:0;flex-wrap:wrap;justify-content:flex-end}.catalog-footer>*{margin-inline-start:16px}\n"] }]
|
|
1832
|
+
}], propDecorators: { searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], closed: [{ type: i0.Output, args: ["closed"] }], widgetCdkListbox: [{ type: i0.ViewChild, args: [i0.forwardRef(() => CdkListbox), { isSignal: true }] }] } });
|
|
1899
1833
|
|
|
1900
1834
|
/**
|
|
1901
1835
|
* Copyright (c) Siemens 2016 - 2026
|
|
@@ -2059,21 +1993,13 @@ class SiFlexibleDashboardComponent {
|
|
|
2059
1993
|
dashboard.restore();
|
|
2060
1994
|
}
|
|
2061
1995
|
if (this.editable()) {
|
|
2062
|
-
this.
|
|
1996
|
+
this.editable.set(false);
|
|
2063
1997
|
this.viewState.set('dashboard');
|
|
2064
1998
|
this.catalogHost().clear();
|
|
2065
1999
|
}
|
|
2066
2000
|
this.dashboardId$.next(changes.dashboardId.currentValue);
|
|
2067
2001
|
this.setupMenuItems();
|
|
2068
2002
|
}
|
|
2069
|
-
if (changes.editable) {
|
|
2070
|
-
if (changes.editable.currentValue) {
|
|
2071
|
-
this.grid().edit();
|
|
2072
|
-
}
|
|
2073
|
-
else {
|
|
2074
|
-
this.grid().cancel();
|
|
2075
|
-
}
|
|
2076
|
-
}
|
|
2077
2003
|
if (changes.hideAddWidgetInstanceButton) {
|
|
2078
2004
|
this.hideAddWidgetInstanceButton$.next(changes.hideAddWidgetInstanceButton.currentValue);
|
|
2079
2005
|
}
|
|
@@ -2094,7 +2020,7 @@ class SiFlexibleDashboardComponent {
|
|
|
2094
2020
|
dashboard.restore();
|
|
2095
2021
|
}
|
|
2096
2022
|
if (!this.editable()) {
|
|
2097
|
-
this.
|
|
2023
|
+
this.editable.set(true);
|
|
2098
2024
|
}
|
|
2099
2025
|
this.viewState.set('catalog');
|
|
2100
2026
|
const componentType = this.widgetCatalogComponent() ?? SiWidgetCatalogComponent;
|
|
@@ -2175,11 +2101,11 @@ class SiFlexibleDashboardComponent {
|
|
|
2175
2101
|
return this.widgetCatalog().find(widget => widget.id === id);
|
|
2176
2102
|
}
|
|
2177
2103
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiFlexibleDashboardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2178
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.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 } }, 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 [heading]=\"pageTitle()\" [sticky]=\"true\">\n <si-dashboard-toolbar\n #toolbar\n menubar\n [class.d-none]=\"!isDashboardVisible()\"\n [primaryEditActions]=\"(primaryEditActions$ | async) ?? []\"\n [secondaryEditActions]=\"(secondaryEditActions$ | async) ?? []\"\n [
|
|
2104
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.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 } }, 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 [heading]=\"pageTitle()\" [sticky]=\"true\">\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", 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: "pipe", type: AsyncPipe, name: "async" }] });
|
|
2179
2105
|
}
|
|
2180
2106
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiFlexibleDashboardComponent, decorators: [{
|
|
2181
2107
|
type: Component,
|
|
2182
|
-
args: [{ selector: 'si-flexible-dashboard', imports: [SiDashboardComponent, SiDashboardToolbarComponent, SiGridComponent, AsyncPipe], template: "<si-dashboard #dashboard [heading]=\"pageTitle()\" [sticky]=\"true\">\n <si-dashboard-toolbar\n #toolbar\n menubar\n [class.d-none]=\"!isDashboardVisible()\"\n [primaryEditActions]=\"(primaryEditActions$ | async) ?? []\"\n [secondaryEditActions]=\"(secondaryEditActions$ | async) ?? []\"\n [
|
|
2108
|
+
args: [{ selector: 'si-flexible-dashboard', imports: [SiDashboardComponent, SiDashboardToolbarComponent, SiGridComponent, AsyncPipe], template: "<si-dashboard #dashboard [heading]=\"pageTitle()\" [sticky]=\"true\">\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", styles: [":host{display:flex;flex:1 1 0;flex-direction:column}\n"] }]
|
|
2183
2109
|
}], 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 }] }], 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 }] }] } });
|
|
2184
2110
|
|
|
2185
2111
|
/**
|