@c8y/ngx-components 1022.6.0 → 1022.8.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.
- package/core/file-picker/file-picker.component.d.ts +5 -2
- package/core/file-picker/file-picker.component.d.ts.map +1 -1
- package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-firmware.mjs +2 -2
- package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-firmware.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-software.mjs +2 -2
- package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-software.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-repository-configuration.mjs +1 -1
- package/fesm2022/c8y-ngx-components-repository-configuration.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-repository-firmware.mjs +6 -6
- package/fesm2022/c8y-ngx-components-repository-firmware.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-repository-software.mjs +4 -4
- package/fesm2022/c8y-ngx-components-repository-software.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-linear-gauge.mjs +19 -7
- package/fesm2022/c8y-ngx-components-widgets-implementations-linear-gauge.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components.mjs +14 -2
- package/fesm2022/c8y-ngx-components.mjs.map +1 -1
- package/locales/locales.pot +12 -0
- package/package.json +1 -1
- package/widgets/implementations/linear-gauge/linear-gauge-widget-view/linear-gauge-widget-view.component.d.ts +1 -0
- package/widgets/implementations/linear-gauge/linear-gauge-widget-view/linear-gauge-widget-view.component.d.ts.map +1 -1
|
@@ -105,19 +105,31 @@ class LinearGaugeWidgetViewComponent {
|
|
|
105
105
|
return {
|
|
106
106
|
current: measurement.value,
|
|
107
107
|
fractionSize: this.config.fractionSize || 1,
|
|
108
|
-
max: dp.max,
|
|
109
|
-
min: dp.min,
|
|
110
|
-
redRangeMax: dp.redRangeMax,
|
|
111
|
-
redRangeMin: dp.redRangeMin,
|
|
112
|
-
target: dp.target,
|
|
108
|
+
max: this.ensureIsNumber(dp.max),
|
|
109
|
+
min: this.ensureIsNumber(dp.min),
|
|
110
|
+
redRangeMax: this.ensureIsNumber(dp.redRangeMax),
|
|
111
|
+
redRangeMin: this.ensureIsNumber(dp.redRangeMin),
|
|
112
|
+
target: this.ensureIsNumber(dp.target),
|
|
113
113
|
time: date,
|
|
114
|
-
yellowRangeMax: dp.yellowRangeMax,
|
|
115
|
-
yellowRangeMin: dp.yellowRangeMin,
|
|
114
|
+
yellowRangeMax: this.ensureIsNumber(dp.yellowRangeMax),
|
|
115
|
+
yellowRangeMin: this.ensureIsNumber(dp.yellowRangeMin),
|
|
116
116
|
unit: measurement.unit || dp.unit,
|
|
117
117
|
orientation: this.getOrientation()
|
|
118
118
|
};
|
|
119
119
|
}));
|
|
120
120
|
}
|
|
121
|
+
ensureIsNumber(value) {
|
|
122
|
+
if (typeof value === 'number') {
|
|
123
|
+
return value;
|
|
124
|
+
}
|
|
125
|
+
if (typeof value === 'string' && value.trim().length > 0) {
|
|
126
|
+
const parsedValue = parseFloat(value);
|
|
127
|
+
if (!isNaN(parsedValue)) {
|
|
128
|
+
return parsedValue;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return undefined;
|
|
132
|
+
}
|
|
121
133
|
assignContextFromContextDashboard(datapoint) {
|
|
122
134
|
if (!this.dashboard?.isDeviceTypeDashboard) {
|
|
123
135
|
return datapoint;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"c8y-ngx-components-widgets-implementations-linear-gauge.mjs","sources":["../../widgets/implementations/linear-gauge/linear-gauge-widget-config/linear-gauge-widget-config.component.ts","../../widgets/implementations/linear-gauge/linear-gauge-widget-config/linear-gauge-widget-config.component.html","../../widgets/implementations/linear-gauge/linear-gauge-widget-view/linear-gauge-widget-view.component.ts","../../widgets/implementations/linear-gauge/linear-gauge-widget-view/linear-gauge-widget-view.component.html","../../widgets/implementations/linear-gauge/c8y-ngx-components-widgets-implementations-linear-gauge.ts"],"sourcesContent":["import { Component, Input, OnInit } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { FormBuilder, NgForm, ReactiveFormsModule, Validators } from '@angular/forms';\nimport type {\n DatapointAttributesFormConfig,\n DatapointSelectorModalOptions,\n KPIDetails\n} from '@c8y/ngx-components/datapoint-selector';\nimport { WidgetConfigComponent } from '@c8y/ngx-components/context-dashboard';\nimport { CoreModule, OnBeforeSave } from '@c8y/ngx-components';\nimport { DatapointSelectorModule } from '@c8y/ngx-components/datapoint-selector';\nimport { LinearGaugeWidgetConfig } from '../linear-gauge.model';\n\n@Component({\n selector: 'c8y-linear-gauge-widget-config',\n templateUrl: './linear-gauge-widget-config.component.html',\n standalone: true,\n imports: [DatapointSelectorModule, ReactiveFormsModule, CoreModule]\n})\nexport class LinearGaugeWidgetConfigComponent implements OnInit, OnBeforeSave {\n @Input() config: LinearGaugeWidgetConfig;\n formGroup: ReturnType<LinearGaugeWidgetConfigComponent['createForm']>;\n datapointSelectionConfig: Partial<DatapointSelectorModalOptions> = {};\n defaultFormOptions: Partial<DatapointAttributesFormConfig> = {\n showRedRange: true,\n showYellowRange: true,\n showRange: true,\n showTarget: true\n };\n private limits = {\n numberOfDecimalPlacesMax: 10,\n numberOfDecimalPlacesMin: 0\n } as const;\n\n constructor(\n private formBuilder: FormBuilder,\n private form: NgForm,\n private widgetConfig: WidgetConfigComponent\n ) {}\n\n onBeforeSave(\n config?: LinearGaugeWidgetConfigComponent['config']\n ): boolean | Promise<boolean> | Observable<boolean> {\n if (this.formGroup.valid) {\n Object.assign(config, this.formGroup.value);\n return true;\n }\n return false;\n }\n\n ngOnInit() {\n if (this.widgetConfig.context?.id) {\n this.datapointSelectionConfig.contextAsset = this.widgetConfig?.context;\n }\n this.initForm();\n if (this.config?.datapoints) {\n this.formGroup.patchValue({ datapoints: this.config.datapoints });\n }\n if (typeof this.config?.fractionSize === 'number' && !Number.isNaN(this.config?.fractionSize)) {\n this.formGroup.patchValue({ fractionSize: this.config.fractionSize });\n }\n }\n\n private initForm(): void {\n this.formGroup = this.createForm();\n this.form.form.addControl('config', this.formGroup);\n this.formGroup.patchValue(this.config);\n }\n\n private createForm() {\n return this.formBuilder.group({\n fractionSize: [\n 2,\n [\n Validators.required,\n Validators.min(this.limits.numberOfDecimalPlacesMin),\n Validators.max(this.limits.numberOfDecimalPlacesMax)\n ]\n ],\n datapoints: this.formBuilder.control(new Array<KPIDetails>(), [Validators.required])\n });\n }\n}\n","<form\n class=\"no-card-context\"\n [formGroup]=\"formGroup\"\n>\n <c8y-datapoint-selection-list\n class=\"bg-inherit d-block\"\n name=\"datapoints\"\n [defaultFormOptions]=\"defaultFormOptions\"\n [config]=\"datapointSelectionConfig\"\n [minActiveCount]=\"1\"\n [maxActiveCount]=\"1\"\n formControlName=\"datapoints\"\n ></c8y-datapoint-selection-list>\n <fieldset class=\"c8y-fieldset\">\n <legend translate>Decimal places</legend>\n <c8y-form-group class=\"form-group-sm m-b-16\">\n <input\n class=\"form-control\"\n name=\"fractionSize\"\n type=\"number\"\n formControlName=\"fractionSize\"\n step=\"1\"\n />\n <c8y-messages [show]=\"formGroup.controls.fractionSize.errors\"></c8y-messages>\n </c8y-form-group>\n </fieldset>\n</form>\n","import { Component, Input, OnChanges, Optional } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { Observable, BehaviorSubject } from 'rxjs';\nimport { distinctUntilChanged, filter, map, shareReplay, switchMap } from 'rxjs/operators';\nimport {\n DynamicComponent,\n DynamicComponentAlert,\n DynamicComponentAlertAggregator,\n DynamicComponentComponent,\n MeasurementRealtimeService,\n RangeDisplay,\n RangeDisplayModule,\n gettext\n} from '@c8y/ngx-components';\nimport type { KPIDetails } from '@c8y/ngx-components/datapoint-selector';\nimport { IMeasurementValue } from '@c8y/client';\nimport { defaultWidgetIds } from '@c8y/ngx-components/widgets/definitions';\nimport { AsyncPipe, NgClass, NgIf } from '@angular/common';\nimport { ContextDashboardComponent } from '@c8y/ngx-components/context-dashboard';\nimport { LinearGaugeWidgetConfig } from '../linear-gauge.model';\n\n@Component({\n selector: 'c8y-linear-gauge-widget-view',\n templateUrl: './linear-gauge-widget-view.component.html',\n providers: [MeasurementRealtimeService],\n standalone: true,\n imports: [NgIf, NgClass, AsyncPipe, RangeDisplayModule]\n})\nexport class LinearGaugeWidgetViewComponent implements OnChanges, DynamicComponent {\n @Input() config: LinearGaugeWidgetConfig;\n\n rangeDisplayConfig$: Observable<RangeDisplay>;\n alerts: DynamicComponentAlertAggregator;\n private activeDatapoint$ = new BehaviorSubject<KPIDetails>(null);\n\n constructor(\n private measurementRealtime: MeasurementRealtimeService,\n @Optional() private dashboard: ContextDashboardComponent,\n @Optional() private dynamicComponent?: DynamicComponentComponent\n ) {\n const activeDatapoint = this.activeDatapoint$.pipe(\n filter(dp => !!dp),\n map(dp => this.assignContextFromContextDashboard(dp)),\n distinctUntilChanged()\n );\n this.rangeDisplayConfig$ = activeDatapoint.pipe(\n switchMap(dp => this.getRangeDisplayConfig$(dp)),\n shareReplay({ refCount: true, bufferSize: 1 })\n );\n this.rangeDisplayConfig$\n .pipe(\n map(data => this.getErrorType(data)),\n distinctUntilChanged<ReturnType<LinearGaugeWidgetViewComponent['getErrorType']>>(),\n takeUntilDestroyed<ReturnType<LinearGaugeWidgetViewComponent['getErrorType']>>()\n )\n .subscribe(inRange => this.updateAlertStatus(inRange));\n }\n\n ngOnChanges(): void {\n const activeDp = this.config.datapoints.find(dp => dp.__active);\n this.activeDatapoint$.next(activeDp);\n }\n\n private getRangeDisplayConfig$(dp: KPIDetails): Observable<RangeDisplay> {\n return this.measurementRealtime\n .latestValueOfSpecificMeasurement$(dp.fragment, dp.series, dp.__target, 1, true)\n .pipe(\n map(m => {\n if (!m) {\n return null;\n }\n const date = m.time;\n const measurement: IMeasurementValue = m[dp.fragment][dp.series];\n return {\n current: measurement.value,\n fractionSize: this.config.fractionSize || 1,\n max: dp.max,\n min: dp.min,\n redRangeMax: dp.redRangeMax,\n redRangeMin: dp.redRangeMin,\n target: dp.target,\n time: date,\n yellowRangeMax: dp.yellowRangeMax,\n yellowRangeMin: dp.yellowRangeMin,\n unit: measurement.unit || dp.unit,\n orientation: this.getOrientation()\n };\n })\n );\n }\n\n private assignContextFromContextDashboard(datapoint: KPIDetails): KPIDetails {\n if (!this.dashboard?.isDeviceTypeDashboard) {\n return datapoint;\n }\n const context = this.dashboard?.context;\n if (context?.id) {\n const { name, id } = context;\n datapoint.__target = { name, id };\n }\n return datapoint;\n }\n\n private getOrientation(): 'horizontal' | 'vertical' {\n return this.dynamicComponent?.componentId === defaultWidgetIds.LINEAR_GAUGE\n ? 'horizontal'\n : 'vertical';\n }\n\n private getErrorType(data: RangeDisplay | null) {\n if (!data) {\n return 'NOT_FOUND';\n }\n\n if (!this.isInRange(data)) {\n return 'OUT_OF_RANGE';\n }\n\n return 'NONE';\n }\n\n private isInRange(data: RangeDisplay): boolean {\n if (!Number.isFinite(data.max) || !Number.isFinite(data.min)) {\n // default range is 0-100\n return data.current <= 100 && data.current >= 0;\n }\n return data.current <= data.max && data.current >= data.min;\n }\n\n private updateAlertStatus(\n errorType: ReturnType<LinearGaugeWidgetViewComponent['getErrorType']>\n ): void {\n if (!this.alerts) {\n return;\n }\n this.alerts.clear();\n let msg: string;\n if (errorType === 'OUT_OF_RANGE') {\n msg = gettext('Current value out of defined range.');\n } else if (errorType === 'NOT_FOUND') {\n msg = gettext('Configured data point not available on the selected device.');\n }\n\n if (!msg) {\n return;\n }\n\n this.alerts.addAlerts(\n new DynamicComponentAlert({\n type: 'warning',\n text: msg\n })\n );\n }\n}\n","<div\n class=\"p-l-16 p-r-16 p-b-16 fit-h d-flex d-col flex-center\"\n *ngIf=\"rangeDisplayConfig$ | async as rangeDisplayConfig\"\n [ngClass]=\"{\n 'p-t-40 j-c-center': rangeDisplayConfig.orientation === 'horizontal',\n }\"\n>\n <c8y-range-display [config]=\"rangeDisplayConfig\" [ngClass]=\"{'flex-grow': rangeDisplayConfig.orientation == 'vertical'}\"></c8y-range-display>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i4","i1"],"mappings":";;;;;;;;;;;;;;;MAmBa,gCAAgC,CAAA;AAe3C,IAAA,WAAA,CACU,WAAwB,EACxB,IAAY,EACZ,YAAmC,EAAA;QAFnC,IAAW,CAAA,WAAA,GAAX,WAAW;QACX,IAAI,CAAA,IAAA,GAAJ,IAAI;QACJ,IAAY,CAAA,YAAA,GAAZ,YAAY;QAftB,IAAwB,CAAA,wBAAA,GAA2C,EAAE;AACrE,QAAA,IAAA,CAAA,kBAAkB,GAA2C;AAC3D,YAAA,YAAY,EAAE,IAAI;AAClB,YAAA,eAAe,EAAE,IAAI;AACrB,YAAA,SAAS,EAAE,IAAI;AACf,YAAA,UAAU,EAAE;SACb;AACO,QAAA,IAAA,CAAA,MAAM,GAAG;AACf,YAAA,wBAAwB,EAAE,EAAE;AAC5B,YAAA,wBAAwB,EAAE;SAClB;;AAQV,IAAA,YAAY,CACV,MAAmD,EAAA;AAEnD,QAAA,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE;YACxB,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;AAC3C,YAAA,OAAO,IAAI;;AAEb,QAAA,OAAO,KAAK;;IAGd,QAAQ,GAAA;QACN,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,EAAE,EAAE;YACjC,IAAI,CAAC,wBAAwB,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,EAAE,OAAO;;QAEzE,IAAI,CAAC,QAAQ,EAAE;AACf,QAAA,IAAI,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE;AAC3B,YAAA,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;;QAEnE,IAAI,OAAO,IAAI,CAAC,MAAM,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AAA,EAAA,CAAA,QAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;4FAE3C,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAP1C,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,8BAA8B,EAE7B,SAAA,EAAA,CAAC,0BAA0B,CAAC,cAC3B,IAAI,EAAA,OAAA,EACP,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,kBAAkB,CAAC,EAAA,QAAA,EAAA,2YAAA,EAAA;;0BAWpD;;0BACA;yCATM,MAAM,EAAA,CAAA;sBAAd;;;AE7BH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"c8y-ngx-components-widgets-implementations-linear-gauge.mjs","sources":["../../widgets/implementations/linear-gauge/linear-gauge-widget-config/linear-gauge-widget-config.component.ts","../../widgets/implementations/linear-gauge/linear-gauge-widget-config/linear-gauge-widget-config.component.html","../../widgets/implementations/linear-gauge/linear-gauge-widget-view/linear-gauge-widget-view.component.ts","../../widgets/implementations/linear-gauge/linear-gauge-widget-view/linear-gauge-widget-view.component.html","../../widgets/implementations/linear-gauge/c8y-ngx-components-widgets-implementations-linear-gauge.ts"],"sourcesContent":["import { Component, Input, OnInit } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { FormBuilder, NgForm, ReactiveFormsModule, Validators } from '@angular/forms';\nimport type {\n DatapointAttributesFormConfig,\n DatapointSelectorModalOptions,\n KPIDetails\n} from '@c8y/ngx-components/datapoint-selector';\nimport { WidgetConfigComponent } from '@c8y/ngx-components/context-dashboard';\nimport { CoreModule, OnBeforeSave } from '@c8y/ngx-components';\nimport { DatapointSelectorModule } from '@c8y/ngx-components/datapoint-selector';\nimport { LinearGaugeWidgetConfig } from '../linear-gauge.model';\n\n@Component({\n selector: 'c8y-linear-gauge-widget-config',\n templateUrl: './linear-gauge-widget-config.component.html',\n standalone: true,\n imports: [DatapointSelectorModule, ReactiveFormsModule, CoreModule]\n})\nexport class LinearGaugeWidgetConfigComponent implements OnInit, OnBeforeSave {\n @Input() config: LinearGaugeWidgetConfig;\n formGroup: ReturnType<LinearGaugeWidgetConfigComponent['createForm']>;\n datapointSelectionConfig: Partial<DatapointSelectorModalOptions> = {};\n defaultFormOptions: Partial<DatapointAttributesFormConfig> = {\n showRedRange: true,\n showYellowRange: true,\n showRange: true,\n showTarget: true\n };\n private limits = {\n numberOfDecimalPlacesMax: 10,\n numberOfDecimalPlacesMin: 0\n } as const;\n\n constructor(\n private formBuilder: FormBuilder,\n private form: NgForm,\n private widgetConfig: WidgetConfigComponent\n ) {}\n\n onBeforeSave(\n config?: LinearGaugeWidgetConfigComponent['config']\n ): boolean | Promise<boolean> | Observable<boolean> {\n if (this.formGroup.valid) {\n Object.assign(config, this.formGroup.value);\n return true;\n }\n return false;\n }\n\n ngOnInit() {\n if (this.widgetConfig.context?.id) {\n this.datapointSelectionConfig.contextAsset = this.widgetConfig?.context;\n }\n this.initForm();\n if (this.config?.datapoints) {\n this.formGroup.patchValue({ datapoints: this.config.datapoints });\n }\n if (typeof this.config?.fractionSize === 'number' && !Number.isNaN(this.config?.fractionSize)) {\n this.formGroup.patchValue({ fractionSize: this.config.fractionSize });\n }\n }\n\n private initForm(): void {\n this.formGroup = this.createForm();\n this.form.form.addControl('config', this.formGroup);\n this.formGroup.patchValue(this.config);\n }\n\n private createForm() {\n return this.formBuilder.group({\n fractionSize: [\n 2,\n [\n Validators.required,\n Validators.min(this.limits.numberOfDecimalPlacesMin),\n Validators.max(this.limits.numberOfDecimalPlacesMax)\n ]\n ],\n datapoints: this.formBuilder.control(new Array<KPIDetails>(), [Validators.required])\n });\n }\n}\n","<form\n class=\"no-card-context\"\n [formGroup]=\"formGroup\"\n>\n <c8y-datapoint-selection-list\n class=\"bg-inherit d-block\"\n name=\"datapoints\"\n [defaultFormOptions]=\"defaultFormOptions\"\n [config]=\"datapointSelectionConfig\"\n [minActiveCount]=\"1\"\n [maxActiveCount]=\"1\"\n formControlName=\"datapoints\"\n ></c8y-datapoint-selection-list>\n <fieldset class=\"c8y-fieldset\">\n <legend translate>Decimal places</legend>\n <c8y-form-group class=\"form-group-sm m-b-16\">\n <input\n class=\"form-control\"\n name=\"fractionSize\"\n type=\"number\"\n formControlName=\"fractionSize\"\n step=\"1\"\n />\n <c8y-messages [show]=\"formGroup.controls.fractionSize.errors\"></c8y-messages>\n </c8y-form-group>\n </fieldset>\n</form>\n","import { Component, Input, OnChanges, Optional } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { Observable, BehaviorSubject } from 'rxjs';\nimport { distinctUntilChanged, filter, map, shareReplay, switchMap } from 'rxjs/operators';\nimport {\n DynamicComponent,\n DynamicComponentAlert,\n DynamicComponentAlertAggregator,\n DynamicComponentComponent,\n MeasurementRealtimeService,\n RangeDisplay,\n RangeDisplayModule,\n gettext\n} from '@c8y/ngx-components';\nimport type { KPIDetails } from '@c8y/ngx-components/datapoint-selector';\nimport { IMeasurementValue } from '@c8y/client';\nimport { defaultWidgetIds } from '@c8y/ngx-components/widgets/definitions';\nimport { AsyncPipe, NgClass, NgIf } from '@angular/common';\nimport { ContextDashboardComponent } from '@c8y/ngx-components/context-dashboard';\nimport { LinearGaugeWidgetConfig } from '../linear-gauge.model';\n\n@Component({\n selector: 'c8y-linear-gauge-widget-view',\n templateUrl: './linear-gauge-widget-view.component.html',\n providers: [MeasurementRealtimeService],\n standalone: true,\n imports: [NgIf, NgClass, AsyncPipe, RangeDisplayModule]\n})\nexport class LinearGaugeWidgetViewComponent implements OnChanges, DynamicComponent {\n @Input() config: LinearGaugeWidgetConfig;\n\n rangeDisplayConfig$: Observable<RangeDisplay>;\n alerts: DynamicComponentAlertAggregator;\n private activeDatapoint$ = new BehaviorSubject<KPIDetails>(null);\n\n constructor(\n private measurementRealtime: MeasurementRealtimeService,\n @Optional() private dashboard: ContextDashboardComponent,\n @Optional() private dynamicComponent?: DynamicComponentComponent\n ) {\n const activeDatapoint = this.activeDatapoint$.pipe(\n filter(dp => !!dp),\n map(dp => this.assignContextFromContextDashboard(dp)),\n distinctUntilChanged()\n );\n this.rangeDisplayConfig$ = activeDatapoint.pipe(\n switchMap(dp => this.getRangeDisplayConfig$(dp)),\n shareReplay({ refCount: true, bufferSize: 1 })\n );\n this.rangeDisplayConfig$\n .pipe(\n map(data => this.getErrorType(data)),\n distinctUntilChanged<ReturnType<LinearGaugeWidgetViewComponent['getErrorType']>>(),\n takeUntilDestroyed<ReturnType<LinearGaugeWidgetViewComponent['getErrorType']>>()\n )\n .subscribe(inRange => this.updateAlertStatus(inRange));\n }\n\n ngOnChanges(): void {\n const activeDp = this.config.datapoints.find(dp => dp.__active);\n this.activeDatapoint$.next(activeDp);\n }\n\n private getRangeDisplayConfig$(dp: KPIDetails): Observable<RangeDisplay> {\n return this.measurementRealtime\n .latestValueOfSpecificMeasurement$(dp.fragment, dp.series, dp.__target, 1, true)\n .pipe(\n map(m => {\n if (!m) {\n return null;\n }\n const date = m.time;\n const measurement: IMeasurementValue = m[dp.fragment][dp.series];\n return {\n current: measurement.value,\n fractionSize: this.config.fractionSize || 1,\n max: this.ensureIsNumber(dp.max),\n min: this.ensureIsNumber(dp.min),\n redRangeMax: this.ensureIsNumber(dp.redRangeMax),\n redRangeMin: this.ensureIsNumber(dp.redRangeMin),\n target: this.ensureIsNumber(dp.target),\n time: date,\n yellowRangeMax: this.ensureIsNumber(dp.yellowRangeMax),\n yellowRangeMin: this.ensureIsNumber(dp.yellowRangeMin),\n unit: measurement.unit || dp.unit,\n orientation: this.getOrientation()\n };\n })\n );\n }\n\n private ensureIsNumber(value: number | string): number {\n if (typeof value === 'number') {\n return value;\n }\n\n if (typeof value === 'string' && value.trim().length > 0) {\n const parsedValue = parseFloat(value);\n if (!isNaN(parsedValue)) {\n return parsedValue;\n }\n }\n return undefined;\n }\n\n private assignContextFromContextDashboard(datapoint: KPIDetails): KPIDetails {\n if (!this.dashboard?.isDeviceTypeDashboard) {\n return datapoint;\n }\n const context = this.dashboard?.context;\n if (context?.id) {\n const { name, id } = context;\n datapoint.__target = { name, id };\n }\n return datapoint;\n }\n\n private getOrientation(): 'horizontal' | 'vertical' {\n return this.dynamicComponent?.componentId === defaultWidgetIds.LINEAR_GAUGE\n ? 'horizontal'\n : 'vertical';\n }\n\n private getErrorType(data: RangeDisplay | null) {\n if (!data) {\n return 'NOT_FOUND';\n }\n\n if (!this.isInRange(data)) {\n return 'OUT_OF_RANGE';\n }\n\n return 'NONE';\n }\n\n private isInRange(data: RangeDisplay): boolean {\n if (!Number.isFinite(data.max) || !Number.isFinite(data.min)) {\n // default range is 0-100\n return data.current <= 100 && data.current >= 0;\n }\n return data.current <= data.max && data.current >= data.min;\n }\n\n private updateAlertStatus(\n errorType: ReturnType<LinearGaugeWidgetViewComponent['getErrorType']>\n ): void {\n if (!this.alerts) {\n return;\n }\n this.alerts.clear();\n let msg: string;\n if (errorType === 'OUT_OF_RANGE') {\n msg = gettext('Current value out of defined range.');\n } else if (errorType === 'NOT_FOUND') {\n msg = gettext('Configured data point not available on the selected device.');\n }\n\n if (!msg) {\n return;\n }\n\n this.alerts.addAlerts(\n new DynamicComponentAlert({\n type: 'warning',\n text: msg\n })\n );\n }\n}\n","<div\n class=\"p-l-16 p-r-16 p-b-16 fit-h d-flex d-col flex-center\"\n *ngIf=\"rangeDisplayConfig$ | async as rangeDisplayConfig\"\n [ngClass]=\"{\n 'p-t-40 j-c-center': rangeDisplayConfig.orientation === 'horizontal',\n }\"\n>\n <c8y-range-display [config]=\"rangeDisplayConfig\" [ngClass]=\"{'flex-grow': rangeDisplayConfig.orientation == 'vertical'}\"></c8y-range-display>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i4","i1"],"mappings":";;;;;;;;;;;;;;;MAmBa,gCAAgC,CAAA;AAe3C,IAAA,WAAA,CACU,WAAwB,EACxB,IAAY,EACZ,YAAmC,EAAA;QAFnC,IAAW,CAAA,WAAA,GAAX,WAAW;QACX,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A,EAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,OAAO,EAAE,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,SAAS,6CAAE,kBAAkB,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAAA,IAAA,CAAA,qBAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,MAAA,EAAA,CAAA,QAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;4FAE3C,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAP1C,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,8BAA8B,EAE7B,SAAA,EAAA,CAAC,0BAA0B,CAAC,cAC3B,IAAI,EAAA,OAAA,EACP,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,kBAAkB,CAAC,EAAA,QAAA,EAAA,2YAAA,EAAA;;0BAWpD;;0BACA;yCATM,MAAM,EAAA,CAAA;sBAAd;;;AE7BH;;AAEG;;;;"}
|
|
@@ -22875,8 +22875,13 @@ class FilePickerComponent {
|
|
|
22875
22875
|
this.onFilesPicked = new EventEmitter();
|
|
22876
22876
|
this.maxAllowedFiles = Infinity;
|
|
22877
22877
|
this.uploadChoice = 'uploadBinary';
|
|
22878
|
+
this.allowedUploadChoices = [
|
|
22879
|
+
'uploadBinary',
|
|
22880
|
+
'uploadUrl'
|
|
22881
|
+
];
|
|
22878
22882
|
this.config = { maxlength: 2048 };
|
|
22879
22883
|
this.ValidationPattern = ValidationPattern;
|
|
22884
|
+
this.providedPopover = gettext$1('Use this option if the device will resolve the binary itself. No file is uploaded.');
|
|
22880
22885
|
}
|
|
22881
22886
|
/**
|
|
22882
22887
|
* @ignore
|
|
@@ -22929,8 +22934,13 @@ class FilePickerComponent {
|
|
|
22929
22934
|
isPopoverUsed() {
|
|
22930
22935
|
return !isEmpty(this.fileUrlPopover);
|
|
22931
22936
|
}
|
|
22937
|
+
setProvidedOption() {
|
|
22938
|
+
this.fileToSave = { url: '$PROVIDED' };
|
|
22939
|
+
delete this.fileUrl;
|
|
22940
|
+
this.onFilesPicked.emit(this.fileToSave);
|
|
22941
|
+
}
|
|
22932
22942
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FilePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
22933
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: FilePickerComponent, isStandalone: true, selector: "c8y-file-picker", inputs: { maxAllowedFiles: "maxAllowedFiles", uploadChoice: "uploadChoice", fileUrl: "fileUrl", fileBinary: "fileBinary", config: "config", filePickerIndex: "filePickerIndex", fileUrlPopover: "fileUrlPopover" }, outputs: { onFilesPicked: "onFilesPicked" }, viewQueries: [{ propertyName: "dropArea", first: true, predicate: DropAreaComponent, descendants: true, static: true }], ngImport: i0, template: "<div class=\"form-group\">\n <label
|
|
22943
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: FilePickerComponent, isStandalone: true, selector: "c8y-file-picker", inputs: { maxAllowedFiles: "maxAllowedFiles", uploadChoice: "uploadChoice", allowedUploadChoices: "allowedUploadChoices", fileUrl: "fileUrl", fileBinary: "fileBinary", config: "config", filePickerIndex: "filePickerIndex", fileUrlPopover: "fileUrlPopover" }, outputs: { onFilesPicked: "onFilesPicked" }, viewQueries: [{ propertyName: "dropArea", first: true, predicate: DropAreaComponent, descendants: true, static: true }], ngImport: i0, template: "<div class=\"form-group\">\n <label\n class=\"c8y-radio\"\n title=\"{{ 'Upload a binary' | translate }}\"\n >\n <input\n name=\"uploadChoice-{{ filePickerIndex }}\"\n type=\"radio\"\n value=\"uploadBinary\"\n #radio\n [(ngModel)]=\"uploadChoice\"\n (click)=\"clearInputFromUrl()\"\n />\n <span></span>\n <span>{{ 'Upload a binary' | translate }}</span>\n </label>\n <label\n class=\"c8y-radio m-l-8\"\n title=\"{{ 'Provide a file path' | translate }}\"\n data-cy=\"file-picker--file-path-input\"\n >\n <input\n name=\"uploadChoice-{{ filePickerIndex }}\"\n type=\"radio\"\n value=\"uploadUrl\"\n #radio\n [(ngModel)]=\"uploadChoice\"\n (click)=\"clearSelectedFiles()\"\n />\n <span></span>\n <span>\n {{ 'Provide a file path' | translate }}\n </span>\n <button\n class=\"btn-help\"\n [attr.aria-label]=\"'Help' | translate\"\n popover=\"{{ fileUrlPopover | translate }}\"\n placement=\"top\"\n placement=\"top\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n *ngIf=\"isPopoverUsed()\"\n ></button>\n </label>\n <label\n class=\"c8y-radio m-l-8\"\n title=\"{{ 'Mark as provided' | translate }}\"\n *ngIf=\"allowedUploadChoices.includes('provided')\"\n >\n <input\n name=\"uploadChoice-{{ filePickerIndex }}\"\n type=\"radio\"\n value=\"provided\"\n #radio\n [(ngModel)]=\"uploadChoice\"\n (click)=\"setProvidedOption()\"\n />\n <span></span>\n <span>{{ 'Provided' | translate }}</span>\n <button\n class=\"btn-help\"\n [attr.aria-label]=\"'Help' | translate\"\n popover=\"{{ providedPopover | translate }}\"\n placement=\"top\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n ></button>\n </label>\n</div>\n\n<div [hidden]=\"uploadChoice !== 'uploadBinary'\">\n <c8y-form-group class=\"m-0\">\n <c8y-drop-area\n class=\"drop-area-sm\"\n [title]=\"'Drop file or click to browse' | translate\"\n [attr.aria-label]=\"'Drop file or click to browse' | translate\"\n (dropped)=\"onFileDropped($event)\"\n [maxAllowedFiles]=\"maxAllowedFiles\"\n [files]=\"droppedFiles\"\n ></c8y-drop-area>\n </c8y-form-group>\n</div>\n\n<div [hidden]=\"uploadChoice !== 'uploadUrl'\">\n <c8y-form-group class=\"m-0\">\n <div class=\"m-b-4 p-b-8\">\n <div class=\"input-group\">\n <span class=\"input-group-addon\">\n <i c8yIcon=\"globe\"></i>\n </span>\n <input\n class=\"form-control\"\n placeholder=\"{{ 'e.g.' | translate }} http://example.com/binary.zip\"\n name=\"fileUrl\"\n type=\"text\"\n required\n data-cy=\"file-picker--fileUrl\"\n [(ngModel)]=\"fileUrl\"\n (ngModelChange)=\"onFileUrlChange($event)\"\n maxlength=\"{{ config.maxlength }}\"\n [pattern]=\"ValidationPattern.rules.noWhiteSpaceOnly.pattern\"\n />\n </div>\n </div>\n </c8y-form-group>\n</div>\n", dependencies: [{ kind: "ngmodule", type: FormsModule$1 }, { kind: "directive", type: i1$8.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$8.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i1$8.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$8.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$8.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1$8.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i1$8.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: PopoverModule }, { kind: "directive", type: i1$9.PopoverDirective, selector: "[popover]", inputs: ["adaptivePosition", "boundariesElement", "popover", "popoverContext", "popoverTitle", "placement", "outsideClick", "triggers", "container", "containerClass", "isOpen", "delay"], outputs: ["onShown", "onHidden"], exportAs: ["bs-popover"] }, { kind: "component", type: FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "component", type: DropAreaComponent, selector: "c8y-drop-area", inputs: ["formControl", "title", "message", "icon", "loadingMessage", "forceHideList", "alwaysShow", "clickToOpen", "loading", "progress", "maxAllowedFiles", "files", "maxFileSizeInMegaBytes", "accept"], outputs: ["dropped"] }, { kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: RequiredInputPlaceholderDirective, selector: "input[required], input[formControlName]" }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }] }); }
|
|
22934
22944
|
}
|
|
22935
22945
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FilePickerComponent, decorators: [{
|
|
22936
22946
|
type: Component,
|
|
@@ -22943,7 +22953,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
22943
22953
|
IconDirective,
|
|
22944
22954
|
RequiredInputPlaceholderDirective,
|
|
22945
22955
|
C8yTranslatePipe
|
|
22946
|
-
], template: "<div class=\"form-group\">\n <label
|
|
22956
|
+
], template: "<div class=\"form-group\">\n <label\n class=\"c8y-radio\"\n title=\"{{ 'Upload a binary' | translate }}\"\n >\n <input\n name=\"uploadChoice-{{ filePickerIndex }}\"\n type=\"radio\"\n value=\"uploadBinary\"\n #radio\n [(ngModel)]=\"uploadChoice\"\n (click)=\"clearInputFromUrl()\"\n />\n <span></span>\n <span>{{ 'Upload a binary' | translate }}</span>\n </label>\n <label\n class=\"c8y-radio m-l-8\"\n title=\"{{ 'Provide a file path' | translate }}\"\n data-cy=\"file-picker--file-path-input\"\n >\n <input\n name=\"uploadChoice-{{ filePickerIndex }}\"\n type=\"radio\"\n value=\"uploadUrl\"\n #radio\n [(ngModel)]=\"uploadChoice\"\n (click)=\"clearSelectedFiles()\"\n />\n <span></span>\n <span>\n {{ 'Provide a file path' | translate }}\n </span>\n <button\n class=\"btn-help\"\n [attr.aria-label]=\"'Help' | translate\"\n popover=\"{{ fileUrlPopover | translate }}\"\n placement=\"top\"\n placement=\"top\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n *ngIf=\"isPopoverUsed()\"\n ></button>\n </label>\n <label\n class=\"c8y-radio m-l-8\"\n title=\"{{ 'Mark as provided' | translate }}\"\n *ngIf=\"allowedUploadChoices.includes('provided')\"\n >\n <input\n name=\"uploadChoice-{{ filePickerIndex }}\"\n type=\"radio\"\n value=\"provided\"\n #radio\n [(ngModel)]=\"uploadChoice\"\n (click)=\"setProvidedOption()\"\n />\n <span></span>\n <span>{{ 'Provided' | translate }}</span>\n <button\n class=\"btn-help\"\n [attr.aria-label]=\"'Help' | translate\"\n popover=\"{{ providedPopover | translate }}\"\n placement=\"top\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n ></button>\n </label>\n</div>\n\n<div [hidden]=\"uploadChoice !== 'uploadBinary'\">\n <c8y-form-group class=\"m-0\">\n <c8y-drop-area\n class=\"drop-area-sm\"\n [title]=\"'Drop file or click to browse' | translate\"\n [attr.aria-label]=\"'Drop file or click to browse' | translate\"\n (dropped)=\"onFileDropped($event)\"\n [maxAllowedFiles]=\"maxAllowedFiles\"\n [files]=\"droppedFiles\"\n ></c8y-drop-area>\n </c8y-form-group>\n</div>\n\n<div [hidden]=\"uploadChoice !== 'uploadUrl'\">\n <c8y-form-group class=\"m-0\">\n <div class=\"m-b-4 p-b-8\">\n <div class=\"input-group\">\n <span class=\"input-group-addon\">\n <i c8yIcon=\"globe\"></i>\n </span>\n <input\n class=\"form-control\"\n placeholder=\"{{ 'e.g.' | translate }} http://example.com/binary.zip\"\n name=\"fileUrl\"\n type=\"text\"\n required\n data-cy=\"file-picker--fileUrl\"\n [(ngModel)]=\"fileUrl\"\n (ngModelChange)=\"onFileUrlChange($event)\"\n maxlength=\"{{ config.maxlength }}\"\n [pattern]=\"ValidationPattern.rules.noWhiteSpaceOnly.pattern\"\n />\n </div>\n </div>\n </c8y-form-group>\n</div>\n" }]
|
|
22947
22957
|
}], propDecorators: { dropArea: [{
|
|
22948
22958
|
type: ViewChild,
|
|
22949
22959
|
args: [DropAreaComponent, { static: true }]
|
|
@@ -22953,6 +22963,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
22953
22963
|
type: Input
|
|
22954
22964
|
}], uploadChoice: [{
|
|
22955
22965
|
type: Input
|
|
22966
|
+
}], allowedUploadChoices: [{
|
|
22967
|
+
type: Input
|
|
22956
22968
|
}], fileUrl: [{
|
|
22957
22969
|
type: Input
|
|
22958
22970
|
}], fileBinary: [{
|