@c8y/ngx-components 1022.21.3 → 1022.26.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/asset-properties/asset-properties.model.d.ts +117 -0
- package/asset-properties/asset-properties.model.d.ts.map +1 -0
- package/asset-properties/asset-properties.service.d.ts +72 -0
- package/asset-properties/asset-properties.service.d.ts.map +1 -0
- package/asset-properties/asset-property-list/asset-property-action.directive.d.ts +11 -0
- package/asset-properties/asset-property-list/asset-property-action.directive.d.ts.map +1 -0
- package/asset-properties/asset-property-list/asset-property-icon.pipe.d.ts +11 -0
- package/asset-properties/asset-property-list/asset-property-icon.pipe.d.ts.map +1 -0
- package/asset-properties/asset-property-list/asset-property-list.component.d.ts +195 -0
- package/asset-properties/asset-property-list/asset-property-list.component.d.ts.map +1 -0
- package/asset-properties/asset-property-list/asset-property-value.pipe.d.ts +17 -0
- package/asset-properties/asset-property-list/asset-property-value.pipe.d.ts.map +1 -0
- package/asset-properties/asset-property-list/tree-data-source.d.ts +19 -0
- package/asset-properties/asset-property-list/tree-data-source.d.ts.map +1 -0
- package/asset-properties/asset-property-selector-drawer/asset-property-selector-drawer.component.d.ts +75 -0
- package/asset-properties/asset-property-selector-drawer/asset-property-selector-drawer.component.d.ts.map +1 -0
- package/asset-properties/c8y-ngx-components-asset-properties.d.ts.map +1 -0
- package/asset-properties/index.d.ts +6 -0
- package/asset-properties/index.d.ts.map +1 -0
- package/core/user/user-edit-modal.component.d.ts.map +1 -1
- package/datapoint-explorer/view/datapoint-explorer.component.d.ts +2 -0
- package/datapoint-explorer/view/datapoint-explorer.component.d.ts.map +1 -1
- package/device-provisioned-certificates/device-tab-provisioned-certificates.component.d.ts +8 -2
- package/device-provisioned-certificates/device-tab-provisioned-certificates.component.d.ts.map +1 -1
- package/echart/charts.component.d.ts +1 -1
- package/echart/charts.component.d.ts.map +1 -1
- package/echart/index.d.ts +1 -0
- package/echart/index.d.ts.map +1 -1
- package/echart/models/datapoints-graph-widget.model.d.ts +13 -0
- package/echart/models/datapoints-graph-widget.model.d.ts.map +1 -1
- package/echart/services/chart-helpers.service.d.ts +23 -0
- package/echart/services/chart-helpers.service.d.ts.map +1 -0
- package/echart/services/echarts-options.service.d.ts +1 -1
- package/echart/services/echarts-options.service.d.ts.map +1 -1
- package/fesm2022/c8y-ngx-components-alarms.mjs +2 -2
- package/fesm2022/c8y-ngx-components-alarms.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-asset-properties.mjs +1573 -0
- package/fesm2022/c8y-ngx-components-asset-properties.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs +22 -7
- package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-device-list.mjs +2 -2
- package/fesm2022/c8y-ngx-components-device-list.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-device-provisioned-certificates.mjs +32 -18
- package/fesm2022/c8y-ngx-components-device-provisioned-certificates.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-echart-models.mjs +14 -1
- package/fesm2022/c8y-ngx-components-echart-models.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-echart.mjs +88 -29
- package/fesm2022/c8y-ngx-components-echart.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-protocol-opcua.mjs +3 -3
- package/fesm2022/c8y-ngx-components-protocol-opcua.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-html-widget.mjs +6 -0
- package/fesm2022/c8y-ngx-components-widgets-definitions-html-widget.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs +12 -4
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-html-widget.mjs +51 -10
- package/fesm2022/c8y-ngx-components-widgets-implementations-html-widget.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components.mjs +1 -1
- package/fesm2022/c8y-ngx-components.mjs.map +1 -1
- package/locales/de.po +38 -24
- package/locales/es.po +38 -24
- package/locales/fr.po +38 -24
- package/locales/ja_JP.po +37 -24
- package/locales/ko.po +37 -24
- package/locales/locales.pot +43 -12
- package/locales/nl.po +38 -24
- package/locales/pl.po +38 -24
- package/locales/pt_BR.po +38 -24
- package/locales/zh_CN.po +38 -24
- package/locales/zh_TW.po +38 -24
- package/package.json +1 -1
- package/widgets/definitions/html-widget/html-widget-config.factory.d.ts.map +1 -1
- package/widgets/implementations/datapoints-graph/datapoints-graph-config/datapoints-graph-widget-config.component.d.ts +2 -0
- package/widgets/implementations/datapoints-graph/datapoints-graph-config/datapoints-graph-widget-config.component.d.ts.map +1 -1
- package/widgets/implementations/html-widget/html-widget-properties-selector/html-widget-properties-selector.component.d.ts +17 -0
- package/widgets/implementations/html-widget/html-widget-properties-selector/html-widget-properties-selector.component.d.ts.map +1 -0
- package/widgets/implementations/html-widget/html-widget.model.d.ts +2 -2
- package/widgets/implementations/html-widget/html-widget.model.d.ts.map +1 -1
- package/widgets/implementations/html-widget/index.d.ts +1 -0
- package/widgets/implementations/html-widget/index.d.ts.map +1 -1
|
@@ -698,7 +698,7 @@ class EchartsOptionsService {
|
|
|
698
698
|
* @param allAlarms - All alarms.
|
|
699
699
|
* @returns The formatted string for the tooltip.
|
|
700
700
|
*/
|
|
701
|
-
getTooltipFormatterForAlarmAndEvents(tooltipParams, params, allEvents, allAlarms) {
|
|
701
|
+
getTooltipFormatterForAlarmAndEvents(tooltipParams, params, allEvents, allAlarms, displayOptions) {
|
|
702
702
|
if (!Array.isArray(tooltipParams)) {
|
|
703
703
|
return '';
|
|
704
704
|
}
|
|
@@ -707,7 +707,7 @@ class EchartsOptionsService {
|
|
|
707
707
|
const allSeries = this.echartsInstance?.getOption()['series'];
|
|
708
708
|
// filter out alarm and event series
|
|
709
709
|
const allDataPointSeries = allSeries.filter(series => series['typeOfSeries'] !== 'alarm' && series['typeOfSeries'] !== 'event');
|
|
710
|
-
this.processSeries(allDataPointSeries, XAxisValue, YAxisReadings);
|
|
710
|
+
this.processSeries(allDataPointSeries, XAxisValue, YAxisReadings, displayOptions);
|
|
711
711
|
// find event and alarm of the same type as the hovered markedLine or markedPoint
|
|
712
712
|
const event = allEvents.find(e => e.type === params.data.itemType);
|
|
713
713
|
const alarm = allAlarms.find(a => a.type === params.data.itemType);
|
|
@@ -896,17 +896,17 @@ class EchartsOptionsService {
|
|
|
896
896
|
* @param XAxisValue - The X Axis value.
|
|
897
897
|
* @param YAxisReadings - The Y Axis readings.
|
|
898
898
|
*/
|
|
899
|
-
processSeries(allDataPointSeries, XAxisValue, YAxisReadings) {
|
|
899
|
+
processSeries(allDataPointSeries, XAxisValue, YAxisReadings, displayOptions) {
|
|
900
900
|
allDataPointSeries.forEach((series) => {
|
|
901
901
|
if (series.datapointId === 'aggregated') {
|
|
902
902
|
return;
|
|
903
903
|
}
|
|
904
904
|
let value = '';
|
|
905
905
|
if (series.id.endsWith('/min')) {
|
|
906
|
-
value = this.processMinSeries(series, allDataPointSeries, XAxisValue);
|
|
906
|
+
value = this.processMinSeries(series, allDataPointSeries, XAxisValue, displayOptions);
|
|
907
907
|
}
|
|
908
908
|
else if (!series.id.endsWith('/max')) {
|
|
909
|
-
value = this.processRegularSeries(series, XAxisValue);
|
|
909
|
+
value = this.processRegularSeries(series, XAxisValue, displayOptions);
|
|
910
910
|
}
|
|
911
911
|
if (value) {
|
|
912
912
|
YAxisReadings.push(`<div class="d-flex a-i-center p-b-8 text-default"><span class='dlt-c8y-icon-circle m-r-4' style='color: ${series.itemStyle.color};'></span>` + // color circle
|
|
@@ -923,7 +923,7 @@ class EchartsOptionsService {
|
|
|
923
923
|
* @param XAxisValue - The X Axis value.
|
|
924
924
|
* @returns The processed value.
|
|
925
925
|
*/
|
|
926
|
-
processMinSeries(series, allDataPointSeries, XAxisValue) {
|
|
926
|
+
processMinSeries(series, allDataPointSeries, XAxisValue, displayOptions) {
|
|
927
927
|
const minValue = this.findValueForExactOrEarlierTimestamp(series.data, XAxisValue);
|
|
928
928
|
if (!minValue) {
|
|
929
929
|
return '';
|
|
@@ -931,7 +931,7 @@ class EchartsOptionsService {
|
|
|
931
931
|
const maxSeries = allDataPointSeries.find(s => s['id'] === series.id.replace('/min', '/max'));
|
|
932
932
|
const maxValue = this.findValueForExactOrEarlierTimestamp(maxSeries?.['data'], XAxisValue);
|
|
933
933
|
return (`<div class="d-flex a-i-center separator-top p-t-8 p-b-8 text-default"><label class="text-12 m-r-8 m-b-0">${this.datePipe.transform(minValue[0])}</label>` +
|
|
934
|
-
`<span class="m-l-auto text-12">${minValue[1]} — ${maxValue?.[1]}` +
|
|
934
|
+
`<span class="m-l-auto text-12">${minValue[1].toFixed(displayOptions.numberOfDecimalPlaces ?? 2) ?? '--'} — ${maxValue?.[1].toFixed(displayOptions.numberOfDecimalPlaces ?? 2) ?? '--'}` +
|
|
935
935
|
(series.datapointUnit ? ` ${series.datapointUnit}` : '') +
|
|
936
936
|
`</span></div>`);
|
|
937
937
|
}
|
|
@@ -941,14 +941,14 @@ class EchartsOptionsService {
|
|
|
941
941
|
* @param XAxisValue - The X Axis value.
|
|
942
942
|
* @returns The processed value.
|
|
943
943
|
*/
|
|
944
|
-
processRegularSeries(series, XAxisValue) {
|
|
944
|
+
processRegularSeries(series, XAxisValue, displayOptions) {
|
|
945
945
|
const seriesValue = this.findValueForExactOrEarlierTimestamp(series.data, XAxisValue);
|
|
946
946
|
if (!seriesValue) {
|
|
947
947
|
return '';
|
|
948
948
|
}
|
|
949
949
|
return (`<div class="d-flex a-i-center p-t-8 p-b-8 separator-top text-default">` +
|
|
950
950
|
`<label class="m-b-0 m-r-8 text-12">${this.datePipe.transform(seriesValue[0])}</label><span class="m-l-auto text-12">` +
|
|
951
|
-
seriesValue[1]?.
|
|
951
|
+
`${seriesValue[1]?.toFixed(displayOptions.numberOfDecimalPlaces ?? 2) ?? '--'}` +
|
|
952
952
|
(series.datapointUnit ? ` ${series.datapointUnit}` : '') +
|
|
953
953
|
`</span></div>`);
|
|
954
954
|
}
|
|
@@ -959,9 +959,9 @@ class EchartsOptionsService {
|
|
|
959
959
|
*/
|
|
960
960
|
processEvent(event, XAxisValue) {
|
|
961
961
|
let value = `<ul class="list-unstyled small separator-top text-default">`;
|
|
962
|
-
value += `<li class="p-t-4 p-b-4 d-flex separator-bottom text-no-wrap"><label class="small m-b-0 m-r-8"
|
|
963
|
-
value += `<li class="p-t-4 p-b-4 d-flex separator-bottom text-no-wrap"><label class="small m-b-0 m-r-8"
|
|
964
|
-
value += `<li class="p-t-4 p-b-4 d-flex separator-bottom text-no-wrap"><label class="small m-b-0 m-r-8"
|
|
962
|
+
value += `<li class="p-t-4 p-b-4 d-flex separator-bottom text-no-wrap"><label class="small m-b-0 m-r-8">${this.translate.instant(gettext('Event type'))}</label><code class="m-l-auto" style="display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; word-break: break-word; white-space: normal; max-width: 200px; -webkit-line-clamp: 2;" title="${event.type}">${event.type}</code></li>`;
|
|
963
|
+
value += `<li class="p-t-4 p-b-4 d-flex separator-bottom text-no-wrap"><label class="small m-b-0 m-r-8">${this.translate.instant(gettext('Event text'))}</label><span class="m-l-auto" style="display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; word-break: break-word; white-space: normal; max-width: 200px; -webkit-line-clamp: 5;" title="${event.text}">${event.text}</span></li>`;
|
|
964
|
+
value += `<li class="p-t-4 p-b-4 d-flex separator-bottom text-no-wrap"><label class="small m-b-0 m-r-8">${this.translate.instant(gettext('Event time'))}</label><span class="m-l-auto">${this.datePipe.transform(XAxisValue)}<span></li>`;
|
|
965
965
|
value += `</ul>`;
|
|
966
966
|
return value;
|
|
967
967
|
}
|
|
@@ -972,19 +972,19 @@ class EchartsOptionsService {
|
|
|
972
972
|
*/
|
|
973
973
|
async processAlarm(alarm) {
|
|
974
974
|
let value = `<ul class="list-unstyled small separator-top text-default m-0">`;
|
|
975
|
-
value += `<li class="p-t-4 p-b-4 d-flex a-i-center separator-bottom text-no-wrap"><label class="text-label-small m-b-0 m-r-8"
|
|
975
|
+
value += `<li class="p-t-4 p-b-4 d-flex a-i-center separator-bottom text-no-wrap"><label class="text-label-small m-b-0 m-r-8">${this.translate.instant(gettext('Alarm severity'))}</label>`;
|
|
976
976
|
value += `<span class="small d-inline-flex a-i-center gap-4 m-l-auto"><i class="stroked-icon icon-14 status dlt-c8y-icon-${this.severityIconPipe.transform(alarm.severity)} ${alarm.severity.toLowerCase()}" > </i> ${this.severityLabelPipe.transform(alarm.severity)} </span></li>`;
|
|
977
|
-
value += `<li class="p-t-4 p-b-4 d-flex separator-bottom text-no-wrap"><label class="text-label-small m-b-0 m-r-8"
|
|
978
|
-
value += `<li class="p-t-4 p-b-4 d-flex separator-bottom text-no-wrap"><label class="text-label-small m-b-0 m-r-8"
|
|
979
|
-
value += `<li class="p-t-4 p-b-4 d-flex separator-bottom text-no-wrap"><label class="text-label-small m-b-0 m-r-8"
|
|
977
|
+
value += `<li class="p-t-4 p-b-4 d-flex separator-bottom text-no-wrap"><label class="text-label-small m-b-0 m-r-8">${this.translate.instant(gettext('Alarm type'))}</label><span class="small m-l-auto"><code>${alarm.type}</code></span></li>`;
|
|
978
|
+
value += `<li class="p-t-4 p-b-4 d-flex separator-bottom text-no-wrap"><label class="text-label-small m-b-0 m-r-8">${this.translate.instant(gettext('Message'))}</label><span class="small m-l-auto" style="display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; overflow: hidden; text-overflow: ellipsis; word-break: break-word; white-space: normal; max-width: 200px;" title="${this.translate.instant(alarm.text)}">${this.translate.instant(alarm.text)}</span></li>`;
|
|
979
|
+
value += `<li class="p-t-4 p-b-4 d-flex separator-bottom text-no-wrap"><label class="text-label-small m-b-0 m-r-8">${this.translate.instant(gettext('Last updated'))}</label><span class="small m-l-auto">${this.datePipe.transform(alarm['lastUpdated'])}</span></li>`;
|
|
980
980
|
const exists = await this.alarmRouteExists();
|
|
981
981
|
if (exists) {
|
|
982
982
|
const currentUrl = window.location.href;
|
|
983
983
|
const baseUrlIndex = currentUrl.indexOf(INDEX_HTML);
|
|
984
984
|
const baseUrl = currentUrl.substring(0, baseUrlIndex + INDEX_HTML.length);
|
|
985
|
-
value += `<li class="p-t-4 p-b-4 d-flex separator-bottom text-no-wrap"><label class="text-label-small m-b-0 m-r-8"
|
|
985
|
+
value += `<li class="p-t-4 p-b-4 d-flex separator-bottom text-no-wrap"><label class="text-label-small m-b-0 m-r-8">${this.translate.instant(gettext('Open details'))}</label><span class="small m-l-auto"><a href="${baseUrl}#/alarms/${alarm.id}/details?showCleared=true">${this.translate.instant(gettext('Alarm details'))}</a></span></li>`;
|
|
986
986
|
}
|
|
987
|
-
value += `<li class="p-t-4 p-b-4 d-flex text-no-wrap"><label class="text-label-small m-b-0 m-r-8"
|
|
987
|
+
value += `<li class="p-t-4 p-b-4 d-flex text-no-wrap"><label class="text-label-small m-b-0 m-r-8">${this.translate.instant(gettext('Alarm count'))}</label><span class="small m-l-auto"><span class="badge badge-info">${alarm.count}</span></span></li>`;
|
|
988
988
|
value += `</ul>`;
|
|
989
989
|
return value;
|
|
990
990
|
}
|
|
@@ -1307,7 +1307,7 @@ class EchartsOptionsService {
|
|
|
1307
1307
|
getTooltipFormatter(displayOptions) {
|
|
1308
1308
|
return params => {
|
|
1309
1309
|
if (!Array.isArray(params) || !params[0]?.data) {
|
|
1310
|
-
return
|
|
1310
|
+
return null;
|
|
1311
1311
|
}
|
|
1312
1312
|
const data = params[0].data;
|
|
1313
1313
|
const XAxisValue = data[0];
|
|
@@ -1335,7 +1335,7 @@ class EchartsOptionsService {
|
|
|
1335
1335
|
value =
|
|
1336
1336
|
`<div class="d-flex a-i-center separator-top text-default p-t-8 p-b-8">` +
|
|
1337
1337
|
`<label class="text-12 m-r-8 m-b-0">${this.datePipe.transform(minValue[0])}</label>` +
|
|
1338
|
-
`<div class="m-l-auto text-12" >${minValue[1].toFixed(displayOptions.numberOfDecimalPlaces ?? 2)} — ${maxValue[1].toFixed(displayOptions.numberOfDecimalPlaces ?? 2)}` +
|
|
1338
|
+
`<div class="m-l-auto text-12" >${minValue[1].toFixed(displayOptions.numberOfDecimalPlaces ?? 2) ?? '--'} — ${maxValue[1].toFixed(displayOptions.numberOfDecimalPlaces ?? 2) ?? '--'}` +
|
|
1339
1339
|
(series['datapointUnit'] ? ` ${series['datapointUnit']}` : '') +
|
|
1340
1340
|
`</div></div>`;
|
|
1341
1341
|
}
|
|
@@ -1351,7 +1351,7 @@ class EchartsOptionsService {
|
|
|
1351
1351
|
value =
|
|
1352
1352
|
`<div class="d-flex a-i-center separator-top text-default p-t-8 p-b-8">` +
|
|
1353
1353
|
`<label class="text-12 m-r-8 m-b-0">${this.datePipe.transform(seriesValue[0])}</label>` +
|
|
1354
|
-
`<div class="m-l-auto text-12" >${seriesValue[1]?.toFixed(displayOptions.numberOfDecimalPlaces ?? 2)}` +
|
|
1354
|
+
`<div class="m-l-auto text-12" >${seriesValue[1]?.toFixed(displayOptions.numberOfDecimalPlaces ?? 2) ?? '--'}` +
|
|
1355
1355
|
(series['datapointUnit'] ? ` ${series['datapointUnit']}` : '') +
|
|
1356
1356
|
`</div></div>`;
|
|
1357
1357
|
}
|
|
@@ -1641,11 +1641,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
1641
1641
|
|
|
1642
1642
|
class ChartAlertsComponent {
|
|
1643
1643
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ChartAlertsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1644
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: ChartAlertsComponent, isStandalone: true, selector: "c8y-chart-alerts", inputs: { alerts: "alerts" }, ngImport: i0, template: "<div\n class=\"overlay-center-vertically d-
|
|
1644
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: ChartAlertsComponent, isStandalone: true, selector: "c8y-chart-alerts", inputs: { alerts: "alerts" }, ngImport: i0, template: "<div\n class=\"overlay-center-vertically d-col p-16 p-r-24 p-l-24\"\n *ngIf=\"alerts?.anyAlertExists$ | async\"\n>\n <ng-container *ngFor=\"let alertGroup of alerts?.alertGroups\">\n <div\n class=\"alert\"\n role=\"alert\"\n *ngIf=\"alertGroup.value.alerts.length\"\n [ngClass]=\"'alert-' + alertGroup.type\"\n >\n <button\n class=\"close\"\n type=\"button\"\n (click)=\"alerts.dismissAlertGroup(alertGroup.type, dismissPermanently.checked)\"\n >\n <span aria-hidden=\"true\">\u00D7</span>\n <span class=\"sr-only\">{{ 'Close' | translate }}</span>\n </button>\n <p *ngFor=\"let alertItem of alertGroup.value.alerts\">\n {{ alertItem.text | translate }}\n </p>\n <label\n class=\"c8y-checkbox m-t-16\"\n title=\"{{ 'Don\\'t show again' | translate }}\"\n >\n <input\n type=\"checkbox\"\n #dismissPermanently\n />\n <span></span>\n <span>{{ \"Don't show again\" | translate }}</span>\n </label>\n </div>\n </ng-container>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1$1.C8yTranslatePipe, name: "translate" }, { kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }] }); }
|
|
1645
1645
|
}
|
|
1646
1646
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ChartAlertsComponent, decorators: [{
|
|
1647
1647
|
type: Component,
|
|
1648
|
-
args: [{ selector: 'c8y-chart-alerts', standalone: true, imports: [CommonModule], template: "<div\n class=\"overlay-center-vertically d-
|
|
1648
|
+
args: [{ selector: 'c8y-chart-alerts', standalone: true, imports: [CommonModule], template: "<div\n class=\"overlay-center-vertically d-col p-16 p-r-24 p-l-24\"\n *ngIf=\"alerts?.anyAlertExists$ | async\"\n>\n <ng-container *ngFor=\"let alertGroup of alerts?.alertGroups\">\n <div\n class=\"alert\"\n role=\"alert\"\n *ngIf=\"alertGroup.value.alerts.length\"\n [ngClass]=\"'alert-' + alertGroup.type\"\n >\n <button\n class=\"close\"\n type=\"button\"\n (click)=\"alerts.dismissAlertGroup(alertGroup.type, dismissPermanently.checked)\"\n >\n <span aria-hidden=\"true\">\u00D7</span>\n <span class=\"sr-only\">{{ 'Close' | translate }}</span>\n </button>\n <p *ngFor=\"let alertItem of alertGroup.value.alerts\">\n {{ alertItem.text | translate }}\n </p>\n <label\n class=\"c8y-checkbox m-t-16\"\n title=\"{{ 'Don\\'t show again' | translate }}\"\n >\n <input\n type=\"checkbox\"\n #dismissPermanently\n />\n <span></span>\n <span>{{ \"Don't show again\" | translate }}</span>\n </label>\n </div>\n </ng-container>\n</div>\n" }]
|
|
1649
1649
|
}], propDecorators: { alerts: [{
|
|
1650
1650
|
type: Input
|
|
1651
1651
|
}] } });
|
|
@@ -1859,7 +1859,15 @@ class ChartsComponent {
|
|
|
1859
1859
|
return;
|
|
1860
1860
|
}
|
|
1861
1861
|
updatedOptions.tooltip.formatter = (tooltipParams) => {
|
|
1862
|
-
return this.echartsOptionsService.getTooltipFormatterForAlarmAndEvents(tooltipParams, params, this.events, this.alarms
|
|
1862
|
+
return this.echartsOptionsService.getTooltipFormatterForAlarmAndEvents(tooltipParams, params, this.events, this.alarms, {
|
|
1863
|
+
displayMarkedLine: this.config.displayMarkedLine || false,
|
|
1864
|
+
displayMarkedPoint: this.config.displayMarkedPoint || false,
|
|
1865
|
+
mergeMatchingDatapoints: this.config.mergeMatchingDatapoints || false,
|
|
1866
|
+
forceMergeDatapoints: this.config.forceMergeDatapoints || false,
|
|
1867
|
+
showLabelAndUnit: this.config.showLabelAndUnit || false,
|
|
1868
|
+
showSlider: this.config.showSlider || false,
|
|
1869
|
+
numberOfDecimalPlaces: this.config.numberOfDecimalPlaces ?? 2
|
|
1870
|
+
});
|
|
1863
1871
|
};
|
|
1864
1872
|
this.echartsInstance.setOption(updatedOptions);
|
|
1865
1873
|
});
|
|
@@ -1873,7 +1881,7 @@ class ChartsComponent {
|
|
|
1873
1881
|
}
|
|
1874
1882
|
onChartClick(params) {
|
|
1875
1883
|
const options = this.echartsInstance.getOption();
|
|
1876
|
-
if (!this.
|
|
1884
|
+
if (!this.isAlarmOrEventClick(params)) {
|
|
1877
1885
|
this.echartsInstance.setOption({
|
|
1878
1886
|
tooltip: { triggerOn: 'mousemove' },
|
|
1879
1887
|
series: [{ markArea: { data: [] }, markLine: { data: [] } }]
|
|
@@ -1881,6 +1889,17 @@ class ChartsComponent {
|
|
|
1881
1889
|
return;
|
|
1882
1890
|
}
|
|
1883
1891
|
const clickedAlarms = this.alarms.filter(alarm => alarm.type === params.data.itemType);
|
|
1892
|
+
const clickedEvents = this.events.filter(event => event.type === params.data.itemType);
|
|
1893
|
+
if (clickedEvents.length > 0) {
|
|
1894
|
+
const updatedOptions = {
|
|
1895
|
+
tooltip: {
|
|
1896
|
+
enterable: true,
|
|
1897
|
+
triggerOn: 'click'
|
|
1898
|
+
}
|
|
1899
|
+
};
|
|
1900
|
+
this.echartsInstance.setOption(updatedOptions);
|
|
1901
|
+
return;
|
|
1902
|
+
}
|
|
1884
1903
|
this.isMarkedAreaEnabled.emit(this.hasMarkArea(options));
|
|
1885
1904
|
const updatedOptions = !this.hasMarkArea(options)
|
|
1886
1905
|
? {
|
|
@@ -1903,8 +1922,9 @@ class ChartsComponent {
|
|
|
1903
1922
|
};
|
|
1904
1923
|
this.echartsInstance.setOption(updatedOptions);
|
|
1905
1924
|
}
|
|
1906
|
-
|
|
1907
|
-
return this.alarms.some(alarm => alarm.type === params.data.itemType)
|
|
1925
|
+
isAlarmOrEventClick(params) {
|
|
1926
|
+
return (this.alarms.some(alarm => alarm.type === params.data.itemType) ||
|
|
1927
|
+
this.events.some(event => event.type === params.data.itemType));
|
|
1908
1928
|
}
|
|
1909
1929
|
hasMarkArea(options) {
|
|
1910
1930
|
return options?.series?.[0]?.markArea?.data?.length > 0;
|
|
@@ -2190,7 +2210,7 @@ class ChartsComponent {
|
|
|
2190
2210
|
values[new Date(this.config.dateFrom).toISOString()] = [{ min: null, max: null }];
|
|
2191
2211
|
}
|
|
2192
2212
|
else {
|
|
2193
|
-
if (this.alerts) {
|
|
2213
|
+
if (this.alerts && !customTimeRange) {
|
|
2194
2214
|
this.alerts.clear();
|
|
2195
2215
|
}
|
|
2196
2216
|
}
|
|
@@ -2299,6 +2319,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
2299
2319
|
args: ['chart']
|
|
2300
2320
|
}] } });
|
|
2301
2321
|
|
|
2322
|
+
class ChartHelpersService {
|
|
2323
|
+
/**
|
|
2324
|
+
* Cleans the widget configuration which will be sent to Gainsight by removing unnecessary properties.
|
|
2325
|
+
* @param config The widget configuration to clean.
|
|
2326
|
+
* @returns The cleaned widget configuration.
|
|
2327
|
+
*/
|
|
2328
|
+
getConfigSummaryForGainsight(config) {
|
|
2329
|
+
return {
|
|
2330
|
+
datapointCount: config.datapoints?.length ?? 0,
|
|
2331
|
+
alarmsEventsCount: config.alarmsEventsConfigs?.length ?? 0,
|
|
2332
|
+
interval: config.interval,
|
|
2333
|
+
forceMergeDatapoints: config.forceMergeDatapoints,
|
|
2334
|
+
mergeMatchingDatapoints: config.mergeMatchingDatapoints,
|
|
2335
|
+
showSlider: config.showSlider,
|
|
2336
|
+
widgetInstanceGlobalTimeContext: config.widgetInstanceGlobalTimeContext,
|
|
2337
|
+
dateFrom: config.dateFrom,
|
|
2338
|
+
dateTo: config.dateTo
|
|
2339
|
+
};
|
|
2340
|
+
}
|
|
2341
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ChartHelpersService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2342
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ChartHelpersService }); }
|
|
2343
|
+
}
|
|
2344
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ChartHelpersService, decorators: [{
|
|
2345
|
+
type: Injectable
|
|
2346
|
+
}] });
|
|
2347
|
+
|
|
2302
2348
|
var DATE_SELECTION_EXTENDED;
|
|
2303
2349
|
(function (DATE_SELECTION_EXTENDED) {
|
|
2304
2350
|
DATE_SELECTION_EXTENDED["CONFIG"] = "config";
|
|
@@ -2308,6 +2354,19 @@ const REALTIME_TEXTS = {
|
|
|
2308
2354
|
ACTIVE: gettext('Realtime active'),
|
|
2309
2355
|
INACTIVE: gettext('Realtime inactive')
|
|
2310
2356
|
};
|
|
2357
|
+
const PRODUCT_EXPERIENCE_DATA_EXPLORER_AND_GRAPH = {
|
|
2358
|
+
EVENTS: {
|
|
2359
|
+
DATA_EXPLORER_AND_GRAPH: 'data-explorer-and-graph'
|
|
2360
|
+
},
|
|
2361
|
+
COMPONENTS: {
|
|
2362
|
+
DATA_EXPLORER_DETAILS: 'data-explorer-details'
|
|
2363
|
+
},
|
|
2364
|
+
ACTIONS: {
|
|
2365
|
+
DATA_EXPLORER_CONFIG_INIT: 'data-explorer-config-init',
|
|
2366
|
+
DATA_EXPLORER_CONFIG_CHANGE: 'data-explorer-config-change',
|
|
2367
|
+
DATA_GRAPH_WIDGET_CONFIG: 'data-graph-widget-config'
|
|
2368
|
+
}
|
|
2369
|
+
};
|
|
2311
2370
|
const SEVERITY_LABELS = {
|
|
2312
2371
|
CRITICAL: gettext('Critical`alarm`'),
|
|
2313
2372
|
MAJOR: gettext('Major`alarm`'),
|
|
@@ -2319,5 +2378,5 @@ const SEVERITY_LABELS = {
|
|
|
2319
2378
|
* Generated bundle index. Do not edit.
|
|
2320
2379
|
*/
|
|
2321
2380
|
|
|
2322
|
-
export { ChartAlarmsService, ChartEventsService, ChartsComponent, DATE_SELECTION_EXTENDED, ICONS_MAP, REALTIME_TEXTS, SEVERITY_LABELS };
|
|
2381
|
+
export { ChartAlarmsService, ChartEventsService, ChartHelpersService, ChartsComponent, DATE_SELECTION_EXTENDED, ICONS_MAP, PRODUCT_EXPERIENCE_DATA_EXPLORER_AND_GRAPH, REALTIME_TEXTS, SEVERITY_LABELS };
|
|
2323
2382
|
//# sourceMappingURL=c8y-ngx-components-echart.mjs.map
|