@c8y/ngx-components 1023.10.1 → 1023.14.2
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/context-dashboard/index.d.ts +11 -2
- package/context-dashboard/index.d.ts.map +1 -1
- package/datapoint-explorer/index.d.ts +78 -1
- package/datapoint-explorer/index.d.ts.map +1 -1
- package/datapoint-explorer/view/index.d.ts +150 -14
- package/datapoint-explorer/view/index.d.ts.map +1 -1
- package/echart/index.d.ts +12 -2
- package/echart/index.d.ts.map +1 -1
- package/echart/models/index.d.ts +12 -2
- package/echart/models/index.d.ts.map +1 -1
- package/fesm2022/c8y-ngx-components-alarms.mjs +2 -2
- package/fesm2022/c8y-ngx-components-alarms.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-context-dashboard.mjs +17 -5
- package/fesm2022/c8y-ngx-components-context-dashboard.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs +388 -64
- package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-datapoint-explorer.mjs +329 -4
- package/fesm2022/c8y-ngx-components-datapoint-explorer.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-echart-models.mjs +6 -1
- package/fesm2022/c8y-ngx-components-echart-models.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-echart.mjs +6 -1
- package/fesm2022/c8y-ngx-components-echart.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-global-context.mjs +1093 -40
- package/fesm2022/c8y-ngx-components-global-context.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-alarms-alarm-list.mjs +3 -4
- package/fesm2022/c8y-ngx-components-widgets-definitions-alarms-alarm-list.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-alarms.mjs +86 -99
- package/fesm2022/c8y-ngx-components-widgets-implementations-alarms.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs +129 -17
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-info-gauge.mjs +4 -4
- package/fesm2022/c8y-ngx-components-widgets-implementations-info-gauge.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components.mjs +16037 -15943
- package/fesm2022/c8y-ngx-components.mjs.map +1 -1
- package/global-context/index.d.ts +180 -4
- package/global-context/index.d.ts.map +1 -1
- package/index.d.ts +10754 -10654
- package/index.d.ts.map +1 -1
- package/locales/de.po +26 -11
- package/locales/es.po +25 -10
- package/locales/fr.po +25 -10
- package/locales/ja_JP.po +22 -7
- package/locales/ko.po +24 -11
- package/locales/locales.pot +23 -8
- package/locales/nl.po +26 -10
- package/locales/pl.po +25 -10
- package/locales/pt_BR.po +25 -10
- package/locales/zh_CN.po +24 -9
- package/locales/zh_TW.po +26 -10
- package/package.json +1 -1
- package/widgets/definitions/alarms/alarm-list/index.d.ts +1 -2
- package/widgets/definitions/alarms/alarm-list/index.d.ts.map +1 -1
- package/widgets/implementations/alarms/index.d.ts +35 -28
- package/widgets/implementations/alarms/index.d.ts.map +1 -1
- package/widgets/implementations/datapoints-graph/index.d.ts +19 -5
- package/widgets/implementations/datapoints-graph/index.d.ts.map +1 -1
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { gettext } from '@c8y/ngx-components/gettext';
|
|
2
2
|
import { aggregationType } from '@c8y/client';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { computed, signal, Injectable, inject, input, forwardRef, ChangeDetectionStrategy, Component, DestroyRef, output, Input, ViewChild, EventEmitter, viewChild, effect,
|
|
4
|
+
import { computed, signal, Injectable, inject, input, forwardRef, ChangeDetectionStrategy, Component, DestroyRef, output, Input, ChangeDetectorRef, ViewChild, EventEmitter, viewChild, effect, HostListener, Output, TemplateRef, untracked, ContentChild, NgModule } from '@angular/core';
|
|
5
5
|
import * as i4 from '@c8y/ngx-components';
|
|
6
6
|
import { ViewContext, I18nModule, IconDirective, FormGroupComponent, MessagesComponent, MessageDirective, DateTimePickerModule, C8yTranslatePipe, DatePipe, TabsOutletComponent, FormsModule as FormsModule$1, CountdownIntervalModule, CountdownIntervalComponent, AlertService, ContextRouteService, DashboardChildComponent, hookActionBar } from '@c8y/ngx-components';
|
|
7
|
-
import { BehaviorSubject, map, distinctUntilChanged, shareReplay, fromEvent, filter, debounceTime, startWith, tap as tap$1, firstValueFrom, combineLatest, Subject, take, skip, throttleTime } from 'rxjs';
|
|
8
|
-
import * as i1
|
|
7
|
+
import { BehaviorSubject, map, distinctUntilChanged, shareReplay, fromEvent, filter, debounceTime, startWith, tap as tap$1, firstValueFrom, combineLatest, Subject, take, skip, throttleTime, merge as merge$1, EMPTY } from 'rxjs';
|
|
8
|
+
import * as i1 from '@angular/forms';
|
|
9
9
|
import { FormBuilder, FormsModule, NG_VALUE_ACCESSOR, ReactiveFormsModule, FormControl } from '@angular/forms';
|
|
10
10
|
import { pick, omit, isObject, isEqual, transform, some, cloneDeep, merge, isEmpty } from 'lodash-es';
|
|
11
11
|
import { ActivatedRoute, Router, NavigationStart, NavigationEnd, ActivationEnd } from '@angular/router';
|
|
12
|
-
import * as i1$
|
|
12
|
+
import * as i1$1 from '@angular/common';
|
|
13
13
|
import { NgClass, CommonModule, AsyncPipe, TitleCasePipe, Location, NgTemplateOutlet } from '@angular/common';
|
|
14
14
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
15
15
|
import { ContextDashboardStateService } from '@c8y/ngx-components/context-dashboard-state';
|
|
16
|
-
import * as
|
|
16
|
+
import * as i2 from 'ngx-bootstrap/tooltip';
|
|
17
17
|
import { TooltipModule } from 'ngx-bootstrap/tooltip';
|
|
18
|
-
import * as i1$
|
|
18
|
+
import * as i1$2 from 'ngx-bootstrap/collapse';
|
|
19
19
|
import { CollapseModule } from 'ngx-bootstrap/collapse';
|
|
20
|
-
import * as i2$
|
|
20
|
+
import * as i2$2 from 'ngx-bootstrap/popover';
|
|
21
21
|
import { PopoverModule } from 'ngx-bootstrap/popover';
|
|
22
|
-
import * as i2 from 'ngx-bootstrap/dropdown';
|
|
22
|
+
import * as i2$1 from 'ngx-bootstrap/dropdown';
|
|
23
23
|
import { BsDropdownModule, BsDropdownDirective } from 'ngx-bootstrap/dropdown';
|
|
24
24
|
import { A11yModule } from '@angular/cdk/a11y';
|
|
25
|
-
import { withLatestFrom, filter as filter$1, tap, distinctUntilChanged as distinctUntilChanged$1, map as map$1 } from 'rxjs/operators';
|
|
25
|
+
import { withLatestFrom, filter as filter$1, tap, distinctUntilChanged as distinctUntilChanged$1, map as map$1, catchError } from 'rxjs/operators';
|
|
26
26
|
import { TranslateService } from '@ngx-translate/core';
|
|
27
27
|
|
|
28
28
|
const GLOBAL_CONTEXT_EVENTS = {
|
|
@@ -62,7 +62,6 @@ const REFRESH_OPTION = {
|
|
|
62
62
|
LIVE: 'live',
|
|
63
63
|
HISTORY: 'history'
|
|
64
64
|
};
|
|
65
|
-
const DEFAULT_INTERVAL_VALUES = [5_000, 10_000, 15_000, 30_000, 60_000];
|
|
66
65
|
|
|
67
66
|
const todayDate = new Date();
|
|
68
67
|
const TIME_SPAN_MS = {
|
|
@@ -2874,7 +2873,7 @@ class AggregationPickerComponent {
|
|
|
2874
2873
|
useExisting: forwardRef(() => AggregationPickerComponent),
|
|
2875
2874
|
multi: true
|
|
2876
2875
|
}
|
|
2877
|
-
], ngImport: i0, template: "@if (layout() === 'dropdown') {\n <div\n class=\"dropdown\"\n style=\"border: 0; margin-left: -1px\"\n container=\"body\"\n #dropdown=\"bs-dropdown\"\n dropdown\n [attr.data-cy]=\"'global-context--aggregation-picker'\"\n [insideClick]=\"true\"\n [isDisabled]=\"disabled()\"\n >\n <button\n class=\"dropdown-toggle form-control p-t-0 p-b-0 l-h-1 d-flex a-i-center\"\n [attr.aria-label]=\"currentText() | translate\"\n tooltip=\"{{ (disabled() ? AGGREGATION_TEXTS.disabled : currentText()) | translate }}\"\n placement=\"top\"\n container=\"body\"\n [attr.aria-haspopup]=\"'listbox'\"\n [attr.aria-expanded]=\"dropdown.isOpen\"\n type=\"button\"\n [attr.data-cy]=\"'global-context--aggregation-picker-' + value()\"\n [adaptivePosition]=\"false\"\n [delay]=\"500\"\n dropdownToggle\n >\n <i\n class=\"icon-14\"\n [c8yIcon]=\"currentIcon()\"\n ></i>\n <span class=\"caret m-r-8 m-l-4\"></span>\n </button>\n\n <ul\n class=\"dropdown-menu dropdown-menu-right--xs\"\n role=\"listbox\"\n *dropdownMenu\n >\n @for (aggregation of AGGREGATIONS; track aggregation.id || $index) {\n @let isDisabled = aggregation.id ? disabledAggregations()[aggregation.id] : false;\n <li\n [class.active]=\"aggregation.id === value()\"\n [class.disabled]=\"isDisabled\"\n >\n <button\n class=\"\"\n [attr.aria-selected]=\"aggregation.id === value()\"\n role=\"option\"\n (click)=\"selectAggregation(aggregation.id); dropdown.isOpen = false\"\n [disabled]=\"isDisabled\"\n [attr.data-cy]=\"'global-context--aggregation-picker-input-' + aggregation.id\"\n >\n <i\n class=\"icon-14\"\n [c8yIcon]=\"\n aggregation.id ? AGGREGATION_ICONS[aggregation.id] : AGGREGATION_ICONS.undefined\n \"\n ></i>\n <span>{{ aggregation.title | translate }}</span>\n </button>\n </li>\n }\n </ul>\n </div>\n}\n\n@if (layout() === 'radio') {\n <div\n class=\"radio-group d-flex-md a-i-center gap-16\"\n [attr.aria-label]=\"'Aggregation options' | translate\"\n role=\"radiogroup\"\n >\n @for (aggregation of AGGREGATIONS; track aggregation.id || $index) {\n @let isDisabled = aggregation.id ? disabledAggregations()[aggregation.id] : false;\n <label\n class=\"c8y-radio\"\n [attr.data-cy]=\"'global-context--aggregation-picker-input-' + aggregation.id\"\n >\n <input\n name=\"aggregation\"\n role=\"radio\"\n type=\"radio\"\n [value]=\"aggregation.id\"\n [checked]=\"aggregation.id === value()\"\n [disabled]=\"isDisabled\"\n (change)=\"selectAggregation(aggregation.id)\"\n />\n <span></span>\n <i\n class=\"icon-16 m-l-4\"\n [c8yIcon]=\"\n aggregation.id ? AGGREGATION_ICONS[aggregation.id] : AGGREGATION_ICONS.undefined\n \"\n ></i>\n <span>{{ aggregation.title | translate }}</span>\n </label>\n }\n </div>\n}\n", dependencies: [{ kind: "ngmodule", type: TooltipModule }, { kind: "directive", type:
|
|
2876
|
+
], ngImport: i0, template: "@if (layout() === 'dropdown') {\n <div\n class=\"dropdown\"\n style=\"border: 0; margin-left: -1px\"\n container=\"body\"\n #dropdown=\"bs-dropdown\"\n dropdown\n [attr.data-cy]=\"'global-context--aggregation-picker'\"\n [insideClick]=\"true\"\n [isDisabled]=\"disabled()\"\n >\n <button\n class=\"dropdown-toggle form-control p-t-0 p-b-0 l-h-1 d-flex a-i-center\"\n [attr.aria-label]=\"currentText() | translate\"\n tooltip=\"{{ (disabled() ? AGGREGATION_TEXTS.disabled : currentText()) | translate }}\"\n placement=\"top\"\n container=\"body\"\n [attr.aria-haspopup]=\"'listbox'\"\n [attr.aria-expanded]=\"dropdown.isOpen\"\n type=\"button\"\n [attr.data-cy]=\"'global-context--aggregation-picker-' + value()\"\n [adaptivePosition]=\"false\"\n [delay]=\"500\"\n dropdownToggle\n >\n <i\n class=\"icon-14\"\n [c8yIcon]=\"currentIcon()\"\n ></i>\n <span class=\"caret m-r-8 m-l-4\"></span>\n </button>\n\n <ul\n class=\"dropdown-menu dropdown-menu-right--xs\"\n role=\"listbox\"\n *dropdownMenu\n >\n @for (aggregation of AGGREGATIONS; track aggregation.id || $index) {\n @let isDisabled = aggregation.id ? disabledAggregations()[aggregation.id] : false;\n <li\n [class.active]=\"aggregation.id === value()\"\n [class.disabled]=\"isDisabled\"\n >\n <button\n class=\"\"\n [attr.aria-selected]=\"aggregation.id === value()\"\n role=\"option\"\n (click)=\"selectAggregation(aggregation.id); dropdown.isOpen = false\"\n [disabled]=\"isDisabled\"\n [attr.data-cy]=\"'global-context--aggregation-picker-input-' + aggregation.id\"\n >\n <i\n class=\"icon-14\"\n [c8yIcon]=\"\n aggregation.id ? AGGREGATION_ICONS[aggregation.id] : AGGREGATION_ICONS.undefined\n \"\n ></i>\n <span>{{ aggregation.title | translate }}</span>\n </button>\n </li>\n }\n </ul>\n </div>\n}\n\n@if (layout() === 'radio') {\n <div\n class=\"radio-group d-flex-md a-i-center gap-16\"\n [attr.aria-label]=\"'Aggregation options' | translate\"\n role=\"radiogroup\"\n >\n @for (aggregation of AGGREGATIONS; track aggregation.id || $index) {\n @let isDisabled = aggregation.id ? disabledAggregations()[aggregation.id] : false;\n <label\n class=\"c8y-radio\"\n [attr.data-cy]=\"'global-context--aggregation-picker-input-' + aggregation.id\"\n >\n <input\n name=\"aggregation\"\n role=\"radio\"\n type=\"radio\"\n [value]=\"aggregation.id\"\n [checked]=\"aggregation.id === value()\"\n [disabled]=\"isDisabled\"\n (change)=\"selectAggregation(aggregation.id)\"\n />\n <span></span>\n <i\n class=\"icon-16 m-l-4\"\n [c8yIcon]=\"\n aggregation.id ? AGGREGATION_ICONS[aggregation.id] : AGGREGATION_ICONS.undefined\n \"\n ></i>\n <span>{{ aggregation.title | translate }}</span>\n </label>\n }\n </div>\n}\n", dependencies: [{ kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i2.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: BsDropdownModule }, { kind: "directive", type: i2$1.BsDropdownMenuDirective, selector: "[bsDropdownMenu],[dropdownMenu]", exportAs: ["bs-dropdown-menu"] }, { kind: "directive", type: i2$1.BsDropdownToggleDirective, selector: "[bsDropdownToggle],[dropdownToggle]", exportAs: ["bs-dropdown-toggle"] }, { kind: "directive", type: i2$1.BsDropdownDirective, selector: "[bsDropdown], [dropdown]", inputs: ["placement", "triggers", "container", "dropup", "autoClose", "isAnimated", "insideClick", "isDisabled", "isOpen"], outputs: ["isOpenChange", "onShown", "onHidden"], exportAs: ["bs-dropdown"] }, { kind: "ngmodule", type: I18nModule }, { kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "ngmodule", type: FormsModule }, { kind: "pipe", type: i4.C8yTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2878
2877
|
}
|
|
2879
2878
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AggregationPickerComponent, decorators: [{
|
|
2880
2879
|
type: Component,
|
|
@@ -3098,7 +3097,7 @@ class HistoryModeConfigurationControlsComponent {
|
|
|
3098
3097
|
};
|
|
3099
3098
|
}
|
|
3100
3099
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: HistoryModeConfigurationControlsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3101
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: HistoryModeConfigurationControlsComponent, isStandalone: true, selector: "c8y-history-mode-configuration-controls", inputs: { settings: "settings", context: "context" }, outputs: { contextChange: "contextChange", validationStatus: "validationStatus" }, ngImport: i0, template: "@if (currentForm) {\n @let SHOW_TIME_CONTEXT = settings.showTimeContext;\n @let SHOW_AGGREGATION = settings.showAggregation;\n\n <form [formGroup]=\"currentForm\">\n <div class=\"content-flex-100\">\n <div\n class=\"col-4\"\n [ngClass]=\"{ 'm-b-8': !SHOW_AGGREGATION }\"\n >\n @if (SHOW_TIME_CONTEXT) {\n @let dateTimeContext = currentForm.get('dateTimeContext');\n @let tempDateFromValue = dateTimeContext.get('dateFrom')?.value;\n @let tempDateToValue = dateTimeContext.get('dateTo')?.value;\n @let fromErrors = dateFromErrors();\n @let toErrors = dateToErrors();\n\n <fieldset class=\"c8y-fieldset\">\n <legend>\n <div class=\"standalone btn-icon-dot__item time-context m-r-4\">\n <i\n class=\"\"\n [c8yIcon]=\"'calendar'\"\n ></i>\n </div>\n {{ 'Date & time range' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"TIME_RANGE_PICKER_POPOVER | translate\"\n placement=\"top\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n [adaptivePosition]=\"true\"\n ></button>\n </legend>\n <c8y-form-group class=\"content-flex-58 d-flex a-i-center m-b-0 p-t-16\">\n <c8y-form-group\n [class.has-error]=\"fromErrors\"\n class=\"form-group-sm d-flex a-i-center col-6 flex-wrap\"\n >\n <label\n class=\"m-b-sm-0 m-r-8 text-nowrap\"\n style=\"min-width: 30px\"\n [title]=\"'From`date`' | translate\"\n for=\"dateFrom\"\n translate\n >\n From`date`\n </label>\n <c8y-date-time-picker\n [class.has-error]=\"fromErrors\"\n id=\"dateFrom\"\n [maxDate]=\"tempDateToValue\"\n [placeholder]=\"'From`date`' | translate\"\n [formControl]=\"dateTimeContext.get('dateFrom')\"\n ></c8y-date-time-picker>\n <c8y-messages [show]=\"fromErrors\">\n <c8y-message\n name=\"dateAfterRangeMax\"\n [text]=\"errorMessages.dateAfterRangeMax | translate\"\n ></c8y-message>\n <c8y-message\n name=\"invalidDateTime\"\n [text]=\"errorMessages.invalidDateTime | translate\"\n ></c8y-message>\n <c8y-message\n name=\"invalidDateRange\"\n [text]=\"errorMessages.invalidDateRange | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group\n [class.has-error]=\"toErrors\"\n class=\"form-group-sm d-flex flex-wrap col-6 a-i-center\"\n >\n <label\n class=\"m-b-sm-0 text-nowrap m-r-8\"\n style=\"min-width: 30px\"\n [title]=\"'To`date`' | translate\"\n for=\"dateTo\"\n translate\n >\n To`date`\n </label>\n <c8y-date-time-picker\n [class.has-error]=\"toErrors\"\n id=\"dateTo\"\n [minDate]=\"tempDateFromValue\"\n [placeholder]=\"'To`date`' | translate\"\n [formControl]=\"dateTimeContext.get('dateTo')\"\n ></c8y-date-time-picker>\n <c8y-messages [show]=\"toErrors\">\n <c8y-message\n name=\"dateBeforeRangeMin\"\n [text]=\"errorMessages.dateBeforeRangeMin | translate\"\n ></c8y-message>\n <c8y-message\n name=\"invalidDateTime\"\n [text]=\"errorMessages.invalidDateTime | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n </c8y-form-group>\n </fieldset>\n }\n </div>\n <div class=\"col-\">\n @if (SHOW_AGGREGATION) {\n @let selectedAggregation = currentForm.get('aggregation')?.value;\n\n <fieldset class=\"c8y-fieldset\">\n <legend>\n <div class=\"standalone btn-icon-dot__item aggregation m-r-4\">\n <i [c8yIcon]=\"'input'\"></i>\n </div>\n {{ 'Aggregation' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"AGGREGATION_POPOVER | translate\"\n placement=\"top\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n [adaptivePosition]=\"true\"\n ></button>\n </legend>\n <c8y-form-group class=\"p-t-16 p-b-16 m-b-4\">\n <c8y-aggregation-picker\n formControlName=\"aggregation\"\n [resetToDefault]=\"true\"\n [disabledAggregations]=\"disabledAggregations()\"\n [layout]=\"'radio'\"\n ></c8y-aggregation-picker>\n </c8y-form-group>\n </fieldset>\n }\n </div>\n </div>\n </form>\n}\n", dependencies: [{ kind: "ngmodule", type: I18nModule }, { kind: "directive", type: i4.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "ngmodule", type: TooltipModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1
|
|
3100
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: HistoryModeConfigurationControlsComponent, isStandalone: true, selector: "c8y-history-mode-configuration-controls", inputs: { settings: "settings", context: "context" }, outputs: { contextChange: "contextChange", validationStatus: "validationStatus" }, ngImport: i0, template: "@if (currentForm) {\n @let SHOW_TIME_CONTEXT = settings.showTimeContext;\n @let SHOW_AGGREGATION = settings.showAggregation;\n\n <form [formGroup]=\"currentForm\">\n <div class=\"content-flex-100\">\n <div\n class=\"col-4\"\n [ngClass]=\"{ 'm-b-8': !SHOW_AGGREGATION }\"\n >\n @if (SHOW_TIME_CONTEXT) {\n @let dateTimeContext = currentForm.get('dateTimeContext');\n @let tempDateFromValue = dateTimeContext.get('dateFrom')?.value;\n @let tempDateToValue = dateTimeContext.get('dateTo')?.value;\n @let fromErrors = dateFromErrors();\n @let toErrors = dateToErrors();\n\n <fieldset class=\"c8y-fieldset\">\n <legend>\n <div class=\"standalone btn-icon-dot__item time-context m-r-4\">\n <i\n class=\"\"\n [c8yIcon]=\"'calendar'\"\n ></i>\n </div>\n {{ 'Date & time range' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"TIME_RANGE_PICKER_POPOVER | translate\"\n placement=\"top\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n [adaptivePosition]=\"true\"\n ></button>\n </legend>\n <c8y-form-group class=\"content-flex-58 d-flex a-i-center m-b-0 p-t-16\">\n <c8y-form-group\n [class.has-error]=\"fromErrors\"\n class=\"form-group-sm d-flex a-i-center col-6 flex-wrap\"\n >\n <label\n class=\"m-b-sm-0 m-r-8 text-nowrap\"\n style=\"min-width: 30px\"\n [title]=\"'From`date`' | translate\"\n for=\"dateFrom\"\n translate\n >\n From`date`\n </label>\n <c8y-date-time-picker\n [class.has-error]=\"fromErrors\"\n id=\"dateFrom\"\n [maxDate]=\"tempDateToValue\"\n [placeholder]=\"'From`date`' | translate\"\n [formControl]=\"dateTimeContext.get('dateFrom')\"\n ></c8y-date-time-picker>\n <c8y-messages [show]=\"fromErrors\">\n <c8y-message\n name=\"dateAfterRangeMax\"\n [text]=\"errorMessages.dateAfterRangeMax | translate\"\n ></c8y-message>\n <c8y-message\n name=\"invalidDateTime\"\n [text]=\"errorMessages.invalidDateTime | translate\"\n ></c8y-message>\n <c8y-message\n name=\"invalidDateRange\"\n [text]=\"errorMessages.invalidDateRange | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group\n [class.has-error]=\"toErrors\"\n class=\"form-group-sm d-flex flex-wrap col-6 a-i-center\"\n >\n <label\n class=\"m-b-sm-0 text-nowrap m-r-8\"\n style=\"min-width: 30px\"\n [title]=\"'To`date`' | translate\"\n for=\"dateTo\"\n translate\n >\n To`date`\n </label>\n <c8y-date-time-picker\n [class.has-error]=\"toErrors\"\n id=\"dateTo\"\n [minDate]=\"tempDateFromValue\"\n [placeholder]=\"'To`date`' | translate\"\n [formControl]=\"dateTimeContext.get('dateTo')\"\n ></c8y-date-time-picker>\n <c8y-messages [show]=\"toErrors\">\n <c8y-message\n name=\"dateBeforeRangeMin\"\n [text]=\"errorMessages.dateBeforeRangeMin | translate\"\n ></c8y-message>\n <c8y-message\n name=\"invalidDateTime\"\n [text]=\"errorMessages.invalidDateTime | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n </c8y-form-group>\n </fieldset>\n }\n </div>\n <div class=\"col-\">\n @if (SHOW_AGGREGATION) {\n @let selectedAggregation = currentForm.get('aggregation')?.value;\n\n <fieldset class=\"c8y-fieldset\">\n <legend>\n <div class=\"standalone btn-icon-dot__item aggregation m-r-4\">\n <i [c8yIcon]=\"'input'\"></i>\n </div>\n {{ 'Aggregation' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"AGGREGATION_POPOVER | translate\"\n placement=\"top\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n [adaptivePosition]=\"true\"\n ></button>\n </legend>\n <c8y-form-group class=\"p-t-16 p-b-16 m-b-4\">\n <c8y-aggregation-picker\n formControlName=\"aggregation\"\n [resetToDefault]=\"true\"\n [disabledAggregations]=\"disabledAggregations()\"\n [layout]=\"'radio'\"\n ></c8y-aggregation-picker>\n </c8y-form-group>\n </fieldset>\n }\n </div>\n </div>\n </form>\n}\n", dependencies: [{ kind: "ngmodule", type: I18nModule }, { kind: "directive", type: i4.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "ngmodule", type: TooltipModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { 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.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["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: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: PopoverModule }, { kind: "directive", type: i2$2.PopoverDirective, selector: "[popover]", inputs: ["adaptivePosition", "boundariesElement", "popover", "popoverContext", "popoverTitle", "placement", "outsideClick", "triggers", "container", "containerClass", "isOpen", "delay"], outputs: ["onShown", "onHidden"], exportAs: ["bs-popover"] }, { kind: "component", type: FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "component", type: AggregationPickerComponent, selector: "c8y-aggregation-picker", inputs: ["disabledAggregations", "resetToDefault", "layout"] }, { kind: "component", type: MessagesComponent, selector: "c8y-messages", inputs: ["show", "defaults", "helpMessage"] }, { kind: "directive", type: MessageDirective, selector: "c8y-message", inputs: ["name", "text"] }, { kind: "ngmodule", type: DateTimePickerModule }, { kind: "component", type: i4.DateTimePickerComponent, selector: "c8y-date-time-picker", inputs: ["minDate", "maxDate", "placeholder", "dateInputFormat", "adaptivePosition", "size", "dateType", "config"], outputs: ["onDateSelected"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3102
3101
|
}
|
|
3103
3102
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: HistoryModeConfigurationControlsComponent, decorators: [{
|
|
3104
3103
|
type: Component,
|
|
@@ -3164,7 +3163,7 @@ class IntervalPickerComponent {
|
|
|
3164
3163
|
useExisting: forwardRef(() => IntervalPickerComponent),
|
|
3165
3164
|
multi: true
|
|
3166
3165
|
}
|
|
3167
|
-
], ngImport: i0, template: "@for (interval of INTERVALS; track interval.id) {\n @let isSelected = interval.id === value;\n @let checkVisibility = isSelected ? 'visible' : 'hidden';\n @let isIntervalDisabled = shouldDisableInterval?.isDisabled;\n @let isIntervalDisabledMsg = shouldDisableInterval?.msg;\n @let isCustom = interval.id === 'custom';\n\n <li [class.active]=\"isSelected\">\n <div\n [ngStyle]=\"{\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center'\n }\"\n >\n <button\n class=\"mr-2\"\n type=\"button\"\n [attr.data-cy]=\"'global-context--interval-' + interval.id\"\n (click)=\"onIntervalSelect(interval.id)\"\n [disabled]=\"isCustom && isIntervalDisabled\"\n >\n <span [class.text-primary]=\"isSelected\">\n <span\n [c8yIcon]=\"'check'\"\n [style.visibility]=\"checkVisibility\"\n ></span>\n {{ interval.title | translate }}\n </span>\n </button>\n </div>\n </li>\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$
|
|
3166
|
+
], ngImport: i0, template: "@for (interval of INTERVALS; track interval.id) {\n @let isSelected = interval.id === value;\n @let checkVisibility = isSelected ? 'visible' : 'hidden';\n @let isIntervalDisabled = shouldDisableInterval?.isDisabled;\n @let isIntervalDisabledMsg = shouldDisableInterval?.msg;\n @let isCustom = interval.id === 'custom';\n\n <li [class.active]=\"isSelected\">\n <div\n [ngStyle]=\"{\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center'\n }\"\n >\n <button\n class=\"mr-2\"\n type=\"button\"\n [attr.data-cy]=\"'global-context--interval-' + interval.id\"\n (click)=\"onIntervalSelect(interval.id)\"\n [disabled]=\"isCustom && isIntervalDisabled\"\n >\n <span [class.text-primary]=\"isSelected\">\n <span\n [c8yIcon]=\"'check'\"\n [style.visibility]=\"checkVisibility\"\n ></span>\n {{ interval.title | translate }}\n </span>\n </button>\n </div>\n </li>\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: A11yModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: BsDropdownModule }, { kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "ngmodule", type: PopoverModule }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3168
3167
|
}
|
|
3169
3168
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: IntervalPickerComponent, decorators: [{
|
|
3170
3169
|
type: Component,
|
|
@@ -3202,6 +3201,7 @@ class DateTimeContextPickerComponent {
|
|
|
3202
3201
|
this.formBuilder = inject(FormBuilder);
|
|
3203
3202
|
this.destroyRef = inject(DestroyRef);
|
|
3204
3203
|
this.datePipe = inject(DatePipe);
|
|
3204
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
3205
3205
|
this.INTERVALS = INTERVAL_TITLES;
|
|
3206
3206
|
this.DATE_FORMAT = 'medium';
|
|
3207
3207
|
this.TIME_INTERVAL = TIME_INTERVAL;
|
|
@@ -3245,6 +3245,7 @@ class DateTimeContextPickerComponent {
|
|
|
3245
3245
|
this.canEmit.set(true);
|
|
3246
3246
|
this.customSnapshot.set(null);
|
|
3247
3247
|
}
|
|
3248
|
+
this.cdr.markForCheck();
|
|
3248
3249
|
}
|
|
3249
3250
|
}
|
|
3250
3251
|
registerOnChange(fn) {
|
|
@@ -3453,7 +3454,7 @@ class DateTimeContextPickerComponent {
|
|
|
3453
3454
|
useExisting: forwardRef(() => DateTimeContextPickerComponent),
|
|
3454
3455
|
multi: true
|
|
3455
3456
|
}
|
|
3456
|
-
], viewQueries: [{ propertyName: "dropdown", first: true, predicate: BsDropdownDirective, descendants: true }], ngImport: i0, template: "@if (form) {\n @let intervalValue = form.get('interval')?.value;\n @let isIntervalNone = intervalValue === 'none';\n @let dateFromControl = form.get('dateFrom');\n @let dateToControl = form.get('dateTo');\n @let dateRangeLabel = getDateRangeLabel();\n\n <form [formGroup]=\"form\">\n <div\n class=\"dropdown max-width-100\"\n container=\"body\"\n #dropdown=\"bs-dropdown\"\n dropdown\n [insideClick]=\"true\"\n [isDisabled]=\"disabled\"\n (onShown)=\"onShownDropdown()\"\n (onHidden)=\"onHiddenDropdown()\"\n >\n <!-- Dropdown toggle button with better accessibility -->\n <button\n class=\"dropdown-toggle form-control l-h-tight d-flex a-i-center\"\n [attr.aria-label]=\"dateRangeLabel\"\n [tooltip]=\"dateRangeLabel\"\n placement=\"top\"\n container=\"body\"\n [adaptivePosition]=\"false\"\n [delay]=\"500\"\n dropdownToggle\n data-cy=\"c8y-date-time-context-picker--picker-toggle\"\n >\n <i\n class=\"m-r-4\"\n [c8yIcon]=\"'schedule1'\"\n aria-hidden=\"true\"\n ></i>\n <div class=\"d-col text-left flex-grow min-width-0\">\n @if (isIntervalNone) {\n <span class=\"text-10 text-muted l-h-1\">\n {{ 'No date filter' | translate }}\n </span>\n } @else {\n <span\n class=\"text-10 text-muted l-h-1\"\n data-cy=\"c8y-date-time-context-picker--picker-label\"\n >\n {{ INTERVALS[intervalValue] | translate }}\n </span>\n <span\n class=\"text-12 l-h-1 text-medium text-truncate\"\n data-cy=\"c8y-date-time-context-picker--picker-time-range\"\n >\n {{ form.get('dateFrom')?.value | c8yDate: DATE_FORMAT }} \u2014\n {{ form.get('dateTo')?.value | c8yDate: DATE_FORMAT }}\n </span>\n }\n </div>\n <span\n class=\"caret m-r-16 m-l-4\"\n aria-hidden=\"true\"\n ></span>\n </button>\n\n <!-- Dropdown menu -->\n <ul\n class=\"dropdown-menu dropdown-menu--date-range\"\n role=\"menu\"\n *dropdownMenu\n >\n @if (dropdown.isOpen) {\n <!-- Interval picker section -->\n <c8y-interval-picker\n class=\"d-contents\"\n formControlName=\"interval\"\n [shouldDisableInterval]=\"shouldDisableInterval\"\n ></c8y-interval-picker>\n\n <!-- Custom date range section -->\n @if (isCustomMode() && (config?.showDateFrom || config?.showDateTo)) {\n <div class=\"p-l-16 p-r-16\">\n @if (config?.showDateFrom) {\n <c8y-form-group [class.has-error]=\"getDateFromErrors()\">\n <label\n [title]=\"'From`date`' | translate\"\n for=\"dateFrom\"\n translate\n >\n From`date`\n </label>\n <c8y-date-time-picker\n [class.has-error]=\"getDateFromErrors()\"\n id=\"dateFrom\"\n [maxDate]=\"tempDateToControl?.value\"\n [placeholder]=\"'From`date`' | translate\"\n [formControl]=\"tempDateFromControl\"\n ></c8y-date-time-picker>\n <c8y-messages [show]=\"getDateFromErrors()\">\n <c8y-message\n name=\"dateAfterRangeMax\"\n [text]=\"errorMessages.dateAfterRangeMax | translate\"\n ></c8y-message>\n <c8y-message\n name=\"dateBeforeRangeMin\"\n [text]=\"errorMessages.dateBeforeRangeMin | translate\"\n ></c8y-message>\n <c8y-message\n name=\"invalidDateTime\"\n [text]=\"errorMessages.invalidDateTime | translate\"\n ></c8y-message>\n <c8y-message\n name=\"bsDate\"\n [text]=\"errorMessages.invalidDateTime | translate\"\n ></c8y-message>\n <c8y-message\n name=\"invalidDateRange\"\n [text]=\"errorMessages.invalidDateRange | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n }\n\n @if (config?.showDateTo) {\n <c8y-form-group [class.has-error]=\"getDateToErrors()\">\n <label\n [title]=\"'To`date`' | translate\"\n for=\"dateTo\"\n translate\n >\n To`date`\n </label>\n <c8y-date-time-picker\n [class.has-error]=\"getDateToErrors()\"\n id=\"dateTo\"\n [minDate]=\"tempDateFromControl?.value\"\n [placeholder]=\"'To`date`' | translate\"\n [formControl]=\"tempDateToControl\"\n ></c8y-date-time-picker>\n <c8y-messages [show]=\"getDateToErrors()\">\n <c8y-message\n name=\"dateAfterRangeMax\"\n [text]=\"errorMessages.dateAfterRangeMax | translate\"\n ></c8y-message>\n <c8y-message\n name=\"dateBeforeRangeMin\"\n [text]=\"errorMessages.dateBeforeRangeMin | translate\"\n ></c8y-message>\n <c8y-message\n name=\"invalidDateTime\"\n [text]=\"errorMessages.invalidDateTime | translate\"\n ></c8y-message>\n <c8y-message\n name=\"bsDate\"\n [text]=\"errorMessages.invalidDateTime | translate\"\n ></c8y-message>\n <c8y-message\n name=\"invalidDateRange\"\n [text]=\"errorMessages.invalidDateRange | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n }\n </div>\n\n <!-- Action buttons -->\n <div class=\"p-16 d-flex gap-8 separator-top\">\n <button\n class=\"btn btn-default btn-sm flex-grow\"\n title=\"{{ 'Reset' | translate }}\"\n type=\"button\"\n (click)=\"reset()\"\n translate\n >\n Reset\n </button>\n\n <button\n class=\"btn btn-primary btn-sm flex-grow\"\n title=\"{{ 'Apply' | translate }}\"\n type=\"button\"\n (click)=\"applyDateTimeContext()\"\n [disabled]=\"isApplyDisabled()\"\n translate\n >\n Apply\n </button>\n </div>\n }\n }\n </ul>\n </div>\n </form>\n}\n", dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i1.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: BsDropdownModule }, { kind: "directive", type: i2.BsDropdownMenuDirective, selector: "[bsDropdownMenu],[dropdownMenu]", exportAs: ["bs-dropdown-menu"] }, { kind: "directive", type: i2.BsDropdownToggleDirective, selector: "[bsDropdownToggle],[dropdownToggle]", exportAs: ["bs-dropdown-toggle"] }, { kind: "directive", type: i2.BsDropdownDirective, selector: "[bsDropdown], [dropdown]", inputs: ["placement", "triggers", "container", "dropup", "autoClose", "isAnimated", "insideClick", "isDisabled", "isOpen"], outputs: ["isOpenChange", "onShown", "onHidden"], exportAs: ["bs-dropdown"] }, { kind: "ngmodule", type: I18nModule }, { kind: "directive", type: i4.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "component", type: MessagesComponent, selector: "c8y-messages", inputs: ["show", "defaults", "helpMessage"] }, { kind: "directive", type: MessageDirective, selector: "c8y-message", inputs: ["name", "text"] }, { kind: "component", type: FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "component", type: IntervalPickerComponent, selector: "c8y-interval-picker", inputs: ["INTERVALS", "shouldDisableInterval"] }, { kind: "ngmodule", type: DateTimePickerModule }, { kind: "component", type: i4.DateTimePickerComponent, selector: "c8y-date-time-picker", inputs: ["minDate", "maxDate", "placeholder", "dateInputFormat", "adaptivePosition", "size", "dateType", "config"], outputs: ["onDateSelected"] }, { kind: "pipe", type: i4.C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: DatePipe, name: "c8yDate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3457
|
+
], viewQueries: [{ propertyName: "dropdown", first: true, predicate: BsDropdownDirective, descendants: true }], ngImport: i0, template: "@if (form) {\n @let intervalValue = form.get('interval')?.value;\n @let isIntervalNone = intervalValue === 'none';\n @let dateFromControl = form.get('dateFrom');\n @let dateToControl = form.get('dateTo');\n @let dateRangeLabel = getDateRangeLabel();\n\n <form [formGroup]=\"form\">\n <div\n class=\"dropdown max-width-100\"\n container=\"body\"\n #dropdown=\"bs-dropdown\"\n dropdown\n [insideClick]=\"true\"\n [isDisabled]=\"disabled\"\n (onShown)=\"onShownDropdown()\"\n (onHidden)=\"onHiddenDropdown()\"\n >\n <!-- Dropdown toggle button with better accessibility -->\n <button\n class=\"dropdown-toggle form-control l-h-tight d-flex a-i-center\"\n [attr.aria-label]=\"dateRangeLabel\"\n [tooltip]=\"dateRangeLabel\"\n placement=\"top\"\n container=\"body\"\n [adaptivePosition]=\"false\"\n [delay]=\"500\"\n dropdownToggle\n data-cy=\"c8y-date-time-context-picker--picker-toggle\"\n >\n <i\n class=\"m-r-4\"\n [c8yIcon]=\"'schedule1'\"\n aria-hidden=\"true\"\n ></i>\n <div class=\"d-col text-left flex-grow min-width-0\">\n @if (isIntervalNone) {\n <span class=\"text-10 text-muted l-h-1\">\n {{ 'No date filter' | translate }}\n </span>\n } @else {\n <span\n class=\"text-10 text-muted l-h-1\"\n data-cy=\"c8y-date-time-context-picker--picker-label\"\n >\n {{ INTERVALS[intervalValue] | translate }}\n </span>\n <span\n class=\"text-12 l-h-1 text-medium text-truncate\"\n data-cy=\"c8y-date-time-context-picker--picker-time-range\"\n >\n {{ form.get('dateFrom')?.value | c8yDate: DATE_FORMAT }} \u2014\n {{ form.get('dateTo')?.value | c8yDate: DATE_FORMAT }}\n </span>\n }\n </div>\n <span\n class=\"caret m-r-16 m-l-4\"\n aria-hidden=\"true\"\n ></span>\n </button>\n\n <!-- Dropdown menu -->\n <ul\n class=\"dropdown-menu dropdown-menu--date-range\"\n role=\"menu\"\n *dropdownMenu\n >\n @if (dropdown.isOpen) {\n <!-- Interval picker section -->\n <c8y-interval-picker\n class=\"d-contents\"\n formControlName=\"interval\"\n [shouldDisableInterval]=\"shouldDisableInterval\"\n ></c8y-interval-picker>\n\n <!-- Custom date range section -->\n @if (isCustomMode() && (config?.showDateFrom || config?.showDateTo)) {\n <div class=\"p-l-16 p-r-16\">\n @if (config?.showDateFrom) {\n <c8y-form-group [class.has-error]=\"getDateFromErrors()\">\n <label\n [title]=\"'From`date`' | translate\"\n for=\"dateFrom\"\n translate\n >\n From`date`\n </label>\n <c8y-date-time-picker\n [class.has-error]=\"getDateFromErrors()\"\n id=\"dateFrom\"\n [maxDate]=\"tempDateToControl?.value\"\n [placeholder]=\"'From`date`' | translate\"\n [formControl]=\"tempDateFromControl\"\n ></c8y-date-time-picker>\n <c8y-messages [show]=\"getDateFromErrors()\">\n <c8y-message\n name=\"dateAfterRangeMax\"\n [text]=\"errorMessages.dateAfterRangeMax | translate\"\n ></c8y-message>\n <c8y-message\n name=\"dateBeforeRangeMin\"\n [text]=\"errorMessages.dateBeforeRangeMin | translate\"\n ></c8y-message>\n <c8y-message\n name=\"invalidDateTime\"\n [text]=\"errorMessages.invalidDateTime | translate\"\n ></c8y-message>\n <c8y-message\n name=\"bsDate\"\n [text]=\"errorMessages.invalidDateTime | translate\"\n ></c8y-message>\n <c8y-message\n name=\"invalidDateRange\"\n [text]=\"errorMessages.invalidDateRange | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n }\n\n @if (config?.showDateTo) {\n <c8y-form-group [class.has-error]=\"getDateToErrors()\">\n <label\n [title]=\"'To`date`' | translate\"\n for=\"dateTo\"\n translate\n >\n To`date`\n </label>\n <c8y-date-time-picker\n [class.has-error]=\"getDateToErrors()\"\n id=\"dateTo\"\n [minDate]=\"tempDateFromControl?.value\"\n [placeholder]=\"'To`date`' | translate\"\n [formControl]=\"tempDateToControl\"\n ></c8y-date-time-picker>\n <c8y-messages [show]=\"getDateToErrors()\">\n <c8y-message\n name=\"dateAfterRangeMax\"\n [text]=\"errorMessages.dateAfterRangeMax | translate\"\n ></c8y-message>\n <c8y-message\n name=\"dateBeforeRangeMin\"\n [text]=\"errorMessages.dateBeforeRangeMin | translate\"\n ></c8y-message>\n <c8y-message\n name=\"invalidDateTime\"\n [text]=\"errorMessages.invalidDateTime | translate\"\n ></c8y-message>\n <c8y-message\n name=\"bsDate\"\n [text]=\"errorMessages.invalidDateTime | translate\"\n ></c8y-message>\n <c8y-message\n name=\"invalidDateRange\"\n [text]=\"errorMessages.invalidDateRange | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n }\n </div>\n\n <!-- Action buttons -->\n <div class=\"p-16 d-flex gap-8 separator-top\">\n <button\n class=\"btn btn-default btn-sm flex-grow\"\n title=\"{{ 'Reset' | translate }}\"\n type=\"button\"\n (click)=\"reset()\"\n translate\n >\n Reset\n </button>\n\n <button\n class=\"btn btn-primary btn-sm flex-grow\"\n title=\"{{ 'Apply' | translate }}\"\n type=\"button\"\n (click)=\"applyDateTimeContext()\"\n [disabled]=\"isApplyDisabled()\"\n translate\n >\n Apply\n </button>\n </div>\n }\n }\n </ul>\n </div>\n </form>\n}\n", dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { 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.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["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: TooltipModule }, { kind: "directive", type: i2.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: BsDropdownModule }, { kind: "directive", type: i2$1.BsDropdownMenuDirective, selector: "[bsDropdownMenu],[dropdownMenu]", exportAs: ["bs-dropdown-menu"] }, { kind: "directive", type: i2$1.BsDropdownToggleDirective, selector: "[bsDropdownToggle],[dropdownToggle]", exportAs: ["bs-dropdown-toggle"] }, { kind: "directive", type: i2$1.BsDropdownDirective, selector: "[bsDropdown], [dropdown]", inputs: ["placement", "triggers", "container", "dropup", "autoClose", "isAnimated", "insideClick", "isDisabled", "isOpen"], outputs: ["isOpenChange", "onShown", "onHidden"], exportAs: ["bs-dropdown"] }, { kind: "ngmodule", type: I18nModule }, { kind: "directive", type: i4.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "component", type: MessagesComponent, selector: "c8y-messages", inputs: ["show", "defaults", "helpMessage"] }, { kind: "directive", type: MessageDirective, selector: "c8y-message", inputs: ["name", "text"] }, { kind: "component", type: FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "component", type: IntervalPickerComponent, selector: "c8y-interval-picker", inputs: ["INTERVALS", "shouldDisableInterval"] }, { kind: "ngmodule", type: DateTimePickerModule }, { kind: "component", type: i4.DateTimePickerComponent, selector: "c8y-date-time-picker", inputs: ["minDate", "maxDate", "placeholder", "dateInputFormat", "adaptivePosition", "size", "dateType", "config"], outputs: ["onDateSelected"] }, { kind: "pipe", type: i4.C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: DatePipe, name: "c8yDate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3457
3458
|
}
|
|
3458
3459
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DateTimeContextPickerComponent, decorators: [{
|
|
3459
3460
|
type: Component,
|
|
@@ -3560,7 +3561,7 @@ class LiveModeConfigurationControlsComponent {
|
|
|
3560
3561
|
}, { emitEvent: false });
|
|
3561
3562
|
}
|
|
3562
3563
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: LiveModeConfigurationControlsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3563
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: LiveModeConfigurationControlsComponent, isStandalone: true, selector: "c8y-live-mode-configuration-controls", inputs: { settings: "settings", context: "context" }, outputs: { contextChange: "contextChange" }, ngImport: i0, template: "@if (form) {\n @let SHOW_TIME_CONTEXT = settings.showTimeContext;\n @let SHOW_AUTO_REFRESH = settings.showAutoRefresh;\n\n <form [formGroup]=\"form\">\n <div class=\"content-flex-82\">\n <div class=\"col-5\">\n @if (SHOW_TIME_CONTEXT) {\n <fieldset class=\"c8y-fieldset\">\n <legend>\n <div class=\"standalone btn-icon-dot__item time-context m-r-4\">\n <i [c8yIcon]=\"'calendar'\"></i>\n </div>\n {{ 'Date & time' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"TIME_RANGE_PICKER_POPOVER | translate\"\n placement=\"top\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n [adaptivePosition]=\"true\"\n ></button>\n </legend>\n <c8y-form-group class=\"m-b-4 p-t-16 p-b-16\">\n <c8y-date-time-context-picker\n formControlName=\"dateTimeContext\"\n [config]=\"{ showDateTo: false, showDateFrom: true }\"\n ></c8y-date-time-context-picker>\n </c8y-form-group>\n </fieldset>\n }\n </div>\n <div class=\"col-3\">\n @if (SHOW_AUTO_REFRESH) {\n <fieldset class=\"c8y-fieldset\">\n <legend class=\"d-flex\">\n <div class=\"standalone btn-icon-dot__item auto-refresh m-r-4\">\n <i [c8yIcon]=\"'refresh'\"></i>\n </div>\n {{ 'Auto refresh' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"REFRESH_POPOVER_MESSAGE | translate\"\n placement=\"top\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n [adaptivePosition]=\"true\"\n ></button>\n </legend>\n <c8y-form-group class=\"m-b-8 form-group-sm p-t-16 p-b-16\">\n <div class=\"d-flex gap-8 a-i-center\">\n <label class=\"c8y-switch c8y-switch--inline\">\n <input\n type=\"checkbox\"\n #arInput\n formControlName=\"isAutoRefreshEnabled\"\n />\n <span></span>\n <span>\n {{ 'Auto refresh enabled' | translate }}\n </span>\n </label>\n </div>\n </c8y-form-group>\n </fieldset>\n }\n </div>\n </div>\n </form>\n}\n", dependencies: [{ kind: "ngmodule", type: TooltipModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1
|
|
3564
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: LiveModeConfigurationControlsComponent, isStandalone: true, selector: "c8y-live-mode-configuration-controls", inputs: { settings: "settings", context: "context" }, outputs: { contextChange: "contextChange" }, ngImport: i0, template: "@if (form) {\n @let SHOW_TIME_CONTEXT = settings.showTimeContext;\n @let SHOW_AUTO_REFRESH = settings.showAutoRefresh;\n\n <form [formGroup]=\"form\">\n <div class=\"content-flex-82\">\n <div class=\"col-5\">\n @if (SHOW_TIME_CONTEXT) {\n <fieldset class=\"c8y-fieldset\">\n <legend>\n <div class=\"standalone btn-icon-dot__item time-context m-r-4\">\n <i [c8yIcon]=\"'calendar'\"></i>\n </div>\n {{ 'Date & time' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"TIME_RANGE_PICKER_POPOVER | translate\"\n placement=\"top\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n [adaptivePosition]=\"true\"\n ></button>\n </legend>\n <c8y-form-group class=\"m-b-4 p-t-16 p-b-16\">\n <c8y-date-time-context-picker\n formControlName=\"dateTimeContext\"\n [config]=\"{ showDateTo: false, showDateFrom: true }\"\n ></c8y-date-time-context-picker>\n </c8y-form-group>\n </fieldset>\n }\n </div>\n <div class=\"col-3\">\n @if (SHOW_AUTO_REFRESH) {\n <fieldset class=\"c8y-fieldset\">\n <legend class=\"d-flex\">\n <div class=\"standalone btn-icon-dot__item auto-refresh m-r-4\">\n <i [c8yIcon]=\"'refresh'\"></i>\n </div>\n {{ 'Auto refresh' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"REFRESH_POPOVER_MESSAGE | translate\"\n placement=\"top\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n [adaptivePosition]=\"true\"\n ></button>\n </legend>\n <c8y-form-group class=\"m-b-8 form-group-sm p-t-16 p-b-16\">\n <div class=\"d-flex gap-8 a-i-center\">\n <label class=\"c8y-switch c8y-switch--inline\">\n <input\n type=\"checkbox\"\n #arInput\n formControlName=\"isAutoRefreshEnabled\"\n />\n <span></span>\n <span>\n {{ 'Auto refresh enabled' | translate }}\n </span>\n </label>\n </div>\n </c8y-form-group>\n </fieldset>\n }\n </div>\n </div>\n </form>\n}\n", dependencies: [{ kind: "ngmodule", type: TooltipModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { 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: "component", type: DateTimeContextPickerComponent, selector: "c8y-date-time-context-picker", inputs: ["disabled", "shouldDisableInterval", "config"] }, { kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: PopoverModule }, { kind: "directive", type: i2$2.PopoverDirective, selector: "[popover]", inputs: ["adaptivePosition", "boundariesElement", "popover", "popoverContext", "popoverTitle", "placement", "outsideClick", "triggers", "container", "containerClass", "isOpen", "delay"], outputs: ["onShown", "onHidden"], exportAs: ["bs-popover"] }, { kind: "component", type: FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3564
3565
|
}
|
|
3565
3566
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: LiveModeConfigurationControlsComponent, decorators: [{
|
|
3566
3567
|
type: Component,
|
|
@@ -3993,7 +3994,7 @@ class ConfigurationCollapseComponent {
|
|
|
3993
3994
|
this.hasPendingChanges.set(!isEqual(snapshot, latest));
|
|
3994
3995
|
}
|
|
3995
3996
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ConfigurationCollapseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3996
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: ConfigurationCollapseComponent, isStandalone: true, selector: "c8y-configuration-collapse", inputs: { supportedModes: { classPropertyName: "supportedModes", publicName: "supportedModes", isSignal: true, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "context", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { contextChange: "contextChange", refreshOptionChange: "refreshOptionChange", savePreferenceChange: "savePreferenceChange" }, host: { classAttribute: "d-contents" }, ngImport: i0, template: "<div\n class=\"c8y-global-context\"\n [collapse]=\"isCollapsed()\"\n (collapsed)=\"onCollapsed()\"\n (expanded)=\"onExpanded()\"\n [isAnimated]=\"true\"\n>\n <div class=\"p-t-16 p-b-16 p-l-24 p-r-24 separator-bottom\">\n <span\n class=\"h4\"\n translate\n >\n Time mode\n </span>\n </div>\n <div>\n @if (!isCollapsed()) {\n <c8y-configuration-controls\n [activeMode]=\"activeMode()\"\n [liveContext]=\"liveViewContext()\"\n [historyContext]=\"historyViewContext()\"\n [supportedModes]=\"supportedModes()\"\n (refreshOptionChange)=\"onModeSelected($event)\"\n (contextChange)=\"onModeChange($event)\"\n (validationStatus)=\"onValidationStatusChange($event)\"\n ></c8y-configuration-controls>\n }\n </div>\n <div class=\"c8y-top-drawer--footer\">\n <div class=\"d-flex a-i-center gap-8\">\n <button\n class=\"btn btn-default\"\n [title]=\"'Close help' | translate\"\n aria-controls=\"collapseHelp\"\n [attr.aria-expanded]=\"!isCollapsed()\"\n type=\"button\"\n (click)=\"toggle()\"\n translate\n >\n Close\n </button>\n <button\n class=\"btn btn-primary\"\n [title]=\"'Apply global context' | translate\"\n aria-controls=\"collapseHelp\"\n [attr.aria-expanded]=\"!isCollapsed()\"\n type=\"button\"\n (click)=\"apply()\"\n [disabled]=\"!hasPendingChanges() || !isFormValid()\"\n translate\n data-cy=\"global-date-context--Apply-button\"\n >\n Apply\n </button>\n\n <label class=\"c8y-checkbox d-flex align-items-center m-b-0\">\n <input\n class=\"m-r-4\"\n type=\"checkbox\"\n [ngModel]=\"shouldSave()\"\n (ngModelChange)=\"shouldSaveInDashboard($event)\"\n />\n <span class=\"a-s-center m-r-8\"></span>\n <span\n class=\"text-truncate\"\n translate\n >\n Save in dashboard configuration\n </span>\n <button\n class=\"btn-help btn-help--sm m-l-4\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"helpText | translate\"\n placement=\"right\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n [adaptivePosition]=\"true\"\n ></button>\n </label>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: TooltipModule }, { kind: "ngmodule", type: CollapseModule }, { kind: "directive", type: i1$
|
|
3997
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: ConfigurationCollapseComponent, isStandalone: true, selector: "c8y-configuration-collapse", inputs: { supportedModes: { classPropertyName: "supportedModes", publicName: "supportedModes", isSignal: true, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "context", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { contextChange: "contextChange", refreshOptionChange: "refreshOptionChange", savePreferenceChange: "savePreferenceChange" }, host: { classAttribute: "d-contents" }, ngImport: i0, template: "<div\n class=\"c8y-global-context\"\n [collapse]=\"isCollapsed()\"\n (collapsed)=\"onCollapsed()\"\n (expanded)=\"onExpanded()\"\n [isAnimated]=\"true\"\n>\n <div class=\"p-t-16 p-b-16 p-l-24 p-r-24 separator-bottom\">\n <span\n class=\"h4\"\n translate\n >\n Time mode\n </span>\n </div>\n <div>\n @if (!isCollapsed()) {\n <c8y-configuration-controls\n [activeMode]=\"activeMode()\"\n [liveContext]=\"liveViewContext()\"\n [historyContext]=\"historyViewContext()\"\n [supportedModes]=\"supportedModes()\"\n (refreshOptionChange)=\"onModeSelected($event)\"\n (contextChange)=\"onModeChange($event)\"\n (validationStatus)=\"onValidationStatusChange($event)\"\n ></c8y-configuration-controls>\n }\n </div>\n <div class=\"c8y-top-drawer--footer\">\n <div class=\"d-flex a-i-center gap-8\">\n <button\n class=\"btn btn-default\"\n [title]=\"'Close help' | translate\"\n aria-controls=\"collapseHelp\"\n [attr.aria-expanded]=\"!isCollapsed()\"\n type=\"button\"\n (click)=\"toggle()\"\n translate\n >\n Close\n </button>\n <button\n class=\"btn btn-primary\"\n [title]=\"'Apply global context' | translate\"\n aria-controls=\"collapseHelp\"\n [attr.aria-expanded]=\"!isCollapsed()\"\n type=\"button\"\n (click)=\"apply()\"\n [disabled]=\"!hasPendingChanges() || !isFormValid()\"\n translate\n data-cy=\"global-date-context--Apply-button\"\n >\n Apply\n </button>\n\n <label class=\"c8y-checkbox d-flex align-items-center m-b-0\">\n <input\n class=\"m-r-4\"\n type=\"checkbox\"\n [ngModel]=\"shouldSave()\"\n (ngModelChange)=\"shouldSaveInDashboard($event)\"\n />\n <span class=\"a-s-center m-r-8\"></span>\n <span\n class=\"text-truncate\"\n translate\n >\n Save in dashboard configuration\n </span>\n <button\n class=\"btn-help btn-help--sm m-l-4\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"helpText | translate\"\n placement=\"right\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n [adaptivePosition]=\"true\"\n ></button>\n </label>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: TooltipModule }, { kind: "ngmodule", type: CollapseModule }, { kind: "directive", type: i1$2.CollapseDirective, selector: "[collapse]", inputs: ["display", "isAnimated", "collapse"], outputs: ["collapsed", "collapses", "expanded", "expands"], exportAs: ["bs-collapse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { 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: "ngmodule", type: FormsModule$1 }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: PopoverModule }, { kind: "directive", type: i2$2.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: ConfigurationControlsComponent, selector: "c8y-configuration-controls", inputs: ["controlsDisplayMode", "settings", "activeMode", "liveContext", "historyContext", "supportedModes", "tabsOutletName"], outputs: ["refreshOptionChange", "contextChange", "validationStatus"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3997
3998
|
}
|
|
3998
3999
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ConfigurationCollapseComponent, decorators: [{
|
|
3999
4000
|
type: Component,
|
|
@@ -4559,6 +4560,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
4559
4560
|
args: [{ selector: 'c8y-aggregation-display', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [C8yTranslatePipe, IconDirective], template: "<div class=\"d-flex a-i-center l-h-tight form-control\">\n <i\n class=\"m-r-4\"\n [c8yIcon]=\"aggregation() ? AGGREGATION_ICONS[aggregation()] : AGGREGATION_ICONS.undefined\"\n ></i>\n <div class=\"d-col text-left fit-w\">\n <span class=\"text-10 l-h-1 text-muted\">\n {{ 'Aggregation' | translate }}\n </span>\n <span\n class=\"text-12 l-h-1 text-medium text-truncate\"\n data-cy=\"global-date-context--Aggregation-display-value\"\n >\n {{ AGGREGATION_TEXTS[aggregation()] | translate }}\n </span>\n </div>\n</div>\n" }]
|
|
4560
4561
|
}], propDecorators: { aggregation: [{ type: i0.Input, args: [{ isSignal: true, alias: "aggregation", required: false }] }] } });
|
|
4561
4562
|
|
|
4563
|
+
/**
|
|
4564
|
+
* Source of auto-refresh state change.
|
|
4565
|
+
*/
|
|
4566
|
+
var AutoRefreshChangeSource;
|
|
4567
|
+
(function (AutoRefreshChangeSource) {
|
|
4568
|
+
/** External change from user interaction or form value changes */
|
|
4569
|
+
AutoRefreshChangeSource["External"] = "external";
|
|
4570
|
+
/** Internal change from tab visibility detection */
|
|
4571
|
+
AutoRefreshChangeSource["Visibility"] = "visibility";
|
|
4572
|
+
})(AutoRefreshChangeSource || (AutoRefreshChangeSource = {}));
|
|
4562
4573
|
/**
|
|
4563
4574
|
* Auto-refresh toggle control with countdown timer.
|
|
4564
4575
|
*
|
|
@@ -4581,6 +4592,8 @@ class AutoRefreshControlComponent {
|
|
|
4581
4592
|
this.cdr = inject(ChangeDetectorRef);
|
|
4582
4593
|
// Grace period handling for widgets without proper loading state
|
|
4583
4594
|
this.gracePeriodTimeout = null;
|
|
4595
|
+
// Track if auto-refresh was disabled by tab visibility (not user action)
|
|
4596
|
+
this.disabledByTabVisibility = false;
|
|
4584
4597
|
this.loadingChange = new EventEmitter();
|
|
4585
4598
|
this.refresh = new EventEmitter();
|
|
4586
4599
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
@@ -4620,17 +4633,28 @@ class AutoRefreshControlComponent {
|
|
|
4620
4633
|
ngOnDestroy() {
|
|
4621
4634
|
this.clearGracePeriod();
|
|
4622
4635
|
}
|
|
4636
|
+
onVisibilityChange() {
|
|
4637
|
+
if (document.hidden && this.isEnabled) {
|
|
4638
|
+
this.disabledByTabVisibility = true;
|
|
4639
|
+
this.setAutoRefreshEnabled(false, AutoRefreshChangeSource.Visibility);
|
|
4640
|
+
}
|
|
4641
|
+
else {
|
|
4642
|
+
if (this.disabledByTabVisibility) {
|
|
4643
|
+
this.setAutoRefreshEnabled(true, AutoRefreshChangeSource.Visibility);
|
|
4644
|
+
}
|
|
4645
|
+
}
|
|
4646
|
+
}
|
|
4623
4647
|
toggleIntervalRefresh() {
|
|
4624
|
-
this.
|
|
4625
|
-
this.onChange(this.isEnabled);
|
|
4626
|
-
this.syncCountdownState();
|
|
4627
|
-
this.cdr.markForCheck();
|
|
4648
|
+
this.setAutoRefreshEnabled(!this.isEnabled, AutoRefreshChangeSource.External);
|
|
4628
4649
|
}
|
|
4629
4650
|
registerOnChange(fn) {
|
|
4630
4651
|
this.onChange = fn;
|
|
4631
4652
|
}
|
|
4632
4653
|
writeValue(showIntervalRefresh) {
|
|
4633
4654
|
this.isEnabled = showIntervalRefresh;
|
|
4655
|
+
// External state change always clears the flag
|
|
4656
|
+
// This ensures visibility doesn't re-enable after external disable
|
|
4657
|
+
this.disabledByTabVisibility = false;
|
|
4634
4658
|
this.syncCountdownState();
|
|
4635
4659
|
this.cdr.markForCheck();
|
|
4636
4660
|
}
|
|
@@ -4641,6 +4665,22 @@ class AutoRefreshControlComponent {
|
|
|
4641
4665
|
this.clearGracePeriod();
|
|
4642
4666
|
this.countdownIntervalComponent?.reset();
|
|
4643
4667
|
}
|
|
4668
|
+
/**
|
|
4669
|
+
* Internal method to change auto-refresh state with proper flag management.
|
|
4670
|
+
* @param enabled - New enabled state
|
|
4671
|
+
* @param source - Source of the change (External or Visibility)
|
|
4672
|
+
*/
|
|
4673
|
+
setAutoRefreshEnabled(enabled, source) {
|
|
4674
|
+
this.isEnabled = enabled;
|
|
4675
|
+
if (enabled || source === AutoRefreshChangeSource.External) {
|
|
4676
|
+
this.disabledByTabVisibility = false;
|
|
4677
|
+
}
|
|
4678
|
+
if (source === AutoRefreshChangeSource.External) {
|
|
4679
|
+
this.onChange(this.isEnabled);
|
|
4680
|
+
}
|
|
4681
|
+
this.syncCountdownState();
|
|
4682
|
+
this.cdr.markForCheck();
|
|
4683
|
+
}
|
|
4644
4684
|
setupLoadingHandler() {
|
|
4645
4685
|
this.loading$
|
|
4646
4686
|
.pipe(withLatestFrom(this.countdownComponentReady$), filter$1(([_, component]) => component !== null), tap(([isLoading, component]) => {
|
|
@@ -4688,13 +4728,13 @@ class AutoRefreshControlComponent {
|
|
|
4688
4728
|
}
|
|
4689
4729
|
}
|
|
4690
4730
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AutoRefreshControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4691
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: AutoRefreshControlComponent, isStandalone: true, selector: "c8y-auto-refresh-control", inputs: { isAutoRefreshConnected: "isAutoRefreshConnected", autoRefreshSeconds: "autoRefreshSeconds", disableCounter: "disableCounter", isEnabled: "isEnabled", isLoading: "isLoading" }, outputs: { loadingChange: "loadingChange", refresh: "refresh" }, providers: [
|
|
4731
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: AutoRefreshControlComponent, isStandalone: true, selector: "c8y-auto-refresh-control", inputs: { isAutoRefreshConnected: "isAutoRefreshConnected", autoRefreshSeconds: "autoRefreshSeconds", disableCounter: "disableCounter", isEnabled: "isEnabled", isLoading: "isLoading" }, outputs: { loadingChange: "loadingChange", refresh: "refresh" }, host: { listeners: { "document:visibilitychange": "onVisibilityChange()" } }, providers: [
|
|
4692
4732
|
{
|
|
4693
4733
|
provide: NG_VALUE_ACCESSOR,
|
|
4694
4734
|
useExisting: forwardRef(() => AutoRefreshControlComponent),
|
|
4695
4735
|
multi: true
|
|
4696
4736
|
}
|
|
4697
|
-
], viewQueries: [{ propertyName: "countdownIntervalComponent", first: true, predicate: CountdownIntervalComponent, descendants: true }], ngImport: i0, template: "@let autoRefreshTooltip = (isEnabled ? DISABLE_AUTO_REFRESH : ENABLE_AUTO_REFRESH) | translate;\n@let countdownInterval = (autoRefreshSeconds$ | async) ?? DEFAULT_INTERVAL_VALUE;\n\n<button\n [class.btn]=\"disableCounter\"\n [class.btn-link]=\"disableCounter\"\n [class.c8y-realtime]=\"disableCounter\"\n [class.toggle-countdown]=\"!disableCounter\"\n [attr.aria-label]=\"autoRefreshTooltip\"\n [tooltip]=\"tooltipTpl\"\n placement=\"bottom\"\n container=\"body\"\n [delay]=\"500\"\n (click)=\"toggleIntervalRefresh(); $event.stopPropagation()\"\n [adaptivePosition]=\"false\"\n [disabled]=\"isLoading\"\n mode\n data-cy=\"global-date-context--Auto-refresh-toggle\"\n>\n <div class=\"d-flex a-i-center\">\n @if (!disableCounter) {\n <c8y-countdown-interval\n #countdown\n [hidden]=\"!isEnabled\"\n [countdownInterval]=\"countdownInterval\"\n [config]=\"countdownIntervalConfig\"\n ></c8y-countdown-interval>\n }\n\n @if (!isEnabled) {\n <i\n class=\"icon-20 text-primary\"\n [c8yIcon]=\"'pause-circle'\"\n data-cy=\"global-date-context--Auto-refresh-toggle-pause\"\n ></i>\n } @else if (disableCounter) {\n <span class=\"c8y-pulse m-0 active\"></span>\n }\n </div>\n</button>\n\n<ng-template #tooltipTpl>\n {{ autoRefreshTooltip }}\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: CountdownIntervalModule }, { kind: "component", type: i4.CountdownIntervalComponent, selector: "c8y-countdown-interval", inputs: ["countdownInterval", "config"], outputs: ["countdownEnded"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type:
|
|
4737
|
+
], viewQueries: [{ propertyName: "countdownIntervalComponent", first: true, predicate: CountdownIntervalComponent, descendants: true }], ngImport: i0, template: "@let autoRefreshTooltip = (isEnabled ? DISABLE_AUTO_REFRESH : ENABLE_AUTO_REFRESH) | translate;\n@let countdownInterval = (autoRefreshSeconds$ | async) ?? DEFAULT_INTERVAL_VALUE;\n\n<button\n [class.btn]=\"disableCounter\"\n [class.btn-link]=\"disableCounter\"\n [class.c8y-realtime]=\"disableCounter\"\n [class.toggle-countdown]=\"!disableCounter\"\n [attr.aria-label]=\"autoRefreshTooltip\"\n [tooltip]=\"tooltipTpl\"\n placement=\"bottom\"\n container=\"body\"\n [delay]=\"500\"\n (click)=\"toggleIntervalRefresh(); $event.stopPropagation()\"\n [adaptivePosition]=\"false\"\n [disabled]=\"isLoading\"\n mode\n data-cy=\"global-date-context--Auto-refresh-toggle\"\n>\n <div class=\"d-flex a-i-center\">\n @if (!disableCounter) {\n <c8y-countdown-interval\n #countdown\n [hidden]=\"!isEnabled\"\n [countdownInterval]=\"countdownInterval\"\n [config]=\"countdownIntervalConfig\"\n ></c8y-countdown-interval>\n }\n\n @if (!isEnabled) {\n <i\n class=\"icon-20 text-primary\"\n [c8yIcon]=\"'pause-circle'\"\n data-cy=\"global-date-context--Auto-refresh-toggle-pause\"\n ></i>\n } @else if (disableCounter) {\n <span class=\"c8y-pulse m-0 active\"></span>\n }\n </div>\n</button>\n\n<ng-template #tooltipTpl>\n {{ autoRefreshTooltip }}\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: CountdownIntervalModule }, { kind: "component", type: i4.CountdownIntervalComponent, selector: "c8y-countdown-interval", inputs: ["countdownInterval", "config"], outputs: ["countdownEnded"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i2.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: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4698
4738
|
}
|
|
4699
4739
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AutoRefreshControlComponent, decorators: [{
|
|
4700
4740
|
type: Component,
|
|
@@ -4722,6 +4762,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
4722
4762
|
type: Output
|
|
4723
4763
|
}], refresh: [{
|
|
4724
4764
|
type: Output
|
|
4765
|
+
}], onVisibilityChange: [{
|
|
4766
|
+
type: HostListener,
|
|
4767
|
+
args: ['document:visibilitychange']
|
|
4725
4768
|
}] } });
|
|
4726
4769
|
|
|
4727
4770
|
class TimeRangeDisplayComponent {
|
|
@@ -4765,7 +4808,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
4765
4808
|
* ```
|
|
4766
4809
|
*
|
|
4767
4810
|
*/
|
|
4768
|
-
class ContextControlsComponent {
|
|
4811
|
+
let ContextControlsComponent$1 = class ContextControlsComponent {
|
|
4769
4812
|
constructor() {
|
|
4770
4813
|
// Static properties
|
|
4771
4814
|
this.REFRESH_OPTION = REFRESH_OPTION;
|
|
@@ -4848,9 +4891,9 @@ class ContextControlsComponent {
|
|
|
4848
4891
|
return pick(settings, requiredKeys);
|
|
4849
4892
|
}
|
|
4850
4893
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ContextControlsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4851
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: ContextControlsComponent, isStandalone: true, selector: "c8y-context-controls", inputs: { showDisplayModeLabel: "showDisplayModeLabel", isLoading: "isLoading", settings: "settings", context: "context" }, outputs: { contextChange: "contextChange", refresh: "refresh", contextClick: "contextClick" }, ngImport: i0, template: "@if (form) {\n @let SHOW_TIME_CONTEXT = settings.showTimeContext;\n @let SHOW_AGGREGATION = settings.showAggregation;\n @let SHOW_AUTO_REFRESH = settings.showAutoRefresh;\n @let refreshIntervalValue = form?.get('refreshInterval')?.value;\n @let isLiveMode = refreshOption === REFRESH_OPTION.LIVE;\n\n @if (isLiveMode) {\n <form\n class=\"input-group\"\n [formGroup]=\"form\"\n >\n <c8y-auto-refresh-control\n #autoRefreshControl\n [isLoading]=\"isLoading\"\n [isAutoRefreshConnected]=\"isAutoRefreshConnected\"\n formControlName=\"isAutoRefreshEnabled\"\n [autoRefreshSeconds]=\"refreshIntervalValue\"\n (refresh)=\"refresh.emit()\"\n ></c8y-auto-refresh-control>\n <button\n class=\"btn-clean d-flex p-l-xs-16 p-r-xs-16 m-t-xs-8 m-b-xs-8\"\n style=\"margin-left: -1px\"\n (click)=\"contextClick.emit($event); $event.stopPropagation()\"\n >\n <div class=\"d-col a-i-start form-control\">\n <p class=\"text-muted fit-w text-10 l-h-1\">\n {{ 'Time mode' | translate }}\n </p>\n <p\n class=\"text-bold text-12 fit-w l-h-1\"\n data-cy=\"global-time-context-controls--Display-mode\"\n >\n {{ refreshOption | translate | titlecase }}\n </p>\n </div>\n\n @let interval = form.get('dateTimeContext')?.value?.interval;\n @let isCustomInterval = interval === 'custom';\n\n <c8y-time-range-display\n style=\"margin-left: -1px\"\n [dateTimeContext]=\"form.get('dateTimeContext')?.value\"\n ></c8y-time-range-display>\n\n @if (!(isAnySettingsEnabled$ | async)) {\n <div\n class=\"d-col a-i-center form-control\"\n style=\"margin-left: -1px\"\n >\n <i\n class=\"dlt-c8y-icon-disconnected icon-20 text-danger\"\n [tooltip]=\"'No synced widgets' | translate\"\n placement=\"right\"\n container=\"body\"\n [delay]=\"500\"\n data-cy=\"global-time-context-controls--Widgets-disconnected\"\n ></i>\n </div>\n }\n </button>\n </form>\n } @else {\n <form [formGroup]=\"form\">\n <button\n class=\"btn-clean d-flex p-l-xs-16 p-r-xs-16 m-t-xs-8 m-b-xs-8\"\n (click)=\"contextClick.emit($event); $event.stopPropagation()\"\n >\n <div class=\"d-col a-i-center form-control\">\n <i class=\"dlt-c8y-icon-schedule1 icon-20 text-primary\"></i>\n </div>\n\n <div\n class=\"d-col a-i-start form-control\"\n style=\"margin-left: -1px\"\n >\n <p class=\"text-muted fit-w text-10 l-h-1\">\n {{ 'Time mode' | translate }}\n </p>\n <p\n class=\"text-bold text-12 fit-w l-h-1\"\n data-cy=\"global-time-context-controls--Display-mode\"\n >\n {{ refreshOption | translate | titlecase }}\n </p>\n </div>\n\n <c8y-time-range-display\n style=\"margin-left: -1px\"\n [dateTimeContext]=\"form.get('dateTimeContext')?.value\"\n ></c8y-time-range-display>\n <c8y-aggregation-display\n style=\"margin-left: -1px\"\n [aggregation]=\"form.get('aggregation')?.value\"\n ></c8y-aggregation-display>\n\n @if (!(isAnySettingsEnabled$ | async)) {\n <div\n class=\"d-col a-i-center form-control\"\n style=\"margin-left: -1px\"\n >\n <i\n class=\"dlt-c8y-icon-disconnected icon-20 text-danger\"\n [tooltip]=\"'No synced widgets' | translate\"\n placement=\"right\"\n container=\"body\"\n [delay]=\"500\"\n data-cy=\"global-time-context-controls--Widgets-disconnected\"\n ></i>\n </div>\n }\n </button>\n </form>\n }\n}\n", dependencies: [{ kind: "ngmodule", type: TooltipModule }, { kind: "directive", type:
|
|
4852
|
-
}
|
|
4853
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ContextControlsComponent, decorators: [{
|
|
4894
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: ContextControlsComponent, isStandalone: true, selector: "c8y-context-controls", inputs: { showDisplayModeLabel: "showDisplayModeLabel", isLoading: "isLoading", settings: "settings", context: "context" }, outputs: { contextChange: "contextChange", refresh: "refresh", contextClick: "contextClick" }, ngImport: i0, template: "@if (form) {\n @let SHOW_TIME_CONTEXT = settings.showTimeContext;\n @let SHOW_AGGREGATION = settings.showAggregation;\n @let SHOW_AUTO_REFRESH = settings.showAutoRefresh;\n @let refreshIntervalValue = form?.get('refreshInterval')?.value;\n @let isLiveMode = refreshOption === REFRESH_OPTION.LIVE;\n\n @if (isLiveMode) {\n <form\n class=\"input-group\"\n [formGroup]=\"form\"\n >\n <c8y-auto-refresh-control\n #autoRefreshControl\n [isLoading]=\"isLoading\"\n [isAutoRefreshConnected]=\"isAutoRefreshConnected\"\n formControlName=\"isAutoRefreshEnabled\"\n [autoRefreshSeconds]=\"refreshIntervalValue\"\n (refresh)=\"refresh.emit()\"\n ></c8y-auto-refresh-control>\n <button\n class=\"btn-clean d-flex p-l-xs-16 p-r-xs-16 m-t-xs-8 m-b-xs-8\"\n style=\"margin-left: -1px\"\n (click)=\"contextClick.emit($event); $event.stopPropagation()\"\n >\n <div class=\"d-col a-i-start form-control\">\n <p class=\"text-muted fit-w text-10 l-h-1\">\n {{ 'Time mode' | translate }}\n </p>\n <p\n class=\"text-bold text-12 fit-w l-h-1\"\n data-cy=\"global-time-context-controls--Display-mode\"\n >\n {{ refreshOption | translate | titlecase }}\n </p>\n </div>\n\n @let interval = form.get('dateTimeContext')?.value?.interval;\n @let isCustomInterval = interval === 'custom';\n\n <c8y-time-range-display\n style=\"margin-left: -1px\"\n [dateTimeContext]=\"form.get('dateTimeContext')?.value\"\n ></c8y-time-range-display>\n\n @if (!(isAnySettingsEnabled$ | async)) {\n <div\n class=\"d-col a-i-center form-control\"\n style=\"margin-left: -1px\"\n >\n <i\n class=\"dlt-c8y-icon-disconnected icon-20 text-danger\"\n [tooltip]=\"'No synced widgets' | translate\"\n placement=\"right\"\n container=\"body\"\n [delay]=\"500\"\n data-cy=\"global-time-context-controls--Widgets-disconnected\"\n ></i>\n </div>\n }\n </button>\n </form>\n } @else {\n <form [formGroup]=\"form\">\n <button\n class=\"btn-clean d-flex p-l-xs-16 p-r-xs-16 m-t-xs-8 m-b-xs-8\"\n (click)=\"contextClick.emit($event); $event.stopPropagation()\"\n >\n <div class=\"d-col a-i-center form-control\">\n <i class=\"dlt-c8y-icon-schedule1 icon-20 text-primary\"></i>\n </div>\n\n <div\n class=\"d-col a-i-start form-control\"\n style=\"margin-left: -1px\"\n >\n <p class=\"text-muted fit-w text-10 l-h-1\">\n {{ 'Time mode' | translate }}\n </p>\n <p\n class=\"text-bold text-12 fit-w l-h-1\"\n data-cy=\"global-time-context-controls--Display-mode\"\n >\n {{ refreshOption | translate | titlecase }}\n </p>\n </div>\n\n <c8y-time-range-display\n style=\"margin-left: -1px\"\n [dateTimeContext]=\"form.get('dateTimeContext')?.value\"\n ></c8y-time-range-display>\n <c8y-aggregation-display\n style=\"margin-left: -1px\"\n [aggregation]=\"form.get('aggregation')?.value\"\n ></c8y-aggregation-display>\n\n @if (!(isAnySettingsEnabled$ | async)) {\n <div\n class=\"d-col a-i-center form-control\"\n style=\"margin-left: -1px\"\n >\n <i\n class=\"dlt-c8y-icon-disconnected icon-20 text-danger\"\n [tooltip]=\"'No synced widgets' | translate\"\n placement=\"right\"\n container=\"body\"\n [delay]=\"500\"\n data-cy=\"global-time-context-controls--Widgets-disconnected\"\n ></i>\n </div>\n }\n </button>\n </form>\n }\n}\n", dependencies: [{ kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i2.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: CollapseModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { 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: FormsModule$1 }, { kind: "ngmodule", type: PopoverModule }, { kind: "component", type: AutoRefreshControlComponent, selector: "c8y-auto-refresh-control", inputs: ["isAutoRefreshConnected", "autoRefreshSeconds", "disableCounter", "isEnabled", "isLoading"], outputs: ["loadingChange", "refresh"] }, { kind: "component", type: TimeRangeDisplayComponent, selector: "c8y-time-range-display", inputs: ["dateTimeContext", "mode"] }, { kind: "component", type: AggregationDisplayComponent, selector: "c8y-aggregation-display", inputs: ["aggregation"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: TitleCasePipe, name: "titlecase" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4895
|
+
};
|
|
4896
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ContextControlsComponent$1, decorators: [{
|
|
4854
4897
|
type: Component,
|
|
4855
4898
|
args: [{ selector: 'c8y-context-controls', standalone: true, imports: [
|
|
4856
4899
|
C8yTranslatePipe,
|
|
@@ -5383,14 +5426,14 @@ class GlobalContextComponent {
|
|
|
5383
5426
|
});
|
|
5384
5427
|
}
|
|
5385
5428
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: GlobalContextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5386
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: GlobalContextComponent, isStandalone: true, selector: "c8y-global-context", viewQueries: [{ propertyName: "configurationCollapseComponent", first: true, predicate: ConfigurationCollapseComponent, descendants: true }], ngImport: i0, template: "@if (globalContextState() !== null && isVisible()) {\n <c8y-context-controls\n [settings]=\"settings\"\n [context]=\"globalContextState()\"\n [isLoading]=\"globalContextService.isLoading()\"\n (refresh)=\"onRefresh()\"\n (contextChange)=\"onChanges($event)\"\n (contextClick)=\"gcs.toggle()\"\n ></c8y-context-controls>\n\n <c8y-configuration-collapse\n #gcs\n [context]=\"globalContextState()\"\n (contextChange)=\"onChanges($event)\"\n (refreshOptionChange)=\"onRefreshOptionChanges($event)\"\n (savePreferenceChange)=\"shouldSaveDashboardState = $event\"\n ></c8y-configuration-collapse>\n}\n", dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: TooltipModule }, { kind: "component", type: ContextControlsComponent, selector: "c8y-context-controls", inputs: ["showDisplayModeLabel", "isLoading", "settings", "context"], outputs: ["contextChange", "refresh", "contextClick"] }, { kind: "component", type: ConfigurationCollapseComponent, selector: "c8y-configuration-collapse", inputs: ["supportedModes", "context"], outputs: ["contextChange", "refreshOptionChange", "savePreferenceChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5429
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: GlobalContextComponent, isStandalone: true, selector: "c8y-global-context", viewQueries: [{ propertyName: "configurationCollapseComponent", first: true, predicate: ConfigurationCollapseComponent, descendants: true }], ngImport: i0, template: "@if (globalContextState() !== null && isVisible()) {\n <c8y-context-controls\n [settings]=\"settings\"\n [context]=\"globalContextState()\"\n [isLoading]=\"globalContextService.isLoading()\"\n (refresh)=\"onRefresh()\"\n (contextChange)=\"onChanges($event)\"\n (contextClick)=\"gcs.toggle()\"\n ></c8y-context-controls>\n\n <c8y-configuration-collapse\n #gcs\n [context]=\"globalContextState()\"\n (contextChange)=\"onChanges($event)\"\n (refreshOptionChange)=\"onRefreshOptionChanges($event)\"\n (savePreferenceChange)=\"shouldSaveDashboardState = $event\"\n ></c8y-configuration-collapse>\n}\n", dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: TooltipModule }, { kind: "component", type: ContextControlsComponent$1, selector: "c8y-context-controls", inputs: ["showDisplayModeLabel", "isLoading", "settings", "context"], outputs: ["contextChange", "refresh", "contextClick"] }, { kind: "component", type: ConfigurationCollapseComponent, selector: "c8y-configuration-collapse", inputs: ["supportedModes", "context"], outputs: ["contextChange", "refreshOptionChange", "savePreferenceChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5387
5430
|
}
|
|
5388
5431
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: GlobalContextComponent, decorators: [{
|
|
5389
5432
|
type: Component,
|
|
5390
5433
|
args: [{ standalone: true, imports: [
|
|
5391
5434
|
ReactiveFormsModule,
|
|
5392
5435
|
TooltipModule,
|
|
5393
|
-
ContextControlsComponent,
|
|
5436
|
+
ContextControlsComponent$1,
|
|
5394
5437
|
ConfigurationCollapseComponent
|
|
5395
5438
|
], selector: 'c8y-global-context', changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (globalContextState() !== null && isVisible()) {\n <c8y-context-controls\n [settings]=\"settings\"\n [context]=\"globalContextState()\"\n [isLoading]=\"globalContextService.isLoading()\"\n (refresh)=\"onRefresh()\"\n (contextChange)=\"onChanges($event)\"\n (contextClick)=\"gcs.toggle()\"\n ></c8y-context-controls>\n\n <c8y-configuration-collapse\n #gcs\n [context]=\"globalContextState()\"\n (contextChange)=\"onChanges($event)\"\n (refreshOptionChange)=\"onRefreshOptionChanges($event)\"\n (savePreferenceChange)=\"shouldSaveDashboardState = $event\"\n ></c8y-configuration-collapse>\n}\n" }]
|
|
5396
5439
|
}], ctorParameters: () => [], propDecorators: { configurationCollapseComponent: [{
|
|
@@ -5905,7 +5948,7 @@ class GlobalContextLinkControlsComponent {
|
|
|
5905
5948
|
</button>
|
|
5906
5949
|
<ng-template #masterTooltipTemplate>{{ masterTooltipText() | translate }}</ng-template>
|
|
5907
5950
|
}
|
|
5908
|
-
`, isInline: true, styles: [".btn-icon-dot[disabled]{cursor:not-allowed;opacity:.75}.btn-icon-dot.link-auto-unlinked,.btn-icon-dot.link-auto-unlinked:focus{box-shadow:0 0 0 2px var(--c8y-palette-status-danger);border-color:var(--c8y-palette-status-danger)}\n"], dependencies: [{ kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type:
|
|
5951
|
+
`, isInline: true, styles: [".btn-icon-dot[disabled]{cursor:not-allowed;opacity:.75}.btn-icon-dot.link-auto-unlinked,.btn-icon-dot.link-auto-unlinked:focus{box-shadow:0 0 0 2px var(--c8y-palette-status-danger);border-color:var(--c8y-palette-status-danger)}\n"], dependencies: [{ kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i2.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: "pipe", type: C8yTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5909
5952
|
}
|
|
5910
5953
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: GlobalContextLinkControlsComponent, decorators: [{
|
|
5911
5954
|
type: Component,
|
|
@@ -6289,6 +6332,8 @@ function resolveConfigurationValue(key, sources, localStateValues, globalStateVa
|
|
|
6289
6332
|
return undefined;
|
|
6290
6333
|
case 'eventSourceId':
|
|
6291
6334
|
return undefined;
|
|
6335
|
+
case 'isGlobalContextReady':
|
|
6336
|
+
return undefined;
|
|
6292
6337
|
default: {
|
|
6293
6338
|
// Exhaustive check: ensures all keys are handled at compile time
|
|
6294
6339
|
const _exhaustive = key;
|
|
@@ -8460,7 +8505,7 @@ class GlobalContextInlineComponent {
|
|
|
8460
8505
|
};
|
|
8461
8506
|
}
|
|
8462
8507
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: GlobalContextInlineComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8463
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: GlobalContextInlineComponent, isStandalone: true, selector: "c8y-global-context-inline", inputs: { widgetControls: { classPropertyName: "widgetControls", publicName: "widgetControls", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, dashboardChildForLegacy: { classPropertyName: "dashboardChildForLegacy", publicName: "dashboardChildForLegacy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { refresh: "refresh", globalContextChange: "globalContextChange" }, providers: [GlobalContextInlineOrchestratorService], viewQueries: [{ propertyName: "headerTemplateRef", first: true, predicate: ["headerContent"], descendants: true, read: TemplateRef, static: true }], exportAs: ["globalContextInline"], ngImport: i0, template: "<ng-template #headerContent>\n @let linkModel = linkDisplayModel();\n <ng-content select=\"#header\"></ng-content>\n\n @if (shouldShowHeaderLinks()) {\n <c8y-global-context-link-controls\n [linkStates]=\"linkModel.linkStates\"\n [controlConfigs]=\"linkModel.controlConfig\"\n (allLinksToggled)=\"toggleAllLinks($event)\"\n ></c8y-global-context-link-controls>\n }\n</ng-template>\n\n<ng-template #inlineContent>\n @let settings = inlineSettings();\n @let linkModel = linkDisplayModel();\n\n @if (form && settings) {\n <form\n class=\"d-flex gap-16 p-l-16 p-r-16 p-b-8
|
|
8508
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: GlobalContextInlineComponent, isStandalone: true, selector: "c8y-global-context-inline", inputs: { widgetControls: { classPropertyName: "widgetControls", publicName: "widgetControls", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, dashboardChildForLegacy: { classPropertyName: "dashboardChildForLegacy", publicName: "dashboardChildForLegacy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { refresh: "refresh", globalContextChange: "globalContextChange" }, providers: [GlobalContextInlineOrchestratorService], viewQueries: [{ propertyName: "headerTemplateRef", first: true, predicate: ["headerContent"], descendants: true, read: TemplateRef, static: true }], exportAs: ["globalContextInline"], ngImport: i0, template: "<ng-template #headerContent>\n @let linkModel = linkDisplayModel();\n <ng-content select=\"#header\"></ng-content>\n\n @if (shouldShowHeaderLinks()) {\n <c8y-global-context-link-controls\n [linkStates]=\"linkModel.linkStates\"\n [controlConfigs]=\"linkModel.controlConfig\"\n (allLinksToggled)=\"toggleAllLinks($event)\"\n ></c8y-global-context-link-controls>\n }\n</ng-template>\n\n<ng-template #inlineContent>\n @let settings = inlineSettings();\n @let linkModel = linkDisplayModel();\n\n @if (form && settings) {\n <form\n class=\"d-flex gap-16 p-l-16 p-r-16 inner-scroll\"\n [ngClass]=\"{\n 'p-b-8':\n settings.showTimeContext ||\n settings.showRefresh ||\n settings.showAutoRefresh ||\n settings.showAggregation\n }\"\n [formGroup]=\"form\"\n >\n <div class=\"input-group w-auto input-group-sm\">\n @if (settings.showAggregation) {\n <c8y-aggregation-picker\n data-cy=\"global-inline-date-context--Aggregation-display\"\n [disabledAggregations]=\"getDisabledAggregations()\"\n formControlName=\"aggregation\"\n [resetToDefault]=\"true\"\n ></c8y-aggregation-picker>\n }\n\n @if (settings.showAutoRefresh) {\n <c8y-auto-refresh-control\n [isLoading]=\"isLoading()\"\n [disableCounter]=\"shouldDisableCounter\"\n formControlName=\"isAutoRefreshEnabled\"\n [autoRefreshSeconds]=\"getAutoRefreshSeconds()\"\n [isAutoRefreshConnected]=\"linkModel.linkStates.isAutoRefreshEnabled ?? false\"\n (refresh)=\"onLocalRefreshTrigger()\"\n ></c8y-auto-refresh-control>\n }\n\n @if (settings.showTimeContext) {\n @let isHistoryMode = form.get('refreshOption')?.value === REFRESH_OPTION.HISTORY;\n <c8y-date-time-context-picker\n style=\"margin-left: -1px\"\n formControlName=\"dateTimeContext\"\n [shouldDisableInterval]=\"getIntervalDisableConfig()\"\n [config]=\"\n isHistoryMode\n ? { showDateTo: true, showDateFrom: true }\n : { showDateTo: false, showDateFrom: true }\n \"\n ></c8y-date-time-context-picker>\n }\n\n @if (settings.showRefresh) {\n <div class=\"input-group-btn\">\n <button\n class=\"btn btn-default\"\n [attr.aria-label]=\"'Refresh' | translate\"\n [tooltip]=\"'Refresh' | translate\"\n placement=\"bottom\"\n container=\"body\"\n type=\"button\"\n data-cy=\"global-inline-date-context--reload-button\"\n [adaptivePosition]=\"false\"\n [delay]=\"500\"\n [disabled]=\"isLoading()\"\n (click)=\"refresh.emit(null)\"\n >\n <i\n [class.icon-spin]=\"isLoading()\"\n [c8yIcon]=\"'refresh'\"\n ></i>\n </button>\n </div>\n }\n </div>\n </form>\n }\n\n <ng-content select=\"#body\"></ng-content>\n</ng-template>\n\n@switch (effectiveConfig().displayMode) {\n @case (GLOBAL_CONTEXT_DISPLAY_MODE.CONFIG) {\n <ng-container [ngTemplateOutlet]=\"inlineContent\"></ng-container>\n }\n @case (GLOBAL_CONTEXT_DISPLAY_MODE.VIEW_AND_CONFIG) {\n <ng-container [ngTemplateOutlet]=\"headerContent\"></ng-container>\n <ng-container [ngTemplateOutlet]=\"inlineContent\"></ng-container>\n }\n @default {\n @if (shouldRenderHeaderInline()) {\n <ng-container [ngTemplateOutlet]=\"headerContent\"></ng-container>\n }\n <ng-container [ngTemplateOutlet]=\"inlineContent\"></ng-container>\n }\n}\n", dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { 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: "component", type: GlobalContextLinkControlsComponent, selector: "c8y-global-context-link-controls", inputs: ["linkStates", "controlConfigs"], outputs: ["allLinksToggled"] }, { kind: "component", type: AggregationPickerComponent, selector: "c8y-aggregation-picker", inputs: ["disabledAggregations", "resetToDefault", "layout"] }, { kind: "component", type: AutoRefreshControlComponent, selector: "c8y-auto-refresh-control", inputs: ["isAutoRefreshConnected", "autoRefreshSeconds", "disableCounter", "isEnabled", "isLoading"], outputs: ["loadingChange", "refresh"] }, { kind: "component", type: DateTimeContextPickerComponent, selector: "c8y-date-time-context-picker", inputs: ["disabled", "shouldDisableInterval", "config"] }, { kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i2.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: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
8464
8509
|
}
|
|
8465
8510
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: GlobalContextInlineComponent, decorators: [{
|
|
8466
8511
|
type: Component,
|
|
@@ -8473,8 +8518,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
8473
8518
|
IconDirective,
|
|
8474
8519
|
C8yTranslatePipe,
|
|
8475
8520
|
TooltipModule,
|
|
8476
|
-
NgTemplateOutlet
|
|
8477
|
-
|
|
8521
|
+
NgTemplateOutlet,
|
|
8522
|
+
NgClass
|
|
8523
|
+
], selector: 'c8y-global-context-inline', exportAs: 'globalContextInline', providers: [GlobalContextInlineOrchestratorService], template: "<ng-template #headerContent>\n @let linkModel = linkDisplayModel();\n <ng-content select=\"#header\"></ng-content>\n\n @if (shouldShowHeaderLinks()) {\n <c8y-global-context-link-controls\n [linkStates]=\"linkModel.linkStates\"\n [controlConfigs]=\"linkModel.controlConfig\"\n (allLinksToggled)=\"toggleAllLinks($event)\"\n ></c8y-global-context-link-controls>\n }\n</ng-template>\n\n<ng-template #inlineContent>\n @let settings = inlineSettings();\n @let linkModel = linkDisplayModel();\n\n @if (form && settings) {\n <form\n class=\"d-flex gap-16 p-l-16 p-r-16 inner-scroll\"\n [ngClass]=\"{\n 'p-b-8':\n settings.showTimeContext ||\n settings.showRefresh ||\n settings.showAutoRefresh ||\n settings.showAggregation\n }\"\n [formGroup]=\"form\"\n >\n <div class=\"input-group w-auto input-group-sm\">\n @if (settings.showAggregation) {\n <c8y-aggregation-picker\n data-cy=\"global-inline-date-context--Aggregation-display\"\n [disabledAggregations]=\"getDisabledAggregations()\"\n formControlName=\"aggregation\"\n [resetToDefault]=\"true\"\n ></c8y-aggregation-picker>\n }\n\n @if (settings.showAutoRefresh) {\n <c8y-auto-refresh-control\n [isLoading]=\"isLoading()\"\n [disableCounter]=\"shouldDisableCounter\"\n formControlName=\"isAutoRefreshEnabled\"\n [autoRefreshSeconds]=\"getAutoRefreshSeconds()\"\n [isAutoRefreshConnected]=\"linkModel.linkStates.isAutoRefreshEnabled ?? false\"\n (refresh)=\"onLocalRefreshTrigger()\"\n ></c8y-auto-refresh-control>\n }\n\n @if (settings.showTimeContext) {\n @let isHistoryMode = form.get('refreshOption')?.value === REFRESH_OPTION.HISTORY;\n <c8y-date-time-context-picker\n style=\"margin-left: -1px\"\n formControlName=\"dateTimeContext\"\n [shouldDisableInterval]=\"getIntervalDisableConfig()\"\n [config]=\"\n isHistoryMode\n ? { showDateTo: true, showDateFrom: true }\n : { showDateTo: false, showDateFrom: true }\n \"\n ></c8y-date-time-context-picker>\n }\n\n @if (settings.showRefresh) {\n <div class=\"input-group-btn\">\n <button\n class=\"btn btn-default\"\n [attr.aria-label]=\"'Refresh' | translate\"\n [tooltip]=\"'Refresh' | translate\"\n placement=\"bottom\"\n container=\"body\"\n type=\"button\"\n data-cy=\"global-inline-date-context--reload-button\"\n [adaptivePosition]=\"false\"\n [delay]=\"500\"\n [disabled]=\"isLoading()\"\n (click)=\"refresh.emit(null)\"\n >\n <i\n [class.icon-spin]=\"isLoading()\"\n [c8yIcon]=\"'refresh'\"\n ></i>\n </button>\n </div>\n }\n </div>\n </form>\n }\n\n <ng-content select=\"#body\"></ng-content>\n</ng-template>\n\n@switch (effectiveConfig().displayMode) {\n @case (GLOBAL_CONTEXT_DISPLAY_MODE.CONFIG) {\n <ng-container [ngTemplateOutlet]=\"inlineContent\"></ng-container>\n }\n @case (GLOBAL_CONTEXT_DISPLAY_MODE.VIEW_AND_CONFIG) {\n <ng-container [ngTemplateOutlet]=\"headerContent\"></ng-container>\n <ng-container [ngTemplateOutlet]=\"inlineContent\"></ng-container>\n }\n @default {\n @if (shouldRenderHeaderInline()) {\n <ng-container [ngTemplateOutlet]=\"headerContent\"></ng-container>\n }\n <ng-container [ngTemplateOutlet]=\"inlineContent\"></ng-container>\n }\n}\n" }]
|
|
8478
8524
|
}], ctorParameters: () => [], propDecorators: { widgetControls: [{ type: i0.Input, args: [{ isSignal: true, alias: "widgetControls", required: true }] }], config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: false }] }], isLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "isLoading", required: false }] }], dashboardChildForLegacy: [{ type: i0.Input, args: [{ isSignal: true, alias: "dashboardChildForLegacy", required: false }] }], refresh: [{ type: i0.Output, args: ["refresh"] }], globalContextChange: [{ type: i0.Output, args: ["globalContextChange"] }], headerTemplateRef: [{
|
|
8479
8525
|
type: ViewChild,
|
|
8480
8526
|
args: ['headerContent', { static: true, read: TemplateRef }]
|
|
@@ -9043,7 +9089,7 @@ class ConfigContextSelectorComponent {
|
|
|
9043
9089
|
}
|
|
9044
9090
|
</form>
|
|
9045
9091
|
}
|
|
9046
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1
|
|
9092
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: FormsModule }, { 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.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { 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: PopoverModule }, { kind: "directive", type: i2$2.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: C8yTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
9047
9093
|
}
|
|
9048
9094
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ConfigContextSelectorComponent, decorators: [{
|
|
9049
9095
|
type: Component,
|
|
@@ -9373,7 +9419,7 @@ class GlobalContextWidgetConfigComponent {
|
|
|
9373
9419
|
></c8y-global-context-config>
|
|
9374
9420
|
</fieldset>
|
|
9375
9421
|
}
|
|
9376
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1
|
|
9422
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { 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: "component", type: ConfigContextSelectorComponent, selector: "c8y-config-context-selector" }, { kind: "component", type: GlobalContextConfigComponent, selector: "c8y-global-context-config", inputs: ["config", "isLoading", "widgetControls", "liveSnapshot", "historySnapshot"], outputs: ["refresh", "globalContextChange"] }, { kind: "ngmodule", type: PopoverModule }, { kind: "directive", type: i2$2.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: C8yTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
9377
9423
|
}
|
|
9378
9424
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: GlobalContextWidgetConfigComponent, decorators: [{
|
|
9379
9425
|
type: Component,
|
|
@@ -9475,7 +9521,7 @@ class RealtimeControlComponent {
|
|
|
9475
9521
|
useExisting: forwardRef(() => RealtimeControlComponent),
|
|
9476
9522
|
multi: true
|
|
9477
9523
|
}
|
|
9478
|
-
], ngImport: i0, template: "@let buttonLabel = (isActive ? disableRealtimeLabel : enableRealtimeLabel) | translate;\n\n<button\n class=\"btn btn-icon c8y-realtime\"\n [attr.aria-label]=\"buttonLabel\"\n [tooltip]=\"tooltipTpl\"\n placement=\"top\"\n container=\"body\"\n type=\"button\"\n data-cy=\"global-context--realtime-toggle\"\n (click)=\"onButtonClick()\"\n [adaptivePosition]=\"false\"\n [delay]=\"500\"\n [disabled]=\"disabled\"\n>\n <span\n class=\"c8y-pulse m-0\"\n [class.active]=\"isActive\"\n [class.inactive]=\"!isActive\"\n ></span>\n</button>\n<ng-template #tooltipTpl>\n {{ buttonLabel }}\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: TooltipModule }, { kind: "directive", type:
|
|
9524
|
+
], ngImport: i0, template: "@let buttonLabel = (isActive ? disableRealtimeLabel : enableRealtimeLabel) | translate;\n\n<button\n class=\"btn btn-icon c8y-realtime\"\n [attr.aria-label]=\"buttonLabel\"\n [tooltip]=\"tooltipTpl\"\n placement=\"top\"\n container=\"body\"\n type=\"button\"\n data-cy=\"global-context--realtime-toggle\"\n (click)=\"onButtonClick()\"\n [adaptivePosition]=\"false\"\n [delay]=\"500\"\n [disabled]=\"disabled\"\n>\n <span\n class=\"c8y-pulse m-0\"\n [class.active]=\"isActive\"\n [class.inactive]=\"!isActive\"\n ></span>\n</button>\n<ng-template #tooltipTpl>\n {{ buttonLabel }}\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i2.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: FormsModule }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
9479
9525
|
}
|
|
9480
9526
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: RealtimeControlComponent, decorators: [{
|
|
9481
9527
|
type: Component,
|
|
@@ -9596,7 +9642,7 @@ class PreviewControlsComponent {
|
|
|
9596
9642
|
this.config.displayMode = GLOBAL_CONTEXT_DISPLAY_MODE.DASHBOARD;
|
|
9597
9643
|
}
|
|
9598
9644
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: PreviewControlsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
9599
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: PreviewControlsComponent, isStandalone: true, selector: "c8y-preview-controls", inputs: { widgetControls: "widgetControls", config: "config" }, ngImport: i0, template: "<!-- Main Controls -->\n@let isConfigMode = config?.displayMode === GLOBAL_CONTEXT_DISPLAY_MODE.CONFIG;\n@let settings = inlineControlsSettings$ | async;\n\n@if (form && settings) {\n <form\n class=\"d-flex gap-16 p-l-16 p-r-16 p-b-8 inner-scroll\"\n [formGroup]=\"form\"\n >\n <!-- Control Group Container -->\n <div class=\"input-group w-auto\">\n <!-- Aggregation Picker -->\n @if (settings.showAggregation) {\n <c8y-aggregation-picker\n formControlName=\"aggregation\"\n [resetToDefault]=\"true\"\n ></c8y-aggregation-picker>\n }\n\n <!-- Auto Refresh Controls -->\n @if (settings.showAutoRefresh) {\n <!-- Auto Refresh Toggle -->\n <c8y-auto-refresh-control\n [isLoading]=\"isLoading\"\n [disableCounter]=\"shouldDisableCounter\"\n formControlName=\"isAutoRefreshEnabled\"\n [autoRefreshSeconds]=\"form.get('refreshInterval')?.value\"\n ></c8y-auto-refresh-control>\n }\n\n @if (settings.showTimeContext) {\n @let isHistoryMode = form.get('refreshOption')?.value === REFRESH_OPTION.HISTORY;\n @let configValue =\n isHistoryMode\n ? {\n showDateTo: true,\n showDateFrom: true\n }\n : {\n showDateTo: false,\n showDateFrom: true\n };\n <c8y-date-time-context-picker\n style=\"margin-left: -1px\"\n formControlName=\"dateTimeContext\"\n [shouldDisableInterval]=\"shouldDisableCustomInterval\"\n [config]=\"configValue\"\n ></c8y-date-time-context-picker>\n }\n\n <!-- Manual Refresh Button -->\n @if (settings.showRefresh) {\n <div class=\"input-group-btn\">\n <button\n class=\"btn btn-default\"\n [attr.aria-label]=\"'Refresh' | translate\"\n [tooltip]=\"'Refresh' | translate\"\n placement=\"bottom\"\n type=\"button\"\n [adaptivePosition]=\"false\"\n [delay]=\"500\"\n [disabled]=\"isLoading\"\n >\n <i\n [class.icon-spin]=\"isLoading\"\n [c8yIcon]=\"'refresh'\"\n ></i>\n </button>\n </div>\n }\n </div>\n </form>\n}\n", styles: [":host{position:relative;display:block;cursor:not-allowed}:host form{position:relative;pointer-events:none;-webkit-user-select:none;user-select:none}:host form:after{content:\"\";position:absolute;inset:0;background:#ffffff0d;z-index:1;pointer-events:none}:host form button,:host form input,:host form select,:host form .dropdown-toggle,:host form .btn{cursor:not-allowed!important;opacity:.85}:host form *{pointer-events:none!important;-webkit-user-select:none!important;user-select:none!important}\n"], dependencies: [{ kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1
|
|
9645
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: PreviewControlsComponent, isStandalone: true, selector: "c8y-preview-controls", inputs: { widgetControls: "widgetControls", config: "config" }, ngImport: i0, template: "<!-- Main Controls -->\n@let isConfigMode = config?.displayMode === GLOBAL_CONTEXT_DISPLAY_MODE.CONFIG;\n@let settings = inlineControlsSettings$ | async;\n\n@if (form && settings) {\n <form\n class=\"d-flex gap-16 p-l-16 p-r-16 p-b-8 inner-scroll\"\n [formGroup]=\"form\"\n >\n <!-- Control Group Container -->\n <div class=\"input-group w-auto\">\n <!-- Aggregation Picker -->\n @if (settings.showAggregation) {\n <c8y-aggregation-picker\n formControlName=\"aggregation\"\n [resetToDefault]=\"true\"\n ></c8y-aggregation-picker>\n }\n\n <!-- Auto Refresh Controls -->\n @if (settings.showAutoRefresh) {\n <!-- Auto Refresh Toggle -->\n <c8y-auto-refresh-control\n [isLoading]=\"isLoading\"\n [disableCounter]=\"shouldDisableCounter\"\n formControlName=\"isAutoRefreshEnabled\"\n [autoRefreshSeconds]=\"form.get('refreshInterval')?.value\"\n ></c8y-auto-refresh-control>\n }\n\n @if (settings.showTimeContext) {\n @let isHistoryMode = form.get('refreshOption')?.value === REFRESH_OPTION.HISTORY;\n @let configValue =\n isHistoryMode\n ? {\n showDateTo: true,\n showDateFrom: true\n }\n : {\n showDateTo: false,\n showDateFrom: true\n };\n <c8y-date-time-context-picker\n style=\"margin-left: -1px\"\n formControlName=\"dateTimeContext\"\n [shouldDisableInterval]=\"shouldDisableCustomInterval\"\n [config]=\"configValue\"\n ></c8y-date-time-context-picker>\n }\n\n <!-- Manual Refresh Button -->\n @if (settings.showRefresh) {\n <div class=\"input-group-btn\">\n <button\n class=\"btn btn-default\"\n [attr.aria-label]=\"'Refresh' | translate\"\n [tooltip]=\"'Refresh' | translate\"\n placement=\"bottom\"\n type=\"button\"\n [adaptivePosition]=\"false\"\n [delay]=\"500\"\n [disabled]=\"isLoading\"\n >\n <i\n [class.icon-spin]=\"isLoading\"\n [c8yIcon]=\"'refresh'\"\n ></i>\n </button>\n </div>\n }\n </div>\n </form>\n}\n", styles: [":host{position:relative;display:block;cursor:not-allowed}:host form{position:relative;pointer-events:none;-webkit-user-select:none;user-select:none}:host form:after{content:\"\";position:absolute;inset:0;background:#ffffff0d;z-index:1;pointer-events:none}:host form button,:host form input,:host form select,:host form .dropdown-toggle,:host form .btn{cursor:not-allowed!important;opacity:.85}:host form *{pointer-events:none!important;-webkit-user-select:none!important;user-select:none!important}\n"], dependencies: [{ kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { 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: "component", type: DateTimeContextPickerComponent, selector: "c8y-date-time-context-picker", inputs: ["disabled", "shouldDisableInterval", "config"] }, { kind: "component", type: AggregationPickerComponent, selector: "c8y-aggregation-picker", inputs: ["disabledAggregations", "resetToDefault", "layout"] }, { kind: "component", type: AutoRefreshControlComponent, selector: "c8y-auto-refresh-control", inputs: ["isAutoRefreshConnected", "autoRefreshSeconds", "disableCounter", "isEnabled", "isLoading"], outputs: ["loadingChange", "refresh"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i2.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: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
9600
9646
|
}
|
|
9601
9647
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: PreviewControlsComponent, decorators: [{
|
|
9602
9648
|
type: Component,
|
|
@@ -10690,7 +10736,1016 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
10690
10736
|
type: Output
|
|
10691
10737
|
}] } });
|
|
10692
10738
|
|
|
10693
|
-
|
|
10739
|
+
/** Context control feature constants for type-safe access */
|
|
10740
|
+
const CONTEXT_FEATURE = {
|
|
10741
|
+
/** Time range selector for live mode (relative time window that moves with current time) */
|
|
10742
|
+
LIVE_TIME: 'liveTime',
|
|
10743
|
+
/** Time range selector for history mode (fixed date range for historical analysis) */
|
|
10744
|
+
HISTORY_TIME: 'historyTime',
|
|
10745
|
+
/** Data aggregation options (hourly, daily, etc.) - history mode only */
|
|
10746
|
+
AGGREGATION: 'aggregation',
|
|
10747
|
+
/** Auto-refresh toggle (fixed 5s interval) - live mode only */
|
|
10748
|
+
AUTO_REFRESH: 'autoRefresh',
|
|
10749
|
+
/** Manual refresh button */
|
|
10750
|
+
REFRESH: 'refresh'
|
|
10751
|
+
};
|
|
10752
|
+
/** Preset name constants for type-safe access */
|
|
10753
|
+
const PRESET_NAME = {
|
|
10754
|
+
DEFAULT: 'default',
|
|
10755
|
+
ALARM_LIST: 'alarmList',
|
|
10756
|
+
CHART: 'chart',
|
|
10757
|
+
LIVE_ONLY: 'liveOnly',
|
|
10758
|
+
HISTORY_ONLY: 'historyOnly',
|
|
10759
|
+
ALARM_LIST_CONFIG: 'alarmListConfig',
|
|
10760
|
+
ALARM_LIST_LEGACY: 'alarmListLegacy'
|
|
10761
|
+
};
|
|
10762
|
+
/** Control presets for different widget types (mode constraints applied by applyModeConstraints) */
|
|
10763
|
+
const CONTROL_PRESETS = {
|
|
10764
|
+
/** Full-featured preset for most widgets (supports both live and history modes) */
|
|
10765
|
+
[PRESET_NAME.DEFAULT]: {
|
|
10766
|
+
dashboard: [
|
|
10767
|
+
CONTEXT_FEATURE.LIVE_TIME,
|
|
10768
|
+
CONTEXT_FEATURE.HISTORY_TIME,
|
|
10769
|
+
CONTEXT_FEATURE.AUTO_REFRESH
|
|
10770
|
+
],
|
|
10771
|
+
config: [CONTEXT_FEATURE.LIVE_TIME, CONTEXT_FEATURE.HISTORY_TIME, CONTEXT_FEATURE.AUTO_REFRESH],
|
|
10772
|
+
view_and_config: [
|
|
10773
|
+
CONTEXT_FEATURE.LIVE_TIME,
|
|
10774
|
+
CONTEXT_FEATURE.HISTORY_TIME,
|
|
10775
|
+
CONTEXT_FEATURE.AUTO_REFRESH,
|
|
10776
|
+
CONTEXT_FEATURE.AGGREGATION,
|
|
10777
|
+
CONTEXT_FEATURE.REFRESH
|
|
10778
|
+
]
|
|
10779
|
+
},
|
|
10780
|
+
/** For alarm/event lists (supports both live and history modes) */
|
|
10781
|
+
[PRESET_NAME.ALARM_LIST]: {
|
|
10782
|
+
dashboard: [
|
|
10783
|
+
CONTEXT_FEATURE.LIVE_TIME,
|
|
10784
|
+
CONTEXT_FEATURE.HISTORY_TIME,
|
|
10785
|
+
CONTEXT_FEATURE.AUTO_REFRESH
|
|
10786
|
+
],
|
|
10787
|
+
config: [CONTEXT_FEATURE.AUTO_REFRESH],
|
|
10788
|
+
view_and_config: [
|
|
10789
|
+
CONTEXT_FEATURE.LIVE_TIME,
|
|
10790
|
+
CONTEXT_FEATURE.HISTORY_TIME,
|
|
10791
|
+
CONTEXT_FEATURE.AUTO_REFRESH
|
|
10792
|
+
]
|
|
10793
|
+
},
|
|
10794
|
+
/** For alarm/event lists in config mode (supports both live and history modes with time in config) */
|
|
10795
|
+
[PRESET_NAME.ALARM_LIST_CONFIG]: {
|
|
10796
|
+
dashboard: [
|
|
10797
|
+
CONTEXT_FEATURE.LIVE_TIME,
|
|
10798
|
+
CONTEXT_FEATURE.HISTORY_TIME,
|
|
10799
|
+
CONTEXT_FEATURE.AUTO_REFRESH
|
|
10800
|
+
],
|
|
10801
|
+
config: [
|
|
10802
|
+
CONTEXT_FEATURE.LIVE_TIME,
|
|
10803
|
+
CONTEXT_FEATURE.HISTORY_TIME,
|
|
10804
|
+
CONTEXT_FEATURE.AUTO_REFRESH,
|
|
10805
|
+
CONTEXT_FEATURE.AGGREGATION
|
|
10806
|
+
],
|
|
10807
|
+
view_and_config: [
|
|
10808
|
+
CONTEXT_FEATURE.LIVE_TIME,
|
|
10809
|
+
CONTEXT_FEATURE.HISTORY_TIME,
|
|
10810
|
+
CONTEXT_FEATURE.AUTO_REFRESH
|
|
10811
|
+
]
|
|
10812
|
+
},
|
|
10813
|
+
/** For charts with aggregation support (supports both live and history modes) */
|
|
10814
|
+
[PRESET_NAME.CHART]: {
|
|
10815
|
+
dashboard: [
|
|
10816
|
+
CONTEXT_FEATURE.LIVE_TIME,
|
|
10817
|
+
CONTEXT_FEATURE.HISTORY_TIME,
|
|
10818
|
+
CONTEXT_FEATURE.AUTO_REFRESH
|
|
10819
|
+
],
|
|
10820
|
+
config: [CONTEXT_FEATURE.LIVE_TIME, CONTEXT_FEATURE.HISTORY_TIME, CONTEXT_FEATURE.AUTO_REFRESH],
|
|
10821
|
+
view_and_config: [
|
|
10822
|
+
CONTEXT_FEATURE.LIVE_TIME,
|
|
10823
|
+
CONTEXT_FEATURE.HISTORY_TIME,
|
|
10824
|
+
CONTEXT_FEATURE.AGGREGATION,
|
|
10825
|
+
CONTEXT_FEATURE.AUTO_REFRESH,
|
|
10826
|
+
CONTEXT_FEATURE.REFRESH
|
|
10827
|
+
]
|
|
10828
|
+
},
|
|
10829
|
+
/** For live-only widgets (no history mode support) */
|
|
10830
|
+
[PRESET_NAME.LIVE_ONLY]: {
|
|
10831
|
+
dashboard: [CONTEXT_FEATURE.LIVE_TIME, CONTEXT_FEATURE.AUTO_REFRESH],
|
|
10832
|
+
config: [CONTEXT_FEATURE.LIVE_TIME, CONTEXT_FEATURE.AUTO_REFRESH],
|
|
10833
|
+
view_and_config: [
|
|
10834
|
+
CONTEXT_FEATURE.LIVE_TIME,
|
|
10835
|
+
CONTEXT_FEATURE.AUTO_REFRESH,
|
|
10836
|
+
CONTEXT_FEATURE.REFRESH
|
|
10837
|
+
]
|
|
10838
|
+
},
|
|
10839
|
+
/** For history-only widgets (no live mode support) */
|
|
10840
|
+
[PRESET_NAME.HISTORY_ONLY]: {
|
|
10841
|
+
dashboard: [CONTEXT_FEATURE.HISTORY_TIME],
|
|
10842
|
+
config: [CONTEXT_FEATURE.HISTORY_TIME, CONTEXT_FEATURE.AGGREGATION],
|
|
10843
|
+
view_and_config: [
|
|
10844
|
+
CONTEXT_FEATURE.HISTORY_TIME,
|
|
10845
|
+
CONTEXT_FEATURE.AGGREGATION,
|
|
10846
|
+
CONTEXT_FEATURE.REFRESH
|
|
10847
|
+
]
|
|
10848
|
+
},
|
|
10849
|
+
[PRESET_NAME.ALARM_LIST_LEGACY]: {
|
|
10850
|
+
dashboard: [
|
|
10851
|
+
CONTEXT_FEATURE.LIVE_TIME,
|
|
10852
|
+
CONTEXT_FEATURE.HISTORY_TIME,
|
|
10853
|
+
CONTEXT_FEATURE.AUTO_REFRESH
|
|
10854
|
+
],
|
|
10855
|
+
config: [CONTEXT_FEATURE.AUTO_REFRESH, CONTEXT_FEATURE.REFRESH],
|
|
10856
|
+
view_and_config: [
|
|
10857
|
+
CONTEXT_FEATURE.LIVE_TIME,
|
|
10858
|
+
CONTEXT_FEATURE.HISTORY_TIME,
|
|
10859
|
+
CONTEXT_FEATURE.AUTO_REFRESH
|
|
10860
|
+
]
|
|
10861
|
+
}
|
|
10862
|
+
};
|
|
10863
|
+
/**
|
|
10864
|
+
* Apply mode constraints (hard rules) to filter controls based on refresh option.
|
|
10865
|
+
*
|
|
10866
|
+
* @param controls - Array of control features
|
|
10867
|
+
* @param refreshOption - Current refresh option (REFRESH_OPTION.LIVE or REFRESH_OPTION.HISTORY)
|
|
10868
|
+
* @returns Filtered array with mode constraints applied
|
|
10869
|
+
*/
|
|
10870
|
+
function applyModeConstraints(controls, refreshOption) {
|
|
10871
|
+
if (refreshOption === REFRESH_OPTION.HISTORY) {
|
|
10872
|
+
// History mode: no auto-refresh, no live time
|
|
10873
|
+
return controls.filter(c => c !== CONTEXT_FEATURE.AUTO_REFRESH && c !== CONTEXT_FEATURE.LIVE_TIME);
|
|
10874
|
+
}
|
|
10875
|
+
if (refreshOption === REFRESH_OPTION.LIVE) {
|
|
10876
|
+
// Live mode: no aggregation, no history time
|
|
10877
|
+
return controls.filter(c => c !== CONTEXT_FEATURE.AGGREGATION && c !== CONTEXT_FEATURE.HISTORY_TIME);
|
|
10878
|
+
}
|
|
10879
|
+
return controls;
|
|
10880
|
+
}
|
|
10881
|
+
/**
|
|
10882
|
+
* Get supported modes from a preset definition.
|
|
10883
|
+
* Modes are derived from features:
|
|
10884
|
+
* - LIVE mode: supported if preset has AUTO_REFRESH (LIVE_TIME is optional)
|
|
10885
|
+
* - HISTORY mode: supported if preset has HISTORY_TIME
|
|
10886
|
+
*
|
|
10887
|
+
* @param controls - Preset name or definition
|
|
10888
|
+
* @param displayMode - Current display mode
|
|
10889
|
+
* @returns Array of supported refresh options
|
|
10890
|
+
*/
|
|
10891
|
+
function getSupportedModes(controls, displayMode) {
|
|
10892
|
+
const presetDef = typeof controls === 'string' ? CONTROL_PRESETS[controls] : controls;
|
|
10893
|
+
const features = presetDef[displayMode];
|
|
10894
|
+
const modes = [];
|
|
10895
|
+
// Support LIVE if has autoRefresh (with optional liveTime)
|
|
10896
|
+
if (features.includes(CONTEXT_FEATURE.AUTO_REFRESH)) {
|
|
10897
|
+
modes.push(REFRESH_OPTION.LIVE);
|
|
10898
|
+
}
|
|
10899
|
+
// Support HISTORY if has historyTime
|
|
10900
|
+
if (features.includes(CONTEXT_FEATURE.HISTORY_TIME)) {
|
|
10901
|
+
modes.push(REFRESH_OPTION.HISTORY);
|
|
10902
|
+
}
|
|
10903
|
+
// Fallback to LIVE if no mode features detected
|
|
10904
|
+
return modes.length > 0 ? modes : [REFRESH_OPTION.LIVE];
|
|
10905
|
+
}
|
|
10906
|
+
/**
|
|
10907
|
+
* Convert controls preset to GlobalContextSettings for registration.
|
|
10908
|
+
*/
|
|
10909
|
+
function controlsToSettings(controls, displayMode, refreshOption) {
|
|
10910
|
+
const presetDef = typeof controls === 'string' ? CONTROL_PRESETS[controls] : controls;
|
|
10911
|
+
const activeControls = applyModeConstraints(presetDef[displayMode], refreshOption);
|
|
10912
|
+
return {
|
|
10913
|
+
showTimeContext: activeControls.includes(CONTEXT_FEATURE.LIVE_TIME) ||
|
|
10914
|
+
activeControls.includes(CONTEXT_FEATURE.HISTORY_TIME),
|
|
10915
|
+
showAutoRefresh: activeControls.includes(CONTEXT_FEATURE.AUTO_REFRESH),
|
|
10916
|
+
showRefreshInterval: false,
|
|
10917
|
+
showAggregation: activeControls.includes(CONTEXT_FEATURE.AGGREGATION),
|
|
10918
|
+
showRefresh: activeControls.includes(CONTEXT_FEATURE.REFRESH)
|
|
10919
|
+
};
|
|
10920
|
+
}
|
|
10921
|
+
|
|
10922
|
+
class ConfigModeControls {
|
|
10923
|
+
constructor() {
|
|
10924
|
+
this.destroyRef = inject(DestroyRef);
|
|
10925
|
+
this.globalContextUtils = inject(GlobalContextUtilsService);
|
|
10926
|
+
this.globalContextEventService = inject(GlobalContextEventService);
|
|
10927
|
+
this.controls = input(PRESET_NAME.DEFAULT, ...(ngDevMode ? [{ debugName: "controls" }] : []));
|
|
10928
|
+
this.config = input.required(...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
10929
|
+
this.configChange = output();
|
|
10930
|
+
this.displayModeControl = new FormControl(GLOBAL_CONTEXT_DISPLAY_MODE.DASHBOARD, { nonNullable: true });
|
|
10931
|
+
this.GLOBAL_CONTEXT_DISPLAY_MODE = GLOBAL_CONTEXT_DISPLAY_MODE;
|
|
10932
|
+
this.displayMode = signal(GLOBAL_CONTEXT_DISPLAY_MODE.DASHBOARD, ...(ngDevMode ? [{ debugName: "displayMode" }] : []));
|
|
10933
|
+
this.refreshOption = signal(REFRESH_OPTION.LIVE, ...(ngDevMode ? [{ debugName: "refreshOption" }] : []));
|
|
10934
|
+
this.liveState = signal(null, ...(ngDevMode ? [{ debugName: "liveState" }] : []));
|
|
10935
|
+
this.historyState = signal(null, ...(ngDevMode ? [{ debugName: "historyState" }] : []));
|
|
10936
|
+
this.lastEmittedContext = signal({}, ...(ngDevMode ? [{ debugName: "lastEmittedContext" }] : []));
|
|
10937
|
+
this.settings = computed(() => controlsToSettings(this.controls(), this.displayMode(), this.refreshOption()), ...(ngDevMode ? [{ debugName: "settings" }] : []));
|
|
10938
|
+
this.supportedModes = computed(() => getSupportedModes(this.controls(), this.displayMode()), ...(ngDevMode ? [{ debugName: "supportedModes" }] : []));
|
|
10939
|
+
// Sync with incoming config
|
|
10940
|
+
effect(() => {
|
|
10941
|
+
const cfg = this.config();
|
|
10942
|
+
if (!cfg)
|
|
10943
|
+
return;
|
|
10944
|
+
untracked(() => {
|
|
10945
|
+
const mode = cfg.displayMode ?? GLOBAL_CONTEXT_DISPLAY_MODE.DASHBOARD;
|
|
10946
|
+
if (this.displayModeControl.value !== mode) {
|
|
10947
|
+
this.displayModeControl.setValue(mode, { emitEvent: false });
|
|
10948
|
+
this.displayMode.set(mode);
|
|
10949
|
+
}
|
|
10950
|
+
const refreshOpt = cfg.refreshOption ?? REFRESH_OPTION.LIVE;
|
|
10951
|
+
this.refreshOption.set(refreshOpt);
|
|
10952
|
+
if (refreshOpt === REFRESH_OPTION.LIVE) {
|
|
10953
|
+
this.liveState.set({ ...cfg });
|
|
10954
|
+
}
|
|
10955
|
+
else {
|
|
10956
|
+
this.historyState.set({ ...cfg });
|
|
10957
|
+
}
|
|
10958
|
+
this.lastEmittedContext.set(cfg);
|
|
10959
|
+
});
|
|
10960
|
+
});
|
|
10961
|
+
}
|
|
10962
|
+
ngOnInit() {
|
|
10963
|
+
this.displayModeControl.valueChanges
|
|
10964
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
10965
|
+
.subscribe(mode => {
|
|
10966
|
+
this.displayMode.set(mode);
|
|
10967
|
+
this.emitForDisplayMode(mode);
|
|
10968
|
+
});
|
|
10969
|
+
this.emitInitialState();
|
|
10970
|
+
}
|
|
10971
|
+
onRefreshOptionChange(option) {
|
|
10972
|
+
this.refreshOption.set(option);
|
|
10973
|
+
const snapshot = option === REFRESH_OPTION.LIVE ? this.liveState() : this.historyState();
|
|
10974
|
+
const context = {
|
|
10975
|
+
...(snapshot ?? this.config()),
|
|
10976
|
+
refreshOption: option,
|
|
10977
|
+
displayMode: this.displayMode(),
|
|
10978
|
+
aggregation: option === REFRESH_OPTION.LIVE ? null : (snapshot ?? this.config()).aggregation
|
|
10979
|
+
};
|
|
10980
|
+
this.emit(context);
|
|
10981
|
+
}
|
|
10982
|
+
onConfigurationChange(changes) {
|
|
10983
|
+
const context = {
|
|
10984
|
+
...this.config(),
|
|
10985
|
+
...changes,
|
|
10986
|
+
refreshOption: this.refreshOption(),
|
|
10987
|
+
displayMode: this.displayMode()
|
|
10988
|
+
};
|
|
10989
|
+
// Update snapshot for current mode
|
|
10990
|
+
if (this.refreshOption() === REFRESH_OPTION.LIVE) {
|
|
10991
|
+
this.liveState.set({ ...context });
|
|
10992
|
+
}
|
|
10993
|
+
else {
|
|
10994
|
+
this.historyState.set({ ...context });
|
|
10995
|
+
}
|
|
10996
|
+
this.emit(context);
|
|
10997
|
+
}
|
|
10998
|
+
emitInitialState() {
|
|
10999
|
+
const cfg = this.config();
|
|
11000
|
+
if (!cfg)
|
|
11001
|
+
return;
|
|
11002
|
+
const mode = cfg.displayMode ?? GLOBAL_CONTEXT_DISPLAY_MODE.DASHBOARD;
|
|
11003
|
+
const context = mode === GLOBAL_CONTEXT_DISPLAY_MODE.DASHBOARD
|
|
11004
|
+
? this.getGlobalContextState(mode)
|
|
11005
|
+
: { ...cfg, isGlobalContextReady: true };
|
|
11006
|
+
this.lastEmittedContext.set(context);
|
|
11007
|
+
this.configChange.emit({ context, diff: context });
|
|
11008
|
+
}
|
|
11009
|
+
emitForDisplayMode(mode) {
|
|
11010
|
+
if (mode === GLOBAL_CONTEXT_DISPLAY_MODE.DASHBOARD) {
|
|
11011
|
+
this.emit(this.getGlobalContextState(mode));
|
|
11012
|
+
}
|
|
11013
|
+
else {
|
|
11014
|
+
const snapshot = this.refreshOption() === REFRESH_OPTION.LIVE ? this.liveState() : this.historyState();
|
|
11015
|
+
this.emit({ ...(snapshot ?? this.config()), displayMode: mode, isGlobalContextReady: true });
|
|
11016
|
+
}
|
|
11017
|
+
}
|
|
11018
|
+
emit(context) {
|
|
11019
|
+
const diff = this.globalContextUtils.getChangedFields(this.lastEmittedContext(), context);
|
|
11020
|
+
if (Object.keys(diff).length === 0)
|
|
11021
|
+
return;
|
|
11022
|
+
this.lastEmittedContext.set(context);
|
|
11023
|
+
this.configChange.emit({ context, diff });
|
|
11024
|
+
}
|
|
11025
|
+
getGlobalContextState(mode) {
|
|
11026
|
+
const globalState = this.globalContextEventService.getLatestValue(GLOBAL_CONTEXT_EVENTS.STATE_CHANGE);
|
|
11027
|
+
return globalState
|
|
11028
|
+
? {
|
|
11029
|
+
displayMode: mode,
|
|
11030
|
+
dateTimeContext: globalState.dateTimeContext,
|
|
11031
|
+
refreshOption: globalState.refreshOption,
|
|
11032
|
+
aggregation: globalState.aggregation,
|
|
11033
|
+
isAutoRefreshEnabled: globalState.isAutoRefreshEnabled,
|
|
11034
|
+
refreshInterval: globalState.refreshInterval,
|
|
11035
|
+
isGlobalContextReady: true
|
|
11036
|
+
}
|
|
11037
|
+
: { displayMode: mode, isGlobalContextReady: true };
|
|
11038
|
+
}
|
|
11039
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ConfigModeControls, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
11040
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: ConfigModeControls, isStandalone: true, selector: "c8y-config-mode-controls", inputs: { controls: { classPropertyName: "controls", publicName: "controls", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { configChange: "configChange" }, ngImport: i0, template: `
|
|
11041
|
+
<form>
|
|
11042
|
+
<fieldset class="c8y-fieldset">
|
|
11043
|
+
<legend>
|
|
11044
|
+
{{ 'Time context' | translate }}
|
|
11045
|
+
<button
|
|
11046
|
+
class="btn-help btn-help--sm"
|
|
11047
|
+
[attr.aria-label]="'Help' | translate"
|
|
11048
|
+
[popover]="
|
|
11049
|
+
'Sync with dashboard settings or set independent time controls for this widget.'
|
|
11050
|
+
| translate
|
|
11051
|
+
"
|
|
11052
|
+
placement="right"
|
|
11053
|
+
triggers="focus"
|
|
11054
|
+
container="body"
|
|
11055
|
+
type="button"
|
|
11056
|
+
[adaptivePosition]="true"
|
|
11057
|
+
></button>
|
|
11058
|
+
</legend>
|
|
11059
|
+
<c8y-config-context-selector
|
|
11060
|
+
[formControl]="displayModeControl"
|
|
11061
|
+
></c8y-config-context-selector>
|
|
11062
|
+
</fieldset>
|
|
11063
|
+
</form>
|
|
11064
|
+
|
|
11065
|
+
@if (displayMode() !== GLOBAL_CONTEXT_DISPLAY_MODE.DASHBOARD) {
|
|
11066
|
+
<fieldset class="c8y-fieldset p-l-0 p-r-0 p-t-16">
|
|
11067
|
+
<legend class="m-l-16">{{ 'Widget time context' | translate }}</legend>
|
|
11068
|
+
<c8y-configuration-controls
|
|
11069
|
+
[settings]="settings()"
|
|
11070
|
+
[controlsDisplayMode]="'horizontal'"
|
|
11071
|
+
[tabsOutletName]="'verticalTabOutletForConfigurationModes'"
|
|
11072
|
+
[activeMode]="refreshOption()"
|
|
11073
|
+
[liveContext]="liveState()"
|
|
11074
|
+
[historyContext]="historyState()"
|
|
11075
|
+
[supportedModes]="supportedModes()"
|
|
11076
|
+
(contextChange)="onConfigurationChange($event)"
|
|
11077
|
+
(refreshOptionChange)="onRefreshOptionChange($event)"
|
|
11078
|
+
></c8y-configuration-controls>
|
|
11079
|
+
</fieldset>
|
|
11080
|
+
}
|
|
11081
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { 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.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: ConfigContextSelectorComponent, selector: "c8y-config-context-selector" }, { kind: "component", type: ConfigurationControlsComponent, selector: "c8y-configuration-controls", inputs: ["controlsDisplayMode", "settings", "activeMode", "liveContext", "historyContext", "supportedModes", "tabsOutletName"], outputs: ["refreshOptionChange", "contextChange", "validationStatus"] }, { kind: "ngmodule", type: PopoverModule }, { kind: "directive", type: i2$2.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: C8yTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
11082
|
+
}
|
|
11083
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ConfigModeControls, decorators: [{
|
|
11084
|
+
type: Component,
|
|
11085
|
+
args: [{
|
|
11086
|
+
selector: 'c8y-config-mode-controls',
|
|
11087
|
+
standalone: true,
|
|
11088
|
+
imports: [
|
|
11089
|
+
ReactiveFormsModule,
|
|
11090
|
+
ConfigContextSelectorComponent,
|
|
11091
|
+
ConfigurationControlsComponent,
|
|
11092
|
+
C8yTranslatePipe,
|
|
11093
|
+
PopoverModule
|
|
11094
|
+
],
|
|
11095
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
11096
|
+
template: `
|
|
11097
|
+
<form>
|
|
11098
|
+
<fieldset class="c8y-fieldset">
|
|
11099
|
+
<legend>
|
|
11100
|
+
{{ 'Time context' | translate }}
|
|
11101
|
+
<button
|
|
11102
|
+
class="btn-help btn-help--sm"
|
|
11103
|
+
[attr.aria-label]="'Help' | translate"
|
|
11104
|
+
[popover]="
|
|
11105
|
+
'Sync with dashboard settings or set independent time controls for this widget.'
|
|
11106
|
+
| translate
|
|
11107
|
+
"
|
|
11108
|
+
placement="right"
|
|
11109
|
+
triggers="focus"
|
|
11110
|
+
container="body"
|
|
11111
|
+
type="button"
|
|
11112
|
+
[adaptivePosition]="true"
|
|
11113
|
+
></button>
|
|
11114
|
+
</legend>
|
|
11115
|
+
<c8y-config-context-selector
|
|
11116
|
+
[formControl]="displayModeControl"
|
|
11117
|
+
></c8y-config-context-selector>
|
|
11118
|
+
</fieldset>
|
|
11119
|
+
</form>
|
|
11120
|
+
|
|
11121
|
+
@if (displayMode() !== GLOBAL_CONTEXT_DISPLAY_MODE.DASHBOARD) {
|
|
11122
|
+
<fieldset class="c8y-fieldset p-l-0 p-r-0 p-t-16">
|
|
11123
|
+
<legend class="m-l-16">{{ 'Widget time context' | translate }}</legend>
|
|
11124
|
+
<c8y-configuration-controls
|
|
11125
|
+
[settings]="settings()"
|
|
11126
|
+
[controlsDisplayMode]="'horizontal'"
|
|
11127
|
+
[tabsOutletName]="'verticalTabOutletForConfigurationModes'"
|
|
11128
|
+
[activeMode]="refreshOption()"
|
|
11129
|
+
[liveContext]="liveState()"
|
|
11130
|
+
[historyContext]="historyState()"
|
|
11131
|
+
[supportedModes]="supportedModes()"
|
|
11132
|
+
(contextChange)="onConfigurationChange($event)"
|
|
11133
|
+
(refreshOptionChange)="onRefreshOptionChange($event)"
|
|
11134
|
+
></c8y-configuration-controls>
|
|
11135
|
+
</fieldset>
|
|
11136
|
+
}
|
|
11137
|
+
`
|
|
11138
|
+
}]
|
|
11139
|
+
}], ctorParameters: () => [], propDecorators: { controls: [{ type: i0.Input, args: [{ isSignal: true, alias: "controls", required: false }] }], config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }], configChange: [{ type: i0.Output, args: ["configChange"] }] } });
|
|
11140
|
+
|
|
11141
|
+
class ContextControlsComponent {
|
|
11142
|
+
constructor() {
|
|
11143
|
+
this.fb = inject(FormBuilder);
|
|
11144
|
+
this.aggregationValidationService = inject(AggregationValidationService);
|
|
11145
|
+
this.globalContextUtils = inject(GlobalContextUtilsService);
|
|
11146
|
+
this.controls = input(PRESET_NAME.DEFAULT, ...(ngDevMode ? [{ debugName: "controls" }] : []));
|
|
11147
|
+
this.displayMode = input(GLOBAL_CONTEXT_DISPLAY_MODE.DASHBOARD, ...(ngDevMode ? [{ debugName: "displayMode" }] : []));
|
|
11148
|
+
this.config = input.required(...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
11149
|
+
this.isLoading = input(false, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
|
|
11150
|
+
this.configChange = output();
|
|
11151
|
+
this.refresh = output();
|
|
11152
|
+
this.lastEmittedState = signal({}, ...(ngDevMode ? [{ debugName: "lastEmittedState" }] : []));
|
|
11153
|
+
/**
|
|
11154
|
+
* Visible controls for the template.
|
|
11155
|
+
* LIVE_TIME and HISTORY_TIME are normalized to 'time' for template simplicity.
|
|
11156
|
+
*/
|
|
11157
|
+
this.visibleControls = computed(() => {
|
|
11158
|
+
const controlsInput = this.controls();
|
|
11159
|
+
const presetDef = typeof controlsInput === 'string' ? CONTROL_PRESETS[controlsInput] : controlsInput;
|
|
11160
|
+
const baseControls = presetDef[this.displayMode()];
|
|
11161
|
+
const refreshOption = this.config().refreshOption || REFRESH_OPTION.LIVE;
|
|
11162
|
+
const filteredControls = applyModeConstraints(baseControls, refreshOption);
|
|
11163
|
+
// Normalize LIVE_TIME/HISTORY_TIME to 'time' for template
|
|
11164
|
+
return filteredControls.map(c => c === CONTEXT_FEATURE.LIVE_TIME || c === CONTEXT_FEATURE.HISTORY_TIME ? 'time' : c);
|
|
11165
|
+
}, ...(ngDevMode ? [{ debugName: "visibleControls" }] : []));
|
|
11166
|
+
this.disabledAggregations = computed(() => {
|
|
11167
|
+
const dateCtx = this.config().dateTimeContext;
|
|
11168
|
+
if (!dateCtx)
|
|
11169
|
+
return {};
|
|
11170
|
+
const [from, to] = this.parseDateRange(dateCtx);
|
|
11171
|
+
return this.aggregationValidationService.getDisabledAggregations([from, to]);
|
|
11172
|
+
}, ...(ngDevMode ? [{ debugName: "disabledAggregations" }] : []));
|
|
11173
|
+
this.dateTimePickerConfig = computed(() => {
|
|
11174
|
+
const refreshOption = this.config().refreshOption;
|
|
11175
|
+
return refreshOption === REFRESH_OPTION.HISTORY
|
|
11176
|
+
? { showDateFrom: true, showDateTo: true }
|
|
11177
|
+
: { showDateFrom: true, showDateTo: false };
|
|
11178
|
+
}, ...(ngDevMode ? [{ debugName: "dateTimePickerConfig" }] : []));
|
|
11179
|
+
this.autoRefreshSeconds = computed(() => this.config().refreshInterval || GLOBAL_CONTEXT_DEFAULTS.REFRESH_INTERVAL, ...(ngDevMode ? [{ debugName: "autoRefreshSeconds" }] : []));
|
|
11180
|
+
this.form = this.fb.group({
|
|
11181
|
+
dateTimeContext: [null],
|
|
11182
|
+
aggregation: [null],
|
|
11183
|
+
isAutoRefreshEnabled: [false],
|
|
11184
|
+
refreshInterval: [GLOBAL_CONTEXT_DEFAULTS.REFRESH_INTERVAL],
|
|
11185
|
+
refreshOption: [GLOBAL_CONTEXT_DEFAULTS.REFRESH_OPTION]
|
|
11186
|
+
});
|
|
11187
|
+
this.syncConfigToForm();
|
|
11188
|
+
this.subscribeToFormChanges();
|
|
11189
|
+
}
|
|
11190
|
+
onRefresh() {
|
|
11191
|
+
const { dateTimeContext } = this.config();
|
|
11192
|
+
if (!dateTimeContext) {
|
|
11193
|
+
this.refresh.emit();
|
|
11194
|
+
return;
|
|
11195
|
+
}
|
|
11196
|
+
const context = {
|
|
11197
|
+
...this.config(),
|
|
11198
|
+
dateTimeContext: DateTimeContextUtil.normalizeForLive(dateTimeContext)
|
|
11199
|
+
};
|
|
11200
|
+
if (!this.emitIfChanged(context)) {
|
|
11201
|
+
this.refresh.emit();
|
|
11202
|
+
}
|
|
11203
|
+
}
|
|
11204
|
+
/** Emits configChange if context differs from last emitted state. Returns true if emitted. */
|
|
11205
|
+
emitIfChanged(context) {
|
|
11206
|
+
const diff = this.globalContextUtils.getChangedFields(this.lastEmittedState(), context);
|
|
11207
|
+
if (Object.keys(diff).length === 0)
|
|
11208
|
+
return false;
|
|
11209
|
+
this.lastEmittedState.set(context);
|
|
11210
|
+
this.configChange.emit({ context, diff });
|
|
11211
|
+
return true;
|
|
11212
|
+
}
|
|
11213
|
+
syncConfigToForm() {
|
|
11214
|
+
effect(() => {
|
|
11215
|
+
const cfg = this.config();
|
|
11216
|
+
this.form.patchValue(cfg, { emitEvent: false });
|
|
11217
|
+
this.lastEmittedState.set(this.form.value);
|
|
11218
|
+
});
|
|
11219
|
+
}
|
|
11220
|
+
subscribeToFormChanges() {
|
|
11221
|
+
this.form.valueChanges.pipe(takeUntilDestroyed()).subscribe(value => {
|
|
11222
|
+
const context = this.clearInvalidAggregation(value);
|
|
11223
|
+
this.emitIfChanged(context);
|
|
11224
|
+
});
|
|
11225
|
+
}
|
|
11226
|
+
/** Clears aggregation if in LIVE mode or invalid for current time range (HISTORY mode). */
|
|
11227
|
+
clearInvalidAggregation(context) {
|
|
11228
|
+
const { aggregation, dateTimeContext, refreshOption } = context;
|
|
11229
|
+
if (!aggregation)
|
|
11230
|
+
return context;
|
|
11231
|
+
// LIVE mode doesn't support aggregation
|
|
11232
|
+
if (refreshOption === REFRESH_OPTION.LIVE) {
|
|
11233
|
+
this.form.patchValue({ aggregation: null }, { emitEvent: false });
|
|
11234
|
+
return { ...context, aggregation: null };
|
|
11235
|
+
}
|
|
11236
|
+
// HISTORY mode: validate aggregation for time range
|
|
11237
|
+
if (!dateTimeContext)
|
|
11238
|
+
return context;
|
|
11239
|
+
const [from, to] = this.parseDateRange(dateTimeContext);
|
|
11240
|
+
const disabledAggs = this.aggregationValidationService.getDisabledAggregations([from, to]);
|
|
11241
|
+
if (disabledAggs[aggregation]) {
|
|
11242
|
+
this.form.patchValue({ aggregation: null }, { emitEvent: false });
|
|
11243
|
+
return { ...context, aggregation: null };
|
|
11244
|
+
}
|
|
11245
|
+
return context;
|
|
11246
|
+
}
|
|
11247
|
+
parseDateRange(dateCtx) {
|
|
11248
|
+
const from = typeof dateCtx.dateFrom === 'string' ? new Date(dateCtx.dateFrom) : dateCtx.dateFrom;
|
|
11249
|
+
const to = typeof dateCtx.dateTo === 'string' ? new Date(dateCtx.dateTo) : dateCtx.dateTo;
|
|
11250
|
+
return [from, to];
|
|
11251
|
+
}
|
|
11252
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ContextControlsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
11253
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: ContextControlsComponent, isStandalone: true, selector: "c8y-context-controls", inputs: { controls: { classPropertyName: "controls", publicName: "controls", isSignal: true, isRequired: false, transformFunction: null }, displayMode: { classPropertyName: "displayMode", publicName: "displayMode", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { configChange: "configChange", refresh: "refresh" }, ngImport: i0, template: `
|
|
11254
|
+
<form
|
|
11255
|
+
class="d-flex gap-16 p-l-16 p-r-16 p-b-8 inner-scroll h-auto min-width-0 widget-controls"
|
|
11256
|
+
[formGroup]="form"
|
|
11257
|
+
>
|
|
11258
|
+
<div class="input-group w-auto">
|
|
11259
|
+
@if (visibleControls().includes('aggregation')) {
|
|
11260
|
+
<c8y-aggregation-picker
|
|
11261
|
+
formControlName="aggregation"
|
|
11262
|
+
[disabledAggregations]="disabledAggregations()"
|
|
11263
|
+
[resetToDefault]="true"
|
|
11264
|
+
>
|
|
11265
|
+
</c8y-aggregation-picker>
|
|
11266
|
+
}
|
|
11267
|
+
|
|
11268
|
+
@if (visibleControls().includes('autoRefresh')) {
|
|
11269
|
+
<c8y-auto-refresh-control
|
|
11270
|
+
formControlName="isAutoRefreshEnabled"
|
|
11271
|
+
[autoRefreshSeconds]="autoRefreshSeconds()"
|
|
11272
|
+
[isLoading]="isLoading()"
|
|
11273
|
+
(refresh)="onRefresh()"
|
|
11274
|
+
>
|
|
11275
|
+
</c8y-auto-refresh-control>
|
|
11276
|
+
}
|
|
11277
|
+
|
|
11278
|
+
@if (visibleControls().includes('time')) {
|
|
11279
|
+
<c8y-date-time-context-picker
|
|
11280
|
+
style="margin-left: -1px"
|
|
11281
|
+
formControlName="dateTimeContext"
|
|
11282
|
+
[config]="dateTimePickerConfig()"
|
|
11283
|
+
>
|
|
11284
|
+
</c8y-date-time-context-picker>
|
|
11285
|
+
}
|
|
11286
|
+
|
|
11287
|
+
@if (visibleControls().includes('refresh')) {
|
|
11288
|
+
<div class="input-group-btn">
|
|
11289
|
+
<button
|
|
11290
|
+
class="btn btn-default"
|
|
11291
|
+
[attr.aria-label]="'Refresh' | translate"
|
|
11292
|
+
[tooltip]="'Refresh' | translate"
|
|
11293
|
+
placement="bottom"
|
|
11294
|
+
container="body"
|
|
11295
|
+
type="button"
|
|
11296
|
+
[delay]="500"
|
|
11297
|
+
[disabled]="isLoading()"
|
|
11298
|
+
(click)="onRefresh()"
|
|
11299
|
+
data-cy="widget-controls--refresh-button"
|
|
11300
|
+
>
|
|
11301
|
+
<i [class.icon-spin]="isLoading()" [c8yIcon]="'refresh'"></i>
|
|
11302
|
+
</button>
|
|
11303
|
+
</div>
|
|
11304
|
+
}
|
|
11305
|
+
</div>
|
|
11306
|
+
</form>
|
|
11307
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { 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: "component", type: DateTimeContextPickerComponent, selector: "c8y-date-time-context-picker", inputs: ["disabled", "shouldDisableInterval", "config"] }, { kind: "component", type: AggregationPickerComponent, selector: "c8y-aggregation-picker", inputs: ["disabledAggregations", "resetToDefault", "layout"] }, { kind: "component", type: AutoRefreshControlComponent, selector: "c8y-auto-refresh-control", inputs: ["isAutoRefreshConnected", "autoRefreshSeconds", "disableCounter", "isEnabled", "isLoading"], outputs: ["loadingChange", "refresh"] }, { kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i2.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: "pipe", type: C8yTranslatePipe, name: "translate" }] }); }
|
|
11308
|
+
}
|
|
11309
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ContextControlsComponent, decorators: [{
|
|
11310
|
+
type: Component,
|
|
11311
|
+
args: [{
|
|
11312
|
+
selector: 'c8y-context-controls',
|
|
11313
|
+
standalone: true,
|
|
11314
|
+
imports: [
|
|
11315
|
+
ReactiveFormsModule,
|
|
11316
|
+
DateTimeContextPickerComponent,
|
|
11317
|
+
AggregationPickerComponent,
|
|
11318
|
+
AutoRefreshControlComponent,
|
|
11319
|
+
IconDirective,
|
|
11320
|
+
C8yTranslatePipe,
|
|
11321
|
+
TooltipModule
|
|
11322
|
+
],
|
|
11323
|
+
template: `
|
|
11324
|
+
<form
|
|
11325
|
+
class="d-flex gap-16 p-l-16 p-r-16 p-b-8 inner-scroll h-auto min-width-0 widget-controls"
|
|
11326
|
+
[formGroup]="form"
|
|
11327
|
+
>
|
|
11328
|
+
<div class="input-group w-auto">
|
|
11329
|
+
@if (visibleControls().includes('aggregation')) {
|
|
11330
|
+
<c8y-aggregation-picker
|
|
11331
|
+
formControlName="aggregation"
|
|
11332
|
+
[disabledAggregations]="disabledAggregations()"
|
|
11333
|
+
[resetToDefault]="true"
|
|
11334
|
+
>
|
|
11335
|
+
</c8y-aggregation-picker>
|
|
11336
|
+
}
|
|
11337
|
+
|
|
11338
|
+
@if (visibleControls().includes('autoRefresh')) {
|
|
11339
|
+
<c8y-auto-refresh-control
|
|
11340
|
+
formControlName="isAutoRefreshEnabled"
|
|
11341
|
+
[autoRefreshSeconds]="autoRefreshSeconds()"
|
|
11342
|
+
[isLoading]="isLoading()"
|
|
11343
|
+
(refresh)="onRefresh()"
|
|
11344
|
+
>
|
|
11345
|
+
</c8y-auto-refresh-control>
|
|
11346
|
+
}
|
|
11347
|
+
|
|
11348
|
+
@if (visibleControls().includes('time')) {
|
|
11349
|
+
<c8y-date-time-context-picker
|
|
11350
|
+
style="margin-left: -1px"
|
|
11351
|
+
formControlName="dateTimeContext"
|
|
11352
|
+
[config]="dateTimePickerConfig()"
|
|
11353
|
+
>
|
|
11354
|
+
</c8y-date-time-context-picker>
|
|
11355
|
+
}
|
|
11356
|
+
|
|
11357
|
+
@if (visibleControls().includes('refresh')) {
|
|
11358
|
+
<div class="input-group-btn">
|
|
11359
|
+
<button
|
|
11360
|
+
class="btn btn-default"
|
|
11361
|
+
[attr.aria-label]="'Refresh' | translate"
|
|
11362
|
+
[tooltip]="'Refresh' | translate"
|
|
11363
|
+
placement="bottom"
|
|
11364
|
+
container="body"
|
|
11365
|
+
type="button"
|
|
11366
|
+
[delay]="500"
|
|
11367
|
+
[disabled]="isLoading()"
|
|
11368
|
+
(click)="onRefresh()"
|
|
11369
|
+
data-cy="widget-controls--refresh-button"
|
|
11370
|
+
>
|
|
11371
|
+
<i [class.icon-spin]="isLoading()" [c8yIcon]="'refresh'"></i>
|
|
11372
|
+
</button>
|
|
11373
|
+
</div>
|
|
11374
|
+
}
|
|
11375
|
+
</div>
|
|
11376
|
+
</form>
|
|
11377
|
+
`
|
|
11378
|
+
}]
|
|
11379
|
+
}], ctorParameters: () => [], propDecorators: { controls: [{ type: i0.Input, args: [{ isSignal: true, alias: "controls", required: false }] }], displayMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayMode", required: false }] }], config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }], isLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "isLoading", required: false }] }], configChange: [{ type: i0.Output, args: ["configChange"] }], refresh: [{ type: i0.Output, args: ["refresh"] }] } });
|
|
11380
|
+
|
|
11381
|
+
// Map preset controls to state keys
|
|
11382
|
+
const CONTROL_DISPLAY_CONFIG = {
|
|
11383
|
+
liveTime: {
|
|
11384
|
+
key: 'liveTime',
|
|
11385
|
+
stateKey: 'dateTimeContext',
|
|
11386
|
+
cssClass: 'time-context',
|
|
11387
|
+
label: gettext('date/time'),
|
|
11388
|
+
icon: 'calendar'
|
|
11389
|
+
},
|
|
11390
|
+
historyTime: {
|
|
11391
|
+
key: 'historyTime',
|
|
11392
|
+
stateKey: 'dateTimeContext',
|
|
11393
|
+
cssClass: 'time-context',
|
|
11394
|
+
label: gettext('date/time'),
|
|
11395
|
+
icon: 'calendar'
|
|
11396
|
+
},
|
|
11397
|
+
aggregation: {
|
|
11398
|
+
key: 'aggregation',
|
|
11399
|
+
stateKey: 'aggregation',
|
|
11400
|
+
cssClass: 'aggregation',
|
|
11401
|
+
label: gettext('aggregation'),
|
|
11402
|
+
icon: 'input'
|
|
11403
|
+
},
|
|
11404
|
+
autoRefresh: {
|
|
11405
|
+
key: 'autoRefresh',
|
|
11406
|
+
stateKey: 'isAutoRefreshEnabled',
|
|
11407
|
+
cssClass: 'auto-refresh',
|
|
11408
|
+
label: gettext('auto refresh'),
|
|
11409
|
+
icon: 'refresh'
|
|
11410
|
+
}
|
|
11411
|
+
};
|
|
11412
|
+
class LinkButtonsComponent {
|
|
11413
|
+
constructor() {
|
|
11414
|
+
this.injectedDashboardChild = inject(DashboardChildComponent, { optional: true });
|
|
11415
|
+
this.translateService = inject(TranslateService);
|
|
11416
|
+
this.dashboardChild = input(...(ngDevMode ? [undefined, { debugName: "dashboardChild" }] : []));
|
|
11417
|
+
this.isLinked = input.required(...(ngDevMode ? [{ debugName: "isLinked" }] : []));
|
|
11418
|
+
this.controls = input(PRESET_NAME.DEFAULT, ...(ngDevMode ? [{ debugName: "controls" }] : []));
|
|
11419
|
+
this.config = input({}, ...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
11420
|
+
this.toggle = output();
|
|
11421
|
+
this.visibleControls = computed(() => {
|
|
11422
|
+
const controlsInput = this.controls();
|
|
11423
|
+
const presetDef = typeof controlsInput === 'string' ? CONTROL_PRESETS[controlsInput] : controlsInput;
|
|
11424
|
+
const refreshOption = this.config().refreshOption || REFRESH_OPTION.LIVE;
|
|
11425
|
+
const dashboardControls = presetDef[GLOBAL_CONTEXT_DISPLAY_MODE.DASHBOARD];
|
|
11426
|
+
const activeControls = applyModeConstraints(dashboardControls, refreshOption);
|
|
11427
|
+
return activeControls.map(key => CONTROL_DISPLAY_CONFIG[key]).filter(Boolean);
|
|
11428
|
+
}, ...(ngDevMode ? [{ debugName: "visibleControls" }] : []));
|
|
11429
|
+
this.masterTooltipText = computed(() => {
|
|
11430
|
+
const controls = this.visibleControls();
|
|
11431
|
+
const clickToToggleLabel = this.translateService.instant(gettext('(click to toggle)'));
|
|
11432
|
+
if (!this.isLinked()) {
|
|
11433
|
+
const usingWidgetCustomTimeSettingsLabel = this.translateService.instant(gettext('Using widget custom time settings'));
|
|
11434
|
+
return `${usingWidgetCustomTimeSettingsLabel}\n${clickToToggleLabel}`;
|
|
11435
|
+
}
|
|
11436
|
+
const linkedNames = controls.map(control => this.translateService.instant(control.label));
|
|
11437
|
+
const formatter = new Intl.ListFormat(this.translateService.getCurrentLang()?.replace('_', '-'), {
|
|
11438
|
+
type: 'conjunction'
|
|
11439
|
+
});
|
|
11440
|
+
const linkedNamesList = formatter.format(linkedNames);
|
|
11441
|
+
const linkedToDashboardLabel = this.translateService.instant(gettext('Synced to dashboard:'));
|
|
11442
|
+
return `${linkedToDashboardLabel}\n${linkedNamesList}\n${clickToToggleLabel}`;
|
|
11443
|
+
}, ...(ngDevMode ? [{ debugName: "masterTooltipText" }] : []));
|
|
11444
|
+
}
|
|
11445
|
+
ngAfterViewInit() {
|
|
11446
|
+
const dashChild = this.getDashboardChild();
|
|
11447
|
+
if (dashChild && this.headerTemplateRef) {
|
|
11448
|
+
const headers = dashChild.additionalHeaderTemplates;
|
|
11449
|
+
if (!headers.includes(this.headerTemplateRef)) {
|
|
11450
|
+
headers.push(this.headerTemplateRef);
|
|
11451
|
+
}
|
|
11452
|
+
}
|
|
11453
|
+
}
|
|
11454
|
+
ngOnDestroy() {
|
|
11455
|
+
const dashChild = this.getDashboardChild();
|
|
11456
|
+
if (dashChild && this.headerTemplateRef) {
|
|
11457
|
+
const idx = dashChild.additionalHeaderTemplates.indexOf(this.headerTemplateRef);
|
|
11458
|
+
if (idx >= 0) {
|
|
11459
|
+
dashChild.additionalHeaderTemplates.splice(idx, 1);
|
|
11460
|
+
}
|
|
11461
|
+
}
|
|
11462
|
+
}
|
|
11463
|
+
getDashboardChild() {
|
|
11464
|
+
return this.dashboardChild() ?? this.injectedDashboardChild ?? null;
|
|
11465
|
+
}
|
|
11466
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: LinkButtonsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
11467
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: LinkButtonsComponent, isStandalone: true, selector: "c8y-link-buttons", inputs: { dashboardChild: { classPropertyName: "dashboardChild", publicName: "dashboardChild", isSignal: true, isRequired: false, transformFunction: null }, isLinked: { classPropertyName: "isLinked", publicName: "isLinked", isSignal: true, isRequired: true, transformFunction: null }, controls: { classPropertyName: "controls", publicName: "controls", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { toggle: "toggle" }, viewQueries: [{ propertyName: "headerTemplateRef", first: true, predicate: ["headerContent"], descendants: true, read: TemplateRef, static: true }], ngImport: i0, template: `
|
|
11468
|
+
<ng-template #headerContent>
|
|
11469
|
+
<button
|
|
11470
|
+
class="btn-icon-dot-set"
|
|
11471
|
+
[class.active]="isLinked()"
|
|
11472
|
+
[attr.aria-label]="'Global context sync controls' | translate"
|
|
11473
|
+
[tooltip]="masterTooltipTemplate"
|
|
11474
|
+
delay="500"
|
|
11475
|
+
container="body"
|
|
11476
|
+
(click)="toggle.emit(!isLinked())"
|
|
11477
|
+
data-cy="global-context-link--all"
|
|
11478
|
+
>
|
|
11479
|
+
<span class="btn-icon-dot__item default" [class.active]="isLinked()">
|
|
11480
|
+
<i [c8yIcon]="isLinked() ? 'link' : 'unlink'"></i>
|
|
11481
|
+
</span>
|
|
11482
|
+
@for (control of visibleControls(); track control.stateKey) {
|
|
11483
|
+
<span
|
|
11484
|
+
[class]="control.cssClass + ' btn-icon-dot__item'"
|
|
11485
|
+
[class.active]="isLinked()"
|
|
11486
|
+
[attr.data-cy]="'global-context-link--' + control.stateKey"
|
|
11487
|
+
>
|
|
11488
|
+
<i [c8yIcon]="control.icon"></i>
|
|
11489
|
+
</span>
|
|
11490
|
+
}
|
|
11491
|
+
</button>
|
|
11492
|
+
<ng-template #masterTooltipTemplate>{{ masterTooltipText() }}</ng-template>
|
|
11493
|
+
</ng-template>
|
|
11494
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i2.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: "pipe", type: C8yTranslatePipe, name: "translate" }] }); }
|
|
11495
|
+
}
|
|
11496
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: LinkButtonsComponent, decorators: [{
|
|
11497
|
+
type: Component,
|
|
11498
|
+
args: [{
|
|
11499
|
+
selector: 'c8y-link-buttons',
|
|
11500
|
+
standalone: true,
|
|
11501
|
+
imports: [IconDirective, TooltipModule, C8yTranslatePipe],
|
|
11502
|
+
template: `
|
|
11503
|
+
<ng-template #headerContent>
|
|
11504
|
+
<button
|
|
11505
|
+
class="btn-icon-dot-set"
|
|
11506
|
+
[class.active]="isLinked()"
|
|
11507
|
+
[attr.aria-label]="'Global context sync controls' | translate"
|
|
11508
|
+
[tooltip]="masterTooltipTemplate"
|
|
11509
|
+
delay="500"
|
|
11510
|
+
container="body"
|
|
11511
|
+
(click)="toggle.emit(!isLinked())"
|
|
11512
|
+
data-cy="global-context-link--all"
|
|
11513
|
+
>
|
|
11514
|
+
<span class="btn-icon-dot__item default" [class.active]="isLinked()">
|
|
11515
|
+
<i [c8yIcon]="isLinked() ? 'link' : 'unlink'"></i>
|
|
11516
|
+
</span>
|
|
11517
|
+
@for (control of visibleControls(); track control.stateKey) {
|
|
11518
|
+
<span
|
|
11519
|
+
[class]="control.cssClass + ' btn-icon-dot__item'"
|
|
11520
|
+
[class.active]="isLinked()"
|
|
11521
|
+
[attr.data-cy]="'global-context-link--' + control.stateKey"
|
|
11522
|
+
>
|
|
11523
|
+
<i [c8yIcon]="control.icon"></i>
|
|
11524
|
+
</span>
|
|
11525
|
+
}
|
|
11526
|
+
</button>
|
|
11527
|
+
<ng-template #masterTooltipTemplate>{{ masterTooltipText() }}</ng-template>
|
|
11528
|
+
</ng-template>
|
|
11529
|
+
`
|
|
11530
|
+
}]
|
|
11531
|
+
}], propDecorators: { headerTemplateRef: [{
|
|
11532
|
+
type: ViewChild,
|
|
11533
|
+
args: ['headerContent', { static: true, read: TemplateRef }]
|
|
11534
|
+
}], dashboardChild: [{ type: i0.Input, args: [{ isSignal: true, alias: "dashboardChild", required: false }] }], isLinked: [{ type: i0.Input, args: [{ isSignal: true, alias: "isLinked", required: true }] }], controls: [{ type: i0.Input, args: [{ isSignal: true, alias: "controls", required: false }] }], config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: false }] }], toggle: [{ type: i0.Output, args: ["toggle"] }] } });
|
|
11535
|
+
|
|
11536
|
+
class GlobalContextConnectorComponent {
|
|
11537
|
+
constructor() {
|
|
11538
|
+
this.eventService = inject(GlobalContextEventService);
|
|
11539
|
+
this.globalContextService = inject(GlobalContextService);
|
|
11540
|
+
this.globalContextUtils = inject(GlobalContextUtilsService);
|
|
11541
|
+
this.destroyRef = inject(DestroyRef);
|
|
11542
|
+
this.lastEmittedState = signal({}, ...(ngDevMode ? [{ debugName: "lastEmittedState" }] : []));
|
|
11543
|
+
this.controls = input(PRESET_NAME.DEFAULT, ...(ngDevMode ? [{ debugName: "controls" }] : []));
|
|
11544
|
+
this.config = input.required(...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
11545
|
+
this.isLoading = input(false, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
|
|
11546
|
+
this.dashboardChild = input.required(...(ngDevMode ? [{ debugName: "dashboardChild" }] : []));
|
|
11547
|
+
this.linked = input(undefined, ...(ngDevMode ? [{ debugName: "linked" }] : []));
|
|
11548
|
+
this.configChange = output();
|
|
11549
|
+
this.refresh = output();
|
|
11550
|
+
this.isLinked = signal(true, ...(ngDevMode ? [{ debugName: "isLinked" }] : []));
|
|
11551
|
+
this.syncExternalLinkState();
|
|
11552
|
+
this.subscribeToGlobalContext();
|
|
11553
|
+
this.registerWithGlobalContext();
|
|
11554
|
+
this.trackLoadingState();
|
|
11555
|
+
this.destroyRef.onDestroy(() => {
|
|
11556
|
+
this.globalContextService.unregister(this.componentId);
|
|
11557
|
+
this.globalContextService.unregisterLoading(this.componentId);
|
|
11558
|
+
});
|
|
11559
|
+
}
|
|
11560
|
+
onLinkToggle(linked) {
|
|
11561
|
+
this.isLinked.set(linked);
|
|
11562
|
+
if (linked) {
|
|
11563
|
+
const cached = this.eventService.getLatestValue(GLOBAL_CONTEXT_EVENTS.STATE_CHANGE);
|
|
11564
|
+
if (cached)
|
|
11565
|
+
this.emitIfChanged(cached);
|
|
11566
|
+
}
|
|
11567
|
+
}
|
|
11568
|
+
onLocalChange(event) {
|
|
11569
|
+
this.lastEmittedState.set(event.context);
|
|
11570
|
+
this.configChange.emit(event);
|
|
11571
|
+
}
|
|
11572
|
+
onLocalRefresh() {
|
|
11573
|
+
const { dateTimeContext } = this.config();
|
|
11574
|
+
if (!dateTimeContext) {
|
|
11575
|
+
this.refresh.emit();
|
|
11576
|
+
return;
|
|
11577
|
+
}
|
|
11578
|
+
const context = {
|
|
11579
|
+
...this.config(),
|
|
11580
|
+
dateTimeContext: DateTimeContextUtil.normalizeForLive(dateTimeContext)
|
|
11581
|
+
};
|
|
11582
|
+
if (!this.emitIfChanged(context)) {
|
|
11583
|
+
this.refresh.emit();
|
|
11584
|
+
}
|
|
11585
|
+
}
|
|
11586
|
+
/** Emits configChange if context differs from last emitted state. Returns true if emitted. */
|
|
11587
|
+
emitIfChanged(context) {
|
|
11588
|
+
const diff = this.globalContextUtils.getChangedFields(this.lastEmittedState(), context);
|
|
11589
|
+
if (Object.keys(diff).length === 0)
|
|
11590
|
+
return false;
|
|
11591
|
+
this.lastEmittedState.set(context);
|
|
11592
|
+
this.configChange.emit({ context, diff });
|
|
11593
|
+
return true;
|
|
11594
|
+
}
|
|
11595
|
+
get componentId() {
|
|
11596
|
+
const data = this.dashboardChild()['data'];
|
|
11597
|
+
return data.id;
|
|
11598
|
+
}
|
|
11599
|
+
syncExternalLinkState() {
|
|
11600
|
+
effect(() => {
|
|
11601
|
+
const external = this.linked();
|
|
11602
|
+
if (external !== undefined)
|
|
11603
|
+
this.isLinked.set(external);
|
|
11604
|
+
});
|
|
11605
|
+
}
|
|
11606
|
+
subscribeToGlobalContext() {
|
|
11607
|
+
let subscription = null;
|
|
11608
|
+
effect(() => {
|
|
11609
|
+
subscription?.unsubscribe();
|
|
11610
|
+
if (!this.isLinked())
|
|
11611
|
+
return;
|
|
11612
|
+
const cached = this.eventService.getLatestValue(GLOBAL_CONTEXT_EVENTS.STATE_CHANGE);
|
|
11613
|
+
if (cached)
|
|
11614
|
+
this.emitIfChanged(cached);
|
|
11615
|
+
const stateChanges$ = this.eventService.on(GLOBAL_CONTEXT_EVENTS.STATE_CHANGE);
|
|
11616
|
+
const refresh$ = this.eventService.on(GLOBAL_CONTEXT_EVENTS.REFRESH).pipe(map$1(data => ({
|
|
11617
|
+
...this.config(),
|
|
11618
|
+
dateTimeContext: {
|
|
11619
|
+
dateFrom: data.dateFrom,
|
|
11620
|
+
dateTo: data.dateTo,
|
|
11621
|
+
interval: data.interval
|
|
11622
|
+
}
|
|
11623
|
+
})));
|
|
11624
|
+
subscription = merge$1(stateChanges$, refresh$)
|
|
11625
|
+
.pipe(takeUntilDestroyed(this.destroyRef), catchError(() => EMPTY))
|
|
11626
|
+
.subscribe(state => {
|
|
11627
|
+
if (state)
|
|
11628
|
+
this.emitIfChanged(state);
|
|
11629
|
+
});
|
|
11630
|
+
});
|
|
11631
|
+
}
|
|
11632
|
+
registerWithGlobalContext() {
|
|
11633
|
+
effect(() => {
|
|
11634
|
+
if (this.isLinked()) {
|
|
11635
|
+
const settings = controlsToSettings(this.controls(), GLOBAL_CONTEXT_DISPLAY_MODE.DASHBOARD, this.config().refreshOption || REFRESH_OPTION.LIVE);
|
|
11636
|
+
this.globalContextService.register(this.componentId, settings);
|
|
11637
|
+
}
|
|
11638
|
+
else {
|
|
11639
|
+
this.globalContextService.unregister(this.componentId);
|
|
11640
|
+
}
|
|
11641
|
+
});
|
|
11642
|
+
}
|
|
11643
|
+
trackLoadingState() {
|
|
11644
|
+
effect(() => {
|
|
11645
|
+
const shouldTrack = this.isLinked() && this.isLoading();
|
|
11646
|
+
if (shouldTrack) {
|
|
11647
|
+
this.globalContextService.registerLoading(this.componentId);
|
|
11648
|
+
}
|
|
11649
|
+
else {
|
|
11650
|
+
this.globalContextService.unregisterLoading(this.componentId);
|
|
11651
|
+
}
|
|
11652
|
+
});
|
|
11653
|
+
}
|
|
11654
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: GlobalContextConnectorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
11655
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: GlobalContextConnectorComponent, isStandalone: true, selector: "c8y-global-context-connector", inputs: { controls: { classPropertyName: "controls", publicName: "controls", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, dashboardChild: { classPropertyName: "dashboardChild", publicName: "dashboardChild", isSignal: true, isRequired: true, transformFunction: null }, linked: { classPropertyName: "linked", publicName: "linked", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { configChange: "configChange", refresh: "refresh" }, ngImport: i0, template: `
|
|
11656
|
+
<c8y-link-buttons
|
|
11657
|
+
[dashboardChild]="dashboardChild()"
|
|
11658
|
+
[isLinked]="isLinked()"
|
|
11659
|
+
[controls]="controls()"
|
|
11660
|
+
[config]="config()"
|
|
11661
|
+
(toggle)="onLinkToggle($event)"
|
|
11662
|
+
></c8y-link-buttons>
|
|
11663
|
+
|
|
11664
|
+
@if (!isLinked()) {
|
|
11665
|
+
<c8y-context-controls
|
|
11666
|
+
[controls]="controls()"
|
|
11667
|
+
displayMode="dashboard"
|
|
11668
|
+
[config]="config()"
|
|
11669
|
+
[isLoading]="isLoading()"
|
|
11670
|
+
(configChange)="onLocalChange($event)"
|
|
11671
|
+
(refresh)="onLocalRefresh()"
|
|
11672
|
+
></c8y-context-controls>
|
|
11673
|
+
}
|
|
11674
|
+
`, isInline: true, dependencies: [{ kind: "component", type: ContextControlsComponent, selector: "c8y-context-controls", inputs: ["controls", "displayMode", "config", "isLoading"], outputs: ["configChange", "refresh"] }, { kind: "component", type: LinkButtonsComponent, selector: "c8y-link-buttons", inputs: ["dashboardChild", "isLinked", "controls", "config"], outputs: ["toggle"] }] }); }
|
|
11675
|
+
}
|
|
11676
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: GlobalContextConnectorComponent, decorators: [{
|
|
11677
|
+
type: Component,
|
|
11678
|
+
args: [{
|
|
11679
|
+
selector: 'c8y-global-context-connector',
|
|
11680
|
+
standalone: true,
|
|
11681
|
+
imports: [ContextControlsComponent, LinkButtonsComponent],
|
|
11682
|
+
template: `
|
|
11683
|
+
<c8y-link-buttons
|
|
11684
|
+
[dashboardChild]="dashboardChild()"
|
|
11685
|
+
[isLinked]="isLinked()"
|
|
11686
|
+
[controls]="controls()"
|
|
11687
|
+
[config]="config()"
|
|
11688
|
+
(toggle)="onLinkToggle($event)"
|
|
11689
|
+
></c8y-link-buttons>
|
|
11690
|
+
|
|
11691
|
+
@if (!isLinked()) {
|
|
11692
|
+
<c8y-context-controls
|
|
11693
|
+
[controls]="controls()"
|
|
11694
|
+
displayMode="dashboard"
|
|
11695
|
+
[config]="config()"
|
|
11696
|
+
[isLoading]="isLoading()"
|
|
11697
|
+
(configChange)="onLocalChange($event)"
|
|
11698
|
+
(refresh)="onLocalRefresh()"
|
|
11699
|
+
></c8y-context-controls>
|
|
11700
|
+
}
|
|
11701
|
+
`
|
|
11702
|
+
}]
|
|
11703
|
+
}], ctorParameters: () => [], propDecorators: { controls: [{ type: i0.Input, args: [{ isSignal: true, alias: "controls", required: false }] }], config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }], isLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "isLoading", required: false }] }], dashboardChild: [{ type: i0.Input, args: [{ isSignal: true, alias: "dashboardChild", required: true }] }], linked: [{ type: i0.Input, args: [{ isSignal: true, alias: "linked", required: false }] }], configChange: [{ type: i0.Output, args: ["configChange"] }], refresh: [{ type: i0.Output, args: ["refresh"] }] } });
|
|
11704
|
+
|
|
11705
|
+
class LocalControlsComponent {
|
|
11706
|
+
constructor() {
|
|
11707
|
+
this.controls = input(PRESET_NAME.DEFAULT, ...(ngDevMode ? [{ debugName: "controls" }] : []));
|
|
11708
|
+
this.displayMode = input(GLOBAL_CONTEXT_DISPLAY_MODE.CONFIG, ...(ngDevMode ? [{ debugName: "displayMode" }] : []));
|
|
11709
|
+
this.config = input.required(...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
11710
|
+
this.isLoading = input(false, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
|
|
11711
|
+
this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
11712
|
+
this.configChange = output();
|
|
11713
|
+
this.refresh = output();
|
|
11714
|
+
}
|
|
11715
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: LocalControlsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
11716
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.15", type: LocalControlsComponent, isStandalone: true, selector: "c8y-local-controls", inputs: { controls: { classPropertyName: "controls", publicName: "controls", isSignal: true, isRequired: false, transformFunction: null }, displayMode: { classPropertyName: "displayMode", publicName: "displayMode", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { configChange: "configChange", refresh: "refresh" }, host: { attributes: { "data-local-controls": "true" }, properties: { "class.disabled": "disabled()" } }, ngImport: i0, template: `
|
|
11717
|
+
<div [class.disabled-overlay]="disabled()">
|
|
11718
|
+
<c8y-context-controls
|
|
11719
|
+
[controls]="controls()"
|
|
11720
|
+
[displayMode]="displayMode()"
|
|
11721
|
+
[config]="config()"
|
|
11722
|
+
[isLoading]="isLoading()"
|
|
11723
|
+
(configChange)="configChange.emit($event)"
|
|
11724
|
+
(refresh)="refresh.emit()"
|
|
11725
|
+
></c8y-context-controls>
|
|
11726
|
+
</div>
|
|
11727
|
+
`, isInline: true, styles: [".disabled-overlay{position:relative;cursor:not-allowed}.disabled-overlay:after{content:\"\";position:absolute;inset:0;z-index:10}\n"], dependencies: [{ kind: "component", type: ContextControlsComponent, selector: "c8y-context-controls", inputs: ["controls", "displayMode", "config", "isLoading"], outputs: ["configChange", "refresh"] }] }); }
|
|
11728
|
+
}
|
|
11729
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: LocalControlsComponent, decorators: [{
|
|
11730
|
+
type: Component,
|
|
11731
|
+
args: [{ selector: 'c8y-local-controls', standalone: true, imports: [ContextControlsComponent], host: {
|
|
11732
|
+
'data-local-controls': 'true',
|
|
11733
|
+
'[class.disabled]': 'disabled()'
|
|
11734
|
+
}, template: `
|
|
11735
|
+
<div [class.disabled-overlay]="disabled()">
|
|
11736
|
+
<c8y-context-controls
|
|
11737
|
+
[controls]="controls()"
|
|
11738
|
+
[displayMode]="displayMode()"
|
|
11739
|
+
[config]="config()"
|
|
11740
|
+
[isLoading]="isLoading()"
|
|
11741
|
+
(configChange)="configChange.emit($event)"
|
|
11742
|
+
(refresh)="refresh.emit()"
|
|
11743
|
+
></c8y-context-controls>
|
|
11744
|
+
</div>
|
|
11745
|
+
`, styles: [".disabled-overlay{position:relative;cursor:not-allowed}.disabled-overlay:after{content:\"\";position:absolute;inset:0;z-index:10}\n"] }]
|
|
11746
|
+
}], propDecorators: { controls: [{ type: i0.Input, args: [{ isSignal: true, alias: "controls", required: false }] }], displayMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayMode", required: false }] }], config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }], isLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "isLoading", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], configChange: [{ type: i0.Output, args: ["configChange"] }], refresh: [{ type: i0.Output, args: ["refresh"] }] } });
|
|
11747
|
+
|
|
11748
|
+
/** @deprecated Use LocalControlsComponent or GlobalContextConnectorComponent instead */
|
|
10694
11749
|
|
|
10695
11750
|
class GlobalContextModule {
|
|
10696
11751
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: GlobalContextModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
@@ -10707,11 +11762,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
10707
11762
|
}]
|
|
10708
11763
|
}] });
|
|
10709
11764
|
|
|
10710
|
-
// Export models
|
|
10711
|
-
|
|
10712
11765
|
/**
|
|
10713
11766
|
* Generated bundle index. Do not edit.
|
|
10714
11767
|
*/
|
|
10715
11768
|
|
|
10716
|
-
export { AGGREGATIONS, AGGREGATION_ICONS, AGGREGATION_ICON_TYPE, AGGREGATION_LABELS, AGGREGATION_LIMITS, AGGREGATION_TEXTS, AGGREGATION_VALUES, AGGREGATION_VALUES_ARR, AggregationDisplayComponent, AggregationPickerComponent, AggregationPickerService, AggregationValidationService, AutoRefreshControlComponent, ConfigContextSelectorComponent, ConfigurationCollapseComponent, ConfigurationControlsComponent, ContextControlsComponent
|
|
11769
|
+
export { AGGREGATIONS, AGGREGATION_ICONS, AGGREGATION_ICON_TYPE, AGGREGATION_LABELS, AGGREGATION_LIMITS, AGGREGATION_TEXTS, AGGREGATION_VALUES, AGGREGATION_VALUES_ARR, AggregationDisplayComponent, AggregationPickerComponent, AggregationPickerService, AggregationValidationService, AutoRefreshControlComponent, CONTEXT_FEATURE, CONTROL_PRESETS, ConfigContextSelectorComponent, ConfigModeControls, ConfigModeControls as ConfigModeControlsComponent, ConfigurationCollapseComponent, ConfigurationControlsComponent, ContextControlsComponent$1 as ContextControlsComponent, DEFAULT_WIDGET_TEMPLATE, DateContextQueryParamNames, DateTimeContextPickerComponent, DateTimeContextPickerService, GLOBAL_CONTEXT_DEFAULTS, GLOBAL_CONTEXT_DISPLAY_MODE, GLOBAL_CONTEXT_EVENTS, GLOBAL_CONTEXT_SOURCE, GlobalContextComponent, GlobalContextConfigComponent, GlobalContextConnectorComponent, GlobalContextEventService, GlobalContextFormService, GlobalContextInlineComponent, GlobalContextLinkControlsComponent, GlobalContextModule, GlobalContextNavigationService, GlobalContextQueryService, GlobalContextService, GlobalContextUtilsService, GlobalContextValidationService, GlobalContextWidgetConfigComponent, GlobalContextWidgetWrapperComponent, HistoryModeConfigurationControlsComponent, INTERVALS, INTERVAL_TITLES, IntervalPickerComponent, LINK_BTNS_CONFIG, LinkButtonsComponent, LiveModeConfigurationControlsComponent, LocalControlsComponent, PRESET_NAME, PreviewControlsComponent, REFRESH_OPTION, ROUTE_PATHS, RealtimeControlComponent, TIME_DURATION, TIME_INTERVAL, TIME_SPAN_MS, TIMING, TimeRangeDisplayComponent, UI_PRIORITIES, WIDGET_DISPLAY_MODE, WIDGET_FEATURE_MAP, WidgetConfigMigrationService, WidgetControlService, applyModeConstraints, buildAggregationExtensions, buildBaselineControls, buildWidgetControlsFromPresets, controlsToSettings, createAutoRefreshHandlers, createResult, defineWidgetControls, getSupportedModes, guards, isAggregationLinked, isAggregationUnlinked, isAutoRefreshDisabled, isAutoRefreshEnabled, isConfig, isDashboard, isDateTimeContextLinked, isDateTimeContextUnlinked, isHistory, isLive, isViewAndConfig, mergePartialControls, resolveWidgetControlsInput, setAutoRefreshControlsVisibility, setAutoRefreshLinks, updateBothSettings };
|
|
10717
11770
|
//# sourceMappingURL=c8y-ngx-components-global-context.mjs.map
|