@siemens/dashboards-ng 49.9.0 → 49.11.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"siemens-dashboards-ng-translate.mjs","sources":["../../../../projects/dashboards-ng/translate/si-translatable-keys.interface.ts","../../../../projects/dashboards-ng/translate/si-translatable-overrides.provider.ts","../../../../projects/dashboards-ng/translate/index.ts","../../../../projects/dashboards-ng/translate/siemens-dashboards-ng-translate.ts"],"sourcesContent":["/* eslint-disable */\n\n// Auto-generated file. Run 'npx update-translatable-keys' to update.\n\nexport interface SiTranslatableKeys {\n 'DASHBOARD.ADD_WIDGET'?: string;\n 'DASHBOARD.CANCEL'?: string;\n 'DASHBOARD.EDIT'?: string;\n 'DASHBOARD.REMOVE_WIDGET_CONFIRMATION_DIALOG.CANCEL'?: string;\n 'DASHBOARD.REMOVE_WIDGET_CONFIRMATION_DIALOG.HEADING'?: string;\n 'DASHBOARD.REMOVE_WIDGET_CONFIRMATION_DIALOG.MESSAGE'?: string;\n 'DASHBOARD.REMOVE_WIDGET_CONFIRMATION_DIALOG.REMOVE'?: string;\n 'DASHBOARD.SAVE'?: string;\n 'DASHBOARD.WIDGET.EDIT'?: string;\n 'DASHBOARD.WIDGET.EXPAND'?: string;\n 'DASHBOARD.WIDGET.REMOVE'?: string;\n 'DASHBOARD.WIDGET.RESTORE'?: string;\n 'DASHBOARD.WIDGET_EDITOR_DIALOG.CANCEL'?: string;\n 'DASHBOARD.WIDGET_EDITOR_DIALOG.DISCARD_CONFIG_CHANGE_DIALOG.CANCEL'?: string;\n 'DASHBOARD.WIDGET_EDITOR_DIALOG.DISCARD_CONFIG_CHANGE_DIALOG.DISCARD'?: string;\n 'DASHBOARD.WIDGET_EDITOR_DIALOG.DISCARD_CONFIG_CHANGE_DIALOG.HEADING'?: string;\n 'DASHBOARD.WIDGET_EDITOR_DIALOG.DISCARD_CONFIG_CHANGE_DIALOG.MESSAGE'?: string;\n 'DASHBOARD.WIDGET_EDITOR_DIALOG.DISCARD_CONFIG_CHANGE_DIALOG.SAVE'?: string;\n 'DASHBOARD.WIDGET_EDITOR_DIALOG.NEXT'?: string;\n 'DASHBOARD.WIDGET_EDITOR_DIALOG.PREVIOUS'?: string;\n 'DASHBOARD.WIDGET_EDITOR_DIALOG.SAVE'?: string;\n 'DASHBOARD.WIDGET_EDITOR_DIALOG.TITLE'?: string;\n 'DASHBOARD.WIDGET_LIBRARY.ADD'?: string;\n 'DASHBOARD.WIDGET_LIBRARY.CANCEL'?: string;\n 'DASHBOARD.WIDGET_LIBRARY.DISCARD_CONFIG_CHANGE_DIALOG.CANCEL'?: string;\n 'DASHBOARD.WIDGET_LIBRARY.DISCARD_CONFIG_CHANGE_DIALOG.DISCARD'?: string;\n 'DASHBOARD.WIDGET_LIBRARY.DISCARD_CONFIG_CHANGE_DIALOG.HEADING'?: string;\n 'DASHBOARD.WIDGET_LIBRARY.DISCARD_CONFIG_CHANGE_DIALOG.MESSAGE'?: string;\n 'DASHBOARD.WIDGET_LIBRARY.EMPTY'?: string;\n 'DASHBOARD.WIDGET_LIBRARY.NEXT'?: string;\n 'DASHBOARD.WIDGET_LIBRARY.PREVIOUS'?: string;\n 'DASHBOARD.WIDGET_LIBRARY.SEARCH_PLACEHOLDER'?: string;\n 'DASHBOARD.WIDGET_LIBRARY.TITLE'?: string;\n 'DASHBOARD.WIDGET_LIBRARY.WIDGET_CATALOG_LIST'?: string;\n}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { Provider } from '@angular/core';\nimport { SI_TRANSLATABLE_VALUES } from '@siemens/element-translate-ng/translate';\n\nimport { SiTranslatableKeys } from './si-translatable-keys.interface';\n\nexport const provideSiDashboardsTranslatableOverrides: (\n values: SiTranslatableKeys\n) => Provider = values => ({\n useValue: values,\n multi: true,\n provide: SI_TRANSLATABLE_VALUES\n});\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nexport * from './si-translatable-keys.interface';\nexport * from './si-translatable-overrides.provider';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAAA;;MCSa,wCAAwC,GAErC,MAAM,KAAK;AACzB,IAAA,QAAQ,EAAE,MAAM;AAChB,IAAA,KAAK,EAAE,IAAI;AACX,IAAA,OAAO,EAAE;AACV,CAAA;;ACfD;;;AAGG;;ACHH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"siemens-dashboards-ng-translate.mjs","sources":["../../../../projects/dashboards-ng/translate/si-translatable-keys.interface.ts","../../../../projects/dashboards-ng/translate/si-translatable-overrides.provider.ts","../../../../projects/dashboards-ng/translate/index.ts","../../../../projects/dashboards-ng/translate/siemens-dashboards-ng-translate.ts"],"sourcesContent":["/* eslint-disable */\n\n// Auto-generated file. Run 'npx update-translatable-keys' to update.\n\nexport interface SiTranslatableKeys {\n 'DASHBOARD.ADD_WIDGET'?: string;\n 'DASHBOARD.CANCEL'?: string;\n 'DASHBOARD.EDIT'?: string;\n 'DASHBOARD.REMOVE_WIDGET_CONFIRMATION_DIALOG.CANCEL'?: string;\n 'DASHBOARD.REMOVE_WIDGET_CONFIRMATION_DIALOG.HEADING'?: string;\n 'DASHBOARD.REMOVE_WIDGET_CONFIRMATION_DIALOG.MESSAGE'?: string;\n 'DASHBOARD.REMOVE_WIDGET_CONFIRMATION_DIALOG.REMOVE'?: string;\n 'DASHBOARD.SAVE'?: string;\n 'DASHBOARD.WIDGET.A11Y.ACTIVATED'?: string;\n 'DASHBOARD.WIDGET.A11Y.DEACTIVATED'?: string;\n 'DASHBOARD.WIDGET.A11Y.DESCRIPTION'?: string;\n 'DASHBOARD.WIDGET.A11Y.MOVED'?: string;\n 'DASHBOARD.WIDGET.A11Y.RESIZED'?: string;\n 'DASHBOARD.WIDGET.EDIT'?: string;\n 'DASHBOARD.WIDGET.EXPAND'?: string;\n 'DASHBOARD.WIDGET.REMOVE'?: string;\n 'DASHBOARD.WIDGET.RESTORE'?: string;\n 'DASHBOARD.WIDGET_EDITOR_DIALOG.CANCEL'?: string;\n 'DASHBOARD.WIDGET_EDITOR_DIALOG.DISCARD_CONFIG_CHANGE_DIALOG.CANCEL'?: string;\n 'DASHBOARD.WIDGET_EDITOR_DIALOG.DISCARD_CONFIG_CHANGE_DIALOG.DISCARD'?: string;\n 'DASHBOARD.WIDGET_EDITOR_DIALOG.DISCARD_CONFIG_CHANGE_DIALOG.HEADING'?: string;\n 'DASHBOARD.WIDGET_EDITOR_DIALOG.DISCARD_CONFIG_CHANGE_DIALOG.MESSAGE'?: string;\n 'DASHBOARD.WIDGET_EDITOR_DIALOG.DISCARD_CONFIG_CHANGE_DIALOG.SAVE'?: string;\n 'DASHBOARD.WIDGET_EDITOR_DIALOG.NEXT'?: string;\n 'DASHBOARD.WIDGET_EDITOR_DIALOG.PREVIOUS'?: string;\n 'DASHBOARD.WIDGET_EDITOR_DIALOG.SAVE'?: string;\n 'DASHBOARD.WIDGET_EDITOR_DIALOG.TITLE'?: string;\n 'DASHBOARD.WIDGET_LIBRARY.ADD'?: string;\n 'DASHBOARD.WIDGET_LIBRARY.CANCEL'?: string;\n 'DASHBOARD.WIDGET_LIBRARY.DISCARD_CONFIG_CHANGE_DIALOG.CANCEL'?: string;\n 'DASHBOARD.WIDGET_LIBRARY.DISCARD_CONFIG_CHANGE_DIALOG.DISCARD'?: string;\n 'DASHBOARD.WIDGET_LIBRARY.DISCARD_CONFIG_CHANGE_DIALOG.HEADING'?: string;\n 'DASHBOARD.WIDGET_LIBRARY.DISCARD_CONFIG_CHANGE_DIALOG.MESSAGE'?: string;\n 'DASHBOARD.WIDGET_LIBRARY.EMPTY'?: string;\n 'DASHBOARD.WIDGET_LIBRARY.NEXT'?: string;\n 'DASHBOARD.WIDGET_LIBRARY.PREVIOUS'?: string;\n 'DASHBOARD.WIDGET_LIBRARY.SEARCH_PLACEHOLDER'?: string;\n 'DASHBOARD.WIDGET_LIBRARY.TITLE'?: string;\n 'DASHBOARD.WIDGET_LIBRARY.WIDGET_CATALOG_LIST'?: string;\n}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { Provider } from '@angular/core';\nimport { SI_TRANSLATABLE_VALUES } from '@siemens/element-translate-ng/translate';\n\nimport { SiTranslatableKeys } from './si-translatable-keys.interface';\n\nexport const provideSiDashboardsTranslatableOverrides: (\n values: SiTranslatableKeys\n) => Provider = values => ({\n useValue: values,\n multi: true,\n provide: SI_TRANSLATABLE_VALUES\n});\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nexport * from './si-translatable-keys.interface';\nexport * from './si-translatable-overrides.provider';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAAA;;MCSa,wCAAwC,GAErC,MAAM,KAAK;AACzB,IAAA,QAAQ,EAAE,MAAM;AAChB,IAAA,KAAK,EAAE,IAAI;AACX,IAAA,OAAO,EAAE;AACV,CAAA;;ACfD;;;AAGG;;ACHH;;AAEG;;;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
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, ElementRef, Renderer2, DOCUMENT, Directive, EventEmitter, createNgModule, Injector, EnvironmentInjector, DestroyRef, ViewContainerRef, isSignal,
|
|
3
|
+
import { InjectionToken, inject, input, model, output, viewChild, computed, Component, Injectable, ElementRef, Renderer2, DOCUMENT, Directive, EventEmitter, createNgModule, Injector, EnvironmentInjector, DestroyRef, signal, ViewContainerRef, isSignal, NgZone, IterableDiffers, inputBinding, outputBinding, NgModule } from '@angular/core';
|
|
4
4
|
import { SiDashboardCardComponent, SiDashboardComponent } from '@siemens/element-ng/dashboard';
|
|
5
5
|
import { t, SiTranslatePipe, injectSiTranslateService } from '@siemens/element-translate-ng/translate';
|
|
6
|
-
import { BehaviorSubject, of, Subject, throwError, ReplaySubject, combineLatest } from 'rxjs';
|
|
6
|
+
import { BehaviorSubject, of, Subject, throwError, ReplaySubject, first, combineLatest } from 'rxjs';
|
|
7
7
|
import { take, takeUntil } from 'rxjs/operators';
|
|
8
8
|
import { BOOTSTRAP_BREAKPOINTS, SiResponsiveContainerDirective } from '@siemens/element-ng/resize-observer';
|
|
9
9
|
import { ActivatedRoute, RouterLink } from '@angular/router';
|
|
@@ -13,6 +13,7 @@ import { SiLoadingButtonComponent, SiLoadingSpinnerDirective } from '@siemens/el
|
|
|
13
13
|
import { SiTooltipDirective } from '@siemens/element-ng/tooltip';
|
|
14
14
|
import { SiModalService } from '@siemens/element-ng/modal';
|
|
15
15
|
import { GridStack } from 'gridstack';
|
|
16
|
+
import { LiveAnnouncer } from '@angular/cdk/a11y';
|
|
16
17
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
17
18
|
import { SiActionDialogService } from '@siemens/element-ng/action-modal';
|
|
18
19
|
import { CdkListbox, CdkOption } from '@angular/cdk/listbox';
|
|
@@ -577,6 +578,11 @@ class SiWidgetHostComponent {
|
|
|
577
578
|
injector = inject(Injector);
|
|
578
579
|
envInjector = inject(EnvironmentInjector);
|
|
579
580
|
destroyRef = inject(DestroyRef);
|
|
581
|
+
translateService = injectSiTranslateService();
|
|
582
|
+
liveAnnouncer = inject(LiveAnnouncer);
|
|
583
|
+
elementRef = inject(ElementRef).nativeElement;
|
|
584
|
+
/** @defaultValue false */
|
|
585
|
+
keyboardActive = signal(false, ...(ngDevMode ? [{ debugName: "keyboardActive" }] : []));
|
|
580
586
|
widgetConfig = input.required(...(ngDevMode ? [{ debugName: "widgetConfig" }] : []));
|
|
581
587
|
/**
|
|
582
588
|
* The component factory for this widget's type.
|
|
@@ -590,6 +596,7 @@ class SiWidgetHostComponent {
|
|
|
590
596
|
editable = input(false, ...(ngDevMode ? [{ debugName: "editable" }] : []));
|
|
591
597
|
remove = output();
|
|
592
598
|
edit = output();
|
|
599
|
+
gridEvent = output();
|
|
593
600
|
card = viewChild.required('card');
|
|
594
601
|
widgetHost = viewChild.required('widgetHost', { read: ViewContainerRef });
|
|
595
602
|
labelEdit = t(() => $localize `:@@DASHBOARD.WIDGET.EDIT:Edit`);
|
|
@@ -600,6 +607,11 @@ class SiWidgetHostComponent {
|
|
|
600
607
|
labelDialogHeading = t(() => $localize `:@@DASHBOARD.REMOVE_WIDGET_CONFIRMATION_DIALOG.HEADING:Remove widget`);
|
|
601
608
|
labelDialogRemove = t(() => $localize `:@@DASHBOARD.REMOVE_WIDGET_CONFIRMATION_DIALOG.REMOVE:Remove`);
|
|
602
609
|
labelDialogCancel = t(() => $localize `:@@DASHBOARD.REMOVE_WIDGET_CONFIRMATION_DIALOG.CANCEL:Cancel`);
|
|
610
|
+
a11yWidgetMovedMessage = t(() => $localize `:@@DASHBOARD.WIDGET.A11Y.MOVED:Widget moved to column {{column}}, row {{row}}.`);
|
|
611
|
+
a11yWidgetResizedMessage = t(() => $localize `:@@DASHBOARD.WIDGET.A11Y.RESIZED:Widget resized to {{columns}} columns wide, {{rows}} rows tall.`);
|
|
612
|
+
a11yWidgetActivatedMessage = t(() => $localize `:@@DASHBOARD.WIDGET.A11Y.ACTIVATED:Widget activated. Use arrow keys to move, Shift+arrow keys to resize, Escape to exit.`);
|
|
613
|
+
a11yWidgetDeactivatedMessage = t(() => $localize `:@@DASHBOARD.WIDGET.A11Y.DEACTIVATED:Widget deactivated.`);
|
|
614
|
+
a11yWidgetDescription = t(() => $localize `:@@DASHBOARD.WIDGET.A11Y.DESCRIPTION:Press Enter or Space to activate. Then use arrow keys to move, Shift+arrow keys to resize, Escape to exit.`);
|
|
603
615
|
widgetInstance;
|
|
604
616
|
widgetRef;
|
|
605
617
|
/** @defaultValue [] */
|
|
@@ -673,6 +685,137 @@ class SiWidgetHostComponent {
|
|
|
673
685
|
ngOnInit() {
|
|
674
686
|
this.attachWidgetInstance();
|
|
675
687
|
}
|
|
688
|
+
onToggleActive(event) {
|
|
689
|
+
if (!this.editable() || event.target !== event.currentTarget) {
|
|
690
|
+
return;
|
|
691
|
+
}
|
|
692
|
+
event.preventDefault();
|
|
693
|
+
const active = !this.keyboardActive();
|
|
694
|
+
this.keyboardActive.set(active);
|
|
695
|
+
this.announceTranslated(active ? this.a11yWidgetActivatedMessage : this.a11yWidgetDeactivatedMessage, {});
|
|
696
|
+
}
|
|
697
|
+
onDeactivate(event) {
|
|
698
|
+
if (!this.keyboardActive()) {
|
|
699
|
+
return;
|
|
700
|
+
}
|
|
701
|
+
event.preventDefault();
|
|
702
|
+
this.keyboardActive.set(false);
|
|
703
|
+
this.announceTranslated(this.a11yWidgetDeactivatedMessage, {});
|
|
704
|
+
}
|
|
705
|
+
onFocusOut() {
|
|
706
|
+
if (this.keyboardActive()) {
|
|
707
|
+
this.keyboardActive.set(false);
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
onArrowKey(event) {
|
|
711
|
+
if (!this.keyboardActive()) {
|
|
712
|
+
return;
|
|
713
|
+
}
|
|
714
|
+
const el = this.elementRef;
|
|
715
|
+
const node = el?.gridstackNode;
|
|
716
|
+
if (!node?.grid) {
|
|
717
|
+
return;
|
|
718
|
+
}
|
|
719
|
+
const keyEvent = event;
|
|
720
|
+
if (keyEvent.shiftKey) {
|
|
721
|
+
this.handleResize(keyEvent, node);
|
|
722
|
+
}
|
|
723
|
+
else {
|
|
724
|
+
this.handleMove(keyEvent, node);
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
handleResize(event, node) {
|
|
728
|
+
const el = this.elementRef;
|
|
729
|
+
let { w, h } = node;
|
|
730
|
+
switch (event.key) {
|
|
731
|
+
case 'ArrowRight':
|
|
732
|
+
w = (w ?? 1) + 1;
|
|
733
|
+
break;
|
|
734
|
+
case 'ArrowLeft':
|
|
735
|
+
w = Math.max(node.minW ?? 1, (w ?? 1) - 1);
|
|
736
|
+
break;
|
|
737
|
+
case 'ArrowDown':
|
|
738
|
+
h = (h ?? 1) + 1;
|
|
739
|
+
break;
|
|
740
|
+
case 'ArrowUp':
|
|
741
|
+
h = Math.max(node.minH ?? 1, (h ?? 1) - 1);
|
|
742
|
+
break;
|
|
743
|
+
default:
|
|
744
|
+
return;
|
|
745
|
+
}
|
|
746
|
+
if (w === node.w && h === node.h) {
|
|
747
|
+
return;
|
|
748
|
+
}
|
|
749
|
+
event.preventDefault();
|
|
750
|
+
const grid = node.grid;
|
|
751
|
+
grid.update(el, { w, h });
|
|
752
|
+
this.gridEvent.emit(new Event('resizestop'));
|
|
753
|
+
this.announceTranslated(this.a11yWidgetResizedMessage, { columns: w, rows: h });
|
|
754
|
+
}
|
|
755
|
+
handleMove(event, node) {
|
|
756
|
+
const el = this.elementRef;
|
|
757
|
+
const { x, y } = node;
|
|
758
|
+
const grid = node.grid;
|
|
759
|
+
let newX = x ?? 0;
|
|
760
|
+
let newY = y ?? 0;
|
|
761
|
+
switch (event.key) {
|
|
762
|
+
case 'ArrowRight':
|
|
763
|
+
do {
|
|
764
|
+
newX++;
|
|
765
|
+
grid.update(el, { x: newX, y });
|
|
766
|
+
} while (node.x === x && newX < grid.getColumn());
|
|
767
|
+
break;
|
|
768
|
+
case 'ArrowLeft':
|
|
769
|
+
if (newX <= 0) {
|
|
770
|
+
break;
|
|
771
|
+
}
|
|
772
|
+
do {
|
|
773
|
+
newX--;
|
|
774
|
+
grid.update(el, { x: newX, y });
|
|
775
|
+
} while (node.x === x && newX > 0);
|
|
776
|
+
break;
|
|
777
|
+
case 'ArrowDown':
|
|
778
|
+
do {
|
|
779
|
+
newY++;
|
|
780
|
+
grid.update(el, { x, y: newY });
|
|
781
|
+
} while (node.y === y && newY < grid.getRow());
|
|
782
|
+
break;
|
|
783
|
+
case 'ArrowUp':
|
|
784
|
+
if (newY <= 0) {
|
|
785
|
+
break;
|
|
786
|
+
}
|
|
787
|
+
do {
|
|
788
|
+
newY--;
|
|
789
|
+
grid.update(el, { x, y: newY });
|
|
790
|
+
} while (node.y === y && newY > 0);
|
|
791
|
+
break;
|
|
792
|
+
default:
|
|
793
|
+
return;
|
|
794
|
+
}
|
|
795
|
+
event.preventDefault();
|
|
796
|
+
this.gridEvent.emit(new Event('dragstop'));
|
|
797
|
+
this.scrollIntoViewAfterTransition(el);
|
|
798
|
+
this.announceTranslated(this.a11yWidgetMovedMessage, {
|
|
799
|
+
column: (node.x ?? 0) + 1,
|
|
800
|
+
row: (node.y ?? 0) + 1
|
|
801
|
+
});
|
|
802
|
+
}
|
|
803
|
+
scrollIntoViewAfterTransition(el) {
|
|
804
|
+
const onEnd = () => {
|
|
805
|
+
el.removeEventListener('transitionend', onEnd);
|
|
806
|
+
el.scrollIntoView({ block: 'nearest', behavior: 'smooth' });
|
|
807
|
+
};
|
|
808
|
+
el.addEventListener('transitionend', onEnd, { once: true });
|
|
809
|
+
}
|
|
810
|
+
announce(message) {
|
|
811
|
+
this.liveAnnouncer.announce(message, 'assertive');
|
|
812
|
+
}
|
|
813
|
+
announceTranslated(message, params) {
|
|
814
|
+
this.translateService
|
|
815
|
+
.translateAsync(message, params)
|
|
816
|
+
.pipe(first())
|
|
817
|
+
.subscribe(msg => this.announce(msg));
|
|
818
|
+
}
|
|
676
819
|
attachWidgetInstance() {
|
|
677
820
|
const componentFactory = this.componentFactory();
|
|
678
821
|
if (componentFactory) {
|
|
@@ -705,6 +848,9 @@ class SiWidgetHostComponent {
|
|
|
705
848
|
}
|
|
706
849
|
}
|
|
707
850
|
setupEditable(editable, widgetConfig) {
|
|
851
|
+
if (!editable) {
|
|
852
|
+
this.keyboardActive.set(false);
|
|
853
|
+
}
|
|
708
854
|
widgetConfig ??= {
|
|
709
855
|
primaryActions: this.widgetInstance?.primaryActions,
|
|
710
856
|
secondaryActions: this.widgetInstance?.secondaryActions,
|
|
@@ -783,14 +929,14 @@ class SiWidgetHostComponent {
|
|
|
783
929
|
});
|
|
784
930
|
}
|
|
785
931
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiWidgetHostComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
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"] }] });
|
|
932
|
+
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", gridEvent: "gridEvent" }, 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 [class.elevation-2]=\"keyboardActive()\"\n [class.si-widget-keyboard-active]=\"keyboardActive()\"\n [attr.tabindex]=\"editable() ? 0 : null\"\n [attr.role]=\"editable() ? 'application' : null\"\n [attr.aria-roledescription]=\"editable() ? 'widget' : null\"\n [attr.aria-label]=\"editable() ? widgetConfig().heading : null\"\n [attr.aria-description]=\"editable() ? (a11yWidgetDescription | translate) : null\"\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 (keydown.enter)=\"onToggleActive($event)\"\n (keydown.space)=\"onToggleActive($event)\"\n (keydown.escape)=\"onDeactivate($event)\"\n (keydown.arrowRight)=\"onArrowKey($event)\"\n (keydown.arrowLeft)=\"onArrowKey($event)\"\n (keydown.arrowUp)=\"onArrowKey($event)\"\n (keydown.arrowDown)=\"onArrowKey($event)\"\n (keydown.shift.arrowRight)=\"onArrowKey($event)\"\n (keydown.shift.arrowLeft)=\"onArrowKey($event)\"\n (keydown.shift.arrowUp)=\"onArrowKey($event)\"\n (keydown.shift.arrowDown)=\"onArrowKey($event)\"\n (focusout)=\"onFocusOut()\"\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"] }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }] });
|
|
787
933
|
}
|
|
788
934
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiWidgetHostComponent, decorators: [{
|
|
789
935
|
type: Component,
|
|
790
|
-
args: [{ selector: 'si-widget-host', imports: [SiDashboardCardComponent, NgTemplateOutlet], host: {
|
|
936
|
+
args: [{ selector: 'si-widget-host', imports: [SiDashboardCardComponent, NgTemplateOutlet, SiTranslatePipe], host: {
|
|
791
937
|
class: 'grid-stack-item'
|
|
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 }] }] } });
|
|
938
|
+
}, 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 [class.elevation-2]=\"keyboardActive()\"\n [class.si-widget-keyboard-active]=\"keyboardActive()\"\n [attr.tabindex]=\"editable() ? 0 : null\"\n [attr.role]=\"editable() ? 'application' : null\"\n [attr.aria-roledescription]=\"editable() ? 'widget' : null\"\n [attr.aria-label]=\"editable() ? widgetConfig().heading : null\"\n [attr.aria-description]=\"editable() ? (a11yWidgetDescription | translate) : null\"\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 (keydown.enter)=\"onToggleActive($event)\"\n (keydown.space)=\"onToggleActive($event)\"\n (keydown.escape)=\"onDeactivate($event)\"\n (keydown.arrowRight)=\"onArrowKey($event)\"\n (keydown.arrowLeft)=\"onArrowKey($event)\"\n (keydown.arrowUp)=\"onArrowKey($event)\"\n (keydown.arrowDown)=\"onArrowKey($event)\"\n (keydown.shift.arrowRight)=\"onArrowKey($event)\"\n (keydown.shift.arrowLeft)=\"onArrowKey($event)\"\n (keydown.shift.arrowUp)=\"onArrowKey($event)\"\n (keydown.shift.arrowDown)=\"onArrowKey($event)\"\n (focusout)=\"onFocusOut()\"\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"] }]
|
|
939
|
+
}], 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"] }], gridEvent: [{ type: i0.Output, args: ["gridEvent"] }], card: [{ type: i0.ViewChild, args: ['card', { isSignal: true }] }], widgetHost: [{ type: i0.ViewChild, args: ['widgetHost', { ...{ read: ViewContainerRef }, isSignal: true }] }] } });
|
|
794
940
|
|
|
795
941
|
/**
|
|
796
942
|
* Copyright (c) Siemens 2016 - 2026
|
|
@@ -941,6 +1087,9 @@ class SiGridstackWrapperComponent {
|
|
|
941
1087
|
}),
|
|
942
1088
|
outputBinding('edit', widgetConfig => {
|
|
943
1089
|
this.widgetInstanceEdit.emit(widgetConfig);
|
|
1090
|
+
}),
|
|
1091
|
+
outputBinding('gridEvent', event => {
|
|
1092
|
+
this.gridEvent.emit({ event, grid: this.grid });
|
|
944
1093
|
})
|
|
945
1094
|
]
|
|
946
1095
|
});
|