@c8y/ngx-components 1023.70.0 → 1023.75.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/index.d.ts +19 -1
- package/asset-properties/index.d.ts.map +1 -1
- package/cockpit-config/index.d.ts +4 -3
- package/cockpit-config/index.d.ts.map +1 -1
- package/context-dashboard/index.d.ts +202 -4
- package/context-dashboard/index.d.ts.map +1 -1
- package/datapoints-export-selector/index.d.ts +8 -1
- package/datapoints-export-selector/index.d.ts.map +1 -1
- package/device-profile/index.d.ts +8 -1
- package/device-profile/index.d.ts.map +1 -1
- package/events/cockpit/index.d.ts +6 -0
- package/events/cockpit/index.d.ts.map +1 -0
- package/events/devicemanagement/index.d.ts +6 -0
- package/events/devicemanagement/index.d.ts.map +1 -0
- package/events/events-timeline/index.d.ts +11 -10
- package/events/events-timeline/index.d.ts.map +1 -1
- package/events/index.d.ts +363 -5
- package/events/index.d.ts.map +1 -1
- package/fesm2022/c8y-ngx-components-alarm-event-selector.mjs +1 -1
- package/fesm2022/c8y-ngx-components-alarm-event-selector.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-alarms.mjs +1 -1
- package/fesm2022/c8y-ngx-components-alarms.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-asset-properties.mjs +2 -2
- package/fesm2022/c8y-ngx-components-asset-properties.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-auth-configuration.mjs +1 -1
- package/fesm2022/c8y-ngx-components-auth-configuration.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-branding-shared-lazy-add-branding-modal.mjs +1 -1
- package/fesm2022/c8y-ngx-components-branding-shared-lazy-add-branding-modal.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-branding-shared-lazy.mjs +2 -2
- package/fesm2022/c8y-ngx-components-branding-shared-lazy.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-cockpit-config.mjs +8 -11
- package/fesm2022/c8y-ngx-components-cockpit-config.mjs.map +1 -1
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-alarm-count-config.component-CPLDClTp.mjs → c8y-ngx-components-computed-asset-properties-alarm-count-config.component-DX9Rgjgl.mjs} +2 -2
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-alarm-count-config.component-CPLDClTp.mjs.map → c8y-ngx-components-computed-asset-properties-alarm-count-config.component-DX9Rgjgl.mjs.map} +1 -1
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-c8y-ngx-components-computed-asset-properties-9be_iMQg.mjs → c8y-ngx-components-computed-asset-properties-c8y-ngx-components-computed-asset-properties-CRpLJ5H7.mjs} +8 -8
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-c8y-ngx-components-computed-asset-properties-9be_iMQg.mjs.map → c8y-ngx-components-computed-asset-properties-c8y-ngx-components-computed-asset-properties-CRpLJ5H7.mjs.map} +1 -1
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-configuration-snapshot-config.component-B2em01_W.mjs → c8y-ngx-components-computed-asset-properties-configuration-snapshot-config.component-2rDsrxcs.mjs} +2 -2
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-configuration-snapshot-config.component-B2em01_W.mjs.map → c8y-ngx-components-computed-asset-properties-configuration-snapshot-config.component-2rDsrxcs.mjs.map} +1 -1
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-event-count-config.component-CQuGa1RI.mjs → c8y-ngx-components-computed-asset-properties-event-count-config.component-BJNoqWZf.mjs} +2 -2
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-event-count-config.component-CQuGa1RI.mjs.map → c8y-ngx-components-computed-asset-properties-event-count-config.component-BJNoqWZf.mjs.map} +1 -1
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-fieldbus-item-status-config.component-CkmurxJv.mjs → c8y-ngx-components-computed-asset-properties-fieldbus-item-status-config.component-DYac6foX.mjs} +3 -3
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-fieldbus-item-status-config.component-CkmurxJv.mjs.map → c8y-ngx-components-computed-asset-properties-fieldbus-item-status-config.component-DYac6foX.mjs.map} +1 -1
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-last-measurement-config.component-CTK9zNUh.mjs → c8y-ngx-components-computed-asset-properties-last-measurement-config.component-3yTe6lIr.mjs} +3 -3
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-last-measurement-config.component-CTK9zNUh.mjs.map → c8y-ngx-components-computed-asset-properties-last-measurement-config.component-3yTe6lIr.mjs.map} +1 -1
- package/fesm2022/c8y-ngx-components-computed-asset-properties.mjs +1 -1
- package/fesm2022/{c8y-ngx-components-context-dashboard-dashboard-appearance-settings.component-DsCDppJx.mjs → c8y-ngx-components-context-dashboard-dashboard-appearance-settings.component-C7yXSDYC.mjs} +3 -3
- package/fesm2022/{c8y-ngx-components-context-dashboard-dashboard-appearance-settings.component-DsCDppJx.mjs.map → c8y-ngx-components-context-dashboard-dashboard-appearance-settings.component-C7yXSDYC.mjs.map} +1 -1
- package/fesm2022/{c8y-ngx-components-context-dashboard-dashboard-general-settings.component-RdLW5nde.mjs → c8y-ngx-components-context-dashboard-dashboard-general-settings.component-w8N16Z3t.mjs} +4 -4
- package/fesm2022/{c8y-ngx-components-context-dashboard-dashboard-general-settings.component-RdLW5nde.mjs.map → c8y-ngx-components-context-dashboard-dashboard-general-settings.component-w8N16Z3t.mjs.map} +1 -1
- package/fesm2022/c8y-ngx-components-context-dashboard.mjs +561 -21
- package/fesm2022/c8y-ngx-components-context-dashboard.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs +2 -2
- package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-datapoint-library-details.mjs +1 -1
- package/fesm2022/c8y-ngx-components-datapoint-library-details.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-datapoint-selector.mjs +1 -1
- package/fesm2022/c8y-ngx-components-datapoint-selector.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-datapoints-export-selector.mjs +41 -8
- package/fesm2022/c8y-ngx-components-datapoints-export-selector.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-device-profile.mjs +38 -12
- package/fesm2022/c8y-ngx-components-device-profile.mjs.map +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-ecosystem-license-confirm.mjs +1 -1
- package/fesm2022/c8y-ngx-components-ecosystem-license-confirm.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-ecosystem-shared.mjs +1 -1
- package/fesm2022/c8y-ngx-components-ecosystem-shared.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-ecosystem.mjs +1 -1
- package/fesm2022/c8y-ngx-components-ecosystem.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-events-cockpit.mjs +54 -0
- package/fesm2022/c8y-ngx-components-events-cockpit.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-events-devicemanagement.mjs +79 -0
- package/fesm2022/c8y-ngx-components-events-devicemanagement.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-events-events-timeline.mjs +30 -20
- package/fesm2022/c8y-ngx-components-events-events-timeline.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-events.mjs +1080 -4
- package/fesm2022/c8y-ngx-components-events.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-file-preview.mjs +48 -41
- package/fesm2022/c8y-ngx-components-file-preview.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-files-repository.mjs +1 -1
- package/fesm2022/c8y-ngx-components-files-repository.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-global-context.mjs +68 -34
- package/fesm2022/c8y-ngx-components-global-context.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-interval-picker.mjs +3 -3
- package/fesm2022/c8y-ngx-components-interval-picker.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-location.mjs +1 -1
- package/fesm2022/c8y-ngx-components-location.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-operation-picker.mjs +1 -1
- package/fesm2022/c8y-ngx-components-operation-picker.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-operations-bulk-operation-scheduler.mjs +1 -1
- package/fesm2022/c8y-ngx-components-operations-bulk-operation-scheduler.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-operations-stepper-bulk-type-device-profile.mjs +1 -1
- package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-device-profile.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-software.mjs +1 -1
- package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-software.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-protocol-lpwan.mjs +5 -5
- package/fesm2022/c8y-ngx-components-protocol-lpwan.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-protocol-opcua.mjs +2 -2
- package/fesm2022/c8y-ngx-components-protocol-opcua.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-remote-access-shared.mjs +1 -1
- package/fesm2022/c8y-ngx-components-remote-access-shared.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-remote-access-ssh-remote-access-ssh-endpoint-modal.mjs +1 -1
- package/fesm2022/c8y-ngx-components-remote-access-ssh-remote-access-ssh-endpoint-modal.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-remote-access-vnc-remote-access-vnc-endpoint-modal.mjs +1 -1
- package/fesm2022/c8y-ngx-components-remote-access-vnc-remote-access-vnc-endpoint-modal.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-remote-access-vnc-vnc-viewer.mjs +1 -1
- package/fesm2022/c8y-ngx-components-remote-access-vnc-vnc-viewer.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-repository-firmware.mjs +1 -1
- package/fesm2022/c8y-ngx-components-repository-firmware.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-static-assets-modal.mjs +1 -1
- package/fesm2022/c8y-ngx-components-static-assets-modal.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-time-context.mjs +1 -1
- package/fesm2022/c8y-ngx-components-time-context.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-translation-editor-lazy.mjs +1 -1
- package/fesm2022/c8y-ngx-components-translation-editor-lazy.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-event-list.mjs +39 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-event-list.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-html-widget.mjs +76 -4
- package/fesm2022/c8y-ngx-components-widgets-definitions-html-widget.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-alarms.mjs +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-alarms.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-events.mjs +236 -0
- package/fesm2022/c8y-ngx-components-widgets-implementations-events.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-widgets-implementations-html-widget.mjs +271 -31
- package/fesm2022/c8y-ngx-components-widgets-implementations-html-widget.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-image.mjs +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-image.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-info-gauge.mjs +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-info-gauge.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-kpi.mjs +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-kpi.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-linear-gauge.mjs +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-linear-gauge.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-map.mjs +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-map.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components.mjs +257 -31
- package/fesm2022/c8y-ngx-components.mjs.map +1 -1
- package/file-preview/index.d.ts +7 -6
- package/file-preview/index.d.ts.map +1 -1
- package/global-context/index.d.ts +3 -0
- package/global-context/index.d.ts.map +1 -1
- package/index.d.ts +108 -12
- package/index.d.ts.map +1 -1
- package/locales/de.po +205 -38
- package/locales/es.po +204 -37
- package/locales/fr.po +204 -37
- package/locales/ja_JP.po +204 -38
- package/locales/ko.po +205 -38
- package/locales/locales.pot +117 -3
- package/locales/nl.po +205 -38
- package/locales/pl.po +205 -38
- package/locales/pt_BR.po +204 -37
- package/locales/zh_CN.po +205 -38
- package/locales/zh_TW.po +205 -38
- 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/definitions/event-list/index.d.ts +44 -1
- package/widgets/definitions/event-list/index.d.ts.map +1 -1
- package/widgets/implementations/alarms/index.d.ts +2 -0
- package/widgets/implementations/alarms/index.d.ts.map +1 -1
- package/widgets/implementations/events/index.d.ts +89 -0
- package/widgets/implementations/events/index.d.ts.map +1 -0
- package/widgets/implementations/html-widget/index.d.ts +69 -9
- package/widgets/implementations/html-widget/index.d.ts.map +1 -1
|
@@ -373,7 +373,7 @@ class KpiWidgetConfigComponent {
|
|
|
373
373
|
});
|
|
374
374
|
}
|
|
375
375
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: KpiWidgetConfigComponent, deps: [{ token: i1.FormBuilder }, { token: i1.NgForm }, { token: i2.WidgetConfigComponent }, { token: i2.WidgetConfigService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
376
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: KpiWidgetConfigComponent, isStandalone: true, selector: "c8y-kpi-widget-config", inputs: { config: "config" }, viewQueries: [{ propertyName: "previewMapSet", first: true, predicate: ["kpiPreview"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<form [formGroup]=\"formGroup\">\n <fieldset class=\"c8y-fieldset\">\n <legend>{{ 'Layout' | translate }}</legend>\n <div class=\"d-flex a-i-center gap-8\">\n <div class=\"form-group form-group-sm m-b-16\">\n <label translate>Icon</label>\n <c8y-icon-selector-wrapper\n [iconSize]=\"16\"\n name=\"icon\"\n formControlName=\"icon\"\n ></c8y-icon-selector-wrapper>\n </div>\n <c8y-form-group class=\"form-group-sm m-b-16 flex-grow\">\n <label\n [title]=\"'Font size of measurement value (px)' | translate\"\n translate\n >\n Font size of measurement value (px)\n </label>\n <input\n class=\"form-control\"\n name=\"fontSize\"\n type=\"number\"\n formControlName=\"fontSize\"\n [placeholder]=\"'e.g. {{ example }}' | translate: { example: 36 }\"\n />\n <c8y-messages\n [show]=\"formGroup.controls?.fontSize?.touched && formGroup?.controls?.fontSize?.errors\"\n ></c8y-messages>\n </c8y-form-group>\n </div>\n </fieldset>\n\n <fieldset class=\"c8y-fieldset\">\n <legend>{{ 'Display' | translate }}</legend>\n <div class=\"d-flex gap-16 flex-wrap\">\n <c8y-form-group class=\"m-b-8\">\n <label\n class=\"c8y-checkbox\"\n [title]=\"'Show timestamp' | translate\"\n >\n <input\n name=\"showTimestamp\"\n type=\"checkbox\"\n formControlName=\"showTimestamp\"\n />\n <span></span>\n <span translate>Show timestamp</span>\n </label>\n </c8y-form-group>\n\n <c8y-form-group class=\"m-b-8\">\n <label\n class=\"c8y-checkbox\"\n [title]=\"'Show icon' | translate\"\n >\n <input\n name=\"showIcon\"\n type=\"checkbox\"\n formControlName=\"showIcon\"\n />\n <span></span>\n <span translate>Show icon</span>\n </label>\n </c8y-form-group>\n\n <c8y-form-group class=\"m-b-8\">\n <label\n class=\"c8y-checkbox\"\n [title]=\"'Show trend icon' | translate\"\n >\n <input\n name=\"showTrend\"\n type=\"checkbox\"\n formControlName=\"showTrend\"\n />\n <span></span>\n <span translate>Show trend icon</span>\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n popover=\"{{\n 'Indicates the trend between the last two measurement values.' | translate\n }}\"\n placement=\"right\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n ></button>\n </label>\n </c8y-form-group>\n </div>\n </fieldset>\n\n <fieldset class=\"c8y-fieldset\">\n <legend translate>Number of decimal places</legend>\n <c8y-form-group class=\"form-group-sm m-b-20\">\n <input\n class=\"form-control\"\n name=\"numberOfDecimalPlaces\"\n type=\"number\"\n formControlName=\"numberOfDecimalPlaces\"\n [placeholder]=\"'e.g. {{ example }}' | translate: { example: 1 }\"\n />\n <c8y-messages\n [show]=\"\n formGroup.controls?.numberOfDecimalPlaces?.touched &&\n formGroup?.controls?.numberOfDecimalPlaces?.errors\n \"\n ></c8y-messages>\n </c8y-form-group>\n </fieldset>\n</form>\n\n<ng-template #kpiPreview>\n @if (formGroup && formGroup.value) {\n @if (formGroup.value.datapoints?.length > 0 && previewActiveDatapoint) {\n <div style=\"height: 300px\">\n <c8y-kpi-widget-view [config]=\"previewConfig\"></c8y-kpi-widget-view>\n </div>\n } @else {\n <div class=\"col-md-6 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=\"kpi-widget--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/#kpi\">user documentation</a>.\n </small>\n </p>\n </c8y-ui-empty-state>\n </div>\n }\n }\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.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.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "component", type: FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "component", type: MessagesComponent, selector: "c8y-messages", inputs: ["show", "defaults", "helpMessage"] }, { kind: "component", type: EmptyStateComponent, selector: "c8y-ui-empty-state", inputs: ["icon", "title", "subtitle", "horizontal"] }, { kind: "component", type: GuideDocsComponent, selector: "[c8y-guide-docs]" }, { kind: "directive", type: GuideHrefDirective, selector: "[c8y-guide-href]", inputs: ["c8y-guide-href"] }, { kind: "ngmodule", type: DatapointSelectorModule }, { kind: "ngmodule", type: IconSelectorModule }, { kind: "component", type: i3.IconSelectorWrapperComponent, selector: "c8y-icon-selector-wrapper", inputs: ["canRemoveIcon", "selectedIcon", "iconSize"], outputs: ["onSelect"] }, { kind: "ngmodule", type: PopoverModule }, { kind: "directive", type: i4.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: KpiWidgetViewComponent, selector: "c8y-kpi-widget-view", inputs: ["config"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }], viewProviders: [{ provide: ControlContainer, useExisting: NgForm }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
376
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: KpiWidgetConfigComponent, isStandalone: true, selector: "c8y-kpi-widget-config", inputs: { config: "config" }, viewQueries: [{ propertyName: "previewMapSet", first: true, predicate: ["kpiPreview"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<form [formGroup]=\"formGroup\">\n <fieldset class=\"c8y-fieldset\">\n <legend>{{ 'Layout' | translate }}</legend>\n <div class=\"d-flex a-i-center gap-8\">\n <div class=\"form-group form-group-sm m-b-16\">\n <label translate>Icon</label>\n <c8y-icon-selector-wrapper\n [iconSize]=\"16\"\n name=\"icon\"\n formControlName=\"icon\"\n ></c8y-icon-selector-wrapper>\n </div>\n <c8y-form-group class=\"form-group-sm m-b-16 flex-grow\">\n <label\n [title]=\"'Font size of measurement value (px)' | translate\"\n translate\n >\n Font size of measurement value (px)\n </label>\n <input\n class=\"form-control\"\n name=\"fontSize\"\n type=\"number\"\n formControlName=\"fontSize\"\n [placeholder]=\"'e.g. {{ example }}' | translate: { example: 36 }\"\n />\n <c8y-messages\n [show]=\"formGroup.controls?.fontSize?.touched && formGroup?.controls?.fontSize?.errors\"\n ></c8y-messages>\n </c8y-form-group>\n </div>\n </fieldset>\n\n <fieldset class=\"c8y-fieldset\">\n <legend>{{ 'Display' | translate }}</legend>\n <div class=\"d-flex gap-16 flex-wrap\">\n <c8y-form-group class=\"m-b-8\">\n <label\n class=\"c8y-checkbox\"\n [title]=\"'Show timestamp' | translate\"\n >\n <input\n name=\"showTimestamp\"\n type=\"checkbox\"\n formControlName=\"showTimestamp\"\n />\n <span></span>\n <span translate>Show timestamp</span>\n </label>\n </c8y-form-group>\n\n <c8y-form-group class=\"m-b-8\">\n <label\n class=\"c8y-checkbox\"\n [title]=\"'Show icon' | translate\"\n >\n <input\n name=\"showIcon\"\n type=\"checkbox\"\n formControlName=\"showIcon\"\n />\n <span></span>\n <span translate>Show icon</span>\n </label>\n </c8y-form-group>\n\n <c8y-form-group class=\"m-b-8\">\n <label\n class=\"c8y-checkbox\"\n [title]=\"'Show trend icon' | translate\"\n >\n <input\n name=\"showTrend\"\n type=\"checkbox\"\n formControlName=\"showTrend\"\n />\n <span></span>\n <span translate>Show trend icon</span>\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n popover=\"{{\n 'Indicates the trend between the last two measurement values.' | translate\n }}\"\n placement=\"right\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n ></button>\n </label>\n </c8y-form-group>\n </div>\n </fieldset>\n\n <fieldset class=\"c8y-fieldset\">\n <legend translate>Number of decimal places</legend>\n <c8y-form-group class=\"form-group-sm m-b-20\">\n <input\n class=\"form-control\"\n name=\"numberOfDecimalPlaces\"\n type=\"number\"\n formControlName=\"numberOfDecimalPlaces\"\n [placeholder]=\"'e.g. {{ example }}' | translate: { example: 1 }\"\n />\n <c8y-messages\n [show]=\"\n formGroup.controls?.numberOfDecimalPlaces?.touched &&\n formGroup?.controls?.numberOfDecimalPlaces?.errors\n \"\n ></c8y-messages>\n </c8y-form-group>\n </fieldset>\n</form>\n\n<ng-template #kpiPreview>\n @if (formGroup && formGroup.value) {\n @if (formGroup.value.datapoints?.length > 0 && previewActiveDatapoint) {\n <div style=\"height: 300px\">\n <c8y-kpi-widget-view [config]=\"previewConfig\"></c8y-kpi-widget-view>\n </div>\n } @else {\n <div class=\"col-md-6 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=\"kpi-widget--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/#kpi\">user documentation</a>.\n </small>\n </p>\n </c8y-ui-empty-state>\n </div>\n }\n }\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.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.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "component", type: FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "component", type: MessagesComponent, selector: "c8y-messages", inputs: ["show", "defaults", "helpMessage", "additionalMessages"] }, { kind: "component", type: EmptyStateComponent, selector: "c8y-ui-empty-state", inputs: ["icon", "title", "subtitle", "horizontal"] }, { kind: "component", type: GuideDocsComponent, selector: "[c8y-guide-docs]" }, { kind: "directive", type: GuideHrefDirective, selector: "[c8y-guide-href]", inputs: ["c8y-guide-href"] }, { kind: "ngmodule", type: DatapointSelectorModule }, { kind: "ngmodule", type: IconSelectorModule }, { kind: "component", type: i3.IconSelectorWrapperComponent, selector: "c8y-icon-selector-wrapper", inputs: ["canRemoveIcon", "selectedIcon", "iconSize"], outputs: ["onSelect"] }, { kind: "ngmodule", type: PopoverModule }, { kind: "directive", type: i4.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: KpiWidgetViewComponent, selector: "c8y-kpi-widget-view", inputs: ["config"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }], viewProviders: [{ provide: ControlContainer, useExisting: NgForm }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
377
377
|
}
|
|
378
378
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: KpiWidgetConfigComponent, decorators: [{
|
|
379
379
|
type: Component,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"c8y-ngx-components-widgets-implementations-kpi.mjs","sources":["../../widgets/implementations/kpi/kpi-widget.model.ts","../../widgets/implementations/kpi/kpi-widget-view/kpi-widget-view.component.ts","../../widgets/implementations/kpi/kpi-widget-view/kpi-widget-view.component.html","../../widgets/implementations/kpi/kpi-widget-config/kpi-widget-config.component.ts","../../widgets/implementations/kpi/kpi-widget-config/kpi-widget-config.component.html","../../widgets/implementations/kpi/c8y-ngx-components-widgets-implementations-kpi.ts"],"sourcesContent":["import { KPIDetails } from '@c8y/ngx-components/datapoint-selector';\nimport { SupportedIconsSuggestions } from '@c8y/ngx-components/icon-selector/icons';\nimport type { GlobalContextState } from '@c8y/ngx-components/global-context';\n\nexport interface KpiWidgetConfig extends Partial<GlobalContextState> {\n datapoints: KPIDetails[];\n icon?: SupportedIconsSuggestions | null;\n showTimestamp?: boolean | null;\n showTrend?: boolean | null;\n showIcon?: boolean | null;\n numberOfDecimalPlaces?: number | null;\n fontSize?: number | null;\n}\n\nexport interface MeasurementValue {\n unit?: string;\n value: number;\n date: string;\n}\n\nexport enum ColorClass {\n danger = 'text-danger',\n warning = 'text-warning',\n unknown = ''\n}\n\nexport type KpiState = {\n latestMeasurement: MeasurementValue;\n previousValue: MeasurementValue | undefined;\n trend: string;\n unit: string;\n colorClass: ColorClass;\n};\n","import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n inject,\n Input,\n OnChanges,\n OnInit,\n signal,\n SimpleChanges\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { IMeasurement } from '@c8y/client';\nimport {\n C8yTranslateDirective,\n C8yTranslatePipe,\n DashboardChildComponent,\n DatePipe,\n EmptyStateComponent,\n IconDirective,\n LoadingComponent,\n MeasurementRealtimeService\n} from '@c8y/ngx-components';\nimport { ContextDashboardComponent } from '@c8y/ngx-components/context-dashboard';\nimport { KPIDetails } from '@c8y/ngx-components/datapoint-selector';\nimport {\n DisplayMode,\n GLOBAL_CONTEXT_DISPLAY_MODE,\n GlobalContextConnectorComponent,\n GlobalContextState,\n LocalControlsComponent,\n PRESET_NAME,\n PresetName,\n REFRESH_OPTION,\n WidgetConfigMigrationService\n} from '@c8y/ngx-components/global-context';\nimport { isEqual, merge as mergeObj } from 'lodash-es';\nimport { BehaviorSubject, combineLatest, merge as merge$, NEVER, Observable, Subject } from 'rxjs';\nimport {\n distinctUntilChanged,\n filter,\n map,\n pairwise,\n share,\n startWith,\n switchMap,\n tap\n} from 'rxjs/operators';\nimport { ColorClass, KpiState, KpiWidgetConfig, MeasurementValue } from '../kpi-widget.model';\nimport { AsyncPipe, DecimalPipe, NgClass, NgStyle } from '@angular/common';\n\n@Component({\n selector: 'c8y-kpi-widget-view',\n templateUrl: './kpi-widget-view.component.html',\n standalone: true,\n imports: [\n AsyncPipe,\n DatePipe,\n DecimalPipe,\n NgClass,\n NgStyle,\n C8yTranslatePipe,\n C8yTranslateDirective,\n IconDirective,\n LoadingComponent,\n EmptyStateComponent,\n GlobalContextConnectorComponent,\n LocalControlsComponent\n ],\n providers: [MeasurementRealtimeService],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'd-col fit-h' }\n})\nexport class KpiWidgetViewComponent implements OnChanges, OnInit {\n @Input() config: KpiWidgetConfig = { datapoints: [] };\n\n displayMode = signal<DisplayMode>(GLOBAL_CONTEXT_DISPLAY_MODE.DASHBOARD);\n contextConfig = signal<GlobalContextState>({});\n isLinkedToGlobal = signal<boolean | undefined>(undefined);\n widgetControls = signal<PresetName>(PRESET_NAME.KPI);\n isHistoryMode = signal(false);\n\n state$: Observable<KpiState | null> = NEVER;\n noDataInitiallyInDB = signal(false);\n\n readonly GLOBAL_CONTEXT_DISPLAY_MODE = GLOBAL_CONTEXT_DISPLAY_MODE;\n\n private dashboardChild = inject(DashboardChildComponent, { optional: true });\n private dashboard = inject(ContextDashboardComponent, { optional: true });\n private measurementRealtime = inject(MeasurementRealtimeService);\n private widgetConfigMigrationService = inject(WidgetConfigMigrationService);\n private destroyRef = inject(DestroyRef);\n\n private context$ = new BehaviorSubject<GlobalContextState | null>(null);\n private refresh$ = new Subject<void>();\n private lastDatapoint: KPIDetails | null = null;\n\n ngOnInit(): void {\n this.config = mergeObj(\n this.config,\n this.widgetConfigMigrationService.migrateWidgetConfig(this.config)\n );\n\n this.syncDisplayState();\n this.buildStatePipeline();\n\n if (!this.isDashboardMode()) {\n this.emitContext(this.config);\n }\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n const cfg = changes.config?.currentValue as KpiWidgetConfig;\n if (!cfg) {\n return;\n }\n this.config = cfg;\n this.syncDisplayState();\n\n if (this.isOnRealDashboard()) {\n return;\n }\n if (this.isDashboardPreviewWaitingForContext()) {\n return;\n }\n this.emitContext(this.config, this.hasDatapointChanged());\n }\n\n onContextChange(event: { context: GlobalContextState; diff: GlobalContextState }): void {\n this.contextConfig.set(event.context);\n this.emitContext(event.context);\n }\n\n onRefresh(): void {\n this.refresh$.next();\n }\n\n getDashboardChild(): DashboardChildComponent {\n return this.dashboardChild;\n }\n\n setupObservable(datapoint: KPIDetails, context: GlobalContextState): Observable<KpiState> {\n const isHistory = context.refreshOption === REFRESH_OPTION.HISTORY;\n const isPaused = !isHistory && context.isAutoRefreshEnabled === false;\n this.isHistoryMode.set(isHistory);\n this.noDataInitiallyInDB.set(false);\n\n let source$: Observable<MeasurementValue>;\n if (isPaused) {\n source$ = this.getHistoryMeasurement$(datapoint, {});\n } else if (isHistory) {\n source$ = this.getHistoryMeasurement$(datapoint, context);\n } else {\n source$ = this.getLiveMeasurement$(datapoint);\n }\n\n const shared$ = source$.pipe(share());\n const lastTwo$ = shared$.pipe(pairwise());\n\n return combineLatest([\n shared$,\n lastTwo$.pipe(\n map(([prev]) => prev),\n startWith(undefined as MeasurementValue | undefined)\n ),\n this.getTrend$(lastTwo$),\n shared$.pipe(\n map(m => datapoint.unit || m.unit || ''),\n startWith(''),\n distinctUntilChanged()\n ),\n this.getColorClass$(shared$, datapoint)\n ]).pipe(\n map(([latestMeasurement, previousValue, trend, unit, colorClass]) => ({\n latestMeasurement,\n previousValue,\n trend,\n unit,\n colorClass\n }))\n );\n }\n\n private buildStatePipeline(): void {\n const readState = () => ({ ctx: this.context$.value, dp: this.findActiveDatapoint() });\n\n this.state$ = merge$(\n this.context$.pipe(map(readState), distinctUntilChanged(isEqual)),\n this.refresh$.pipe(map(readState))\n ).pipe(\n filter((s): s is { ctx: GlobalContextState; dp: KPIDetails } => !!s.ctx && !!s.dp),\n switchMap(({ ctx, dp }) => {\n this.assignContextFromContextDashboard(dp);\n return this.setupObservable(dp, ctx).pipe(startWith(null as KpiState | null));\n }),\n takeUntilDestroyed(this.destroyRef)\n );\n }\n\n private syncDisplayState(): void {\n const newMode = this.resolveDisplayMode();\n if (this.displayMode() !== newMode) {\n this.displayMode.set(newMode);\n }\n\n const newCtx = this.extractContext(this.config);\n if (!isEqual(this.contextConfig(), newCtx)) {\n this.contextConfig.set(newCtx);\n }\n }\n\n private emitContext(source: Partial<GlobalContextState>, force = false): void {\n const ctx = this.extractContext(source);\n if (force || !isEqual(this.context$.value, ctx)) {\n this.context$.next(ctx);\n }\n }\n\n private isDashboardMode(): boolean {\n return this.resolveDisplayMode() === GLOBAL_CONTEXT_DISPLAY_MODE.DASHBOARD;\n }\n\n private isOnRealDashboard(): boolean {\n return this.isDashboardMode() && !!this.dashboardChild;\n }\n\n private isDashboardPreviewWaitingForContext(): boolean {\n return this.isDashboardMode() && !this.config.isGlobalContextReady;\n }\n\n private resolveDisplayMode(): DisplayMode {\n return (this.config?.displayMode || GLOBAL_CONTEXT_DISPLAY_MODE.CONFIG) as DisplayMode;\n }\n\n private extractContext(source: Partial<GlobalContextState>): GlobalContextState {\n return {\n dateTimeContext: source.dateTimeContext,\n isAutoRefreshEnabled: source.isAutoRefreshEnabled,\n refreshInterval: source.refreshInterval,\n refreshOption: source.refreshOption\n };\n }\n\n private findActiveDatapoint(): KPIDetails | undefined {\n return this.config?.datapoints?.find(dp => dp?.__active);\n }\n\n private hasDatapointChanged(): boolean {\n const dp = this.findActiveDatapoint();\n if (!dp) {\n return false;\n }\n const prev = this.lastDatapoint;\n this.lastDatapoint = dp;\n return (\n !prev ||\n dp.fragment !== prev.fragment ||\n dp.series !== prev.series ||\n dp.__target?.id !== prev.__target?.id ||\n dp.unit !== prev.unit ||\n dp.redRangeMin !== prev.redRangeMin ||\n dp.redRangeMax !== prev.redRangeMax ||\n dp.yellowRangeMin !== prev.yellowRangeMin ||\n dp.yellowRangeMax !== prev.yellowRangeMax\n );\n }\n\n private getLiveMeasurement$(datapoint: KPIDetails): Observable<MeasurementValue> {\n return this.measurementRealtime\n .latestValueOfSpecificMeasurement$(\n datapoint.fragment,\n datapoint.series,\n datapoint.__target,\n this.config.showTrend ? 2 : 1,\n true\n )\n .pipe(\n tap(m => {\n if (!m) this.noDataInitiallyInDB.set(true);\n }),\n filter(m => !!m),\n map(m => this.toMeasurementValue(m, datapoint))\n );\n }\n\n private getHistoryMeasurement$(\n datapoint: KPIDetails,\n context: GlobalContextState\n ): Observable<MeasurementValue> {\n return this.measurementRealtime\n .lastMeasurement$(\n datapoint.fragment,\n datapoint.series,\n datapoint.__target,\n 1,\n true,\n context.dateTimeContext?.dateFrom,\n context.dateTimeContext?.dateTo\n )\n .pipe(\n tap(m => {\n if (!m) this.noDataInitiallyInDB.set(true);\n }),\n filter(m => !!m),\n map(m => this.toMeasurementValue(m, datapoint))\n );\n }\n\n private toMeasurementValue(m: IMeasurement, dp: KPIDetails): MeasurementValue {\n return {\n unit: m[dp.fragment][dp.series].unit,\n value: m[dp.fragment][dp.series].value,\n date: m.time as string\n };\n }\n\n private getColorClass$(\n measurement$: Observable<MeasurementValue>,\n datapoint: KPIDetails\n ): Observable<ColorClass> {\n return measurement$.pipe(\n map(m => {\n if (this.inRange(datapoint, m.value, 'redRangeMin', 'redRangeMax')) {\n return ColorClass.danger;\n }\n if (this.inRange(datapoint, m.value, 'yellowRangeMin', 'yellowRangeMax')) {\n return ColorClass.warning;\n }\n return ColorClass.unknown;\n }),\n startWith(ColorClass.unknown),\n distinctUntilChanged()\n );\n }\n\n private getTrend$(lastTwo$: Observable<MeasurementValue[]>): Observable<string> {\n return lastTwo$.pipe(\n map(([prev, curr]) => {\n if (prev.value < curr.value) return '45deg';\n if (prev.value > curr.value) return '135deg';\n return '90deg';\n }),\n startWith('90deg'),\n distinctUntilChanged()\n );\n }\n\n private inRange(dp: KPIDetails, value: number, minKey: string, maxKey: string): boolean {\n return (\n typeof dp[minKey] === 'number' &&\n typeof dp[maxKey] === 'number' &&\n value >= dp[minKey] &&\n value < dp[maxKey]\n );\n }\n\n private assignContextFromContextDashboard(datapoint: KPIDetails): void {\n if (!this.dashboard?.isDeviceTypeDashboard) {\n return;\n }\n const context = this.dashboard?.context;\n if (context?.id) {\n datapoint.__target = { name: context.name, id: context.id };\n }\n }\n}\n","@if (displayMode() === GLOBAL_CONTEXT_DISPLAY_MODE.DASHBOARD && getDashboardChild()) {\n <c8y-global-context-connector\n [controls]=\"widgetControls()\"\n [config]=\"contextConfig()\"\n [dashboardChild]=\"getDashboardChild()\"\n [linked]=\"isLinkedToGlobal()\"\n [emitRefresh]=\"false\"\n (configChange)=\"onContextChange($event)\"\n (refresh)=\"onRefresh()\"\n ></c8y-global-context-connector>\n} @else if (displayMode() !== GLOBAL_CONTEXT_DISPLAY_MODE.DASHBOARD) {\n <c8y-local-controls\n [controls]=\"widgetControls()\"\n [displayMode]=\"displayMode()\"\n [config]=\"contextConfig()\"\n [emitRefresh]=\"false\"\n (configChange)=\"onContextChange($event)\"\n (refresh)=\"onRefresh()\"\n ></c8y-local-controls>\n}\n\n@if (state$ | async; as lastState) {\n <div class=\"kpi-widget__container d-flex d-col flex-grow fit-w a-i-center j-c-center\">\n <div class=\"d-flex a-i-center j-c-center fit-w\">\n @if (config.icon && config.showIcon) {\n <div\n class=\"m-r-16 flex-no-shrink text-muted\"\n [ngClass]=\"lastState.colorClass\"\n >\n <i\n class=\"icon-32\"\n [c8yIcon]=\"config.icon\"\n ></i>\n </div>\n }\n <div class=\"text-truncate\">\n <span\n class=\"text-truncate text-medium\"\n [ngStyle]=\"{ 'font-size': (config.fontSize || '36') + 'px' }\"\n title=\"{{\n lastState.colorClass === 'text-danger'\n ? ('Within red range:' | translate)\n : lastState.colorClass === 'text-warning'\n ? ('Within yellow range:' | translate)\n : ''\n }} {{\n lastState.latestMeasurement.value\n | number\n : '1.' +\n (config.numberOfDecimalPlaces || '0') +\n '-' +\n (config.numberOfDecimalPlaces || '0')\n }} {{ lastState.unit || '' }}\"\n [ngClass]=\"lastState.colorClass\"\n >\n {{\n lastState.latestMeasurement.value\n | number\n : '1.' +\n (config.numberOfDecimalPlaces || '0') +\n '-' +\n (config.numberOfDecimalPlaces || '0')\n }}\n <small class=\"text-regular\">{{ lastState.unit || '' }}</small>\n </span>\n </div>\n @if (config?.showTrend && lastState.previousValue; as previousValue) {\n <div class=\"dot dot-info dot-30 m-l-16 flex-no-shrink\">\n <i\n class=\"icon-20\"\n c8yIcon=\"arrow-dotted-up\"\n [ngStyle]=\"{ transform: 'rotate(' + lastState.trend + ')' }\"\n [title]=\"\n ('Previous value' | translate) +\n ': ' +\n (previousValue.value\n | number\n : '1.' +\n (config.numberOfDecimalPlaces || '0') +\n '-' +\n (config.numberOfDecimalPlaces || '0')) +\n ' (' +\n (previousValue.date | c8yDate: 'medium') +\n ')'\n \"\n ></i>\n </div>\n }\n </div>\n <div class=\"d-flex d-col a-i-center\">\n @if (config?.showTimestamp) {\n <p class=\"icon-flex text-center text-muted small m-b-0\">\n <i c8yIcon=\"calendar\"></i>\n {{ lastState.latestMeasurement.date | c8yDate: 'medium' }}\n </p>\n }\n @if (isHistoryMode()) {\n <p class=\"text-center text-muted small m-b-0\">\n <span translate>Last measurement in selected time range</span>\n </p>\n }\n </div>\n </div>\n} @else {\n <div class=\"d-flex flex-grow fit-w j-c-center a-i-center\">\n @let noDataSubtitleLive = 'Waiting for measurements to be created.' | translate;\n @let noDataSubtitleHistory = 'No data available for the selected time period.' | translate;\n @if (noDataInitiallyInDB()) {\n <c8y-ui-empty-state\n [icon]=\"'line-chart'\"\n [title]=\"'No measurement to display.' | translate\"\n [subtitle]=\"isHistoryMode() ? noDataSubtitleHistory : noDataSubtitleLive\"\n [horizontal]=\"true\"\n ></c8y-ui-empty-state>\n } @else {\n <c8y-loading></c8y-loading>\n }\n </div>\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n inject,\n Input,\n OnChanges,\n OnInit,\n SimpleChanges,\n TemplateRef,\n ViewChild\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport {\n AbstractControl,\n ControlContainer,\n FormBuilder,\n NgForm,\n ReactiveFormsModule,\n ValidationErrors,\n ValidatorFn,\n Validators\n} from '@angular/forms';\nimport {\n C8yTranslateDirective,\n C8yTranslatePipe,\n C8yValidators,\n EmptyStateComponent,\n FormGroupComponent,\n GuideDocsComponent,\n GuideHrefDirective,\n MessagesComponent,\n OnBeforeSave\n} from '@c8y/ngx-components';\nimport { WidgetConfigComponent, WidgetConfigService } from '@c8y/ngx-components/context-dashboard';\nimport {\n DatapointAttributesFormConfig,\n DatapointSelectorModalOptions,\n DatapointSelectorModule,\n KPIDetails\n} from '@c8y/ngx-components/datapoint-selector';\nimport { IconSelectorModule } from '@c8y/ngx-components/icon-selector';\nimport { PopoverModule } from 'ngx-bootstrap/popover';\nimport { Observable } from 'rxjs';\nimport { debounceTime, filter } from 'rxjs/operators';\nimport { KpiWidgetViewComponent } from '../kpi-widget-view/kpi-widget-view.component';\nimport { KpiWidgetConfig } from '../kpi-widget.model';\n\nexport function exactlyASingleDatapointActive(): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n const datapoints: KPIDetails[] = control.value;\n if (!datapoints?.length) {\n return null;\n }\n return datapoints.filter(dp => dp.__active).length === 1\n ? null\n : { exactlyOneDatapointNeedsToBeActive: true };\n };\n}\n\n@Component({\n selector: 'c8y-kpi-widget-config',\n templateUrl: './kpi-widget-config.component.html',\n standalone: true,\n imports: [\n ReactiveFormsModule,\n C8yTranslatePipe,\n C8yTranslateDirective,\n FormGroupComponent,\n MessagesComponent,\n EmptyStateComponent,\n GuideDocsComponent,\n GuideHrefDirective,\n DatapointSelectorModule,\n IconSelectorModule,\n PopoverModule,\n KpiWidgetViewComponent\n ],\n viewProviders: [{ provide: ControlContainer, useExisting: NgForm }],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class KpiWidgetConfigComponent implements OnChanges, OnInit, OnBeforeSave {\n @ViewChild('kpiPreview')\n set previewMapSet(template: TemplateRef<unknown>) {\n this.widgetConfigService.setPreview(template || null);\n }\n\n @Input() config: KpiWidgetConfig;\n\n previewActiveDatapoint: KPIDetails;\n datapointSelectionConfig: Partial<DatapointSelectorModalOptions> = {};\n defaultFormOptions: Partial<DatapointAttributesFormConfig> = {\n showRedRange: true,\n showYellowRange: true\n };\n formGroup: ReturnType<KpiWidgetConfigComponent['createForm']>;\n previewConfig: KpiWidgetConfig;\n\n private destroyRef = inject(DestroyRef);\n private limits = {\n fontSizeMax: 72,\n fontSizeMin: 18,\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 private widgetConfigService: WidgetConfigService\n ) {}\n\n onBeforeSave(config?: KpiWidgetConfig): 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 ngOnChanges(changes: SimpleChanges): void {\n if (this.formGroup && changes.config) {\n this.formGroup.controls.datapoints.patchValue(this.config.datapoints || []);\n }\n }\n\n ngOnInit(): void {\n if (this.widgetConfig.context?.id) {\n this.datapointSelectionConfig.contextAsset = this.widgetConfig.context;\n }\n\n this.previewConfig = { ...this.config };\n this.initForm();\n\n if (this.config?.datapoints) {\n this.formGroup.patchValue({ datapoints: this.config.datapoints });\n this.previewActiveDatapoint = this.config.datapoints.find(dp => dp.__active);\n }\n\n this.widgetConfigService.currentConfig$\n .pipe(\n filter(c => !!c),\n takeUntilDestroyed(this.destroyRef)\n )\n .subscribe(c => {\n this.previewConfig = { ...this.previewConfig, ...c, ...this.formGroup.value };\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 this.formGroup.valueChanges\n .pipe(debounceTime(100), takeUntilDestroyed(this.destroyRef))\n .subscribe(formValue => {\n if (formValue.datapoints) {\n this.previewActiveDatapoint = formValue.datapoints.find(dp => dp.__active);\n }\n\n if (this.formGroup.valid) {\n this.previewConfig = { ...this.config, ...this.applyLimitsToPreview(formValue) };\n }\n\n Object.assign(this.config, formValue);\n });\n }\n\n private applyLimitsToPreview(formValue: Partial<KpiWidgetConfig>): Partial<KpiWidgetConfig> {\n const result = { ...formValue };\n\n if (result.numberOfDecimalPlaces !== undefined) {\n result.numberOfDecimalPlaces = this.clamp(\n result.numberOfDecimalPlaces,\n this.limits.numberOfDecimalPlacesMin,\n this.limits.numberOfDecimalPlacesMax\n );\n }\n\n if (result.fontSize !== undefined) {\n result.fontSize = this.clamp(\n result.fontSize,\n this.limits.fontSizeMin,\n this.limits.fontSizeMax\n );\n }\n\n return result;\n }\n\n private clamp(value: number, min: number, max: number): number {\n return Math.max(min, Math.min(max, value));\n }\n\n private createForm() {\n return this.formBuilder.group({\n numberOfDecimalPlaces: [\n 2,\n [\n Validators.required,\n Validators.min(this.limits.numberOfDecimalPlacesMin),\n Validators.max(this.limits.numberOfDecimalPlacesMax),\n C8yValidators.integerValidator()\n ]\n ],\n showTimestamp: [true, []],\n showTrend: [true, []],\n showIcon: [true, []],\n icon: ['water', [Validators.required, Validators.minLength(1)]],\n fontSize: [\n 36,\n [\n Validators.required,\n Validators.min(this.limits.fontSizeMin),\n Validators.max(this.limits.fontSizeMax)\n ]\n ],\n datapoints: this.formBuilder.control(new Array<KPIDetails>(), [\n Validators.required,\n Validators.minLength(1),\n exactlyASingleDatapointActive()\n ])\n });\n }\n}\n","<form [formGroup]=\"formGroup\">\n <fieldset class=\"c8y-fieldset\">\n <legend>{{ 'Layout' | translate }}</legend>\n <div class=\"d-flex a-i-center gap-8\">\n <div class=\"form-group form-group-sm m-b-16\">\n <label translate>Icon</label>\n <c8y-icon-selector-wrapper\n [iconSize]=\"16\"\n name=\"icon\"\n formControlName=\"icon\"\n ></c8y-icon-selector-wrapper>\n </div>\n <c8y-form-group class=\"form-group-sm m-b-16 flex-grow\">\n <label\n [title]=\"'Font size of measurement value (px)' | translate\"\n translate\n >\n Font size of measurement value (px)\n </label>\n <input\n class=\"form-control\"\n name=\"fontSize\"\n type=\"number\"\n formControlName=\"fontSize\"\n [placeholder]=\"'e.g. {{ example }}' | translate: { example: 36 }\"\n />\n <c8y-messages\n [show]=\"formGroup.controls?.fontSize?.touched && formGroup?.controls?.fontSize?.errors\"\n ></c8y-messages>\n </c8y-form-group>\n </div>\n </fieldset>\n\n <fieldset class=\"c8y-fieldset\">\n <legend>{{ 'Display' | translate }}</legend>\n <div class=\"d-flex gap-16 flex-wrap\">\n <c8y-form-group class=\"m-b-8\">\n <label\n class=\"c8y-checkbox\"\n [title]=\"'Show timestamp' | translate\"\n >\n <input\n name=\"showTimestamp\"\n type=\"checkbox\"\n formControlName=\"showTimestamp\"\n />\n <span></span>\n <span translate>Show timestamp</span>\n </label>\n </c8y-form-group>\n\n <c8y-form-group class=\"m-b-8\">\n <label\n class=\"c8y-checkbox\"\n [title]=\"'Show icon' | translate\"\n >\n <input\n name=\"showIcon\"\n type=\"checkbox\"\n formControlName=\"showIcon\"\n />\n <span></span>\n <span translate>Show icon</span>\n </label>\n </c8y-form-group>\n\n <c8y-form-group class=\"m-b-8\">\n <label\n class=\"c8y-checkbox\"\n [title]=\"'Show trend icon' | translate\"\n >\n <input\n name=\"showTrend\"\n type=\"checkbox\"\n formControlName=\"showTrend\"\n />\n <span></span>\n <span translate>Show trend icon</span>\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n popover=\"{{\n 'Indicates the trend between the last two measurement values.' | translate\n }}\"\n placement=\"right\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n ></button>\n </label>\n </c8y-form-group>\n </div>\n </fieldset>\n\n <fieldset class=\"c8y-fieldset\">\n <legend translate>Number of decimal places</legend>\n <c8y-form-group class=\"form-group-sm m-b-20\">\n <input\n class=\"form-control\"\n name=\"numberOfDecimalPlaces\"\n type=\"number\"\n formControlName=\"numberOfDecimalPlaces\"\n [placeholder]=\"'e.g. {{ example }}' | translate: { example: 1 }\"\n />\n <c8y-messages\n [show]=\"\n formGroup.controls?.numberOfDecimalPlaces?.touched &&\n formGroup?.controls?.numberOfDecimalPlaces?.errors\n \"\n ></c8y-messages>\n </c8y-form-group>\n </fieldset>\n</form>\n\n<ng-template #kpiPreview>\n @if (formGroup && formGroup.value) {\n @if (formGroup.value.datapoints?.length > 0 && previewActiveDatapoint) {\n <div style=\"height: 300px\">\n <c8y-kpi-widget-view [config]=\"previewConfig\"></c8y-kpi-widget-view>\n </div>\n } @else {\n <div class=\"col-md-6 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=\"kpi-widget--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/#kpi\">user documentation</a>.\n </small>\n </p>\n </c8y-ui-empty-state>\n </div>\n }\n }\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["mergeObj","merge$"],"mappings":";;;;;;;;;;;;;;;;;;;IAoBY;AAAZ,CAAA,UAAY,UAAU,EAAA;AACpB,IAAA,UAAA,CAAA,QAAA,CAAA,GAAA,aAAsB;AACtB,IAAA,UAAA,CAAA,SAAA,CAAA,GAAA,cAAwB;AACxB,IAAA,UAAA,CAAA,SAAA,CAAA,GAAA,EAAY;AACd,CAAC,EAJW,UAAU,KAAV,UAAU,GAAA,EAAA,CAAA,CAAA;;MCqDT,sBAAsB,CAAA;AAtBnC,IAAA,WAAA,GAAA;AAuBW,QAAA,IAAA,CAAA,MAAM,GAAoB,EAAE,UAAU,EAAE,EAAE,EAAE;AAErD,QAAA,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,gBAAA,EAAA,QAAA,EAAA,OAAA,CAAA,EAAA,OAAA,EAAA,CAAA,SAAA,EAAA,UAAA,CAAA,EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACb,sBAAsB,EAAA,QAAA,EAAA,qBAAA,EAAA,MAAA,EAAA,CAAA,QAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAVtB,gBAAgB,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,aAAA,EAYH,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAGxD,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBArBpC,SAAS;+BACE,uBAAuB,EAAA,UAAA,EAErB,IAAI,EAAA,OAAA,EACP;wBACP,mBAAmB;wBACnB,gBAAgB;wBAChB,qBAAqB;wBACrB,kBAAkB;wBAClB,iBAAiB;wBACjB,mBAAmB;wBACnB,kBAAkB;wBAClB,kBAAkB;wBAClB,uBAAuB;wBACvB,kBAAkB;wBAClB,aAAa;wBACb;AACD,qBAAA,EAAA,aAAA,EACc,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,EAAA,eAAA,EAClD,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,0/IAAA,EAAA;;sBAG9C,SAAS;uBAAC,YAAY;;sBAKtB;;;AEvFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"c8y-ngx-components-widgets-implementations-kpi.mjs","sources":["../../widgets/implementations/kpi/kpi-widget.model.ts","../../widgets/implementations/kpi/kpi-widget-view/kpi-widget-view.component.ts","../../widgets/implementations/kpi/kpi-widget-view/kpi-widget-view.component.html","../../widgets/implementations/kpi/kpi-widget-config/kpi-widget-config.component.ts","../../widgets/implementations/kpi/kpi-widget-config/kpi-widget-config.component.html","../../widgets/implementations/kpi/c8y-ngx-components-widgets-implementations-kpi.ts"],"sourcesContent":["import { KPIDetails } from '@c8y/ngx-components/datapoint-selector';\nimport { SupportedIconsSuggestions } from '@c8y/ngx-components/icon-selector/icons';\nimport type { GlobalContextState } from '@c8y/ngx-components/global-context';\n\nexport interface KpiWidgetConfig extends Partial<GlobalContextState> {\n datapoints: KPIDetails[];\n icon?: SupportedIconsSuggestions | null;\n showTimestamp?: boolean | null;\n showTrend?: boolean | null;\n showIcon?: boolean | null;\n numberOfDecimalPlaces?: number | null;\n fontSize?: number | null;\n}\n\nexport interface MeasurementValue {\n unit?: string;\n value: number;\n date: string;\n}\n\nexport enum ColorClass {\n danger = 'text-danger',\n warning = 'text-warning',\n unknown = ''\n}\n\nexport type KpiState = {\n latestMeasurement: MeasurementValue;\n previousValue: MeasurementValue | undefined;\n trend: string;\n unit: string;\n colorClass: ColorClass;\n};\n","import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n inject,\n Input,\n OnChanges,\n OnInit,\n signal,\n SimpleChanges\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { IMeasurement } from '@c8y/client';\nimport {\n C8yTranslateDirective,\n C8yTranslatePipe,\n DashboardChildComponent,\n DatePipe,\n EmptyStateComponent,\n IconDirective,\n LoadingComponent,\n MeasurementRealtimeService\n} from '@c8y/ngx-components';\nimport { ContextDashboardComponent } from '@c8y/ngx-components/context-dashboard';\nimport { KPIDetails } from '@c8y/ngx-components/datapoint-selector';\nimport {\n DisplayMode,\n GLOBAL_CONTEXT_DISPLAY_MODE,\n GlobalContextConnectorComponent,\n GlobalContextState,\n LocalControlsComponent,\n PRESET_NAME,\n PresetName,\n REFRESH_OPTION,\n WidgetConfigMigrationService\n} from '@c8y/ngx-components/global-context';\nimport { isEqual, merge as mergeObj } from 'lodash-es';\nimport { BehaviorSubject, combineLatest, merge as merge$, NEVER, Observable, Subject } from 'rxjs';\nimport {\n distinctUntilChanged,\n filter,\n map,\n pairwise,\n share,\n startWith,\n switchMap,\n tap\n} from 'rxjs/operators';\nimport { ColorClass, KpiState, KpiWidgetConfig, MeasurementValue } from '../kpi-widget.model';\nimport { AsyncPipe, DecimalPipe, NgClass, NgStyle } from '@angular/common';\n\n@Component({\n selector: 'c8y-kpi-widget-view',\n templateUrl: './kpi-widget-view.component.html',\n standalone: true,\n imports: [\n AsyncPipe,\n DatePipe,\n DecimalPipe,\n NgClass,\n NgStyle,\n C8yTranslatePipe,\n C8yTranslateDirective,\n IconDirective,\n LoadingComponent,\n EmptyStateComponent,\n GlobalContextConnectorComponent,\n LocalControlsComponent\n ],\n providers: [MeasurementRealtimeService],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'd-col fit-h' }\n})\nexport class KpiWidgetViewComponent implements OnChanges, OnInit {\n @Input() config: KpiWidgetConfig = { datapoints: [] };\n\n displayMode = signal<DisplayMode>(GLOBAL_CONTEXT_DISPLAY_MODE.DASHBOARD);\n contextConfig = signal<GlobalContextState>({});\n isLinkedToGlobal = signal<boolean | undefined>(undefined);\n widgetControls = signal<PresetName>(PRESET_NAME.KPI);\n isHistoryMode = signal(false);\n\n state$: Observable<KpiState | null> = NEVER;\n noDataInitiallyInDB = signal(false);\n\n readonly GLOBAL_CONTEXT_DISPLAY_MODE = GLOBAL_CONTEXT_DISPLAY_MODE;\n\n private dashboardChild = inject(DashboardChildComponent, { optional: true });\n private dashboard = inject(ContextDashboardComponent, { optional: true });\n private measurementRealtime = inject(MeasurementRealtimeService);\n private widgetConfigMigrationService = inject(WidgetConfigMigrationService);\n private destroyRef = inject(DestroyRef);\n\n private context$ = new BehaviorSubject<GlobalContextState | null>(null);\n private refresh$ = new Subject<void>();\n private lastDatapoint: KPIDetails | null = null;\n\n ngOnInit(): void {\n this.config = mergeObj(\n this.config,\n this.widgetConfigMigrationService.migrateWidgetConfig(this.config)\n );\n\n this.syncDisplayState();\n this.buildStatePipeline();\n\n if (!this.isDashboardMode()) {\n this.emitContext(this.config);\n }\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n const cfg = changes.config?.currentValue as KpiWidgetConfig;\n if (!cfg) {\n return;\n }\n this.config = cfg;\n this.syncDisplayState();\n\n if (this.isOnRealDashboard()) {\n return;\n }\n if (this.isDashboardPreviewWaitingForContext()) {\n return;\n }\n this.emitContext(this.config, this.hasDatapointChanged());\n }\n\n onContextChange(event: { context: GlobalContextState; diff: GlobalContextState }): void {\n this.contextConfig.set(event.context);\n this.emitContext(event.context);\n }\n\n onRefresh(): void {\n this.refresh$.next();\n }\n\n getDashboardChild(): DashboardChildComponent {\n return this.dashboardChild;\n }\n\n setupObservable(datapoint: KPIDetails, context: GlobalContextState): Observable<KpiState> {\n const isHistory = context.refreshOption === REFRESH_OPTION.HISTORY;\n const isPaused = !isHistory && context.isAutoRefreshEnabled === false;\n this.isHistoryMode.set(isHistory);\n this.noDataInitiallyInDB.set(false);\n\n let source$: Observable<MeasurementValue>;\n if (isPaused) {\n source$ = this.getHistoryMeasurement$(datapoint, {});\n } else if (isHistory) {\n source$ = this.getHistoryMeasurement$(datapoint, context);\n } else {\n source$ = this.getLiveMeasurement$(datapoint);\n }\n\n const shared$ = source$.pipe(share());\n const lastTwo$ = shared$.pipe(pairwise());\n\n return combineLatest([\n shared$,\n lastTwo$.pipe(\n map(([prev]) => prev),\n startWith(undefined as MeasurementValue | undefined)\n ),\n this.getTrend$(lastTwo$),\n shared$.pipe(\n map(m => datapoint.unit || m.unit || ''),\n startWith(''),\n distinctUntilChanged()\n ),\n this.getColorClass$(shared$, datapoint)\n ]).pipe(\n map(([latestMeasurement, previousValue, trend, unit, colorClass]) => ({\n latestMeasurement,\n previousValue,\n trend,\n unit,\n colorClass\n }))\n );\n }\n\n private buildStatePipeline(): void {\n const readState = () => ({ ctx: this.context$.value, dp: this.findActiveDatapoint() });\n\n this.state$ = merge$(\n this.context$.pipe(map(readState), distinctUntilChanged(isEqual)),\n this.refresh$.pipe(map(readState))\n ).pipe(\n filter((s): s is { ctx: GlobalContextState; dp: KPIDetails } => !!s.ctx && !!s.dp),\n switchMap(({ ctx, dp }) => {\n this.assignContextFromContextDashboard(dp);\n return this.setupObservable(dp, ctx).pipe(startWith(null as KpiState | null));\n }),\n takeUntilDestroyed(this.destroyRef)\n );\n }\n\n private syncDisplayState(): void {\n const newMode = this.resolveDisplayMode();\n if (this.displayMode() !== newMode) {\n this.displayMode.set(newMode);\n }\n\n const newCtx = this.extractContext(this.config);\n if (!isEqual(this.contextConfig(), newCtx)) {\n this.contextConfig.set(newCtx);\n }\n }\n\n private emitContext(source: Partial<GlobalContextState>, force = false): void {\n const ctx = this.extractContext(source);\n if (force || !isEqual(this.context$.value, ctx)) {\n this.context$.next(ctx);\n }\n }\n\n private isDashboardMode(): boolean {\n return this.resolveDisplayMode() === GLOBAL_CONTEXT_DISPLAY_MODE.DASHBOARD;\n }\n\n private isOnRealDashboard(): boolean {\n return this.isDashboardMode() && !!this.dashboardChild;\n }\n\n private isDashboardPreviewWaitingForContext(): boolean {\n return this.isDashboardMode() && !this.config.isGlobalContextReady;\n }\n\n private resolveDisplayMode(): DisplayMode {\n return (this.config?.displayMode || GLOBAL_CONTEXT_DISPLAY_MODE.CONFIG) as DisplayMode;\n }\n\n private extractContext(source: Partial<GlobalContextState>): GlobalContextState {\n return {\n dateTimeContext: source.dateTimeContext,\n isAutoRefreshEnabled: source.isAutoRefreshEnabled,\n refreshInterval: source.refreshInterval,\n refreshOption: source.refreshOption\n };\n }\n\n private findActiveDatapoint(): KPIDetails | undefined {\n return this.config?.datapoints?.find(dp => dp?.__active);\n }\n\n private hasDatapointChanged(): boolean {\n const dp = this.findActiveDatapoint();\n if (!dp) {\n return false;\n }\n const prev = this.lastDatapoint;\n this.lastDatapoint = dp;\n return (\n !prev ||\n dp.fragment !== prev.fragment ||\n dp.series !== prev.series ||\n dp.__target?.id !== prev.__target?.id ||\n dp.unit !== prev.unit ||\n dp.redRangeMin !== prev.redRangeMin ||\n dp.redRangeMax !== prev.redRangeMax ||\n dp.yellowRangeMin !== prev.yellowRangeMin ||\n dp.yellowRangeMax !== prev.yellowRangeMax\n );\n }\n\n private getLiveMeasurement$(datapoint: KPIDetails): Observable<MeasurementValue> {\n return this.measurementRealtime\n .latestValueOfSpecificMeasurement$(\n datapoint.fragment,\n datapoint.series,\n datapoint.__target,\n this.config.showTrend ? 2 : 1,\n true\n )\n .pipe(\n tap(m => {\n if (!m) this.noDataInitiallyInDB.set(true);\n }),\n filter(m => !!m),\n map(m => this.toMeasurementValue(m, datapoint))\n );\n }\n\n private getHistoryMeasurement$(\n datapoint: KPIDetails,\n context: GlobalContextState\n ): Observable<MeasurementValue> {\n return this.measurementRealtime\n .lastMeasurement$(\n datapoint.fragment,\n datapoint.series,\n datapoint.__target,\n 1,\n true,\n context.dateTimeContext?.dateFrom,\n context.dateTimeContext?.dateTo\n )\n .pipe(\n tap(m => {\n if (!m) this.noDataInitiallyInDB.set(true);\n }),\n filter(m => !!m),\n map(m => this.toMeasurementValue(m, datapoint))\n );\n }\n\n private toMeasurementValue(m: IMeasurement, dp: KPIDetails): MeasurementValue {\n return {\n unit: m[dp.fragment][dp.series].unit,\n value: m[dp.fragment][dp.series].value,\n date: m.time as string\n };\n }\n\n private getColorClass$(\n measurement$: Observable<MeasurementValue>,\n datapoint: KPIDetails\n ): Observable<ColorClass> {\n return measurement$.pipe(\n map(m => {\n if (this.inRange(datapoint, m.value, 'redRangeMin', 'redRangeMax')) {\n return ColorClass.danger;\n }\n if (this.inRange(datapoint, m.value, 'yellowRangeMin', 'yellowRangeMax')) {\n return ColorClass.warning;\n }\n return ColorClass.unknown;\n }),\n startWith(ColorClass.unknown),\n distinctUntilChanged()\n );\n }\n\n private getTrend$(lastTwo$: Observable<MeasurementValue[]>): Observable<string> {\n return lastTwo$.pipe(\n map(([prev, curr]) => {\n if (prev.value < curr.value) return '45deg';\n if (prev.value > curr.value) return '135deg';\n return '90deg';\n }),\n startWith('90deg'),\n distinctUntilChanged()\n );\n }\n\n private inRange(dp: KPIDetails, value: number, minKey: string, maxKey: string): boolean {\n return (\n typeof dp[minKey] === 'number' &&\n typeof dp[maxKey] === 'number' &&\n value >= dp[minKey] &&\n value < dp[maxKey]\n );\n }\n\n private assignContextFromContextDashboard(datapoint: KPIDetails): void {\n if (!this.dashboard?.isDeviceTypeDashboard) {\n return;\n }\n const context = this.dashboard?.context;\n if (context?.id) {\n datapoint.__target = { name: context.name, id: context.id };\n }\n }\n}\n","@if (displayMode() === GLOBAL_CONTEXT_DISPLAY_MODE.DASHBOARD && getDashboardChild()) {\n <c8y-global-context-connector\n [controls]=\"widgetControls()\"\n [config]=\"contextConfig()\"\n [dashboardChild]=\"getDashboardChild()\"\n [linked]=\"isLinkedToGlobal()\"\n [emitRefresh]=\"false\"\n (configChange)=\"onContextChange($event)\"\n (refresh)=\"onRefresh()\"\n ></c8y-global-context-connector>\n} @else if (displayMode() !== GLOBAL_CONTEXT_DISPLAY_MODE.DASHBOARD) {\n <c8y-local-controls\n [controls]=\"widgetControls()\"\n [displayMode]=\"displayMode()\"\n [config]=\"contextConfig()\"\n [emitRefresh]=\"false\"\n (configChange)=\"onContextChange($event)\"\n (refresh)=\"onRefresh()\"\n ></c8y-local-controls>\n}\n\n@if (state$ | async; as lastState) {\n <div class=\"kpi-widget__container d-flex d-col flex-grow fit-w a-i-center j-c-center\">\n <div class=\"d-flex a-i-center j-c-center fit-w\">\n @if (config.icon && config.showIcon) {\n <div\n class=\"m-r-16 flex-no-shrink text-muted\"\n [ngClass]=\"lastState.colorClass\"\n >\n <i\n class=\"icon-32\"\n [c8yIcon]=\"config.icon\"\n ></i>\n </div>\n }\n <div class=\"text-truncate\">\n <span\n class=\"text-truncate text-medium\"\n [ngStyle]=\"{ 'font-size': (config.fontSize || '36') + 'px' }\"\n title=\"{{\n lastState.colorClass === 'text-danger'\n ? ('Within red range:' | translate)\n : lastState.colorClass === 'text-warning'\n ? ('Within yellow range:' | translate)\n : ''\n }} {{\n lastState.latestMeasurement.value\n | number\n : '1.' +\n (config.numberOfDecimalPlaces || '0') +\n '-' +\n (config.numberOfDecimalPlaces || '0')\n }} {{ lastState.unit || '' }}\"\n [ngClass]=\"lastState.colorClass\"\n >\n {{\n lastState.latestMeasurement.value\n | number\n : '1.' +\n (config.numberOfDecimalPlaces || '0') +\n '-' +\n (config.numberOfDecimalPlaces || '0')\n }}\n <small class=\"text-regular\">{{ lastState.unit || '' }}</small>\n </span>\n </div>\n @if (config?.showTrend && lastState.previousValue; as previousValue) {\n <div class=\"dot dot-info dot-30 m-l-16 flex-no-shrink\">\n <i\n class=\"icon-20\"\n c8yIcon=\"arrow-dotted-up\"\n [ngStyle]=\"{ transform: 'rotate(' + lastState.trend + ')' }\"\n [title]=\"\n ('Previous value' | translate) +\n ': ' +\n (previousValue.value\n | number\n : '1.' +\n (config.numberOfDecimalPlaces || '0') +\n '-' +\n (config.numberOfDecimalPlaces || '0')) +\n ' (' +\n (previousValue.date | c8yDate: 'medium') +\n ')'\n \"\n ></i>\n </div>\n }\n </div>\n <div class=\"d-flex d-col a-i-center\">\n @if (config?.showTimestamp) {\n <p class=\"icon-flex text-center text-muted small m-b-0\">\n <i c8yIcon=\"calendar\"></i>\n {{ lastState.latestMeasurement.date | c8yDate: 'medium' }}\n </p>\n }\n @if (isHistoryMode()) {\n <p class=\"text-center text-muted small m-b-0\">\n <span translate>Last measurement in selected time range</span>\n </p>\n }\n </div>\n </div>\n} @else {\n <div class=\"d-flex flex-grow fit-w j-c-center a-i-center\">\n @let noDataSubtitleLive = 'Waiting for measurements to be created.' | translate;\n @let noDataSubtitleHistory = 'No data available for the selected time period.' | translate;\n @if (noDataInitiallyInDB()) {\n <c8y-ui-empty-state\n [icon]=\"'line-chart'\"\n [title]=\"'No measurement to display.' | translate\"\n [subtitle]=\"isHistoryMode() ? noDataSubtitleHistory : noDataSubtitleLive\"\n [horizontal]=\"true\"\n ></c8y-ui-empty-state>\n } @else {\n <c8y-loading></c8y-loading>\n }\n </div>\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n inject,\n Input,\n OnChanges,\n OnInit,\n SimpleChanges,\n TemplateRef,\n ViewChild\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport {\n AbstractControl,\n ControlContainer,\n FormBuilder,\n NgForm,\n ReactiveFormsModule,\n ValidationErrors,\n ValidatorFn,\n Validators\n} from '@angular/forms';\nimport {\n C8yTranslateDirective,\n C8yTranslatePipe,\n C8yValidators,\n EmptyStateComponent,\n FormGroupComponent,\n GuideDocsComponent,\n GuideHrefDirective,\n MessagesComponent,\n OnBeforeSave\n} from '@c8y/ngx-components';\nimport { WidgetConfigComponent, WidgetConfigService } from '@c8y/ngx-components/context-dashboard';\nimport {\n DatapointAttributesFormConfig,\n DatapointSelectorModalOptions,\n DatapointSelectorModule,\n KPIDetails\n} from '@c8y/ngx-components/datapoint-selector';\nimport { IconSelectorModule } from '@c8y/ngx-components/icon-selector';\nimport { PopoverModule } from 'ngx-bootstrap/popover';\nimport { Observable } from 'rxjs';\nimport { debounceTime, filter } from 'rxjs/operators';\nimport { KpiWidgetViewComponent } from '../kpi-widget-view/kpi-widget-view.component';\nimport { KpiWidgetConfig } from '../kpi-widget.model';\n\nexport function exactlyASingleDatapointActive(): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n const datapoints: KPIDetails[] = control.value;\n if (!datapoints?.length) {\n return null;\n }\n return datapoints.filter(dp => dp.__active).length === 1\n ? null\n : { exactlyOneDatapointNeedsToBeActive: true };\n };\n}\n\n@Component({\n selector: 'c8y-kpi-widget-config',\n templateUrl: './kpi-widget-config.component.html',\n standalone: true,\n imports: [\n ReactiveFormsModule,\n C8yTranslatePipe,\n C8yTranslateDirective,\n FormGroupComponent,\n MessagesComponent,\n EmptyStateComponent,\n GuideDocsComponent,\n GuideHrefDirective,\n DatapointSelectorModule,\n IconSelectorModule,\n PopoverModule,\n KpiWidgetViewComponent\n ],\n viewProviders: [{ provide: ControlContainer, useExisting: NgForm }],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class KpiWidgetConfigComponent implements OnChanges, OnInit, OnBeforeSave {\n @ViewChild('kpiPreview')\n set previewMapSet(template: TemplateRef<unknown>) {\n this.widgetConfigService.setPreview(template || null);\n }\n\n @Input() config: KpiWidgetConfig;\n\n previewActiveDatapoint: KPIDetails;\n datapointSelectionConfig: Partial<DatapointSelectorModalOptions> = {};\n defaultFormOptions: Partial<DatapointAttributesFormConfig> = {\n showRedRange: true,\n showYellowRange: true\n };\n formGroup: ReturnType<KpiWidgetConfigComponent['createForm']>;\n previewConfig: KpiWidgetConfig;\n\n private destroyRef = inject(DestroyRef);\n private limits = {\n fontSizeMax: 72,\n fontSizeMin: 18,\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 private widgetConfigService: WidgetConfigService\n ) {}\n\n onBeforeSave(config?: KpiWidgetConfig): 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 ngOnChanges(changes: SimpleChanges): void {\n if (this.formGroup && changes.config) {\n this.formGroup.controls.datapoints.patchValue(this.config.datapoints || []);\n }\n }\n\n ngOnInit(): void {\n if (this.widgetConfig.context?.id) {\n this.datapointSelectionConfig.contextAsset = this.widgetConfig.context;\n }\n\n this.previewConfig = { ...this.config };\n this.initForm();\n\n if (this.config?.datapoints) {\n this.formGroup.patchValue({ datapoints: this.config.datapoints });\n this.previewActiveDatapoint = this.config.datapoints.find(dp => dp.__active);\n }\n\n this.widgetConfigService.currentConfig$\n .pipe(\n filter(c => !!c),\n takeUntilDestroyed(this.destroyRef)\n )\n .subscribe(c => {\n this.previewConfig = { ...this.previewConfig, ...c, ...this.formGroup.value };\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 this.formGroup.valueChanges\n .pipe(debounceTime(100), takeUntilDestroyed(this.destroyRef))\n .subscribe(formValue => {\n if (formValue.datapoints) {\n this.previewActiveDatapoint = formValue.datapoints.find(dp => dp.__active);\n }\n\n if (this.formGroup.valid) {\n this.previewConfig = { ...this.config, ...this.applyLimitsToPreview(formValue) };\n }\n\n Object.assign(this.config, formValue);\n });\n }\n\n private applyLimitsToPreview(formValue: Partial<KpiWidgetConfig>): Partial<KpiWidgetConfig> {\n const result = { ...formValue };\n\n if (result.numberOfDecimalPlaces !== undefined) {\n result.numberOfDecimalPlaces = this.clamp(\n result.numberOfDecimalPlaces,\n this.limits.numberOfDecimalPlacesMin,\n this.limits.numberOfDecimalPlacesMax\n );\n }\n\n if (result.fontSize !== undefined) {\n result.fontSize = this.clamp(\n result.fontSize,\n this.limits.fontSizeMin,\n this.limits.fontSizeMax\n );\n }\n\n return result;\n }\n\n private clamp(value: number, min: number, max: number): number {\n return Math.max(min, Math.min(max, value));\n }\n\n private createForm() {\n return this.formBuilder.group({\n numberOfDecimalPlaces: [\n 2,\n [\n Validators.required,\n Validators.min(this.limits.numberOfDecimalPlacesMin),\n Validators.max(this.limits.numberOfDecimalPlacesMax),\n C8yValidators.integerValidator()\n ]\n ],\n showTimestamp: [true, []],\n showTrend: [true, []],\n showIcon: [true, []],\n icon: ['water', [Validators.required, Validators.minLength(1)]],\n fontSize: [\n 36,\n [\n Validators.required,\n Validators.min(this.limits.fontSizeMin),\n Validators.max(this.limits.fontSizeMax)\n ]\n ],\n datapoints: this.formBuilder.control(new Array<KPIDetails>(), [\n Validators.required,\n Validators.minLength(1),\n exactlyASingleDatapointActive()\n ])\n });\n }\n}\n","<form [formGroup]=\"formGroup\">\n <fieldset class=\"c8y-fieldset\">\n <legend>{{ 'Layout' | translate }}</legend>\n <div class=\"d-flex a-i-center gap-8\">\n <div class=\"form-group form-group-sm m-b-16\">\n <label translate>Icon</label>\n <c8y-icon-selector-wrapper\n [iconSize]=\"16\"\n name=\"icon\"\n formControlName=\"icon\"\n ></c8y-icon-selector-wrapper>\n </div>\n <c8y-form-group class=\"form-group-sm m-b-16 flex-grow\">\n <label\n [title]=\"'Font size of measurement value (px)' | translate\"\n translate\n >\n Font size of measurement value (px)\n </label>\n <input\n class=\"form-control\"\n name=\"fontSize\"\n type=\"number\"\n formControlName=\"fontSize\"\n [placeholder]=\"'e.g. {{ example }}' | translate: { example: 36 }\"\n />\n <c8y-messages\n [show]=\"formGroup.controls?.fontSize?.touched && formGroup?.controls?.fontSize?.errors\"\n ></c8y-messages>\n </c8y-form-group>\n </div>\n </fieldset>\n\n <fieldset class=\"c8y-fieldset\">\n <legend>{{ 'Display' | translate }}</legend>\n <div class=\"d-flex gap-16 flex-wrap\">\n <c8y-form-group class=\"m-b-8\">\n <label\n class=\"c8y-checkbox\"\n [title]=\"'Show timestamp' | translate\"\n >\n <input\n name=\"showTimestamp\"\n type=\"checkbox\"\n formControlName=\"showTimestamp\"\n />\n <span></span>\n <span translate>Show timestamp</span>\n </label>\n </c8y-form-group>\n\n <c8y-form-group class=\"m-b-8\">\n <label\n class=\"c8y-checkbox\"\n [title]=\"'Show icon' | translate\"\n >\n <input\n name=\"showIcon\"\n type=\"checkbox\"\n formControlName=\"showIcon\"\n />\n <span></span>\n <span translate>Show icon</span>\n </label>\n </c8y-form-group>\n\n <c8y-form-group class=\"m-b-8\">\n <label\n class=\"c8y-checkbox\"\n [title]=\"'Show trend icon' | translate\"\n >\n <input\n name=\"showTrend\"\n type=\"checkbox\"\n formControlName=\"showTrend\"\n />\n <span></span>\n <span translate>Show trend icon</span>\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n popover=\"{{\n 'Indicates the trend between the last two measurement values.' | translate\n }}\"\n placement=\"right\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n ></button>\n </label>\n </c8y-form-group>\n </div>\n </fieldset>\n\n <fieldset class=\"c8y-fieldset\">\n <legend translate>Number of decimal places</legend>\n <c8y-form-group class=\"form-group-sm m-b-20\">\n <input\n class=\"form-control\"\n name=\"numberOfDecimalPlaces\"\n type=\"number\"\n formControlName=\"numberOfDecimalPlaces\"\n [placeholder]=\"'e.g. {{ example }}' | translate: { example: 1 }\"\n />\n <c8y-messages\n [show]=\"\n formGroup.controls?.numberOfDecimalPlaces?.touched &&\n formGroup?.controls?.numberOfDecimalPlaces?.errors\n \"\n ></c8y-messages>\n </c8y-form-group>\n </fieldset>\n</form>\n\n<ng-template #kpiPreview>\n @if (formGroup && formGroup.value) {\n @if (formGroup.value.datapoints?.length > 0 && previewActiveDatapoint) {\n <div style=\"height: 300px\">\n <c8y-kpi-widget-view [config]=\"previewConfig\"></c8y-kpi-widget-view>\n </div>\n } @else {\n <div class=\"col-md-6 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=\"kpi-widget--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/#kpi\">user documentation</a>.\n </small>\n </p>\n </c8y-ui-empty-state>\n </div>\n }\n }\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["mergeObj","merge$"],"mappings":";;;;;;;;;;;;;;;;;;;IAoBY;AAAZ,CAAA,UAAY,UAAU,EAAA;AACpB,IAAA,UAAA,CAAA,QAAA,CAAA,GAAA,aAAsB;AACtB,IAAA,UAAA,CAAA,SAAA,CAAA,GAAA,cAAwB;AACxB,IAAA,UAAA,CAAA,SAAA,CAAA,GAAA,EAAY;AACd,CAAC,EAJW,UAAU,KAAV,UAAU,GAAA,EAAA,CAAA,CAAA;;MCqDT,sBAAsB,C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i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: LinearGaugeWidgetConfigComponent, deps: [{ token: i1.FormBuilder }, { token: i1.NgForm }, { token: i2.WidgetConfigComponent }, { token: i2.WidgetConfigService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
220
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: LinearGaugeWidgetConfigComponent, isStandalone: true, selector: "c8y-linear-gauge-widget-config", inputs: { config: "config" }, viewQueries: [{ propertyName: "previewMapSet", first: true, predicate: ["linearGaugePreview"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<form\n class=\"no-card-context\"\n [formGroup]=\"formGroup\"\n>\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\n<ng-template #linearGaugePreview>\n @if (formGroup && formGroup.value) {\n @if (formGroup.value.datapoints?.length > 0 && previewActiveDatapoint) {\n <div style=\"height: 300px\">\n @if (previewConfig) {\n <c8y-linear-gauge-widget-view [config]=\"previewConfig\"></c8y-linear-gauge-widget-view>\n }\n </div>\n } @else {\n <div class=\"col-md-6 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=\"linear-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/#linear-gauge\">\n user documentation</a\n >.\n </small>\n </p>\n </c8y-ui-empty-state>\n </div>\n }\n }\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: DatapointSelectorModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.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.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: CoreModule }, { kind: "component", type: i3.EmptyStateComponent, selector: "c8y-ui-empty-state", inputs: ["icon", "title", "subtitle", "horizontal"] }, { kind: "directive", type: i3.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "component", type: i3.FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "component", type: i3.MessagesComponent, selector: "c8y-messages", inputs: ["show", "defaults", "helpMessage"] }, { kind: "directive", type: i3.RequiredInputPlaceholderDirective, selector: "input[required], input[formControlName]" }, { kind: "directive", type: i3.GuideHrefDirective, selector: "[c8y-guide-href]", inputs: ["c8y-guide-href"] }, { kind: "component", type: i3.GuideDocsComponent, selector: "[c8y-guide-docs]" }, { kind: "component", type: LinearGaugeWidgetViewComponent, selector: "c8y-linear-gauge-widget-view", inputs: ["config"] }, { kind: "pipe", type: i3.C8yTranslatePipe, name: "translate" }] }); }
|
|
220
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: LinearGaugeWidgetConfigComponent, isStandalone: true, selector: "c8y-linear-gauge-widget-config", inputs: { config: "config" }, viewQueries: [{ propertyName: "previewMapSet", first: true, predicate: ["linearGaugePreview"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<form\n class=\"no-card-context\"\n [formGroup]=\"formGroup\"\n>\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\n<ng-template #linearGaugePreview>\n @if (formGroup && formGroup.value) {\n @if (formGroup.value.datapoints?.length > 0 && previewActiveDatapoint) {\n <div style=\"height: 300px\">\n @if (previewConfig) {\n <c8y-linear-gauge-widget-view [config]=\"previewConfig\"></c8y-linear-gauge-widget-view>\n }\n </div>\n } @else {\n <div class=\"col-md-6 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=\"linear-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/#linear-gauge\">\n user documentation</a\n >.\n </small>\n </p>\n </c8y-ui-empty-state>\n </div>\n }\n }\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: DatapointSelectorModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.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.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: CoreModule }, { kind: "component", type: i3.EmptyStateComponent, selector: "c8y-ui-empty-state", inputs: ["icon", "title", "subtitle", "horizontal"] }, { kind: "directive", type: i3.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "component", type: i3.FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "component", type: i3.MessagesComponent, selector: "c8y-messages", inputs: ["show", "defaults", "helpMessage", "additionalMessages"] }, { kind: "directive", type: i3.RequiredInputPlaceholderDirective, selector: "input[required], input[formControlName]" }, { kind: "directive", type: i3.GuideHrefDirective, selector: "[c8y-guide-href]", inputs: ["c8y-guide-href"] }, { kind: "component", type: i3.GuideDocsComponent, selector: "[c8y-guide-docs]" }, { kind: "component", type: LinearGaugeWidgetViewComponent, selector: "c8y-linear-gauge-widget-view", inputs: ["config"] }, { kind: "pipe", type: i3.C8yTranslatePipe, name: "translate" }] }); }
|
|
221
221
|
}
|
|
222
222
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: LinearGaugeWidgetConfigComponent, decorators: [{
|
|
223
223
|
type: Component,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"c8y-ngx-components-widgets-implementations-linear-gauge.mjs","sources":["../../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/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/c8y-ngx-components-widgets-implementations-linear-gauge.ts"],"sourcesContent":["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 { gettext } from '@c8y/ngx-components/gettext';\nimport {\n DynamicComponent,\n DynamicComponentAlert,\n DynamicComponentAlertAggregator,\n DynamicComponentComponent,\n MeasurementRealtimeService,\n RangeDisplay,\n RangeDisplayModule\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","import {\n Component,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n SimpleChanges,\n TemplateRef,\n ViewChild\n} from '@angular/core';\nimport { Observable, Subject, takeUntil } from 'rxjs';\nimport { debounceTime } from 'rxjs/operators';\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, WidgetConfigService } from '@c8y/ngx-components/context-dashboard';\nimport { CoreModule, OnBeforeSave } from '@c8y/ngx-components';\nimport { DatapointSelectorModule } from '@c8y/ngx-components/datapoint-selector';\nimport { LinearGaugeWidgetViewComponent } from '../linear-gauge-widget-view/linear-gauge-widget-view.component';\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: [\n DatapointSelectorModule,\n ReactiveFormsModule,\n CoreModule,\n LinearGaugeWidgetViewComponent\n ]\n})\nexport class LinearGaugeWidgetConfigComponent\n implements OnChanges, OnInit, OnBeforeSave, OnDestroy\n{\n @ViewChild('linearGaugePreview')\n set previewMapSet(template: TemplateRef<unknown>) {\n if (template) {\n this.widgetConfigService.setPreview(template);\n return;\n }\n this.widgetConfigService.setPreview(null);\n }\n\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 previewConfig: LinearGaugeWidgetConfig;\n previewActiveDatapoint: KPIDetails;\n private limits = {\n numberOfDecimalPlacesMax: 10,\n numberOfDecimalPlacesMin: 0\n } as const;\n private destroy$ = new Subject<void>();\n\n constructor(\n private formBuilder: FormBuilder,\n private form: NgForm,\n private widgetConfig: WidgetConfigComponent,\n private widgetConfigService: WidgetConfigService\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 ngOnChanges(changes: SimpleChanges): void {\n if (this.formGroup && changes.config) {\n this.formGroup.controls.datapoints.patchValue(this.config.datapoints || []);\n }\n }\n\n ngOnInit() {\n if (this.widgetConfig.context?.id) {\n this.datapointSelectionConfig.contextAsset = this.widgetConfig?.context;\n }\n\n // Initialize preview config\n this.previewConfig = { ...this.config };\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 ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\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 // Update preview on form changes\n this.formGroup.valueChanges\n .pipe(debounceTime(100), takeUntil(this.destroy$))\n .subscribe(formValue => {\n if (formValue.datapoints) {\n this.previewActiveDatapoint = formValue.datapoints.find(dp => dp.__active);\n }\n this.previewConfig = { ...this.config, ...formValue };\n Object.assign(this.config, formValue);\n });\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 <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\n<ng-template #linearGaugePreview>\n @if (formGroup && formGroup.value) {\n @if (formGroup.value.datapoints?.length > 0 && previewActiveDatapoint) {\n <div style=\"height: 300px\">\n @if (previewConfig) {\n <c8y-linear-gauge-widget-view [config]=\"previewConfig\"></c8y-linear-gauge-widget-view>\n }\n </div>\n } @else {\n <div class=\"col-md-6 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=\"linear-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/#linear-gauge\">\n user documentation</a\n >.\n </small>\n </p>\n </c8y-ui-empty-state>\n </div>\n }\n }\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;;;MA4Ba,8BAA8B,CAAA;AAOzC,IAAA,WAAA,CACU,mBAA+C,EACnC,SAAoC,EACpC,gBAA4C,EAAA;QAFxD,IAAA,CAAA,mBAAmB,GAAnB,mBAAmB;QACP,IAAA,CAAA,SAAS,GAAT,SAAS;QACT,IAAA,CAAA,gBAAgB,GAAhB,gBAAgB;AAL9B,QAAA,IAAA,CAAA,gBAAgB,GAAG,IAAI,eAAe,CAAa,IAAI,CAAC;AAO9D,QAAA,MAAM,eAAe,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAChD,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC,EAClB,GAAG,CAAC,EAAE,IAAI,IAAI,CAAC,iCAAiC,CAAC,EAAE,CAAC,CAAC,EACrD,oBAAoB,EAAE,CACvB;AACD,QAAA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,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,kBAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACV,8BAA8B,EAAA,QAAA,EAAA,8BAAA,EAAA,MAAA,EAAA,CAAA,QAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,EAAA,CAAA,gBAAA,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;4FAGrB,gCAAgC,EAAA,UAAA,EAAA,CAAA;kBAX5C,SAAS;+BACE,gCAAgC,EAAA,UAAA,EAE9B,IAAI,EAAA,OAAA,EACP;wBACP,uBAAuB;wBACvB,mBAAmB;wBACnB,UAAU;wBACV;AACD,qBAAA,EAAA,QAAA,EAAA,ooDAAA,EAAA;;sBAKA,SAAS;uBAAC,oBAAoB;;sBAS9B;;;AE/CH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"c8y-ngx-components-widgets-implementations-linear-gauge.mjs","sources":["../../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/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/c8y-ngx-components-widgets-implementations-linear-gauge.ts"],"sourcesContent":["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 { gettext } from '@c8y/ngx-components/gettext';\nimport {\n DynamicComponent,\n DynamicComponentAlert,\n DynamicComponentAlertAggregator,\n DynamicComponentComponent,\n MeasurementRealtimeService,\n RangeDisplay,\n RangeDisplayModule\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","import {\n Component,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n SimpleChanges,\n TemplateRef,\n ViewChild\n} from '@angular/core';\nimport { Observable, Subject, takeUntil } from 'rxjs';\nimport { debounceTime } from 'rxjs/operators';\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, WidgetConfigService } from '@c8y/ngx-components/context-dashboard';\nimport { CoreModule, OnBeforeSave } from '@c8y/ngx-components';\nimport { DatapointSelectorModule } from '@c8y/ngx-components/datapoint-selector';\nimport { LinearGaugeWidgetViewComponent } from '../linear-gauge-widget-view/linear-gauge-widget-view.component';\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: [\n DatapointSelectorModule,\n ReactiveFormsModule,\n CoreModule,\n LinearGaugeWidgetViewComponent\n ]\n})\nexport class LinearGaugeWidgetConfigComponent\n implements OnChanges, OnInit, OnBeforeSave, OnDestroy\n{\n @ViewChild('linearGaugePreview')\n set previewMapSet(template: TemplateRef<unknown>) {\n if (template) {\n this.widgetConfigService.setPreview(template);\n return;\n }\n this.widgetConfigService.setPreview(null);\n }\n\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 previewConfig: LinearGaugeWidgetConfig;\n previewActiveDatapoint: KPIDetails;\n private limits = {\n numberOfDecimalPlacesMax: 10,\n numberOfDecimalPlacesMin: 0\n } as const;\n private destroy$ = new Subject<void>();\n\n constructor(\n private formBuilder: FormBuilder,\n private form: NgForm,\n private widgetConfig: WidgetConfigComponent,\n private widgetConfigService: WidgetConfigService\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 ngOnChanges(changes: SimpleChanges): void {\n if (this.formGroup && changes.config) {\n this.formGroup.controls.datapoints.patchValue(this.config.datapoints || []);\n }\n }\n\n ngOnInit() {\n if (this.widgetConfig.context?.id) {\n this.datapointSelectionConfig.contextAsset = this.widgetConfig?.context;\n }\n\n // Initialize preview config\n this.previewConfig = { ...this.config };\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 ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\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 // Update preview on form changes\n this.formGroup.valueChanges\n .pipe(debounceTime(100), takeUntil(this.destroy$))\n .subscribe(formValue => {\n if (formValue.datapoints) {\n this.previewActiveDatapoint = formValue.datapoints.find(dp => dp.__active);\n }\n this.previewConfig = { ...this.config, ...formValue };\n Object.assign(this.config, formValue);\n });\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 <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\n<ng-template #linearGaugePreview>\n @if (formGroup && formGroup.value) {\n @if (formGroup.value.datapoints?.length > 0 && previewActiveDatapoint) {\n <div style=\"height: 300px\">\n @if (previewConfig) {\n <c8y-linear-gauge-widget-view [config]=\"previewConfig\"></c8y-linear-gauge-widget-view>\n }\n </div>\n } @else {\n <div class=\"col-md-6 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=\"linear-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/#linear-gauge\">\n user documentation</a\n >.\n </small>\n </p>\n </c8y-ui-empty-state>\n </div>\n }\n }\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n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
243
243
|
this.previewMap.addMarkerToMap(this.centerIcon);
|
|
244
244
|
}
|
|
245
245
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MapWidgetConfigComponent, deps: [{ token: i4.MapService }, { token: i2$1.AlertService }, { token: i3.TranslateService }, { token: MAP_DEFAULT_CONFIG }, { token: i4$1.WidgetConfigService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
246
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: MapWidgetConfigComponent, isStandalone: true, selector: "c8y-map-widget-config", inputs: { config: "config" }, viewQueries: [{ propertyName: "previewMap", first: true, predicate: MapComponent, descendants: true }, { propertyName: "previewMapSet", first: true, predicate: ["previewMap"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "@if (formConfig) {\n <fieldset class=\"c8y-fieldset\">\n <legend>{{ 'Map' | translate }}</legend>\n <div class=\"row tight-grid\">\n <div class=\"col-xs-3\">\n <c8y-form-group class=\"m-b-16 text-center form-group-sm\">\n <label translate>Marker icon</label>\n <c8y-icon-selector-wrapper\n [canRemoveIcon]=\"true\"\n [iconSize]=\"16\"\n [selectedIcon]=\"formConfig.icon\"\n (onSelect)=\"selectIcon($event)\"\n ></c8y-icon-selector-wrapper>\n </c8y-form-group>\n </div>\n <div [ngClass]=\"{ 'col-xs-6': !isPositionedDevice(), 'col-xs-9': isPositionedDevice() }\">\n <div class=\"form-group form-group-sm\">\n <label translate>Zoom level</label>\n <c8y-range\n class=\"label-bottom\"\n name=\"zoomLevel\"\n #range\n [(ngModel)]=\"formConfig.zoomLevel\"\n (change)=\"zoomLevelChanged()\"\n >\n <input\n type=\"range\"\n min=\"0\"\n max=\"18\"\n step=\"1\"\n [disabled]=\"!isPositionedDevice() && formConfig.autoFitToBounds\"\n />\n </c8y-range>\n </div>\n </div>\n @if (!isPositionedDevice()) {\n <div class=\"col-xs-3\">\n <c8y-form-group class=\"m-b-16 text-center form-group-sm\">\n <label translate>Fit to bounds</label>\n <div class=\"m-t-4 d-flex j-c-center\">\n <label class=\"c8y-switch c8y-switch--inline\">\n <input\n name=\"autoFitToBounds\"\n type=\"checkbox\"\n [(ngModel)]=\"formConfig.autoFitToBounds\"\n (ngModelChange)=\"fitToBound()\"\n />\n <span></span>\n </label>\n <button\n class=\"btn-help\"\n aria-label=\"Help content\"\n [popover]=\"\n 'If enabled, the zoom level and center bound is always adjusted to fit all assets within the map view.'\n | translate\n \"\n placement=\"top\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n ></button>\n </div>\n </c8y-form-group>\n </div>\n }\n </div>\n <c8y-form-group class=\"form-group-sm\">\n <label translate>Center bound</label>\n <div class=\"input-group input-group-sm\">\n <input\n class=\"form-control\"\n placeholder=\"{{ 'lat.`latitude`' | translate }}\"\n name=\"centerLat\"\n type=\"number\"\n required\n [(ngModel)]=\"formConfig.center[0]\"\n (change)=\"changeCenter()\"\n (keydown.enter)=\"changeCenterOnEnterKey($event)\"\n min=\"-90\"\n max=\"90\"\n step=\"0.1\"\n [disabled]=\"!isPositionedDevice() && formConfig.autoFitToBounds\"\n />\n <input\n class=\"form-control\"\n placeholder=\"{{ 'lng.`longitude`' | translate }}\"\n name=\"centerLng\"\n type=\"number\"\n required\n min=\"-180\"\n max=\"180\"\n [(ngModel)]=\"formConfig.center[1]\"\n (change)=\"changeCenter()\"\n (keydown.enter)=\"changeCenterOnEnterKey($event)\"\n min=\"-180\"\n max=\"180\"\n step=\"0.1\"\n [disabled]=\"!isPositionedDevice() && formConfig.autoFitToBounds\"\n />\n <div class=\"input-group-btn\">\n <button\n class=\"btn btn-default\"\n [attr.aria-label]=\"'Use your location' | translate\"\n [tooltip]=\"'Use your location' | translate\"\n placement=\"top\"\n container=\"body\"\n (click)=\"useOwnPosition()\"\n [disabled]=\"!isPositionedDevice() && formConfig.autoFitToBounds\"\n >\n <i\n class=\"icon-14\"\n c8yIcon=\"location-arrow\"\n ></i>\n </button>\n </div>\n <div class=\"input-group-btn\">\n @if (canAutoCenter()) {\n <button\n class=\"btn btn-default\"\n [attr.aria-label]=\"'Use selected asset location' | translate\"\n [tooltip]=\"'Use selected asset location' | translate\"\n placement=\"top\"\n container=\"body\"\n (click)=\"centerToAsset()\"\n [disabled]=\"!isPositionedDevice() && formConfig.autoFitToBounds\"\n >\n <i\n class=\"icon-14\"\n c8yIcon=\"location\"\n ></i>\n </button>\n } @else {\n <button\n class=\"btn btn-default\"\n [attr.aria-label]=\"'Fit to assets bounds' | translate\"\n [tooltip]=\"'Fit to assets bounds' | translate\"\n placement=\"top\"\n container=\"body\"\n (click)=\"fitToBounds()\"\n [disabled]=\"!isPositionedDevice() && formConfig.autoFitToBounds\"\n >\n <i\n class=\"icon-14\"\n c8yIcon=\"waypoint-map\"\n ></i>\n </button>\n }\n </div>\n </div>\n\n @if (!formConfig.autoFitToBounds) {\n <c8y-messages\n [helpMessage]=\"'Drag the map to the desired position' | translate\"\n ></c8y-messages>\n }\n </c8y-form-group>\n </fieldset>\n\n @if (isPositionedDevice()) {\n <fieldset class=\"c8y-fieldset\">\n <legend>{{ 'Follow' | translate }}</legend>\n <div class=\"row tight-grid d-flex a-i-center\">\n <div class=\"col-xs-12\">\n <div class=\"form-group form-group-sm m-b-16\">\n <label class=\"c8y-switch c8y-switch--inline\">\n <input\n name=\"follow\"\n type=\"checkbox\"\n [(ngModel)]=\"formConfig.follow\"\n />\n <span></span>\n <span\n class=\"text-12\"\n translate\n >\n Follow selected\n </span>\n </label>\n </div>\n </div>\n </div>\n </fieldset>\n }\n}\n\n<ng-template #previewMap>\n <div style=\"width: 100%; height: 100%\">\n @if (config.mapConfig) {\n <c8y-map\n [assets]=\"assets()\"\n [config]=\"config.mapConfig\"\n (onMove)=\"onPreviewMapMove($event)\"\n (onZoomStart)=\"onPreviewZoomStart()\"\n (onZoomEnd)=\"onPreviewZoomEnd($event)\"\n (onInit)=\"previewMapInit($event)\"\n ></c8y-map>\n }\n </div>\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i6.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: i6.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i6.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i6.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i6.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: CommonModule$1 }, { kind: "directive", type: i2$1.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: i2$1.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "ngmodule", type: FormsModule$1 }, { kind: "directive", type: i2$1.MinValidationDirective, selector: "[min]", inputs: ["min"] }, { kind: "directive", type: i2$1.MaxValidationDirective, selector: "[max]", inputs: ["max"] }, { kind: "component", type: i2$1.FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "component", type: i2$1.MessagesComponent, selector: "c8y-messages", inputs: ["show", "defaults", "helpMessage"] }, { kind: "directive", type: i2$1.RequiredInputPlaceholderDirective, selector: "input[required], input[formControlName]" }, { kind: "directive", type: i2$1.RangeDirective, selector: "input[type=\"range\"]" }, { kind: "component", type: i2$1.RangeComponent, selector: "c8y-range", inputs: ["valueDisplayMode"] }, { kind: "ngmodule", type: IconSelectorModule }, { kind: "component", type: i7.IconSelectorWrapperComponent, selector: "c8y-icon-selector-wrapper", inputs: ["canRemoveIcon", "selectedIcon", "iconSize"], outputs: ["onSelect"] }, { kind: "ngmodule", type: MapModule }, { kind: "component", type: i4.MapComponent, selector: "c8y-map", inputs: ["config", "assets", "polyline$", "polylineOptions"], outputs: ["onRealtimeUpdate", "onMove", "onMoveEnd", "onZoomStart", "onZoomEnd", "onMap", "onInit"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i8.TooltipDirective, selector: "[tooltip], [tooltipHtml]", inputs: ["adaptivePosition", "tooltip", "placement", "triggers", "container", "containerClass", "boundariesElement", "isOpen", "isDisabled", "delay", "tooltipHtml", "tooltipPlacement", "tooltipIsOpen", "tooltipEnable", "tooltipAppendToBody", "tooltipAnimation", "tooltipClass", "tooltipContext", "tooltipPopupDelay", "tooltipFadeDuration", "tooltipTrigger"], outputs: ["tooltipChange", "onShown", "onHidden", "tooltipStateChanged"], exportAs: ["bs-tooltip"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: PopoverModule }, { kind: "directive", type: i9.PopoverDirective, selector: "[popover]", inputs: ["adaptivePosition", "boundariesElement", "popover", "popoverContext", "popoverTitle", "placement", "outsideClick", "triggers", "container", "containerClass", "isOpen", "delay"], outputs: ["onShown", "onHidden"], exportAs: ["bs-popover"] }, { kind: "pipe", type: i2$1.C8yTranslatePipe, name: "translate" }], viewProviders: [{ provide: ControlContainer, useExisting: NgForm }] }); }
|
|
246
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: MapWidgetConfigComponent, isStandalone: true, selector: "c8y-map-widget-config", inputs: { config: "config" }, viewQueries: [{ propertyName: "previewMap", first: true, predicate: MapComponent, descendants: true }, { propertyName: "previewMapSet", first: true, predicate: ["previewMap"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "@if (formConfig) {\n <fieldset class=\"c8y-fieldset\">\n <legend>{{ 'Map' | translate }}</legend>\n <div class=\"row tight-grid\">\n <div class=\"col-xs-3\">\n <c8y-form-group class=\"m-b-16 text-center form-group-sm\">\n <label translate>Marker icon</label>\n <c8y-icon-selector-wrapper\n [canRemoveIcon]=\"true\"\n [iconSize]=\"16\"\n [selectedIcon]=\"formConfig.icon\"\n (onSelect)=\"selectIcon($event)\"\n ></c8y-icon-selector-wrapper>\n </c8y-form-group>\n </div>\n <div [ngClass]=\"{ 'col-xs-6': !isPositionedDevice(), 'col-xs-9': isPositionedDevice() }\">\n <div class=\"form-group form-group-sm\">\n <label translate>Zoom level</label>\n <c8y-range\n class=\"label-bottom\"\n name=\"zoomLevel\"\n #range\n [(ngModel)]=\"formConfig.zoomLevel\"\n (change)=\"zoomLevelChanged()\"\n >\n <input\n type=\"range\"\n min=\"0\"\n max=\"18\"\n step=\"1\"\n [disabled]=\"!isPositionedDevice() && formConfig.autoFitToBounds\"\n />\n </c8y-range>\n </div>\n </div>\n @if (!isPositionedDevice()) {\n <div class=\"col-xs-3\">\n <c8y-form-group class=\"m-b-16 text-center form-group-sm\">\n <label translate>Fit to bounds</label>\n <div class=\"m-t-4 d-flex j-c-center\">\n <label class=\"c8y-switch c8y-switch--inline\">\n <input\n name=\"autoFitToBounds\"\n type=\"checkbox\"\n [(ngModel)]=\"formConfig.autoFitToBounds\"\n (ngModelChange)=\"fitToBound()\"\n />\n <span></span>\n </label>\n <button\n class=\"btn-help\"\n aria-label=\"Help content\"\n [popover]=\"\n 'If enabled, the zoom level and center bound is always adjusted to fit all assets within the map view.'\n | translate\n \"\n placement=\"top\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n ></button>\n </div>\n </c8y-form-group>\n </div>\n }\n </div>\n <c8y-form-group class=\"form-group-sm\">\n <label translate>Center bound</label>\n <div class=\"input-group input-group-sm\">\n <input\n class=\"form-control\"\n placeholder=\"{{ 'lat.`latitude`' | translate }}\"\n name=\"centerLat\"\n type=\"number\"\n required\n [(ngModel)]=\"formConfig.center[0]\"\n (change)=\"changeCenter()\"\n (keydown.enter)=\"changeCenterOnEnterKey($event)\"\n min=\"-90\"\n max=\"90\"\n step=\"0.1\"\n [disabled]=\"!isPositionedDevice() && formConfig.autoFitToBounds\"\n />\n <input\n class=\"form-control\"\n placeholder=\"{{ 'lng.`longitude`' | translate }}\"\n name=\"centerLng\"\n type=\"number\"\n required\n min=\"-180\"\n max=\"180\"\n [(ngModel)]=\"formConfig.center[1]\"\n (change)=\"changeCenter()\"\n (keydown.enter)=\"changeCenterOnEnterKey($event)\"\n min=\"-180\"\n max=\"180\"\n step=\"0.1\"\n [disabled]=\"!isPositionedDevice() && formConfig.autoFitToBounds\"\n />\n <div class=\"input-group-btn\">\n <button\n class=\"btn btn-default\"\n [attr.aria-label]=\"'Use your location' | translate\"\n [tooltip]=\"'Use your location' | translate\"\n placement=\"top\"\n container=\"body\"\n (click)=\"useOwnPosition()\"\n [disabled]=\"!isPositionedDevice() && formConfig.autoFitToBounds\"\n >\n <i\n class=\"icon-14\"\n c8yIcon=\"location-arrow\"\n ></i>\n </button>\n </div>\n <div class=\"input-group-btn\">\n @if (canAutoCenter()) {\n <button\n class=\"btn btn-default\"\n [attr.aria-label]=\"'Use selected asset location' | translate\"\n [tooltip]=\"'Use selected asset location' | translate\"\n placement=\"top\"\n container=\"body\"\n (click)=\"centerToAsset()\"\n [disabled]=\"!isPositionedDevice() && formConfig.autoFitToBounds\"\n >\n <i\n class=\"icon-14\"\n c8yIcon=\"location\"\n ></i>\n </button>\n } @else {\n <button\n class=\"btn btn-default\"\n [attr.aria-label]=\"'Fit to assets bounds' | translate\"\n [tooltip]=\"'Fit to assets bounds' | translate\"\n placement=\"top\"\n container=\"body\"\n (click)=\"fitToBounds()\"\n [disabled]=\"!isPositionedDevice() && formConfig.autoFitToBounds\"\n >\n <i\n class=\"icon-14\"\n c8yIcon=\"waypoint-map\"\n ></i>\n </button>\n }\n </div>\n </div>\n\n @if (!formConfig.autoFitToBounds) {\n <c8y-messages\n [helpMessage]=\"'Drag the map to the desired position' | translate\"\n ></c8y-messages>\n }\n </c8y-form-group>\n </fieldset>\n\n @if (isPositionedDevice()) {\n <fieldset class=\"c8y-fieldset\">\n <legend>{{ 'Follow' | translate }}</legend>\n <div class=\"row tight-grid d-flex a-i-center\">\n <div class=\"col-xs-12\">\n <div class=\"form-group form-group-sm m-b-16\">\n <label class=\"c8y-switch c8y-switch--inline\">\n <input\n name=\"follow\"\n type=\"checkbox\"\n [(ngModel)]=\"formConfig.follow\"\n />\n <span></span>\n <span\n class=\"text-12\"\n translate\n >\n Follow selected\n </span>\n </label>\n </div>\n </div>\n </div>\n </fieldset>\n }\n}\n\n<ng-template #previewMap>\n <div style=\"width: 100%; height: 100%\">\n @if (config.mapConfig) {\n <c8y-map\n [assets]=\"assets()\"\n [config]=\"config.mapConfig\"\n (onMove)=\"onPreviewMapMove($event)\"\n (onZoomStart)=\"onPreviewZoomStart()\"\n (onZoomEnd)=\"onPreviewZoomEnd($event)\"\n (onInit)=\"previewMapInit($event)\"\n ></c8y-map>\n }\n </div>\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i6.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: i6.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i6.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i6.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i6.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: CommonModule$1 }, { kind: "directive", type: i2$1.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: i2$1.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "ngmodule", type: FormsModule$1 }, { kind: "directive", type: i2$1.MinValidationDirective, selector: "[min]", inputs: ["min"] }, { kind: "directive", type: i2$1.MaxValidationDirective, selector: "[max]", inputs: ["max"] }, { kind: "component", type: i2$1.FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "component", type: i2$1.MessagesComponent, selector: "c8y-messages", inputs: ["show", "defaults", "helpMessage", "additionalMessages"] }, { kind: "directive", type: i2$1.RequiredInputPlaceholderDirective, selector: "input[required], input[formControlName]" }, { kind: "directive", type: i2$1.RangeDirective, selector: "input[type=\"range\"]" }, { kind: "component", type: i2$1.RangeComponent, selector: "c8y-range", inputs: ["valueDisplayMode"] }, { kind: "ngmodule", type: IconSelectorModule }, { kind: "component", type: i7.IconSelectorWrapperComponent, selector: "c8y-icon-selector-wrapper", inputs: ["canRemoveIcon", "selectedIcon", "iconSize"], outputs: ["onSelect"] }, { kind: "ngmodule", type: MapModule }, { kind: "component", type: i4.MapComponent, selector: "c8y-map", inputs: ["config", "assets", "polyline$", "polylineOptions"], outputs: ["onRealtimeUpdate", "onMove", "onMoveEnd", "onZoomStart", "onZoomEnd", "onMap", "onInit"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i8.TooltipDirective, selector: "[tooltip], [tooltipHtml]", inputs: ["adaptivePosition", "tooltip", "placement", "triggers", "container", "containerClass", "boundariesElement", "isOpen", "isDisabled", "delay", "tooltipHtml", "tooltipPlacement", "tooltipIsOpen", "tooltipEnable", "tooltipAppendToBody", "tooltipAnimation", "tooltipClass", "tooltipContext", "tooltipPopupDelay", "tooltipFadeDuration", "tooltipTrigger"], outputs: ["tooltipChange", "onShown", "onHidden", "tooltipStateChanged"], exportAs: ["bs-tooltip"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: PopoverModule }, { kind: "directive", type: i9.PopoverDirective, selector: "[popover]", inputs: ["adaptivePosition", "boundariesElement", "popover", "popoverContext", "popoverTitle", "placement", "outsideClick", "triggers", "container", "containerClass", "isOpen", "delay"], outputs: ["onShown", "onHidden"], exportAs: ["bs-popover"] }, { kind: "pipe", type: i2$1.C8yTranslatePipe, name: "translate" }], viewProviders: [{ provide: ControlContainer, useExisting: NgForm }] }); }
|
|
247
247
|
}
|
|
248
248
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MapWidgetConfigComponent, decorators: [{
|
|
249
249
|
type: Component,
|