@siemens/dashboards-ng 48.8.0 → 49.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -17
- package/fesm2022/siemens-dashboards-ng-module-federation.mjs.map +1 -1
- package/fesm2022/siemens-dashboards-ng.mjs +220 -197
- package/fesm2022/siemens-dashboards-ng.mjs.map +1 -1
- package/module-federation/package.json +2 -1
- package/package.json +9 -10
- package/translate/package.json +2 -1
- package/{index.d.ts → types/siemens-dashboards-ng.d.ts} +105 -82
- /package/{module-federation/index.d.ts → types/siemens-dashboards-ng-module-federation.d.ts} +0 -0
- /package/{translate/index.d.ts → types/siemens-dashboards-ng-translate.d.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
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,
|
|
3
|
+
import { InjectionToken, inject, input, model, output, viewChild, computed, Component, Injectable, signal, Renderer2, DOCUMENT, ElementRef, ViewChild, Input, Directive, EventEmitter, createNgModule, Injector, EnvironmentInjector, DestroyRef, ViewContainerRef, isSignal, NgZone, inputBinding, outputBinding, NgModule } from '@angular/core';
|
|
4
4
|
import { SiDashboardCardComponent, SiDashboardComponent } from '@siemens/element-ng/dashboard';
|
|
5
5
|
import { t, SiTranslatePipe } from '@siemens/element-translate-ng/translate';
|
|
6
6
|
import { BehaviorSubject, of, Subject, throwError, ReplaySubject, combineLatest } from 'rxjs';
|
|
@@ -9,7 +9,7 @@ import { BOOTSTRAP_BREAKPOINTS, SiResponsiveContainerDirective } from '@siemens/
|
|
|
9
9
|
import { ActivatedRoute, RouterLink } from '@angular/router';
|
|
10
10
|
import { SiContentActionBarComponent } from '@siemens/element-ng/content-action-bar';
|
|
11
11
|
import { SiLinkDirective } from '@siemens/element-ng/link';
|
|
12
|
-
import { SiLoadingSpinnerComponent,
|
|
12
|
+
import { SiLoadingSpinnerComponent, SiLoadingSpinnerDirective } from '@siemens/element-ng/loading-spinner';
|
|
13
13
|
import { SiModalService } from '@siemens/element-ng/modal';
|
|
14
14
|
import { GridStack } from 'gridstack';
|
|
15
15
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
@@ -48,10 +48,6 @@ const SI_DASHBOARD_CONFIGURATION = new InjectionToken('Injection token to config
|
|
|
48
48
|
providedIn: 'root',
|
|
49
49
|
factory: () => ({ grid: { gridStackOptions: DEFAULT_GRIDSTACK_OPTIONS } })
|
|
50
50
|
});
|
|
51
|
-
/**
|
|
52
|
-
* @deprecated Use SI_DASHBOARD_CONFIGURATION instead.
|
|
53
|
-
*/
|
|
54
|
-
const CONFIG_TOKEN = SI_DASHBOARD_CONFIGURATION;
|
|
55
51
|
|
|
56
52
|
/**
|
|
57
53
|
* Copyright (c) Siemens 2016 - 2025
|
|
@@ -117,26 +113,19 @@ class SiDefaultWidgetStorage extends SiWidgetStorage {
|
|
|
117
113
|
}
|
|
118
114
|
return this.map.get(dashboardId);
|
|
119
115
|
}
|
|
120
|
-
save(
|
|
121
|
-
const newWidgets =
|
|
122
|
-
if (widget.id === undefined) {
|
|
123
|
-
return { ...widget, id: Math.random().toString(36).substring(2, 9) };
|
|
124
|
-
}
|
|
125
|
-
else {
|
|
126
|
-
return widget;
|
|
127
|
-
}
|
|
128
|
-
});
|
|
116
|
+
save(modifiedWidgets, addedWidgets, removedWidgets, dashboardId) {
|
|
117
|
+
const newWidgets = [...addedWidgets, ...modifiedWidgets];
|
|
129
118
|
this.update(newWidgets, dashboardId);
|
|
130
119
|
return of(newWidgets);
|
|
131
120
|
}
|
|
132
|
-
update(
|
|
121
|
+
update(widgetConfigs, dashboardId) {
|
|
133
122
|
const widgets$ = this.load(dashboardId);
|
|
134
|
-
widgets$.next(
|
|
123
|
+
widgets$.next(widgetConfigs);
|
|
135
124
|
if (!dashboardId) {
|
|
136
|
-
this.storage.setItem(STORAGE_KEY, JSON.stringify(
|
|
125
|
+
this.storage.setItem(STORAGE_KEY, JSON.stringify(widgetConfigs));
|
|
137
126
|
}
|
|
138
127
|
else {
|
|
139
|
-
this.storage.setItem(`${STORAGE_KEY}-${dashboardId}`, JSON.stringify(
|
|
128
|
+
this.storage.setItem(`${STORAGE_KEY}-${dashboardId}`, JSON.stringify(widgetConfigs));
|
|
140
129
|
}
|
|
141
130
|
}
|
|
142
131
|
loadFromStorage(dashboardId) {
|
|
@@ -173,44 +162,44 @@ class SiDashboardToolbarComponent {
|
|
|
173
162
|
*
|
|
174
163
|
* @defaultValue []
|
|
175
164
|
*/
|
|
176
|
-
primaryEditActions = input([]);
|
|
165
|
+
primaryEditActions = input([], ...(ngDevMode ? [{ debugName: "primaryEditActions" }] : []));
|
|
177
166
|
/**
|
|
178
167
|
* Set secondary actions that are in `editable` mode second visible or in
|
|
179
168
|
* the dropdown part of the content action bar of the toolbar.
|
|
180
169
|
*
|
|
181
170
|
* @defaultValue [] */
|
|
182
|
-
secondaryEditActions = input([]);
|
|
171
|
+
secondaryEditActions = input([], ...(ngDevMode ? [{ debugName: "secondaryEditActions" }] : []));
|
|
183
172
|
/**
|
|
184
173
|
* Input to disable the save button. Note, the input `disabled` disables all
|
|
185
174
|
* actions and the save button of the toolbar.
|
|
186
175
|
*
|
|
187
176
|
* @defaultValue true
|
|
188
177
|
*/
|
|
189
|
-
disableSaveButton = model(true);
|
|
178
|
+
disableSaveButton = model(true, ...(ngDevMode ? [{ debugName: "disableSaveButton" }] : []));
|
|
190
179
|
/**
|
|
191
180
|
* Input to disable all actions and buttons of the toolbar.
|
|
192
181
|
*
|
|
193
182
|
* @defaultValue false */
|
|
194
|
-
disabled = input(false);
|
|
183
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
195
184
|
/**
|
|
196
185
|
* Input option to set the `editable` mode. When editable
|
|
197
186
|
* the toolbar shows a cancel and save button. Otherwise,
|
|
198
187
|
* it displays an edit button.
|
|
199
188
|
*
|
|
200
189
|
* @defaultValue false */
|
|
201
|
-
editable = model(false);
|
|
190
|
+
editable = model(false, ...(ngDevMode ? [{ debugName: "editable" }] : []));
|
|
202
191
|
/**
|
|
203
192
|
* Option to hide the dashboard edit button.
|
|
204
193
|
*
|
|
205
194
|
* @defaultValue false
|
|
206
195
|
*/
|
|
207
|
-
hideEditButton = input(false);
|
|
196
|
+
hideEditButton = input(false, ...(ngDevMode ? [{ debugName: "hideEditButton" }] : []));
|
|
208
197
|
/**
|
|
209
198
|
* Option to display the edit button as a text button instead, only if the window is larger than xs {@link SiResponsiveContainerDirective}.
|
|
210
199
|
*
|
|
211
200
|
* @defaultValue false
|
|
212
201
|
*/
|
|
213
|
-
showEditButtonLabel = input(false);
|
|
202
|
+
showEditButtonLabel = input(false, ...(ngDevMode ? [{ debugName: "showEditButtonLabel" }] : []));
|
|
214
203
|
/**
|
|
215
204
|
* Emits on save button click.
|
|
216
205
|
*/
|
|
@@ -225,11 +214,11 @@ class SiDashboardToolbarComponent {
|
|
|
225
214
|
labelSave = t(() => $localize `:@@DASHBOARD.SAVE:Save`);
|
|
226
215
|
activatedRoute = inject(ActivatedRoute, { optional: true });
|
|
227
216
|
dashboardToolbarContainer = viewChild.required(SiResponsiveContainerDirective);
|
|
228
|
-
showContentActionBar = computed(() => this.primaryEditActions()?.length + this.secondaryEditActions()?.length > 3);
|
|
217
|
+
showContentActionBar = computed(() => this.primaryEditActions()?.length + this.secondaryEditActions()?.length > 3, ...(ngDevMode ? [{ debugName: "showContentActionBar" }] : []));
|
|
229
218
|
editActions = computed(() => [
|
|
230
219
|
...this.primaryEditActions(),
|
|
231
220
|
...this.secondaryEditActions()
|
|
232
|
-
]);
|
|
221
|
+
], ...(ngDevMode ? [{ debugName: "editActions" }] : []));
|
|
233
222
|
onEdit() {
|
|
234
223
|
this.editable.set(true);
|
|
235
224
|
}
|
|
@@ -248,21 +237,68 @@ class SiDashboardToolbarComponent {
|
|
|
248
237
|
}
|
|
249
238
|
showEditButtonLabelDesktop = computed(() => {
|
|
250
239
|
return this.showEditButtonLabel() && !this.dashboardToolbarContainer()?.xs();
|
|
251
|
-
});
|
|
252
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
253
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
240
|
+
}, ...(ngDevMode ? [{ debugName: "showEditButtonLabelDesktop" }] : []));
|
|
241
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiDashboardToolbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
242
|
+
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 } }, outputs: { disableSaveButton: "disableSaveButtonChange", editable: "editableChange", save: "save", cancel: "cancel" }, 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\n ? 'btn-secondary'\n : 'btn-circle btn-sm btn-tertiary element-edit'\n \"\n [attr.aria-label]=\"labelEdit | translate\"\n [attr.title]=\"!showEditButtonLabelDesktop ? (labelEdit | translate) : undefined\"\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]=\"primaryEditActions()\"\n [secondaryActions]=\"secondaryEditActions()\"\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 <!-- eslint-disable @angular-eslint/template/no-any -->\n <!-- This item has a patched action which will inject the grid. But our types do not reflect this. -->\n <!-- TODO: make our types reflect that this item has a patched action. -->\n <button\n type=\"button\"\n class=\"btn btn-secondary me-4\"\n (click)=\"$any(action.action)()\"\n >\n {{ action.label! | translate }}\n </button>\n <!-- eslint-disable-enable @angular-eslint/template/no-any -->\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 <button\n type=\"button\"\n class=\"btn btn-primary\"\n [disabled]=\"disableSaveButton() || disabled()\"\n (click)=\"onSave()\"\n >\n @if (disabled()) {\n <si-loading-spinner />\n } @else {\n <span>{{ labelSave | translate }}</span>\n }\n </button>\n </div>\n }\n </div>\n</div>\n", styles: [":host{display:flex;flex:1 1 0;flex-direction:column}si-loading-spinner{--loading-spinner-size: 1rem;--loading-spinner-color: var(--element-text-inverse)}\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: SiLoadingSpinnerComponent, selector: "si-loading-spinner", inputs: ["isBlockingSpinner", "isSpinnerOverlay", "ariaLabel"] }, { 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: "pipe", type: SiTranslatePipe, name: "translate" }] });
|
|
254
243
|
}
|
|
255
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
244
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiDashboardToolbarComponent, decorators: [{
|
|
256
245
|
type: Component,
|
|
257
246
|
args: [{ selector: 'si-dashboard-toolbar', imports: [
|
|
258
247
|
SiContentActionBarComponent,
|
|
259
248
|
SiLinkDirective,
|
|
260
249
|
SiLoadingSpinnerComponent,
|
|
261
250
|
RouterLink,
|
|
262
|
-
NgClass,
|
|
263
251
|
SiResponsiveContainerDirective,
|
|
264
252
|
SiTranslatePipe
|
|
265
|
-
], 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 [
|
|
253
|
+
], 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\n ? 'btn-secondary'\n : 'btn-circle btn-sm btn-tertiary element-edit'\n \"\n [attr.aria-label]=\"labelEdit | translate\"\n [attr.title]=\"!showEditButtonLabelDesktop ? (labelEdit | translate) : undefined\"\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]=\"primaryEditActions()\"\n [secondaryActions]=\"secondaryEditActions()\"\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 <!-- eslint-disable @angular-eslint/template/no-any -->\n <!-- This item has a patched action which will inject the grid. But our types do not reflect this. -->\n <!-- TODO: make our types reflect that this item has a patched action. -->\n <button\n type=\"button\"\n class=\"btn btn-secondary me-4\"\n (click)=\"$any(action.action)()\"\n >\n {{ action.label! | translate }}\n </button>\n <!-- eslint-disable-enable @angular-eslint/template/no-any -->\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 <button\n type=\"button\"\n class=\"btn btn-primary\"\n [disabled]=\"disableSaveButton() || disabled()\"\n (click)=\"onSave()\"\n >\n @if (disabled()) {\n <si-loading-spinner />\n } @else {\n <span>{{ labelSave | translate }}</span>\n }\n </button>\n </div>\n }\n </div>\n</div>\n", styles: [":host{display:flex;flex:1 1 0;flex-direction:column}si-loading-spinner{--loading-spinner-size: 1rem;--loading-spinner-color: var(--element-text-inverse)}\n"] }]
|
|
254
|
+
}], 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 }] }], save: [{ type: i0.Output, args: ["save"] }], cancel: [{ type: i0.Output, args: ["cancel"] }], dashboardToolbarContainer: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SiResponsiveContainerDirective), { isSignal: true }] }] } });
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Copyright (c) Siemens 2016 - 2025
|
|
258
|
+
* SPDX-License-Identifier: MIT
|
|
259
|
+
*/
|
|
260
|
+
/**
|
|
261
|
+
* Injection token to optionally inject the {@link SiWidgetIdProvider} implementation
|
|
262
|
+
* to provide custom widget id generation logic. The default implementation
|
|
263
|
+
* is {@link SiWidgetDefaultIdProvider}.
|
|
264
|
+
*
|
|
265
|
+
* * @example
|
|
266
|
+
* The following shows how to provide your own widget id provider.
|
|
267
|
+
* ```
|
|
268
|
+
* providers: [..., { provide: SI_WIDGET_ID_PROVIDER, useClass: CustomWidgetIdProvider }]
|
|
269
|
+
* ```
|
|
270
|
+
*
|
|
271
|
+
*/
|
|
272
|
+
const SI_WIDGET_ID_PROVIDER = new InjectionToken('Injection token to configure your widget id provider.', { providedIn: 'root', factory: () => inject(SiWidgetDefaultIdProvider) });
|
|
273
|
+
/**
|
|
274
|
+
* Abstract class to provide widget id generation logic.
|
|
275
|
+
*/
|
|
276
|
+
class SiWidgetIdProvider {
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* The default implementation of the {@link SiWidgetIdProvider} which
|
|
280
|
+
* generates random widget ids.
|
|
281
|
+
*/
|
|
282
|
+
class SiWidgetDefaultIdProvider extends SiWidgetIdProvider {
|
|
283
|
+
/**
|
|
284
|
+
* Generates a unique widget id.
|
|
285
|
+
*
|
|
286
|
+
* The method uses `crypto.randomUUID()` which generates a RFC4122 version 4 UUID
|
|
287
|
+
* (a cryptographically secure random identifier with 122 bits of entropy).
|
|
288
|
+
*
|
|
289
|
+
* @param widget - The widget instance config without any id.
|
|
290
|
+
* @param dashboardId - The id of the dashboard where the widget is added.
|
|
291
|
+
* @returns A unique widget id string in the format `crypto.randomUUID()`.
|
|
292
|
+
*/
|
|
293
|
+
generateWidgetId(widget, dashboardId) {
|
|
294
|
+
return crypto.randomUUID();
|
|
295
|
+
}
|
|
296
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiWidgetDefaultIdProvider, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
297
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiWidgetDefaultIdProvider, providedIn: 'root' });
|
|
298
|
+
}
|
|
299
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiWidgetDefaultIdProvider, decorators: [{
|
|
300
|
+
type: Injectable,
|
|
301
|
+
args: [{ providedIn: 'root' }]
|
|
266
302
|
}] });
|
|
267
303
|
|
|
268
304
|
/**
|
|
@@ -271,8 +307,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
|
|
|
271
307
|
*/
|
|
272
308
|
class SiGridService {
|
|
273
309
|
/** @defaultValue [] */
|
|
274
|
-
widgetCatalog = signal([]);
|
|
275
|
-
widgetCatalogMap = computed(() => new Map(this.widgetCatalog().map(widget => [widget.id, widget])));
|
|
310
|
+
widgetCatalog = signal([], ...(ngDevMode ? [{ debugName: "widgetCatalog" }] : []));
|
|
311
|
+
widgetCatalogMap = computed(() => new Map(this.widgetCatalog().map(widget => [widget.id, widget])), ...(ngDevMode ? [{ debugName: "widgetCatalogMap" }] : []));
|
|
276
312
|
/**
|
|
277
313
|
* Observable that emits true if si-grid is set to editable.
|
|
278
314
|
* The owner of the editable state is the si-grid component.
|
|
@@ -283,10 +319,10 @@ class SiGridService {
|
|
|
283
319
|
getWidget(id) {
|
|
284
320
|
return this.widgetCatalogMap().get(id);
|
|
285
321
|
}
|
|
286
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
287
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
322
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiGridService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
323
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiGridService });
|
|
288
324
|
}
|
|
289
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
325
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiGridService, decorators: [{
|
|
290
326
|
type: Injectable
|
|
291
327
|
}] });
|
|
292
328
|
|
|
@@ -326,10 +362,10 @@ class SiWebComponentWrapperBaseComponent {
|
|
|
326
362
|
const script = document.querySelector(`script[src='${url}']`);
|
|
327
363
|
return script ? true : false;
|
|
328
364
|
}
|
|
329
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
330
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
365
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiWebComponentWrapperBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
366
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.8", type: SiWebComponentWrapperBaseComponent, isStandalone: true, inputs: { config: "config", elementTagName: "elementTagName", url: "url" }, viewQueries: [{ propertyName: "webComponentHost", first: true, predicate: ["webComponentHost"], descendants: true, read: ElementRef, static: true }], ngImport: i0 });
|
|
331
367
|
}
|
|
332
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
368
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiWebComponentWrapperBaseComponent, decorators: [{
|
|
333
369
|
type: Directive
|
|
334
370
|
}], propDecorators: { config: [{
|
|
335
371
|
type: Input
|
|
@@ -384,10 +420,10 @@ class SiWebComponentEditorWrapperComponent extends SiWebComponentWrapperBaseComp
|
|
|
384
420
|
previous() {
|
|
385
421
|
this.webComponent?.dispatchEvent(new CustomEvent('previous'));
|
|
386
422
|
}
|
|
387
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
388
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
423
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiWebComponentEditorWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
424
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.8", type: SiWebComponentEditorWrapperComponent, isStandalone: true, selector: "si-web-component-editor-wrapper", usesInheritance: true, ngImport: i0, template: "<div #webComponentHost class=\"h-100\"></div>\n" });
|
|
389
425
|
}
|
|
390
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
426
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiWebComponentEditorWrapperComponent, decorators: [{
|
|
391
427
|
type: Component,
|
|
392
428
|
args: [{ selector: 'si-web-component-editor-wrapper', template: "<div #webComponentHost class=\"h-100\"></div>\n" }]
|
|
393
429
|
}] });
|
|
@@ -428,10 +464,10 @@ class SiWebComponentWrapperComponent extends SiWebComponentWrapperBaseComponent
|
|
|
428
464
|
this.secondaryEditActions = event.secondaryEditActions ?? this.secondaryEditActions;
|
|
429
465
|
this.configChange.emit(event);
|
|
430
466
|
}
|
|
431
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
432
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
467
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiWebComponentWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
468
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.8", type: SiWebComponentWrapperComponent, isStandalone: true, selector: "si-web-component-wrapper", inputs: { editable: "editable" }, usesInheritance: true, ngImport: i0, template: "<div #webComponentHost class=\"h-100\"></div>\n" });
|
|
433
469
|
}
|
|
434
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
470
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiWebComponentWrapperComponent, decorators: [{
|
|
435
471
|
type: Component,
|
|
436
472
|
args: [{ selector: 'si-web-component-wrapper', template: "<div #webComponentHost class=\"h-100\"></div>\n" }]
|
|
437
473
|
}], propDecorators: { editable: [{
|
|
@@ -471,29 +507,50 @@ const setupComponent = (widgetComponentFactory, host, injector, envInjector, com
|
|
|
471
507
|
return throwError(() => new Error(`Unknown widget factory type ${widgetComponentFactory.factoryType}.`));
|
|
472
508
|
}
|
|
473
509
|
};
|
|
510
|
+
const loadModuleBasedComponent = (factory, componentName, host, injector, envInjector, result) => {
|
|
511
|
+
const loader = factory.moduleLoader;
|
|
512
|
+
const componentKey = factory[componentName];
|
|
513
|
+
loader(componentKey).then(moduleExports => {
|
|
514
|
+
const ngModuleRef = createNgModule(moduleExports[factory.moduleName], envInjector);
|
|
515
|
+
const componentType = moduleExports[componentKey];
|
|
516
|
+
const widgetInstanceRef = host.createComponent(componentType, { injector, ngModuleRef });
|
|
517
|
+
result.next(widgetInstanceRef);
|
|
518
|
+
result.complete();
|
|
519
|
+
}, rejection => {
|
|
520
|
+
const errorMsg = `Loading widget module ${factory.moduleName} failed`;
|
|
521
|
+
const msg = rejection ? `${errorMsg} with ${JSON.stringify(rejection.toString())}` : errorMsg;
|
|
522
|
+
result.error(msg);
|
|
523
|
+
result.complete();
|
|
524
|
+
});
|
|
525
|
+
};
|
|
526
|
+
const loadStandaloneComponent = (factory, componentName, host, injector, result) => {
|
|
527
|
+
const loader = factory.componentLoader;
|
|
528
|
+
const componentKey = factory[componentName];
|
|
529
|
+
loader(componentKey).then(componentType => {
|
|
530
|
+
const widgetInstanceRef = host.createComponent(componentType, { injector });
|
|
531
|
+
result.next(widgetInstanceRef);
|
|
532
|
+
result.complete();
|
|
533
|
+
}, rejection => {
|
|
534
|
+
const errorMsg = `Loading widget component ${componentKey} failed`;
|
|
535
|
+
const msg = rejection ? `${errorMsg} with ${JSON.stringify(rejection.toString())}` : errorMsg;
|
|
536
|
+
result.error(msg);
|
|
537
|
+
result.complete();
|
|
538
|
+
});
|
|
539
|
+
};
|
|
474
540
|
const loadAndAttachComponent = (factory, componentName, host, injector, envInjector) => {
|
|
475
541
|
const result = new Subject();
|
|
476
|
-
if (factory[componentName]) {
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
result.next(widgetInstanceRef);
|
|
486
|
-
result.complete();
|
|
487
|
-
}, rejection => {
|
|
488
|
-
const msg = rejection
|
|
489
|
-
? `Loading widget module ${factory.moduleName} failed with ${JSON.stringify(rejection.toString())}`
|
|
490
|
-
: `Loading widget module ${factory.moduleName} failed`;
|
|
491
|
-
result.error(msg);
|
|
492
|
-
result.complete();
|
|
493
|
-
});
|
|
542
|
+
if (!factory[componentName]) {
|
|
543
|
+
result.error(`Provided component factory has no ${componentName} component configuration`);
|
|
544
|
+
return result;
|
|
545
|
+
}
|
|
546
|
+
if (factory.moduleName) {
|
|
547
|
+
loadModuleBasedComponent(factory, componentName, host, injector, envInjector, result);
|
|
548
|
+
}
|
|
549
|
+
else if (factory.componentLoader) {
|
|
550
|
+
loadStandaloneComponent(factory, componentName, host, injector, result);
|
|
494
551
|
}
|
|
495
552
|
else {
|
|
496
|
-
result.error(
|
|
553
|
+
result.error('Invalid factory configuration: missing moduleLoader or componentLoader');
|
|
497
554
|
}
|
|
498
555
|
return result;
|
|
499
556
|
};
|
|
@@ -528,7 +585,7 @@ class SiWidgetHostComponent {
|
|
|
528
585
|
injector = inject(Injector);
|
|
529
586
|
envInjector = inject(EnvironmentInjector);
|
|
530
587
|
destroyRef = inject(DestroyRef);
|
|
531
|
-
widgetConfig = input.required();
|
|
588
|
+
widgetConfig = input.required(...(ngDevMode ? [{ debugName: "widgetConfig" }] : []));
|
|
532
589
|
remove = output();
|
|
533
590
|
edit = output();
|
|
534
591
|
card = viewChild.required('card');
|
|
@@ -725,15 +782,15 @@ class SiWidgetHostComponent {
|
|
|
725
782
|
}
|
|
726
783
|
});
|
|
727
784
|
}
|
|
728
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
729
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
785
|
+
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 } }, 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$ | async) {\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}.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-block-end:24px;inset-block-start:40px;inset-inline:24px;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: AsyncPipe, name: "async" }] });
|
|
730
787
|
}
|
|
731
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
788
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiWidgetHostComponent, decorators: [{
|
|
732
789
|
type: Component,
|
|
733
|
-
args: [{ selector: 'si-widget-host', imports: [SiDashboardCardComponent, AsyncPipe,
|
|
790
|
+
args: [{ selector: 'si-widget-host', imports: [SiDashboardCardComponent, AsyncPipe, NgTemplateOutlet], host: {
|
|
734
791
|
class: 'grid-stack-item'
|
|
735
|
-
}, template: "<div class=\"grid-stack-item-content p-4\">\n @if (editable$ | async) {\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 [
|
|
736
|
-
}] });
|
|
792
|
+
}, template: "<div class=\"grid-stack-item-content p-4\">\n @if (editable$ | async) {\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}.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-block-end:24px;inset-block-start:40px;inset-inline:24px;position:absolute;z-index:100}\n"] }]
|
|
793
|
+
}], 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 }] }] } });
|
|
737
794
|
|
|
738
795
|
/**
|
|
739
796
|
* Copyright (c) Siemens 2016 - 2025
|
|
@@ -745,17 +802,17 @@ class SiGridstackWrapperComponent {
|
|
|
745
802
|
*
|
|
746
803
|
* @defaultValue []
|
|
747
804
|
*/
|
|
748
|
-
widgetConfigs = input([]);
|
|
805
|
+
widgetConfigs = input([], ...(ngDevMode ? [{ debugName: "widgetConfigs" }] : []));
|
|
749
806
|
/**
|
|
750
807
|
* Whenever gridstack allows to drag, resize or delete the grid item
|
|
751
808
|
*
|
|
752
809
|
* @defaultValue false
|
|
753
810
|
*/
|
|
754
|
-
editable = input(false);
|
|
811
|
+
editable = input(false, ...(ngDevMode ? [{ debugName: "editable" }] : []));
|
|
755
812
|
/**
|
|
756
813
|
* Module configuration
|
|
757
814
|
*/
|
|
758
|
-
gridConfig = input();
|
|
815
|
+
gridConfig = input(...(ngDevMode ? [undefined, { debugName: "gridConfig" }] : []));
|
|
759
816
|
/**
|
|
760
817
|
* Emits dashboard grid events.
|
|
761
818
|
*/
|
|
@@ -768,15 +825,15 @@ class SiGridstackWrapperComponent {
|
|
|
768
825
|
* Emits the id of a widget instance that shall be edited.
|
|
769
826
|
*/
|
|
770
827
|
widgetInstanceEdit = output();
|
|
771
|
-
gridstackContainer = viewChild('gridstackContainer', { read: ViewContainerRef });
|
|
828
|
+
gridstackContainer = viewChild('gridstackContainer', { ...(ngDevMode ? { debugName: "gridstackContainer" } : {}), read: ViewContainerRef });
|
|
772
829
|
grid;
|
|
773
830
|
markedForRender = [];
|
|
774
|
-
gridItems = signal([]);
|
|
775
|
-
gridItemsMap = computed(() => new Map(this.gridItems().map(item => [item.id, item])));
|
|
831
|
+
gridItems = signal([], ...(ngDevMode ? [{ debugName: "gridItems" }] : []));
|
|
832
|
+
gridItemsMap = computed(() => new Map(this.gridItems().map(item => [item.id, item])), ...(ngDevMode ? [{ debugName: "gridItemsMap" }] : []));
|
|
776
833
|
itemIdAttr = 'item-id';
|
|
777
834
|
ngZone = inject(NgZone);
|
|
778
835
|
elementRef = inject(ElementRef);
|
|
779
|
-
widgetConfigsMap = computed(() => new Map(this.widgetConfigs().map(w => [w.id, w])));
|
|
836
|
+
widgetConfigsMap = computed(() => new Map(this.widgetConfigs().map(w => [w.id, w])), ...(ngDevMode ? [{ debugName: "widgetConfigsMap" }] : []));
|
|
780
837
|
ngOnChanges(changes) {
|
|
781
838
|
if (changes.widgetConfigs) {
|
|
782
839
|
const { currentValue, previousValue, firstChange } = changes.widgetConfigs;
|
|
@@ -869,7 +926,7 @@ class SiGridstackWrapperComponent {
|
|
|
869
926
|
}
|
|
870
927
|
addToView(item) {
|
|
871
928
|
// we use computed here to dynamically bind the widgetConfig to the SiWidgetHostComponent
|
|
872
|
-
const config = computed(() => this.widgetConfigsMap().get(item.id));
|
|
929
|
+
const config = computed(() => this.widgetConfigsMap().get(item.id), ...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
873
930
|
const componentRef = this.gridstackContainer().createComponent(SiWidgetHostComponent, {
|
|
874
931
|
bindings: [
|
|
875
932
|
inputBinding('widgetConfig', config),
|
|
@@ -914,13 +971,13 @@ class SiGridstackWrapperComponent {
|
|
|
914
971
|
});
|
|
915
972
|
});
|
|
916
973
|
}
|
|
917
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
918
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "
|
|
974
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiGridstackWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
975
|
+
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"] });
|
|
919
976
|
}
|
|
920
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
977
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiGridstackWrapperComponent, decorators: [{
|
|
921
978
|
type: Component,
|
|
922
979
|
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"] }]
|
|
923
|
-
}] });
|
|
980
|
+
}], 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 }] }] } });
|
|
924
981
|
|
|
925
982
|
/**
|
|
926
983
|
* Copyright (c) Siemens 2016 - 2025
|
|
@@ -937,12 +994,12 @@ class SiWidgetInstanceEditorDialogComponent {
|
|
|
937
994
|
* Input for the widget instance configuration. It is used to populate the
|
|
938
995
|
* widget editor.
|
|
939
996
|
*/
|
|
940
|
-
widgetConfig = model.required();
|
|
997
|
+
widgetConfig = model.required(...(ngDevMode ? [{ debugName: "widgetConfig" }] : []));
|
|
941
998
|
/**
|
|
942
999
|
* Input for the widget definition. It is required to retrieve the component
|
|
943
1000
|
* factory to instantiate the widget editor.
|
|
944
1001
|
*/
|
|
945
|
-
widget = input.required();
|
|
1002
|
+
widget = input.required(...(ngDevMode ? [{ debugName: "widget" }] : []));
|
|
946
1003
|
/**
|
|
947
1004
|
* Emits the edited widget instance configuration if the user confirms by
|
|
948
1005
|
* saving, or `undefined` if the user cancels the dialog.
|
|
@@ -954,8 +1011,8 @@ class SiWidgetInstanceEditorDialogComponent {
|
|
|
954
1011
|
editorSetupCompleted = output();
|
|
955
1012
|
editorHost = viewChild.required('editorHost', { read: ViewContainerRef });
|
|
956
1013
|
/** Indicates if the current config is valid or not. If invalid, the save button will be disabled. */
|
|
957
|
-
invalidConfig = signal(false);
|
|
958
|
-
showNextButton = computed(() => this.editorWizardState() !== undefined ? true : false);
|
|
1014
|
+
invalidConfig = signal(false, ...(ngDevMode ? [{ debugName: "invalidConfig" }] : []));
|
|
1015
|
+
showNextButton = computed(() => this.editorWizardState() !== undefined ? true : false, ...(ngDevMode ? [{ debugName: "showNextButton" }] : []));
|
|
959
1016
|
disableNextButton = computed(() => {
|
|
960
1017
|
const wizardState = this.editorWizardState();
|
|
961
1018
|
if (!wizardState) {
|
|
@@ -970,12 +1027,12 @@ class SiWidgetInstanceEditorDialogComponent {
|
|
|
970
1027
|
else {
|
|
971
1028
|
return false;
|
|
972
1029
|
}
|
|
973
|
-
});
|
|
974
|
-
showPreviousButton = computed(() => !!this.editorWizardState());
|
|
1030
|
+
}, ...(ngDevMode ? [{ debugName: "disableNextButton" }] : []));
|
|
1031
|
+
showPreviousButton = computed(() => !!this.editorWizardState(), ...(ngDevMode ? [{ debugName: "showPreviousButton" }] : []));
|
|
975
1032
|
disablePreviousButton = computed(() => {
|
|
976
1033
|
const wizardState = this.editorWizardState();
|
|
977
1034
|
return wizardState ? !wizardState.hasPrevious : true;
|
|
978
|
-
});
|
|
1035
|
+
}, ...(ngDevMode ? [{ debugName: "disablePreviousButton" }] : []));
|
|
979
1036
|
labelSave = t(() => $localize `:@@DASHBOARD.WIDGET_EDITOR_DIALOG.SAVE:Save`);
|
|
980
1037
|
labelCancel = t(() => $localize `:@@DASHBOARD.WIDGET_EDITOR_DIALOG.CANCEL:Cancel`);
|
|
981
1038
|
labelPrevious = t(() => $localize `:@@DASHBOARD.WIDGET_EDITOR_DIALOG.PREVIOUS:Previous`);
|
|
@@ -990,9 +1047,9 @@ class SiWidgetInstanceEditorDialogComponent {
|
|
|
990
1047
|
* emits configChange events. Triggers edit discard confirmation dialog when widget config
|
|
991
1048
|
* is modified but not dialog is canceled.
|
|
992
1049
|
* */
|
|
993
|
-
widgetConfigModified = signal(false);
|
|
1050
|
+
widgetConfigModified = signal(false, ...(ngDevMode ? [{ debugName: "widgetConfigModified" }] : []));
|
|
994
1051
|
widgetInstanceEditor;
|
|
995
|
-
editorWizardState = signal(undefined);
|
|
1052
|
+
editorWizardState = signal(undefined, ...(ngDevMode ? [{ debugName: "editorWizardState" }] : []));
|
|
996
1053
|
subscriptions = [];
|
|
997
1054
|
injector = inject(Injector);
|
|
998
1055
|
envInjector = inject(EnvironmentInjector);
|
|
@@ -1020,7 +1077,6 @@ class SiWidgetInstanceEditorDialogComponent {
|
|
|
1020
1077
|
if (this.widgetInstanceEditor.configChange) {
|
|
1021
1078
|
this.subscriptions.push(this.widgetInstanceEditor.configChange.subscribe(config => {
|
|
1022
1079
|
if (!hasStatusChangesEmitter) {
|
|
1023
|
-
this.invalidConfig.set(!!config.invalid);
|
|
1024
1080
|
this.widgetConfigModified.set(true);
|
|
1025
1081
|
}
|
|
1026
1082
|
}));
|
|
@@ -1109,20 +1165,18 @@ class SiWidgetInstanceEditorDialogComponent {
|
|
|
1109
1165
|
this.widgetConfigModified.set(statusChanges.modified);
|
|
1110
1166
|
}
|
|
1111
1167
|
}
|
|
1112
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1113
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
1168
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiWidgetInstanceEditorDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1169
|
+
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" }] });
|
|
1114
1170
|
}
|
|
1115
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1171
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiWidgetInstanceEditorDialogComponent, decorators: [{
|
|
1116
1172
|
type: Component,
|
|
1117
1173
|
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"] }]
|
|
1118
|
-
}] });
|
|
1174
|
+
}], 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"] }], editorHost: [{ type: i0.ViewChild, args: ['editorHost', { ...{ read: ViewContainerRef }, isSignal: true }] }] } });
|
|
1119
1175
|
|
|
1120
1176
|
/**
|
|
1121
1177
|
* Copyright (c) Siemens 2016 - 2025
|
|
1122
1178
|
* SPDX-License-Identifier: MIT
|
|
1123
1179
|
*/
|
|
1124
|
-
const NEW_WIDGET_PREFIX = 'new-widget-';
|
|
1125
|
-
let idCounter = 1;
|
|
1126
1180
|
/**
|
|
1127
1181
|
* The grid component is the actual component on which the widget instances are placed and visualized. You can think of
|
|
1128
1182
|
* a headless dashboard, without a title, toolbar or edit buttons.
|
|
@@ -1132,20 +1186,21 @@ class SiGridComponent {
|
|
|
1132
1186
|
gridService = inject(SiGridService);
|
|
1133
1187
|
modalService = inject(SiModalService);
|
|
1134
1188
|
widgetStorage = inject(SI_WIDGET_STORE);
|
|
1189
|
+
widgetIdProvider = inject(SI_WIDGET_ID_PROVIDER);
|
|
1135
1190
|
/**
|
|
1136
1191
|
* Configuration options for a grid instance. Default is the optional
|
|
1137
1192
|
* value from the {@link SI_DASHBOARD_CONFIGURATION}.
|
|
1138
1193
|
*
|
|
1139
1194
|
* @defaultValue inject(SI_DASHBOARD_CONFIGURATION)?.grid
|
|
1140
1195
|
*/
|
|
1141
|
-
gridConfig = input(inject(SI_DASHBOARD_CONFIGURATION)?.grid);
|
|
1196
|
+
gridConfig = input(inject(SI_DASHBOARD_CONFIGURATION)?.grid, ...(ngDevMode ? [{ debugName: "gridConfig" }] : []));
|
|
1142
1197
|
/**
|
|
1143
1198
|
* Sets the grid into editable mode, in which the widget instances can be moved,
|
|
1144
1199
|
* resized, removed or new ones added.
|
|
1145
1200
|
*
|
|
1146
1201
|
* @defaultValue false
|
|
1147
1202
|
*/
|
|
1148
|
-
editable = model(false);
|
|
1203
|
+
editable = model(false, ...(ngDevMode ? [{ debugName: "editable" }] : []));
|
|
1149
1204
|
/**
|
|
1150
1205
|
* This is the internal owner of the current editable state and is used to track if
|
|
1151
1206
|
* editable or not. Not editable can be changed by either calling the `edit()` api
|
|
@@ -1158,14 +1213,14 @@ class SiGridComponent {
|
|
|
1158
1213
|
* An optional, but recommended dashboard id that is used in persistence and passed
|
|
1159
1214
|
* to the widget store for saving and loading data.
|
|
1160
1215
|
*/
|
|
1161
|
-
dashboardId = input();
|
|
1216
|
+
dashboardId = input(...(ngDevMode ? [undefined, { debugName: "dashboardId" }] : []));
|
|
1162
1217
|
/**
|
|
1163
1218
|
* Provides the available widgets to the grid. When loading the widget configurations from
|
|
1164
1219
|
* the storage, we need to have the widget definition available to be able to create the widget
|
|
1165
1220
|
* instances on the grid.
|
|
1166
1221
|
*
|
|
1167
1222
|
* @defaultValue [] */
|
|
1168
|
-
widgetCatalog = input([]);
|
|
1223
|
+
widgetCatalog = input([], ...(ngDevMode ? [{ debugName: "widgetCatalog" }] : []));
|
|
1169
1224
|
/**
|
|
1170
1225
|
* When the user clicks edit on a widget instance, an editor need to appear and the
|
|
1171
1226
|
* widget editor component need to be loaded. When the grid is used standalone, it
|
|
@@ -1176,18 +1231,18 @@ class SiGridComponent {
|
|
|
1176
1231
|
* widget `edit` action.
|
|
1177
1232
|
*
|
|
1178
1233
|
* @defaultValue false */
|
|
1179
|
-
emitWidgetInstanceEditEvents = input(false);
|
|
1234
|
+
emitWidgetInstanceEditEvents = input(false, ...(ngDevMode ? [{ debugName: "emitWidgetInstanceEditEvents" }] : []));
|
|
1180
1235
|
/**
|
|
1181
1236
|
* Option to turn off the loading spinner on save and load operations.
|
|
1182
1237
|
*
|
|
1183
1238
|
* @defaultValue false
|
|
1184
1239
|
*/
|
|
1185
|
-
hideProgressIndicator = input(false);
|
|
1240
|
+
hideProgressIndicator = input(false, ...(ngDevMode ? [{ debugName: "hideProgressIndicator" }] : []));
|
|
1186
1241
|
/**
|
|
1187
1242
|
* Option to configure a custom widget instance editor dialog component. The component provides the
|
|
1188
1243
|
* editor hosting and the buttons to save and cancel.
|
|
1189
1244
|
*/
|
|
1190
|
-
widgetInstanceEditorDialogComponent = input();
|
|
1245
|
+
widgetInstanceEditorDialogComponent = input(...(ngDevMode ? [undefined, { debugName: "widgetInstanceEditorDialogComponent" }] : []));
|
|
1191
1246
|
/**
|
|
1192
1247
|
* Emits the modification state of the grid. It is `unmodified` when the visible state
|
|
1193
1248
|
* is equal to the loaded state from the widget storage. When the user modifies the dashboard by
|
|
@@ -1238,13 +1293,6 @@ class SiGridComponent {
|
|
|
1238
1293
|
markedForRemoval = [];
|
|
1239
1294
|
/** @defaultValue viewChild.required(SiGridstackWrapperComponent) */
|
|
1240
1295
|
gridStackWrapper = viewChild.required(SiGridstackWrapperComponent);
|
|
1241
|
-
/**
|
|
1242
|
-
* Service used to indicate load and save indication.
|
|
1243
|
-
* @deprecated Use `isLoading` instead.
|
|
1244
|
-
*
|
|
1245
|
-
* @defaultValue inject(SiLoadingService)
|
|
1246
|
-
*/
|
|
1247
|
-
loadingService = inject(SiLoadingService);
|
|
1248
1296
|
/**
|
|
1249
1297
|
* Indication for load and save operations.
|
|
1250
1298
|
*/
|
|
@@ -1278,7 +1326,6 @@ class SiGridComponent {
|
|
|
1278
1326
|
ngOnDestroy() {
|
|
1279
1327
|
this.storeSubscription?.unsubscribe();
|
|
1280
1328
|
this.isLoading.complete();
|
|
1281
|
-
this.loadingService.counter.complete();
|
|
1282
1329
|
}
|
|
1283
1330
|
/**
|
|
1284
1331
|
* Set dashboard grid in editable mode to modify widget instances.
|
|
@@ -1302,12 +1349,13 @@ class SiGridComponent {
|
|
|
1302
1349
|
return;
|
|
1303
1350
|
}
|
|
1304
1351
|
this.isLoading.next(true);
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
const
|
|
1308
|
-
const
|
|
1352
|
+
// Update position information
|
|
1353
|
+
const widgets = this.updateWidgetPositions(this.visibleWidgetInstances$.value);
|
|
1354
|
+
const transientWidgetIds = new Set(this.transientWidgetInstances.map(w => w.id));
|
|
1355
|
+
const modifiedWidgets = widgets.filter(widget => !transientWidgetIds.has(widget.id));
|
|
1356
|
+
const addedWidgets = widgets.filter(widget => transientWidgetIds.has(widget.id));
|
|
1309
1357
|
this.widgetStorage
|
|
1310
|
-
.save(
|
|
1358
|
+
.save(modifiedWidgets, addedWidgets, this.markedForRemoval, this.dashboardId())
|
|
1311
1359
|
.pipe(take(1))
|
|
1312
1360
|
.subscribe({
|
|
1313
1361
|
next: (value) => {
|
|
@@ -1316,12 +1364,10 @@ class SiGridComponent {
|
|
|
1316
1364
|
this.editable.set(false);
|
|
1317
1365
|
this.gridService.editable$.next(this.editableInternal);
|
|
1318
1366
|
this.isLoading.next(false);
|
|
1319
|
-
this.loadingService.counter.next(0);
|
|
1320
1367
|
},
|
|
1321
1368
|
error: (err) => {
|
|
1322
1369
|
console.error('Saving dashboard configuration failed.', err);
|
|
1323
1370
|
this.isLoading.next(false);
|
|
1324
|
-
this.loadingService.counter.next(0);
|
|
1325
1371
|
}
|
|
1326
1372
|
});
|
|
1327
1373
|
}
|
|
@@ -1349,7 +1395,7 @@ class SiGridComponent {
|
|
|
1349
1395
|
* @param widgetInstanceConfig - The new widget configuration.
|
|
1350
1396
|
*/
|
|
1351
1397
|
addWidgetInstance(widgetInstanceConfig) {
|
|
1352
|
-
const id =
|
|
1398
|
+
const id = this.widgetIdProvider.generateWidgetId(widgetInstanceConfig, this.dashboardId());
|
|
1353
1399
|
const newWidget = { ...widgetInstanceConfig, id };
|
|
1354
1400
|
const nextWidgets = this.updateWidgetPositions([
|
|
1355
1401
|
...this.visibleWidgetInstances$.value,
|
|
@@ -1367,7 +1413,9 @@ class SiGridComponent {
|
|
|
1367
1413
|
removeWidgetInstance(widgetInstanceId) {
|
|
1368
1414
|
const widgetToRemove = this.visibleWidgetInstances$.value.find(widget => widget.id === widgetInstanceId);
|
|
1369
1415
|
if (widgetToRemove) {
|
|
1370
|
-
this.
|
|
1416
|
+
if (!this.transientWidgetInstances.some(widget => widget.id === widgetToRemove.id)) {
|
|
1417
|
+
this.markedForRemoval.push(widgetToRemove);
|
|
1418
|
+
}
|
|
1371
1419
|
let nextWidgets = this.visibleWidgetInstances$.value.filter(widget => widget.id !== widgetInstanceId);
|
|
1372
1420
|
nextWidgets = this.updateWidgetPositions(nextWidgets);
|
|
1373
1421
|
this.visibleWidgetInstances$.next(nextWidgets);
|
|
@@ -1446,7 +1494,6 @@ class SiGridComponent {
|
|
|
1446
1494
|
// subscription. To handle this, we use the boolean marker `initialLoad`.
|
|
1447
1495
|
this.initialLoad = true;
|
|
1448
1496
|
this.isLoading.next(true);
|
|
1449
|
-
this.loadingService.counter.next(1);
|
|
1450
1497
|
this.storeSubscription = this.widgetStorage.load(this.dashboardId()).subscribe({
|
|
1451
1498
|
next: widgets => {
|
|
1452
1499
|
this.visibleWidgetInstances$.next(widgets);
|
|
@@ -1454,13 +1501,11 @@ class SiGridComponent {
|
|
|
1454
1501
|
if (this.initialLoad) {
|
|
1455
1502
|
this.initialLoad = false;
|
|
1456
1503
|
this.isLoading.next(false);
|
|
1457
|
-
this.loadingService.counter.next(0);
|
|
1458
1504
|
}
|
|
1459
1505
|
},
|
|
1460
1506
|
error: err => {
|
|
1461
1507
|
console.error('Loading dashboard configuration failed', err);
|
|
1462
1508
|
this.isLoading.next(false);
|
|
1463
|
-
this.loadingService.counter.next(0);
|
|
1464
1509
|
}
|
|
1465
1510
|
});
|
|
1466
1511
|
}
|
|
@@ -1489,13 +1534,13 @@ class SiGridComponent {
|
|
|
1489
1534
|
this.isModified.emit(this.modified);
|
|
1490
1535
|
}
|
|
1491
1536
|
}
|
|
1492
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1493
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
1537
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiGridComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1538
|
+
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" }, providers: [SiGridService], 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 [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"], outputs: ["gridEvent", "widgetInstanceRemove", "widgetInstanceEdit"] }, { kind: "directive", type: SiLoadingSpinnerDirective, selector: "[siLoading]", inputs: ["siLoading", "blocking", "initialDelay"] }, { kind: "pipe", type: AsyncPipe, name: "async" }] });
|
|
1494
1539
|
}
|
|
1495
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1540
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiGridComponent, decorators: [{
|
|
1496
1541
|
type: Component,
|
|
1497
|
-
args: [{ selector: 'si-grid', imports: [SiGridstackWrapperComponent, SiLoadingSpinnerDirective, AsyncPipe], providers: [SiGridService
|
|
1498
|
-
}] });
|
|
1542
|
+
args: [{ selector: 'si-grid', imports: [SiGridstackWrapperComponent, SiLoadingSpinnerDirective, AsyncPipe], providers: [SiGridService], 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 [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"] }]
|
|
1543
|
+
}], 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 }] }] } });
|
|
1499
1544
|
|
|
1500
1545
|
/**
|
|
1501
1546
|
* Function creates a new {@link WidgetConfig} without id from a {@link Widget} and
|
|
@@ -1534,7 +1579,7 @@ class SiWidgetCatalogComponent {
|
|
|
1534
1579
|
* t(() => $localize`:@@DASHBOARD.WIDGET_LIBRARY.SEARCH_PLACEHOLDER:Search widget`)
|
|
1535
1580
|
* ```
|
|
1536
1581
|
*/
|
|
1537
|
-
searchPlaceholder = input(t(() => $localize `:@@DASHBOARD.WIDGET_LIBRARY.SEARCH_PLACEHOLDER:Search widget`));
|
|
1582
|
+
searchPlaceholder = input(t(() => $localize `:@@DASHBOARD.WIDGET_LIBRARY.SEARCH_PLACEHOLDER:Search widget`), ...(ngDevMode ? [{ debugName: "searchPlaceholder" }] : []));
|
|
1538
1583
|
/**
|
|
1539
1584
|
* Emits when the catalog is `closed`, either by canceling or by adding or saving
|
|
1540
1585
|
* a widget configuration. On cancel `undefined` is emitted, otherwise the related
|
|
@@ -1547,7 +1592,7 @@ class SiWidgetCatalogComponent {
|
|
|
1547
1592
|
* @internal
|
|
1548
1593
|
* @defaultValue 'list'
|
|
1549
1594
|
*/
|
|
1550
|
-
view = signal('list');
|
|
1595
|
+
view = signal('list', ...(ngDevMode ? [{ debugName: "view" }] : []));
|
|
1551
1596
|
editorHost = viewChild.required('editorHost', { read: ViewContainerRef });
|
|
1552
1597
|
/**
|
|
1553
1598
|
* Property to provide the available widgets to the catalog. The flexible
|
|
@@ -1565,9 +1610,9 @@ class SiWidgetCatalogComponent {
|
|
|
1565
1610
|
* Array used to hold the search result on the widget catalog.
|
|
1566
1611
|
* @defaultValue [] */
|
|
1567
1612
|
filteredWidgetCatalog = [];
|
|
1568
|
-
selected = signal(undefined);
|
|
1613
|
+
selected = signal(undefined, ...(ngDevMode ? [{ debugName: "selected" }] : []));
|
|
1569
1614
|
widgetConfig;
|
|
1570
|
-
hasEditor = signal(false);
|
|
1615
|
+
hasEditor = signal(false, ...(ngDevMode ? [{ debugName: "hasEditor" }] : []));
|
|
1571
1616
|
labelCancel = t(() => $localize `:@@DASHBOARD.WIDGET_LIBRARY.CANCEL:Cancel`);
|
|
1572
1617
|
labelPrevious = t(() => $localize `:@@DASHBOARD.WIDGET_LIBRARY.PREVIOUS:Previous`);
|
|
1573
1618
|
labelNext = t(() => $localize `:@@DASHBOARD.WIDGET_LIBRARY.NEXT:Next`);
|
|
@@ -1578,10 +1623,10 @@ class SiWidgetCatalogComponent {
|
|
|
1578
1623
|
labelDialogMessage = t(() => $localize `:@@DASHBOARD.WIDGET_LIBRARY.DISCARD_CONFIG_CHANGE_DIALOG.MESSAGE:The widget configuration changed. Do you want to discard the changes?`);
|
|
1579
1624
|
labelDialogDiscard = t(() => $localize `:@@DASHBOARD.WIDGET_LIBRARY.DISCARD_CONFIG_CHANGE_DIALOG.DISCARD:Discard`);
|
|
1580
1625
|
labelWidgetCatalogList = t(() => $localize `:@@DASHBOARD.WIDGET_LIBRARY.WIDGET_CATALOG_LIST:Widget catalog list`);
|
|
1581
|
-
showAddButton = computed(() => this.view() === 'list' ? !this.hasEditor() : true);
|
|
1582
|
-
showNextButton = computed(() => this.view() === 'list' ? this.hasEditor() : this.editorWizardState() !== undefined);
|
|
1583
|
-
showPreviousButton = computed(() => this.view() === 'editor');
|
|
1584
|
-
disableAddButton = computed(() => !this.selected() || this.invalidConfig());
|
|
1626
|
+
showAddButton = computed(() => this.view() === 'list' ? !this.hasEditor() : true, ...(ngDevMode ? [{ debugName: "showAddButton" }] : []));
|
|
1627
|
+
showNextButton = computed(() => this.view() === 'list' ? this.hasEditor() : this.editorWizardState() !== undefined, ...(ngDevMode ? [{ debugName: "showNextButton" }] : []));
|
|
1628
|
+
showPreviousButton = computed(() => this.view() === 'editor', ...(ngDevMode ? [{ debugName: "showPreviousButton" }] : []));
|
|
1629
|
+
disableAddButton = computed(() => !this.selected() || this.invalidConfig(), ...(ngDevMode ? [{ debugName: "disableAddButton" }] : []));
|
|
1585
1630
|
disableNextButton = computed(() => {
|
|
1586
1631
|
const wizardState = this.editorWizardState();
|
|
1587
1632
|
if (this.view() === 'list') {
|
|
@@ -1599,9 +1644,9 @@ class SiWidgetCatalogComponent {
|
|
|
1599
1644
|
else {
|
|
1600
1645
|
return false;
|
|
1601
1646
|
}
|
|
1602
|
-
});
|
|
1647
|
+
}, ...(ngDevMode ? [{ debugName: "disableNextButton" }] : []));
|
|
1603
1648
|
/** Indicates if the current config is valid or not. If invalid, the add button is disabled. */
|
|
1604
|
-
invalidConfig = signal(false);
|
|
1649
|
+
invalidConfig = signal(false, ...(ngDevMode ? [{ debugName: "invalidConfig" }] : []));
|
|
1605
1650
|
/**
|
|
1606
1651
|
* Marks the widget configuration as modified. Is set when widget editor instance
|
|
1607
1652
|
* emits configChange events. Triggers edit discard confirmation dialog when widget config
|
|
@@ -1609,13 +1654,13 @@ class SiWidgetCatalogComponent {
|
|
|
1609
1654
|
* */
|
|
1610
1655
|
widgetConfigModified = false;
|
|
1611
1656
|
widgetInstanceEditor;
|
|
1612
|
-
editorWizardState = signal(undefined);
|
|
1657
|
+
editorWizardState = signal(undefined, ...(ngDevMode ? [{ debugName: "editorWizardState" }] : []));
|
|
1613
1658
|
widgetInstanceEditorRef;
|
|
1614
1659
|
subscriptions = [];
|
|
1615
1660
|
dialogService = inject(SiActionDialogService);
|
|
1616
1661
|
injector = inject(Injector);
|
|
1617
1662
|
envInjector = inject(EnvironmentInjector);
|
|
1618
|
-
widgetCdkListbox = viewChild((CdkListbox));
|
|
1663
|
+
widgetCdkListbox = viewChild((CdkListbox), ...(ngDevMode ? [{ debugName: "widgetCdkListbox" }] : []));
|
|
1619
1664
|
ngOnInit() {
|
|
1620
1665
|
this.filteredWidgetCatalog = this.widgetCatalog;
|
|
1621
1666
|
if (this.widgetCatalog.length > 0) {
|
|
@@ -1730,7 +1775,6 @@ class SiWidgetCatalogComponent {
|
|
|
1730
1775
|
if (this.widgetInstanceEditor.configChange) {
|
|
1731
1776
|
this.subscriptions.push(this.widgetInstanceEditor.configChange.subscribe(config => {
|
|
1732
1777
|
if (!hasStatusChangesEmitter) {
|
|
1733
|
-
this.invalidConfig.set(!!config.invalid);
|
|
1734
1778
|
this.widgetConfigModified = true;
|
|
1735
1779
|
}
|
|
1736
1780
|
}));
|
|
@@ -1810,10 +1854,10 @@ class SiWidgetCatalogComponent {
|
|
|
1810
1854
|
this.widgetConfigModified = statusChanges.modified;
|
|
1811
1855
|
}
|
|
1812
1856
|
}
|
|
1813
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1814
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
1857
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiWidgetCatalogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1858
|
+
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" }] });
|
|
1815
1859
|
}
|
|
1816
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1860
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiWidgetCatalogComponent, decorators: [{
|
|
1817
1861
|
type: Component,
|
|
1818
1862
|
args: [{ selector: 'si-widget-catalog', imports: [
|
|
1819
1863
|
SiSearchBarComponent,
|
|
@@ -1823,7 +1867,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
|
|
|
1823
1867
|
CdkListbox,
|
|
1824
1868
|
CdkOption
|
|
1825
1869
|
], 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"] }]
|
|
1826
|
-
}] });
|
|
1870
|
+
}], propDecorators: { searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], closed: [{ type: i0.Output, args: ["closed"] }], editorHost: [{ type: i0.ViewChild, args: ['editorHost', { ...{ read: ViewContainerRef }, isSignal: true }] }], widgetCdkListbox: [{ type: i0.ViewChild, args: [i0.forwardRef(() => CdkListbox), { isSignal: true }] }] } });
|
|
1827
1871
|
|
|
1828
1872
|
/**
|
|
1829
1873
|
* Copyright (c) Siemens 2016 - 2025
|
|
@@ -1839,62 +1883,62 @@ class SiFlexibleDashboardComponent {
|
|
|
1839
1883
|
*
|
|
1840
1884
|
* @defaultValue false
|
|
1841
1885
|
*/
|
|
1842
|
-
editable = model(false);
|
|
1886
|
+
editable = model(false, ...(ngDevMode ? [{ debugName: "editable" }] : []));
|
|
1843
1887
|
/**
|
|
1844
1888
|
* Heading for the dashboard.
|
|
1845
1889
|
*/
|
|
1846
|
-
heading = input();
|
|
1890
|
+
heading = input(...(ngDevMode ? [undefined, { debugName: "heading" }] : []));
|
|
1847
1891
|
/**
|
|
1848
1892
|
* Optionally, provide a custom subclass of the SiWidgetCatalogComponent
|
|
1849
1893
|
* to use your own catalog component.
|
|
1850
1894
|
*/
|
|
1851
|
-
widgetCatalogComponent = input();
|
|
1895
|
+
widgetCatalogComponent = input(...(ngDevMode ? [undefined, { debugName: "widgetCatalogComponent" }] : []));
|
|
1852
1896
|
/**
|
|
1853
1897
|
* Optionally, provide a custom subclass of the {@link SiWidgetInstanceEditorDialogComponent}
|
|
1854
1898
|
* to use your own implementation.
|
|
1855
1899
|
*/
|
|
1856
|
-
widgetInstanceEditorDialogComponent = input();
|
|
1900
|
+
widgetInstanceEditorDialogComponent = input(...(ngDevMode ? [undefined, { debugName: "widgetInstanceEditorDialogComponent" }] : []));
|
|
1857
1901
|
/**
|
|
1858
1902
|
* Optionally, but it is recommended to include an id for a dashboard.
|
|
1859
1903
|
* The id is utilized in the persistence calls on the {@link SiWidgetStorage}.
|
|
1860
1904
|
*/
|
|
1861
|
-
dashboardId = input();
|
|
1905
|
+
dashboardId = input(...(ngDevMode ? [undefined, { debugName: "dashboardId" }] : []));
|
|
1862
1906
|
/**
|
|
1863
1907
|
* Sets the available widgets for the widget catalog to the dashboard.
|
|
1864
1908
|
*
|
|
1865
1909
|
* @defaultValue [] */
|
|
1866
|
-
widgetCatalog = input([]);
|
|
1910
|
+
widgetCatalog = input([], ...(ngDevMode ? [{ debugName: "widgetCatalog" }] : []));
|
|
1867
1911
|
/**
|
|
1868
1912
|
* Option to remove the add widget instance button from the primary toolbar.
|
|
1869
1913
|
*
|
|
1870
1914
|
* @defaultValue false
|
|
1871
1915
|
*/
|
|
1872
|
-
hideAddWidgetInstanceButton = input(false);
|
|
1916
|
+
hideAddWidgetInstanceButton = input(false, ...(ngDevMode ? [{ debugName: "hideAddWidgetInstanceButton" }] : []));
|
|
1873
1917
|
/**
|
|
1874
1918
|
* Option to hide the dashboard edit button.
|
|
1875
1919
|
*
|
|
1876
1920
|
* @defaultValue false
|
|
1877
1921
|
*/
|
|
1878
|
-
hideEditButton = input(false);
|
|
1922
|
+
hideEditButton = input(false, ...(ngDevMode ? [{ debugName: "hideEditButton" }] : []));
|
|
1879
1923
|
/**
|
|
1880
1924
|
* Option to display the edit button as a text button instead, only if the window is larger than xs {@link SiResponsiveContainerDirective}.
|
|
1881
1925
|
*
|
|
1882
1926
|
* @defaultValue false
|
|
1883
1927
|
*/
|
|
1884
|
-
showEditButtonLabel = input(false);
|
|
1928
|
+
showEditButtonLabel = input(false, ...(ngDevMode ? [{ debugName: "showEditButtonLabel" }] : []));
|
|
1885
1929
|
/**
|
|
1886
1930
|
* Option to turn off the loading spinner on save and load operations.
|
|
1887
1931
|
*
|
|
1888
1932
|
* @defaultValue false
|
|
1889
1933
|
*/
|
|
1890
|
-
hideProgressIndicator = input(false);
|
|
1934
|
+
hideProgressIndicator = input(false, ...(ngDevMode ? [{ debugName: "hideProgressIndicator" }] : []));
|
|
1891
1935
|
/**
|
|
1892
1936
|
* Option to configure a dashboard instance. Default is the optional value from
|
|
1893
1937
|
* the {@link SI_DASHBOARD_CONFIGURATION}.
|
|
1894
1938
|
*
|
|
1895
1939
|
* @defaultValue inject(SI_DASHBOARD_CONFIGURATION)
|
|
1896
1940
|
*/
|
|
1897
|
-
config = input(inject(SI_DASHBOARD_CONFIGURATION));
|
|
1941
|
+
config = input(inject(SI_DASHBOARD_CONFIGURATION), ...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
1898
1942
|
/**
|
|
1899
1943
|
* Placeholder text for the search input field in the widget catalog.
|
|
1900
1944
|
*
|
|
@@ -1903,7 +1947,7 @@ class SiFlexibleDashboardComponent {
|
|
|
1903
1947
|
* t(() => $localize`:@@DASHBOARD.WIDGET_LIBRARY.SEARCH_PLACEHOLDER:Search widget`)
|
|
1904
1948
|
* ```
|
|
1905
1949
|
*/
|
|
1906
|
-
searchPlaceholder = input(t(() => $localize `:@@DASHBOARD.WIDGET_LIBRARY.SEARCH_PLACEHOLDER:Search widget`));
|
|
1950
|
+
searchPlaceholder = input(t(() => $localize `:@@DASHBOARD.WIDGET_LIBRARY.SEARCH_PLACEHOLDER:Search widget`), ...(ngDevMode ? [{ debugName: "searchPlaceholder" }] : []));
|
|
1907
1951
|
/**
|
|
1908
1952
|
* The grid component is the actual container for the widgets.
|
|
1909
1953
|
*/
|
|
@@ -1944,7 +1988,7 @@ class SiFlexibleDashboardComponent {
|
|
|
1944
1988
|
/**
|
|
1945
1989
|
* @returns True, if the dashboard shows its widgets and not a catalog or and editor.
|
|
1946
1990
|
*/
|
|
1947
|
-
isDashboardVisible = computed(() => this.viewState() === 'dashboard');
|
|
1991
|
+
isDashboardVisible = computed(() => this.viewState() === 'dashboard', ...(ngDevMode ? [{ debugName: "isDashboardVisible" }] : []));
|
|
1948
1992
|
/**
|
|
1949
1993
|
* The page title of the dashboard, which is either {@link SiFlexibleDashboardComponent.heading} for the
|
|
1950
1994
|
* default widget view or `DASHBOARD.WIDGET_EDITOR_DIALOG.TITLE` or 'DASHBOARD.WIDGET_LIBRARY.TITLE' when
|
|
@@ -1960,8 +2004,8 @@ class SiFlexibleDashboardComponent {
|
|
|
1960
2004
|
default:
|
|
1961
2005
|
return this.heading();
|
|
1962
2006
|
}
|
|
1963
|
-
});
|
|
1964
|
-
viewState = signal('dashboard');
|
|
2007
|
+
}, ...(ngDevMode ? [{ debugName: "pageTitle" }] : []));
|
|
2008
|
+
viewState = signal('dashboard', ...(ngDevMode ? [{ debugName: "viewState" }] : []));
|
|
1965
2009
|
widgetStorage = inject(SI_WIDGET_STORE);
|
|
1966
2010
|
hideAddWidgetInstanceButton$ = new BehaviorSubject(this.hideAddWidgetInstanceButton());
|
|
1967
2011
|
dashboardId$ = new Subject();
|
|
@@ -2090,52 +2134,31 @@ class SiFlexibleDashboardComponent {
|
|
|
2090
2134
|
getWidget(id) {
|
|
2091
2135
|
return this.widgetCatalog().find(widget => widget.id === id);
|
|
2092
2136
|
}
|
|
2093
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2094
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "
|
|
2137
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiFlexibleDashboardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2138
|
+
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 } }, 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 [editable]=\"editable()\"\n [disabled]=\"(grid.isLoading | async) ?? false\"\n [hideEditButton]=\"hideEditButton()\"\n [showEditButtonLabel]=\"showEditButtonLabel()\"\n (editableChange)=\"grid.edit()\"\n (save)=\"grid.save()\"\n (cancel)=\"grid.cancel()\"\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"], outputs: ["disableSaveButtonChange", "editableChange", "save", "cancel"] }, { 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" }] });
|
|
2095
2139
|
}
|
|
2096
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2140
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiFlexibleDashboardComponent, decorators: [{
|
|
2097
2141
|
type: Component,
|
|
2098
2142
|
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 [editable]=\"editable()\"\n [disabled]=\"(grid.isLoading | async) ?? false\"\n [hideEditButton]=\"hideEditButton()\"\n [showEditButtonLabel]=\"showEditButtonLabel()\"\n (editableChange)=\"grid.edit()\"\n (save)=\"grid.save()\"\n (cancel)=\"grid.cancel()\"\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"] }]
|
|
2099
|
-
}] });
|
|
2143
|
+
}], 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 }] }], 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 }] }] } });
|
|
2100
2144
|
|
|
2101
2145
|
/**
|
|
2102
2146
|
* Copyright (c) Siemens 2016 - 2025
|
|
2103
2147
|
* SPDX-License-Identifier: MIT
|
|
2104
2148
|
*/
|
|
2105
2149
|
class SiDashboardsNgModule {
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
* `SI_DASHBOARD_CONFIGURATION` and `SI_WIDGET_STORE` direct in your app configuration. We migrated to standalone
|
|
2109
|
-
* components already and will delete this module definition later.
|
|
2110
|
-
*/
|
|
2111
|
-
static forRoot({ config, dashboardApi }) {
|
|
2112
|
-
return {
|
|
2113
|
-
ngModule: SiDashboardsNgModule,
|
|
2114
|
-
providers: [
|
|
2115
|
-
{
|
|
2116
|
-
provide: SI_DASHBOARD_CONFIGURATION,
|
|
2117
|
-
useValue: config
|
|
2118
|
-
},
|
|
2119
|
-
dashboardApi ?? {
|
|
2120
|
-
provide: SiWidgetStorage,
|
|
2121
|
-
useClass: SiDefaultWidgetStorage
|
|
2122
|
-
},
|
|
2123
|
-
dashboardApi ? { provide: SI_WIDGET_STORE, useExisting: SiWidgetStorage } : []
|
|
2124
|
-
]
|
|
2125
|
-
};
|
|
2126
|
-
}
|
|
2127
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: SiDashboardsNgModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2128
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.6", ngImport: i0, type: SiDashboardsNgModule, imports: [SiFlexibleDashboardComponent,
|
|
2150
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiDashboardsNgModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2151
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.8", ngImport: i0, type: SiDashboardsNgModule, imports: [SiFlexibleDashboardComponent,
|
|
2129
2152
|
SiGridComponent,
|
|
2130
2153
|
SiWidgetCatalogComponent,
|
|
2131
2154
|
SiWidgetInstanceEditorDialogComponent], exports: [SiFlexibleDashboardComponent,
|
|
2132
2155
|
SiGridComponent,
|
|
2133
2156
|
SiWidgetCatalogComponent,
|
|
2134
2157
|
SiWidgetInstanceEditorDialogComponent] });
|
|
2135
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
2158
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiDashboardsNgModule, imports: [SiFlexibleDashboardComponent,
|
|
2136
2159
|
SiWidgetCatalogComponent] });
|
|
2137
2160
|
}
|
|
2138
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2161
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiDashboardsNgModule, decorators: [{
|
|
2139
2162
|
type: NgModule,
|
|
2140
2163
|
args: [{
|
|
2141
2164
|
imports: [
|
|
@@ -2162,5 +2185,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
|
|
|
2162
2185
|
* Generated bundle index. Do not edit.
|
|
2163
2186
|
*/
|
|
2164
2187
|
|
|
2165
|
-
export {
|
|
2188
|
+
export { DEFAULT_GRIDSTACK_OPTIONS, DEFAULT_WIDGET_STORAGE_TOKEN, SI_DASHBOARD_CONFIGURATION, SI_WIDGET_ID_PROVIDER, SI_WIDGET_STORE, STORAGE_KEY, SiDashboardsNgModule, SiDefaultWidgetStorage, SiFlexibleDashboardComponent, SiGridComponent, SiWidgetCatalogComponent, SiWidgetDefaultIdProvider, SiWidgetIdProvider, SiWidgetInstanceEditorDialogComponent, SiWidgetStorage, SiDashboardsNgModule as SimplDashboardsNgModule, createWidgetConfig, setupWidgetEditor, setupWidgetInstance, widgetFactoryRegistry };
|
|
2166
2189
|
//# sourceMappingURL=siemens-dashboards-ng.mjs.map
|