@siemens/dashboards-ng 51.0.0-rc.6 → 51.0.0-rc.8
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.
|
@@ -7,7 +7,7 @@ import { BehaviorSubject, of, Subject, throwError, ReplaySubject, first, combine
|
|
|
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';
|
|
10
|
-
import { elementEdit } from '@siemens/element-icons';
|
|
10
|
+
import { elementEdit, elementApps } from '@siemens/element-icons';
|
|
11
11
|
import { SiContentActionBarComponent } from '@siemens/element-ng/content-action-bar';
|
|
12
12
|
import { addIcons, SiIconComponent } from '@siemens/element-ng/icon';
|
|
13
13
|
import { SiLinkDirective } from '@siemens/element-ng/link';
|
|
@@ -599,6 +599,7 @@ class SiWidgetHostComponent {
|
|
|
599
599
|
destroyRef = inject(DestroyRef);
|
|
600
600
|
translateService = injectSiTranslateService();
|
|
601
601
|
liveAnnouncer = inject(LiveAnnouncer);
|
|
602
|
+
elementAppsIcon = addIcons({ elementApps }).elementApps;
|
|
602
603
|
/** @internal */
|
|
603
604
|
elementRef = inject(ElementRef).nativeElement;
|
|
604
605
|
/** @defaultValue false */
|
|
@@ -614,12 +615,12 @@ class SiWidgetHostComponent {
|
|
|
614
615
|
componentFactory = input(/* @ts-ignore */
|
|
615
616
|
...(ngDevMode ? [undefined, { debugName: "componentFactory" }] : /* istanbul ignore next */ []));
|
|
616
617
|
/**
|
|
617
|
-
*
|
|
618
|
+
* Icon for the widget, displayed in the configuration placeholder.
|
|
618
619
|
*
|
|
619
|
-
* @defaultValue
|
|
620
|
+
* @defaultValue this.elementAppsIcon
|
|
620
621
|
*/
|
|
621
|
-
|
|
622
|
-
...(ngDevMode ? [{ debugName: "
|
|
622
|
+
widgetIcon = input(/* @ts-ignore */
|
|
623
|
+
...(ngDevMode ? [undefined, { debugName: "widgetIcon" }] : /* istanbul ignore next */ []));
|
|
623
624
|
/**
|
|
624
625
|
* Sets the widget host into editable mode.
|
|
625
626
|
*
|
|
@@ -656,7 +657,7 @@ class SiWidgetHostComponent {
|
|
|
656
657
|
return null;
|
|
657
658
|
}, /* @ts-ignore */
|
|
658
659
|
...(ngDevMode ? [{ debugName: "widgetAriaLabel" }] : /* istanbul ignore next */ []));
|
|
659
|
-
emptyStateIcon = computed(() =>
|
|
660
|
+
emptyStateIcon = computed(() => this.widgetIcon() ?? this.elementAppsIcon, /* @ts-ignore */
|
|
660
661
|
...(ngDevMode ? [{ debugName: "emptyStateIcon" }] : /* istanbul ignore next */ []));
|
|
661
662
|
widgetInstance;
|
|
662
663
|
widgetRef;
|
|
@@ -723,6 +724,7 @@ class SiWidgetHostComponent {
|
|
|
723
724
|
...(ngDevMode ? [{ debugName: "accentLine" }] : /* istanbul ignore next */ []));
|
|
724
725
|
setupPending = computed(() => !!this.widgetConfig().setupPending, /* @ts-ignore */
|
|
725
726
|
...(ngDevMode ? [{ debugName: "setupPending" }] : /* istanbul ignore next */ []));
|
|
727
|
+
moveInProgress = false;
|
|
726
728
|
ngOnChanges(changes) {
|
|
727
729
|
if (changes.widgetConfig) {
|
|
728
730
|
const options = {
|
|
@@ -791,7 +793,7 @@ class SiWidgetHostComponent {
|
|
|
791
793
|
this.announceTranslated(this.a11yWidgetDeactivatedMessage, {});
|
|
792
794
|
}
|
|
793
795
|
onFocusOut() {
|
|
794
|
-
if (this.keyboardActive()) {
|
|
796
|
+
if (this.keyboardActive() && !this.moveInProgress) {
|
|
795
797
|
this.keyboardActive.set(false);
|
|
796
798
|
}
|
|
797
799
|
}
|
|
@@ -805,12 +807,15 @@ class SiWidgetHostComponent {
|
|
|
805
807
|
return;
|
|
806
808
|
}
|
|
807
809
|
const keyEvent = event;
|
|
810
|
+
this.moveInProgress = true;
|
|
808
811
|
if (keyEvent.shiftKey) {
|
|
809
812
|
this.handleResize(keyEvent, node);
|
|
810
813
|
}
|
|
811
814
|
else {
|
|
812
815
|
this.handleMove(keyEvent, node);
|
|
813
816
|
}
|
|
817
|
+
this.card().element.nativeElement.focus();
|
|
818
|
+
this.moveInProgress = false;
|
|
814
819
|
}
|
|
815
820
|
handleResize(event, node) {
|
|
816
821
|
const el = this.elementRef;
|
|
@@ -1035,7 +1040,7 @@ class SiWidgetHostComponent {
|
|
|
1035
1040
|
});
|
|
1036
1041
|
}
|
|
1037
1042
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiWidgetHostComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1038
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: SiWidgetHostComponent, isStandalone: true, selector: "si-widget-host", inputs: { widgetConfig: { classPropertyName: "widgetConfig", publicName: "widgetConfig", isSignal: true, isRequired: true, transformFunction: null }, grid: { classPropertyName: "grid", publicName: "grid", isSignal: true, isRequired: false, transformFunction: null }, componentFactory: { classPropertyName: "componentFactory", publicName: "componentFactory", isSignal: true, isRequired: false, transformFunction: null },
|
|
1043
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: SiWidgetHostComponent, isStandalone: true, selector: "si-widget-host", inputs: { widgetConfig: { classPropertyName: "widgetConfig", publicName: "widgetConfig", isSignal: true, isRequired: true, transformFunction: null }, grid: { classPropertyName: "grid", publicName: "grid", isSignal: true, isRequired: false, transformFunction: null }, componentFactory: { classPropertyName: "componentFactory", publicName: "componentFactory", isSignal: true, isRequired: false, transformFunction: null }, widgetIcon: { classPropertyName: "widgetIcon", publicName: "widgetIcon", 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: { properties: { "attr.role": "editable() ? null : 'listitem'", "attr.aria-roledescription": "editable() ? null : 'widget'", "attr.aria-label": "editable() || !widgetAriaLabel() ? null : widgetAriaLabel()" }, 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\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]=\"!setupPending() ? 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 @if (setupPending()) {\n <si-empty-state\n [icon]=\"emptyStateIcon()\"\n [heading]=\"labelSetup\"\n [content]=\"labelSetupMessage\"\n />\n }\n </div>\n @let footer = widgetInstanceFooter();\n @if (footer && !setupPending()) {\n <div class=\"card-footer\" footer>\n <ng-container *ngTemplateOutlet=\"footer\" />\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:var(--si-sys-sizing-spacing-y-30)!important;inset-inline-end:var(--si-sys-sizing-spacing-x-30)!important}.resize-handle{inset-block-end:var(--si-sys-sizing-spacing-y-30);color:var(--si-sys-text-secondary);pointer-events:none;position:absolute;inset-inline-end:var(--si-sys-sizing-spacing-x-30);text-align:center;z-index:10}.draggable-overlay{inset:var(--si-sys-sizing-spacing-y-40) var(--si-sys-sizing-spacing-x-40);position:absolute;z-index:100}si-empty-state{display:block;block-size:100%;inline-size:100%;overflow:auto}\n"], dependencies: [{ kind: "component", type: SiDashboardCardComponent, selector: "si-dashboard-card", inputs: ["restoreText", "expandText", "enableExpandInteraction", "showMenubar"], outputs: ["expandChange"] }, { kind: "component", type: SiEmptyStateComponent, selector: "si-empty-state", inputs: ["icon", "heading", "content"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }] });
|
|
1039
1044
|
}
|
|
1040
1045
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiWidgetHostComponent, decorators: [{
|
|
1041
1046
|
type: Component,
|
|
@@ -1047,8 +1052,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
1047
1052
|
'[attr.role]': "editable() ? null : 'listitem'",
|
|
1048
1053
|
'[attr.aria-roledescription]': "editable() ? null : 'widget'",
|
|
1049
1054
|
'[attr.aria-label]': 'editable() || !widgetAriaLabel() ? null : widgetAriaLabel()'
|
|
1050
|
-
}, 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\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]=\"!setupPending() ? 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 @if (setupPending()) {\n <si-empty-state\n [icon]=\"emptyStateIcon()\"\n [heading]=\"labelSetup\"\n [content]=\"labelSetupMessage\"\n />\n }\n </div>\n @let footer = widgetInstanceFooter();\n @if (footer && !setupPending()) {\n <div class=\"card-footer\" footer>\n <ng-container *ngTemplateOutlet=\"footer\" />\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:
|
|
1051
|
-
}], propDecorators: { widgetConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "widgetConfig", required: true }] }], grid: [{ type: i0.Input, args: [{ isSignal: true, alias: "grid", required: false }] }], componentFactory: [{ type: i0.Input, args: [{ isSignal: true, alias: "componentFactory", required: false }] }],
|
|
1055
|
+
}, 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\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]=\"!setupPending() ? 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 @if (setupPending()) {\n <si-empty-state\n [icon]=\"emptyStateIcon()\"\n [heading]=\"labelSetup\"\n [content]=\"labelSetupMessage\"\n />\n }\n </div>\n @let footer = widgetInstanceFooter();\n @if (footer && !setupPending()) {\n <div class=\"card-footer\" footer>\n <ng-container *ngTemplateOutlet=\"footer\" />\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:var(--si-sys-sizing-spacing-y-30)!important;inset-inline-end:var(--si-sys-sizing-spacing-x-30)!important}.resize-handle{inset-block-end:var(--si-sys-sizing-spacing-y-30);color:var(--si-sys-text-secondary);pointer-events:none;position:absolute;inset-inline-end:var(--si-sys-sizing-spacing-x-30);text-align:center;z-index:10}.draggable-overlay{inset:var(--si-sys-sizing-spacing-y-40) var(--si-sys-sizing-spacing-x-40);position:absolute;z-index:100}si-empty-state{display:block;block-size:100%;inline-size:100%;overflow:auto}\n"] }]
|
|
1056
|
+
}], propDecorators: { widgetConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "widgetConfig", required: true }] }], grid: [{ type: i0.Input, args: [{ isSignal: true, alias: "grid", required: false }] }], componentFactory: [{ type: i0.Input, args: [{ isSignal: true, alias: "componentFactory", required: false }] }], widgetIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "widgetIcon", 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 }] }] } });
|
|
1052
1057
|
|
|
1053
1058
|
/**
|
|
1054
1059
|
* Copyright (c) Siemens 2016 - 2026
|
|
@@ -1137,9 +1142,12 @@ class SiGridstackWrapperComponent {
|
|
|
1137
1142
|
...this.gridConfig()?.gridStackOptions,
|
|
1138
1143
|
...initialViewMode
|
|
1139
1144
|
};
|
|
1140
|
-
this.grid =
|
|
1145
|
+
this.grid =
|
|
1146
|
+
GridStack.init(options, this.elementRef.nativeElement.firstChild) ?? undefined;
|
|
1141
1147
|
this.startBatch();
|
|
1142
|
-
|
|
1148
|
+
if (this.grid) {
|
|
1149
|
+
this.hookEvents(this.grid);
|
|
1150
|
+
}
|
|
1143
1151
|
this.destroyRef.onDestroy(() => this.grid?.destroy());
|
|
1144
1152
|
}
|
|
1145
1153
|
startBatch() {
|
|
@@ -1176,11 +1184,11 @@ class SiGridstackWrapperComponent {
|
|
|
1176
1184
|
});
|
|
1177
1185
|
}
|
|
1178
1186
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiGridstackWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1179
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.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: "widgetHosts", predicate: SiWidgetHostComponent, descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"grid-stack\"\n [attr.role]=\"editable() ? null : 'list'\"\n [attr.aria-label]=\"editable() ? null : (a11yWidgetsListLabel | translate)\"\n>\n @if (grid) {\n @for (item of widgetConfigs(); track item.id) {\n @let widget = widgetCatalogMap().get(item.widgetId);\n <si-widget-host\n [grid]=\"grid\"\n [editable]=\"editable()\"\n [widgetConfig]=\"item\"\n [
|
|
1187
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.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: "widgetHosts", predicate: SiWidgetHostComponent, descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"grid-stack\"\n [attr.role]=\"editable() ? null : 'list'\"\n [attr.aria-label]=\"editable() ? null : (a11yWidgetsListLabel | translate)\"\n>\n @if (grid) {\n @for (item of widgetConfigs(); track item.id) {\n @let widget = widgetCatalogMap().get(item.widgetId);\n <si-widget-host\n [grid]=\"grid\"\n [editable]=\"editable()\"\n [widgetConfig]=\"item\"\n [widgetIcon]=\"widget?.iconClass\"\n [componentFactory]=\"widget?.componentFactory\"\n (remove)=\"widgetInstanceRemove.emit(item.id)\"\n (edit)=\"widgetInstanceEdit.emit(item)\"\n />\n }\n }\n</div>\n", styles: ["::ng-deep .si-grid-stack-placeholder{background-color:var(--si-sys-background-information-subtle);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"], dependencies: [{ kind: "component", type: SiWidgetHostComponent, selector: "si-widget-host", inputs: ["widgetConfig", "grid", "componentFactory", "widgetIcon", "editable"], outputs: ["remove", "edit", "gridEvent"] }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }] });
|
|
1180
1188
|
}
|
|
1181
1189
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiGridstackWrapperComponent, decorators: [{
|
|
1182
1190
|
type: Component,
|
|
1183
|
-
args: [{ selector: 'si-gridstack-wrapper', imports: [SiWidgetHostComponent, SiTranslatePipe], template: "<div\n class=\"grid-stack\"\n [attr.role]=\"editable() ? null : 'list'\"\n [attr.aria-label]=\"editable() ? null : (a11yWidgetsListLabel | translate)\"\n>\n @if (grid) {\n @for (item of widgetConfigs(); track item.id) {\n @let widget = widgetCatalogMap().get(item.widgetId);\n <si-widget-host\n [grid]=\"grid\"\n [editable]=\"editable()\"\n [widgetConfig]=\"item\"\n [
|
|
1191
|
+
args: [{ selector: 'si-gridstack-wrapper', imports: [SiWidgetHostComponent, SiTranslatePipe], template: "<div\n class=\"grid-stack\"\n [attr.role]=\"editable() ? null : 'list'\"\n [attr.aria-label]=\"editable() ? null : (a11yWidgetsListLabel | translate)\"\n>\n @if (grid) {\n @for (item of widgetConfigs(); track item.id) {\n @let widget = widgetCatalogMap().get(item.widgetId);\n <si-widget-host\n [grid]=\"grid\"\n [editable]=\"editable()\"\n [widgetConfig]=\"item\"\n [widgetIcon]=\"widget?.iconClass\"\n [componentFactory]=\"widget?.componentFactory\"\n (remove)=\"widgetInstanceRemove.emit(item.id)\"\n (edit)=\"widgetInstanceEdit.emit(item)\"\n />\n }\n }\n</div>\n", styles: ["::ng-deep .si-grid-stack-placeholder{background-color:var(--si-sys-background-information-subtle);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"] }]
|
|
1184
1192
|
}], 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"] }], widgetHosts: [{ type: i0.ViewChildren, args: [i0.forwardRef(() => SiWidgetHostComponent), { isSignal: true }] }] } });
|
|
1185
1193
|
|
|
1186
1194
|
/**
|
|
@@ -1393,11 +1401,11 @@ class SiWidgetInstanceEditorDialogComponent extends SiWidgetEditorBase {
|
|
|
1393
1401
|
this.closed.emit(this.widgetConfig());
|
|
1394
1402
|
}
|
|
1395
1403
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiWidgetInstanceEditorDialogComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1396
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.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
|
|
1404
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.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:calc(var(--si-sys-sizing-spacing-x-20) * -1);margin-block-start:calc(var(--si-sys-sizing-spacing-y-20) * -1)}.editor-footer{align-items:center;display:flex;flex-shrink:0;flex-wrap:wrap;justify-content:flex-end}.editor-footer>*{margin-inline-start:var(--si-sys-sizing-spacing-x-60)}\n"], dependencies: [{ kind: "pipe", type: SiTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
1397
1405
|
}
|
|
1398
1406
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiWidgetInstanceEditorDialogComponent, decorators: [{
|
|
1399
1407
|
type: Component,
|
|
1400
|
-
args: [{ selector: 'si-widget-instance-editor-dialog', imports: [SiTranslatePipe], changeDetection: ChangeDetectionStrategy.Eager, 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
|
|
1408
|
+
args: [{ selector: 'si-widget-instance-editor-dialog', imports: [SiTranslatePipe], changeDetection: ChangeDetectionStrategy.Eager, 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:calc(var(--si-sys-sizing-spacing-x-20) * -1);margin-block-start:calc(var(--si-sys-sizing-spacing-y-20) * -1)}.editor-footer{align-items:center;display:flex;flex-shrink:0;flex-wrap:wrap;justify-content:flex-end}.editor-footer>*{margin-inline-start:var(--si-sys-sizing-spacing-x-60)}\n"] }]
|
|
1401
1409
|
}], 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"] }] } });
|
|
1402
1410
|
|
|
1403
1411
|
/**
|
|
@@ -2105,7 +2113,7 @@ class SiWidgetCatalogComponent extends SiWidgetEditorBase {
|
|
|
2105
2113
|
return config;
|
|
2106
2114
|
}
|
|
2107
2115
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiWidgetCatalogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2108
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: SiWidgetCatalogComponent, isStandalone: true, selector: "si-widget-catalog", inputs: { multiSelect: { classPropertyName: "multiSelect", publicName: "multiSelect", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closed: "closed" }, 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 d-flex\">\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
|
|
2116
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: SiWidgetCatalogComponent, isStandalone: true, selector: "si-widget-catalog", inputs: { multiSelect: { classPropertyName: "multiSelect", publicName: "multiSelect", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closed: "closed" }, 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 d-flex\">\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 background-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]=\"selectedWidgets()\"\n [cdkListboxMultiple]=\"multiSelect()\"\n (cdkListboxValueChange)=\"selectWidgets($event.value)\"\n >\n @for (widget of filteredWidgetCatalog; track $index) {\n <li\n class=\"list-group-item d-flex list-group-item-action\"\n [cdkOption]=\"widget\"\n [class.active]=\"selectedWidgets().includes(widget)\"\n >\n @if (multiSelect()) {\n <div class=\"form-check d-flex align-items-center me-5 my-n1\" inert>\n <input\n type=\"checkbox\"\n class=\"form-check-input\"\n aria-hidden=\"true\"\n [checked]=\"selectedWidgets().includes(widget)\"\n />\n </div>\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:calc(var(--si-sys-sizing-spacing-x-20) * -1);margin-block-start:calc(var(--si-sys-sizing-spacing-y-20) * -1)}.list-group-item{cursor:pointer}.list-group-item .form-check{block-size:2.5rem}.catalog-footer{align-items:center;display:flex;flex-shrink:0;flex-wrap:wrap;justify-content:flex-end}.catalog-footer>*{margin-inline-start:var(--si-sys-sizing-spacing-x-60)}\n"], dependencies: [{ kind: "component", type: SiSearchBarComponent, selector: "si-search-bar", inputs: ["debounceTime", "prohibitedCharacters", "placeholder", "showIcon", "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" }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
2109
2117
|
}
|
|
2110
2118
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiWidgetCatalogComponent, decorators: [{
|
|
2111
2119
|
type: Component,
|
|
@@ -2116,7 +2124,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
2116
2124
|
SiTranslatePipe,
|
|
2117
2125
|
CdkListbox,
|
|
2118
2126
|
CdkOption
|
|
2119
|
-
], changeDetection: ChangeDetectionStrategy.Eager, 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 d-flex\">\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
|
|
2127
|
+
], changeDetection: ChangeDetectionStrategy.Eager, 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 d-flex\">\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 background-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]=\"selectedWidgets()\"\n [cdkListboxMultiple]=\"multiSelect()\"\n (cdkListboxValueChange)=\"selectWidgets($event.value)\"\n >\n @for (widget of filteredWidgetCatalog; track $index) {\n <li\n class=\"list-group-item d-flex list-group-item-action\"\n [cdkOption]=\"widget\"\n [class.active]=\"selectedWidgets().includes(widget)\"\n >\n @if (multiSelect()) {\n <div class=\"form-check d-flex align-items-center me-5 my-n1\" inert>\n <input\n type=\"checkbox\"\n class=\"form-check-input\"\n aria-hidden=\"true\"\n [checked]=\"selectedWidgets().includes(widget)\"\n />\n </div>\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:calc(var(--si-sys-sizing-spacing-x-20) * -1);margin-block-start:calc(var(--si-sys-sizing-spacing-y-20) * -1)}.list-group-item{cursor:pointer}.list-group-item .form-check{block-size:2.5rem}.catalog-footer{align-items:center;display:flex;flex-shrink:0;flex-wrap:wrap;justify-content:flex-end}.catalog-footer>*{margin-inline-start:var(--si-sys-sizing-spacing-x-60)}\n"] }]
|
|
2120
2128
|
}], ctorParameters: () => [], propDecorators: { multiSelect: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiSelect", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
|
|
2121
2129
|
|
|
2122
2130
|
/**
|
|
@@ -2455,7 +2463,7 @@ class SiWidgetRendererComponent {
|
|
|
2455
2463
|
widget = input.required(/* @ts-ignore */
|
|
2456
2464
|
...(ngDevMode ? [{ debugName: "widget" }] : /* istanbul ignore next */ []));
|
|
2457
2465
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiWidgetRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2458
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.8", type: SiWidgetRendererComponent, isStandalone: true, selector: "si-widget-renderer", inputs: { widgetConfig: { classPropertyName: "widgetConfig", publicName: "widgetConfig", isSignal: true, isRequired: true, transformFunction: null }, widget: { classPropertyName: "widget", publicName: "widget", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<si-widget-host\n class=\"h-100\"\n [widgetConfig]=\"widgetConfig()\"\n [componentFactory]=\"widget().componentFactory\"\n/>\n", styles: ["si-widget-host ::ng-deep .grid-stack-item-content{flex:1 1 auto;min-inline-size:0;min-block-size:0;padding:0!important}\n"], dependencies: [{ kind: "component", type: SiWidgetHostComponent, selector: "si-widget-host", inputs: ["widgetConfig", "grid", "componentFactory", "
|
|
2466
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.8", type: SiWidgetRendererComponent, isStandalone: true, selector: "si-widget-renderer", inputs: { widgetConfig: { classPropertyName: "widgetConfig", publicName: "widgetConfig", isSignal: true, isRequired: true, transformFunction: null }, widget: { classPropertyName: "widget", publicName: "widget", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<si-widget-host\n class=\"h-100\"\n [widgetConfig]=\"widgetConfig()\"\n [componentFactory]=\"widget().componentFactory\"\n/>\n", styles: ["si-widget-host ::ng-deep .grid-stack-item-content{flex:1 1 auto;min-inline-size:0;min-block-size:0;padding:0!important}\n"], dependencies: [{ kind: "component", type: SiWidgetHostComponent, selector: "si-widget-host", inputs: ["widgetConfig", "grid", "componentFactory", "widgetIcon", "editable"], outputs: ["remove", "edit", "gridEvent"] }] });
|
|
2459
2467
|
}
|
|
2460
2468
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiWidgetRendererComponent, decorators: [{
|
|
2461
2469
|
type: Component,
|