@c8y/ngx-components 1021.55.2 → 1021.55.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/common/interval-based-reload.abstract.d.ts +13 -3
- package/core/common/interval-based-reload.abstract.d.ts.map +1 -1
- package/core/dashboard/widget-auto-refresh-context/auto-refresh-control.component.d.ts +3 -4
- package/core/dashboard/widget-auto-refresh-context/auto-refresh-control.component.d.ts.map +1 -1
- package/core/dashboard/widget-auto-refresh-context/widget-auto-refresh-context.component.d.ts +1 -0
- package/core/dashboard/widget-auto-refresh-context/widget-auto-refresh-context.component.d.ts.map +1 -1
- package/core/dashboard/widgets-dashboard-event.service.d.ts +7 -0
- package/core/dashboard/widgets-dashboard-event.service.d.ts.map +1 -1
- package/core/dashboard/wiget-time-context/widget-time-context.component.d.ts +6 -2
- package/core/dashboard/wiget-time-context/widget-time-context.component.d.ts.map +1 -1
- package/datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/data-fetching.service.d.ts.map +1 -1
- package/datapoints-export-selector/datapoints-export-selector.component.d.ts +3 -1
- package/datapoints-export-selector/datapoints-export-selector.component.d.ts.map +1 -1
- package/esm2022/core/aggregation/aggregation.model.mjs +2 -2
- package/esm2022/core/common/interval-based-reload.abstract.mjs +13 -13
- package/esm2022/core/dashboard/dashboard-child.component.mjs +3 -3
- package/esm2022/core/dashboard/widget-auto-refresh-context/auto-refresh-control.component.mjs +6 -8
- package/esm2022/core/dashboard/widget-auto-refresh-context/widget-auto-refresh-context.component.mjs +9 -1
- package/esm2022/core/dashboard/widgets-dashboard-event.service.mjs +19 -2
- package/esm2022/core/dashboard/widgets-dashboard.component.mjs +3 -3
- package/esm2022/core/dashboard/wiget-time-context/widget-time-context-icon-bar/widget-time-context-icon-bar.component.mjs +3 -3
- package/esm2022/core/dashboard/wiget-time-context/widget-time-context.component.mjs +48 -23
- package/esm2022/datapoint-explorer/view/datapoint-explorer.component.mjs +2 -2
- package/esm2022/datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/data-fetching.service.mjs +1 -3
- package/esm2022/datapoints-export-selector/datapoints-export-selector.component.mjs +9 -5
- package/esm2022/widgets/definitions/datapoints-table/index.mjs +3 -2
- package/esm2022/widgets/implementations/alarms/alarm-list-widget-view/alarm-list-widget.component.mjs +3 -3
- package/esm2022/widgets/implementations/alarms/alarm-widget-alarms-reload.component.mjs +17 -100
- package/esm2022/widgets/implementations/datapoints-table/datapoints-table-config/datapoints-table-config.component.mjs +47 -34
- package/esm2022/widgets/implementations/datapoints-table/datapoints-table-view/datapoints-reload/datapoints-reload.component.mjs +35 -13
- package/esm2022/widgets/implementations/datapoints-table/datapoints-table-view/datapoints-table/datapoints-table.component.mjs +3 -3
- package/esm2022/widgets/implementations/datapoints-table/datapoints-table-view/datapoints-table-view.component.mjs +75 -35
- package/esm2022/widgets/implementations/datapoints-table/datapoints-table-widget.model.mjs +3 -5
- package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs +1 -1
- package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-datapoints-export-selector.mjs +7 -6
- package/fesm2022/c8y-ngx-components-datapoints-export-selector.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-datapoints-table.mjs +2 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-datapoints-table.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-alarms.mjs +18 -101
- package/fesm2022/c8y-ngx-components-widgets-implementations-alarms.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-table.mjs +147 -76
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-table.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components.mjs +209 -162
- package/fesm2022/c8y-ngx-components.mjs.map +1 -1
- package/locales/locales.pot +3 -4
- package/package.json +1 -1
- package/widgets/definitions/datapoints-table/index.d.ts.map +1 -1
- package/widgets/implementations/alarms/alarm-widget-alarms-reload.component.d.ts +18 -63
- package/widgets/implementations/alarms/alarm-widget-alarms-reload.component.d.ts.map +1 -1
- package/widgets/implementations/datapoints-table/datapoints-table-config/datapoints-table-config.component.d.ts +4 -2
- package/widgets/implementations/datapoints-table/datapoints-table-config/datapoints-table-config.component.d.ts.map +1 -1
- package/widgets/implementations/datapoints-table/datapoints-table-view/datapoints-reload/datapoints-reload.component.d.ts +16 -8
- package/widgets/implementations/datapoints-table/datapoints-table-view/datapoints-reload/datapoints-reload.component.d.ts.map +1 -1
- package/widgets/implementations/datapoints-table/datapoints-table-view/datapoints-table-view.component.d.ts +21 -4
- package/widgets/implementations/datapoints-table/datapoints-table-view/datapoints-table-view.component.d.ts.map +1 -1
- package/widgets/implementations/datapoints-table/datapoints-table-widget.model.d.ts +4 -1
- package/widgets/implementations/datapoints-table/datapoints-table-widget.model.d.ts.map +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Directive, Input, Injector, InjectionToken, Injectable, Optional, Inject, isDevMode, inject, Pipe, EventEmitter, NgModule, LOCALE_ID, EnvironmentInjector, HostListener, NgModuleRef, createNgModule, Component, Output, HostBinding, forwardRef, SecurityContext, TemplateRef, APP_INITIALIZER,
|
|
2
|
+
import { Directive, Input, Injector, InjectionToken, Injectable, Optional, Inject, isDevMode, inject, Pipe, EventEmitter, NgModule, LOCALE_ID, EnvironmentInjector, HostListener, NgModuleRef, createNgModule, Component, Output, HostBinding, forwardRef, SecurityContext, TemplateRef, APP_INITIALIZER, Self, SkipSelf, ViewChild, Attribute, ContentChild, ViewContainerRef, ContentChildren, ElementRef, ViewChildren, createComponent, runInInjectionContext, importProvidersFrom, ChangeDetectionStrategy, SimpleChange, reflectComponentType, signal, effect, Type, DestroyRef } from '@angular/core';
|
|
3
3
|
import * as i1$4 from 'ngx-bootstrap/dropdown';
|
|
4
4
|
import { BsDropdownModule, BsDropdownDirective } from 'ngx-bootstrap/dropdown';
|
|
5
5
|
import * as i3 from '@angular/cdk/a11y';
|
|
6
6
|
import { A11yModule, CdkTrapFocus } from '@angular/cdk/a11y';
|
|
7
|
-
import { castArray, flatten, uniq, sortBy, groupBy, camelCase, isEqual, isUndefined, throttle as throttle$1, keys, get, isNaN as isNaN$1, isFinite, each, mapValues, mapKeys, forEach, reduce, union, cloneDeep, uniqBy, assign, min, every, first, map as map$2, find, negate, upperFirst, memoize as memoize$1, property, some, entries, omitBy, isDate, orderBy, flatMap, isEmpty, filter as filter$
|
|
8
|
-
import { merge, of, defer, combineLatest, race, isObservable, from, Subject, BehaviorSubject, NEVER, Observable, firstValueFrom, map as map$1, distinctUntilChanged as distinctUntilChanged$1, fromEvent, pipe, throwError, concat, EMPTY, timer, fromEventPattern, startWith as startWith$1, switchMap as switchMap$1, takeUntil as takeUntil$1, empty, forkJoin, ReplaySubject, interval, shareReplay as shareReplay$1, mergeMap as mergeMap$1 } from 'rxjs';
|
|
7
|
+
import { castArray, flatten, uniq, sortBy, groupBy, camelCase, isEqual, isUndefined, throttle as throttle$1, keys, get, isNaN as isNaN$1, isFinite, each, mapValues, mapKeys, forEach, reduce, union, cloneDeep, uniqBy, assign, min, every, first, map as map$2, find, negate, upperFirst, memoize as memoize$1, property, some, entries, omitBy, isDate, orderBy, flatMap, isEmpty, filter as filter$2, snakeCase, matches, isString, clone, toNumber, isEqualWith, escape as escape$1, escapeRegExp, assignWith, set, omit, pick, has, transform, identity, flow, isNil, chunk, values, without, indexOf, parseInt as parseInt$1, kebabCase, forOwn } from 'lodash-es';
|
|
8
|
+
import { merge, of, defer, combineLatest, race, isObservable, from, Subject, BehaviorSubject, NEVER, Observable, firstValueFrom, map as map$1, distinctUntilChanged as distinctUntilChanged$1, fromEvent, pipe, throwError, concat, filter as filter$1, tap as tap$1, EMPTY, timer, fromEventPattern, startWith as startWith$1, switchMap as switchMap$1, takeUntil as takeUntil$1, empty, forkJoin, ReplaySubject, interval, shareReplay as shareReplay$1, mergeMap as mergeMap$1 } from 'rxjs';
|
|
9
9
|
import { map, distinctUntilChanged, filter, startWith, switchMap, take, shareReplay, scan, debounceTime, share, takeUntil, tap, catchError, first as first$1, retryWhen, delay, concatMap, debounce, sample, withLatestFrom, mergeMap, every as every$1, toArray, merge as merge$1, expand, skip, mapTo, finalize, reduce as reduce$1, combineLatestWith } from 'rxjs/operators';
|
|
10
10
|
import * as i1 from '@c8y/client';
|
|
11
11
|
import { ApplicationAvailability, OperationStatus, TenantLoginOptionType, UserManagementSource, GrantType, ApplicationType, BearerAuthFromSessionStorage, FetchClient, Client, PasswordStrength, QueriesUtil, InventoryService, UserService, ApplicationService, TenantService, AlarmService, aggregationType, Service } from '@c8y/client';
|
|
@@ -9429,7 +9429,7 @@ class IntervalBasedReload {
|
|
|
9429
9429
|
return;
|
|
9430
9430
|
}
|
|
9431
9431
|
// Checks if the user has stopped scrolling and the countdown is currently hidden
|
|
9432
|
-
const onUserScrollTopShow = !this.isScrolling && this.hideCountdown;
|
|
9432
|
+
const onUserScrollTopShow = !this.isScrolling && this.countdownSubscription?.closed && this.hideCountdown;
|
|
9433
9433
|
if (onUserScrollTopShow) {
|
|
9434
9434
|
this.isIntervalRefreshToggleOn = true;
|
|
9435
9435
|
this.enableCountdown();
|
|
@@ -9452,14 +9452,15 @@ class IntervalBasedReload {
|
|
|
9452
9452
|
*/
|
|
9453
9453
|
onToggleCountdownButtonState($event) {
|
|
9454
9454
|
$event.preventDefault();
|
|
9455
|
-
this.isIntervalRefreshToggleOn = !this.isIntervalRefreshToggleOn;
|
|
9455
|
+
this.isIntervalRefreshToggleOn = !this.isRefreshDisabled && !this.isIntervalRefreshToggleOn;
|
|
9456
9456
|
this.updateCountdownButtonTooltipText();
|
|
9457
9457
|
if (!this.isIntervalRefreshToggleOn) {
|
|
9458
9458
|
this.disableCountdown();
|
|
9459
9459
|
this.manuallyDisabledCountdown = true;
|
|
9460
9460
|
return;
|
|
9461
9461
|
}
|
|
9462
|
-
|
|
9462
|
+
const onRefreshToggleOn = this.isIntervalRefreshToggleOn && this.countdownSubscription.closed;
|
|
9463
|
+
if (onRefreshToggleOn) {
|
|
9463
9464
|
this.enableCountdown();
|
|
9464
9465
|
this.manuallyDisabledCountdown = false;
|
|
9465
9466
|
}
|
|
@@ -9474,14 +9475,12 @@ class IntervalBasedReload {
|
|
|
9474
9475
|
* @param injector - The injector used to provide necessary dependencies
|
|
9475
9476
|
* within the `runInInjectionContext`.
|
|
9476
9477
|
*/
|
|
9477
|
-
startCountdown(
|
|
9478
|
-
|
|
9479
|
-
|
|
9480
|
-
|
|
9481
|
-
|
|
9482
|
-
|
|
9483
|
-
});
|
|
9484
|
-
});
|
|
9478
|
+
startCountdown() {
|
|
9479
|
+
this.countdownSubscription = this.isLoading
|
|
9480
|
+
.pipe(filter$1(isLoading => !Boolean(isLoading)), tap$1(() => {
|
|
9481
|
+
this.countdownIntervalComponent?.start();
|
|
9482
|
+
}))
|
|
9483
|
+
.subscribe();
|
|
9485
9484
|
}
|
|
9486
9485
|
/**
|
|
9487
9486
|
* Disables and hides the countdown timer.
|
|
@@ -9492,6 +9491,7 @@ class IntervalBasedReload {
|
|
|
9492
9491
|
* conceal the countdown timer.
|
|
9493
9492
|
*/
|
|
9494
9493
|
disableCountdown() {
|
|
9494
|
+
this.countdownSubscription.unsubscribe();
|
|
9495
9495
|
this.countdownIntervalComponent?.stop();
|
|
9496
9496
|
this.hideCountdown = true;
|
|
9497
9497
|
}
|
|
@@ -10901,9 +10901,9 @@ class ActionBarComponent {
|
|
|
10901
10901
|
});
|
|
10902
10902
|
}
|
|
10903
10903
|
ngOnInit() {
|
|
10904
|
-
this.right$ = this.items$.pipe(map(items => filter$
|
|
10905
|
-
this.left$ = this.items$.pipe(map(items => filter$
|
|
10906
|
-
this.more$ = this.items$.pipe(map(items => filter$
|
|
10904
|
+
this.right$ = this.items$.pipe(map(items => filter$2(items, { placement: 'right' })), map(items => sortBy(items, this.byPriority)));
|
|
10905
|
+
this.left$ = this.items$.pipe(map(items => filter$2(items, { placement: 'left' })), map(items => sortBy(items, this.byPriority)));
|
|
10906
|
+
this.more$ = this.items$.pipe(map(items => filter$2(items, { placement: 'more' })), map(items => sortBy(items, this.byPriority)));
|
|
10907
10907
|
this.hidden$ = this.items$.pipe(map(items => {
|
|
10908
10908
|
return !(items && items.length);
|
|
10909
10909
|
}));
|
|
@@ -14887,7 +14887,7 @@ class PasswordService {
|
|
|
14887
14887
|
return password.search(/[^0-9a-zA-Z]+/) !== -1;
|
|
14888
14888
|
}
|
|
14889
14889
|
getStrengthColor(password) {
|
|
14890
|
-
const passwordStrength = filter$
|
|
14890
|
+
const passwordStrength = filter$2([
|
|
14891
14891
|
this.hasLowerCase(password),
|
|
14892
14892
|
this.hasUpperCase(password),
|
|
14893
14893
|
this.hasNumbers(password),
|
|
@@ -15194,7 +15194,7 @@ class PasswordStrengthCheckerService {
|
|
|
15194
15194
|
return password.search(/[^0-9a-zA-Z]+/) !== -1;
|
|
15195
15195
|
}
|
|
15196
15196
|
getStrengthColor(password) {
|
|
15197
|
-
const passwordStrength = filter$
|
|
15197
|
+
const passwordStrength = filter$2([
|
|
15198
15198
|
this.hasLowerCase(password),
|
|
15199
15199
|
this.hasUpperCase(password),
|
|
15200
15200
|
this.hasNumbers(password),
|
|
@@ -28236,7 +28236,7 @@ const AGGREGATION_ICONS = {
|
|
|
28236
28236
|
DAILY: 'calendar-o'
|
|
28237
28237
|
};
|
|
28238
28238
|
const AGGREGATION_TEXTS = {
|
|
28239
|
-
disabled: gettext$1('No aggregation with
|
|
28239
|
+
disabled: gettext$1('No aggregation with real-time or auto-refresh enabled'),
|
|
28240
28240
|
undefined: gettext$1('No aggregation'),
|
|
28241
28241
|
MINUTELY: gettext$1('Minutely aggregation'),
|
|
28242
28242
|
HOURLY: gettext$1('Hourly aggregation'),
|
|
@@ -28276,11 +28276,11 @@ class WidgetTimeContextIconBar {
|
|
|
28276
28276
|
}
|
|
28277
28277
|
}
|
|
28278
28278
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WidgetTimeContextIconBar, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
28279
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: WidgetTimeContextIconBar, selector: "c8y-widget-time-context-icon-bar", inputs: { config: "config" }, ngImport: i0, template: "<span class=\"m-l-auto d-flex\">\n <button\n class=\"btn btn-clean btn-no-focus\"\n [attr.aria-label]=\"'Aggregation' | translate\"\n tooltip=\"{{\n (config?.aggregation ? AGGREGATION_TEXTS[config.aggregation] : AGGREGATION_TEXTS.undefined)\n | translate\n }}\"\n placement=\"top\"\n container=\"body\"\n type=\"button\"\n *ngIf=\"config.displaySettings.globalAggregationContext\"\n [adaptivePosition]=\"false\"\n >\n <i\n class=\"icon-14\"\n [c8yIcon]=\"\n config?.aggregation ? AGGREGATION_ICONS[config.aggregation] : AGGREGATION_ICONS.undefined\n \"\n ></i>\n </button>\n <button\n class=\"btn c8y-realtime btn-no-focus\"\n [attr.aria-label]=\"(config?.realtime ? 'Realtime active' : 'Realtime inactive') | translate\"\n tooltip=\"{{ (config?.realtime ? 'Realtime active' : 'Realtime inactive') | translate }}\"\n placement=\"top\"\n container=\"body\"\n type=\"button\"\n >\n <span\n class=\"c8y-pulse m-0\"\n [ngClass]=\"{ active: config?.realtime, inactive: !config?.realtime }\"\n ></span>\n </button>\n <button\n class=\"btn btn-clean btn-no-focus p-l-4 p-r-0\"\n [attr.aria-label]=\"globalContextButtonText | translate\"\n [tooltip]=\"globalContextButtonText | translate\"\n placement=\"top\"\n container=\"body\"\n data-cy=\"dashboard-child--global-date-context-indicator\"\n >\n <span class=\"tag tag--success chip\">\n <i c8yIcon=\"clock\"></i>\n {{ 'Realtime' | translate }}\n </span>\n </button>\n</span>\n", dependencies: [{ kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$2.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: i1$1.TranslatePipe, name: "translate" }] }); }
|
|
28279
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: WidgetTimeContextIconBar, selector: "c8y-widget-time-context-icon-bar", inputs: { config: "config" }, ngImport: i0, template: "<span class=\"m-l-auto d-flex\">\n <button\n class=\"btn btn-clean btn-no-focus\"\n [attr.aria-label]=\"'Aggregation' | translate\"\n tooltip=\"{{\n (config?.aggregation ? AGGREGATION_TEXTS[config.aggregation] : AGGREGATION_TEXTS.undefined)\n | translate\n }}\"\n placement=\"top\"\n container=\"body\"\n type=\"button\"\n *ngIf=\"config.displaySettings.globalAggregationContext\"\n [adaptivePosition]=\"false\"\n >\n <i\n class=\"icon-14\"\n [c8yIcon]=\"\n config?.aggregation ? AGGREGATION_ICONS[config.aggregation] : AGGREGATION_ICONS.undefined\n \"\n ></i>\n </button>\n <button\n class=\"btn c8y-realtime btn-no-focus\"\n [attr.aria-label]=\"(config?.realtime ? 'Realtime active' : 'Realtime inactive') | translate\"\n tooltip=\"{{ (config?.realtime ? 'Realtime active' : 'Realtime inactive') | translate }}\"\n placement=\"top\"\n container=\"body\"\n type=\"button\"\n *ngIf=\"config?.widgetInstanceGlobalTimeContext\"\n >\n <span\n class=\"c8y-pulse m-0\"\n [ngClass]=\"{ active: config?.realtime, inactive: !config?.realtime }\"\n ></span>\n </button>\n <button\n class=\"btn btn-clean btn-no-focus p-l-4 p-r-0\"\n [attr.aria-label]=\"globalContextButtonText | translate\"\n [tooltip]=\"globalContextButtonText | translate\"\n placement=\"top\"\n container=\"body\"\n data-cy=\"dashboard-child--global-date-context-indicator\"\n *ngIf=\"config?.widgetInstanceGlobalTimeContext\"\n >\n <span class=\"tag tag--success chip\">\n <i c8yIcon=\"clock\"></i>\n {{ 'Realtime' | translate }}\n </span>\n </button>\n</span>\n", dependencies: [{ kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$2.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: i1$1.TranslatePipe, name: "translate" }] }); }
|
|
28280
28280
|
}
|
|
28281
28281
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WidgetTimeContextIconBar, decorators: [{
|
|
28282
28282
|
type: Component,
|
|
28283
|
-
args: [{ selector: 'c8y-widget-time-context-icon-bar', template: "<span class=\"m-l-auto d-flex\">\n <button\n class=\"btn btn-clean btn-no-focus\"\n [attr.aria-label]=\"'Aggregation' | translate\"\n tooltip=\"{{\n (config?.aggregation ? AGGREGATION_TEXTS[config.aggregation] : AGGREGATION_TEXTS.undefined)\n | translate\n }}\"\n placement=\"top\"\n container=\"body\"\n type=\"button\"\n *ngIf=\"config.displaySettings.globalAggregationContext\"\n [adaptivePosition]=\"false\"\n >\n <i\n class=\"icon-14\"\n [c8yIcon]=\"\n config?.aggregation ? AGGREGATION_ICONS[config.aggregation] : AGGREGATION_ICONS.undefined\n \"\n ></i>\n </button>\n <button\n class=\"btn c8y-realtime btn-no-focus\"\n [attr.aria-label]=\"(config?.realtime ? 'Realtime active' : 'Realtime inactive') | translate\"\n tooltip=\"{{ (config?.realtime ? 'Realtime active' : 'Realtime inactive') | translate }}\"\n placement=\"top\"\n container=\"body\"\n type=\"button\"\n >\n <span\n class=\"c8y-pulse m-0\"\n [ngClass]=\"{ active: config?.realtime, inactive: !config?.realtime }\"\n ></span>\n </button>\n <button\n class=\"btn btn-clean btn-no-focus p-l-4 p-r-0\"\n [attr.aria-label]=\"globalContextButtonText | translate\"\n [tooltip]=\"globalContextButtonText | translate\"\n placement=\"top\"\n container=\"body\"\n data-cy=\"dashboard-child--global-date-context-indicator\"\n >\n <span class=\"tag tag--success chip\">\n <i c8yIcon=\"clock\"></i>\n {{ 'Realtime' | translate }}\n </span>\n </button>\n</span>\n" }]
|
|
28283
|
+
args: [{ selector: 'c8y-widget-time-context-icon-bar', template: "<span class=\"m-l-auto d-flex\">\n <button\n class=\"btn btn-clean btn-no-focus\"\n [attr.aria-label]=\"'Aggregation' | translate\"\n tooltip=\"{{\n (config?.aggregation ? AGGREGATION_TEXTS[config.aggregation] : AGGREGATION_TEXTS.undefined)\n | translate\n }}\"\n placement=\"top\"\n container=\"body\"\n type=\"button\"\n *ngIf=\"config.displaySettings.globalAggregationContext\"\n [adaptivePosition]=\"false\"\n >\n <i\n class=\"icon-14\"\n [c8yIcon]=\"\n config?.aggregation ? AGGREGATION_ICONS[config.aggregation] : AGGREGATION_ICONS.undefined\n \"\n ></i>\n </button>\n <button\n class=\"btn c8y-realtime btn-no-focus\"\n [attr.aria-label]=\"(config?.realtime ? 'Realtime active' : 'Realtime inactive') | translate\"\n tooltip=\"{{ (config?.realtime ? 'Realtime active' : 'Realtime inactive') | translate }}\"\n placement=\"top\"\n container=\"body\"\n type=\"button\"\n *ngIf=\"config?.widgetInstanceGlobalTimeContext\"\n >\n <span\n class=\"c8y-pulse m-0\"\n [ngClass]=\"{ active: config?.realtime, inactive: !config?.realtime }\"\n ></span>\n </button>\n <button\n class=\"btn btn-clean btn-no-focus p-l-4 p-r-0\"\n [attr.aria-label]=\"globalContextButtonText | translate\"\n [tooltip]=\"globalContextButtonText | translate\"\n placement=\"top\"\n container=\"body\"\n data-cy=\"dashboard-child--global-date-context-indicator\"\n *ngIf=\"config?.widgetInstanceGlobalTimeContext\"\n >\n <span class=\"tag tag--success chip\">\n <i c8yIcon=\"clock\"></i>\n {{ 'Realtime' | translate }}\n </span>\n </button>\n</span>\n" }]
|
|
28284
28284
|
}], propDecorators: { config: [{
|
|
28285
28285
|
type: Input
|
|
28286
28286
|
}] } });
|
|
@@ -28520,13 +28520,13 @@ class DashboardChildComponent {
|
|
|
28520
28520
|
return false;
|
|
28521
28521
|
}
|
|
28522
28522
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DashboardChildComponent, deps: [{ token: DashboardComponent }, { token: i1$3.DomSanitizer }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
28523
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: DashboardChildComponent, selector: "c8y-dashboard-child", inputs: { x: "x", y: "y", width: "width", height: "height", data: "data", margin: "margin", useIntersection: "useIntersection", isFrozen: "isFrozen", canToggleFullscreen: "canToggleFullscreen", editMode: "editMode", class: "class" }, outputs: { changeStart: "changeStart", changeEnd: "changeEnd", toggleFullscreen: "toggleFullscreen" }, host: { properties: { "class.fullscreen": "this.fullscreen", "attr.style": "this.inlineStyle" }, classAttribute: "dashboard-grid-child" }, queries: [{ propertyName: "templateActions", predicate: DashboardChildActionComponent }], usesOnChanges: true, ngImport: i0, template: "<div cdkDropList>\n <div\n class=\"card-placeholder\"\n *ngIf=\"isResize\"\n ></div>\n <div\n [ngStyle]=\"{ width: _pxWidth, height: _pxHeight }\"\n [ngClass]=\"klasses\"\n cdkDrag\n (cdkDragStarted)=\"dragStarted($event)\"\n (cdkDragEnded)=\"reset($event)\"\n [cdkDragDisabled]=\"(isOneColumnView$ | async) || !editMode || fullscreen\"\n >\n <div\n class=\"card-header-actions card-header-grid\"\n [ngClass]=\"{\n 'drag-handle': editMode && !fullscreen,\n draggableCursor: editMode && !fullscreen\n }\"\n cdkDragHandle\n >\n <ng-content select=\"c8y-dashboard-child-title\"></ng-content>\n <div\n class=\"header-actions d-flex a-i-center\"\n *ngIf=\"actions.length > 0\"\n >\n <c8y-widget-time-context-icon-bar\n *ngIf=\"data?.config?.displaySettings
|
|
28523
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: DashboardChildComponent, selector: "c8y-dashboard-child", inputs: { x: "x", y: "y", width: "width", height: "height", data: "data", margin: "margin", useIntersection: "useIntersection", isFrozen: "isFrozen", canToggleFullscreen: "canToggleFullscreen", editMode: "editMode", class: "class" }, outputs: { changeStart: "changeStart", changeEnd: "changeEnd", toggleFullscreen: "toggleFullscreen" }, host: { properties: { "class.fullscreen": "this.fullscreen", "attr.style": "this.inlineStyle" }, classAttribute: "dashboard-grid-child" }, queries: [{ propertyName: "templateActions", predicate: DashboardChildActionComponent }], usesOnChanges: true, ngImport: i0, template: "<div cdkDropList>\n <div\n class=\"card-placeholder\"\n *ngIf=\"isResize\"\n ></div>\n <div\n [ngStyle]=\"{ width: _pxWidth, height: _pxHeight }\"\n [ngClass]=\"klasses\"\n cdkDrag\n (cdkDragStarted)=\"dragStarted($event)\"\n (cdkDragEnded)=\"reset($event)\"\n [cdkDragDisabled]=\"(isOneColumnView$ | async) || !editMode || fullscreen\"\n >\n <div\n class=\"card-header-actions card-header-grid\"\n [ngClass]=\"{\n 'drag-handle': editMode && !fullscreen,\n draggableCursor: editMode && !fullscreen\n }\"\n cdkDragHandle\n >\n <ng-content select=\"c8y-dashboard-child-title\"></ng-content>\n <div\n class=\"header-actions d-flex a-i-center\"\n *ngIf=\"actions.length > 0\"\n >\n <c8y-widget-time-context-icon-bar\n *ngIf=\"\n data?.config?.displaySettings &&\n (data?.config?.widgetInstanceGlobalTimeContext ||\n data?.config?.widgetInstanceGlobalAutoRefreshContext)\n \"\n [config]=\"data.config\"\n ></c8y-widget-time-context-icon-bar>\n <c8y-widget-auto-refresh-context-icon-bar\n *ngIf=\"\n data?.config?.widgetInstanceGlobalAutoRefreshContext &&\n data?.config?.displaySettings.globalAutoRefreshContext\n \"\n ></c8y-widget-auto-refresh-context-icon-bar>\n\n <button\n class=\"btn btn-icon\"\n [attr.aria-label]=\"'Full screen' | translate\"\n [tooltip]=\"fullscreen ? ('Exit full screen' | translate) : ('Full screen' | translate)\"\n [delay]=\"500\"\n container=\"body\"\n [disabled]=\"editMode || !canToggleFullscreen\"\n (click)=\"toggleFullscreen.next()\"\n data-cy=\"c8y-dashboard-child--settings-fullscreen\"\n >\n <i [c8yIcon]=\"fullscreen ? 'compress' : 'expand'\"></i>\n </button>\n <div\n class=\"optionsBtn dropdown\"\n placement=\"bottom right\"\n dropdown\n [container]=\"'body'\"\n >\n <button\n class=\"btn btn-icon c8y-dropdown\"\n title=\"{{ 'Settings' | translate }}\"\n aria-haspopup=\"true\"\n *ngIf=\"editMode\"\n data-cy=\"c8y-dashboard-child--settings\"\n (click)=\"(false)\"\n dropdownToggle\n >\n <i [c8yIcon]=\"'cog'\"></i>\n </button>\n <button\n class=\"btn btn-icon\"\n [attr.aria-label]=\"'Click "Edit widgets" to unlock' | translate\"\n tooltip=\"{{ 'Click "Edit widgets" to unlock' | translate }}\"\n container=\"body\"\n *ngIf=\"!editMode\"\n (click)=\"(false)\"\n data-cy=\"c8y-dashboard-child--settings-locked\"\n >\n <i [c8yIcon]=\"'lock'\"></i>\n </button>\n <ul\n class=\"dropdown-menu dropdown-menu-right\"\n style=\"right: -1px\"\n data-cy=\"c8y-dashboard-child--actions-dropdown\"\n *dropdownMenu\n >\n <ng-container *ngFor=\"let action of actions\">\n <ng-container *ngTemplateOutlet=\"action.template\"></ng-container>\n </ng-container>\n </ul>\n </div>\n </div>\n </div>\n <div class=\"card-inner-scroll\">\n <ng-content></ng-content>\n </div>\n <div\n class=\"resize-handle hidden-xs\"\n *ngIf=\"editMode && !isDragging && !fullscreen\"\n cdkDrag\n [cdkDragDisabled]=\"!editMode || fullscreen\"\n (cdkDragStarted)=\"resizeStarted($event)\"\n (cdkDragEnded)=\"reset($event)\"\n ></div>\n <div\n class=\"resize-icon hidden-xs\"\n *ngIf=\"editMode && !isDragging && !fullscreen\"\n ></div>\n\n <div\n class=\"card-placeholder\"\n *cdkDragPlaceholder\n ></div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i5$2.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i5$2.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i5$2.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "directive", type: i5$2.CdkDragPlaceholder, selector: "ng-template[cdkDragPlaceholder]", inputs: ["data"] }, { kind: "directive", type: i1$4.BsDropdownMenuDirective, selector: "[bsDropdownMenu],[dropdownMenu]", exportAs: ["bs-dropdown-menu"] }, { kind: "directive", type: i1$4.BsDropdownToggleDirective, selector: "[bsDropdownToggle],[dropdownToggle]", exportAs: ["bs-dropdown-toggle"] }, { kind: "directive", type: i1$4.BsDropdownDirective, selector: "[bsDropdown], [dropdown]", inputs: ["placement", "triggers", "container", "dropup", "autoClose", "isAnimated", "insideClick", "isDisabled", "isOpen"], outputs: ["isOpenChange", "onShown", "onHidden"], exportAs: ["bs-dropdown"] }, { kind: "directive", type: i2$2.TooltipDirective, selector: "[tooltip], [tooltipHtml]", inputs: ["adaptivePosition", "tooltip", "placement", "triggers", "container", "containerClass", "boundariesElement", "isOpen", "isDisabled", "delay", "tooltipHtml", "tooltipPlacement", "tooltipIsOpen", "tooltipEnable", "tooltipAppendToBody", "tooltipAnimation", "tooltipClass", "tooltipContext", "tooltipPopupDelay", "tooltipFadeDuration", "tooltipTrigger"], outputs: ["tooltipChange", "onShown", "onHidden", "tooltipStateChanged"], exportAs: ["bs-tooltip"] }, { kind: "component", type: WidgetAutoRefreshContextIconBarComponent, selector: "c8y-widget-auto-refresh-context-icon-bar" }, { kind: "component", type: WidgetTimeContextIconBar, selector: "c8y-widget-time-context-icon-bar", inputs: ["config"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] }); }
|
|
28524
28524
|
}
|
|
28525
28525
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DashboardChildComponent, decorators: [{
|
|
28526
28526
|
type: Component,
|
|
28527
28527
|
args: [{ selector: 'c8y-dashboard-child', host: {
|
|
28528
28528
|
class: 'dashboard-grid-child'
|
|
28529
|
-
}, template: "<div cdkDropList>\n <div\n class=\"card-placeholder\"\n *ngIf=\"isResize\"\n ></div>\n <div\n [ngStyle]=\"{ width: _pxWidth, height: _pxHeight }\"\n [ngClass]=\"klasses\"\n cdkDrag\n (cdkDragStarted)=\"dragStarted($event)\"\n (cdkDragEnded)=\"reset($event)\"\n [cdkDragDisabled]=\"(isOneColumnView$ | async) || !editMode || fullscreen\"\n >\n <div\n class=\"card-header-actions card-header-grid\"\n [ngClass]=\"{\n 'drag-handle': editMode && !fullscreen,\n draggableCursor: editMode && !fullscreen\n }\"\n cdkDragHandle\n >\n <ng-content select=\"c8y-dashboard-child-title\"></ng-content>\n <div\n class=\"header-actions d-flex a-i-center\"\n *ngIf=\"actions.length > 0\"\n >\n <c8y-widget-time-context-icon-bar\n *ngIf=\"data?.config?.displaySettings
|
|
28529
|
+
}, template: "<div cdkDropList>\n <div\n class=\"card-placeholder\"\n *ngIf=\"isResize\"\n ></div>\n <div\n [ngStyle]=\"{ width: _pxWidth, height: _pxHeight }\"\n [ngClass]=\"klasses\"\n cdkDrag\n (cdkDragStarted)=\"dragStarted($event)\"\n (cdkDragEnded)=\"reset($event)\"\n [cdkDragDisabled]=\"(isOneColumnView$ | async) || !editMode || fullscreen\"\n >\n <div\n class=\"card-header-actions card-header-grid\"\n [ngClass]=\"{\n 'drag-handle': editMode && !fullscreen,\n draggableCursor: editMode && !fullscreen\n }\"\n cdkDragHandle\n >\n <ng-content select=\"c8y-dashboard-child-title\"></ng-content>\n <div\n class=\"header-actions d-flex a-i-center\"\n *ngIf=\"actions.length > 0\"\n >\n <c8y-widget-time-context-icon-bar\n *ngIf=\"\n data?.config?.displaySettings &&\n (data?.config?.widgetInstanceGlobalTimeContext ||\n data?.config?.widgetInstanceGlobalAutoRefreshContext)\n \"\n [config]=\"data.config\"\n ></c8y-widget-time-context-icon-bar>\n <c8y-widget-auto-refresh-context-icon-bar\n *ngIf=\"\n data?.config?.widgetInstanceGlobalAutoRefreshContext &&\n data?.config?.displaySettings.globalAutoRefreshContext\n \"\n ></c8y-widget-auto-refresh-context-icon-bar>\n\n <button\n class=\"btn btn-icon\"\n [attr.aria-label]=\"'Full screen' | translate\"\n [tooltip]=\"fullscreen ? ('Exit full screen' | translate) : ('Full screen' | translate)\"\n [delay]=\"500\"\n container=\"body\"\n [disabled]=\"editMode || !canToggleFullscreen\"\n (click)=\"toggleFullscreen.next()\"\n data-cy=\"c8y-dashboard-child--settings-fullscreen\"\n >\n <i [c8yIcon]=\"fullscreen ? 'compress' : 'expand'\"></i>\n </button>\n <div\n class=\"optionsBtn dropdown\"\n placement=\"bottom right\"\n dropdown\n [container]=\"'body'\"\n >\n <button\n class=\"btn btn-icon c8y-dropdown\"\n title=\"{{ 'Settings' | translate }}\"\n aria-haspopup=\"true\"\n *ngIf=\"editMode\"\n data-cy=\"c8y-dashboard-child--settings\"\n (click)=\"(false)\"\n dropdownToggle\n >\n <i [c8yIcon]=\"'cog'\"></i>\n </button>\n <button\n class=\"btn btn-icon\"\n [attr.aria-label]=\"'Click "Edit widgets" to unlock' | translate\"\n tooltip=\"{{ 'Click "Edit widgets" to unlock' | translate }}\"\n container=\"body\"\n *ngIf=\"!editMode\"\n (click)=\"(false)\"\n data-cy=\"c8y-dashboard-child--settings-locked\"\n >\n <i [c8yIcon]=\"'lock'\"></i>\n </button>\n <ul\n class=\"dropdown-menu dropdown-menu-right\"\n style=\"right: -1px\"\n data-cy=\"c8y-dashboard-child--actions-dropdown\"\n *dropdownMenu\n >\n <ng-container *ngFor=\"let action of actions\">\n <ng-container *ngTemplateOutlet=\"action.template\"></ng-container>\n </ng-container>\n </ul>\n </div>\n </div>\n </div>\n <div class=\"card-inner-scroll\">\n <ng-content></ng-content>\n </div>\n <div\n class=\"resize-handle hidden-xs\"\n *ngIf=\"editMode && !isDragging && !fullscreen\"\n cdkDrag\n [cdkDragDisabled]=\"!editMode || fullscreen\"\n (cdkDragStarted)=\"resizeStarted($event)\"\n (cdkDragEnded)=\"reset($event)\"\n ></div>\n <div\n class=\"resize-icon hidden-xs\"\n *ngIf=\"editMode && !isDragging && !fullscreen\"\n ></div>\n\n <div\n class=\"card-placeholder\"\n *cdkDragPlaceholder\n ></div>\n </div>\n</div>\n" }]
|
|
28530
28530
|
}], ctorParameters: () => [{ type: DashboardComponent }, { type: i1$3.DomSanitizer }, { type: i0.ElementRef }], propDecorators: { templateActions: [{
|
|
28531
28531
|
type: ContentChildren,
|
|
28532
28532
|
args: [DashboardChildActionComponent]
|
|
@@ -28650,6 +28650,8 @@ class WidgetsDashboardEventService {
|
|
|
28650
28650
|
*/
|
|
28651
28651
|
this.events$ = new Subject();
|
|
28652
28652
|
this.lastValueByEvent = {};
|
|
28653
|
+
this.autoRefresh$ = new ReplaySubject(1);
|
|
28654
|
+
this.onAutoRefresh$ = this.autoRefresh$.asObservable();
|
|
28653
28655
|
}
|
|
28654
28656
|
/**
|
|
28655
28657
|
* Returns a subscribable event observable of specific event type if eventType is passed, or observable of
|
|
@@ -28676,6 +28678,21 @@ class WidgetsDashboardEventService {
|
|
|
28676
28678
|
this.lastValueByEvent[event.type] = event.data;
|
|
28677
28679
|
this.events$.next(event);
|
|
28678
28680
|
}
|
|
28681
|
+
/**
|
|
28682
|
+
* @ignore
|
|
28683
|
+
*/
|
|
28684
|
+
emitAutoRefresh(value) {
|
|
28685
|
+
this.autoRefresh$.next(value);
|
|
28686
|
+
}
|
|
28687
|
+
// When a dashboard has a multiple tabs, and not all of them has a realtime global context control
|
|
28688
|
+
// we need to set the realtime to false when switching between tabs to make aggregation selector not to be always disabled
|
|
28689
|
+
// while global auto-refresh context control is available.
|
|
28690
|
+
setRealtimeTimeContextSetting(value = false) {
|
|
28691
|
+
this.lastValueByEvent.TIME_CONTEXT = {
|
|
28692
|
+
...this.lastValueByEvent.TIME_CONTEXT,
|
|
28693
|
+
realtime: value
|
|
28694
|
+
};
|
|
28695
|
+
}
|
|
28679
28696
|
/**
|
|
28680
28697
|
* @ignore
|
|
28681
28698
|
*/
|
|
@@ -28689,6 +28706,133 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
28689
28706
|
type: Injectable
|
|
28690
28707
|
}] });
|
|
28691
28708
|
|
|
28709
|
+
class AggregationPickerComponent {
|
|
28710
|
+
constructor() {
|
|
28711
|
+
/**
|
|
28712
|
+
* Configuration for disabling specific types of aggregation.
|
|
28713
|
+
* By default no aggregation type is disabled.
|
|
28714
|
+
*/
|
|
28715
|
+
this.disabledAggregations = {};
|
|
28716
|
+
this.AGGREGATIONS = AGGREGATIONS;
|
|
28717
|
+
this.AGGREGATION_ICONS = AGGREGATION_ICONS;
|
|
28718
|
+
this.AGGREGATION_TEXTS = AGGREGATION_TEXTS;
|
|
28719
|
+
this.touched = false;
|
|
28720
|
+
this.disabled = false;
|
|
28721
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
28722
|
+
this.onChange = _ => { };
|
|
28723
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
28724
|
+
this.onTouched = () => { };
|
|
28725
|
+
}
|
|
28726
|
+
writeValue(value) {
|
|
28727
|
+
this.value = value;
|
|
28728
|
+
}
|
|
28729
|
+
registerOnChange(fn) {
|
|
28730
|
+
this.onChange = fn;
|
|
28731
|
+
}
|
|
28732
|
+
registerOnTouched(onTouched) {
|
|
28733
|
+
this.onTouched = onTouched;
|
|
28734
|
+
}
|
|
28735
|
+
markAsTouched() {
|
|
28736
|
+
if (!this.touched) {
|
|
28737
|
+
this.onTouched();
|
|
28738
|
+
this.touched = true;
|
|
28739
|
+
}
|
|
28740
|
+
}
|
|
28741
|
+
setDisabledState(disabled) {
|
|
28742
|
+
this.disabled = disabled;
|
|
28743
|
+
}
|
|
28744
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AggregationPickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
28745
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: AggregationPickerComponent, isStandalone: true, selector: "c8y-aggregation-picker", inputs: { disabledAggregations: "disabledAggregations" }, providers: [
|
|
28746
|
+
{
|
|
28747
|
+
provide: NG_VALUE_ACCESSOR,
|
|
28748
|
+
useExisting: forwardRef(() => AggregationPickerComponent),
|
|
28749
|
+
multi: true
|
|
28750
|
+
}
|
|
28751
|
+
], ngImport: i0, template: "<div\n class=\"dropdown\"\n style=\"border: 0; margin-left: -1px\"\n #dropdown=\"bs-dropdown\"\n dropdown\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]=\"(value ? AGGREGATION_TEXTS[value] : AGGREGATION_TEXTS.undefined) | translate\"\n tooltip=\"{{\n (value\n ? AGGREGATION_TEXTS[value]\n : disabled\n ? AGGREGATION_TEXTS.disabled\n : AGGREGATION_TEXTS.undefined\n ) | translate\n }}\"\n placement=\"top\"\n container=\"body\"\n type=\"button\"\n [adaptivePosition]=\"false\"\n [delay]=\"500\"\n dropdownToggle\n >\n <i\n class=\"icon-14\"\n [c8yIcon]=\"value ? AGGREGATION_ICONS[value] : AGGREGATION_ICONS.undefined\"\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 *dropdownMenu\n >\n <li\n *ngFor=\"let aggregation of AGGREGATIONS\"\n [ngClass]=\"{\n active: aggregation.id === value,\n disabled: disabledAggregations[aggregation.id]\n }\"\n >\n <button\n class=\"\"\n (click)=\"onChange(aggregation.id); dropdown.isOpen = false\"\n [disabled]=\"disabledAggregations[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 </ul>\n</div>\n", dependencies: [{ kind: "ngmodule", type: BsDropdownModule }, { kind: "directive", type: i1$4.BsDropdownMenuDirective, selector: "[bsDropdownMenu],[dropdownMenu]", exportAs: ["bs-dropdown-menu"] }, { kind: "directive", type: i1$4.BsDropdownToggleDirective, selector: "[bsDropdownToggle],[dropdownToggle]", exportAs: ["bs-dropdown-toggle"] }, { kind: "directive", type: i1$4.BsDropdownDirective, selector: "[bsDropdown], [dropdown]", inputs: ["placement", "triggers", "container", "dropup", "autoClose", "isAnimated", "insideClick", "isDisabled", "isOpen"], outputs: ["isOpenChange", "onShown", "onHidden"], exportAs: ["bs-dropdown"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i2$2.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: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }] }); }
|
|
28752
|
+
}
|
|
28753
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AggregationPickerComponent, decorators: [{
|
|
28754
|
+
type: Component,
|
|
28755
|
+
args: [{ selector: 'c8y-aggregation-picker', providers: [
|
|
28756
|
+
{
|
|
28757
|
+
provide: NG_VALUE_ACCESSOR,
|
|
28758
|
+
useExisting: forwardRef(() => AggregationPickerComponent),
|
|
28759
|
+
multi: true
|
|
28760
|
+
}
|
|
28761
|
+
], standalone: true, imports: [BsDropdownModule, TooltipModule, IconDirective, NgFor, NgClass, C8yTranslatePipe], template: "<div\n class=\"dropdown\"\n style=\"border: 0; margin-left: -1px\"\n #dropdown=\"bs-dropdown\"\n dropdown\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]=\"(value ? AGGREGATION_TEXTS[value] : AGGREGATION_TEXTS.undefined) | translate\"\n tooltip=\"{{\n (value\n ? AGGREGATION_TEXTS[value]\n : disabled\n ? AGGREGATION_TEXTS.disabled\n : AGGREGATION_TEXTS.undefined\n ) | translate\n }}\"\n placement=\"top\"\n container=\"body\"\n type=\"button\"\n [adaptivePosition]=\"false\"\n [delay]=\"500\"\n dropdownToggle\n >\n <i\n class=\"icon-14\"\n [c8yIcon]=\"value ? AGGREGATION_ICONS[value] : AGGREGATION_ICONS.undefined\"\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 *dropdownMenu\n >\n <li\n *ngFor=\"let aggregation of AGGREGATIONS\"\n [ngClass]=\"{\n active: aggregation.id === value,\n disabled: disabledAggregations[aggregation.id]\n }\"\n >\n <button\n class=\"\"\n (click)=\"onChange(aggregation.id); dropdown.isOpen = false\"\n [disabled]=\"disabledAggregations[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 </ul>\n</div>\n" }]
|
|
28762
|
+
}], propDecorators: { disabledAggregations: [{
|
|
28763
|
+
type: Input
|
|
28764
|
+
}] } });
|
|
28765
|
+
|
|
28766
|
+
class RealtimeControlComponent {
|
|
28767
|
+
constructor() {
|
|
28768
|
+
this.disableRealtimeLabel = gettext$1('Disable realtime');
|
|
28769
|
+
this.enableRealtimeLabel = gettext$1('Enable realtime');
|
|
28770
|
+
this.touched = false;
|
|
28771
|
+
this.disabled = false;
|
|
28772
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
28773
|
+
this.onChange = _ => { };
|
|
28774
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
28775
|
+
this.onTouched = () => { };
|
|
28776
|
+
}
|
|
28777
|
+
writeValue(value) {
|
|
28778
|
+
this.value = value;
|
|
28779
|
+
}
|
|
28780
|
+
registerOnChange(fn) {
|
|
28781
|
+
this.onChange = fn;
|
|
28782
|
+
}
|
|
28783
|
+
registerOnTouched(onTouched) {
|
|
28784
|
+
this.onTouched = onTouched;
|
|
28785
|
+
}
|
|
28786
|
+
markAsTouched() {
|
|
28787
|
+
if (!this.touched) {
|
|
28788
|
+
this.onTouched();
|
|
28789
|
+
this.touched = true;
|
|
28790
|
+
}
|
|
28791
|
+
}
|
|
28792
|
+
setDisabledState(disabled) {
|
|
28793
|
+
this.disabled = disabled;
|
|
28794
|
+
}
|
|
28795
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RealtimeControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
28796
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: RealtimeControlComponent, isStandalone: true, selector: "c8y-realtime-control", providers: [
|
|
28797
|
+
{
|
|
28798
|
+
provide: NG_VALUE_ACCESSOR,
|
|
28799
|
+
useExisting: forwardRef(() => RealtimeControlComponent),
|
|
28800
|
+
multi: true
|
|
28801
|
+
}
|
|
28802
|
+
], ngImport: i0, template: " <button\n class=\"btn btn-icon c8y-realtime\"\n [attr.aria-label]=\"(value ? disableRealtimeLabel : enableRealtimeLabel) | translate\"\n tooltip=\"{{ (value ? disableRealtimeLabel : enableRealtimeLabel) | translate }}\"\n placement=\"top\"\n container=\"body\"\n type=\"button\"\n (click)=\"onChange(!value)\"\n [adaptivePosition]=\"false\"\n [delay]=\"500\"\n [disabled]=\"disabled\"\n>\n <span\n class=\"c8y-pulse m-0\"\n [ngClass]=\"{ active: value, inactive: !value }\"\n ></span>\n</button>\n", dependencies: [{ kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i2$2.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: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }] }); }
|
|
28803
|
+
}
|
|
28804
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RealtimeControlComponent, decorators: [{
|
|
28805
|
+
type: Component,
|
|
28806
|
+
args: [{ selector: 'c8y-realtime-control', providers: [
|
|
28807
|
+
{
|
|
28808
|
+
provide: NG_VALUE_ACCESSOR,
|
|
28809
|
+
useExisting: forwardRef(() => RealtimeControlComponent),
|
|
28810
|
+
multi: true
|
|
28811
|
+
}
|
|
28812
|
+
], standalone: true, imports: [TooltipModule, NgClass, C8yTranslatePipe], template: " <button\n class=\"btn btn-icon c8y-realtime\"\n [attr.aria-label]=\"(value ? disableRealtimeLabel : enableRealtimeLabel) | translate\"\n tooltip=\"{{ (value ? disableRealtimeLabel : enableRealtimeLabel) | translate }}\"\n placement=\"top\"\n container=\"body\"\n type=\"button\"\n (click)=\"onChange(!value)\"\n [adaptivePosition]=\"false\"\n [delay]=\"500\"\n [disabled]=\"disabled\"\n>\n <span\n class=\"c8y-pulse m-0\"\n [ngClass]=\"{ active: value, inactive: !value }\"\n ></span>\n</button>\n" }]
|
|
28813
|
+
}] });
|
|
28814
|
+
|
|
28815
|
+
class WidgetTimeContextDateRangeService {
|
|
28816
|
+
constructor() {
|
|
28817
|
+
this.timeContextChange = signal(null);
|
|
28818
|
+
this.initialTimeRange = signal(null);
|
|
28819
|
+
}
|
|
28820
|
+
emitPropertyUpdate(data) {
|
|
28821
|
+
this.timeContextChange.set(data);
|
|
28822
|
+
}
|
|
28823
|
+
updateInitialTimeRange(data) {
|
|
28824
|
+
this.initialTimeRange.set(data);
|
|
28825
|
+
}
|
|
28826
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WidgetTimeContextDateRangeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
28827
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WidgetTimeContextDateRangeService, providedIn: 'root' }); }
|
|
28828
|
+
}
|
|
28829
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WidgetTimeContextDateRangeService, decorators: [{
|
|
28830
|
+
type: Injectable,
|
|
28831
|
+
args: [{
|
|
28832
|
+
providedIn: 'root'
|
|
28833
|
+
}]
|
|
28834
|
+
}] });
|
|
28835
|
+
|
|
28692
28836
|
var DateContextQueryParamNames;
|
|
28693
28837
|
(function (DateContextQueryParamNames) {
|
|
28694
28838
|
DateContextQueryParamNames["DATE_CONTEXT_FROM"] = "dateContextFrom";
|
|
@@ -28949,133 +29093,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
28949
29093
|
args: [{ providedIn: 'root' }]
|
|
28950
29094
|
}], ctorParameters: () => [{ type: i1$5.ActivatedRoute }, { type: WidgetTimeContextHelperService }, { type: i1$5.Router }] });
|
|
28951
29095
|
|
|
28952
|
-
class WidgetTimeContextDateRangeService {
|
|
28953
|
-
constructor() {
|
|
28954
|
-
this.timeContextChange = signal(null);
|
|
28955
|
-
this.initialTimeRange = signal(null);
|
|
28956
|
-
}
|
|
28957
|
-
emitPropertyUpdate(data) {
|
|
28958
|
-
this.timeContextChange.set(data);
|
|
28959
|
-
}
|
|
28960
|
-
updateInitialTimeRange(data) {
|
|
28961
|
-
this.initialTimeRange.set(data);
|
|
28962
|
-
}
|
|
28963
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WidgetTimeContextDateRangeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
28964
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WidgetTimeContextDateRangeService, providedIn: 'root' }); }
|
|
28965
|
-
}
|
|
28966
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WidgetTimeContextDateRangeService, decorators: [{
|
|
28967
|
-
type: Injectable,
|
|
28968
|
-
args: [{
|
|
28969
|
-
providedIn: 'root'
|
|
28970
|
-
}]
|
|
28971
|
-
}] });
|
|
28972
|
-
|
|
28973
|
-
class RealtimeControlComponent {
|
|
28974
|
-
constructor() {
|
|
28975
|
-
this.disableRealtimeLabel = gettext$1('Disable realtime');
|
|
28976
|
-
this.enableRealtimeLabel = gettext$1('Enable realtime');
|
|
28977
|
-
this.touched = false;
|
|
28978
|
-
this.disabled = false;
|
|
28979
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
28980
|
-
this.onChange = _ => { };
|
|
28981
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
28982
|
-
this.onTouched = () => { };
|
|
28983
|
-
}
|
|
28984
|
-
writeValue(value) {
|
|
28985
|
-
this.value = value;
|
|
28986
|
-
}
|
|
28987
|
-
registerOnChange(fn) {
|
|
28988
|
-
this.onChange = fn;
|
|
28989
|
-
}
|
|
28990
|
-
registerOnTouched(onTouched) {
|
|
28991
|
-
this.onTouched = onTouched;
|
|
28992
|
-
}
|
|
28993
|
-
markAsTouched() {
|
|
28994
|
-
if (!this.touched) {
|
|
28995
|
-
this.onTouched();
|
|
28996
|
-
this.touched = true;
|
|
28997
|
-
}
|
|
28998
|
-
}
|
|
28999
|
-
setDisabledState(disabled) {
|
|
29000
|
-
this.disabled = disabled;
|
|
29001
|
-
}
|
|
29002
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RealtimeControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
29003
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: RealtimeControlComponent, isStandalone: true, selector: "c8y-realtime-control", providers: [
|
|
29004
|
-
{
|
|
29005
|
-
provide: NG_VALUE_ACCESSOR,
|
|
29006
|
-
useExisting: forwardRef(() => RealtimeControlComponent),
|
|
29007
|
-
multi: true
|
|
29008
|
-
}
|
|
29009
|
-
], ngImport: i0, template: " <button\n class=\"btn btn-icon c8y-realtime\"\n [attr.aria-label]=\"(value ? disableRealtimeLabel : enableRealtimeLabel) | translate\"\n tooltip=\"{{ (value ? disableRealtimeLabel : enableRealtimeLabel) | translate }}\"\n placement=\"top\"\n container=\"body\"\n type=\"button\"\n (click)=\"onChange(!value)\"\n [adaptivePosition]=\"false\"\n [delay]=\"500\"\n [disabled]=\"disabled\"\n>\n <span\n class=\"c8y-pulse m-0\"\n [ngClass]=\"{ active: value, inactive: !value }\"\n ></span>\n</button>\n", dependencies: [{ kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i2$2.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: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }] }); }
|
|
29010
|
-
}
|
|
29011
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RealtimeControlComponent, decorators: [{
|
|
29012
|
-
type: Component,
|
|
29013
|
-
args: [{ selector: 'c8y-realtime-control', providers: [
|
|
29014
|
-
{
|
|
29015
|
-
provide: NG_VALUE_ACCESSOR,
|
|
29016
|
-
useExisting: forwardRef(() => RealtimeControlComponent),
|
|
29017
|
-
multi: true
|
|
29018
|
-
}
|
|
29019
|
-
], standalone: true, imports: [TooltipModule, NgClass, C8yTranslatePipe], template: " <button\n class=\"btn btn-icon c8y-realtime\"\n [attr.aria-label]=\"(value ? disableRealtimeLabel : enableRealtimeLabel) | translate\"\n tooltip=\"{{ (value ? disableRealtimeLabel : enableRealtimeLabel) | translate }}\"\n placement=\"top\"\n container=\"body\"\n type=\"button\"\n (click)=\"onChange(!value)\"\n [adaptivePosition]=\"false\"\n [delay]=\"500\"\n [disabled]=\"disabled\"\n>\n <span\n class=\"c8y-pulse m-0\"\n [ngClass]=\"{ active: value, inactive: !value }\"\n ></span>\n</button>\n" }]
|
|
29020
|
-
}] });
|
|
29021
|
-
|
|
29022
|
-
class AggregationPickerComponent {
|
|
29023
|
-
constructor() {
|
|
29024
|
-
/**
|
|
29025
|
-
* Configuration for disabling specific types of aggregation.
|
|
29026
|
-
* By default no aggregation type is disabled.
|
|
29027
|
-
*/
|
|
29028
|
-
this.disabledAggregations = {};
|
|
29029
|
-
this.AGGREGATIONS = AGGREGATIONS;
|
|
29030
|
-
this.AGGREGATION_ICONS = AGGREGATION_ICONS;
|
|
29031
|
-
this.AGGREGATION_TEXTS = AGGREGATION_TEXTS;
|
|
29032
|
-
this.touched = false;
|
|
29033
|
-
this.disabled = false;
|
|
29034
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
29035
|
-
this.onChange = _ => { };
|
|
29036
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
29037
|
-
this.onTouched = () => { };
|
|
29038
|
-
}
|
|
29039
|
-
writeValue(value) {
|
|
29040
|
-
this.value = value;
|
|
29041
|
-
}
|
|
29042
|
-
registerOnChange(fn) {
|
|
29043
|
-
this.onChange = fn;
|
|
29044
|
-
}
|
|
29045
|
-
registerOnTouched(onTouched) {
|
|
29046
|
-
this.onTouched = onTouched;
|
|
29047
|
-
}
|
|
29048
|
-
markAsTouched() {
|
|
29049
|
-
if (!this.touched) {
|
|
29050
|
-
this.onTouched();
|
|
29051
|
-
this.touched = true;
|
|
29052
|
-
}
|
|
29053
|
-
}
|
|
29054
|
-
setDisabledState(disabled) {
|
|
29055
|
-
this.disabled = disabled;
|
|
29056
|
-
}
|
|
29057
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AggregationPickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
29058
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: AggregationPickerComponent, isStandalone: true, selector: "c8y-aggregation-picker", inputs: { disabledAggregations: "disabledAggregations" }, providers: [
|
|
29059
|
-
{
|
|
29060
|
-
provide: NG_VALUE_ACCESSOR,
|
|
29061
|
-
useExisting: forwardRef(() => AggregationPickerComponent),
|
|
29062
|
-
multi: true
|
|
29063
|
-
}
|
|
29064
|
-
], ngImport: i0, template: "<div\n class=\"dropdown\"\n style=\"border: 0; margin-left: -1px\"\n #dropdown=\"bs-dropdown\"\n dropdown\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]=\"(value ? AGGREGATION_TEXTS[value] : AGGREGATION_TEXTS.undefined) | translate\"\n tooltip=\"{{\n (value\n ? AGGREGATION_TEXTS[value]\n : disabled\n ? AGGREGATION_TEXTS.disabled\n : AGGREGATION_TEXTS.undefined\n ) | translate\n }}\"\n placement=\"top\"\n container=\"body\"\n type=\"button\"\n [adaptivePosition]=\"false\"\n [delay]=\"500\"\n dropdownToggle\n >\n <i\n class=\"icon-14\"\n [c8yIcon]=\"value ? AGGREGATION_ICONS[value] : AGGREGATION_ICONS.undefined\"\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 *dropdownMenu\n >\n <li\n *ngFor=\"let aggregation of AGGREGATIONS\"\n [ngClass]=\"{\n active: aggregation.id === value,\n disabled: disabledAggregations[aggregation.id]\n }\"\n >\n <button\n class=\"\"\n (click)=\"onChange(aggregation.id); dropdown.isOpen = false\"\n [disabled]=\"disabledAggregations[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 </ul>\n</div>\n", dependencies: [{ kind: "ngmodule", type: BsDropdownModule }, { kind: "directive", type: i1$4.BsDropdownMenuDirective, selector: "[bsDropdownMenu],[dropdownMenu]", exportAs: ["bs-dropdown-menu"] }, { kind: "directive", type: i1$4.BsDropdownToggleDirective, selector: "[bsDropdownToggle],[dropdownToggle]", exportAs: ["bs-dropdown-toggle"] }, { kind: "directive", type: i1$4.BsDropdownDirective, selector: "[bsDropdown], [dropdown]", inputs: ["placement", "triggers", "container", "dropup", "autoClose", "isAnimated", "insideClick", "isDisabled", "isOpen"], outputs: ["isOpenChange", "onShown", "onHidden"], exportAs: ["bs-dropdown"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i2$2.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: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }] }); }
|
|
29065
|
-
}
|
|
29066
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AggregationPickerComponent, decorators: [{
|
|
29067
|
-
type: Component,
|
|
29068
|
-
args: [{ selector: 'c8y-aggregation-picker', providers: [
|
|
29069
|
-
{
|
|
29070
|
-
provide: NG_VALUE_ACCESSOR,
|
|
29071
|
-
useExisting: forwardRef(() => AggregationPickerComponent),
|
|
29072
|
-
multi: true
|
|
29073
|
-
}
|
|
29074
|
-
], standalone: true, imports: [BsDropdownModule, TooltipModule, IconDirective, NgFor, NgClass, C8yTranslatePipe], template: "<div\n class=\"dropdown\"\n style=\"border: 0; margin-left: -1px\"\n #dropdown=\"bs-dropdown\"\n dropdown\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]=\"(value ? AGGREGATION_TEXTS[value] : AGGREGATION_TEXTS.undefined) | translate\"\n tooltip=\"{{\n (value\n ? AGGREGATION_TEXTS[value]\n : disabled\n ? AGGREGATION_TEXTS.disabled\n : AGGREGATION_TEXTS.undefined\n ) | translate\n }}\"\n placement=\"top\"\n container=\"body\"\n type=\"button\"\n [adaptivePosition]=\"false\"\n [delay]=\"500\"\n dropdownToggle\n >\n <i\n class=\"icon-14\"\n [c8yIcon]=\"value ? AGGREGATION_ICONS[value] : AGGREGATION_ICONS.undefined\"\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 *dropdownMenu\n >\n <li\n *ngFor=\"let aggregation of AGGREGATIONS\"\n [ngClass]=\"{\n active: aggregation.id === value,\n disabled: disabledAggregations[aggregation.id]\n }\"\n >\n <button\n class=\"\"\n (click)=\"onChange(aggregation.id); dropdown.isOpen = false\"\n [disabled]=\"disabledAggregations[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 </ul>\n</div>\n" }]
|
|
29075
|
-
}], propDecorators: { disabledAggregations: [{
|
|
29076
|
-
type: Input
|
|
29077
|
-
}] } });
|
|
29078
|
-
|
|
29079
29096
|
class WidgetTimeContextComponent {
|
|
29080
29097
|
/**
|
|
29081
29098
|
* @ignore only DI.
|
|
@@ -29151,6 +29168,16 @@ class WidgetTimeContextComponent {
|
|
|
29151
29168
|
this.subscribeToIntervalChange();
|
|
29152
29169
|
this.subscribeToRealtimeChange();
|
|
29153
29170
|
this.subscribeToAggregationChange();
|
|
29171
|
+
this.widgetEventService.onAutoRefresh$
|
|
29172
|
+
.pipe(takeUntil(this.destroy$), tap(autoRefresh => (this.isAutoRefreshEnabled = autoRefresh)))
|
|
29173
|
+
.subscribe(autoRefresh => {
|
|
29174
|
+
// Fix for:
|
|
29175
|
+
// 1. Make a group with dashboard having a widget with with auto-refresh time context enabled.
|
|
29176
|
+
// 2. When you route to e.g. home page and back to the group dashboard, none of a groups will be routable again.
|
|
29177
|
+
queueMicrotask(() => {
|
|
29178
|
+
autoRefresh ? this.onDisableAutoRefresh() : this.enableDateRangeAndAggregation();
|
|
29179
|
+
});
|
|
29180
|
+
});
|
|
29154
29181
|
if (initialContext.realtime) {
|
|
29155
29182
|
this.onRealtimeValueChange(initialContext.realtime);
|
|
29156
29183
|
this.startRealtime();
|
|
@@ -29214,6 +29241,8 @@ class WidgetTimeContextComponent {
|
|
|
29214
29241
|
ngOnDestroy() {
|
|
29215
29242
|
this.unsubscribeFromGlobalContext();
|
|
29216
29243
|
this.clearQueryParamsIfNeeded();
|
|
29244
|
+
this.widgetEventService.setRealtimeTimeContextSetting();
|
|
29245
|
+
this.widgetEventService.emitAutoRefresh(false);
|
|
29217
29246
|
this.destroy$.next();
|
|
29218
29247
|
this.destroy$.complete();
|
|
29219
29248
|
}
|
|
@@ -29428,9 +29457,7 @@ class WidgetTimeContextComponent {
|
|
|
29428
29457
|
};
|
|
29429
29458
|
}
|
|
29430
29459
|
startRealtime() {
|
|
29431
|
-
this.
|
|
29432
|
-
this.form.controls.temporaryUserSelectedToDate.disable();
|
|
29433
|
-
this.form.controls.aggregation.disable();
|
|
29460
|
+
this.disableDateRangeAndAggregation();
|
|
29434
29461
|
this.realtimeSubscription = interval(this.REALTIME_INTERVAL)
|
|
29435
29462
|
.pipe(takeUntil(this.destroy$))
|
|
29436
29463
|
.subscribe(() => {
|
|
@@ -29444,11 +29471,26 @@ class WidgetTimeContextComponent {
|
|
|
29444
29471
|
});
|
|
29445
29472
|
});
|
|
29446
29473
|
}
|
|
29474
|
+
onDisableAutoRefresh() {
|
|
29475
|
+
this.form.controls.aggregation.setValue(null);
|
|
29476
|
+
this.disableDateRangeAndAggregation();
|
|
29477
|
+
}
|
|
29478
|
+
disableDateRangeAndAggregation() {
|
|
29479
|
+
this.form.controls.temporaryUserSelectedFromDate.disable();
|
|
29480
|
+
this.form.controls.temporaryUserSelectedToDate.disable();
|
|
29481
|
+
this.form.controls.aggregation.disable();
|
|
29482
|
+
}
|
|
29483
|
+
enableDateRangeAndAggregation() {
|
|
29484
|
+
if (this.form.controls.realtime.value || this.isAutoRefreshEnabled) {
|
|
29485
|
+
return;
|
|
29486
|
+
}
|
|
29487
|
+
this.form.controls.temporaryUserSelectedFromDate.enable();
|
|
29488
|
+
this.form.controls.temporaryUserSelectedToDate.enable();
|
|
29489
|
+
this.form.controls.aggregation.enable();
|
|
29490
|
+
}
|
|
29447
29491
|
stopRealtime() {
|
|
29448
29492
|
this.realtimeSubscription?.unsubscribe();
|
|
29449
|
-
this.
|
|
29450
|
-
this.form?.controls.temporaryUserSelectedToDate.enable();
|
|
29451
|
-
this.form?.controls.aggregation.enable();
|
|
29493
|
+
this.enableDateRangeAndAggregation();
|
|
29452
29494
|
}
|
|
29453
29495
|
onRealtimeValueChange(realtime) {
|
|
29454
29496
|
let dateTimeContext;
|
|
@@ -29908,13 +29950,11 @@ class AutoRefreshControlComponent {
|
|
|
29908
29950
|
this.DEFAULT_INTERVAL_VALUE = DEFAULT_INTERVAL_VALUE;
|
|
29909
29951
|
this.loading = new EventEmitter();
|
|
29910
29952
|
this.widgetGlobalAutoRefresh = inject(WidgetGlobalAutoRefreshService);
|
|
29953
|
+
this.showIntervalRefresh$ = new BehaviorSubject(this.widgetGlobalAutoRefresh.autoRefreshSettings.isEnabled$.getValue());
|
|
29911
29954
|
this.destroy$ = new Subject();
|
|
29912
29955
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
29913
29956
|
this.onTouched = () => { };
|
|
29914
29957
|
}
|
|
29915
|
-
ngOnInit() {
|
|
29916
|
-
this.showIntervalRefresh$ = this.widgetGlobalAutoRefresh.autoRefreshSettings.isEnabled$;
|
|
29917
|
-
}
|
|
29918
29958
|
ngAfterViewInit() {
|
|
29919
29959
|
this.subscribeOnCountdownChangeState();
|
|
29920
29960
|
this.setUpOnCountdownEndedListener();
|
|
@@ -30037,6 +30077,7 @@ class WidgetAutoRefreshContextComponent {
|
|
|
30037
30077
|
this.destroy$ = new Subject();
|
|
30038
30078
|
this.fb = inject(FormBuilder);
|
|
30039
30079
|
this.widgetGlobalAutoRefresh = inject(WidgetGlobalAutoRefreshService);
|
|
30080
|
+
this.widgetEventService = inject(WidgetsDashboardEventService);
|
|
30040
30081
|
}
|
|
30041
30082
|
ngOnInit() {
|
|
30042
30083
|
this.widgetGlobalAutoRefresh.globalRefreshWidgetsCount.update(count => count + 1);
|
|
@@ -30044,6 +30085,11 @@ class WidgetAutoRefreshContextComponent {
|
|
|
30044
30085
|
this.subscribeOnAutoRefreshSecondsChange();
|
|
30045
30086
|
this.subscribeOnAutoRefreshChange();
|
|
30046
30087
|
this.subscribeOnRouterEvents();
|
|
30088
|
+
this.form.controls.autoRefresh.valueChanges
|
|
30089
|
+
.pipe(takeUntil(this.destroy$))
|
|
30090
|
+
.subscribe(autorefresh => {
|
|
30091
|
+
this.widgetEventService.emitAutoRefresh(autorefresh);
|
|
30092
|
+
});
|
|
30047
30093
|
}
|
|
30048
30094
|
ngAfterViewInit() {
|
|
30049
30095
|
this.initializeWidgetSubscriptions();
|
|
@@ -30057,6 +30103,7 @@ class WidgetAutoRefreshContextComponent {
|
|
|
30057
30103
|
.pipe(takeUntil(this.destroy$))
|
|
30058
30104
|
.subscribe();
|
|
30059
30105
|
this.listenOnDashboardSaveOperation();
|
|
30106
|
+
this.widgetEventService.emitAutoRefresh(this.form.controls.autoRefresh.value);
|
|
30060
30107
|
}
|
|
30061
30108
|
ngOnDestroy() {
|
|
30062
30109
|
this.onContextDestroy();
|
|
@@ -30364,7 +30411,7 @@ class WidgetsDashboardComponent {
|
|
|
30364
30411
|
return widgets;
|
|
30365
30412
|
}
|
|
30366
30413
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WidgetsDashboardComponent, deps: [{ token: DynamicComponentService }, { token: i1$1.TranslateService }, { token: i1$5.ActivatedRoute }, { token: ModalService }, { token: WidgetGlobalAutoRefreshService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
30367
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: WidgetsDashboardComponent, selector: "c8y-widgets-dashboard", inputs: { widgets: "widgets", context: "context", contextDashboard: "contextDashboard", _settings: ["settings", "_settings"], isCopyDisabled: "isCopyDisabled", breadcrumb: "breadcrumb", editModeButtons: "editModeButtons" }, outputs: { onAddWidget: "onAddWidget", onEditWidget: "onEditWidget", onDeleteWidget: "onDeleteWidget", onChangeDashboard: "onChangeDashboard", onResize: "onResize", onEditDashboard: "onEditDashboard", onCopyDashboard: "onCopyDashboard", onDeleteDashboard: "onDeleteDashboard", onChangeStart: "onChangeStart", onChangeEnd: "onChangeEnd", onSaveDashboard: "onSaveDashboard", onCancelDashboard: "onCancelDashboard", revertChange: "revertChange" }, host: { styleAttribute: "\n display: block;\n ", classAttribute: "dashboard c8y-grid-dashboard" }, providers: [WidgetsDashboardEventService], usesOnChanges: true, ngImport: i0, template: "<c8y-title *ngIf=\"!!settings.title\">\n {{ settings.title | translate }}\n</c8y-title>\n\n<c8y-breadcrumb *ngIf=\"!!breadcrumb\">\n <c8y-breadcrumb-item\n [icon]=\"breadcrumb.icon\"\n [label]=\"breadcrumb.label\"\n [path]=\"breadcrumb.path\"\n ></c8y-breadcrumb-item>\n</c8y-breadcrumb>\n\n<c8y-action-bar-item\n [placement]=\"'left'\"\n [priority]=\"ACTION_BAR_EDIT_WIDGETS_PRIORITY\"\n *ngIf=\"!(editMode$ | async)\"\n>\n <button\n class=\"btn btn-link animated fadeIn hidden-xs\"\n title=\"{{ 'Edit widgets' | translate }}\"\n type=\"button\"\n [disabled]=\"settings.isDisabled\"\n (click)=\"enableEditMode()\"\n data-cy=\"c8y-widget-dashboard--edit-widgets\"\n >\n <i c8yIcon=\"send-backward\"></i>\n <span class=\"m-l-4\">{{ 'Edit widgets' | translate }}</span>\n </button>\n <button\n class=\"btn btn-link visible-xs m-l-0\"\n tooltip=\"{{ 'Not available on mobile phone' | translate }}\"\n type=\"button\"\n [disabled]=\"true\"\n >\n <i c8yIcon=\"send-backward\"></i>\n <span class=\"m-l-4\">{{ 'Edit widgets' | translate }}</span>\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]=\"'left'\"\n *ngIf=\"editMode$ | async\"\n>\n <button\n class=\"btn btn-link animated fadeIn\"\n title=\"{{ 'Add widget' | translate }}\"\n type=\"button\"\n (click)=\"onAddWidget.emit()\"\n data-cy=\"widget-dashboard--Add-widget\"\n >\n <i c8yIcon=\"plus-circle\"></i>\n {{ 'Add widget' | translate }}\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]=\"'left'\"\n itemClass=\"d-flex a-i-center gap-8\"\n *ngIf=\"editMode$ | async\"\n>\n <div class=\"input-group input-group-sm animated fadeIn\">\n <div class=\"input-group-btn\">\n <button\n class=\"btn btn-default btn-sm btn-icon\"\n [attr.aria-label]=\"'Undo' | translate\"\n [tooltip]=\"\n editModeButtons.undoButtonDisabled\n ? ''\n : (undoMessage\n | translate: { changeToUndo: editModeButtons.changeToUndoName | translate })\n \"\n container=\"body\"\n (click)=\"revertChange.emit('undo')\"\n [disabled]=\"editModeButtons.undoButtonDisabled\"\n >\n <i [c8yIcon]=\"'undo'\"></i>\n </button>\n </div>\n <div class=\"input-group-btn\">\n <button\n class=\"btn btn-default btn-sm btn-icon\"\n [attr.aria-label]=\"'Redo' | translate\"\n [tooltip]=\"\n editModeButtons.redoButtonDisabled\n ? ''\n : (redoMessage\n | translate: { changeToRedo: editModeButtons.changeToRedoName | translate })\n \"\n container=\"body\"\n (click)=\"revertChange.emit('redo')\"\n [disabled]=\"editModeButtons.redoButtonDisabled\"\n >\n <i [c8yIcon]=\"'redo'\"></i>\n </button>\n </div>\n <span></span>\n </div>\n <div class=\"btn-group animated fadeIn\">\n <button\n class=\"btn btn-default btn-sm\"\n title=\"{{ 'Cancel' | translate }}\"\n type=\"button\"\n (click)=\"cancelDashboardSave()\"\n >\n {{ 'Cancel' | translate }}\n </button>\n <button\n class=\"btn btn-primary btn-sm m-l-8\"\n title=\"{{ 'Save' | translate }}\"\n type=\"button\"\n [disabled]=\"editModeButtons.undoButtonDisabled\"\n (click)=\"saveDashboard()\"\n data-cy=\"c8y-widgets-dashboard--save\"\n >\n {{ 'Save' | translate }}\n </button>\n </div>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]=\"'right'\"\n *ngIf=\"onEditDashboard.observers.length\"\n>\n <button\n class=\"btn btn-link hidden-xs m-l-0\"\n title=\"{{ 'Dashboard settings' | translate }}\"\n type=\"button\"\n [disabled]=\"settings.isDisabled || (editMode$ | async)\"\n (click)=\"onEditDashboard.emit()\"\n data-cy=\"c8y-widgets-dashboard--edit-dashboard\"\n >\n <i c8yIcon=\"sorting-slider\"></i>\n <span class=\"visible-xs-inline hidden-sm visible-md-inline visible-lg-inline\">\n {{ 'Dashboard settings' | translate }}\n </span>\n </button>\n <button\n class=\"btn btn-link visible-xs m-l-0\"\n tooltip=\"{{ 'Not available on mobile phone' | translate }}\"\n type=\"button\"\n [disabled]=\"true\"\n >\n <i c8yIcon=\"sorting-slider\"></i>\n <span class=\"visible-xs-inline hidden-sm visible-md-inline visible-lg-inline\">\n {{ 'Dashboard settings' | translate }}\n </span>\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]=\"'right'\"\n *ngIf=\"settings.allowFullscreen\"\n [priority]=\"-5000\"\n itemClass=\"pull-right\"\n>\n <button\n class=\"btn btn-link\"\n [attr.aria-label]=\"'Full screen' | translate\"\n tooltip=\"{{ 'Full screen' | translate }}\"\n placement=\"left\"\n container=\"body\"\n type=\"button\"\n [delay]=\"500\"\n (click)=\"toggleFullscreen()\"\n data-cy=\"widgets-dashboard--Full-screen\"\n >\n <i [c8yIcon]=\"(inFullScreen$ | async) ? 'compress' : 'expand'\"></i>\n <span class=\"visible-xs-inline hidden-sm visible-md-inline visibile-lg-inline\">\n {{ 'Full screen' | translate }}\n </span>\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]=\"'more'\"\n [priority]=\"-2000\"\n *ngIf=\"settings.canCopy\"\n>\n <div\n [ngStyle]=\"{\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center'\n }\"\n >\n <button\n class=\"hidden-xs\"\n title=\"{{\n (isCopyDisabled === true || !isCopyDisabled?.state ? 'Disabled' : copyDashboardLabel) | translate\n }}\"\n type=\"button\"\n [ngClass]=\"{ 'btn btn-link': !settings.canDelete }\"\n data-cy=\"widgets-dashboard--copy-dashboard\"\n (click)=\"onCopyDashboard.emit()\"\n [disabled]=\"isCopyDisabled === true || !isCopyDisabled?.state || (editMode$ | async)\"\n >\n <i c8yIcon=\"clone\"></i>\n <span>{{ copyDashboardLabel | translate }}</span>\n </button>\n <button\n class=\"btn-help btn-help--sm m-r-16 hidden-xs\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"copyDisabledPopoverMsg | translate\"\n placement=\"right\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n *ngIf=\"!isCopyDisabled?.state && copyDisabledPopoverMsg\"\n data-cy=\"widgets-dashboard--info-copy-dashboard\"\n (click)=\"$event.stopPropagation()\"\n ></button>\n </div>\n <button\n class=\"visible-xs m-l-0\"\n tooltip=\"{{ 'Not available on mobile phone' | translate }}\"\n type=\"button\"\n [ngClass]=\"{ 'btn btn-link': !settings.canDelete }\"\n [disabled]=\"true\"\n >\n <i c8yIcon=\"clone\"></i>\n <span>{{ copyDashboardLabel | translate }}</span>\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]=\"'more'\"\n [priority]=\"-3000\"\n *ngIf=\"settings.canDelete && onDeleteDashboard.observers.length\"\n>\n <button\n class=\"hidden-xs\"\n title=\"{{ 'Delete dashboard' | translate }}\"\n type=\"button\"\n data-cy=\"widgets-dashboard--delete-dashboard\"\n [ngClass]=\"{ 'btn btn-link': !settings.canCopy }\"\n (click)=\"onDeleteDashboard.emit()\"\n [disabled]=\"settings.isDisabled || (editMode$ | async)\"\n >\n <i c8yIcon=\"delete\"></i>\n <span translate>Delete dashboard</span>\n </button>\n <button\n class=\"visible-xs m-l-0\"\n tooltip=\"{{ 'Not available on mobile phone' | translate }}\"\n type=\"button\"\n data-cy=\"widgets-dashboard--delete-dashboard-mobile\"\n [ngClass]=\"{ 'btn btn-link': !settings.canCopy }\"\n [disabled]=\"true\"\n >\n <i c8yIcon=\"delete\"></i>\n <span translate>Delete dashboard</span>\n </button>\n</c8y-action-bar-item>\n\n<ng-template #loadingIndicator>\n <c8y-loading\n class=\"col-xs-12 text-center\"\n *ngIf=\"isLoadingWidgets$ | async\"\n ></c8y-loading>\n</ng-template>\n\n<ng-container *ngIf=\"!(isLoadingWidgets$ | async); else loadingIndicator\">\n <ng-container *ngIf=\"resolvedWidgets$ | async as widgetsToDisplay\">\n <!-- empty state -->\n <c8y-ui-empty-state\n [icon]=\"'c8y-device'\"\n [title]=\"'No widgets to display.' | translate\"\n *ngIf=\"widgetsToDisplay?.length === 0\"\n >\n <div *ngIf=\"onAddWidget.observers.length\">\n <p\n translate\n *ngIf=\"editMode$ | async\"\n >\n Add widgets to this dashboard.\n </p>\n <p\n translate\n *ngIf=\"!(editMode$ | async)\"\n >\n Click \"Edit widgets\" to unlock\n </p>\n <div>\n <button\n class=\"btn btn-primary m-t-16\"\n title=\"{{ 'Add widget' | translate }}\"\n type=\"button\"\n [disabled]=\"settings.isDisabled || !(editMode$ | async)\"\n (click)=\"onAddWidget.emit()\"\n data-cy=\"c8y-widgets-dashboard--add-widget\"\n translate\n >\n Add widget\n </button>\n </div>\n <p c8y-guide-docs>\n <small\n translate\n ngNonBindable\n >\n Find out more in the\n <a c8y-guide-href=\"/docs/cockpit/working-with-dashboards\">user documentation</a>\n .\n </small>\n </p>\n </div>\n </c8y-ui-empty-state>\n\n <c8y-dashboard\n [columns]=\"settings.columns\"\n (dashboardChange)=\"onChangeDashboard.emit($event)\"\n #dashboard\n >\n <c8y-dashboard-child\n [class]=\"widget.classes\"\n *ngFor=\"let widget of widgetsToDisplay\"\n [x]=\"widget._x\"\n [y]=\"widget._y\"\n [width]=\"widget._width || settings.defaultWidth\"\n [height]=\"widget._height || settings.defaultHeight\"\n [margin]=\"settings.widgetMargin\"\n [data]=\"widget\"\n [useIntersection]=\"true\"\n [editMode]=\"editMode$ | async\"\n (changeStart)=\"onChangeStart.emit({ widget: widget, source: child, dashboard: dashboard })\"\n (changeEnd)=\"onChangeEnd.emit({ widget: widget, source: child, dashboard: dashboard })\"\n (toggleFullscreen)=\"toggleFullscreenOnWidget(child)\"\n [canToggleFullscreen]=\"!(inFullScreen$ | async) || widgetInFullscreenMode\"\n #child\n >\n <c8y-dashboard-child-title>\n <span\n data-cy=\"c8y-dashboard-list--device-widget\"\n *ngIf=\"settings.translateWidgetTitle\"\n >\n {{ widget.title | translate }}\n </span>\n <span *ngIf=\"!settings.translateWidgetTitle\">\n {{ widget.title }}\n </span>\n </c8y-dashboard-child-title>\n <c8y-dashboard-child-action *ngIf=\"onEditWidget.observers.length\">\n <button\n title=\"{{ 'Edit widget' | translate }}\"\n type=\"button\"\n data-cy=\"widgets-dashboard--Edit-widget\"\n (click)=\"onEditWidget.emit({ widget: widget, source: child, dashboard: dashboard })\"\n >\n <i c8yIcon=\"pencil\"></i>\n <span translate>Edit</span>\n </button>\n </c8y-dashboard-child-action>\n <c8y-dashboard-child-action *ngIf=\"onDeleteWidget.observers.length\">\n <button\n title=\"{{ 'Remove widget' | translate }}\"\n type=\"button\"\n data-cy=\"c8y-widgets-dashboard--remove-widget\"\n (click)=\"onDeleteWidget.emit({ widget: widget, source: child, dashboard: dashboard })\"\n >\n <i c8yIcon=\"delete\"></i>\n <span translate>Remove</span>\n </button>\n </c8y-dashboard-child-action>\n\n <c8y-widget-time-context\n *ngIf=\"\n (widget.config?.displaySettings?.globalTimeContext ||\n widget.config?.displaySettings?.globalRealtimeContext) &&\n widget.config.widgetInstanceGlobalTimeContext\n \"\n (dateContextChange)=\"updateWidgetConfig($event, widget)\"\n [canDecouple]=\"widget.config.canDecoupleGlobalTimeContext\"\n [displaySettings]=\"widget.config.displaySettings\"\n [hidden]=\"(editMode$ | async)\"\n ></c8y-widget-time-context>\n\n <c8y-widget-auto-refresh-context\n *ngIf=\"\n widget?.config?.widgetInstanceGlobalAutoRefreshContext &&\n widget.config?.displaySettings.globalAutoRefreshContext\n \"\n [editMode$]=\"editMode$\"\n ></c8y-widget-auto-refresh-context>\n\n <c8y-dynamic-component\n [componentId]=\"widget.componentId || widget.name\"\n [config]=\"\n widget.templateUrl || widget.widgetComponent\n ? { child: widget, dashboard: contextDashboard, context: context }\n : widget.config\n \"\n *ngIf=\"child.intersected\"\n (updateWidgetClasses)=\"updateWidgetClasses(widget, $event)\"\n ></c8y-dynamic-component>\n </c8y-dashboard-child>\n </c8y-dashboard>\n </ng-container>\n</ng-container>\n", dependencies: [{ kind: "component", type: EmptyStateComponent, selector: "c8y-ui-empty-state", inputs: ["icon", "title", "subtitle", "horizontal"] }, { kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: LoadingComponent, selector: "c8y-loading", inputs: ["layout", "progress", "message"] }, { kind: "component", type: ActionBarItemComponent, selector: "c8y-action-bar-item", inputs: ["placement", "priority", "itemClass", "injector", "groupId", "inGroupPriority"] }, { kind: "component", type: DynamicComponentComponent, selector: "c8y-dynamic-component", inputs: ["componentId", "config", "mode", "notFoundError", "executeResolvers"], outputs: ["updateWidgetClasses"] }, { kind: "directive", type: i2$2.TooltipDirective, selector: "[tooltip], [tooltipHtml]", inputs: ["adaptivePosition", "tooltip", "placement", "triggers", "container", "containerClass", "boundariesElement", "isOpen", "isDisabled", "delay", "tooltipHtml", "tooltipPlacement", "tooltipIsOpen", "tooltipEnable", "tooltipAppendToBody", "tooltipAnimation", "tooltipClass", "tooltipContext", "tooltipPopupDelay", "tooltipFadeDuration", "tooltipTrigger"], outputs: ["tooltipChange", "onShown", "onHidden", "tooltipStateChanged"], exportAs: ["bs-tooltip"] }, { kind: "component", type: TitleComponent, selector: "c8y-title", inputs: ["pageTitleUpdate"] }, { kind: "directive", type: GuideHrefDirective, selector: "[c8y-guide-href]", inputs: ["c8y-guide-href"] }, { kind: "component", type: GuideDocsComponent, selector: "[c8y-guide-docs]" }, { kind: "component", type: BreadcrumbComponent, selector: "c8y-breadcrumb" }, { kind: "component", type: BreadcrumbItemComponent, selector: "c8y-breadcrumb-item", inputs: ["icon", "translate", "label", "path", "injector"] }, { kind: "directive", type: i1$1.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { kind: "directive", type: i2$4.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: WidgetTimeContextComponent, selector: "c8y-widget-time-context", inputs: ["canDecouple", "displaySettings", "hidden"], outputs: ["dateContextChange"] }, { kind: "component", type: DashboardChildActionComponent, selector: "c8y-dashboard-child-action" }, { kind: "component", type: DashboardChildComponent, selector: "c8y-dashboard-child", inputs: ["x", "y", "width", "height", "data", "margin", "useIntersection", "isFrozen", "canToggleFullscreen", "editMode", "class"], outputs: ["changeStart", "changeEnd", "toggleFullscreen"] }, { kind: "component", type: DashboardComponent, selector: "c8y-dashboard", inputs: ["columns", "gap", "rows"], outputs: ["dashboardChange"] }, { kind: "component", type: DashboardChildTitleComponent, selector: "c8y-dashboard-child-title" }, { kind: "component", type: WidgetAutoRefreshContextComponent, selector: "c8y-widget-auto-refresh-context", inputs: ["editMode$"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] }); }
|
|
30414
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: WidgetsDashboardComponent, selector: "c8y-widgets-dashboard", inputs: { widgets: "widgets", context: "context", contextDashboard: "contextDashboard", _settings: ["settings", "_settings"], isCopyDisabled: "isCopyDisabled", breadcrumb: "breadcrumb", editModeButtons: "editModeButtons" }, outputs: { onAddWidget: "onAddWidget", onEditWidget: "onEditWidget", onDeleteWidget: "onDeleteWidget", onChangeDashboard: "onChangeDashboard", onResize: "onResize", onEditDashboard: "onEditDashboard", onCopyDashboard: "onCopyDashboard", onDeleteDashboard: "onDeleteDashboard", onChangeStart: "onChangeStart", onChangeEnd: "onChangeEnd", onSaveDashboard: "onSaveDashboard", onCancelDashboard: "onCancelDashboard", revertChange: "revertChange" }, host: { styleAttribute: "\n display: block;\n ", classAttribute: "dashboard c8y-grid-dashboard" }, providers: [WidgetsDashboardEventService], usesOnChanges: true, ngImport: i0, template: "<c8y-title *ngIf=\"!!settings.title\">\n {{ settings.title | translate }}\n</c8y-title>\n\n<c8y-breadcrumb *ngIf=\"!!breadcrumb\">\n <c8y-breadcrumb-item\n [icon]=\"breadcrumb.icon\"\n [label]=\"breadcrumb.label\"\n [path]=\"breadcrumb.path\"\n ></c8y-breadcrumb-item>\n</c8y-breadcrumb>\n\n<c8y-action-bar-item\n [placement]=\"'left'\"\n [priority]=\"ACTION_BAR_EDIT_WIDGETS_PRIORITY\"\n *ngIf=\"!(editMode$ | async)\"\n>\n <button\n class=\"btn btn-link animated fadeIn hidden-xs\"\n title=\"{{ 'Edit widgets' | translate }}\"\n type=\"button\"\n [disabled]=\"settings.isDisabled\"\n (click)=\"enableEditMode()\"\n data-cy=\"c8y-widget-dashboard--edit-widgets\"\n >\n <i c8yIcon=\"send-backward\"></i>\n <span class=\"m-l-4\">{{ 'Edit widgets' | translate }}</span>\n </button>\n <button\n class=\"btn btn-link visible-xs m-l-0\"\n tooltip=\"{{ 'Not available on mobile phone' | translate }}\"\n type=\"button\"\n [disabled]=\"true\"\n >\n <i c8yIcon=\"send-backward\"></i>\n <span class=\"m-l-4\">{{ 'Edit widgets' | translate }}</span>\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]=\"'left'\"\n *ngIf=\"editMode$ | async\"\n>\n <button\n class=\"btn btn-link animated fadeIn\"\n title=\"{{ 'Add widget' | translate }}\"\n type=\"button\"\n (click)=\"onAddWidget.emit()\"\n data-cy=\"widget-dashboard--Add-widget\"\n >\n <i c8yIcon=\"plus-circle\"></i>\n {{ 'Add widget' | translate }}\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]=\"'left'\"\n itemClass=\"d-flex a-i-center gap-8\"\n *ngIf=\"editMode$ | async\"\n>\n <div class=\"input-group input-group-sm animated fadeIn\">\n <div class=\"input-group-btn\">\n <button\n class=\"btn btn-default btn-sm btn-icon\"\n [attr.aria-label]=\"'Undo' | translate\"\n [tooltip]=\"\n editModeButtons.undoButtonDisabled\n ? ''\n : (undoMessage\n | translate: { changeToUndo: editModeButtons.changeToUndoName | translate })\n \"\n container=\"body\"\n (click)=\"revertChange.emit('undo')\"\n [disabled]=\"editModeButtons.undoButtonDisabled\"\n >\n <i [c8yIcon]=\"'undo'\"></i>\n </button>\n </div>\n <div class=\"input-group-btn\">\n <button\n class=\"btn btn-default btn-sm btn-icon\"\n [attr.aria-label]=\"'Redo' | translate\"\n [tooltip]=\"\n editModeButtons.redoButtonDisabled\n ? ''\n : (redoMessage\n | translate: { changeToRedo: editModeButtons.changeToRedoName | translate })\n \"\n container=\"body\"\n (click)=\"revertChange.emit('redo')\"\n [disabled]=\"editModeButtons.redoButtonDisabled\"\n >\n <i [c8yIcon]=\"'redo'\"></i>\n </button>\n </div>\n <span></span>\n </div>\n <div class=\"btn-group animated fadeIn\">\n <button\n class=\"btn btn-default btn-sm\"\n title=\"{{ 'Cancel' | translate }}\"\n type=\"button\"\n (click)=\"cancelDashboardSave()\"\n >\n {{ 'Cancel' | translate }}\n </button>\n <button\n class=\"btn btn-primary btn-sm m-l-8\"\n title=\"{{ 'Save' | translate }}\"\n type=\"button\"\n [disabled]=\"editModeButtons.undoButtonDisabled\"\n (click)=\"saveDashboard()\"\n data-cy=\"c8y-widgets-dashboard--save\"\n >\n {{ 'Save' | translate }}\n </button>\n </div>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]=\"'right'\"\n *ngIf=\"onEditDashboard.observers.length\"\n>\n <button\n class=\"btn btn-link hidden-xs m-l-0\"\n title=\"{{ 'Dashboard settings' | translate }}\"\n type=\"button\"\n [disabled]=\"settings.isDisabled || (editMode$ | async)\"\n (click)=\"onEditDashboard.emit()\"\n data-cy=\"c8y-widgets-dashboard--edit-dashboard\"\n >\n <i c8yIcon=\"sorting-slider\"></i>\n <span class=\"visible-xs-inline hidden-sm visible-md-inline visible-lg-inline\">\n {{ 'Dashboard settings' | translate }}\n </span>\n </button>\n <button\n class=\"btn btn-link visible-xs m-l-0\"\n tooltip=\"{{ 'Not available on mobile phone' | translate }}\"\n type=\"button\"\n [disabled]=\"true\"\n >\n <i c8yIcon=\"sorting-slider\"></i>\n <span class=\"visible-xs-inline hidden-sm visible-md-inline visible-lg-inline\">\n {{ 'Dashboard settings' | translate }}\n </span>\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]=\"'right'\"\n *ngIf=\"settings.allowFullscreen\"\n [priority]=\"-5000\"\n itemClass=\"pull-right\"\n>\n <button\n class=\"btn btn-link\"\n [attr.aria-label]=\"'Full screen' | translate\"\n tooltip=\"{{ 'Full screen' | translate }}\"\n placement=\"left\"\n container=\"body\"\n type=\"button\"\n [delay]=\"500\"\n (click)=\"toggleFullscreen()\"\n data-cy=\"widgets-dashboard--Full-screen\"\n >\n <i [c8yIcon]=\"(inFullScreen$ | async) ? 'compress' : 'expand'\"></i>\n <span class=\"visible-xs-inline hidden-sm visible-md-inline visibile-lg-inline\">\n {{ 'Full screen' | translate }}\n </span>\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]=\"'more'\"\n [priority]=\"-2000\"\n *ngIf=\"settings.canCopy\"\n>\n <div\n [ngStyle]=\"{\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center'\n }\"\n >\n <button\n class=\"hidden-xs\"\n title=\"{{\n (isCopyDisabled === true || !isCopyDisabled?.state ? 'Disabled' : copyDashboardLabel)\n | translate\n }}\"\n type=\"button\"\n [ngClass]=\"{ 'btn btn-link': !settings.canDelete }\"\n data-cy=\"widgets-dashboard--copy-dashboard\"\n (click)=\"onCopyDashboard.emit()\"\n [disabled]=\"isCopyDisabled === true || !isCopyDisabled?.state || (editMode$ | async)\"\n >\n <i c8yIcon=\"clone\"></i>\n <span>{{ copyDashboardLabel | translate }}</span>\n </button>\n <button\n class=\"btn-help btn-help--sm m-r-16 hidden-xs\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"copyDisabledPopoverMsg | translate\"\n placement=\"right\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n *ngIf=\"!isCopyDisabled?.state && copyDisabledPopoverMsg\"\n data-cy=\"widgets-dashboard--info-copy-dashboard\"\n (click)=\"$event.stopPropagation()\"\n ></button>\n </div>\n <button\n class=\"visible-xs m-l-0\"\n tooltip=\"{{ 'Not available on mobile phone' | translate }}\"\n type=\"button\"\n [ngClass]=\"{ 'btn btn-link': !settings.canDelete }\"\n [disabled]=\"true\"\n >\n <i c8yIcon=\"clone\"></i>\n <span>{{ copyDashboardLabel | translate }}</span>\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]=\"'more'\"\n [priority]=\"-3000\"\n *ngIf=\"settings.canDelete && onDeleteDashboard.observers.length\"\n>\n <button\n class=\"hidden-xs\"\n title=\"{{ 'Delete dashboard' | translate }}\"\n type=\"button\"\n data-cy=\"widgets-dashboard--delete-dashboard\"\n [ngClass]=\"{ 'btn btn-link': !settings.canCopy }\"\n (click)=\"onDeleteDashboard.emit()\"\n [disabled]=\"settings.isDisabled || (editMode$ | async)\"\n >\n <i c8yIcon=\"delete\"></i>\n <span translate>Delete dashboard</span>\n </button>\n <button\n class=\"visible-xs m-l-0\"\n tooltip=\"{{ 'Not available on mobile phone' | translate }}\"\n type=\"button\"\n data-cy=\"widgets-dashboard--delete-dashboard-mobile\"\n [ngClass]=\"{ 'btn btn-link': !settings.canCopy }\"\n [disabled]=\"true\"\n >\n <i c8yIcon=\"delete\"></i>\n <span translate>Delete dashboard</span>\n </button>\n</c8y-action-bar-item>\n\n<ng-template #loadingIndicator>\n <c8y-loading\n class=\"col-xs-12 text-center\"\n *ngIf=\"isLoadingWidgets$ | async\"\n ></c8y-loading>\n</ng-template>\n\n<ng-container *ngIf=\"!(isLoadingWidgets$ | async); else loadingIndicator\">\n <ng-container *ngIf=\"resolvedWidgets$ | async as widgetsToDisplay\">\n <!-- empty state -->\n <c8y-ui-empty-state\n [icon]=\"'c8y-device'\"\n [title]=\"'No widgets to display.' | translate\"\n *ngIf=\"widgetsToDisplay?.length === 0\"\n >\n <div *ngIf=\"onAddWidget.observers.length\">\n <p\n translate\n *ngIf=\"editMode$ | async\"\n >\n Add widgets to this dashboard.\n </p>\n <p\n translate\n *ngIf=\"!(editMode$ | async)\"\n >\n Click \"Edit widgets\" to unlock\n </p>\n <div>\n <button\n class=\"btn btn-primary m-t-16\"\n title=\"{{ 'Add widget' | translate }}\"\n type=\"button\"\n [disabled]=\"settings.isDisabled || !(editMode$ | async)\"\n (click)=\"onAddWidget.emit()\"\n data-cy=\"c8y-widgets-dashboard--add-widget\"\n translate\n >\n Add widget\n </button>\n </div>\n <p c8y-guide-docs>\n <small\n translate\n ngNonBindable\n >\n Find out more in the\n <a c8y-guide-href=\"/docs/cockpit/working-with-dashboards\">user documentation</a>\n .\n </small>\n </p>\n </div>\n </c8y-ui-empty-state>\n\n <c8y-dashboard\n [columns]=\"settings.columns\"\n (dashboardChange)=\"onChangeDashboard.emit($event)\"\n #dashboard\n >\n <c8y-dashboard-child\n [class]=\"widget.classes\"\n *ngFor=\"let widget of widgetsToDisplay\"\n [x]=\"widget._x\"\n [y]=\"widget._y\"\n [width]=\"widget._width || settings.defaultWidth\"\n [height]=\"widget._height || settings.defaultHeight\"\n [margin]=\"settings.widgetMargin\"\n [data]=\"widget\"\n [useIntersection]=\"true\"\n [editMode]=\"editMode$ | async\"\n (changeStart)=\"onChangeStart.emit({ widget: widget, source: child, dashboard: dashboard })\"\n (changeEnd)=\"onChangeEnd.emit({ widget: widget, source: child, dashboard: dashboard })\"\n (toggleFullscreen)=\"toggleFullscreenOnWidget(child)\"\n [canToggleFullscreen]=\"!(inFullScreen$ | async) || widgetInFullscreenMode\"\n #child\n >\n <c8y-dashboard-child-title>\n <span\n data-cy=\"c8y-dashboard-list--device-widget\"\n *ngIf=\"settings.translateWidgetTitle\"\n >\n {{ widget.title | translate }}\n </span>\n <span *ngIf=\"!settings.translateWidgetTitle\">\n {{ widget.title }}\n </span>\n </c8y-dashboard-child-title>\n <c8y-dashboard-child-action *ngIf=\"onEditWidget.observers.length\">\n <button\n title=\"{{ 'Edit widget' | translate }}\"\n type=\"button\"\n data-cy=\"widgets-dashboard--Edit-widget\"\n (click)=\"onEditWidget.emit({ widget: widget, source: child, dashboard: dashboard })\"\n >\n <i c8yIcon=\"pencil\"></i>\n <span translate>Edit</span>\n </button>\n </c8y-dashboard-child-action>\n <c8y-dashboard-child-action *ngIf=\"onDeleteWidget.observers.length\">\n <button\n title=\"{{ 'Remove widget' | translate }}\"\n type=\"button\"\n data-cy=\"c8y-widgets-dashboard--remove-widget\"\n (click)=\"onDeleteWidget.emit({ widget: widget, source: child, dashboard: dashboard })\"\n >\n <i c8yIcon=\"delete\"></i>\n <span translate>Remove</span>\n </button>\n </c8y-dashboard-child-action>\n\n <c8y-widget-time-context\n *ngIf=\"\n (widget.config?.displaySettings?.globalTimeContext ||\n widget.config?.displaySettings?.globalRealtimeContext) &&\n (widget.config.widgetInstanceGlobalTimeContext ||\n widget.config.widgetInstanceGlobalAutoRefreshContext)\n \"\n (dateContextChange)=\"updateWidgetConfig($event, widget)\"\n [canDecouple]=\"widget.config.canDecoupleGlobalTimeContext\"\n [displaySettings]=\"widget.config.displaySettings\"\n [hidden]=\"editMode$ | async\"\n ></c8y-widget-time-context>\n\n <c8y-widget-auto-refresh-context\n *ngIf=\"\n widget?.config?.widgetInstanceGlobalAutoRefreshContext &&\n widget.config?.displaySettings.globalAutoRefreshContext\n \"\n [editMode$]=\"editMode$\"\n ></c8y-widget-auto-refresh-context>\n\n <c8y-dynamic-component\n [componentId]=\"widget.componentId || widget.name\"\n [config]=\"\n widget.templateUrl || widget.widgetComponent\n ? { child: widget, dashboard: contextDashboard, context: context }\n : widget.config\n \"\n *ngIf=\"child.intersected\"\n (updateWidgetClasses)=\"updateWidgetClasses(widget, $event)\"\n ></c8y-dynamic-component>\n </c8y-dashboard-child>\n </c8y-dashboard>\n </ng-container>\n</ng-container>\n", dependencies: [{ kind: "component", type: EmptyStateComponent, selector: "c8y-ui-empty-state", inputs: ["icon", "title", "subtitle", "horizontal"] }, { kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: LoadingComponent, selector: "c8y-loading", inputs: ["layout", "progress", "message"] }, { kind: "component", type: ActionBarItemComponent, selector: "c8y-action-bar-item", inputs: ["placement", "priority", "itemClass", "injector", "groupId", "inGroupPriority"] }, { kind: "component", type: DynamicComponentComponent, selector: "c8y-dynamic-component", inputs: ["componentId", "config", "mode", "notFoundError", "executeResolvers"], outputs: ["updateWidgetClasses"] }, { kind: "directive", type: i2$2.TooltipDirective, selector: "[tooltip], [tooltipHtml]", inputs: ["adaptivePosition", "tooltip", "placement", "triggers", "container", "containerClass", "boundariesElement", "isOpen", "isDisabled", "delay", "tooltipHtml", "tooltipPlacement", "tooltipIsOpen", "tooltipEnable", "tooltipAppendToBody", "tooltipAnimation", "tooltipClass", "tooltipContext", "tooltipPopupDelay", "tooltipFadeDuration", "tooltipTrigger"], outputs: ["tooltipChange", "onShown", "onHidden", "tooltipStateChanged"], exportAs: ["bs-tooltip"] }, { kind: "component", type: TitleComponent, selector: "c8y-title", inputs: ["pageTitleUpdate"] }, { kind: "directive", type: GuideHrefDirective, selector: "[c8y-guide-href]", inputs: ["c8y-guide-href"] }, { kind: "component", type: GuideDocsComponent, selector: "[c8y-guide-docs]" }, { kind: "component", type: BreadcrumbComponent, selector: "c8y-breadcrumb" }, { kind: "component", type: BreadcrumbItemComponent, selector: "c8y-breadcrumb-item", inputs: ["icon", "translate", "label", "path", "injector"] }, { kind: "directive", type: i1$1.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { kind: "directive", type: i2$4.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: WidgetTimeContextComponent, selector: "c8y-widget-time-context", inputs: ["canDecouple", "displaySettings", "hidden"], outputs: ["dateContextChange"] }, { kind: "component", type: DashboardChildActionComponent, selector: "c8y-dashboard-child-action" }, { kind: "component", type: DashboardChildComponent, selector: "c8y-dashboard-child", inputs: ["x", "y", "width", "height", "data", "margin", "useIntersection", "isFrozen", "canToggleFullscreen", "editMode", "class"], outputs: ["changeStart", "changeEnd", "toggleFullscreen"] }, { kind: "component", type: DashboardComponent, selector: "c8y-dashboard", inputs: ["columns", "gap", "rows"], outputs: ["dashboardChange"] }, { kind: "component", type: DashboardChildTitleComponent, selector: "c8y-dashboard-child-title" }, { kind: "component", type: WidgetAutoRefreshContextComponent, selector: "c8y-widget-auto-refresh-context", inputs: ["editMode$"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] }); }
|
|
30368
30415
|
}
|
|
30369
30416
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WidgetsDashboardComponent, decorators: [{
|
|
30370
30417
|
type: Component,
|
|
@@ -30373,7 +30420,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
30373
30420
|
display: block;
|
|
30374
30421
|
`,
|
|
30375
30422
|
class: 'dashboard c8y-grid-dashboard'
|
|
30376
|
-
}, providers: [WidgetsDashboardEventService], template: "<c8y-title *ngIf=\"!!settings.title\">\n {{ settings.title | translate }}\n</c8y-title>\n\n<c8y-breadcrumb *ngIf=\"!!breadcrumb\">\n <c8y-breadcrumb-item\n [icon]=\"breadcrumb.icon\"\n [label]=\"breadcrumb.label\"\n [path]=\"breadcrumb.path\"\n ></c8y-breadcrumb-item>\n</c8y-breadcrumb>\n\n<c8y-action-bar-item\n [placement]=\"'left'\"\n [priority]=\"ACTION_BAR_EDIT_WIDGETS_PRIORITY\"\n *ngIf=\"!(editMode$ | async)\"\n>\n <button\n class=\"btn btn-link animated fadeIn hidden-xs\"\n title=\"{{ 'Edit widgets' | translate }}\"\n type=\"button\"\n [disabled]=\"settings.isDisabled\"\n (click)=\"enableEditMode()\"\n data-cy=\"c8y-widget-dashboard--edit-widgets\"\n >\n <i c8yIcon=\"send-backward\"></i>\n <span class=\"m-l-4\">{{ 'Edit widgets' | translate }}</span>\n </button>\n <button\n class=\"btn btn-link visible-xs m-l-0\"\n tooltip=\"{{ 'Not available on mobile phone' | translate }}\"\n type=\"button\"\n [disabled]=\"true\"\n >\n <i c8yIcon=\"send-backward\"></i>\n <span class=\"m-l-4\">{{ 'Edit widgets' | translate }}</span>\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]=\"'left'\"\n *ngIf=\"editMode$ | async\"\n>\n <button\n class=\"btn btn-link animated fadeIn\"\n title=\"{{ 'Add widget' | translate }}\"\n type=\"button\"\n (click)=\"onAddWidget.emit()\"\n data-cy=\"widget-dashboard--Add-widget\"\n >\n <i c8yIcon=\"plus-circle\"></i>\n {{ 'Add widget' | translate }}\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]=\"'left'\"\n itemClass=\"d-flex a-i-center gap-8\"\n *ngIf=\"editMode$ | async\"\n>\n <div class=\"input-group input-group-sm animated fadeIn\">\n <div class=\"input-group-btn\">\n <button\n class=\"btn btn-default btn-sm btn-icon\"\n [attr.aria-label]=\"'Undo' | translate\"\n [tooltip]=\"\n editModeButtons.undoButtonDisabled\n ? ''\n : (undoMessage\n | translate: { changeToUndo: editModeButtons.changeToUndoName | translate })\n \"\n container=\"body\"\n (click)=\"revertChange.emit('undo')\"\n [disabled]=\"editModeButtons.undoButtonDisabled\"\n >\n <i [c8yIcon]=\"'undo'\"></i>\n </button>\n </div>\n <div class=\"input-group-btn\">\n <button\n class=\"btn btn-default btn-sm btn-icon\"\n [attr.aria-label]=\"'Redo' | translate\"\n [tooltip]=\"\n editModeButtons.redoButtonDisabled\n ? ''\n : (redoMessage\n | translate: { changeToRedo: editModeButtons.changeToRedoName | translate })\n \"\n container=\"body\"\n (click)=\"revertChange.emit('redo')\"\n [disabled]=\"editModeButtons.redoButtonDisabled\"\n >\n <i [c8yIcon]=\"'redo'\"></i>\n </button>\n </div>\n <span></span>\n </div>\n <div class=\"btn-group animated fadeIn\">\n <button\n class=\"btn btn-default btn-sm\"\n title=\"{{ 'Cancel' | translate }}\"\n type=\"button\"\n (click)=\"cancelDashboardSave()\"\n >\n {{ 'Cancel' | translate }}\n </button>\n <button\n class=\"btn btn-primary btn-sm m-l-8\"\n title=\"{{ 'Save' | translate }}\"\n type=\"button\"\n [disabled]=\"editModeButtons.undoButtonDisabled\"\n (click)=\"saveDashboard()\"\n data-cy=\"c8y-widgets-dashboard--save\"\n >\n {{ 'Save' | translate }}\n </button>\n </div>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]=\"'right'\"\n *ngIf=\"onEditDashboard.observers.length\"\n>\n <button\n class=\"btn btn-link hidden-xs m-l-0\"\n title=\"{{ 'Dashboard settings' | translate }}\"\n type=\"button\"\n [disabled]=\"settings.isDisabled || (editMode$ | async)\"\n (click)=\"onEditDashboard.emit()\"\n data-cy=\"c8y-widgets-dashboard--edit-dashboard\"\n >\n <i c8yIcon=\"sorting-slider\"></i>\n <span class=\"visible-xs-inline hidden-sm visible-md-inline visible-lg-inline\">\n {{ 'Dashboard settings' | translate }}\n </span>\n </button>\n <button\n class=\"btn btn-link visible-xs m-l-0\"\n tooltip=\"{{ 'Not available on mobile phone' | translate }}\"\n type=\"button\"\n [disabled]=\"true\"\n >\n <i c8yIcon=\"sorting-slider\"></i>\n <span class=\"visible-xs-inline hidden-sm visible-md-inline visible-lg-inline\">\n {{ 'Dashboard settings' | translate }}\n </span>\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]=\"'right'\"\n *ngIf=\"settings.allowFullscreen\"\n [priority]=\"-5000\"\n itemClass=\"pull-right\"\n>\n <button\n class=\"btn btn-link\"\n [attr.aria-label]=\"'Full screen' | translate\"\n tooltip=\"{{ 'Full screen' | translate }}\"\n placement=\"left\"\n container=\"body\"\n type=\"button\"\n [delay]=\"500\"\n (click)=\"toggleFullscreen()\"\n data-cy=\"widgets-dashboard--Full-screen\"\n >\n <i [c8yIcon]=\"(inFullScreen$ | async) ? 'compress' : 'expand'\"></i>\n <span class=\"visible-xs-inline hidden-sm visible-md-inline visibile-lg-inline\">\n {{ 'Full screen' | translate }}\n </span>\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]=\"'more'\"\n [priority]=\"-2000\"\n *ngIf=\"settings.canCopy\"\n>\n <div\n [ngStyle]=\"{\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center'\n }\"\n >\n <button\n class=\"hidden-xs\"\n title=\"{{\n (isCopyDisabled === true || !isCopyDisabled?.state ? 'Disabled' : copyDashboardLabel) | translate\n }}\"\n type=\"button\"\n [ngClass]=\"{ 'btn btn-link': !settings.canDelete }\"\n data-cy=\"widgets-dashboard--copy-dashboard\"\n (click)=\"onCopyDashboard.emit()\"\n [disabled]=\"isCopyDisabled === true || !isCopyDisabled?.state || (editMode$ | async)\"\n >\n <i c8yIcon=\"clone\"></i>\n <span>{{ copyDashboardLabel | translate }}</span>\n </button>\n <button\n class=\"btn-help btn-help--sm m-r-16 hidden-xs\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"copyDisabledPopoverMsg | translate\"\n placement=\"right\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n *ngIf=\"!isCopyDisabled?.state && copyDisabledPopoverMsg\"\n data-cy=\"widgets-dashboard--info-copy-dashboard\"\n (click)=\"$event.stopPropagation()\"\n ></button>\n </div>\n <button\n class=\"visible-xs m-l-0\"\n tooltip=\"{{ 'Not available on mobile phone' | translate }}\"\n type=\"button\"\n [ngClass]=\"{ 'btn btn-link': !settings.canDelete }\"\n [disabled]=\"true\"\n >\n <i c8yIcon=\"clone\"></i>\n <span>{{ copyDashboardLabel | translate }}</span>\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]=\"'more'\"\n [priority]=\"-3000\"\n *ngIf=\"settings.canDelete && onDeleteDashboard.observers.length\"\n>\n <button\n class=\"hidden-xs\"\n title=\"{{ 'Delete dashboard' | translate }}\"\n type=\"button\"\n data-cy=\"widgets-dashboard--delete-dashboard\"\n [ngClass]=\"{ 'btn btn-link': !settings.canCopy }\"\n (click)=\"onDeleteDashboard.emit()\"\n [disabled]=\"settings.isDisabled || (editMode$ | async)\"\n >\n <i c8yIcon=\"delete\"></i>\n <span translate>Delete dashboard</span>\n </button>\n <button\n class=\"visible-xs m-l-0\"\n tooltip=\"{{ 'Not available on mobile phone' | translate }}\"\n type=\"button\"\n data-cy=\"widgets-dashboard--delete-dashboard-mobile\"\n [ngClass]=\"{ 'btn btn-link': !settings.canCopy }\"\n [disabled]=\"true\"\n >\n <i c8yIcon=\"delete\"></i>\n <span translate>Delete dashboard</span>\n </button>\n</c8y-action-bar-item>\n\n<ng-template #loadingIndicator>\n <c8y-loading\n class=\"col-xs-12 text-center\"\n *ngIf=\"isLoadingWidgets$ | async\"\n ></c8y-loading>\n</ng-template>\n\n<ng-container *ngIf=\"!(isLoadingWidgets$ | async); else loadingIndicator\">\n <ng-container *ngIf=\"resolvedWidgets$ | async as widgetsToDisplay\">\n <!-- empty state -->\n <c8y-ui-empty-state\n [icon]=\"'c8y-device'\"\n [title]=\"'No widgets to display.' | translate\"\n *ngIf=\"widgetsToDisplay?.length === 0\"\n >\n <div *ngIf=\"onAddWidget.observers.length\">\n <p\n translate\n *ngIf=\"editMode$ | async\"\n >\n Add widgets to this dashboard.\n </p>\n <p\n translate\n *ngIf=\"!(editMode$ | async)\"\n >\n Click \"Edit widgets\" to unlock\n </p>\n <div>\n <button\n class=\"btn btn-primary m-t-16\"\n title=\"{{ 'Add widget' | translate }}\"\n type=\"button\"\n [disabled]=\"settings.isDisabled || !(editMode$ | async)\"\n (click)=\"onAddWidget.emit()\"\n data-cy=\"c8y-widgets-dashboard--add-widget\"\n translate\n >\n Add widget\n </button>\n </div>\n <p c8y-guide-docs>\n <small\n translate\n ngNonBindable\n >\n Find out more in the\n <a c8y-guide-href=\"/docs/cockpit/working-with-dashboards\">user documentation</a>\n .\n </small>\n </p>\n </div>\n </c8y-ui-empty-state>\n\n <c8y-dashboard\n [columns]=\"settings.columns\"\n (dashboardChange)=\"onChangeDashboard.emit($event)\"\n #dashboard\n >\n <c8y-dashboard-child\n [class]=\"widget.classes\"\n *ngFor=\"let widget of widgetsToDisplay\"\n [x]=\"widget._x\"\n [y]=\"widget._y\"\n [width]=\"widget._width || settings.defaultWidth\"\n [height]=\"widget._height || settings.defaultHeight\"\n [margin]=\"settings.widgetMargin\"\n [data]=\"widget\"\n [useIntersection]=\"true\"\n [editMode]=\"editMode$ | async\"\n (changeStart)=\"onChangeStart.emit({ widget: widget, source: child, dashboard: dashboard })\"\n (changeEnd)=\"onChangeEnd.emit({ widget: widget, source: child, dashboard: dashboard })\"\n (toggleFullscreen)=\"toggleFullscreenOnWidget(child)\"\n [canToggleFullscreen]=\"!(inFullScreen$ | async) || widgetInFullscreenMode\"\n #child\n >\n <c8y-dashboard-child-title>\n <span\n data-cy=\"c8y-dashboard-list--device-widget\"\n *ngIf=\"settings.translateWidgetTitle\"\n >\n {{ widget.title | translate }}\n </span>\n <span *ngIf=\"!settings.translateWidgetTitle\">\n {{ widget.title }}\n </span>\n </c8y-dashboard-child-title>\n <c8y-dashboard-child-action *ngIf=\"onEditWidget.observers.length\">\n <button\n title=\"{{ 'Edit widget' | translate }}\"\n type=\"button\"\n data-cy=\"widgets-dashboard--Edit-widget\"\n (click)=\"onEditWidget.emit({ widget: widget, source: child, dashboard: dashboard })\"\n >\n <i c8yIcon=\"pencil\"></i>\n <span translate>Edit</span>\n </button>\n </c8y-dashboard-child-action>\n <c8y-dashboard-child-action *ngIf=\"onDeleteWidget.observers.length\">\n <button\n title=\"{{ 'Remove widget' | translate }}\"\n type=\"button\"\n data-cy=\"c8y-widgets-dashboard--remove-widget\"\n (click)=\"onDeleteWidget.emit({ widget: widget, source: child, dashboard: dashboard })\"\n >\n <i c8yIcon=\"delete\"></i>\n <span translate>Remove</span>\n </button>\n </c8y-dashboard-child-action>\n\n <c8y-widget-time-context\n *ngIf=\"\n (widget.config?.displaySettings?.globalTimeContext ||\n widget.config?.displaySettings?.globalRealtimeContext) &&\n widget.config.widgetInstanceGlobalTimeContext\n \"\n (dateContextChange)=\"updateWidgetConfig($event, widget)\"\n [canDecouple]=\"widget.config.canDecoupleGlobalTimeContext\"\n [displaySettings]=\"widget.config.displaySettings\"\n [hidden]=\"(editMode$ | async)\"\n ></c8y-widget-time-context>\n\n <c8y-widget-auto-refresh-context\n *ngIf=\"\n widget?.config?.widgetInstanceGlobalAutoRefreshContext &&\n widget.config?.displaySettings.globalAutoRefreshContext\n \"\n [editMode$]=\"editMode$\"\n ></c8y-widget-auto-refresh-context>\n\n <c8y-dynamic-component\n [componentId]=\"widget.componentId || widget.name\"\n [config]=\"\n widget.templateUrl || widget.widgetComponent\n ? { child: widget, dashboard: contextDashboard, context: context }\n : widget.config\n \"\n *ngIf=\"child.intersected\"\n (updateWidgetClasses)=\"updateWidgetClasses(widget, $event)\"\n ></c8y-dynamic-component>\n </c8y-dashboard-child>\n </c8y-dashboard>\n </ng-container>\n</ng-container>\n" }]
|
|
30423
|
+
}, providers: [WidgetsDashboardEventService], template: "<c8y-title *ngIf=\"!!settings.title\">\n {{ settings.title | translate }}\n</c8y-title>\n\n<c8y-breadcrumb *ngIf=\"!!breadcrumb\">\n <c8y-breadcrumb-item\n [icon]=\"breadcrumb.icon\"\n [label]=\"breadcrumb.label\"\n [path]=\"breadcrumb.path\"\n ></c8y-breadcrumb-item>\n</c8y-breadcrumb>\n\n<c8y-action-bar-item\n [placement]=\"'left'\"\n [priority]=\"ACTION_BAR_EDIT_WIDGETS_PRIORITY\"\n *ngIf=\"!(editMode$ | async)\"\n>\n <button\n class=\"btn btn-link animated fadeIn hidden-xs\"\n title=\"{{ 'Edit widgets' | translate }}\"\n type=\"button\"\n [disabled]=\"settings.isDisabled\"\n (click)=\"enableEditMode()\"\n data-cy=\"c8y-widget-dashboard--edit-widgets\"\n >\n <i c8yIcon=\"send-backward\"></i>\n <span class=\"m-l-4\">{{ 'Edit widgets' | translate }}</span>\n </button>\n <button\n class=\"btn btn-link visible-xs m-l-0\"\n tooltip=\"{{ 'Not available on mobile phone' | translate }}\"\n type=\"button\"\n [disabled]=\"true\"\n >\n <i c8yIcon=\"send-backward\"></i>\n <span class=\"m-l-4\">{{ 'Edit widgets' | translate }}</span>\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]=\"'left'\"\n *ngIf=\"editMode$ | async\"\n>\n <button\n class=\"btn btn-link animated fadeIn\"\n title=\"{{ 'Add widget' | translate }}\"\n type=\"button\"\n (click)=\"onAddWidget.emit()\"\n data-cy=\"widget-dashboard--Add-widget\"\n >\n <i c8yIcon=\"plus-circle\"></i>\n {{ 'Add widget' | translate }}\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]=\"'left'\"\n itemClass=\"d-flex a-i-center gap-8\"\n *ngIf=\"editMode$ | async\"\n>\n <div class=\"input-group input-group-sm animated fadeIn\">\n <div class=\"input-group-btn\">\n <button\n class=\"btn btn-default btn-sm btn-icon\"\n [attr.aria-label]=\"'Undo' | translate\"\n [tooltip]=\"\n editModeButtons.undoButtonDisabled\n ? ''\n : (undoMessage\n | translate: { changeToUndo: editModeButtons.changeToUndoName | translate })\n \"\n container=\"body\"\n (click)=\"revertChange.emit('undo')\"\n [disabled]=\"editModeButtons.undoButtonDisabled\"\n >\n <i [c8yIcon]=\"'undo'\"></i>\n </button>\n </div>\n <div class=\"input-group-btn\">\n <button\n class=\"btn btn-default btn-sm btn-icon\"\n [attr.aria-label]=\"'Redo' | translate\"\n [tooltip]=\"\n editModeButtons.redoButtonDisabled\n ? ''\n : (redoMessage\n | translate: { changeToRedo: editModeButtons.changeToRedoName | translate })\n \"\n container=\"body\"\n (click)=\"revertChange.emit('redo')\"\n [disabled]=\"editModeButtons.redoButtonDisabled\"\n >\n <i [c8yIcon]=\"'redo'\"></i>\n </button>\n </div>\n <span></span>\n </div>\n <div class=\"btn-group animated fadeIn\">\n <button\n class=\"btn btn-default btn-sm\"\n title=\"{{ 'Cancel' | translate }}\"\n type=\"button\"\n (click)=\"cancelDashboardSave()\"\n >\n {{ 'Cancel' | translate }}\n </button>\n <button\n class=\"btn btn-primary btn-sm m-l-8\"\n title=\"{{ 'Save' | translate }}\"\n type=\"button\"\n [disabled]=\"editModeButtons.undoButtonDisabled\"\n (click)=\"saveDashboard()\"\n data-cy=\"c8y-widgets-dashboard--save\"\n >\n {{ 'Save' | translate }}\n </button>\n </div>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]=\"'right'\"\n *ngIf=\"onEditDashboard.observers.length\"\n>\n <button\n class=\"btn btn-link hidden-xs m-l-0\"\n title=\"{{ 'Dashboard settings' | translate }}\"\n type=\"button\"\n [disabled]=\"settings.isDisabled || (editMode$ | async)\"\n (click)=\"onEditDashboard.emit()\"\n data-cy=\"c8y-widgets-dashboard--edit-dashboard\"\n >\n <i c8yIcon=\"sorting-slider\"></i>\n <span class=\"visible-xs-inline hidden-sm visible-md-inline visible-lg-inline\">\n {{ 'Dashboard settings' | translate }}\n </span>\n </button>\n <button\n class=\"btn btn-link visible-xs m-l-0\"\n tooltip=\"{{ 'Not available on mobile phone' | translate }}\"\n type=\"button\"\n [disabled]=\"true\"\n >\n <i c8yIcon=\"sorting-slider\"></i>\n <span class=\"visible-xs-inline hidden-sm visible-md-inline visible-lg-inline\">\n {{ 'Dashboard settings' | translate }}\n </span>\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]=\"'right'\"\n *ngIf=\"settings.allowFullscreen\"\n [priority]=\"-5000\"\n itemClass=\"pull-right\"\n>\n <button\n class=\"btn btn-link\"\n [attr.aria-label]=\"'Full screen' | translate\"\n tooltip=\"{{ 'Full screen' | translate }}\"\n placement=\"left\"\n container=\"body\"\n type=\"button\"\n [delay]=\"500\"\n (click)=\"toggleFullscreen()\"\n data-cy=\"widgets-dashboard--Full-screen\"\n >\n <i [c8yIcon]=\"(inFullScreen$ | async) ? 'compress' : 'expand'\"></i>\n <span class=\"visible-xs-inline hidden-sm visible-md-inline visibile-lg-inline\">\n {{ 'Full screen' | translate }}\n </span>\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]=\"'more'\"\n [priority]=\"-2000\"\n *ngIf=\"settings.canCopy\"\n>\n <div\n [ngStyle]=\"{\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center'\n }\"\n >\n <button\n class=\"hidden-xs\"\n title=\"{{\n (isCopyDisabled === true || !isCopyDisabled?.state ? 'Disabled' : copyDashboardLabel)\n | translate\n }}\"\n type=\"button\"\n [ngClass]=\"{ 'btn btn-link': !settings.canDelete }\"\n data-cy=\"widgets-dashboard--copy-dashboard\"\n (click)=\"onCopyDashboard.emit()\"\n [disabled]=\"isCopyDisabled === true || !isCopyDisabled?.state || (editMode$ | async)\"\n >\n <i c8yIcon=\"clone\"></i>\n <span>{{ copyDashboardLabel | translate }}</span>\n </button>\n <button\n class=\"btn-help btn-help--sm m-r-16 hidden-xs\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"copyDisabledPopoverMsg | translate\"\n placement=\"right\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n *ngIf=\"!isCopyDisabled?.state && copyDisabledPopoverMsg\"\n data-cy=\"widgets-dashboard--info-copy-dashboard\"\n (click)=\"$event.stopPropagation()\"\n ></button>\n </div>\n <button\n class=\"visible-xs m-l-0\"\n tooltip=\"{{ 'Not available on mobile phone' | translate }}\"\n type=\"button\"\n [ngClass]=\"{ 'btn btn-link': !settings.canDelete }\"\n [disabled]=\"true\"\n >\n <i c8yIcon=\"clone\"></i>\n <span>{{ copyDashboardLabel | translate }}</span>\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]=\"'more'\"\n [priority]=\"-3000\"\n *ngIf=\"settings.canDelete && onDeleteDashboard.observers.length\"\n>\n <button\n class=\"hidden-xs\"\n title=\"{{ 'Delete dashboard' | translate }}\"\n type=\"button\"\n data-cy=\"widgets-dashboard--delete-dashboard\"\n [ngClass]=\"{ 'btn btn-link': !settings.canCopy }\"\n (click)=\"onDeleteDashboard.emit()\"\n [disabled]=\"settings.isDisabled || (editMode$ | async)\"\n >\n <i c8yIcon=\"delete\"></i>\n <span translate>Delete dashboard</span>\n </button>\n <button\n class=\"visible-xs m-l-0\"\n tooltip=\"{{ 'Not available on mobile phone' | translate }}\"\n type=\"button\"\n data-cy=\"widgets-dashboard--delete-dashboard-mobile\"\n [ngClass]=\"{ 'btn btn-link': !settings.canCopy }\"\n [disabled]=\"true\"\n >\n <i c8yIcon=\"delete\"></i>\n <span translate>Delete dashboard</span>\n </button>\n</c8y-action-bar-item>\n\n<ng-template #loadingIndicator>\n <c8y-loading\n class=\"col-xs-12 text-center\"\n *ngIf=\"isLoadingWidgets$ | async\"\n ></c8y-loading>\n</ng-template>\n\n<ng-container *ngIf=\"!(isLoadingWidgets$ | async); else loadingIndicator\">\n <ng-container *ngIf=\"resolvedWidgets$ | async as widgetsToDisplay\">\n <!-- empty state -->\n <c8y-ui-empty-state\n [icon]=\"'c8y-device'\"\n [title]=\"'No widgets to display.' | translate\"\n *ngIf=\"widgetsToDisplay?.length === 0\"\n >\n <div *ngIf=\"onAddWidget.observers.length\">\n <p\n translate\n *ngIf=\"editMode$ | async\"\n >\n Add widgets to this dashboard.\n </p>\n <p\n translate\n *ngIf=\"!(editMode$ | async)\"\n >\n Click \"Edit widgets\" to unlock\n </p>\n <div>\n <button\n class=\"btn btn-primary m-t-16\"\n title=\"{{ 'Add widget' | translate }}\"\n type=\"button\"\n [disabled]=\"settings.isDisabled || !(editMode$ | async)\"\n (click)=\"onAddWidget.emit()\"\n data-cy=\"c8y-widgets-dashboard--add-widget\"\n translate\n >\n Add widget\n </button>\n </div>\n <p c8y-guide-docs>\n <small\n translate\n ngNonBindable\n >\n Find out more in the\n <a c8y-guide-href=\"/docs/cockpit/working-with-dashboards\">user documentation</a>\n .\n </small>\n </p>\n </div>\n </c8y-ui-empty-state>\n\n <c8y-dashboard\n [columns]=\"settings.columns\"\n (dashboardChange)=\"onChangeDashboard.emit($event)\"\n #dashboard\n >\n <c8y-dashboard-child\n [class]=\"widget.classes\"\n *ngFor=\"let widget of widgetsToDisplay\"\n [x]=\"widget._x\"\n [y]=\"widget._y\"\n [width]=\"widget._width || settings.defaultWidth\"\n [height]=\"widget._height || settings.defaultHeight\"\n [margin]=\"settings.widgetMargin\"\n [data]=\"widget\"\n [useIntersection]=\"true\"\n [editMode]=\"editMode$ | async\"\n (changeStart)=\"onChangeStart.emit({ widget: widget, source: child, dashboard: dashboard })\"\n (changeEnd)=\"onChangeEnd.emit({ widget: widget, source: child, dashboard: dashboard })\"\n (toggleFullscreen)=\"toggleFullscreenOnWidget(child)\"\n [canToggleFullscreen]=\"!(inFullScreen$ | async) || widgetInFullscreenMode\"\n #child\n >\n <c8y-dashboard-child-title>\n <span\n data-cy=\"c8y-dashboard-list--device-widget\"\n *ngIf=\"settings.translateWidgetTitle\"\n >\n {{ widget.title | translate }}\n </span>\n <span *ngIf=\"!settings.translateWidgetTitle\">\n {{ widget.title }}\n </span>\n </c8y-dashboard-child-title>\n <c8y-dashboard-child-action *ngIf=\"onEditWidget.observers.length\">\n <button\n title=\"{{ 'Edit widget' | translate }}\"\n type=\"button\"\n data-cy=\"widgets-dashboard--Edit-widget\"\n (click)=\"onEditWidget.emit({ widget: widget, source: child, dashboard: dashboard })\"\n >\n <i c8yIcon=\"pencil\"></i>\n <span translate>Edit</span>\n </button>\n </c8y-dashboard-child-action>\n <c8y-dashboard-child-action *ngIf=\"onDeleteWidget.observers.length\">\n <button\n title=\"{{ 'Remove widget' | translate }}\"\n type=\"button\"\n data-cy=\"c8y-widgets-dashboard--remove-widget\"\n (click)=\"onDeleteWidget.emit({ widget: widget, source: child, dashboard: dashboard })\"\n >\n <i c8yIcon=\"delete\"></i>\n <span translate>Remove</span>\n </button>\n </c8y-dashboard-child-action>\n\n <c8y-widget-time-context\n *ngIf=\"\n (widget.config?.displaySettings?.globalTimeContext ||\n widget.config?.displaySettings?.globalRealtimeContext) &&\n (widget.config.widgetInstanceGlobalTimeContext ||\n widget.config.widgetInstanceGlobalAutoRefreshContext)\n \"\n (dateContextChange)=\"updateWidgetConfig($event, widget)\"\n [canDecouple]=\"widget.config.canDecoupleGlobalTimeContext\"\n [displaySettings]=\"widget.config.displaySettings\"\n [hidden]=\"editMode$ | async\"\n ></c8y-widget-time-context>\n\n <c8y-widget-auto-refresh-context\n *ngIf=\"\n widget?.config?.widgetInstanceGlobalAutoRefreshContext &&\n widget.config?.displaySettings.globalAutoRefreshContext\n \"\n [editMode$]=\"editMode$\"\n ></c8y-widget-auto-refresh-context>\n\n <c8y-dynamic-component\n [componentId]=\"widget.componentId || widget.name\"\n [config]=\"\n widget.templateUrl || widget.widgetComponent\n ? { child: widget, dashboard: contextDashboard, context: context }\n : widget.config\n \"\n *ngIf=\"child.intersected\"\n (updateWidgetClasses)=\"updateWidgetClasses(widget, $event)\"\n ></c8y-dynamic-component>\n </c8y-dashboard-child>\n </c8y-dashboard>\n </ng-container>\n</ng-container>\n" }]
|
|
30377
30424
|
}], ctorParameters: () => [{ type: DynamicComponentService }, { type: i1$1.TranslateService }, { type: i1$5.ActivatedRoute }, { type: ModalService }, { type: WidgetGlobalAutoRefreshService }], propDecorators: { widgets: [{
|
|
30378
30425
|
type: Input
|
|
30379
30426
|
}], context: [{
|