@c8y/ngx-components 1023.14.220 → 1023.14.222
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/alarm-event-selector/index.d.ts.map +1 -1
- package/datapoint-library/list/index.d.ts.map +1 -1
- package/datapoint-selector/index.d.ts +25 -7
- package/datapoint-selector/index.d.ts.map +1 -1
- package/echart/index.d.ts +1 -0
- package/echart/index.d.ts.map +1 -1
- package/fesm2022/c8y-ngx-components-alarm-event-selector.mjs +13 -8
- package/fesm2022/c8y-ngx-components-alarm-event-selector.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-computed-asset-properties.mjs +8 -3
- package/fesm2022/c8y-ngx-components-computed-asset-properties.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-datapoint-library-details.mjs +2 -2
- package/fesm2022/c8y-ngx-components-datapoint-library-details.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-datapoint-library-list.mjs +13 -5
- package/fesm2022/c8y-ngx-components-datapoint-library-list.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-datapoint-selector.mjs +66 -39
- package/fesm2022/c8y-ngx-components-datapoint-selector.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-echart.mjs +25 -14
- package/fesm2022/c8y-ngx-components-echart.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs +15 -6
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-table.mjs +10 -6
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-table.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-info-gauge.mjs +20 -16
- package/fesm2022/c8y-ngx-components-widgets-implementations-info-gauge.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-kpi.mjs +3 -3
- package/fesm2022/c8y-ngx-components-widgets-implementations-kpi.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-linear-gauge.mjs +4 -4
- package/fesm2022/c8y-ngx-components-widgets-implementations-linear-gauge.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components.mjs +145 -3
- package/fesm2022/c8y-ngx-components.mjs.map +1 -1
- package/index.d.ts +123 -2
- package/index.d.ts.map +1 -1
- package/locales/locales.pot +14 -8
- package/package.json +1 -1
- package/widgets/implementations/datapoints-graph/index.d.ts +6 -0
- package/widgets/implementations/datapoints-graph/index.d.ts.map +1 -1
- package/widgets/implementations/datapoints-table/index.d.ts.map +1 -1
- package/widgets/implementations/info-gauge/index.d.ts.map +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { moveItemInArray, CdkDropList, CdkDrag, CdkDragHandle, DragDropModule } from '@angular/cdk/drag-drop';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { Injectable, forwardRef, Input, Component, EventEmitter, ContentChild, Output,
|
|
3
|
+
import { Injectable, forwardRef, Input, Component, inject, Pipe, EventEmitter, ContentChild, Output, Optional, NgModule } from '@angular/core';
|
|
4
4
|
import * as i2$1 from '@c8y/ngx-components';
|
|
5
|
-
import { C8yValidators, C8yTranslateDirective, FormGroupComponent, RequiredInputPlaceholderDirective, MessagesComponent, MessageDirective, C8yTranslatePipe, MAX_PAGE_SIZE, IconDirective, ListItemComponent, ListItemDragHandleComponent, ListItemCheckboxComponent, HighlightComponent, ListItemActionComponent, ListItemCollapseComponent, TypeaheadComponent, ForOfDirective, ListItemIconComponent, EmptyStateComponent, LoadingComponent, ListGroupComponent, CoreModule } from '@c8y/ngx-components';
|
|
5
|
+
import { C8yValidators, C8yTranslateDirective, FormGroupComponent, RequiredInputPlaceholderDirective, MessagesComponent, MessageDirective, C8yTranslatePipe, MAX_PAGE_SIZE, buildDatapointLabel, translateDatapointLabel, IconDirective, DatapointDescriptionPipe, DatapointUnitPipe, ListItemComponent, ListItemDragHandleComponent, ListItemCheckboxComponent, HighlightComponent, ListItemActionComponent, ListItemCollapseComponent, TypeaheadComponent, ForOfDirective, ListItemIconComponent, EmptyStateComponent, LoadingComponent, ListGroupComponent, CoreModule } from '@c8y/ngx-components';
|
|
6
6
|
import { MillerViewComponent, AssetSelectorModule } from '@c8y/ngx-components/assets-navigator';
|
|
7
7
|
import { CollapseModule } from 'ngx-bootstrap/collapse';
|
|
8
8
|
import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
|
|
@@ -12,13 +12,16 @@ import { PopoverDirective, PopoverModule } from 'ngx-bootstrap/popover';
|
|
|
12
12
|
import { TooltipDirective, TooltipModule } from 'ngx-bootstrap/tooltip';
|
|
13
13
|
import * as i2 from '@angular/forms';
|
|
14
14
|
import { Validators, FormsModule, ReactiveFormsModule, NG_VALUE_ACCESSOR, NG_VALIDATORS } from '@angular/forms';
|
|
15
|
-
import { map, take, filter, startWith, tap, switchMap, shareReplay,
|
|
15
|
+
import { map, take, filter, startWith, distinctUntilChanged, tap, switchMap, shareReplay, debounceTime } from 'rxjs/operators';
|
|
16
16
|
import { gettext } from '@c8y/ngx-components/gettext';
|
|
17
17
|
import { NgClass, NgTemplateOutlet, KeyValuePipe, AsyncPipe, NgIf, NgFor } from '@angular/common';
|
|
18
18
|
import * as i4 from '@c8y/ngx-components/context-dashboard';
|
|
19
19
|
import { pipe, BehaviorSubject, from, combineLatest } from 'rxjs';
|
|
20
20
|
import * as i1 from '@c8y/client';
|
|
21
21
|
import { sortBy, get, uniq } from 'lodash-es';
|
|
22
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
23
|
+
import * as i2$2 from '@ngx-translate/core';
|
|
24
|
+
import { TranslateService } from '@ngx-translate/core';
|
|
22
25
|
|
|
23
26
|
const AXIS_TYPES = [
|
|
24
27
|
{ val: null, text: gettext('Auto') },
|
|
@@ -528,7 +531,7 @@ class DatapointLibraryService {
|
|
|
528
531
|
}
|
|
529
532
|
const datapoint = this.mapDatapointLibraryEntry(foundDatapointLibraryEntry) || tuple;
|
|
530
533
|
if (!datapoint.label) {
|
|
531
|
-
datapoint.label =
|
|
534
|
+
datapoint.label = buildDatapointLabel(datapoint);
|
|
532
535
|
}
|
|
533
536
|
if (!datapoint.unit?.length) {
|
|
534
537
|
datapoint.unit = '';
|
|
@@ -612,6 +615,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
612
615
|
args: [{ providedIn: 'root' }]
|
|
613
616
|
}], ctorParameters: () => [{ type: i1.InventoryService }, { type: i2$1.AppStateService }, { type: i1.MeasurementService }, { type: i2$1.ColorService }] });
|
|
614
617
|
|
|
618
|
+
/**
|
|
619
|
+
* Builds the label of a datapoint, either from the datapoint's own label or, if it has none, from
|
|
620
|
+
* its fragment and series, and translates it. Outside a template, call `translateDatapointLabel`
|
|
621
|
+
* directly.
|
|
622
|
+
*/
|
|
623
|
+
class DatapointLabelPipe {
|
|
624
|
+
constructor() {
|
|
625
|
+
this.translate = inject(TranslateService);
|
|
626
|
+
}
|
|
627
|
+
/**
|
|
628
|
+
* @param datapointOrLabel Either a `KPIDetails` datapoint (its `label` is used, falling back
|
|
629
|
+
* to `fragment → series`) or the label string itself. `options` only applies to a datapoint.
|
|
630
|
+
*/
|
|
631
|
+
transform(datapointOrLabel, options = { includeDevice: false, doNotUseLabel: false }) {
|
|
632
|
+
return translateDatapointLabel(datapointOrLabel, this.translate, options);
|
|
633
|
+
}
|
|
634
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: DatapointLabelPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
635
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.25", ngImport: i0, type: DatapointLabelPipe, isStandalone: true, name: "datapointLabel" }); }
|
|
636
|
+
}
|
|
637
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: DatapointLabelPipe, decorators: [{
|
|
638
|
+
type: Pipe,
|
|
639
|
+
args: [{ name: 'datapointLabel' }]
|
|
640
|
+
}] });
|
|
641
|
+
|
|
615
642
|
class DatapointTemplatePopoverComponent {
|
|
616
643
|
constructor() {
|
|
617
644
|
this.attributes = [
|
|
@@ -640,11 +667,17 @@ class DatapointTemplatePopoverComponent {
|
|
|
640
667
|
];
|
|
641
668
|
}
|
|
642
669
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: DatapointTemplatePopoverComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
643
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: DatapointTemplatePopoverComponent, isStandalone: true, selector: "c8y-datapoint-template-popover", inputs: { datapoint: "datapoint", attributes: "attributes" }, ngImport: i0, template: "<p class=\"text-medium\">\n <i\n c8yIcon=\"circle\"\n [style.color]=\"datapoint.color\"\n ></i>\n {{ datapoint.label }}\n</p>\n<p>{{ datapoint.description }}</p>\n\n<ul class=\"list-unstyled small p-t-16\">\n @for (attribute of attributes; track attribute; let i = $index) {\n @if (datapoint[attribute.key] !== undefined) {\n <li class=\"p-t-4 p-b-4 d-flex separator-bottom text-nowrap\">\n <label class=\"small m-b-0 m-r-8\">\n @if (attribute.labelColor) {\n <i\n c8yIcon=\"square\"\n [style.color]=\"attribute.labelColor\"\n ></i>\n }\n {{ attribute.label | translate }}\n </label>\n @switch (attribute.key) {\n @case ('min') {\n <span class=\"m-l-auto\">{{ datapoint['min'] }} \u2014 {{ datapoint['max'] }}</span>\n }\n @case ('yellowRangeMin') {\n <span class=\"m-l-auto\">\n {{ datapoint['yellowRangeMin'] }} \u2014 {{ datapoint['yellowRangeMax'] }}\n </span>\n }\n @case ('redRangeMin') {\n <span class=\"m-l-auto\">\n {{ datapoint['redRangeMin'] }} \u2014 {{ datapoint['redRangeMax'] }}\n </span>\n }\n @default {\n <span class=\"m-l-auto\">\n {{ datapoint[attribute.key] }}\n </span>\n }\n }\n </li>\n }\n }\n</ul>\n", dependencies: [{ kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }] }); }
|
|
670
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: DatapointTemplatePopoverComponent, isStandalone: true, selector: "c8y-datapoint-template-popover", inputs: { datapoint: "datapoint", attributes: "attributes" }, ngImport: i0, template: "<p class=\"text-medium\">\n <i\n c8yIcon=\"circle\"\n [style.color]=\"datapoint.color\"\n ></i>\n {{ datapoint.label | datapointLabel }}\n</p>\n<p>{{ datapoint.description | datapointDescription }}</p>\n\n<ul class=\"list-unstyled small p-t-16\">\n @for (attribute of attributes; track attribute; let i = $index) {\n @if (datapoint[attribute.key] !== undefined) {\n <li class=\"p-t-4 p-b-4 d-flex separator-bottom text-nowrap\">\n <label class=\"small m-b-0 m-r-8\">\n @if (attribute.labelColor) {\n <i\n c8yIcon=\"square\"\n [style.color]=\"attribute.labelColor\"\n ></i>\n }\n {{ attribute.label | translate }}\n </label>\n @switch (attribute.key) {\n @case ('unit') {\n <span class=\"m-l-auto\">{{ datapoint['unit'] | datapointUnit }}</span>\n }\n @case ('min') {\n <span class=\"m-l-auto\">{{ datapoint['min'] }} \u2014 {{ datapoint['max'] }}</span>\n }\n @case ('yellowRangeMin') {\n <span class=\"m-l-auto\">\n {{ datapoint['yellowRangeMin'] }} \u2014 {{ datapoint['yellowRangeMax'] }}\n </span>\n }\n @case ('redRangeMin') {\n <span class=\"m-l-auto\">\n {{ datapoint['redRangeMin'] }} \u2014 {{ datapoint['redRangeMax'] }}\n </span>\n }\n @default {\n <span class=\"m-l-auto\">\n {{ datapoint[attribute.key] }}\n </span>\n }\n }\n </li>\n }\n }\n</ul>\n", dependencies: [{ kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: DatapointLabelPipe, name: "datapointLabel" }, { kind: "pipe", type: DatapointDescriptionPipe, name: "datapointDescription" }, { kind: "pipe", type: DatapointUnitPipe, name: "datapointUnit" }] }); }
|
|
644
671
|
}
|
|
645
672
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: DatapointTemplatePopoverComponent, decorators: [{
|
|
646
673
|
type: Component,
|
|
647
|
-
args: [{ selector: 'c8y-datapoint-template-popover', imports: [
|
|
674
|
+
args: [{ selector: 'c8y-datapoint-template-popover', imports: [
|
|
675
|
+
IconDirective,
|
|
676
|
+
C8yTranslatePipe,
|
|
677
|
+
DatapointLabelPipe,
|
|
678
|
+
DatapointDescriptionPipe,
|
|
679
|
+
DatapointUnitPipe
|
|
680
|
+
], template: "<p class=\"text-medium\">\n <i\n c8yIcon=\"circle\"\n [style.color]=\"datapoint.color\"\n ></i>\n {{ datapoint.label | datapointLabel }}\n</p>\n<p>{{ datapoint.description | datapointDescription }}</p>\n\n<ul class=\"list-unstyled small p-t-16\">\n @for (attribute of attributes; track attribute; let i = $index) {\n @if (datapoint[attribute.key] !== undefined) {\n <li class=\"p-t-4 p-b-4 d-flex separator-bottom text-nowrap\">\n <label class=\"small m-b-0 m-r-8\">\n @if (attribute.labelColor) {\n <i\n c8yIcon=\"square\"\n [style.color]=\"attribute.labelColor\"\n ></i>\n }\n {{ attribute.label | translate }}\n </label>\n @switch (attribute.key) {\n @case ('unit') {\n <span class=\"m-l-auto\">{{ datapoint['unit'] | datapointUnit }}</span>\n }\n @case ('min') {\n <span class=\"m-l-auto\">{{ datapoint['min'] }} \u2014 {{ datapoint['max'] }}</span>\n }\n @case ('yellowRangeMin') {\n <span class=\"m-l-auto\">\n {{ datapoint['yellowRangeMin'] }} \u2014 {{ datapoint['yellowRangeMax'] }}\n </span>\n }\n @case ('redRangeMin') {\n <span class=\"m-l-auto\">\n {{ datapoint['redRangeMin'] }} \u2014 {{ datapoint['redRangeMax'] }}\n </span>\n }\n @default {\n <span class=\"m-l-auto\">\n {{ datapoint[attribute.key] }}\n </span>\n }\n }\n </li>\n }\n }\n</ul>\n" }]
|
|
648
681
|
}], propDecorators: { datapoint: [{
|
|
649
682
|
type: Input
|
|
650
683
|
}], attributes: [{
|
|
@@ -657,8 +690,9 @@ const AddButtonTypes = {
|
|
|
657
690
|
select: 'select'
|
|
658
691
|
};
|
|
659
692
|
class DatapointSelectorListItemComponent {
|
|
660
|
-
constructor(formBuilder) {
|
|
693
|
+
constructor(formBuilder, translate) {
|
|
661
694
|
this.formBuilder = formBuilder;
|
|
695
|
+
this.translate = translate;
|
|
662
696
|
this.defaultFormOptions = {};
|
|
663
697
|
this.isSelected = false;
|
|
664
698
|
this.isCollapsed = true;
|
|
@@ -686,6 +720,9 @@ class DatapointSelectorListItemComponent {
|
|
|
686
720
|
__template: []
|
|
687
721
|
});
|
|
688
722
|
this.isValid$ = this.formGroup.statusChanges.pipe(map(status => status === 'VALID'), startWith(this.formGroup.valid));
|
|
723
|
+
this.formGroup.valueChanges
|
|
724
|
+
.pipe(map(({ __template, details }) => ({ __template, details })), distinctUntilChanged(undefined, ({ __template, details }) => `${__template}|${details?.label}`), takeUntilDestroyed())
|
|
725
|
+
.subscribe(() => this.updateTemplateForTypeahead());
|
|
689
726
|
}
|
|
690
727
|
validate(_control) {
|
|
691
728
|
if (this.formGroup?.invalid) {
|
|
@@ -703,6 +740,7 @@ class DatapointSelectorListItemComponent {
|
|
|
703
740
|
}
|
|
704
741
|
writeValue(obj) {
|
|
705
742
|
this.formGroup.patchValue({ ...obj, details: obj });
|
|
743
|
+
this.updateTemplateForTypeahead();
|
|
706
744
|
}
|
|
707
745
|
registerOnChange(fn) {
|
|
708
746
|
this.formGroup.valueChanges.pipe(map(tmp => this.transformFormValue(tmp))).subscribe(fn);
|
|
@@ -771,6 +809,17 @@ class DatapointSelectorListItemComponent {
|
|
|
771
809
|
this.writeValue(dataPoint);
|
|
772
810
|
this.setPipe('');
|
|
773
811
|
}
|
|
812
|
+
/**
|
|
813
|
+
* Reads the selection from the form rather than from a caller, so that it stays correct no
|
|
814
|
+
* matter what the form was given, `writeValue(null)` included.
|
|
815
|
+
*/
|
|
816
|
+
updateTemplateForTypeahead() {
|
|
817
|
+
const { __template, details } = this.formGroup.value;
|
|
818
|
+
this.templateForTypeahead =
|
|
819
|
+
__template && details
|
|
820
|
+
? { ...details, translatedLabel: translateDatapointLabel(details, this.translate) }
|
|
821
|
+
: undefined;
|
|
822
|
+
}
|
|
774
823
|
resetUnusedProperties(details) {
|
|
775
824
|
const { showTarget, showYellowRange, showRedRange } = this.defaultFormOptions;
|
|
776
825
|
details.__template = undefined;
|
|
@@ -797,7 +846,7 @@ class DatapointSelectorListItemComponent {
|
|
|
797
846
|
delete obj.details;
|
|
798
847
|
return obj;
|
|
799
848
|
}
|
|
800
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: DatapointSelectorListItemComponent, deps: [{ token: i2.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
849
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: DatapointSelectorListItemComponent, deps: [{ token: i2.FormBuilder }, { token: i2$2.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
801
850
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: DatapointSelectorListItemComponent, isStandalone: true, selector: "c8y-datapoint-selector-list-item", inputs: { defaultFormOptions: "defaultFormOptions", isSelected: "isSelected", isCollapsed: "isCollapsed", addButtonType: "addButtonType", editable: "editable", showActiveToggle: "showActiveToggle", activeToggleDisabled: "activeToggleDisabled", showOptions: "showOptions", datapointLibraryEntries: "datapointLibraryEntries", actions: "actions", optionToRemove: "optionToRemove", hasUnlinkTemplateOption: "hasUnlinkTemplateOption", colorPickerDisabled: "colorPickerDisabled", disableTypeaheadIfSelected: "disableTypeaheadIfSelected", highlightText: "highlightText" }, outputs: { added: "added", removed: "removed" }, providers: [
|
|
802
851
|
{
|
|
803
852
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -809,7 +858,7 @@ class DatapointSelectorListItemComponent {
|
|
|
809
858
|
useExisting: forwardRef(() => DatapointSelectorListItemComponent),
|
|
810
859
|
multi: true
|
|
811
860
|
}
|
|
812
|
-
], queries: [{ propertyName: "dragHandle", first: true, predicate: ListItemDragHandleComponent, descendants: true }], ngImport: i0, template: "<c8y-li\n class=\"c8y-list__item__collapse--container-small\"\n [formGroup]=\"formGroup\"\n #li\n>\n <c8y-li-drag-handle><ng-content select=\"c8y-li-drag-handle\"></ng-content></c8y-li-drag-handle>\n @if (showActiveToggle) {\n <c8y-li-checkbox\n class=\"a-s-center p-r-0\"\n [displayAsSwitch]=\"true\"\n formControlName=\"__active\"\n (click)=\"$event.stopPropagation()\"\n ></c8y-li-checkbox>\n }\n\n <div class=\"d-flex a-i-center\">\n <div\n class=\"c8y-list__item__colorpicker p-t-0 p-b-0 p-l-16\"\n [title]=\"'Change color' | translate\"\n >\n <div class=\"c8y-colorpicker\">\n <input\n [attr.aria-label]=\"'Color' | translate\"\n type=\"color\"\n formControlName=\"color\"\n (click)=\"$event.stopPropagation()\"\n />\n <span [style.background-color]=\"formGroup.value.color\"></span>\n </div>\n </div>\n <button\n class=\"btn-clean data-point-label text-truncate\"\n [attr.aria-expanded]=\"!li.collapsed\"\n type=\"button\"\n (click)=\"li.collapsed = !li.collapsed\"\n >\n <span\n class=\"text-truncate\"\n [title]=\"formGroup.value.details?.label\"\n >\n <c8y-highlight\n [text]=\"formGroup.value.details?.label\"\n [pattern]=\"highlightText\"\n [shouldTrimPattern]=\"true\"\n ></c8y-highlight>\n </span>\n @if (formGroup.value.__target) {\n <small class=\"text-truncate text-muted icon-flex\">\n <i c8yIcon=\"exchange\"></i>\n <span class=\"text-truncate\">{{ formGroup.value.__target.name }}</span>\n </small>\n }\n </button>\n\n @if (!(isValid$ | async)) {\n <button\n class=\"btn btn-dot btn-dot--danger m-l-auto\"\n [attr.aria-label]=\"'Invalid' | translate\"\n [popover]=\"\n errorMessage\n ? errorMessage\n : ('Some entries are invalid. Check the input fields with red borders.' | translate)\n \"\n placement=\"left\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n >\n <i c8yIcon=\"warning\"></i>\n </button>\n }\n @if (addButtonType === AddButtonTypes.addRemove) {\n <div class=\"m-l-auto a-s-center p-r-4\">\n @if (isSelected) {\n <button\n class=\"btn btn-dot btn-dot--danger\"\n [attr.aria-label]=\"'Remove' | translate\"\n [tooltip]=\"'Remove from selected data points' | translate\"\n type=\"button\"\n [delay]=\"500\"\n (click)=\"addOrRemoveItem()\"\n [attr.data-cy]=\"'datapoint-selector-list-item--remove-datapoint-button'\"\n >\n <i\n class=\"icon-20\"\n c8yIcon=\"minus-circle\"\n ></i>\n </button>\n }\n @if (!isSelected) {\n <button\n class=\"btn btn-dot text-primary\"\n [attr.aria-label]=\"'Add to selected data points' | translate\"\n [tooltip]=\"'Add to selected data points' | translate\"\n type=\"button\"\n [delay]=\"500\"\n [disabled]=\"!(isValid$ | async)\"\n (click)=\"addOrRemoveItem()\"\n [attr.data-cy]=\"'datapoint-selector-list-item--add-datapoint-button'\"\n >\n <i\n class=\"text-primary icon-20\"\n c8yIcon=\"plus-circle\"\n ></i>\n </button>\n }\n </div>\n }\n @if (addButtonType === AddButtonTypes.select) {\n <button\n class=\"btn btn-default btn-sm m-l-auto\"\n [attr.aria-label]=\"'Select' | translate\"\n [tooltip]=\"'Select data point' | translate\"\n type=\"button\"\n [delay]=\"500\"\n (click)=\"addOrRemoveItem()\"\n >\n {{ 'Select' | translate }}\n </button>\n }\n </div>\n\n @if (optionToRemove) {\n <c8y-li-action\n [icon]=\"'minus-circle'\"\n [label]=\"'Remove from list' | translate\"\n (click)=\"remove()\"\n ></c8y-li-action>\n }\n @for (action of actions; track action) {\n <c8y-li-action\n [icon]=\"action.icon\"\n [label]=\"action.label\"\n (click)=\"action.callback(formGroup.value)\"\n ></c8y-li-action>\n }\n @if (editable) {\n <c8y-li-collapse>\n <div class=\"data-point-details\">\n <ul class=\"list-unstyled small m-b-16\">\n <li class=\"p-t-4 p-b-4 d-flex separator-top-bottom\">\n <label\n class=\"small m-b-0 m-r-8 a-s-start text-muted\"\n translate\n >\n Fragment\n </label>\n <span\n class=\"m-l-auto text-truncate\"\n title=\"{{ formGroup.value.fragment }}\"\n >\n <c8y-highlight\n [text]=\"formGroup.value.fragment\"\n [pattern]=\"highlightText\"\n [shouldTrimPattern]=\"true\"\n ></c8y-highlight>\n </span>\n </li>\n <li class=\"p-t-4 p-b-4 d-flex separator-bottom\">\n <label\n class=\"small m-b-0 m-r-8 a-s-start text-muted\"\n translate\n >\n Series\n </label>\n <span\n class=\"m-l-auto text-truncate\"\n title=\"{{ formGroup.value.series }}\"\n >\n <c8y-highlight\n [text]=\"formGroup.value.series\"\n [pattern]=\"highlightText\"\n [shouldTrimPattern]=\"true\"\n ></c8y-highlight>\n </span>\n </li>\n </ul>\n @if (datapointLibraryEntries && datapointLibraryEntries | async; as libraryEntries) {\n <div class=\"form-group form-group-sm\">\n <label>\n {{ 'Data point template' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"datapointHintPopoverTemplate\"\n placement=\"top\"\n triggers=\"focus\"\n type=\"button\"\n (click)=\"$event.stopPropagation()\"\n ></button>\n </label>\n\n <ng-template #datapointHintPopoverTemplate>\n {{\n 'Using a data point template sets color, label, unit and ranges. Removing the template allows you to set the values manually.'\n | translate\n }}\n </ng-template>\n <div class=\"input-group input-group-sm\">\n @if (datapointLibraryEntries) {\n <c8y-typeahead\n class=\"flex-grow\"\n [placeholder]=\"'No template' | translate\"\n [ngModel]=\"formGroup.value.__template ? formGroup.value.details : undefined\"\n [ngModelOptions]=\"{ standalone: true }\"\n (onSearch)=\"setPipe($event)\"\n [displayProperty]=\"'label'\"\n [hideNew]=\"true\"\n [disabled]=\"isSelected && disableTypeaheadIfSelected\"\n >\n <c8y-li\n class=\"p-l-8 p-r-8 c8y-list__item--link interact\"\n *c8yFor=\"\n let item of datapointLibraryEntries;\n loadMore: 'auto';\n pipe: filterPipe;\n notFound: notFoundTemplate\n \"\n (click)=\"dataPointTemplateSelected(item)\"\n [active]=\"formGroup.value.__template === item.id\"\n [attr.role]=\"'menuitem'\"\n >\n <c8y-highlight\n [text]=\"item.c8y_Kpi?.label\"\n [pattern]=\"pattern\"\n ></c8y-highlight>\n <c8y-li-icon\n icon=\"circle\"\n [style.color]=\"item.c8y_Kpi?.color\"\n ></c8y-li-icon>\n </c8y-li>\n <ng-template #notFoundTemplate>\n @if (pattern.length > 0) {\n <c8y-li class=\"bg-level-2 p-8\">\n <span>No match found.</span>\n </c8y-li>\n }\n </ng-template>\n </c8y-typeahead>\n }\n <div class=\"input-group-btn\">\n @if (formGroup.value.__template) {\n <button\n class=\"btn btn-default\"\n [attr.aria-label]=\"'Info' | translate\"\n [popover]=\"datapointOverviewPopoverTemplate\"\n placement=\"left\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n >\n <i\n class=\"text-info\"\n c8yIcon=\"info\"\n ></i>\n </button>\n }\n </div>\n <div class=\"input-group-btn\">\n @if (formGroup.value.__template && hasUnlinkTemplateOption) {\n <button\n class=\"btn btn-default\"\n [attr.aria-label]=\"'Unlink data point template' | translate\"\n tooltip=\"{{ 'Unlink data point template' | translate }}\"\n placement=\"left\"\n container=\"body\"\n type=\"button\"\n [delay]=\"500\"\n [adaptivePosition]=\"false\"\n (click)=\"unlinkDatapointTemplate()\"\n >\n <i c8yIcon=\"unlink\"></i>\n </button>\n }\n </div>\n </div>\n </div>\n }\n <ng-template #datapointOverviewPopoverTemplate>\n <c8y-datapoint-template-popover\n [datapoint]=\"formGroup.value.details\"\n ></c8y-datapoint-template-popover>\n </ng-template>\n @if (defaultFormOptions) {\n <c8y-datapoint-attributes-form\n [showTarget]=\"defaultFormOptions.showTarget\"\n [showRange]=\"defaultFormOptions.showRange\"\n [showYellowRange]=\"defaultFormOptions.showYellowRange\"\n [showRedRange]=\"defaultFormOptions.showRedRange\"\n [showChart]=\"defaultFormOptions.showChart\"\n [showFormIfTemplateWasSelected]=\"defaultFormOptions.showFormIfTemplateWasSelected\"\n [selectableChartRenderTypes]=\"defaultFormOptions.selectableChartRenderTypes\"\n [selectableChartLineTypes]=\"defaultFormOptions.selectableChartLineTypes\"\n [selectableAxisTypes]=\"defaultFormOptions.selectableAxisTypes\"\n [showAdvancedChartOptions]=\"defaultFormOptions.showAdvancedChartOptions\"\n [showErrorsImmediately]=\"true\"\n formControlName=\"details\"\n ></c8y-datapoint-attributes-form>\n }\n </div>\n </c8y-li-collapse>\n }\n</c8y-li>\n", dependencies: [{ kind: "component", type: ListItemComponent, selector: "c8y-list-item, c8y-li", inputs: ["active", "highlighted", "emptyActions", "dense", "collapsed", "selectable"], outputs: ["collapsedChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.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: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: ListItemDragHandleComponent, selector: "c8y-list-item-drag-handle, c8y-li-drag-handle" }, { kind: "component", type: ListItemCheckboxComponent, selector: "c8y-list-item-checkbox, c8y-li-checkbox", inputs: ["selected", "indeterminate", "disabled", "displayAsSwitch"], outputs: ["onSelect"] }, { kind: "directive", type: RequiredInputPlaceholderDirective, selector: "input[required], input[formControlName]" }, { kind: "component", type: HighlightComponent, selector: "c8y-highlight", inputs: ["pattern", "text", "elementClass", "shouldTrimPattern"] }, { kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: PopoverDirective, selector: "[popover]", inputs: ["adaptivePosition", "boundariesElement", "popover", "popoverContext", "popoverTitle", "placement", "outsideClick", "triggers", "container", "containerClass", "isOpen", "delay"], outputs: ["onShown", "onHidden"], exportAs: ["bs-popover"] }, { kind: "directive", type: 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: "component", type: ListItemActionComponent, selector: "c8y-list-item-action, c8y-li-action", inputs: ["label", "icon", "disabled"], outputs: ["click"] }, { kind: "component", type: ListItemCollapseComponent, selector: "c8y-list-item-collapse, c8y-li-collapse", inputs: ["collapseWay"] }, { kind: "directive", type: C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "component", type: TypeaheadComponent, selector: "c8y-typeahead", inputs: ["required", "maxlength", "disabled", "allowFreeEntries", "placeholder", "displayProperty", "icon", "name", "autoClose", "hideNew", "container", "selected", "title", "highlightFirstItem"], outputs: ["onSearch", "onIconClick"] }, { kind: "directive", type: ForOfDirective, selector: "[c8yFor]", inputs: ["c8yForOf", "c8yForLoadMore", "c8yForPipe", "c8yForNotFound", "c8yForMaxIterations", "c8yForLoadingTemplate", "c8yForLoadNextLabel", "c8yForLoadingLabel", "c8yForRealtime", "c8yForRealtimeOptions", "c8yForComparator", "c8yForEnableVirtualScroll", "c8yForVirtualScrollElementSize", "c8yForVirtualScrollStrategy", "c8yForVirtualScrollContainerHeight"], outputs: ["c8yForCount", "c8yForChange", "c8yForLoadMoreComponent"] }, { kind: "component", type: ListItemIconComponent, selector: "c8y-list-item-icon, c8y-li-icon", inputs: ["icon", "status"] }, { kind: "component", type: DatapointTemplatePopoverComponent, selector: "c8y-datapoint-template-popover", inputs: ["datapoint", "attributes"] }, { kind: "component", type: DatapointAttributesFormComponent, selector: "c8y-datapoint-attributes-form", inputs: ["selectableChartRenderTypes", "selectableChartLineTypes", "selectableAxisTypes", "showTarget", "showRange", "showYellowRange", "showRedRange", "showChart", "showFormIfTemplateWasSelected", "showAdvancedChartOptions", "showErrorsImmediately"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: AsyncPipe, name: "async" }] }); }
|
|
861
|
+
], queries: [{ propertyName: "dragHandle", first: true, predicate: ListItemDragHandleComponent, descendants: true }], ngImport: i0, template: "<c8y-li\n class=\"c8y-list__item__collapse--container-small\"\n [formGroup]=\"formGroup\"\n #li\n>\n <c8y-li-drag-handle><ng-content select=\"c8y-li-drag-handle\"></ng-content></c8y-li-drag-handle>\n @if (showActiveToggle) {\n <c8y-li-checkbox\n class=\"a-s-center p-r-0\"\n [displayAsSwitch]=\"true\"\n formControlName=\"__active\"\n (click)=\"$event.stopPropagation()\"\n ></c8y-li-checkbox>\n }\n\n <div class=\"d-flex a-i-center\">\n <div\n class=\"c8y-list__item__colorpicker p-t-0 p-b-0 p-l-16\"\n [title]=\"'Change color' | translate\"\n >\n <div class=\"c8y-colorpicker\">\n <input\n [attr.aria-label]=\"'Color' | translate\"\n type=\"color\"\n formControlName=\"color\"\n (click)=\"$event.stopPropagation()\"\n />\n <span [style.background-color]=\"formGroup.value.color\"></span>\n </div>\n </div>\n <button\n class=\"btn-clean data-point-label text-truncate\"\n [attr.aria-expanded]=\"!li.collapsed\"\n type=\"button\"\n (click)=\"li.collapsed = !li.collapsed\"\n >\n <span\n class=\"text-truncate\"\n [title]=\"formGroup.value.details?.label | datapointLabel\"\n >\n <c8y-highlight\n [text]=\"formGroup.value.details?.label | datapointLabel\"\n [pattern]=\"highlightText\"\n [shouldTrimPattern]=\"true\"\n ></c8y-highlight>\n </span>\n @if (formGroup.value.__target) {\n <small class=\"text-truncate text-muted icon-flex\">\n <i c8yIcon=\"exchange\"></i>\n <span class=\"text-truncate\">{{ formGroup.value.__target.name }}</span>\n </small>\n }\n </button>\n\n @if (!(isValid$ | async)) {\n <button\n class=\"btn btn-dot btn-dot--danger m-l-auto\"\n [attr.aria-label]=\"'Invalid' | translate\"\n [popover]=\"\n errorMessage\n ? errorMessage\n : ('Some entries are invalid. Check the input fields with red borders.' | translate)\n \"\n placement=\"left\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n >\n <i c8yIcon=\"warning\"></i>\n </button>\n }\n @if (addButtonType === AddButtonTypes.addRemove) {\n <div class=\"m-l-auto a-s-center p-r-4\">\n @if (isSelected) {\n <button\n class=\"btn btn-dot btn-dot--danger\"\n [attr.aria-label]=\"'Remove' | translate\"\n [tooltip]=\"'Remove from selected data points' | translate\"\n type=\"button\"\n [delay]=\"500\"\n (click)=\"addOrRemoveItem()\"\n [attr.data-cy]=\"'datapoint-selector-list-item--remove-datapoint-button'\"\n >\n <i\n class=\"icon-20\"\n c8yIcon=\"minus-circle\"\n ></i>\n </button>\n }\n @if (!isSelected) {\n <button\n class=\"btn btn-dot text-primary\"\n [attr.aria-label]=\"'Add to selected data points' | translate\"\n [tooltip]=\"'Add to selected data points' | translate\"\n type=\"button\"\n [delay]=\"500\"\n [disabled]=\"!(isValid$ | async)\"\n (click)=\"addOrRemoveItem()\"\n [attr.data-cy]=\"'datapoint-selector-list-item--add-datapoint-button'\"\n >\n <i\n class=\"text-primary icon-20\"\n c8yIcon=\"plus-circle\"\n ></i>\n </button>\n }\n </div>\n }\n @if (addButtonType === AddButtonTypes.select) {\n <button\n class=\"btn btn-default btn-sm m-l-auto\"\n [attr.aria-label]=\"'Select' | translate\"\n [tooltip]=\"'Select data point' | translate\"\n type=\"button\"\n [delay]=\"500\"\n (click)=\"addOrRemoveItem()\"\n >\n {{ 'Select' | translate }}\n </button>\n }\n </div>\n\n @if (optionToRemove) {\n <c8y-li-action\n [icon]=\"'minus-circle'\"\n [label]=\"'Remove from list' | translate\"\n (click)=\"remove()\"\n ></c8y-li-action>\n }\n @for (action of actions; track action) {\n <c8y-li-action\n [icon]=\"action.icon\"\n [label]=\"action.label\"\n (click)=\"action.callback(formGroup.value)\"\n ></c8y-li-action>\n }\n @if (editable) {\n <c8y-li-collapse>\n <div class=\"data-point-details\">\n <ul class=\"list-unstyled small m-b-16\">\n <li class=\"p-t-4 p-b-4 d-flex separator-top-bottom\">\n <label\n class=\"small m-b-0 m-r-8 a-s-start text-muted\"\n translate\n >\n Fragment\n </label>\n <span\n class=\"m-l-auto text-truncate\"\n title=\"{{ formGroup.value.fragment }}\"\n >\n <c8y-highlight\n [text]=\"formGroup.value.fragment\"\n [pattern]=\"highlightText\"\n [shouldTrimPattern]=\"true\"\n ></c8y-highlight>\n </span>\n </li>\n <li class=\"p-t-4 p-b-4 d-flex separator-bottom\">\n <label\n class=\"small m-b-0 m-r-8 a-s-start text-muted\"\n translate\n >\n Series\n </label>\n <span\n class=\"m-l-auto text-truncate\"\n title=\"{{ formGroup.value.series }}\"\n >\n <c8y-highlight\n [text]=\"formGroup.value.series\"\n [pattern]=\"highlightText\"\n [shouldTrimPattern]=\"true\"\n ></c8y-highlight>\n </span>\n </li>\n </ul>\n @if (datapointLibraryEntries && datapointLibraryEntries | async; as libraryEntries) {\n <div class=\"form-group form-group-sm\">\n <label>\n {{ 'Data point template' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"datapointHintPopoverTemplate\"\n placement=\"top\"\n triggers=\"focus\"\n type=\"button\"\n (click)=\"$event.stopPropagation()\"\n ></button>\n </label>\n\n <ng-template #datapointHintPopoverTemplate>\n {{\n 'Using a data point template sets color, label, unit and ranges. Removing the template allows you to set the values manually.'\n | translate\n }}\n </ng-template>\n <div class=\"input-group input-group-sm\">\n @if (datapointLibraryEntries) {\n <c8y-typeahead\n class=\"flex-grow\"\n [placeholder]=\"'No template' | translate\"\n [ngModel]=\"templateForTypeahead\"\n [ngModelOptions]=\"{ standalone: true }\"\n (onSearch)=\"setPipe($event)\"\n [displayProperty]=\"'translatedLabel'\"\n [hideNew]=\"true\"\n [disabled]=\"isSelected && disableTypeaheadIfSelected\"\n >\n <c8y-li\n class=\"p-l-8 p-r-8 c8y-list__item--link interact\"\n *c8yFor=\"\n let item of datapointLibraryEntries;\n loadMore: 'auto';\n pipe: filterPipe;\n notFound: notFoundTemplate\n \"\n (click)=\"dataPointTemplateSelected(item)\"\n [active]=\"formGroup.value.__template === item.id\"\n [attr.role]=\"'menuitem'\"\n >\n <c8y-highlight\n [text]=\"item.c8y_Kpi | datapointLabel\"\n [pattern]=\"pattern\"\n ></c8y-highlight>\n <c8y-li-icon\n icon=\"circle\"\n [style.color]=\"item.c8y_Kpi?.color\"\n ></c8y-li-icon>\n </c8y-li>\n <ng-template #notFoundTemplate>\n @if (pattern.length > 0) {\n <c8y-li class=\"bg-level-2 p-8\">\n <span>No match found.</span>\n </c8y-li>\n }\n </ng-template>\n </c8y-typeahead>\n }\n <div class=\"input-group-btn\">\n @if (formGroup.value.__template) {\n <button\n class=\"btn btn-default\"\n [attr.aria-label]=\"'Info' | translate\"\n [popover]=\"datapointOverviewPopoverTemplate\"\n placement=\"left\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n >\n <i\n class=\"text-info\"\n c8yIcon=\"info\"\n ></i>\n </button>\n }\n </div>\n <div class=\"input-group-btn\">\n @if (formGroup.value.__template && hasUnlinkTemplateOption) {\n <button\n class=\"btn btn-default\"\n [attr.aria-label]=\"'Unlink data point template' | translate\"\n tooltip=\"{{ 'Unlink data point template' | translate }}\"\n placement=\"left\"\n container=\"body\"\n type=\"button\"\n [delay]=\"500\"\n [adaptivePosition]=\"false\"\n (click)=\"unlinkDatapointTemplate()\"\n >\n <i c8yIcon=\"unlink\"></i>\n </button>\n }\n </div>\n </div>\n </div>\n }\n <ng-template #datapointOverviewPopoverTemplate>\n <c8y-datapoint-template-popover\n [datapoint]=\"formGroup.value.details\"\n ></c8y-datapoint-template-popover>\n </ng-template>\n @if (defaultFormOptions) {\n <c8y-datapoint-attributes-form\n [showTarget]=\"defaultFormOptions.showTarget\"\n [showRange]=\"defaultFormOptions.showRange\"\n [showYellowRange]=\"defaultFormOptions.showYellowRange\"\n [showRedRange]=\"defaultFormOptions.showRedRange\"\n [showChart]=\"defaultFormOptions.showChart\"\n [showFormIfTemplateWasSelected]=\"defaultFormOptions.showFormIfTemplateWasSelected\"\n [selectableChartRenderTypes]=\"defaultFormOptions.selectableChartRenderTypes\"\n [selectableChartLineTypes]=\"defaultFormOptions.selectableChartLineTypes\"\n [selectableAxisTypes]=\"defaultFormOptions.selectableAxisTypes\"\n [showAdvancedChartOptions]=\"defaultFormOptions.showAdvancedChartOptions\"\n [showErrorsImmediately]=\"true\"\n formControlName=\"details\"\n ></c8y-datapoint-attributes-form>\n }\n </div>\n </c8y-li-collapse>\n }\n</c8y-li>\n", dependencies: [{ kind: "component", type: ListItemComponent, selector: "c8y-list-item, c8y-li", inputs: ["active", "highlighted", "emptyActions", "dense", "collapsed", "selectable"], outputs: ["collapsedChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.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: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: ListItemDragHandleComponent, selector: "c8y-list-item-drag-handle, c8y-li-drag-handle" }, { kind: "component", type: ListItemCheckboxComponent, selector: "c8y-list-item-checkbox, c8y-li-checkbox", inputs: ["selected", "indeterminate", "disabled", "displayAsSwitch"], outputs: ["onSelect"] }, { kind: "directive", type: RequiredInputPlaceholderDirective, selector: "input[required], input[formControlName]" }, { kind: "component", type: HighlightComponent, selector: "c8y-highlight", inputs: ["pattern", "text", "elementClass", "shouldTrimPattern"] }, { kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: PopoverDirective, selector: "[popover]", inputs: ["adaptivePosition", "boundariesElement", "popover", "popoverContext", "popoverTitle", "placement", "outsideClick", "triggers", "container", "containerClass", "isOpen", "delay"], outputs: ["onShown", "onHidden"], exportAs: ["bs-popover"] }, { kind: "directive", type: 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: "component", type: ListItemActionComponent, selector: "c8y-list-item-action, c8y-li-action", inputs: ["label", "icon", "disabled"], outputs: ["click"] }, { kind: "component", type: ListItemCollapseComponent, selector: "c8y-list-item-collapse, c8y-li-collapse", inputs: ["collapseWay"] }, { kind: "directive", type: C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "component", type: TypeaheadComponent, selector: "c8y-typeahead", inputs: ["required", "maxlength", "disabled", "allowFreeEntries", "placeholder", "displayProperty", "icon", "name", "autoClose", "hideNew", "container", "selected", "title", "highlightFirstItem"], outputs: ["onSearch", "onIconClick"] }, { kind: "directive", type: ForOfDirective, selector: "[c8yFor]", inputs: ["c8yForOf", "c8yForLoadMore", "c8yForPipe", "c8yForNotFound", "c8yForMaxIterations", "c8yForLoadingTemplate", "c8yForLoadNextLabel", "c8yForLoadingLabel", "c8yForRealtime", "c8yForRealtimeOptions", "c8yForComparator", "c8yForEnableVirtualScroll", "c8yForVirtualScrollElementSize", "c8yForVirtualScrollStrategy", "c8yForVirtualScrollContainerHeight"], outputs: ["c8yForCount", "c8yForChange", "c8yForLoadMoreComponent"] }, { kind: "component", type: ListItemIconComponent, selector: "c8y-list-item-icon, c8y-li-icon", inputs: ["icon", "status"] }, { kind: "component", type: DatapointTemplatePopoverComponent, selector: "c8y-datapoint-template-popover", inputs: ["datapoint", "attributes"] }, { kind: "component", type: DatapointAttributesFormComponent, selector: "c8y-datapoint-attributes-form", inputs: ["selectableChartRenderTypes", "selectableChartLineTypes", "selectableAxisTypes", "showTarget", "showRange", "showYellowRange", "showRedRange", "showChart", "showFormIfTemplateWasSelected", "showAdvancedChartOptions", "showErrorsImmediately"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: DatapointLabelPipe, name: "datapointLabel" }] }); }
|
|
813
862
|
}
|
|
814
863
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: DatapointSelectorListItemComponent, decorators: [{
|
|
815
864
|
type: Component,
|
|
@@ -844,9 +893,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
844
893
|
DatapointTemplatePopoverComponent,
|
|
845
894
|
DatapointAttributesFormComponent,
|
|
846
895
|
C8yTranslatePipe,
|
|
847
|
-
AsyncPipe
|
|
848
|
-
], template: "<c8y-li\n class=\"c8y-list__item__collapse--container-small\"\n [formGroup]=\"formGroup\"\n #li\n>\n <c8y-li-drag-handle><ng-content select=\"c8y-li-drag-handle\"></ng-content></c8y-li-drag-handle>\n @if (showActiveToggle) {\n <c8y-li-checkbox\n class=\"a-s-center p-r-0\"\n [displayAsSwitch]=\"true\"\n formControlName=\"__active\"\n (click)=\"$event.stopPropagation()\"\n ></c8y-li-checkbox>\n }\n\n <div class=\"d-flex a-i-center\">\n <div\n class=\"c8y-list__item__colorpicker p-t-0 p-b-0 p-l-16\"\n [title]=\"'Change color' | translate\"\n >\n <div class=\"c8y-colorpicker\">\n <input\n [attr.aria-label]=\"'Color' | translate\"\n type=\"color\"\n formControlName=\"color\"\n (click)=\"$event.stopPropagation()\"\n />\n <span [style.background-color]=\"formGroup.value.color\"></span>\n </div>\n </div>\n <button\n class=\"btn-clean data-point-label text-truncate\"\n [attr.aria-expanded]=\"!li.collapsed\"\n type=\"button\"\n (click)=\"li.collapsed = !li.collapsed\"\n >\n <span\n class=\"text-truncate\"\n [title]=\"formGroup.value.details?.label\"\n >\n <c8y-highlight\n [text]=\"formGroup.value.details?.label\"\n [pattern]=\"highlightText\"\n [shouldTrimPattern]=\"true\"\n ></c8y-highlight>\n </span>\n @if (formGroup.value.__target) {\n <small class=\"text-truncate text-muted icon-flex\">\n <i c8yIcon=\"exchange\"></i>\n <span class=\"text-truncate\">{{ formGroup.value.__target.name }}</span>\n </small>\n }\n </button>\n\n @if (!(isValid$ | async)) {\n <button\n class=\"btn btn-dot btn-dot--danger m-l-auto\"\n [attr.aria-label]=\"'Invalid' | translate\"\n [popover]=\"\n errorMessage\n ? errorMessage\n : ('Some entries are invalid. Check the input fields with red borders.' | translate)\n \"\n placement=\"left\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n >\n <i c8yIcon=\"warning\"></i>\n </button>\n }\n @if (addButtonType === AddButtonTypes.addRemove) {\n <div class=\"m-l-auto a-s-center p-r-4\">\n @if (isSelected) {\n <button\n class=\"btn btn-dot btn-dot--danger\"\n [attr.aria-label]=\"'Remove' | translate\"\n [tooltip]=\"'Remove from selected data points' | translate\"\n type=\"button\"\n [delay]=\"500\"\n (click)=\"addOrRemoveItem()\"\n [attr.data-cy]=\"'datapoint-selector-list-item--remove-datapoint-button'\"\n >\n <i\n class=\"icon-20\"\n c8yIcon=\"minus-circle\"\n ></i>\n </button>\n }\n @if (!isSelected) {\n <button\n class=\"btn btn-dot text-primary\"\n [attr.aria-label]=\"'Add to selected data points' | translate\"\n [tooltip]=\"'Add to selected data points' | translate\"\n type=\"button\"\n [delay]=\"500\"\n [disabled]=\"!(isValid$ | async)\"\n (click)=\"addOrRemoveItem()\"\n [attr.data-cy]=\"'datapoint-selector-list-item--add-datapoint-button'\"\n >\n <i\n class=\"text-primary icon-20\"\n c8yIcon=\"plus-circle\"\n ></i>\n </button>\n }\n </div>\n }\n @if (addButtonType === AddButtonTypes.select) {\n <button\n class=\"btn btn-default btn-sm m-l-auto\"\n [attr.aria-label]=\"'Select' | translate\"\n [tooltip]=\"'Select data point' | translate\"\n type=\"button\"\n [delay]=\"500\"\n (click)=\"addOrRemoveItem()\"\n >\n {{ 'Select' | translate }}\n </button>\n }\n </div>\n\n @if (optionToRemove) {\n <c8y-li-action\n [icon]=\"'minus-circle'\"\n [label]=\"'Remove from list' | translate\"\n (click)=\"remove()\"\n ></c8y-li-action>\n }\n @for (action of actions; track action) {\n <c8y-li-action\n [icon]=\"action.icon\"\n [label]=\"action.label\"\n (click)=\"action.callback(formGroup.value)\"\n ></c8y-li-action>\n }\n @if (editable) {\n <c8y-li-collapse>\n <div class=\"data-point-details\">\n <ul class=\"list-unstyled small m-b-16\">\n <li class=\"p-t-4 p-b-4 d-flex separator-top-bottom\">\n <label\n class=\"small m-b-0 m-r-8 a-s-start text-muted\"\n translate\n >\n Fragment\n </label>\n <span\n class=\"m-l-auto text-truncate\"\n title=\"{{ formGroup.value.fragment }}\"\n >\n <c8y-highlight\n [text]=\"formGroup.value.fragment\"\n [pattern]=\"highlightText\"\n [shouldTrimPattern]=\"true\"\n ></c8y-highlight>\n </span>\n </li>\n <li class=\"p-t-4 p-b-4 d-flex separator-bottom\">\n <label\n class=\"small m-b-0 m-r-8 a-s-start text-muted\"\n translate\n >\n Series\n </label>\n <span\n class=\"m-l-auto text-truncate\"\n title=\"{{ formGroup.value.series }}\"\n >\n <c8y-highlight\n [text]=\"formGroup.value.series\"\n [pattern]=\"highlightText\"\n [shouldTrimPattern]=\"true\"\n ></c8y-highlight>\n </span>\n </li>\n </ul>\n @if (datapointLibraryEntries && datapointLibraryEntries | async; as libraryEntries) {\n <div class=\"form-group form-group-sm\">\n <label>\n {{ 'Data point template' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"datapointHintPopoverTemplate\"\n placement=\"top\"\n triggers=\"focus\"\n type=\"button\"\n (click)=\"$event.stopPropagation()\"\n ></button>\n </label>\n\n <ng-template #datapointHintPopoverTemplate>\n {{\n 'Using a data point template sets color, label, unit and ranges. Removing the template allows you to set the values manually.'\n | translate\n }}\n </ng-template>\n <div class=\"input-group input-group-sm\">\n @if (datapointLibraryEntries) {\n <c8y-typeahead\n class=\"flex-grow\"\n [placeholder]=\"'No template' | translate\"\n [ngModel]=\"formGroup.value.__template ? formGroup.value.details : undefined\"\n [ngModelOptions]=\"{ standalone: true }\"\n (onSearch)=\"setPipe($event)\"\n [displayProperty]=\"'label'\"\n [hideNew]=\"true\"\n [disabled]=\"isSelected && disableTypeaheadIfSelected\"\n >\n <c8y-li\n class=\"p-l-8 p-r-8 c8y-list__item--link interact\"\n *c8yFor=\"\n let item of datapointLibraryEntries;\n loadMore: 'auto';\n pipe: filterPipe;\n notFound: notFoundTemplate\n \"\n (click)=\"dataPointTemplateSelected(item)\"\n [active]=\"formGroup.value.__template === item.id\"\n [attr.role]=\"'menuitem'\"\n >\n <c8y-highlight\n [text]=\"item.c8y_Kpi?.label\"\n [pattern]=\"pattern\"\n ></c8y-highlight>\n <c8y-li-icon\n icon=\"circle\"\n [style.color]=\"item.c8y_Kpi?.color\"\n ></c8y-li-icon>\n </c8y-li>\n <ng-template #notFoundTemplate>\n @if (pattern.length > 0) {\n <c8y-li class=\"bg-level-2 p-8\">\n <span>No match found.</span>\n </c8y-li>\n }\n </ng-template>\n </c8y-typeahead>\n }\n <div class=\"input-group-btn\">\n @if (formGroup.value.__template) {\n <button\n class=\"btn btn-default\"\n [attr.aria-label]=\"'Info' | translate\"\n [popover]=\"datapointOverviewPopoverTemplate\"\n placement=\"left\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n >\n <i\n class=\"text-info\"\n c8yIcon=\"info\"\n ></i>\n </button>\n }\n </div>\n <div class=\"input-group-btn\">\n @if (formGroup.value.__template && hasUnlinkTemplateOption) {\n <button\n class=\"btn btn-default\"\n [attr.aria-label]=\"'Unlink data point template' | translate\"\n tooltip=\"{{ 'Unlink data point template' | translate }}\"\n placement=\"left\"\n container=\"body\"\n type=\"button\"\n [delay]=\"500\"\n [adaptivePosition]=\"false\"\n (click)=\"unlinkDatapointTemplate()\"\n >\n <i c8yIcon=\"unlink\"></i>\n </button>\n }\n </div>\n </div>\n </div>\n }\n <ng-template #datapointOverviewPopoverTemplate>\n <c8y-datapoint-template-popover\n [datapoint]=\"formGroup.value.details\"\n ></c8y-datapoint-template-popover>\n </ng-template>\n @if (defaultFormOptions) {\n <c8y-datapoint-attributes-form\n [showTarget]=\"defaultFormOptions.showTarget\"\n [showRange]=\"defaultFormOptions.showRange\"\n [showYellowRange]=\"defaultFormOptions.showYellowRange\"\n [showRedRange]=\"defaultFormOptions.showRedRange\"\n [showChart]=\"defaultFormOptions.showChart\"\n [showFormIfTemplateWasSelected]=\"defaultFormOptions.showFormIfTemplateWasSelected\"\n [selectableChartRenderTypes]=\"defaultFormOptions.selectableChartRenderTypes\"\n [selectableChartLineTypes]=\"defaultFormOptions.selectableChartLineTypes\"\n [selectableAxisTypes]=\"defaultFormOptions.selectableAxisTypes\"\n [showAdvancedChartOptions]=\"defaultFormOptions.showAdvancedChartOptions\"\n [showErrorsImmediately]=\"true\"\n formControlName=\"details\"\n ></c8y-datapoint-attributes-form>\n }\n </div>\n </c8y-li-collapse>\n }\n</c8y-li>\n" }]
|
|
849
|
-
}], ctorParameters: () => [{ type: i2.FormBuilder }], propDecorators: { defaultFormOptions: [{
|
|
896
|
+
AsyncPipe,
|
|
897
|
+
DatapointLabelPipe
|
|
898
|
+
], template: "<c8y-li\n class=\"c8y-list__item__collapse--container-small\"\n [formGroup]=\"formGroup\"\n #li\n>\n <c8y-li-drag-handle><ng-content select=\"c8y-li-drag-handle\"></ng-content></c8y-li-drag-handle>\n @if (showActiveToggle) {\n <c8y-li-checkbox\n class=\"a-s-center p-r-0\"\n [displayAsSwitch]=\"true\"\n formControlName=\"__active\"\n (click)=\"$event.stopPropagation()\"\n ></c8y-li-checkbox>\n }\n\n <div class=\"d-flex a-i-center\">\n <div\n class=\"c8y-list__item__colorpicker p-t-0 p-b-0 p-l-16\"\n [title]=\"'Change color' | translate\"\n >\n <div class=\"c8y-colorpicker\">\n <input\n [attr.aria-label]=\"'Color' | translate\"\n type=\"color\"\n formControlName=\"color\"\n (click)=\"$event.stopPropagation()\"\n />\n <span [style.background-color]=\"formGroup.value.color\"></span>\n </div>\n </div>\n <button\n class=\"btn-clean data-point-label text-truncate\"\n [attr.aria-expanded]=\"!li.collapsed\"\n type=\"button\"\n (click)=\"li.collapsed = !li.collapsed\"\n >\n <span\n class=\"text-truncate\"\n [title]=\"formGroup.value.details?.label | datapointLabel\"\n >\n <c8y-highlight\n [text]=\"formGroup.value.details?.label | datapointLabel\"\n [pattern]=\"highlightText\"\n [shouldTrimPattern]=\"true\"\n ></c8y-highlight>\n </span>\n @if (formGroup.value.__target) {\n <small class=\"text-truncate text-muted icon-flex\">\n <i c8yIcon=\"exchange\"></i>\n <span class=\"text-truncate\">{{ formGroup.value.__target.name }}</span>\n </small>\n }\n </button>\n\n @if (!(isValid$ | async)) {\n <button\n class=\"btn btn-dot btn-dot--danger m-l-auto\"\n [attr.aria-label]=\"'Invalid' | translate\"\n [popover]=\"\n errorMessage\n ? errorMessage\n : ('Some entries are invalid. Check the input fields with red borders.' | translate)\n \"\n placement=\"left\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n >\n <i c8yIcon=\"warning\"></i>\n </button>\n }\n @if (addButtonType === AddButtonTypes.addRemove) {\n <div class=\"m-l-auto a-s-center p-r-4\">\n @if (isSelected) {\n <button\n class=\"btn btn-dot btn-dot--danger\"\n [attr.aria-label]=\"'Remove' | translate\"\n [tooltip]=\"'Remove from selected data points' | translate\"\n type=\"button\"\n [delay]=\"500\"\n (click)=\"addOrRemoveItem()\"\n [attr.data-cy]=\"'datapoint-selector-list-item--remove-datapoint-button'\"\n >\n <i\n class=\"icon-20\"\n c8yIcon=\"minus-circle\"\n ></i>\n </button>\n }\n @if (!isSelected) {\n <button\n class=\"btn btn-dot text-primary\"\n [attr.aria-label]=\"'Add to selected data points' | translate\"\n [tooltip]=\"'Add to selected data points' | translate\"\n type=\"button\"\n [delay]=\"500\"\n [disabled]=\"!(isValid$ | async)\"\n (click)=\"addOrRemoveItem()\"\n [attr.data-cy]=\"'datapoint-selector-list-item--add-datapoint-button'\"\n >\n <i\n class=\"text-primary icon-20\"\n c8yIcon=\"plus-circle\"\n ></i>\n </button>\n }\n </div>\n }\n @if (addButtonType === AddButtonTypes.select) {\n <button\n class=\"btn btn-default btn-sm m-l-auto\"\n [attr.aria-label]=\"'Select' | translate\"\n [tooltip]=\"'Select data point' | translate\"\n type=\"button\"\n [delay]=\"500\"\n (click)=\"addOrRemoveItem()\"\n >\n {{ 'Select' | translate }}\n </button>\n }\n </div>\n\n @if (optionToRemove) {\n <c8y-li-action\n [icon]=\"'minus-circle'\"\n [label]=\"'Remove from list' | translate\"\n (click)=\"remove()\"\n ></c8y-li-action>\n }\n @for (action of actions; track action) {\n <c8y-li-action\n [icon]=\"action.icon\"\n [label]=\"action.label\"\n (click)=\"action.callback(formGroup.value)\"\n ></c8y-li-action>\n }\n @if (editable) {\n <c8y-li-collapse>\n <div class=\"data-point-details\">\n <ul class=\"list-unstyled small m-b-16\">\n <li class=\"p-t-4 p-b-4 d-flex separator-top-bottom\">\n <label\n class=\"small m-b-0 m-r-8 a-s-start text-muted\"\n translate\n >\n Fragment\n </label>\n <span\n class=\"m-l-auto text-truncate\"\n title=\"{{ formGroup.value.fragment }}\"\n >\n <c8y-highlight\n [text]=\"formGroup.value.fragment\"\n [pattern]=\"highlightText\"\n [shouldTrimPattern]=\"true\"\n ></c8y-highlight>\n </span>\n </li>\n <li class=\"p-t-4 p-b-4 d-flex separator-bottom\">\n <label\n class=\"small m-b-0 m-r-8 a-s-start text-muted\"\n translate\n >\n Series\n </label>\n <span\n class=\"m-l-auto text-truncate\"\n title=\"{{ formGroup.value.series }}\"\n >\n <c8y-highlight\n [text]=\"formGroup.value.series\"\n [pattern]=\"highlightText\"\n [shouldTrimPattern]=\"true\"\n ></c8y-highlight>\n </span>\n </li>\n </ul>\n @if (datapointLibraryEntries && datapointLibraryEntries | async; as libraryEntries) {\n <div class=\"form-group form-group-sm\">\n <label>\n {{ 'Data point template' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"datapointHintPopoverTemplate\"\n placement=\"top\"\n triggers=\"focus\"\n type=\"button\"\n (click)=\"$event.stopPropagation()\"\n ></button>\n </label>\n\n <ng-template #datapointHintPopoverTemplate>\n {{\n 'Using a data point template sets color, label, unit and ranges. Removing the template allows you to set the values manually.'\n | translate\n }}\n </ng-template>\n <div class=\"input-group input-group-sm\">\n @if (datapointLibraryEntries) {\n <c8y-typeahead\n class=\"flex-grow\"\n [placeholder]=\"'No template' | translate\"\n [ngModel]=\"templateForTypeahead\"\n [ngModelOptions]=\"{ standalone: true }\"\n (onSearch)=\"setPipe($event)\"\n [displayProperty]=\"'translatedLabel'\"\n [hideNew]=\"true\"\n [disabled]=\"isSelected && disableTypeaheadIfSelected\"\n >\n <c8y-li\n class=\"p-l-8 p-r-8 c8y-list__item--link interact\"\n *c8yFor=\"\n let item of datapointLibraryEntries;\n loadMore: 'auto';\n pipe: filterPipe;\n notFound: notFoundTemplate\n \"\n (click)=\"dataPointTemplateSelected(item)\"\n [active]=\"formGroup.value.__template === item.id\"\n [attr.role]=\"'menuitem'\"\n >\n <c8y-highlight\n [text]=\"item.c8y_Kpi | datapointLabel\"\n [pattern]=\"pattern\"\n ></c8y-highlight>\n <c8y-li-icon\n icon=\"circle\"\n [style.color]=\"item.c8y_Kpi?.color\"\n ></c8y-li-icon>\n </c8y-li>\n <ng-template #notFoundTemplate>\n @if (pattern.length > 0) {\n <c8y-li class=\"bg-level-2 p-8\">\n <span>No match found.</span>\n </c8y-li>\n }\n </ng-template>\n </c8y-typeahead>\n }\n <div class=\"input-group-btn\">\n @if (formGroup.value.__template) {\n <button\n class=\"btn btn-default\"\n [attr.aria-label]=\"'Info' | translate\"\n [popover]=\"datapointOverviewPopoverTemplate\"\n placement=\"left\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n >\n <i\n class=\"text-info\"\n c8yIcon=\"info\"\n ></i>\n </button>\n }\n </div>\n <div class=\"input-group-btn\">\n @if (formGroup.value.__template && hasUnlinkTemplateOption) {\n <button\n class=\"btn btn-default\"\n [attr.aria-label]=\"'Unlink data point template' | translate\"\n tooltip=\"{{ 'Unlink data point template' | translate }}\"\n placement=\"left\"\n container=\"body\"\n type=\"button\"\n [delay]=\"500\"\n [adaptivePosition]=\"false\"\n (click)=\"unlinkDatapointTemplate()\"\n >\n <i c8yIcon=\"unlink\"></i>\n </button>\n }\n </div>\n </div>\n </div>\n }\n <ng-template #datapointOverviewPopoverTemplate>\n <c8y-datapoint-template-popover\n [datapoint]=\"formGroup.value.details\"\n ></c8y-datapoint-template-popover>\n </ng-template>\n @if (defaultFormOptions) {\n <c8y-datapoint-attributes-form\n [showTarget]=\"defaultFormOptions.showTarget\"\n [showRange]=\"defaultFormOptions.showRange\"\n [showYellowRange]=\"defaultFormOptions.showYellowRange\"\n [showRedRange]=\"defaultFormOptions.showRedRange\"\n [showChart]=\"defaultFormOptions.showChart\"\n [showFormIfTemplateWasSelected]=\"defaultFormOptions.showFormIfTemplateWasSelected\"\n [selectableChartRenderTypes]=\"defaultFormOptions.selectableChartRenderTypes\"\n [selectableChartLineTypes]=\"defaultFormOptions.selectableChartLineTypes\"\n [selectableAxisTypes]=\"defaultFormOptions.selectableAxisTypes\"\n [showAdvancedChartOptions]=\"defaultFormOptions.showAdvancedChartOptions\"\n [showErrorsImmediately]=\"true\"\n formControlName=\"details\"\n ></c8y-datapoint-attributes-form>\n }\n </div>\n </c8y-li-collapse>\n }\n</c8y-li>\n" }]
|
|
899
|
+
}], ctorParameters: () => [{ type: i2.FormBuilder }, { type: i2$2.TranslateService }], propDecorators: { defaultFormOptions: [{
|
|
850
900
|
type: Input
|
|
851
901
|
}], isSelected: [{
|
|
852
902
|
type: Input
|
|
@@ -902,33 +952,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
902
952
|
args: [{ name: 'includesDatapoint' }]
|
|
903
953
|
}] });
|
|
904
954
|
|
|
905
|
-
class DatapointLabelPipe {
|
|
906
|
-
transform(datapoint, options = { includeDevice: false, doNotUseLabel: false }) {
|
|
907
|
-
let label = '';
|
|
908
|
-
try {
|
|
909
|
-
if (!options?.doNotUseLabel && datapoint.label) {
|
|
910
|
-
label = datapoint.label;
|
|
911
|
-
}
|
|
912
|
-
else {
|
|
913
|
-
label = `${datapoint.fragment} → ${datapoint.series}`;
|
|
914
|
-
}
|
|
915
|
-
if (options?.includeDevice && (datapoint.__target?.name || datapoint.__target?.id)) {
|
|
916
|
-
label += ` (${datapoint.__target?.name || datapoint.__target?.id})`;
|
|
917
|
-
}
|
|
918
|
-
}
|
|
919
|
-
catch (e) {
|
|
920
|
-
// nothing to do
|
|
921
|
-
}
|
|
922
|
-
return label;
|
|
923
|
-
}
|
|
924
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: DatapointLabelPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
925
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.25", ngImport: i0, type: DatapointLabelPipe, isStandalone: true, name: "datapointLabel" }); }
|
|
926
|
-
}
|
|
927
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: DatapointLabelPipe, decorators: [{
|
|
928
|
-
type: Pipe,
|
|
929
|
-
args: [{ name: 'datapointLabel' }]
|
|
930
|
-
}] });
|
|
931
|
-
|
|
932
955
|
class DatapointSelectorComponent {
|
|
933
956
|
constructor(datapointService) {
|
|
934
957
|
this.datapointService = datapointService;
|
|
@@ -1428,6 +1451,7 @@ class DatapointSelectorModule {
|
|
|
1428
1451
|
DatapointTemplatePopoverComponent,
|
|
1429
1452
|
IncludesDatapointPipe,
|
|
1430
1453
|
DatapointLabelPipe,
|
|
1454
|
+
DatapointDescriptionPipe,
|
|
1431
1455
|
FilterDatapointsPipe,
|
|
1432
1456
|
DatapointAttributesFormComponent], exports: [DatapointSelectorComponent,
|
|
1433
1457
|
DatapointSelectorModalComponent,
|
|
@@ -1436,6 +1460,7 @@ class DatapointSelectorModule {
|
|
|
1436
1460
|
DatapointTemplatePopoverComponent,
|
|
1437
1461
|
IncludesDatapointPipe,
|
|
1438
1462
|
DatapointLabelPipe,
|
|
1463
|
+
DatapointDescriptionPipe,
|
|
1439
1464
|
DatapointAttributesFormComponent] }); }
|
|
1440
1465
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: DatapointSelectorModule, imports: [AssetSelectorModule,
|
|
1441
1466
|
CollapseModule,
|
|
@@ -1470,6 +1495,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
1470
1495
|
DatapointTemplatePopoverComponent,
|
|
1471
1496
|
IncludesDatapointPipe,
|
|
1472
1497
|
DatapointLabelPipe,
|
|
1498
|
+
DatapointDescriptionPipe,
|
|
1473
1499
|
FilterDatapointsPipe,
|
|
1474
1500
|
DatapointAttributesFormComponent
|
|
1475
1501
|
],
|
|
@@ -1481,6 +1507,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
1481
1507
|
DatapointTemplatePopoverComponent,
|
|
1482
1508
|
IncludesDatapointPipe,
|
|
1483
1509
|
DatapointLabelPipe,
|
|
1510
|
+
DatapointDescriptionPipe,
|
|
1484
1511
|
DatapointAttributesFormComponent
|
|
1485
1512
|
]
|
|
1486
1513
|
}]
|