@c8y/ngx-components 1024.19.10 → 1024.20.0

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.
@@ -1,16 +1,17 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Pipe, Injectable, inject, ViewChild, Input, ChangeDetectionStrategy, Component, Optional, EventEmitter, forwardRef, Output } from '@angular/core';
3
3
  import * as i1 from '@c8y/ngx-components';
4
- import { ThemeSwitcherService, MeasurementRealtimeService, DatePipe, IconDirective, C8yTranslatePipe, DatapointLabelPipe, DatapointUnitPipe, CommonModule, FormGroupComponent, FormsModule, GuideDocsComponent, MessagesComponent } from '@c8y/ngx-components';
4
+ import { translateDatapointUnit, ThemeSwitcherService, MeasurementRealtimeService, DatePipe, IconDirective, C8yTranslatePipe, DatapointLabelPipe, DatapointUnitPipe, CommonModule, FormGroupComponent, FormsModule, GuideDocsComponent, MessagesComponent } from '@c8y/ngx-components';
5
5
  import * as i1$2 from '@angular/common';
6
6
  import { AsyncPipe, NgStyle, DecimalPipe } from '@angular/common';
7
7
  import { of, BehaviorSubject, switchMap, tap, Subject, takeUntil, debounceTime } from 'rxjs';
8
8
  import { map, catchError } from 'rxjs/operators';
9
- import * as i2 from '@c8y/ngx-components/context-dashboard';
9
+ import * as i2$1 from '@c8y/ngx-components/context-dashboard';
10
10
  import { defaultWidgetIds } from '@c8y/ngx-components/widgets/definitions';
11
11
  import * as i1$1 from 'ngx-echarts';
12
12
  import { NgxEchartsModule, NGX_ECHARTS_CONFIG } from 'ngx-echarts';
13
13
  import { gettext } from '@c8y/ngx-components/gettext';
14
+ import * as i2 from '@ngx-translate/core';
14
15
  import * as i1$3 from '@angular/forms';
15
16
  import { NG_VALUE_ACCESSOR, Validators, NgForm, ControlContainer, ReactiveFormsModule } from '@angular/forms';
16
17
  import { DatapointSelectorModule } from '@c8y/ngx-components/datapoint-selector';
@@ -384,8 +385,9 @@ const GAUGE_PRESETS = [
384
385
  ];
385
386
 
386
387
  class RadialGaugeService {
387
- constructor(c8yDatePipe) {
388
+ constructor(c8yDatePipe, translate) {
388
389
  this.c8yDatePipe = c8yDatePipe;
390
+ this.translate = translate;
389
391
  this.containerSize = 400;
390
392
  }
391
393
  setChart(chart) {
@@ -531,7 +533,7 @@ class RadialGaugeService {
531
533
  : gaugeOptions?.detailOffsetCenter || [0, 0],
532
534
  formatter: () => {
533
535
  const value = measurement?.value.toFixed(fractionSize) || 0;
534
- const unit = activeDatapointGauge?.unit || measurement?.unit || '';
536
+ const unit = translateDatapointUnit(activeDatapointGauge?.unit || measurement?.unit, this.translate);
535
537
  const date = new Date(measurement?.date);
536
538
  const formattedDate = this.c8yDatePipe.transform(date);
537
539
  return `{value|${value}}{unit|${unit}} \n {date|${formattedDate}} `;
@@ -584,7 +586,7 @@ class RadialGaugeService {
584
586
  show: gaugeOptions?.showMarkPoint,
585
587
  formatter: () => {
586
588
  const value = measurement?.value.toFixed(fractionSize) || 0;
587
- const unit = activeDatapointGauge?.unit || measurement?.unit || '';
589
+ const unit = translateDatapointUnit(activeDatapointGauge?.unit || measurement?.unit, this.translate);
588
590
  // use -- as fallback in case date is not set (e.g. no measurement yet available for datapoint)
589
591
  let formattedDate = '--';
590
592
  if (measurement?.date) {
@@ -742,7 +744,7 @@ class RadialGaugeService {
742
744
  return clampedValue;
743
745
  }
744
746
  }
745
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: RadialGaugeService, deps: [{ token: i1.DatePipe }], target: i0.ɵɵFactoryTarget.Injectable }); }
747
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: RadialGaugeService, deps: [{ token: i1.DatePipe }, { token: i2.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable }); }
746
748
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: RadialGaugeService, providedIn: 'root' }); }
747
749
  }
748
750
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: RadialGaugeService, decorators: [{
@@ -750,7 +752,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImpo
750
752
  args: [{
751
753
  providedIn: 'root'
752
754
  }]
753
- }], ctorParameters: () => [{ type: i1.DatePipe }] });
755
+ }], ctorParameters: () => [{ type: i1.DatePipe }, { type: i2.TranslateService }] });
754
756
 
755
757
  class RadialGaugeViewComponent {
756
758
  constructor() {
@@ -885,7 +887,7 @@ class InfoGaugeWidgetViewComponent {
885
887
  datapoint.__target = { name, id };
886
888
  }
887
889
  }
888
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: InfoGaugeWidgetViewComponent, deps: [{ token: i2.ContextDashboardComponent, optional: true }, { token: i1.DynamicComponentComponent, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
890
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: InfoGaugeWidgetViewComponent, deps: [{ token: i2$1.ContextDashboardComponent, optional: true }, { token: i1.DynamicComponentComponent, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
889
891
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.19", type: InfoGaugeWidgetViewComponent, isStandalone: true, selector: "c8y-info-gauge-widget-view", inputs: { config: "config" }, host: { classAttribute: "d-contents" }, providers: [MeasurementRealtimeService], usesOnChanges: true, ngImport: i0, template: "@if (isInfoGauge) {\n <div class=\"label-value-unit-gauge new-radial\">\n @if (activeDatapointLabels?.length && isInfoGauge) {\n <div class=\"gauge-legend\">\n @for (dp of activeDatapointLabels; track dp) {\n @if (dp | infoGaugeCurrentMeasurement | async; as measurement) {\n <label\n class=\"text-truncate\"\n title=\"{{ dp.label }}\"\n >\n {{ dp.label }}\n </label>\n @if (!measurement.notFound) {\n <h3\n class=\"text-truncate\"\n title=\"{{ measurement.value | number: fractionSize }} {{\n dp.unit || measurement.unit\n }}\"\n >\n {{ measurement.value | number: fractionSize }} {{ dp.unit || measurement.unit }}\n </h3>\n } @else {\n <h3>--</h3>\n }\n <p class=\"text-muted m-b-8\">\n <small>\n <div>{{ measurement.date | c8yDate: 'mediumDate' }}</div>\n <div>{{ measurement.date | c8yDate: 'mediumTime' }}</div>\n </small>\n </p>\n }\n }\n </div>\n }\n @if (activeDatapointGauge && isInfoGauge) {\n @if (activeDatapointGauge | infoGaugeCurrentMeasurement: true | async; as measurement) {\n <div class=\"gauge-svg\">\n <svg\n height=\"214px\"\n width=\"214px\"\n viewBox=\"0 0 214 214\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n >\n <desc>radial gauge</desc>\n <g\n id=\"scale\"\n stroke=\"none\"\n stroke-width=\"1\"\n fill=\"none\"\n fill-rule=\"evenodd\"\n stroke-dasharray=\"1,5\"\n >\n <circle\n id=\"Oval\"\n stroke=\"#CACECE\"\n stroke-width=\"7\"\n cx=\"107\"\n cy=\"107\"\n r=\"103\"\n ></circle>\n <rect\n id=\"mask\"\n height=\"214\"\n stroke=\"none\"\n fill-rule=\"evenodd\"\n x=\"0\"\n y=\"0\"\n width=\"214\"\n transform=\"rotate(-45 290 182)\"\n ></rect>\n </g>\n <path\n class=\"track\"\n d=\"M 107 27 a 80 80 0 1 0.1 0 Z\"\n transform=\"rotate(-135 107 107)\"\n ></path>\n <path\n class=\"track-value\"\n [ngStyle]=\"{\n stroke: measurement.color,\n 'stroke-dashoffset': -measurement.strokeDashOffset\n }\"\n d=\"M 107 27 a 80 80 0 1 0.1 0 Z\"\n transform=\"rotate(-135 107 107)\"\n ></path>\n <foreignObject\n class=\"d-flex a-i-center j-c-center\"\n height=\"100%\"\n width=\"100%\"\n requiredFeatures=\"http://www.w3.org/TR/SVG11/feature#Extensibility\"\n >\n <div\n class=\"d-flex d-col fit-h a-i-center j-c-center\"\n style=\"padding: 3rem\"\n xmlns=\"http://www.w3.org/1999/xhtml\"\n >\n <p\n class=\"text-truncate text-center\"\n title=\"{{ activeDatapointGauge.label }}\"\n >\n {{ activeDatapointGauge.label }}\n </p>\n @if (!measurement.notFound) {\n <p\n class=\"center-value text-truncate\"\n title=\"{{ measurement.value | number: fractionSize }}\"\n >\n {{ measurement.value | number: fractionSize }}\n </p>\n } @else {\n <p class=\"center-value\">--</p>\n }\n <p class=\"center-unit strong\">\n {{ activeDatapointGauge.unit || measurement.unit }}\n </p>\n <div class=\"center-date-time\">{{ measurement.date | c8yDate: 'mediumDate' }}</div>\n <div class=\"center-date-time\">{{ measurement.date | c8yDate: 'mediumTime' }}</div>\n </div>\n </foreignObject>\n </svg>\n </div>\n }\n }\n <div class=\"clearfix\"></div>\n </div>\n}\n@if (!isInfoGauge) {\n @if (activeDatapointGauge | infoGaugeCurrentMeasurement | async; as measurement) {\n <c8y-radial-gauge\n [activeDatapointGauge]=\"activeDatapointGauge\"\n [measurement]=\"measurement\"\n [fractionSize]=\"config.fractionSize\"\n [gaugeOptions]=\"config.gaugeOptions\"\n [selectedPresetId]=\"config.selectedPresetId\"\n ></c8y-radial-gauge>\n }\n}\n", dependencies: [{ kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: RadialGaugeViewComponent, selector: "c8y-radial-gauge", inputs: ["activeDatapointGauge", "measurement", "fractionSize", "gaugeOptions", "selectedPresetId"] }, { kind: "pipe", type: InfoGaugeCurrentMeasurementPipe, name: "infoGaugeCurrentMeasurement" }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: DecimalPipe, name: "number" }, { kind: "pipe", type: DatePipe, name: "c8yDate" }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
890
892
  }
891
893
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: InfoGaugeWidgetViewComponent, decorators: [{
@@ -902,7 +904,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImpo
902
904
  DatapointLabelPipe,
903
905
  DatapointUnitPipe
904
906
  ], template: "@if (isInfoGauge) {\n <div class=\"label-value-unit-gauge new-radial\">\n @if (activeDatapointLabels?.length && isInfoGauge) {\n <div class=\"gauge-legend\">\n @for (dp of activeDatapointLabels; track dp) {\n @if (dp | infoGaugeCurrentMeasurement | async; as measurement) {\n <label\n class=\"text-truncate\"\n title=\"{{ dp.label }}\"\n >\n {{ dp.label }}\n </label>\n @if (!measurement.notFound) {\n <h3\n class=\"text-truncate\"\n title=\"{{ measurement.value | number: fractionSize }} {{\n dp.unit || measurement.unit\n }}\"\n >\n {{ measurement.value | number: fractionSize }} {{ dp.unit || measurement.unit }}\n </h3>\n } @else {\n <h3>--</h3>\n }\n <p class=\"text-muted m-b-8\">\n <small>\n <div>{{ measurement.date | c8yDate: 'mediumDate' }}</div>\n <div>{{ measurement.date | c8yDate: 'mediumTime' }}</div>\n </small>\n </p>\n }\n }\n </div>\n }\n @if (activeDatapointGauge && isInfoGauge) {\n @if (activeDatapointGauge | infoGaugeCurrentMeasurement: true | async; as measurement) {\n <div class=\"gauge-svg\">\n <svg\n height=\"214px\"\n width=\"214px\"\n viewBox=\"0 0 214 214\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n >\n <desc>radial gauge</desc>\n <g\n id=\"scale\"\n stroke=\"none\"\n stroke-width=\"1\"\n fill=\"none\"\n fill-rule=\"evenodd\"\n stroke-dasharray=\"1,5\"\n >\n <circle\n id=\"Oval\"\n stroke=\"#CACECE\"\n stroke-width=\"7\"\n cx=\"107\"\n cy=\"107\"\n r=\"103\"\n ></circle>\n <rect\n id=\"mask\"\n height=\"214\"\n stroke=\"none\"\n fill-rule=\"evenodd\"\n x=\"0\"\n y=\"0\"\n width=\"214\"\n transform=\"rotate(-45 290 182)\"\n ></rect>\n </g>\n <path\n class=\"track\"\n d=\"M 107 27 a 80 80 0 1 0.1 0 Z\"\n transform=\"rotate(-135 107 107)\"\n ></path>\n <path\n class=\"track-value\"\n [ngStyle]=\"{\n stroke: measurement.color,\n 'stroke-dashoffset': -measurement.strokeDashOffset\n }\"\n d=\"M 107 27 a 80 80 0 1 0.1 0 Z\"\n transform=\"rotate(-135 107 107)\"\n ></path>\n <foreignObject\n class=\"d-flex a-i-center j-c-center\"\n height=\"100%\"\n width=\"100%\"\n requiredFeatures=\"http://www.w3.org/TR/SVG11/feature#Extensibility\"\n >\n <div\n class=\"d-flex d-col fit-h a-i-center j-c-center\"\n style=\"padding: 3rem\"\n xmlns=\"http://www.w3.org/1999/xhtml\"\n >\n <p\n class=\"text-truncate text-center\"\n title=\"{{ activeDatapointGauge.label }}\"\n >\n {{ activeDatapointGauge.label }}\n </p>\n @if (!measurement.notFound) {\n <p\n class=\"center-value text-truncate\"\n title=\"{{ measurement.value | number: fractionSize }}\"\n >\n {{ measurement.value | number: fractionSize }}\n </p>\n } @else {\n <p class=\"center-value\">--</p>\n }\n <p class=\"center-unit strong\">\n {{ activeDatapointGauge.unit || measurement.unit }}\n </p>\n <div class=\"center-date-time\">{{ measurement.date | c8yDate: 'mediumDate' }}</div>\n <div class=\"center-date-time\">{{ measurement.date | c8yDate: 'mediumTime' }}</div>\n </div>\n </foreignObject>\n </svg>\n </div>\n }\n }\n <div class=\"clearfix\"></div>\n </div>\n}\n@if (!isInfoGauge) {\n @if (activeDatapointGauge | infoGaugeCurrentMeasurement | async; as measurement) {\n <c8y-radial-gauge\n [activeDatapointGauge]=\"activeDatapointGauge\"\n [measurement]=\"measurement\"\n [fractionSize]=\"config.fractionSize\"\n [gaugeOptions]=\"config.gaugeOptions\"\n [selectedPresetId]=\"config.selectedPresetId\"\n ></c8y-radial-gauge>\n }\n}\n" }]
905
- }], ctorParameters: () => [{ type: i2.ContextDashboardComponent, decorators: [{
907
+ }], ctorParameters: () => [{ type: i2$1.ContextDashboardComponent, decorators: [{
906
908
  type: Optional
907
909
  }] }, { type: i1.DynamicComponentComponent, decorators: [{
908
910
  type: Optional
@@ -1174,7 +1176,7 @@ class InfoGaugeWidgetConfigComponent {
1174
1176
  gaugePresetId: [this.config.selectedPresetId || 'default']
1175
1177
  });
1176
1178
  }
1177
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: InfoGaugeWidgetConfigComponent, deps: [{ token: i1$3.FormBuilder }, { token: i1$3.NgForm }, { token: i2.WidgetConfigComponent }, { token: i2.WidgetConfigService }, { token: i1.DynamicComponentComponent, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
1179
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: InfoGaugeWidgetConfigComponent, deps: [{ token: i1$3.FormBuilder }, { token: i1$3.NgForm }, { token: i2$1.WidgetConfigComponent }, { token: i2$1.WidgetConfigService }, { token: i1.DynamicComponentComponent, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
1178
1180
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.19", type: InfoGaugeWidgetConfigComponent, isStandalone: true, selector: "c8y-info-gauge-widget-config", inputs: { config: "config" }, providers: [MeasurementRealtimeService], viewQueries: [{ propertyName: "editorComponent", first: true, predicate: EditorComponent, descendants: true }, { propertyName: "previewMapSet", first: true, predicate: ["gaugePreview"], descendants: true }], ngImport: i0, template: "<form [formGroup]=\"formGroup\">\n @if (isInfoGauge) {\n <fieldset class=\"c8y-fieldset\">\n <legend>{{ 'Decimal places' | translate }}</legend>\n <c8y-form-group>\n <input\n class=\"form-control\"\n name=\"fractionSize\"\n type=\"number\"\n formControlName=\"fractionSize\"\n step=\"1\"\n />\n </c8y-form-group>\n </fieldset>\n @if (formGroup.errors?.noActiveDatapoint) {\n <div\n class=\"alert alert-info\"\n role=\"alert\"\n translate\n >\n At least one data point for the labels or the gauge needs to be selected.\n </div>\n }\n } @else {\n <fieldset class=\"c8y-fieldset\">\n <legend>{{ 'Decimal places' | translate }}</legend>\n <c8y-form-group>\n <input\n class=\"form-control\"\n name=\"fractionSize\"\n type=\"number\"\n formControlName=\"fractionSize\"\n step=\"1\"\n />\n </c8y-form-group>\n </fieldset>\n\n <fieldset class=\"c8y-fieldset\">\n <legend>{{ 'Presets' | translate }}</legend>\n <c8y-preset-preview\n formControlName=\"gaugePresetId\"\n [ALL_GAUGE_PRESETS]=\"ALL_GAUGE_PRESETS\"\n (onPresetChange)=\"onRadioPresetChange($event)\"\n ></c8y-preset-preview>\n </fieldset>\n\n <div class=\"p-16\">\n <button\n class=\"btn btn-default\"\n aria-controls=\"advancedCollapse\"\n [attr.aria-expanded]=\"showAdvancedOptions\"\n type=\"button\"\n (click)=\"showAdvancedOptions = !showAdvancedOptions\"\n >\n {{ showAdvancedOptions ? hideAdvancedOptionsLabel : showAdvancedOptionsLabel }}\n </button>\n </div>\n\n <div\n class=\"collapse\"\n id=\"advancedCollapse\"\n [collapse]=\"!showAdvancedOptions\"\n [isAnimated]=\"true\"\n >\n <div\n class=\"fit-h\"\n style=\"min-height: 400px\"\n >\n <c8y-editor\n [ngModel]=\"gaugeOptionsString\"\n (ngModelChange)=\"gaugeJSONChange($event)\"\n (editorInit)=\"assignSchema()\"\n [ngModelOptions]=\"{ standalone: true }\"\n monacoEditorMarkerValidator\n ></c8y-editor>\n </div>\n </div>\n }\n</form>\n\n<ng-template #gaugePreview>\n @if (\n (datapointsGauge?.length > 0 && activeDatapointGauge) ||\n (datapointsLabels?.length > 0 && activeDatapointLabel)\n ) {\n <div>\n <c8y-info-gauge-widget-view [config]=\"previewConfig\"></c8y-info-gauge-widget-view>\n </div>\n } @else {\n <div class=\"d-col a-i-start j-c-center\">\n <c8y-ui-empty-state\n [icon]=\"'c8y-data-points'\"\n [title]=\"'No data points selected' | translate\"\n [subtitle]=\"'Select data point to render content' | translate\"\n [horizontal]=\"false\"\n data-cy=\"info-gauge--empty-state-no-data-point-selected\"\n >\n <p c8y-guide-docs>\n <small\n translate\n ngNonBindable\n >\n Find out more in the\n <a c8y-guide-href=\"/docs/cockpit/widgets-collection/#info-gauge\">user documentation</a>.\n </small>\n </p>\n </c8y-ui-empty-state>\n </div>\n }\n</ng-template>\n", dependencies: [{ kind: "component", type: FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "ngmodule", type: CommonModule }, { kind: "component", type: i1.EmptyStateComponent, selector: "c8y-ui-empty-state", inputs: ["icon", "title", "subtitle", "horizontal"] }, { kind: "directive", type: i1.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$3.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1.RequiredInputPlaceholderDirective, selector: "input[required], input[formControlName]" }, { kind: "ngmodule", type: CollapseModule }, { kind: "directive", type: i4.CollapseDirective, selector: "[collapse]", inputs: ["display", "isAnimated", "collapse"], outputs: ["collapsed", "collapses", "expanded", "expands"], exportAs: ["bs-collapse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: EditorComponent, selector: "c8y-editor", inputs: ["editorOptions", "theme"], outputs: ["editorInit"] }, { kind: "directive", type: MonacoEditorMarkerValidatorDirective, selector: "c8y-editor [monacoEditorMarkerValidator]" }, { kind: "ngmodule", type: DatapointSelectorModule }, { kind: "component", type: PresetPreviewComponent, selector: "c8y-preset-preview", inputs: ["ALL_GAUGE_PRESETS"], outputs: ["onPresetChange"] }, { kind: "component", type: InfoGaugeWidgetViewComponent, selector: "c8y-info-gauge-widget-view", inputs: ["config"] }, { kind: "component", type: GuideDocsComponent, selector: "[c8y-guide-docs]" }, { kind: "pipe", type: i1.C8yTranslatePipe, name: "translate" }], viewProviders: [{ provide: ControlContainer, useExisting: NgForm }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
1179
1181
  }
1180
1182
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: InfoGaugeWidgetConfigComponent, decorators: [{
@@ -1193,7 +1195,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImpo
1193
1195
  InfoGaugeWidgetViewComponent,
1194
1196
  GuideDocsComponent
1195
1197
  ], template: "<form [formGroup]=\"formGroup\">\n @if (isInfoGauge) {\n <fieldset class=\"c8y-fieldset\">\n <legend>{{ 'Decimal places' | translate }}</legend>\n <c8y-form-group>\n <input\n class=\"form-control\"\n name=\"fractionSize\"\n type=\"number\"\n formControlName=\"fractionSize\"\n step=\"1\"\n />\n </c8y-form-group>\n </fieldset>\n @if (formGroup.errors?.noActiveDatapoint) {\n <div\n class=\"alert alert-info\"\n role=\"alert\"\n translate\n >\n At least one data point for the labels or the gauge needs to be selected.\n </div>\n }\n } @else {\n <fieldset class=\"c8y-fieldset\">\n <legend>{{ 'Decimal places' | translate }}</legend>\n <c8y-form-group>\n <input\n class=\"form-control\"\n name=\"fractionSize\"\n type=\"number\"\n formControlName=\"fractionSize\"\n step=\"1\"\n />\n </c8y-form-group>\n </fieldset>\n\n <fieldset class=\"c8y-fieldset\">\n <legend>{{ 'Presets' | translate }}</legend>\n <c8y-preset-preview\n formControlName=\"gaugePresetId\"\n [ALL_GAUGE_PRESETS]=\"ALL_GAUGE_PRESETS\"\n (onPresetChange)=\"onRadioPresetChange($event)\"\n ></c8y-preset-preview>\n </fieldset>\n\n <div class=\"p-16\">\n <button\n class=\"btn btn-default\"\n aria-controls=\"advancedCollapse\"\n [attr.aria-expanded]=\"showAdvancedOptions\"\n type=\"button\"\n (click)=\"showAdvancedOptions = !showAdvancedOptions\"\n >\n {{ showAdvancedOptions ? hideAdvancedOptionsLabel : showAdvancedOptionsLabel }}\n </button>\n </div>\n\n <div\n class=\"collapse\"\n id=\"advancedCollapse\"\n [collapse]=\"!showAdvancedOptions\"\n [isAnimated]=\"true\"\n >\n <div\n class=\"fit-h\"\n style=\"min-height: 400px\"\n >\n <c8y-editor\n [ngModel]=\"gaugeOptionsString\"\n (ngModelChange)=\"gaugeJSONChange($event)\"\n (editorInit)=\"assignSchema()\"\n [ngModelOptions]=\"{ standalone: true }\"\n monacoEditorMarkerValidator\n ></c8y-editor>\n </div>\n </div>\n }\n</form>\n\n<ng-template #gaugePreview>\n @if (\n (datapointsGauge?.length > 0 && activeDatapointGauge) ||\n (datapointsLabels?.length > 0 && activeDatapointLabel)\n ) {\n <div>\n <c8y-info-gauge-widget-view [config]=\"previewConfig\"></c8y-info-gauge-widget-view>\n </div>\n } @else {\n <div class=\"d-col a-i-start j-c-center\">\n <c8y-ui-empty-state\n [icon]=\"'c8y-data-points'\"\n [title]=\"'No data points selected' | translate\"\n [subtitle]=\"'Select data point to render content' | translate\"\n [horizontal]=\"false\"\n data-cy=\"info-gauge--empty-state-no-data-point-selected\"\n >\n <p c8y-guide-docs>\n <small\n translate\n ngNonBindable\n >\n Find out more in the\n <a c8y-guide-href=\"/docs/cockpit/widgets-collection/#info-gauge\">user documentation</a>.\n </small>\n </p>\n </c8y-ui-empty-state>\n </div>\n }\n</ng-template>\n" }]
1196
- }], ctorParameters: () => [{ type: i1$3.FormBuilder }, { type: i1$3.NgForm }, { type: i2.WidgetConfigComponent }, { type: i2.WidgetConfigService }, { type: i1.DynamicComponentComponent, decorators: [{
1198
+ }], ctorParameters: () => [{ type: i1$3.FormBuilder }, { type: i1$3.NgForm }, { type: i2$1.WidgetConfigComponent }, { type: i2$1.WidgetConfigService }, { type: i1.DynamicComponentComponent, decorators: [{
1197
1199
  type: Optional
1198
1200
  }] }], propDecorators: { config: [{
1199
1201
  type: Input