@c8y/ngx-components 1023.68.7 → 1023.71.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/ai/agent-chat/index.d.ts +235 -75
- package/ai/agent-chat/index.d.ts.map +1 -1
- package/ai/ai-chat/index.d.ts +176 -26
- package/ai/ai-chat/index.d.ts.map +1 -1
- package/ai/index.d.ts +309 -75
- package/ai/index.d.ts.map +1 -1
- package/asset-properties/index.d.ts.map +1 -1
- package/echart/index.d.ts +4 -0
- package/echart/index.d.ts.map +1 -1
- package/echart/models/index.d.ts +2 -0
- package/echart/models/index.d.ts.map +1 -1
- package/events/events-timeline/index.d.ts +3 -2
- package/events/events-timeline/index.d.ts.map +1 -1
- package/fesm2022/c8y-ngx-components-ai-agent-chat.mjs +680 -242
- package/fesm2022/c8y-ngx-components-ai-agent-chat.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-ai-ai-chat.mjs +343 -44
- package/fesm2022/c8y-ngx-components-ai-ai-chat.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-ai.mjs +187 -75
- package/fesm2022/c8y-ngx-components-ai.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-asset-properties.mjs +11 -5
- package/fesm2022/c8y-ngx-components-asset-properties.mjs.map +1 -1
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-alarm-count-config.component-B2cy8gI7.mjs → c8y-ngx-components-computed-asset-properties-alarm-count-config.component-CPLDClTp.mjs} +3 -3
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-alarm-count-config.component-B2cy8gI7.mjs.map → c8y-ngx-components-computed-asset-properties-alarm-count-config.component-CPLDClTp.mjs.map} +1 -1
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-c8y-ngx-components-computed-asset-properties-BYHnA-5R.mjs → c8y-ngx-components-computed-asset-properties-c8y-ngx-components-computed-asset-properties-9be_iMQg.mjs} +30 -13
- package/fesm2022/c8y-ngx-components-computed-asset-properties-c8y-ngx-components-computed-asset-properties-9be_iMQg.mjs.map +1 -0
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-configuration-snapshot-config.component-C4oL39m8.mjs → c8y-ngx-components-computed-asset-properties-configuration-snapshot-config.component-B2em01_W.mjs} +3 -3
- package/fesm2022/c8y-ngx-components-computed-asset-properties-configuration-snapshot-config.component-B2em01_W.mjs.map +1 -0
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-event-count-config.component-DGwm6_C9.mjs → c8y-ngx-components-computed-asset-properties-event-count-config.component-CQuGa1RI.mjs} +3 -3
- package/fesm2022/c8y-ngx-components-computed-asset-properties-event-count-config.component-CQuGa1RI.mjs.map +1 -0
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-fieldbus-item-status-config.component-BxfCjbYY.mjs → c8y-ngx-components-computed-asset-properties-fieldbus-item-status-config.component-CkmurxJv.mjs} +5 -5
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-fieldbus-item-status-config.component-BxfCjbYY.mjs.map → c8y-ngx-components-computed-asset-properties-fieldbus-item-status-config.component-CkmurxJv.mjs.map} +1 -1
- package/fesm2022/c8y-ngx-components-computed-asset-properties-last-measurement-config.component-CTK9zNUh.mjs +86 -0
- package/fesm2022/c8y-ngx-components-computed-asset-properties-last-measurement-config.component-CTK9zNUh.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-computed-asset-properties.mjs +1 -1
- package/fesm2022/c8y-ngx-components-device-shell.mjs +1 -1
- package/fesm2022/c8y-ngx-components-device-shell.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-echart-models.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-echart.mjs +39 -18
- package/fesm2022/c8y-ngx-components-echart.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-events-events-timeline.mjs +5 -2
- package/fesm2022/c8y-ngx-components-events-events-timeline.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-operations-operations-timeline.mjs +5 -2
- package/fesm2022/c8y-ngx-components-operations-operations-timeline.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-html-widget-ai-config.mjs +106 -4
- package/fesm2022/c8y-ngx-components-widgets-definitions-html-widget-ai-config.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-html-widget.mjs +14 -122
- package/fesm2022/c8y-ngx-components-widgets-implementations-html-widget.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components.mjs +9 -5
- package/fesm2022/c8y-ngx-components.mjs.map +1 -1
- package/index.d.ts +2 -1
- package/index.d.ts.map +1 -1
- package/locales/de.po +88 -35
- package/locales/es.po +87 -34
- package/locales/fr.po +87 -34
- package/locales/ja_JP.po +87 -35
- package/locales/ko.po +88 -35
- package/locales/locales.pot +83 -30
- package/locales/nl.po +88 -35
- package/locales/pl.po +88 -35
- package/locales/pt_BR.po +87 -34
- package/locales/zh_CN.po +88 -35
- package/locales/zh_TW.po +88 -35
- package/operations/operations-timeline/index.d.ts +3 -2
- package/operations/operations-timeline/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/widgets/implementations/html-widget/index.d.ts +11 -50
- package/widgets/implementations/html-widget/index.d.ts.map +1 -1
- package/fesm2022/c8y-ngx-components-computed-asset-properties-c8y-ngx-components-computed-asset-properties-BYHnA-5R.mjs.map +0 -1
- package/fesm2022/c8y-ngx-components-computed-asset-properties-configuration-snapshot-config.component-C4oL39m8.mjs.map +0 -1
- package/fesm2022/c8y-ngx-components-computed-asset-properties-event-count-config.component-DGwm6_C9.mjs.map +0 -1
- package/fesm2022/c8y-ngx-components-computed-asset-properties-last-measurement-config.component-C1cuxN3L.mjs +0 -92
- package/fesm2022/c8y-ngx-components-computed-asset-properties-last-measurement-config.component-C1cuxN3L.mjs.map +0 -1
|
@@ -4,7 +4,7 @@ import { gettext } from '@c8y/ngx-components/gettext';
|
|
|
4
4
|
import { from, merge, interval, BehaviorSubject, of, lastValueFrom, defer, forkJoin } from 'rxjs';
|
|
5
5
|
import { mergeMap, map, tap, throttleTime, buffer, switchMap } from 'rxjs/operators';
|
|
6
6
|
import * as i1 from '@c8y/ngx-components';
|
|
7
|
-
import { CommonModule, FormsModule, IconDirective, C8yTranslatePipe, WidgetTimeContextMediatorService, WidgetTimeContextDateRangeService, DismissAlertStrategy, DynamicComponentAlert, CoreModule, MeasurementRealtimeService, AlarmRealtimeService, EventRealtimeService } from '@c8y/ngx-components';
|
|
7
|
+
import { CommonModule, FormsModule, IconDirective, C8yTranslatePipe, WidgetTimeContextMediatorService, WidgetTimeContextDateRangeService, ThemeSwitcherService, DismissAlertStrategy, DynamicComponentAlert, CoreModule, MeasurementRealtimeService, AlarmRealtimeService, EventRealtimeService } from '@c8y/ngx-components';
|
|
8
8
|
import * as echarts from 'echarts';
|
|
9
9
|
import * as i1$2 from '@c8y/client';
|
|
10
10
|
import { AlarmStatus, aggregationType, MeasurementService } from '@c8y/client';
|
|
@@ -110,7 +110,7 @@ class YAxisService {
|
|
|
110
110
|
getYAxis(datapointsWithValues, YAxisOptions) {
|
|
111
111
|
const YAxisPlacement = this.getYAxisPlacement(datapointsWithValues, YAxisOptions);
|
|
112
112
|
const hasValues = datapointsWithValues.some(dp => dp.values && Object.keys(dp.values).length > 0);
|
|
113
|
-
const nameGap = hasValues ?
|
|
113
|
+
const nameGap = hasValues ? 22 : 15;
|
|
114
114
|
if (YAxisOptions.forceMergeDatapoints) {
|
|
115
115
|
return {
|
|
116
116
|
name: Array.from(datapointsWithValues)
|
|
@@ -129,12 +129,13 @@ class YAxisService {
|
|
|
129
129
|
animation: true,
|
|
130
130
|
axisLabel: {
|
|
131
131
|
fontSize: 10,
|
|
132
|
-
show: true
|
|
132
|
+
show: true,
|
|
133
|
+
color: YAxisOptions.axisColor
|
|
133
134
|
},
|
|
134
135
|
axisLine: {
|
|
135
136
|
show: true,
|
|
136
137
|
lineStyle: {
|
|
137
|
-
color:
|
|
138
|
+
color: YAxisOptions.axisColor
|
|
138
139
|
},
|
|
139
140
|
onZero: false
|
|
140
141
|
},
|
|
@@ -195,13 +196,14 @@ class YAxisService {
|
|
|
195
196
|
axisLine: {
|
|
196
197
|
show: !(matchingDpRange && YAxisOptions.mergeMatchingDatapoints),
|
|
197
198
|
lineStyle: {
|
|
198
|
-
color: firstOccurrence.has(dp) ?
|
|
199
|
+
color: firstOccurrence.has(dp) ? YAxisOptions.axisColor : dp.color
|
|
199
200
|
},
|
|
200
201
|
onZero: false
|
|
201
202
|
},
|
|
202
203
|
axisLabel: {
|
|
203
204
|
fontSize: 10,
|
|
204
205
|
show: !matchingDpRange || !YAxisOptions.mergeMatchingDatapoints,
|
|
206
|
+
color: YAxisOptions.axisColor,
|
|
205
207
|
formatter: val => {
|
|
206
208
|
if (this.isDefined(dp.min) && this.isDefined(dp.max)) {
|
|
207
209
|
const range = dp.max - dp.min;
|
|
@@ -457,7 +459,8 @@ class EchartsOptionsService {
|
|
|
457
459
|
mergeMatchingDatapoints: displayOptions.mergeMatchingDatapoints,
|
|
458
460
|
forceMergeDatapoints: displayOptions.forceMergeDatapoints,
|
|
459
461
|
setYaxisStartToZero: displayOptions.setYaxisStartToZero,
|
|
460
|
-
showLabelAndUnit: displayOptions.showLabelAndUnit
|
|
462
|
+
showLabelAndUnit: displayOptions.showLabelAndUnit,
|
|
463
|
+
axisColor: displayOptions.axisColor
|
|
461
464
|
});
|
|
462
465
|
const hasValues = datapointsWithValues.some(dp => dp.values && Object.keys(dp.values).length > 0);
|
|
463
466
|
const leftAxis = Array.isArray(yAxis) ? yAxis.filter(yx => yx.position === 'left') : [];
|
|
@@ -587,13 +590,16 @@ class EchartsOptionsService {
|
|
|
587
590
|
}
|
|
588
591
|
},
|
|
589
592
|
axisLine: {
|
|
590
|
-
|
|
591
|
-
|
|
593
|
+
lineStyle: {
|
|
594
|
+
color: displayOptions.axisColor
|
|
595
|
+
},
|
|
596
|
+
onZeroAxisIndex: datapointsWithValues.findIndex(dp => dp.lineType === 'bars') // align X axis to 0 of Y axis of datapoint with lineType 'bars'
|
|
592
597
|
},
|
|
593
598
|
axisLabel: {
|
|
594
599
|
hideOverlap: true,
|
|
595
600
|
borderWidth: 2, // as there is no margin for labels spacing, transparent border is a workaround
|
|
596
601
|
borderColor: 'transparent',
|
|
602
|
+
color: displayOptions.axisColor,
|
|
597
603
|
formatter: value => {
|
|
598
604
|
const date = new Date(value);
|
|
599
605
|
const locale = selectedLanguage?.replace('_', '-');
|
|
@@ -2076,6 +2082,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
2076
2082
|
|
|
2077
2083
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2078
2084
|
class ChartsComponent {
|
|
2085
|
+
get axisColor() {
|
|
2086
|
+
return (getComputedStyle(this.chart.nativeElement).getPropertyValue('--text-muted')?.trim() ||
|
|
2087
|
+
getComputedStyle(this.chart.nativeElement).getPropertyValue('--c8y-text-muted')?.trim());
|
|
2088
|
+
}
|
|
2079
2089
|
constructor() {
|
|
2080
2090
|
this.showLoadMore = false;
|
|
2081
2091
|
this.alarms = [];
|
|
@@ -2106,6 +2116,7 @@ class ChartsComponent {
|
|
|
2106
2116
|
this.chartAlarmsService = inject(ChartAlarmsService);
|
|
2107
2117
|
this.mediator = inject(WidgetTimeContextMediatorService);
|
|
2108
2118
|
this.widgetTimeContextDateRangeService = inject(WidgetTimeContextDateRangeService);
|
|
2119
|
+
this.themeSwitcherService = inject(ThemeSwitcherService);
|
|
2109
2120
|
this.loadedTimeRange = null;
|
|
2110
2121
|
/** Tracks if the last data fetch returned truncated data */
|
|
2111
2122
|
this.dataWasTruncated = false;
|
|
@@ -2147,6 +2158,11 @@ class ChartsComponent {
|
|
|
2147
2158
|
this.configChangedSubject.next();
|
|
2148
2159
|
}
|
|
2149
2160
|
});
|
|
2161
|
+
this.themeSwitcherService.currentlyAppliedTheme$
|
|
2162
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
2163
|
+
.subscribe(() => {
|
|
2164
|
+
this.configChangedSubject.next();
|
|
2165
|
+
});
|
|
2150
2166
|
}
|
|
2151
2167
|
ngOnChanges() {
|
|
2152
2168
|
// Skip config updates while the user is dragging the slider to prevent
|
|
@@ -2438,7 +2454,8 @@ class ChartsComponent {
|
|
|
2438
2454
|
showLabelAndUnit: this.config.showLabelAndUnit ?? chartDefaults.showLabelAndUnit,
|
|
2439
2455
|
showSlider: this.config.showSlider ?? chartDefaults.showSlider,
|
|
2440
2456
|
smoothLines: this.config.smoothLines ?? chartDefaults.smoothLines,
|
|
2441
|
-
numberOfDecimalPlaces: this.config.numberOfDecimalPlaces ?? chartDefaults.numberOfDecimalPlaces
|
|
2457
|
+
numberOfDecimalPlaces: this.config.numberOfDecimalPlaces ?? chartDefaults.numberOfDecimalPlaces,
|
|
2458
|
+
axisColor: this.axisColor
|
|
2442
2459
|
};
|
|
2443
2460
|
}
|
|
2444
2461
|
getDefaultChartOptions() {
|
|
@@ -2582,11 +2599,13 @@ class ChartsComponent {
|
|
|
2582
2599
|
async getChartOptions(datapointsWithValues) {
|
|
2583
2600
|
const timeRange = {
|
|
2584
2601
|
...this.getTimeRange(),
|
|
2585
|
-
interval: this.config.dateTimeContext?.interval ||
|
|
2602
|
+
interval: (this.config.dateTimeContext?.interval ||
|
|
2603
|
+
this.config.interval ||
|
|
2604
|
+
'custom')
|
|
2586
2605
|
};
|
|
2587
2606
|
const sliderPositionMode = this.getSliderPositionMode();
|
|
2588
2607
|
if ((!this.activeDatapoints || this.activeDatapoints.length === 0) &&
|
|
2589
|
-
this.config.alarmsEventsConfigs?.length > 0) {
|
|
2608
|
+
(this.config.alarmsEventsConfigs?.length ?? 0) > 0) {
|
|
2590
2609
|
return this.echartsOptionsService.getChartOptions(datapointsWithValues, timeRange, {
|
|
2591
2610
|
YAxis: this.config.yAxisSplitLines || false,
|
|
2592
2611
|
XAxis: this.config.xAxisSplitLines || false
|
|
@@ -2599,11 +2618,12 @@ class ChartsComponent {
|
|
|
2599
2618
|
showLabelAndUnit: false,
|
|
2600
2619
|
smoothLines: false,
|
|
2601
2620
|
showSlider: false,
|
|
2602
|
-
showOnlyAlarmsOrEvents: true
|
|
2621
|
+
showOnlyAlarmsOrEvents: true,
|
|
2622
|
+
axisColor: this.axisColor
|
|
2603
2623
|
});
|
|
2604
2624
|
}
|
|
2605
2625
|
if (!this.widgetTimeContextDateRangeService.initialTimeRange()) {
|
|
2606
|
-
this.widgetTimeContextDateRangeService.updateDisplayMode(this.config.displayMode);
|
|
2626
|
+
this.widgetTimeContextDateRangeService.updateDisplayMode(this.config.displayMode ?? 'dashboard');
|
|
2607
2627
|
const intervalForExtension = this.config.dateTimeContext?.interval || this.config.interval || 'custom';
|
|
2608
2628
|
const extendedIntervalMs = this.echartsOptionsService.calculateExtendedIntervalInMs(intervalForExtension, {
|
|
2609
2629
|
dateFrom: timeRange.dateFrom,
|
|
@@ -2619,8 +2639,8 @@ class ChartsComponent {
|
|
|
2619
2639
|
YAxis: this.config.yAxisSplitLines || false,
|
|
2620
2640
|
XAxis: this.config.xAxisSplitLines || false
|
|
2621
2641
|
}, this.events, this.alarms, {
|
|
2622
|
-
|
|
2623
|
-
|
|
2642
|
+
sliderPositionMode,
|
|
2643
|
+
...this.displayOptions
|
|
2624
2644
|
}, undefined, aggregatedDatapoints);
|
|
2625
2645
|
}
|
|
2626
2646
|
else {
|
|
@@ -2651,8 +2671,8 @@ class ChartsComponent {
|
|
|
2651
2671
|
YAxis: this.config.yAxisSplitLines || false,
|
|
2652
2672
|
XAxis: this.config.xAxisSplitLines || false
|
|
2653
2673
|
}, this.events, this.alarms, {
|
|
2654
|
-
|
|
2655
|
-
|
|
2674
|
+
sliderPositionMode,
|
|
2675
|
+
...this.displayOptions
|
|
2656
2676
|
}, timeRange, aggregatedDatapoints, true);
|
|
2657
2677
|
}
|
|
2658
2678
|
}
|
|
@@ -2730,7 +2750,7 @@ class ChartsComponent {
|
|
|
2730
2750
|
this.config.showAdvancedChartOptions &&
|
|
2731
2751
|
aggregatedDatapoint.renderType !== 'area' && {
|
|
2732
2752
|
aggregationFunction: aggregatedDatapoint.renderType,
|
|
2733
|
-
aggregationInterval: this.AGGREGATION_INTERVAL_MAP[customTimeRange ? this.getAggregationTypeForTimeRange() : this.config.aggregation]
|
|
2753
|
+
aggregationInterval: this.AGGREGATION_INTERVAL_MAP[(customTimeRange ? this.getAggregationTypeForTimeRange() : this.config.aggregation)]
|
|
2734
2754
|
})
|
|
2735
2755
|
})).pipe(map(res => {
|
|
2736
2756
|
const values = res.data.values;
|
|
@@ -2759,6 +2779,7 @@ class ChartsComponent {
|
|
|
2759
2779
|
case 'months':
|
|
2760
2780
|
return aggregationType.DAILY;
|
|
2761
2781
|
case 'custom':
|
|
2782
|
+
default:
|
|
2762
2783
|
return aggregationType.HOURLY;
|
|
2763
2784
|
}
|
|
2764
2785
|
}
|