@c8y/ngx-components 1023.92.0 → 1023.97.3
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/ai/agents/scada/index.d.ts +10 -0
- package/ai/agents/scada/index.d.ts.map +1 -0
- package/ai/ai-chat/index.d.ts +1 -1
- package/ai/ai-chat/index.d.ts.map +1 -1
- package/alarms/index.d.ts.map +1 -1
- package/computed-asset-properties/index.d.ts +89 -1
- package/computed-asset-properties/index.d.ts.map +1 -1
- package/context-dashboard/device/view/index.d.ts +24 -1
- package/context-dashboard/device/view/index.d.ts.map +1 -1
- package/context-dashboard/index.d.ts +27 -11
- package/context-dashboard/index.d.ts.map +1 -1
- package/echart/index.d.ts.map +1 -1
- package/fesm2022/c8y-ngx-components-ai-agent-chat.mjs +2 -2
- package/fesm2022/c8y-ngx-components-ai-agent-chat.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-ai-agents-scada.mjs +893 -0
- package/fesm2022/c8y-ngx-components-ai-agents-scada.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-ai-ai-chat.mjs +1 -0
- package/fesm2022/c8y-ngx-components-ai-ai-chat.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-alarms.mjs +12 -5
- package/fesm2022/c8y-ngx-components-alarms.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-asset-properties.mjs +2 -2
- package/fesm2022/c8y-ngx-components-asset-properties.mjs.map +1 -1
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-c8y-ngx-components-computed-asset-properties-Cy9R6Ixb.mjs → c8y-ngx-components-computed-asset-properties-c8y-ngx-components-computed-asset-properties-CHZX7ALq.mjs} +10 -9
- package/fesm2022/c8y-ngx-components-computed-asset-properties-c8y-ngx-components-computed-asset-properties-CHZX7ALq.mjs.map +1 -0
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-fieldbus-item-status-config.component-LrmlAh6V.mjs → c8y-ngx-components-computed-asset-properties-fieldbus-item-status-config.component-DgWGXzEx.mjs} +2 -2
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-fieldbus-item-status-config.component-LrmlAh6V.mjs.map → c8y-ngx-components-computed-asset-properties-fieldbus-item-status-config.component-DgWGXzEx.mjs.map} +1 -1
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-last-measurement-config.component-f1u1TcCl.mjs → c8y-ngx-components-computed-asset-properties-last-measurement-config.component-yfc45-l_.mjs} +2 -2
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-last-measurement-config.component-f1u1TcCl.mjs.map → c8y-ngx-components-computed-asset-properties-last-measurement-config.component-yfc45-l_.mjs.map} +1 -1
- package/fesm2022/c8y-ngx-components-computed-asset-properties.mjs +1 -1
- package/fesm2022/c8y-ngx-components-context-dashboard-device-view.mjs +21 -3
- package/fesm2022/c8y-ngx-components-context-dashboard-device-view.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-context-dashboard-devicemanagement.mjs +2 -2
- package/fesm2022/c8y-ngx-components-context-dashboard-devicemanagement.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-context-dashboard.mjs +69 -51
- package/fesm2022/c8y-ngx-components-context-dashboard.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-echart.mjs +52 -36
- package/fesm2022/c8y-ngx-components-echart.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-global-context.mjs +112 -22
- package/fesm2022/c8y-ngx-components-global-context.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-map.mjs +15 -0
- package/fesm2022/c8y-ngx-components-map.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-repository-configuration.mjs +292 -115
- package/fesm2022/c8y-ngx-components-repository-configuration.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-repository-firmware.mjs +2 -2
- package/fesm2022/c8y-ngx-components-repository-firmware.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-repository-software.mjs +1 -1
- package/fesm2022/c8y-ngx-components-repository-software.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-upgrade.mjs +12 -1
- package/fesm2022/c8y-ngx-components-upgrade.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-html-widget.mjs +2 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-html-widget.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-scada.mjs +169 -0
- package/fesm2022/c8y-ngx-components-widgets-definitions-scada.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-widgets-definitions.mjs +2 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-exports.mjs +8 -1
- package/fesm2022/c8y-ngx-components-widgets-exports.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-alarms.mjs +2 -2
- package/fesm2022/c8y-ngx-components-widgets-implementations-alarms.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs +3 -3
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-list.mjs +2 -2
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-list.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-table.mjs +2 -2
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-table.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-events.mjs +2 -2
- package/fesm2022/c8y-ngx-components-widgets-implementations-events.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-html-widget.mjs +90 -32
- package/fesm2022/c8y-ngx-components-widgets-implementations-html-widget.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-kpi.mjs +2 -2
- package/fesm2022/c8y-ngx-components-widgets-implementations-kpi.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-scada.mjs +1698 -0
- package/fesm2022/c8y-ngx-components-widgets-implementations-scada.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components.mjs +220 -45
- package/fesm2022/c8y-ngx-components.mjs.map +1 -1
- package/global-context/index.d.ts +58 -3
- package/global-context/index.d.ts.map +1 -1
- package/index.d.ts +79 -22
- package/index.d.ts.map +1 -1
- package/locales/de.po +165 -3
- package/locales/es.po +165 -3
- package/locales/fr.po +165 -3
- package/locales/ja_JP.po +165 -3
- package/locales/ko.po +165 -3
- package/locales/locales.pot +156 -3
- package/locales/nl.po +165 -3
- package/locales/pl.po +165 -3
- package/locales/pt_BR.po +165 -3
- package/locales/zh_CN.po +165 -3
- package/locales/zh_TW.po +165 -3
- package/map/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/repository/configuration/index.d.ts +64 -39
- package/repository/configuration/index.d.ts.map +1 -1
- package/upgrade/index.d.ts +1 -0
- package/upgrade/index.d.ts.map +1 -1
- package/widgets/cockpit-exports/index.d.ts +6 -0
- package/widgets/cockpit-exports/index.d.ts.map +1 -1
- package/widgets/definitions/index.d.ts +1 -0
- package/widgets/definitions/index.d.ts.map +1 -1
- package/widgets/definitions/scada/index.d.ts +6 -0
- package/widgets/definitions/scada/index.d.ts.map +1 -0
- package/widgets/device-management-exports/index.d.ts +6 -0
- package/widgets/device-management-exports/index.d.ts.map +1 -1
- package/widgets/exports/index.d.ts +8 -1
- package/widgets/exports/index.d.ts.map +1 -1
- package/widgets/implementations/html-widget/index.d.ts +30 -12
- package/widgets/implementations/html-widget/index.d.ts.map +1 -1
- package/widgets/implementations/scada/index.d.ts +415 -0
- package/widgets/implementations/scada/index.d.ts.map +1 -0
- package/fesm2022/c8y-ngx-components-computed-asset-properties-c8y-ngx-components-computed-asset-properties-Cy9R6Ixb.mjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Router } from '@angular/router';
|
|
2
|
-
import { WidgetSettings, AppStateService, Permissions, Alert, AlertService, OptionsService, ClipboardService,
|
|
2
|
+
import { WidgetSettings, AppStateService, Permissions, Alert, AlertService, OptionsService, ClipboardService, DynamicComponent, DynamicComponentAlertAggregator } from '@c8y/ngx-components';
|
|
3
3
|
import { ContextWidgetConfig, AssetPropertyMappings, WidgetConfigService, WidgetConfigNotification, AssetPropertyMappingsService } from '@c8y/ngx-components/context-dashboard';
|
|
4
4
|
import { CockpitConfig } from '@c8y/ngx-components/cockpit-config';
|
|
5
5
|
import * as rxjs from 'rxjs';
|
|
@@ -7,7 +7,7 @@ import { Subject, Observable } from 'rxjs';
|
|
|
7
7
|
import { IManagedObject, IIdentified } from '@c8y/client';
|
|
8
8
|
import { InterpolationParameters, Translation, TranslateService } from '@ngx-translate/core';
|
|
9
9
|
import * as i0 from '@angular/core';
|
|
10
|
-
import { OnChanges, OnDestroy, SimpleChanges, TemplateRef } from '@angular/core';
|
|
10
|
+
import { OnChanges, OnDestroy, SimpleChanges, TemplateRef, OnInit, EventEmitter } from '@angular/core';
|
|
11
11
|
import { ToolCallPart } from '@c8y/ngx-components/ai';
|
|
12
12
|
import { PresetName, GlobalContextState, GLOBAL_CONTEXT_DISPLAY_MODE } from '@c8y/ngx-components/global-context';
|
|
13
13
|
import { AssetPropertyType } from '@c8y/ngx-components/asset-properties';
|
|
@@ -126,6 +126,13 @@ declare class HtmlFrameComponent implements OnChanges, OnDestroy {
|
|
|
126
126
|
config: HtmlWidget;
|
|
127
127
|
device: IManagedObject | IIdentified;
|
|
128
128
|
propertyValues$: Observable<Record<string, unknown>>;
|
|
129
|
+
/**
|
|
130
|
+
* Gates the managed-object realtime subscription. Defaults to always-on
|
|
131
|
+
* for backwards compatibility; callers that own a global time-context
|
|
132
|
+
* control (e.g. SCADA) can pass a live-mode observable to pause the MO
|
|
133
|
+
* updates when the widget is paused.
|
|
134
|
+
*/
|
|
135
|
+
realtimeControl$: Observable<boolean>;
|
|
129
136
|
/**
|
|
130
137
|
* If set to true, it will be ensured that a unique hash is generated
|
|
131
138
|
* for every webcomponent. This is useful if configured as otherwise it might
|
|
@@ -141,6 +148,8 @@ declare class HtmlFrameComponent implements OnChanges, OnDestroy {
|
|
|
141
148
|
private hostElement;
|
|
142
149
|
private reload$;
|
|
143
150
|
private latestUrl?;
|
|
151
|
+
private currentWebComponent?;
|
|
152
|
+
private currentLegacyElement?;
|
|
144
153
|
private htmlContentInitialization$;
|
|
145
154
|
private inventoryService;
|
|
146
155
|
constructor();
|
|
@@ -158,7 +167,7 @@ declare class HtmlFrameComponent implements OnChanges, OnDestroy {
|
|
|
158
167
|
private generateHash;
|
|
159
168
|
private createDefaultWebcomponentCode;
|
|
160
169
|
static ɵfac: i0.ɵɵFactoryDeclaration<HtmlFrameComponent, never>;
|
|
161
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<HtmlFrameComponent, "c8y-html-frame", never, { "config": { "alias": "config"; "required": false; }; "device": { "alias": "device"; "required": false; }; "propertyValues$": { "alias": "propertyValues$"; "required": false; }; "useSalt": { "alias": "useSalt"; "required": false; }; }, {}, never, never, true, never>;
|
|
170
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HtmlFrameComponent, "c8y-html-frame", never, { "config": { "alias": "config"; "required": false; }; "device": { "alias": "device"; "required": false; }; "propertyValues$": { "alias": "propertyValues$"; "required": false; }; "realtimeControl$": { "alias": "realtimeControl$"; "required": false; }; "useSalt": { "alias": "useSalt"; "required": false; }; }, {}, never, never, true, never>;
|
|
162
171
|
}
|
|
163
172
|
|
|
164
173
|
declare class HtmlWidgetConfigComponent implements OnDestroy {
|
|
@@ -175,6 +184,8 @@ declare class HtmlWidgetConfigComponent implements OnDestroy {
|
|
|
175
184
|
globalContextState$: rxjs.Observable<GlobalContextState>;
|
|
176
185
|
constructor();
|
|
177
186
|
ngOnDestroy(): void;
|
|
187
|
+
onCodeChange(value: string): void;
|
|
188
|
+
onCssChange(value: string): void;
|
|
178
189
|
private handleRename;
|
|
179
190
|
static ɵfac: i0.ɵɵFactoryDeclaration<HtmlWidgetConfigComponent, never>;
|
|
180
191
|
static ɵcmp: i0.ɵɵComponentDeclaration<HtmlWidgetConfigComponent, "c8y-html-widget-config", never, {}, {}, never, never, true, never>;
|
|
@@ -193,11 +204,13 @@ declare class HtmlWidgetPropertiesSelectorComponent {
|
|
|
193
204
|
static ɵcmp: i0.ɵɵComponentDeclaration<HtmlWidgetPropertiesSelectorComponent, "c8y-html-widget-properties-selector", never, {}, {}, never, never, true, never>;
|
|
194
205
|
}
|
|
195
206
|
|
|
196
|
-
declare class HtmlWidgetComponent {
|
|
207
|
+
declare class HtmlWidgetComponent implements DynamicComponent, OnInit {
|
|
197
208
|
config: i0.InputSignal<HtmlWidgetConfig>;
|
|
209
|
+
alerts: DynamicComponentAlertAggregator;
|
|
198
210
|
private realtimeControl$;
|
|
199
|
-
|
|
200
|
-
private
|
|
211
|
+
private refresh$;
|
|
212
|
+
private SERVER_ERROR_TEXT;
|
|
213
|
+
propertyValues$: i0.Signal<Observable<Record<string, unknown>>>;
|
|
201
214
|
displayMode: i0.WritableSignal<"config" | "dashboard" | "view_and_config">;
|
|
202
215
|
contextConfig: i0.WritableSignal<GlobalContextState>;
|
|
203
216
|
isLoading: i0.WritableSignal<boolean>;
|
|
@@ -232,9 +245,10 @@ declare class HtmlWidgetComponent {
|
|
|
232
245
|
context: GlobalContextState;
|
|
233
246
|
diff: GlobalContextState;
|
|
234
247
|
}): void;
|
|
235
|
-
|
|
248
|
+
onRefresh(): void;
|
|
236
249
|
private shouldEnableRealtime;
|
|
237
250
|
private mapLegacyConfig;
|
|
251
|
+
private handleFetchError;
|
|
238
252
|
static ɵfac: i0.ɵɵFactoryDeclaration<HtmlWidgetComponent, never>;
|
|
239
253
|
static ɵcmp: i0.ɵɵComponentDeclaration<HtmlWidgetComponent, "c8y-html-widget", never, { "config": { "alias": "config"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
240
254
|
}
|
|
@@ -246,11 +260,15 @@ declare const webComponentTemplate: (html: string, css?: string, viewEncapsulati
|
|
|
246
260
|
declare class WidgetCodeEditorComponent implements OnDestroy {
|
|
247
261
|
mode: 'code' | 'css';
|
|
248
262
|
config: HtmlWidget;
|
|
249
|
-
|
|
250
|
-
|
|
263
|
+
showAdvancedSettings: boolean;
|
|
264
|
+
codeChange: EventEmitter<string>;
|
|
265
|
+
cssChange: EventEmitter<string>;
|
|
251
266
|
translate: TranslateService;
|
|
252
267
|
private widgetConfigService;
|
|
253
|
-
|
|
268
|
+
private readonly defaultPropertyKeys$;
|
|
269
|
+
propertyKeys$: Observable<string[]>;
|
|
270
|
+
propertyPrefix: string;
|
|
271
|
+
editorComponent: EditorComponent;
|
|
254
272
|
editor: Monaco.editor.IStandaloneCodeEditor;
|
|
255
273
|
isAutoSaveEnabled: boolean;
|
|
256
274
|
language: 'html' | 'css' | 'javascript';
|
|
@@ -264,6 +282,7 @@ declare class WidgetCodeEditorComponent implements OnDestroy {
|
|
|
264
282
|
readonly TAB_OUTLET_NAME = "html-widget-tab-outlet";
|
|
265
283
|
private destroy$;
|
|
266
284
|
private suggestionProviders;
|
|
285
|
+
getFormattedPropertyExpression: (key: string) => string;
|
|
267
286
|
ngOnDestroy(): void;
|
|
268
287
|
ngOnChanges(changes: SimpleChanges): void;
|
|
269
288
|
loadCode(): void;
|
|
@@ -276,9 +295,8 @@ declare class WidgetCodeEditorComponent implements OnDestroy {
|
|
|
276
295
|
saveCode(codeStr?: string): void;
|
|
277
296
|
insertPropertyAtCursor(key: string): void;
|
|
278
297
|
private registerPropertySuggestions;
|
|
279
|
-
private getFormattedPropertyExpression;
|
|
280
298
|
static ɵfac: i0.ɵɵFactoryDeclaration<WidgetCodeEditorComponent, never>;
|
|
281
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<WidgetCodeEditorComponent, "c8y-widget-code-editor", never, { "mode": { "alias": "mode"; "required": false; }; "config": { "alias": "config"; "required": false; }; }, {}, never, never, true, never>;
|
|
299
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<WidgetCodeEditorComponent, "c8y-widget-code-editor", never, { "mode": { "alias": "mode"; "required": false; }; "config": { "alias": "config"; "required": false; }; "showAdvancedSettings": { "alias": "showAdvancedSettings"; "required": false; }; "propertyKeys$": { "alias": "propertyKeys$"; "required": false; }; "propertyPrefix": { "alias": "propertyPrefix"; "required": false; }; "getFormattedPropertyExpression": { "alias": "getFormattedPropertyExpression"; "required": false; }; }, { "codeChange": "codeChange"; "cssChange": "cssChange"; }, never, never, true, never>;
|
|
282
300
|
}
|
|
283
301
|
|
|
284
302
|
export { AdvancedSettingsComponent, HtmlAiChatToolDetailsComponent, HtmlFrameComponent, HtmlWidgetComponent, HtmlWidgetConfigComponent, HtmlWidgetConfigService, HtmlWidgetPropertiesSelectorComponent, INITIAL_CSS_FORMATTED, INITIAL_HTML_FORMATTED, WidgetCodeEditorComponent, defaultWebComponentAttributeNameContext, defaultWebComponentName, legacyTemplate, webComponentTemplate };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sources":["../../../../widgets/implementations/html-widget/html-widget.model.ts","../../../../widgets/implementations/html-widget/html-widget-config.service.ts","../../../../widgets/implementations/html-widget/advanced-settings/advanced-settings.component.ts","../../../../widgets/implementations/html-widget/html-ai-chat-tool-details.component.ts","../../../../widgets/implementations/html-widget/html-frame/html-frame.component.ts","../../../../widgets/implementations/html-widget/html-widget-config.component.ts","../../../../widgets/implementations/html-widget/html-widget-properties-selector/html-widget-properties-selector.component.ts","../../../../widgets/implementations/html-widget/html-widget.component.ts","../../../../widgets/implementations/html-widget/legacy-template.ts","../../../../widgets/implementations/html-widget/webcomponent-template.ts","../../../../widgets/implementations/html-widget/widget-code-editor-section/widget-code-editor.component.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null],"names":[],"mappings":";;;;;;;;;;;;;;;;AAQM;AACJ;;;;AAKA;;;;;AAKG;;AAEJ;AAEK;;;;;;;;AASL;;;;AAKA;AAEK;;;AAGJ;AAID;;;;;;AAOA;;;;;;AAOA;AAED;AAgCA;AAQA;AAEA;;AC3EA;;;;AAGmD;AAAoB;AACrE;AACA;AACA;AACA;AAEA;AAgBA;AAEA;AAoBA;AAEA;AAkBA;;;;;AA2CA;AAaA;;;AAsBD;;AClKD;AAOE;AACA;AACA;AACA;AAEA;;;AAMA;AAIA;;;;AAyBM;;;AAMP;;AC3DD;;;AAQ0D;AACxD;AACA;AAEA;AAEA;;AAEG;;AAKH;;;AAWD;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":["../../../../widgets/implementations/html-widget/html-widget.model.ts","../../../../widgets/implementations/html-widget/html-widget-config.service.ts","../../../../widgets/implementations/html-widget/advanced-settings/advanced-settings.component.ts","../../../../widgets/implementations/html-widget/html-ai-chat-tool-details.component.ts","../../../../widgets/implementations/html-widget/html-frame/html-frame.component.ts","../../../../widgets/implementations/html-widget/html-widget-config.component.ts","../../../../widgets/implementations/html-widget/html-widget-properties-selector/html-widget-properties-selector.component.ts","../../../../widgets/implementations/html-widget/html-widget.component.ts","../../../../widgets/implementations/html-widget/legacy-template.ts","../../../../widgets/implementations/html-widget/webcomponent-template.ts","../../../../widgets/implementations/html-widget/widget-code-editor-section/widget-code-editor.component.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null],"names":[],"mappings":";;;;;;;;;;;;;;;;AAQM;AACJ;;;;AAKA;;;;;AAKG;;AAEJ;AAEK;;;;;;;;AASL;;;;AAKA;AAEK;;;AAGJ;AAID;;;;;;AAOA;;;;;;AAOA;AAED;AAgCA;AAQA;AAEA;;AC3EA;;;;AAGmD;AAAoB;AACrE;AACA;AACA;AACA;AAEA;AAgBA;AAEA;AAoBA;AAEA;AAkBA;;;;;AA2CA;AAaA;;;AAsBD;;AClKD;AAOE;AACA;AACA;AACA;AAEA;;;AAMA;AAIA;;;;AAyBM;;;AAMP;;AC3DD;;;AAQ0D;AACxD;AACA;AAEA;AAEA;;AAEG;;AAKH;;;AAWD;;ACFD;;AAYE;;AAKA;;;;;AAKG;AAEH;AAEA;;;;;AAKG;AAEH;;;;;;;;;;;;;;AAsCA;AAKA;;;;;AA4FA;AAUA;AAeA;AAkCA;AASA;;AAiBA;;;AAuBD;;AC9RD;;AAsBE;AACA;AACA;AACA;AACA;;AAEA;;AAQA;AAKA;;AAgBA;AAOA;AAIA;AAIA;;;AAeD;;ACrGD;AAiBE;AACA;AAEA;;;;AAIG;;;;AAcJ;;ACvBD;AAYE;;;;;AAKA;AAgBA;AACA;AACA;AACA;;;;;AAKG;AACH;;AAGA;;;;;;;;;;;;;;;;AAAmC;;AAInC;;;;AAmCgF;AAOhF;AAKA;AAKA;AAiBA;;;AASD;;AC1JD;;ACEA;;AC2BA;AAqBE;;AAMA;AAGA;AAGA;AAEA;;AAGA;AAKS;AACA;;AAGT;AACA;AACA;;AAEA;;;;;;;;;AAgBS;AAMT;AAMA;;AAgCA;AAKA;;;;;AA8BA;;AA4BA;;;AA0GD;;;"}
|
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
import { IIdentified, InventoryService } from '@c8y/client';
|
|
2
|
+
import * as _c8y_ngx_components_widgets_implementations_html_widget from '@c8y/ngx-components/widgets/implementations/html-widget';
|
|
3
|
+
import { HtmlWidgetConfig } from '@c8y/ngx-components/widgets/implementations/html-widget';
|
|
4
|
+
import * as _c8y_ngx_components_context_dashboard from '@c8y/ngx-components/context-dashboard';
|
|
5
|
+
import { ContextWidgetConfig, AssetPropertyMappings, WidgetConfigService, WidgetConfigSectionComponent } from '@c8y/ngx-components/context-dashboard';
|
|
6
|
+
import * as _c8y_ngx_components from '@c8y/ngx-components';
|
|
7
|
+
import { C8yPropertyType, AlertService, DropAreaComponent, DroppedFile, DynamicComponent, DashboardChildComponent, DynamicComponentAlertAggregator } from '@c8y/ngx-components';
|
|
8
|
+
import * as _angular_core from '@angular/core';
|
|
9
|
+
import { OnInit, DestroyRef, ElementRef } from '@angular/core';
|
|
10
|
+
import * as _c8y_ngx_components_ai from '@c8y/ngx-components/ai';
|
|
11
|
+
import { AIService, AgentChatConfig, AssistantMessageDisplayConfig, AIAssistantMessage, AIStreamResponse } from '@c8y/ngx-components/ai';
|
|
12
|
+
import * as _angular_forms from '@angular/forms';
|
|
13
|
+
import { FormBuilder } from '@angular/forms';
|
|
14
|
+
import * as rxjs from 'rxjs';
|
|
15
|
+
import { Subject, Observable } from 'rxjs';
|
|
16
|
+
import * as _c8y_ngx_components_global_context from '@c8y/ngx-components/global-context';
|
|
17
|
+
import { GlobalContextState, GLOBAL_CONTEXT_DISPLAY_MODE } from '@c8y/ngx-components/global-context';
|
|
18
|
+
import * as _c8y_ngx_components_dist_global_context from '@c8y/ngx-components/dist/global-context';
|
|
19
|
+
import * as _c8y_ngx_components_widgets_implementations_scada from '@c8y/ngx-components/widgets/implementations/scada';
|
|
20
|
+
import * as packages_client_lib from 'packages/client/lib';
|
|
21
|
+
|
|
22
|
+
declare const SCADA_WIDGET_FEATURE_FLAG_NAME = "ui.scada-widget.v2";
|
|
23
|
+
interface ScadaWidgetConfig extends ContextWidgetConfig {
|
|
24
|
+
config: {
|
|
25
|
+
htmlWidgetConfig: HtmlWidgetConfig;
|
|
26
|
+
mappings: AssetPropertyMappings;
|
|
27
|
+
svgDisplaySettings?: SvgDisplaySettings;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
type DisplayOption = 'contain' | 'full-width';
|
|
31
|
+
type HorizontalAlignment = 'left' | 'center' | 'right';
|
|
32
|
+
type VerticalAlignment = 'top' | 'center' | 'bottom';
|
|
33
|
+
interface SvgDisplaySettings {
|
|
34
|
+
displayOption: DisplayOption;
|
|
35
|
+
horizontalAlignment: HorizontalAlignment;
|
|
36
|
+
verticalAlignment: VerticalAlignment;
|
|
37
|
+
}
|
|
38
|
+
interface SvgComputedStyling {
|
|
39
|
+
svgWidth: string;
|
|
40
|
+
svgHeight: string;
|
|
41
|
+
svgMaxWidth: string;
|
|
42
|
+
svgMaxHeight: string;
|
|
43
|
+
/** null means the preserveAspectRatio attribute should be removed */
|
|
44
|
+
preserveAspectRatio: string | null;
|
|
45
|
+
containerDisplay: string;
|
|
46
|
+
containerJustifyContent: string;
|
|
47
|
+
containerAlignItems: string;
|
|
48
|
+
containerOverflow: string;
|
|
49
|
+
containerHeight: string;
|
|
50
|
+
containerBoxSizing: string;
|
|
51
|
+
}
|
|
52
|
+
declare const defaultDisplayOption: DisplayOption;
|
|
53
|
+
declare const defaultAlignment = "center";
|
|
54
|
+
interface ScadaWidgetConfigLegacy {
|
|
55
|
+
binaryId: string;
|
|
56
|
+
sanitization: 'strict' | 'lax' | 'none';
|
|
57
|
+
device: Pick<IIdentified, 'id' | 'name'>;
|
|
58
|
+
deviceIds: {
|
|
59
|
+
[placeholderName: string]: string;
|
|
60
|
+
};
|
|
61
|
+
mapping: {
|
|
62
|
+
[placeholderName: string]: LegacyMapping;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
type LegacyMapping = LegacyMappingBase | LegacyMappingComputed | LegacyMappingFieldbus;
|
|
66
|
+
interface LegacyMappingBase {
|
|
67
|
+
id: string;
|
|
68
|
+
keyPath: string[];
|
|
69
|
+
label: string;
|
|
70
|
+
type: C8yPropertyType;
|
|
71
|
+
}
|
|
72
|
+
interface LegacyMappingComputed extends LegacyMappingBase {
|
|
73
|
+
computed: true;
|
|
74
|
+
configSchema: object;
|
|
75
|
+
config: {
|
|
76
|
+
_id: string;
|
|
77
|
+
[key: string]: any;
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
interface LegacyMappingFieldbus {
|
|
81
|
+
fieldbus: true;
|
|
82
|
+
id: string;
|
|
83
|
+
keyPath: [string, string];
|
|
84
|
+
label: string;
|
|
85
|
+
}
|
|
86
|
+
interface ActiveAlarmsStatus {
|
|
87
|
+
critical: number;
|
|
88
|
+
major: number;
|
|
89
|
+
minor: number;
|
|
90
|
+
warning: number;
|
|
91
|
+
}
|
|
92
|
+
declare const INITIAL_SVG_CODE = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg width=\"600px\" height=\"1350px\" viewBox=\"0 0 600 1350\" xmlns=\"http://www.w3.org/2000/svg\">\n <style>\n /* Typography */\n .header {\n font-family: var(--c8y-font-family-base);\n font-size: 28px;\n font-weight: bold;\n fill: var(--text-color, var(--c8y-component-color-default, var(--c8y-root-component-color-default)));\n }\n .branded {\n fill: var(--brand-primary,var(--c8y-brand-primary));\n }\n .step-number {\n font-family: var(--c8y-font-family-base);\n font-size: 18px;\n font-weight: bold;\n fill: var(--c8y-component-background-default, var(--c8y-root-component-background-default));\n }\n .step-title {\n font-family: var(--c8y-font-family-base);\n font-size: 16px;\n font-weight: bold;\n fill: var(--text-color, var(--c8y-component-color-default, var(--c8y-root-component-color-default)));\n }\n .description {\n font-family: var(--c8y-font-family-base);\n font-size: 14px;\n }\n .placeholder {\n font-family: var(--c8y-font-family-base);\n font-size: 14px;\n fill: var(--brand-primary,var(--c8y-brand-primary));\n font-weight: bold;\n }\n .code {\n font-family: var(--c8y-font-family-mono-spaced);\n font-size: 12px;\n fill: var(--c8y-code-color);\n }\n .label {\n font-family: var(--c8y-font-family-base);\n font-size: 13px;\n fill: var(--text-color, var(--c8y-component-color-default, var(--c8y-root-component-color-default)));\n }\n \n /* Components */\n .section-bg {\n fill: var(--c8y-pre-background);\n stroke: var(--c8y-pre-border-color);\n stroke-width: 1px;\n rx: 4px;\n }\n .step-circle {\n fill: var(--brand-primary,var(--c8y-brand-primary));\n }\n .code-bg {\n fill: #0000000d;\n stroke: transparent;\n stroke-width: 1px;\n rx: 13px;\n }\n .button{\n cursor: pointer;\n }\n .button-bg {\n fill: var(--brand-primary,var(--c8y-brand-primary));\n rx: var(--c8y-btn-border-radius-base);\n stroke: var(--brand-primary,var(--c8y-brand-primary));\n stroke-width: 1px;\n }\n .button-text {\n font-family: inherit;\n font-size: 14px;\n fill: var(--c8y-component-background-default, var(--c8y-root-component-background-default));\n text-anchor: middle;\n }\n .button:hover .button-bg {\n fill: var(--c8y-component-background-default, var(--c8y-root-component-background-default));\n }\n .button:hover .button-text {\n fill: var(--brand-primary,var(--c8y-brand-primary));\n }\n .divider {\n stroke: var(--c8y-component-border-color, var(--c8y-root-component-border-color));\n stroke-width: 2px;\n }\n \n /* Alarm status indicators */\n .alarm-none {\n fill: var(--c8y-palette-status-success);\n }\n .alarm-warning {\n fill: var(--c8y-palette-status-info);\n }\n .alarm-minor {\n fill: var(--c8y-palette-status-warning-high);\n }\n .alarm-major {\n fill: var(--c8y-palette-status-warning);\n }\n .alarm-critical {\n fill: var(--c8y-palette-status-danger);\n }\n \n /* Conditional text colors */\n .temp-ok {\n fill: var(--c8y-palette-status-success);\n }\n .temp-warning {\n fill:var(--c8y-palette-status-danger);\n }\n </style>\n \n <!-- Background -->\n <rect width=\"600\" height=\"1400\" fill=\"var(--c8y-component-background-default, var(--c8y-root-component-background-default))\" />\n \n <!-- Header -->\n <text x=\"40\" y=\"50\" class=\"header\">SCADA widget example</text>\n \n <text x=\"40\" y=\"90\" class=\"description\">Follow these steps to customize your visualization</text>\n \n <!-- Divider -->\n <line x1=\"40\" y1=\"110\" x2=\"560\" y2=\"110\" class=\"divider\" />\n \n <!-- STEP 1: SVG configuration -->\n <circle cx=\"55\" cy=\"150\" r=\"15\" class=\"step-circle\" />\n <text x=\"55\" y=\"157\" class=\"step-number\" text-anchor=\"middle\">1</text>\n <text x=\"85\" y=\"155\" class=\"step-title\">SVG configuration</text>\n \n <text x=\"85\" y=\"180\" class=\"description\">Use \"SVG configuration\" section to upload a file, paste code, or generate with AI.</text>\n \n <!-- STEP 2: Add Placeholders -->\n <circle cx=\"55\" cy=\"230\" r=\"15\" class=\"step-circle\" />\n <text x=\"55\" y=\"237\" class=\"step-number\" text-anchor=\"middle\">2</text>\n <text x=\"85\" y=\"235\" class=\"step-title\">Add placeholders</text>\n \n <text x=\"85\" y=\"260\" class=\"description\">Click on a text or tspan element in the preview to convert it into a placeholder.</text>\n \n <rect x=\"85\" y=\"280\" width=\"475\" height=\"80\" class=\"section-bg\" />\n <text x=\"100\" y=\"305\" class=\"label\">Example - click text below to make it dynamic:</text>\n <text x=\"100\" y=\"330\" class=\"placeholder\"><tspan>Device name</tspan> (<tspan>Device ID</tspan>)</text>\n \n <!-- STEP 3: Configure Data Binding -->\n <circle cx=\"55\" cy=\"395\" r=\"15\" class=\"step-circle\" />\n <text x=\"55\" y=\"402\" class=\"step-number\" text-anchor=\"middle\">3</text>\n <text x=\"85\" y=\"400\" class=\"step-title\">Configure data binding</text>\n \n <text x=\"85\" y=\"425\" class=\"description\">Assign asset properties to placeholders in the \"Placeholder mappings\" section</text>\n <text x=\"85\" y=\"445\" class=\"description\">to see their values in the preview.</text>\n \n <!-- Example with actual placeholders -->\n <rect x=\"40\" y=\"470\" width=\"520\" height=\"120\" class=\"section-bg\" />\n <text x=\"60\" y=\"495\" class=\"label\">Examples:</text>\n \n <text x=\"60\" y=\"525\" class=\"label\">Device name:</text>\n <text x=\"180\" y=\"525\" class=\"placeholder\">${this.c8yScadaValues?.deviceName || '-'}</text>\n\n <text x=\"60\" y=\"550\" class=\"label\">Temperature:</text>\n <text x=\"180\" y=\"550\" class=\"placeholder\">${this.c8yScadaValues?.temperature || '-'} \u00B0C</text>\n\n <text x=\"60\" y=\"575\" class=\"label\">Status:</text>\n <text x=\"180\" y=\"575\" class=\"placeholder\">${this.c8yScadaValues?.status || '-'}</text>\n\n <!-- STEP 4: Advanced Customization -->\n <circle cx=\"55\" cy=\"630\" r=\"15\" class=\"step-circle\" />\n <text x=\"55\" y=\"637\" class=\"step-number\" text-anchor=\"middle\">4</text>\n <text x=\"85\" y=\"635\" class=\"step-title\">Advanced: Edit component code</text>\n\n <text x=\"85\" y=\"660\" class=\"description\">Open \"Advanced editor\" section to customize the web component directly.</text>\n \n <!-- Advanced Examples -->\n <rect x=\"40\" y=\"690\" width=\"520\" height=\"630\" class=\"section-bg\" />\n <text x=\"60\" y=\"715\" class=\"label\">Advanced examples (see implementation in the editor):</text>\n \n <!-- Example 1a: Interactive Button - Device Details -->\n <text x=\"60\" y=\"745\" class=\"description\">\u2022 Button navigating to device details:</text>\n <g class=\"button\" @click=${() => this.c8yScadaFunctions?.goToDeviceDetails(this.c8yScadaValues?.deviceId)}>\n <rect x=\"70\" y=\"755\" width=\"200\" height=\"35\" class=\"button-bg\" />\n <text x=\"170\" y=\"777\" class=\"button-text\">Go to device details</text>\n </g>\n\n <!-- Example 1b: Interactive Button - Group Details -->\n <text x=\"60\" y=\"820\" class=\"description\">\u2022 Button navigating to group details:</text>\n <g class=\"button\" @click=${() => this.c8yScadaFunctions?.goToGroupDetails(this.c8yScadaValues?.groupId)}>\n <rect x=\"70\" y=\"830\" width=\"200\" height=\"35\" class=\"button-bg\" />\n <text x=\"170\" y=\"852\" class=\"button-text\">Go to group details</text>\n </g>\n\n <!-- Example 2: Conditional Styling -->\n <text x=\"60\" y=\"895\" class=\"description\">\u2022 Conditional styling based on temperature range:</text>\n <text x=\"70\" y=\"920\" \n class=\"${(this.c8yScadaValues?.temperature >= 20 && this.c8yScadaValues?.temperature <= 30) ? 'temp-ok' : 'temp-warning'}\"\n font-size=\"14px\"\n font-weight=\"bold\">\n Green if temperature is between 20 and 30 \u00B0C, otherwise red.\n </text>\n \n <!-- Example 3: Dynamic Width Progress Bar -->\n <text x=\"60\" y=\"975\" class=\"description\">\u2022 Dynamic calculations (progress bar):</text>\n <rect x=\"70\" y=\"985\" width=\"400\" height=\"25\" class=\"code-bg\" />\n <rect x=\"70\" y=\"985\" \n width=\"${Math.min((this.c8yScadaValues?.progress || 0) * 4, 400)}\" \n height=\"25\" \n fill=\"var(--brand-primary,var(--c8y-brand-primary))\" \n rx=\"13\" />\n <text x=\"480\" y=\"1000\" class=\"label\">${this.c8yScadaValues?.progress || 0}%</text>\n \n <!-- Example 4: Alarm Status Circle -->\n <text x=\"60\" y=\"1040\" class=\"description\">\u2022 Alarm status indicator using getActiveAlarmsStatusClass():</text>\n <circle cx=\"80\" cy=\"1065\" r=\"12\" \n class=\"${this.c8yScadaFunctions?.getActiveAlarmsStatusClass ? 'alarm-' + this.c8yScadaFunctions.getActiveAlarmsStatusClass(this.c8yScadaValues?.alarmsStatus) : 'alarm-none'}\" />\n <text x=\"100\" y=\"1070\" class=\"label\">\n Alarm status:\n ${this.c8yScadaValues?.alarmsStatus?.critical > 0 ? 'CRITICAL' : this.c8yScadaValues?.alarmsStatus?.major > 0 ? 'MAJOR' : this.c8yScadaValues?.alarmsStatus?.minor > 0 ? 'MINOR' : this.c8yScadaValues?.alarmsStatus?.warning > 0 ? 'WARNING' : 'OK'}\n </text>\n \n <!-- Legend for alarm colors -->\n <text x=\"70\" y=\"1110\" class=\"label\">Alarm color legend:</text>\n <circle cx=\"80\" cy=\"1130\" r=\"8\" class=\"alarm-none\" />\n <text x=\"95\" y=\"1135\" class=\"description\">OK</text>\n \n <circle cx=\"150\" cy=\"1130\" r=\"8\" class=\"alarm-warning\" />\n <text x=\"165\" y=\"1135\" class=\"description\">Warning</text>\n \n <circle cx=\"240\" cy=\"1130\" r=\"8\" class=\"alarm-minor\" />\n <text x=\"255\" y=\"1135\" class=\"description\">Minor</text>\n \n <circle cx=\"320\" cy=\"1130\" r=\"8\" class=\"alarm-major\" />\n <text x=\"335\" y=\"1135\" class=\"description\">Major</text>\n \n <circle cx=\"400\" cy=\"1130\" r=\"8\" class=\"alarm-critical\" />\n <text x=\"415\" y=\"1135\" class=\"description\">Critical</text>\n \n <!-- Additional examples info -->\n <rect x=\"70\" y=\"1170\" width=\"460\" height=\"130\" fill=\"var(--c8y-palette-status-info-light)\" stroke=\"var(--c8y-palette-status-info)\" stroke-width=\"1\" rx=\"4\" />\n <text x=\"85\" y=\"1195\" class=\"label\" font-weight=\"bold\">\uD83D\uDCA1 Tips for advanced usage:</text>\n <text x=\"85\" y=\"1220\" class=\"description\">\u2022 Use this.c8yScadaValues to access placeholder values</text>\n <text x=\"85\" y=\"1240\" class=\"description\">\u2022 Use this.c8yScadaFunctions for navigation and utilities</text>\n <text x=\"85\" y=\"1260\" class=\"description\">\u2022 Combine template literals \\${ } with conditional logic</text>\n <text x=\"85\" y=\"1280\" class=\"description\">\u2022 Apply CSS classes dynamically for styling</text>\n</svg>\n";
|
|
93
|
+
|
|
94
|
+
declare class ScadaWidgetService {
|
|
95
|
+
getScadaFunctions(): {
|
|
96
|
+
goToGroupDetails: (groupId: IIdentified["id"]) => void;
|
|
97
|
+
goToDeviceDetails: (deviceId: IIdentified["id"]) => void;
|
|
98
|
+
getActiveAlarmsStatusClass: (activeAlarmsStatus: ActiveAlarmsStatus) => keyof ActiveAlarmsStatus | "none";
|
|
99
|
+
};
|
|
100
|
+
getSvgComputedStyling(settings: SvgDisplaySettings | null | undefined): SvgComputedStyling;
|
|
101
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ScadaWidgetService, never>;
|
|
102
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<ScadaWidgetService>;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
declare class ScadaWidgetConfigService {
|
|
106
|
+
private readonly widgetConfigService;
|
|
107
|
+
private readonly widgetConfigMigration;
|
|
108
|
+
private readonly inventory;
|
|
109
|
+
private readonly inventoryBinary;
|
|
110
|
+
private readonly computedPropertiesService;
|
|
111
|
+
private readonly fieldbusService;
|
|
112
|
+
private readonly destroyRef;
|
|
113
|
+
configChanged$: Subject<ScadaWidgetConfig>;
|
|
114
|
+
config$: rxjs.Observable<ScadaWidgetConfig | (ScadaWidgetConfig & GlobalContextState)>;
|
|
115
|
+
constructor();
|
|
116
|
+
initializeConfig(config: ContextWidgetConfig | null): Promise<ScadaWidgetConfig & GlobalContextState>;
|
|
117
|
+
save(config: ScadaWidgetConfig): void;
|
|
118
|
+
updateConfigWithSvgFile(config: ScadaWidgetConfig, svgFile: File): Promise<ScadaWidgetConfig>;
|
|
119
|
+
updateConfigWithSvgCode(config: ScadaWidgetConfig, originalSvgCode: string): Promise<ScadaWidgetConfig>;
|
|
120
|
+
extractTagContent(text: string, tagName: string): string | undefined;
|
|
121
|
+
applySvgCode(code: string): Promise<void>;
|
|
122
|
+
applyMappings(mappings: string): Promise<void>;
|
|
123
|
+
applyScadaOutput(content: string): Promise<void>;
|
|
124
|
+
/**
|
|
125
|
+
* Safely parses an SVG string containing Lit expressions, allows DOM editing, and returns the edited SVG string.
|
|
126
|
+
* Handles escaping/unescaping Lit syntax and expressions.
|
|
127
|
+
*
|
|
128
|
+
* @param svg The SVG string to process.
|
|
129
|
+
* @param editFn A function that receives the parsed SVG document for editing.
|
|
130
|
+
* @returns The edited SVG string, or throws an exception if parsing or editing failed.
|
|
131
|
+
*/
|
|
132
|
+
editSafelySvgWithLitExpressions(svg: string, editFn: (doc: Document) => Promise<void>): Promise<string>;
|
|
133
|
+
updateMappings(config: ScadaWidgetConfig): void;
|
|
134
|
+
/**
|
|
135
|
+
* Removes hardcoded width and height attributes from the root SVG element.
|
|
136
|
+
*
|
|
137
|
+
* @param svg The SVG string to process.
|
|
138
|
+
* @returns The modified SVG string with width and height attributes removed from the root SVG element.
|
|
139
|
+
*/
|
|
140
|
+
private removeHardcodedSvgDimensions;
|
|
141
|
+
/**
|
|
142
|
+
* Processes an SVG string to identify and mark potential text placeholders within `<text>` and `<tspan>` elements.
|
|
143
|
+
*
|
|
144
|
+
* This method performs the following steps:
|
|
145
|
+
* 1. Escapes Lit syntax event bindings (e.g., `@click=${...}`) to avoid XML parsing issues.
|
|
146
|
+
* 2. Parses the SVG string into a DOM structure.
|
|
147
|
+
* 3. For each `<text>` and `<tspan>` element:
|
|
148
|
+
* - Adds a unique `id` attribute if not already present.
|
|
149
|
+
* - Adds the CSS class `potential-placeholder` if the element's text content does not already contain a placeholder expression (`this.c8yScadaValues?.`).
|
|
150
|
+
* 4. Serializes the DOM back to an SVG string and restores the original Lit syntax.
|
|
151
|
+
*
|
|
152
|
+
* If parsing fails (e.g., due to unhandled Lit syntax), the original SVG string is returned unchanged.
|
|
153
|
+
*
|
|
154
|
+
* @param svg The SVG string to process.
|
|
155
|
+
* @returns The modified SVG string with potential placeholders marked, or the original SVG if parsing fails.
|
|
156
|
+
*/
|
|
157
|
+
private findAndAddMarkupForPotentialTextPlaceholders;
|
|
158
|
+
/**
|
|
159
|
+
* Replaces `{{ key }}` placeholders with new template syntax `${this.c8yScadaValues?.key}`.
|
|
160
|
+
*
|
|
161
|
+
* @param svgCode The SVG code string with placeholders.
|
|
162
|
+
* @returns The SVG code string with new template syntax.
|
|
163
|
+
*/
|
|
164
|
+
private replacePlaceholdersWithTemplateSyntax;
|
|
165
|
+
/**
|
|
166
|
+
* Extracts placeholder keys used in the template syntax (`${this.c8yScadaValues?.key}`)
|
|
167
|
+
* from the provided SVG code string.
|
|
168
|
+
*
|
|
169
|
+
* @param svgCode The SVG code string containing template syntax placeholders.
|
|
170
|
+
* @returns Array of unique placeholder keys.
|
|
171
|
+
*/
|
|
172
|
+
private extractScadaKeys;
|
|
173
|
+
/**
|
|
174
|
+
* Extracts placeholder keys used in the legacy template syntax (`{{ key }}`)
|
|
175
|
+
* from the provided SVG code string.
|
|
176
|
+
*
|
|
177
|
+
* @param svgCode The SVG code string containing legacy template syntax placeholders.
|
|
178
|
+
* @returns Array of unique placeholder keys.
|
|
179
|
+
*/
|
|
180
|
+
private extractLegacyScadaKeys;
|
|
181
|
+
private migrateConfigIfNeeded;
|
|
182
|
+
private migrateGlobalContextConfig;
|
|
183
|
+
private migrateFromLegacyBinary;
|
|
184
|
+
private migrateProperty;
|
|
185
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ScadaWidgetConfigService, never>;
|
|
186
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<ScadaWidgetConfigService>;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
declare class ScadaWidgetSvgSelectorComponent implements OnInit {
|
|
190
|
+
widgetConfigService: WidgetConfigService;
|
|
191
|
+
scadaConfigService: ScadaWidgetConfigService;
|
|
192
|
+
sectionComponent: WidgetConfigSectionComponent;
|
|
193
|
+
inventoryService: InventoryService;
|
|
194
|
+
alertService: AlertService;
|
|
195
|
+
aiService: AIService;
|
|
196
|
+
formBuilder: FormBuilder;
|
|
197
|
+
destroyRef: DestroyRef;
|
|
198
|
+
formGroup: _angular_forms.FormGroup<{
|
|
199
|
+
source: _angular_forms.FormControl<"file" | "text" | "ai">;
|
|
200
|
+
svgCode: _angular_forms.FormControl<string>;
|
|
201
|
+
svgDisplaySettings: _angular_forms.FormGroup<{
|
|
202
|
+
displayOption: _angular_forms.FormControl<"contain" | "full-width">;
|
|
203
|
+
horizontalAlignment: _angular_forms.FormControl<string>;
|
|
204
|
+
verticalAlignment: _angular_forms.FormControl<string>;
|
|
205
|
+
}>;
|
|
206
|
+
}>;
|
|
207
|
+
dropArea: _angular_core.Signal<DropAreaComponent>;
|
|
208
|
+
placeholderText: string;
|
|
209
|
+
displayOptions: ({
|
|
210
|
+
label: "Full width`image fitting option`";
|
|
211
|
+
value: string;
|
|
212
|
+
description: "The image is resized to fit the widget's width while preserving the aspect ratio. Overflowing area is scrollable.";
|
|
213
|
+
} | {
|
|
214
|
+
label: "Contain`verb, image fitting option`";
|
|
215
|
+
value: string;
|
|
216
|
+
description: "The image is entirely displayed within the widget while preserving the aspect ratio.";
|
|
217
|
+
})[];
|
|
218
|
+
horizontalAlignmentOptions: ({
|
|
219
|
+
label: "left`horizontal alignment`";
|
|
220
|
+
value: string;
|
|
221
|
+
} | {
|
|
222
|
+
label: "center`horizontal alignment`";
|
|
223
|
+
value: string;
|
|
224
|
+
} | {
|
|
225
|
+
label: "right`horizontal alignment`";
|
|
226
|
+
value: string;
|
|
227
|
+
})[];
|
|
228
|
+
verticalAlignmentOptions: ({
|
|
229
|
+
label: "top`vertical alignment`";
|
|
230
|
+
value: string;
|
|
231
|
+
} | {
|
|
232
|
+
label: "center`vertical alignment`";
|
|
233
|
+
value: string;
|
|
234
|
+
} | {
|
|
235
|
+
label: "bottom`vertical alignment`";
|
|
236
|
+
value: string;
|
|
237
|
+
})[];
|
|
238
|
+
isAiAvailable: _angular_core.WritableSignal<boolean>;
|
|
239
|
+
aiInitialized: boolean;
|
|
240
|
+
chatConfig: Partial<AgentChatConfig>;
|
|
241
|
+
agent: _c8y_ngx_components_ai.ClientAgentDefinition;
|
|
242
|
+
variables: {
|
|
243
|
+
c8yContext: any;
|
|
244
|
+
c8yContextMeasurements: any;
|
|
245
|
+
};
|
|
246
|
+
suggestions: ({
|
|
247
|
+
label: "Analyze and suggest";
|
|
248
|
+
prompt: string;
|
|
249
|
+
} | {
|
|
250
|
+
label: "Best guess";
|
|
251
|
+
prompt: string;
|
|
252
|
+
})[];
|
|
253
|
+
assistantMessageDisplayConfig: AssistantMessageDisplayConfig;
|
|
254
|
+
readonly preprocessAgentMessage: (message: AIAssistantMessage, changedPart: AIStreamResponse["changedPart"]) => AIAssistantMessage;
|
|
255
|
+
ngOnInit(): Promise<void>;
|
|
256
|
+
onSvgFileDropped(event: DroppedFile[]): Promise<void>;
|
|
257
|
+
applySvgCode(): Promise<void>;
|
|
258
|
+
private initializeAI;
|
|
259
|
+
private applyScadaOutput;
|
|
260
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ScadaWidgetSvgSelectorComponent, never>;
|
|
261
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ScadaWidgetSvgSelectorComponent, "c8y-scada-widget-svg-selector", never, {}, {}, never, never, true, never>;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
declare class ScadaWidgetAdvancedEditorComponent {
|
|
265
|
+
private modalService;
|
|
266
|
+
private destroyRef;
|
|
267
|
+
private alert;
|
|
268
|
+
widgetConfigService: WidgetConfigService;
|
|
269
|
+
scadaWidgetConfigService: ScadaWidgetConfigService;
|
|
270
|
+
config$: rxjs.Observable<_c8y_ngx_components_widgets_implementations_scada.ScadaWidgetConfig | (_c8y_ngx_components_widgets_implementations_scada.ScadaWidgetConfig & _c8y_ngx_components_dist_global_context.GlobalContextState)>;
|
|
271
|
+
propertyKeys$: rxjs.Observable<string[]>;
|
|
272
|
+
readonly PROPERTY_PREFIX = "this.c8yScadaValues";
|
|
273
|
+
private readonly isLegacy;
|
|
274
|
+
private readonly scadaWidgetPreview;
|
|
275
|
+
constructor();
|
|
276
|
+
readonly getFormattedPropertyExpressionFn: (key: string) => string;
|
|
277
|
+
changeCode(newCode: string): Promise<void>;
|
|
278
|
+
/**
|
|
279
|
+
* Adds a placeholder variable to a clicked SVG text or tspan element.
|
|
280
|
+
*
|
|
281
|
+
* This method handles the conversion of static text content in SVG elements into dynamic
|
|
282
|
+
* placeholders that can be mapped to SCADA values. It locates the SVG node in the configuration,
|
|
283
|
+
* prompts the user for a placeholder name, and updates both the SVG code and mappings.
|
|
284
|
+
*
|
|
285
|
+
* @param event - The event object containing the SVG Element that was clicked
|
|
286
|
+
* @param event.node - The SVG Element (text or tspan) that was clicked
|
|
287
|
+
*
|
|
288
|
+
* @returns A promise that resolves when the placeholder has been added and configuration saved
|
|
289
|
+
*
|
|
290
|
+
* @remarks
|
|
291
|
+
* - Only processes `<text>` and `<tspan>` SVG elements
|
|
292
|
+
* - Skips elements that already contain placeholder syntax
|
|
293
|
+
* - Removes the 'potential-placeholder' CSS class from the processed node
|
|
294
|
+
* - Generates a camelCase placeholder name from the existing text content
|
|
295
|
+
* - Updates the widget configuration with new placeholder and mapping
|
|
296
|
+
* - If user cancels the placeholder name prompt, no changes are made
|
|
297
|
+
*/
|
|
298
|
+
addPlaceholder(event: {
|
|
299
|
+
node: Element;
|
|
300
|
+
}): Promise<void>;
|
|
301
|
+
confirmPlaceholderName(proposedName: string): Promise<string | null>;
|
|
302
|
+
private handleRename;
|
|
303
|
+
private replaceAsync;
|
|
304
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ScadaWidgetAdvancedEditorComponent, never>;
|
|
305
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ScadaWidgetAdvancedEditorComponent, "c8y-scada-widget-advanced-editor", never, {}, {}, never, never, true, never>;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
declare class ScadaWidgetViewComponent implements DynamicComponent {
|
|
309
|
+
elementRef: ElementRef<any>;
|
|
310
|
+
scadaWidgetService: ScadaWidgetService;
|
|
311
|
+
scadaWidgetConfigService: ScadaWidgetConfigService;
|
|
312
|
+
config: _angular_core.InputSignal<ScadaWidgetConfig>;
|
|
313
|
+
private readonly contextOverride;
|
|
314
|
+
private readonly initializedConfig;
|
|
315
|
+
readonly effectiveConfig: _angular_core.Signal<{
|
|
316
|
+
dateTimeContext?: _c8y_ngx_components_global_context.DateTimeContext;
|
|
317
|
+
aggregation?: packages_client_lib.aggregationType | null;
|
|
318
|
+
isAutoRefreshEnabled?: boolean;
|
|
319
|
+
refreshInterval?: number;
|
|
320
|
+
refreshOption?: _c8y_ngx_components_global_context.RefreshOption;
|
|
321
|
+
displayMode?: `${GLOBAL_CONTEXT_DISPLAY_MODE}`;
|
|
322
|
+
source?: _c8y_ngx_components_global_context.GlobalContextSource;
|
|
323
|
+
eventSourceId?: string;
|
|
324
|
+
isGlobalContextReady?: boolean;
|
|
325
|
+
config: {
|
|
326
|
+
htmlWidgetConfig: _c8y_ngx_components_widgets_implementations_html_widget.HtmlWidgetConfig;
|
|
327
|
+
mappings: _c8y_ngx_components_context_dashboard.AssetPropertyMappings;
|
|
328
|
+
svgDisplaySettings?: SvgDisplaySettings;
|
|
329
|
+
};
|
|
330
|
+
settings?: _c8y_ngx_components.WidgetSettings;
|
|
331
|
+
displaySettings?: _c8y_ngx_components.WidgetDisplaySettings;
|
|
332
|
+
device?: {
|
|
333
|
+
id?: string | number;
|
|
334
|
+
name?: string;
|
|
335
|
+
[key: string]: any;
|
|
336
|
+
};
|
|
337
|
+
export?: (config: any) => any | Promise<any>;
|
|
338
|
+
import?: (config: any, dashboardData: _c8y_ngx_components_context_dashboard.DashboardMetadata) => any | Promise<any>;
|
|
339
|
+
}>;
|
|
340
|
+
svgDisplaySettings: _angular_core.Signal<SvgDisplaySettings>;
|
|
341
|
+
readonly htmlFrameConfig: _angular_core.Signal<{
|
|
342
|
+
css: string;
|
|
343
|
+
code: string;
|
|
344
|
+
options: _c8y_ngx_components_widgets_implementations_html_widget.HtmlWidgetOptions;
|
|
345
|
+
legacy: boolean;
|
|
346
|
+
devMode: boolean;
|
|
347
|
+
latestCodeHash?: string;
|
|
348
|
+
}>;
|
|
349
|
+
readonly device: _angular_core.Signal<{
|
|
350
|
+
[key: string]: any;
|
|
351
|
+
id?: string | number;
|
|
352
|
+
name?: string;
|
|
353
|
+
}>;
|
|
354
|
+
enablePotentialPlaceholders: _angular_core.InputSignal<boolean>;
|
|
355
|
+
potentialPlaceholderClick: _angular_core.OutputEmitterRef<{
|
|
356
|
+
node: Element;
|
|
357
|
+
}>;
|
|
358
|
+
private clickListenerController;
|
|
359
|
+
webComponentRef: Element;
|
|
360
|
+
legacyScopeRef: object;
|
|
361
|
+
private legacyElementRef?;
|
|
362
|
+
preview: _angular_core.InputSignal<boolean>;
|
|
363
|
+
private destroyRef;
|
|
364
|
+
private alertService;
|
|
365
|
+
protected readonly dashboardChild: DashboardChildComponent;
|
|
366
|
+
alerts: DynamicComponentAlertAggregator;
|
|
367
|
+
private readonly SERVER_ERROR_TEXT;
|
|
368
|
+
private assetPropertyMappings;
|
|
369
|
+
readonly realtimeControl$: Observable<boolean>;
|
|
370
|
+
private realtimeSubscription;
|
|
371
|
+
private readonly refresh$;
|
|
372
|
+
propertyValues$: Observable<Record<string, unknown>>;
|
|
373
|
+
isLoading: _angular_core.WritableSignal<boolean>;
|
|
374
|
+
/**
|
|
375
|
+
* Controls link state to global context:
|
|
376
|
+
* - true/undefined: Widget follows global time context
|
|
377
|
+
* - false: Widget uses local state, ignores global changes
|
|
378
|
+
* Set to false when user is interacting (scrolling, zooming) to prevent interruption
|
|
379
|
+
*/
|
|
380
|
+
isLinkedToGlobal: _angular_core.WritableSignal<boolean>;
|
|
381
|
+
readonly GLOBAL_CONTEXT_DISPLAY_MODE: typeof GLOBAL_CONTEXT_DISPLAY_MODE;
|
|
382
|
+
readonly PRESET_NAME: {
|
|
383
|
+
readonly DEFAULT: "default";
|
|
384
|
+
readonly LIFETIME_LIST: "lifetimeList";
|
|
385
|
+
readonly DATA_TABLE: "dataTable";
|
|
386
|
+
readonly DATA_TABLE_CONFIG: "dataTableConfig";
|
|
387
|
+
readonly LIVE_ONLY: "liveOnly";
|
|
388
|
+
readonly AUTO_REFRESH_ONLY: "autoRefreshOnly";
|
|
389
|
+
readonly AUTO_REFRESH_ONLY_CONFIG: "autoRefreshOnlyConfig";
|
|
390
|
+
readonly HISTORY_ONLY: "historyOnly";
|
|
391
|
+
readonly LIFETIME_LIST_CONFIG: "lifetimeListConfig";
|
|
392
|
+
readonly DATAPOINTS_GRAPH: "datapointsGraph";
|
|
393
|
+
readonly DATAPOINTS_GRAPH_CONFIG: "datapointsGraphConfig";
|
|
394
|
+
readonly KPI: "kpi";
|
|
395
|
+
readonly KPI_CONFIG: "kpiConfig";
|
|
396
|
+
readonly DATA_POINTS_LIST: "dataPointsList";
|
|
397
|
+
readonly DATA_POINTS_LIST_CONFIG: "dataPointsListConfig";
|
|
398
|
+
};
|
|
399
|
+
constructor();
|
|
400
|
+
onContextChange(event: {
|
|
401
|
+
context: GlobalContextState;
|
|
402
|
+
diff: GlobalContextState;
|
|
403
|
+
}): void;
|
|
404
|
+
onRefresh(): void;
|
|
405
|
+
private initializeHtmlWidget;
|
|
406
|
+
private applyLegacySvgStyling;
|
|
407
|
+
private setupRealtimeSubscription;
|
|
408
|
+
private handleFetchError;
|
|
409
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ScadaWidgetViewComponent, never>;
|
|
410
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ScadaWidgetViewComponent, "c8y-scada-widget-view", never, { "config": { "alias": "config"; "required": false; "isSignal": true; }; "enablePotentialPlaceholders": { "alias": "enablePotentialPlaceholders"; "required": false; "isSignal": true; }; "preview": { "alias": "preview"; "required": false; "isSignal": true; }; }, { "potentialPlaceholderClick": "potentialPlaceholderClick"; }, never, never, true, never>;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
export { INITIAL_SVG_CODE, SCADA_WIDGET_FEATURE_FLAG_NAME, ScadaWidgetAdvancedEditorComponent, ScadaWidgetConfigService, ScadaWidgetService, ScadaWidgetSvgSelectorComponent, ScadaWidgetViewComponent, defaultAlignment, defaultDisplayOption };
|
|
414
|
+
export type { ActiveAlarmsStatus, DisplayOption, HorizontalAlignment, LegacyMapping, LegacyMappingBase, LegacyMappingComputed, LegacyMappingFieldbus, ScadaWidgetConfig, ScadaWidgetConfigLegacy, SvgComputedStyling, SvgDisplaySettings, VerticalAlignment };
|
|
415
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":["../../../../widgets/implementations/scada/scada-widget-config/scada.model.ts","../../../../widgets/implementations/scada/scada-widget.service.ts","../../../../widgets/implementations/scada/scada-widget-config/scada-widget-config.service.ts","../../../../widgets/implementations/scada/scada-widget-config/scada-widget-svg-selector.component.ts","../../../../widgets/implementations/scada/scada-widget-config/scada-widget-advanced-editor.component.ts","../../../../widgets/implementations/scada/scada-widget-view/scada-widget-view.component.ts"],"sourcesContent":[null,null,null,null,null,null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAKA;AAEM;AACJ;;;;;AAKD;;AAGK;AACA;;;;;AAML;;;;;;;AAQC;;;;;;;AAOD;AAED;AACA;;;AAME;;AAEA;AAAa;;AACb;AAAW;;AACZ;AAEK;;;;;;AAOL;AAEK;;;AAGJ;;AAEE;;AAEH;;;;AAKC;;AAED;;;;;;AAOA;AAED;;AC1EA;;;;AAW4B;;;;;AAoE3B;;ACnDD;AAEE;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;;AAYM;;AAiBA;AAWA;;;;;AAwEN;;;;;;;AAOG;;;AAiDH;;;;;AAKG;;AAWH;;;;;;;;;;;;;;;AAeG;;AA4BH;;;;;AAKG;AACH;AAIA;;;;;;AAMG;AACH;AAeA;;;;;;AAMG;AACH;;AA0BA;;;;;AAuID;;AC3aD;AAiBE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AASG;AACH;AACA;;;;;;;;;AAgBE;;;;;;;;;;AAKA;;;;;;;;;;AAKA;AAEF;AACA;AACA;AAMA;;;;AAIE;;;;;;;AAYA;;AAiBF;AAgEM;AAsCA;;;;;;AAqDP;;ACrRD;;;;AAWE;AACA;AACA;AACA;;AAKA;AAKA;;AAkBA;;AAgBA;;;;;;;;;;;;;;;;;;;AAmBG;;;AAC0C;;;;;;AAuF9C;;AC5ID;AASE;AACA;AACA;AAEA;AACA;AACA;AAYA;;;;;;;;;;;;;;;;;;;;;;;;AAGG;AACH;AACA;;;;;;;AAGG;AACH;;;;AAAyE;AACzE;;;AACwD;;;;;AAMxD;;;AAIA;AACA;AACA;;;;AAMA;AAKA;AAgBA;AACA;;;;;AAKG;AACH;;AAGA;;;;;;;;;;;;;;;;AAAmC;;;;;AA0B6C;AAKhF;AAKA;AA6BA;AA2BA;AA2CA;;;AASD;;;"}
|