@c8y/ngx-components 1023.92.0 → 1023.97.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/ai/agents/scada/index.d.ts +10 -0
- package/ai/agents/scada/index.d.ts.map +1 -0
- package/ai/ai-chat/index.d.ts +1 -1
- package/ai/ai-chat/index.d.ts.map +1 -1
- package/alarms/index.d.ts.map +1 -1
- package/computed-asset-properties/index.d.ts +89 -1
- package/computed-asset-properties/index.d.ts.map +1 -1
- package/context-dashboard/device/view/index.d.ts +24 -1
- package/context-dashboard/device/view/index.d.ts.map +1 -1
- package/context-dashboard/index.d.ts +27 -11
- package/context-dashboard/index.d.ts.map +1 -1
- package/echart/index.d.ts.map +1 -1
- package/fesm2022/c8y-ngx-components-ai-agent-chat.mjs +2 -2
- package/fesm2022/c8y-ngx-components-ai-agent-chat.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-ai-agents-scada.mjs +893 -0
- package/fesm2022/c8y-ngx-components-ai-agents-scada.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-ai-ai-chat.mjs +1 -0
- package/fesm2022/c8y-ngx-components-ai-ai-chat.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-alarms.mjs +12 -5
- package/fesm2022/c8y-ngx-components-alarms.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-asset-properties.mjs +2 -2
- package/fesm2022/c8y-ngx-components-asset-properties.mjs.map +1 -1
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-c8y-ngx-components-computed-asset-properties-Cy9R6Ixb.mjs → c8y-ngx-components-computed-asset-properties-c8y-ngx-components-computed-asset-properties-CHZX7ALq.mjs} +10 -9
- package/fesm2022/c8y-ngx-components-computed-asset-properties-c8y-ngx-components-computed-asset-properties-CHZX7ALq.mjs.map +1 -0
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-fieldbus-item-status-config.component-LrmlAh6V.mjs → c8y-ngx-components-computed-asset-properties-fieldbus-item-status-config.component-DgWGXzEx.mjs} +2 -2
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-fieldbus-item-status-config.component-LrmlAh6V.mjs.map → c8y-ngx-components-computed-asset-properties-fieldbus-item-status-config.component-DgWGXzEx.mjs.map} +1 -1
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-last-measurement-config.component-f1u1TcCl.mjs → c8y-ngx-components-computed-asset-properties-last-measurement-config.component-yfc45-l_.mjs} +2 -2
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-last-measurement-config.component-f1u1TcCl.mjs.map → c8y-ngx-components-computed-asset-properties-last-measurement-config.component-yfc45-l_.mjs.map} +1 -1
- package/fesm2022/c8y-ngx-components-computed-asset-properties.mjs +1 -1
- package/fesm2022/c8y-ngx-components-context-dashboard-device-view.mjs +21 -3
- package/fesm2022/c8y-ngx-components-context-dashboard-device-view.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-context-dashboard-devicemanagement.mjs +2 -2
- package/fesm2022/c8y-ngx-components-context-dashboard-devicemanagement.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-context-dashboard.mjs +69 -51
- package/fesm2022/c8y-ngx-components-context-dashboard.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-echart.mjs +52 -36
- package/fesm2022/c8y-ngx-components-echart.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-global-context.mjs +112 -22
- package/fesm2022/c8y-ngx-components-global-context.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-map.mjs +15 -0
- package/fesm2022/c8y-ngx-components-map.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-repository-configuration.mjs +292 -115
- package/fesm2022/c8y-ngx-components-repository-configuration.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-repository-firmware.mjs +2 -2
- package/fesm2022/c8y-ngx-components-repository-firmware.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-repository-software.mjs +1 -1
- package/fesm2022/c8y-ngx-components-repository-software.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-upgrade.mjs +12 -1
- package/fesm2022/c8y-ngx-components-upgrade.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-html-widget.mjs +2 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-html-widget.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-scada.mjs +169 -0
- package/fesm2022/c8y-ngx-components-widgets-definitions-scada.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-widgets-definitions.mjs +2 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-exports.mjs +8 -1
- package/fesm2022/c8y-ngx-components-widgets-exports.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-alarms.mjs +2 -2
- package/fesm2022/c8y-ngx-components-widgets-implementations-alarms.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs +3 -3
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-list.mjs +2 -2
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-list.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-table.mjs +2 -2
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-table.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-events.mjs +2 -2
- package/fesm2022/c8y-ngx-components-widgets-implementations-events.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-html-widget.mjs +90 -32
- package/fesm2022/c8y-ngx-components-widgets-implementations-html-widget.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-kpi.mjs +2 -2
- package/fesm2022/c8y-ngx-components-widgets-implementations-kpi.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-scada.mjs +1698 -0
- package/fesm2022/c8y-ngx-components-widgets-implementations-scada.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components.mjs +220 -45
- package/fesm2022/c8y-ngx-components.mjs.map +1 -1
- package/global-context/index.d.ts +58 -3
- package/global-context/index.d.ts.map +1 -1
- package/index.d.ts +79 -22
- package/index.d.ts.map +1 -1
- package/locales/de.po +165 -3
- package/locales/es.po +165 -3
- package/locales/fr.po +165 -3
- package/locales/ja_JP.po +165 -3
- package/locales/ko.po +165 -3
- package/locales/locales.pot +156 -3
- package/locales/nl.po +165 -3
- package/locales/pl.po +165 -3
- package/locales/pt_BR.po +165 -3
- package/locales/zh_CN.po +165 -3
- package/locales/zh_TW.po +165 -3
- package/map/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/repository/configuration/index.d.ts +64 -39
- package/repository/configuration/index.d.ts.map +1 -1
- package/upgrade/index.d.ts +1 -0
- package/upgrade/index.d.ts.map +1 -1
- package/widgets/cockpit-exports/index.d.ts +6 -0
- package/widgets/cockpit-exports/index.d.ts.map +1 -1
- package/widgets/definitions/index.d.ts +1 -0
- package/widgets/definitions/index.d.ts.map +1 -1
- package/widgets/definitions/scada/index.d.ts +6 -0
- package/widgets/definitions/scada/index.d.ts.map +1 -0
- package/widgets/device-management-exports/index.d.ts +6 -0
- package/widgets/device-management-exports/index.d.ts.map +1 -1
- package/widgets/exports/index.d.ts +8 -1
- package/widgets/exports/index.d.ts.map +1 -1
- package/widgets/implementations/html-widget/index.d.ts +30 -12
- package/widgets/implementations/html-widget/index.d.ts.map +1 -1
- package/widgets/implementations/scada/index.d.ts +415 -0
- package/widgets/implementations/scada/index.d.ts.map +1 -0
- package/fesm2022/c8y-ngx-components-computed-asset-properties-c8y-ngx-components-computed-asset-properties-Cy9R6Ixb.mjs.map +0 -1
|
@@ -4,7 +4,7 @@ import * as i2 from '@c8y/ngx-components';
|
|
|
4
4
|
import { IconDirective, C8yTranslatePipe, Permissions, ContextRouteService, Status, NavigatorNode, NEW_DASHBOARD_ROUTER_STATE_PROP, getActivatedRoute, ViewContext, TabsOutletComponent, memoize, hookGeneric, ExtensionPointForPlugins, fromTriggerOnce, getInjectedHooks, stateToFactory, ListGroupModule, C8yComponentOutlet, AlertService, C8yTranslateDirective, DynamicComponentModule, DynamicComponentComponent, sortByPriority, isPromise, CoreModule, WIDGET_CONFIGURATION_GRID_SIZE, HighlightComponent, EmptyStateComponent, FormGroupComponent, RequiredInputPlaceholderDirective, ProductExperienceDirective, ResizableGridComponent, DashboardChildChange, CopyDashboardDisabledReason, TitleComponent, ActionBarItemComponent, HelpComponent, WidgetsDashboardComponent, DatePipe, hookRoute, hookTab, PreviewService, hookNavigator, ManagedObjectRealtimeService, BottomDrawerService, ClipboardService, InputGroupEditableComponent, MessageDirective } from '@c8y/ngx-components';
|
|
5
5
|
import * as i1 from '@angular/router';
|
|
6
6
|
import { RouterOutlet, ActivatedRoute, RouterModule } from '@angular/router';
|
|
7
|
-
import { of, Subject, from, combineLatest, map as map$1, merge, BehaviorSubject, tap as tap$1, withLatestFrom, mergeMap as mergeMap$1, shareReplay as shareReplay$1, scan, debounceTime, isObservable, iif, timer, filter as filter$1, switchMap as switchMap$1, take, forkJoin, firstValueFrom } from 'rxjs';
|
|
7
|
+
import { of, Subject, from, combineLatest, map as map$1, merge, BehaviorSubject, tap as tap$1, withLatestFrom, mergeMap as mergeMap$1, shareReplay as shareReplay$1, scan, debounceTime, isObservable, iif, timer, filter as filter$1, switchMap as switchMap$1, take, EMPTY, defer, forkJoin, firstValueFrom } from 'rxjs';
|
|
8
8
|
import { gettext } from '@c8y/ngx-components/gettext';
|
|
9
9
|
import { __decorate, __metadata } from 'tslib';
|
|
10
10
|
import * as i3 from '@angular/common';
|
|
@@ -382,7 +382,7 @@ class ContextDashboardService {
|
|
|
382
382
|
this.tabs.refresh();
|
|
383
383
|
});
|
|
384
384
|
}
|
|
385
|
-
catch
|
|
385
|
+
catch {
|
|
386
386
|
// intended empty
|
|
387
387
|
}
|
|
388
388
|
}
|
|
@@ -402,17 +402,17 @@ class ContextDashboardService {
|
|
|
402
402
|
}
|
|
403
403
|
return dashboard;
|
|
404
404
|
}
|
|
405
|
-
activateDashboards(route, types) {
|
|
405
|
+
activateDashboards(route, types, options) {
|
|
406
406
|
const { dashboardId } = route.params;
|
|
407
407
|
if (dashboardId) {
|
|
408
|
-
return this.getDashboard$(dashboardId, types, route.parent.data.contextData).pipe(tap(dashboard => {
|
|
408
|
+
return this.getDashboard$(dashboardId, types, route.parent.data.contextData, options).pipe(tap(dashboard => {
|
|
409
409
|
route.data = { dashboard };
|
|
410
410
|
}), map(() => true), catchError(() => {
|
|
411
411
|
return of(false);
|
|
412
412
|
}));
|
|
413
413
|
}
|
|
414
414
|
const { contextData: mo } = this.contextRouteService.getContextData(route);
|
|
415
|
-
this.dashboardTabs$ = this.getTabs$(mo, types, route?.parent?.data);
|
|
415
|
+
this.dashboardTabs$ = this.getTabs$(mo, types, route?.parent?.data, options);
|
|
416
416
|
return this.dashboardTabs$;
|
|
417
417
|
}
|
|
418
418
|
getDashboard(name, defaultWidgets) {
|
|
@@ -540,10 +540,10 @@ class ContextDashboardService {
|
|
|
540
540
|
return widget;
|
|
541
541
|
}), 'id');
|
|
542
542
|
}
|
|
543
|
-
getDashboard$(dashboardIdOrName, dashboardType, mo) {
|
|
543
|
+
getDashboard$(dashboardIdOrName, dashboardType, mo, options) {
|
|
544
544
|
const cache = this.cache.get(dashboardIdOrName);
|
|
545
545
|
const dashboards = mo
|
|
546
|
-
? this.getContextDashboards(mo, dashboardType)
|
|
546
|
+
? this.getContextDashboards(mo, dashboardType, options)
|
|
547
547
|
: this.getNamedDashboard(dashboardIdOrName);
|
|
548
548
|
const cacheRefresh = this.getContextDashboards$(dashboards).pipe(tap(dashboard => this.cacheDashboard(dashboard)), filter(dashboard => dashboard.id === dashboardIdOrName ||
|
|
549
549
|
has(dashboard, `${this.FRAGMENT_NAME}${this.INDEX_SPLIT}${ContextDashboardType.Named}${this.INDEX_SPLIT}${dashboardIdOrName}`)));
|
|
@@ -660,7 +660,7 @@ class ContextDashboardService {
|
|
|
660
660
|
return null;
|
|
661
661
|
}
|
|
662
662
|
}
|
|
663
|
-
async getContextDashboards(mo, dashboardType) {
|
|
663
|
+
async getContextDashboards(mo, dashboardType, options) {
|
|
664
664
|
const filterCriteria = dashboardType.map(t => ({
|
|
665
665
|
// it's necessary to wrap fragment in quotes because dashboard type can contain spaces
|
|
666
666
|
__has: `'${this.createDashboardFragment(mo, t)}'`
|
|
@@ -678,9 +678,11 @@ class ContextDashboardService {
|
|
|
678
678
|
? [...filterCriteria, typeFilterCriteria]
|
|
679
679
|
: filterCriteria;
|
|
680
680
|
const query = this.queriesUtil.buildQuery({ __filter: { __or: finalFilterCriteria } });
|
|
681
|
+
const strictAppFilter = !!options?.strictAppFilter;
|
|
681
682
|
const now = Date.now();
|
|
682
683
|
const cacheHasValidResponse = this.contextDashboardsCache &&
|
|
683
684
|
this.contextDashboardsCache.query === query &&
|
|
685
|
+
this.contextDashboardsCache.strictAppFilter === strictAppFilter &&
|
|
684
686
|
now - this.contextDashboardsCache.timestamp < this.CACHE_TIMEOUT;
|
|
685
687
|
if (cacheHasValidResponse) {
|
|
686
688
|
return this.contextDashboardsCache.result;
|
|
@@ -690,7 +692,8 @@ class ContextDashboardService {
|
|
|
690
692
|
}
|
|
691
693
|
this.contextDashboardsCache = {
|
|
692
694
|
query,
|
|
693
|
-
|
|
695
|
+
strictAppFilter,
|
|
696
|
+
result: this.listAndFilterByApplication(query, strictAppFilter),
|
|
694
697
|
timestamp: now
|
|
695
698
|
};
|
|
696
699
|
return this.contextDashboardsCache.result;
|
|
@@ -890,8 +893,8 @@ class ContextDashboardService {
|
|
|
890
893
|
replaceContextInIdsObj(ids, newContext, oldContext) {
|
|
891
894
|
return Object.fromEntries(Object.entries(ids).map(([key, id]) => [key, id === oldContext.id ? newContext.id : id]));
|
|
892
895
|
}
|
|
893
|
-
getTabs$(mo, dashboardType, context) {
|
|
894
|
-
const dashboards = this.getContextDashboards(mo, dashboardType);
|
|
896
|
+
getTabs$(mo, dashboardType, context, options) {
|
|
897
|
+
const dashboards = this.getContextDashboards(mo, dashboardType, options);
|
|
895
898
|
return this.getContextDashboards$(dashboards).pipe(mergeMap(dashboard => this.verifyDashboardAvailability$(dashboard)),
|
|
896
899
|
// Due to MTM-62321 named context dashboards included fragments for device and groups.
|
|
897
900
|
// therefore some device-info dashboards (from DM app) might occur in cockpit on device level.
|
|
@@ -1014,10 +1017,15 @@ class ContextDashboardService {
|
|
|
1014
1017
|
* For dashboard views within applications, filter dashboards by application association.
|
|
1015
1018
|
* Do it on the client side as the inventory query doesn't perform well on not indexed fragments.
|
|
1016
1019
|
*/
|
|
1017
|
-
async listAndFilterByApplication(query) {
|
|
1020
|
+
async listAndFilterByApplication(query, strictAppFilter = false) {
|
|
1018
1021
|
const dashboards = await this.inventory.list({ query, pageSize: this.DEFAULT_PAGESIZE });
|
|
1022
|
+
const appKey = this.appStateService?.currentApplication?.value?.key;
|
|
1019
1023
|
dashboards.data = dashboards.data.filter(dashboard => {
|
|
1020
|
-
|
|
1024
|
+
const appliedTo = Array.from(dashboard[this.APPLIED_TO_FRAGMENT] || []);
|
|
1025
|
+
if (strictAppFilter) {
|
|
1026
|
+
return !!appKey && appliedTo.includes(appKey);
|
|
1027
|
+
}
|
|
1028
|
+
return appliedTo.includes(appKey) || !dashboard[this.APPLIED_TO_FRAGMENT];
|
|
1021
1029
|
});
|
|
1022
1030
|
return dashboards;
|
|
1023
1031
|
}
|
|
@@ -1555,7 +1563,7 @@ class DashboardDetailComponent {
|
|
|
1555
1563
|
this.tabs = this.dashboardDetailService.getTabs();
|
|
1556
1564
|
}
|
|
1557
1565
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: DashboardDetailComponent, deps: [{ token: ContextDashboardService }, { token: i2$1.TranslateService }, { token: i2.ContextRouteService }, { token: i1.ActivatedRoute }, { token: i2.TabsService }, { token: i1.Router }, { token: i1$1.InventoryService }, { token: i1.ActivatedRoute }, { token: DashboardDetailService }, { token: i2.AppStateService }, { token: i2.GroupService }, { token: i2.ModalService }, { token: i2.GainsightService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1558
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: DashboardDetailComponent, isStandalone: true, selector: "c8y-dashboard-detail", inputs: { isReport: "isReport", deviceType: "deviceType", context: "context", mo: "mo", dashboard: "dashboard", isNamedDashboard: "isNamedDashboard", hideAvailability: "hideAvailability" }, outputs: { dashboardSaved: "dashboardSaved", previewChanged: "previewChanged" }, providers: [DashboardDetailService], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"collapse c8y-top-drawer\"\n [collapse]=\"isCollapsed\"\n [isAnimated]=\"
|
|
1566
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: DashboardDetailComponent, isStandalone: true, selector: "c8y-dashboard-detail", inputs: { isReport: "isReport", deviceType: "deviceType", context: "context", mo: "mo", dashboard: "dashboard", isNamedDashboard: "isNamedDashboard", hideAvailability: "hideAvailability" }, outputs: { dashboardSaved: "dashboardSaved", previewChanged: "previewChanged" }, providers: [DashboardDetailService], usesOnChanges: true, ngImport: i0, template: "<!--\n [isAnimated]=\"false\": ngx-bootstrap's CollapseDirective builds an Angular animation\n player on each open/close but never destroys it on teardown, so the root animation\n engine retains the player and its onDone closure pins this directive \u2014 and via the\n view tree the whole c8y-context-dashboard \u2014 on every \"Dashboard settings\" open (leak).\n-->\n<div\n class=\"collapse c8y-top-drawer\"\n [collapse]=\"isCollapsed\"\n [isAnimated]=\"false\"\n>\n <div class=\"p-t-16 p-b-16 p-l-24 p-r-24 separator-bottom\">\n <span class=\"h4\">{{ 'Dashboard settings' | translate }}</span>\n </div>\n\n @if (!isCollapsed) {\n <div class=\"d-flex\">\n <c8y-tabs-outlet\n class=\"c8y-top-drawer--tabs\"\n [tabs]=\"tabs\"\n [outletName]=\"TABS_OUTLET_NAME\"\n [orientation]=\"'vertical'\"\n [openFirstTab]=\"true\"\n ></c8y-tabs-outlet>\n\n <div\n class=\"inner-scroll c8y-top-drawer__tabs-container flex-grow p-l-24 p-r-lg-32 p-r-xs-24 p-r-sm-24\"\n >\n <router-outlet name=\"dashboard-details\"></router-outlet>\n </div>\n </div>\n }\n\n <div class=\"c8y-top-drawer--footer\">\n <button\n class=\"btn btn-default\"\n title=\"{{ 'Cancel' | translate }}\"\n type=\"button\"\n data-cy=\"dashboard-detail--cancel-dashboard\"\n (click)=\"cancel()\"\n >\n {{ 'Cancel' | translate }}\n </button>\n <button\n class=\"btn btn-primary\"\n title=\"{{ 'Save' | translate }}\"\n type=\"button\"\n data-cy=\"dashboard-detail--save-dashboard\"\n (click)=\"save()\"\n [disabled]=\"\n ((dashboardDetailsForm?.invalid || dashboardDetailsForm?.pristine) && this.isEdit) ||\n dashboardDetailService.saveButtonDisabled\n \"\n >\n {{ 'Save' | translate }}\n </button>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: CollapseDirective, selector: "[collapse]", inputs: ["display", "isAnimated", "collapse"], outputs: ["collapsed", "collapses", "expanded", "expands"], exportAs: ["bs-collapse"] }, { kind: "component", type: TabsOutletComponent, selector: "c8y-tabs-outlet,c8y-ui-tabs", inputs: ["tabs", "orientation", "navigatorOpen", "outletName", "context", "openFirstTab", "hasHeader"] }, { kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }] }); }
|
|
1559
1567
|
}
|
|
1560
1568
|
__decorate([
|
|
1561
1569
|
memoize(),
|
|
@@ -1565,7 +1573,7 @@ __decorate([
|
|
|
1565
1573
|
], DashboardDetailComponent.prototype, "convertStringToHash", null);
|
|
1566
1574
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: DashboardDetailComponent, decorators: [{
|
|
1567
1575
|
type: Component,
|
|
1568
|
-
args: [{ selector: 'c8y-dashboard-detail', providers: [DashboardDetailService], imports: [CollapseDirective, TabsOutletComponent, RouterOutlet, C8yTranslatePipe], template: "<div\n class=\"collapse c8y-top-drawer\"\n [collapse]=\"isCollapsed\"\n [isAnimated]=\"
|
|
1576
|
+
args: [{ selector: 'c8y-dashboard-detail', providers: [DashboardDetailService], imports: [CollapseDirective, TabsOutletComponent, RouterOutlet, C8yTranslatePipe], template: "<!--\n [isAnimated]=\"false\": ngx-bootstrap's CollapseDirective builds an Angular animation\n player on each open/close but never destroys it on teardown, so the root animation\n engine retains the player and its onDone closure pins this directive \u2014 and via the\n view tree the whole c8y-context-dashboard \u2014 on every \"Dashboard settings\" open (leak).\n-->\n<div\n class=\"collapse c8y-top-drawer\"\n [collapse]=\"isCollapsed\"\n [isAnimated]=\"false\"\n>\n <div class=\"p-t-16 p-b-16 p-l-24 p-r-24 separator-bottom\">\n <span class=\"h4\">{{ 'Dashboard settings' | translate }}</span>\n </div>\n\n @if (!isCollapsed) {\n <div class=\"d-flex\">\n <c8y-tabs-outlet\n class=\"c8y-top-drawer--tabs\"\n [tabs]=\"tabs\"\n [outletName]=\"TABS_OUTLET_NAME\"\n [orientation]=\"'vertical'\"\n [openFirstTab]=\"true\"\n ></c8y-tabs-outlet>\n\n <div\n class=\"inner-scroll c8y-top-drawer__tabs-container flex-grow p-l-24 p-r-lg-32 p-r-xs-24 p-r-sm-24\"\n >\n <router-outlet name=\"dashboard-details\"></router-outlet>\n </div>\n </div>\n }\n\n <div class=\"c8y-top-drawer--footer\">\n <button\n class=\"btn btn-default\"\n title=\"{{ 'Cancel' | translate }}\"\n type=\"button\"\n data-cy=\"dashboard-detail--cancel-dashboard\"\n (click)=\"cancel()\"\n >\n {{ 'Cancel' | translate }}\n </button>\n <button\n class=\"btn btn-primary\"\n title=\"{{ 'Save' | translate }}\"\n type=\"button\"\n data-cy=\"dashboard-detail--save-dashboard\"\n (click)=\"save()\"\n [disabled]=\"\n ((dashboardDetailsForm?.invalid || dashboardDetailsForm?.pristine) && this.isEdit) ||\n dashboardDetailService.saveButtonDisabled\n \"\n >\n {{ 'Save' | translate }}\n </button>\n </div>\n</div>\n" }]
|
|
1569
1577
|
}], ctorParameters: () => [{ type: ContextDashboardService }, { type: i2$1.TranslateService }, { type: i2.ContextRouteService }, { type: i1.ActivatedRoute }, { type: i2.TabsService }, { type: i1.Router }, { type: i1$1.InventoryService }, { type: i1.ActivatedRoute }, { type: DashboardDetailService }, { type: i2.AppStateService }, { type: i2.GroupService }, { type: i2.ModalService }, { type: i2.GainsightService }], propDecorators: { isReport: [{
|
|
1570
1578
|
type: Input
|
|
1571
1579
|
}], deviceType: [{
|
|
@@ -4300,7 +4308,9 @@ const canActivateDeviceInfo = (route, _) => {
|
|
|
4300
4308
|
return previewFeatureService.getState$('ui.dm-dashboard-manager').pipe(switchMap$1(isPreviewEnabled => {
|
|
4301
4309
|
return isPreviewEnabled
|
|
4302
4310
|
? contextDashboardService
|
|
4303
|
-
.activateDashboards(route, [ContextDashboardType.Device, ContextDashboardType.Type]
|
|
4311
|
+
.activateDashboards(route, [ContextDashboardType.Device, ContextDashboardType.Type], {
|
|
4312
|
+
strictAppFilter: true
|
|
4313
|
+
})
|
|
4304
4314
|
.pipe(map$1(tabs => !(Array.isArray(tabs) && tabs.length > 0)))
|
|
4305
4315
|
: of(true);
|
|
4306
4316
|
}), take(1));
|
|
@@ -4487,15 +4497,16 @@ class AssetPropertyMappingsService {
|
|
|
4487
4497
|
*
|
|
4488
4498
|
* @param mappings - The asset property mappings configuration.
|
|
4489
4499
|
* @param realtimeControl$ - Observable that controls realtime notifications (true = enabled, false = disabled, default = enabled).
|
|
4500
|
+
* @param refresh$ - Optional trigger; each emission forces a fresh REST fetch of all property values.
|
|
4490
4501
|
* @returns Observable emitting updated asset property values as they change.
|
|
4491
4502
|
*/
|
|
4492
|
-
getValues$(mappings, realtimeControl$ = of(true)) {
|
|
4503
|
+
getValues$(mappings, realtimeControl$ = of(true), refresh$ = EMPTY) {
|
|
4493
4504
|
if (!mappings) {
|
|
4494
4505
|
return of({});
|
|
4495
4506
|
}
|
|
4496
4507
|
const { regular, computed } = this.groupByType(mappings);
|
|
4497
4508
|
const _regularByAssetId = this.groupByAssetId(regular);
|
|
4498
|
-
return merge(...computed.map(mapping => this.getComputedPropertyValues$(mapping, realtimeControl$)), ...Object.entries(_regularByAssetId).map(([assetId, mappings]) => this.getRegularPropertyValues$(assetId, mappings, realtimeControl$))).pipe(scan((acc, update) => ({ ...acc, ...update }), {}), startWith({}));
|
|
4509
|
+
return merge(...computed.map(mapping => this.getComputedPropertyValues$(mapping, realtimeControl$, refresh$)), ...Object.entries(_regularByAssetId).map(([assetId, mappings]) => this.getRegularPropertyValues$(assetId, mappings, realtimeControl$, refresh$))).pipe(scan((acc, update) => ({ ...acc, ...update }), {}), startWith({}));
|
|
4499
4510
|
}
|
|
4500
4511
|
groupByType(mappings) {
|
|
4501
4512
|
const regular = [];
|
|
@@ -4525,7 +4536,7 @@ class AssetPropertyMappingsService {
|
|
|
4525
4536
|
return acc;
|
|
4526
4537
|
}, {});
|
|
4527
4538
|
}
|
|
4528
|
-
getComputedPropertyValues$(mapping, realtimeControl$) {
|
|
4539
|
+
getComputedPropertyValues$(mapping, realtimeControl$, refresh$) {
|
|
4529
4540
|
if (!mapping.assetProperty) {
|
|
4530
4541
|
return of(null);
|
|
4531
4542
|
}
|
|
@@ -4552,28 +4563,21 @@ class AssetPropertyMappingsService {
|
|
|
4552
4563
|
return of(value);
|
|
4553
4564
|
}
|
|
4554
4565
|
}))));
|
|
4555
|
-
return
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
return from(this.inventory.detail(assetId, { withLatestValues: true })).pipe(switchMap(initial => this.moRealtime.onAll$(assetId).pipe(map(update => update?.data), startWith(initial?.data))));
|
|
4568
|
-
}
|
|
4569
|
-
}), map(asset => mappings.reduce((acc, mapping) => ({
|
|
4566
|
+
return combineLatest([
|
|
4567
|
+
realtimeControl$.pipe(distinctUntilChanged()),
|
|
4568
|
+
refresh$.pipe(startWith(undefined))
|
|
4569
|
+
]).pipe(switchMap(([enabled]) => (enabled ? computedValue$ : computedValue$.pipe(take$1(1)))), map(value => ({ [mapping.name]: value })), shareReplay({ bufferSize: 1, refCount: true }));
|
|
4570
|
+
}
|
|
4571
|
+
getRegularPropertyValues$(assetId, mappings, realtimeControl$, refresh$) {
|
|
4572
|
+
const fetchAsset$ = defer(() => from(this.inventory.detail(assetId, { withLatestValues: true }))).pipe(map(res => res?.data));
|
|
4573
|
+
const liveAsset$ = (initial) => this.moRealtime.onAll$(assetId).pipe(map(update => update?.data), startWith(initial));
|
|
4574
|
+
return combineLatest([
|
|
4575
|
+
realtimeControl$.pipe(distinctUntilChanged()),
|
|
4576
|
+
refresh$.pipe(startWith(undefined))
|
|
4577
|
+
]).pipe(switchMap(([enabled]) => (enabled ? fetchAsset$.pipe(switchMap(liveAsset$)) : fetchAsset$)), map(asset => mappings.reduce((acc, mapping) => ({
|
|
4570
4578
|
...acc,
|
|
4571
4579
|
[mapping.name]: this.getRegularPropertyValue(asset, mapping.assetProperty)
|
|
4572
|
-
}), {})),
|
|
4573
|
-
// eslint-disable-next-line no-console
|
|
4574
|
-
console.warn(`Error in controlled asset stream for asset ${assetId}:`, err);
|
|
4575
|
-
return of(mappings.reduce((acc, m) => ({ ...acc, [m.name]: null }), {}));
|
|
4576
|
-
}), shareReplay({ bufferSize: 1, refCount: true }));
|
|
4580
|
+
}), {})), shareReplay({ bufferSize: 1, refCount: true }));
|
|
4577
4581
|
}
|
|
4578
4582
|
getRegularPropertyValue(asset, property) {
|
|
4579
4583
|
if (!asset || !property) {
|
|
@@ -4699,6 +4703,10 @@ class AssetPropertyMappingsComponent {
|
|
|
4699
4703
|
this.allowAddingNewMappings = input(true, ...(ngDevMode ? [{ debugName: "allowAddingNewMappings" }] : []));
|
|
4700
4704
|
this.allowRenamingMappings = input(true, ...(ngDevMode ? [{ debugName: "allowRenamingMappings" }] : []));
|
|
4701
4705
|
this.allowRelabellingMappings = input(true, ...(ngDevMode ? [{ debugName: "allowRelabellingMappings" }] : []));
|
|
4706
|
+
/** When set, mapping names must match this regex. Validated on rename. */
|
|
4707
|
+
this.mappingNameFormatRegex = input(null, ...(ngDevMode ? [{ debugName: "mappingNameFormatRegex" }] : []));
|
|
4708
|
+
/** Error message shown when a name fails the mappingNameFormatRegex check. */
|
|
4709
|
+
this.mappingNameFormatErrorMessage = input(gettext('Name does not match the required format.'), ...(ngDevMode ? [{ debugName: "mappingNameFormatErrorMessage" }] : []));
|
|
4702
4710
|
this.allowEditingMappings = input(true, ...(ngDevMode ? [{ debugName: "allowEditingMappings" }] : []));
|
|
4703
4711
|
this.allowRemovingMappings = input(true, ...(ngDevMode ? [{ debugName: "allowRemovingMappings" }] : []));
|
|
4704
4712
|
this.showLabels = input(true, ...(ngDevMode ? [{ debugName: "showLabels" }] : []));
|
|
@@ -4711,10 +4719,14 @@ class AssetPropertyMappingsComponent {
|
|
|
4711
4719
|
* Callback to transform a mapping into the text that gets copied to the clipboard.
|
|
4712
4720
|
* Exposed as an input so widget config factories can override the default (e.g. to
|
|
4713
4721
|
* produce a template expression like `${this.c8yProperties?.temperature}`).
|
|
4722
|
+
* The second argument is the current widget config, which can be used to adjust
|
|
4723
|
+
* the output based on widget-specific settings (e.g. legacy mode).
|
|
4714
4724
|
*/
|
|
4715
4725
|
this.onBeforeCopyMappingToClipboard = input((mapping) => String(mapping.name), ...(ngDevMode ? [{ debugName: "onBeforeCopyMappingToClipboard" }] : []));
|
|
4716
|
-
this.emptyStateTitle = gettext('No asset property mappings');
|
|
4717
|
-
this.emptyStateSubtitle = gettext('Add first asset property mapping.');
|
|
4726
|
+
this.emptyStateTitle = input(gettext('No asset property mappings'), ...(ngDevMode ? [{ debugName: "emptyStateTitle" }] : []));
|
|
4727
|
+
this.emptyStateSubtitle = input(gettext('Add first asset property mapping.'), ...(ngDevMode ? [{ debugName: "emptyStateSubtitle" }] : []));
|
|
4728
|
+
/** Message shown in the section's feedback area. Available placeholder: {{ count }} */
|
|
4729
|
+
this.feedbackMessage = input(gettext('{{ count }} selected'), ...(ngDevMode ? [{ debugName: "feedbackMessage" }] : []));
|
|
4718
4730
|
this.mappings$ = this.widgetConfigService.currentConfig$.pipe(map$1(config => get(config, this.widgetConfigPath())));
|
|
4719
4731
|
this.keys$ = this.mappings$.pipe(map$1(mappings => Object.keys(mappings || {}).sort((a, b) => a.localeCompare(b))));
|
|
4720
4732
|
this.mappingsSignal = toSignal(this.mappings$, { initialValue: null });
|
|
@@ -4753,7 +4765,7 @@ class AssetPropertyMappingsComponent {
|
|
|
4753
4765
|
const config = await firstValueFrom(this.widgetConfigService.currentConfig$);
|
|
4754
4766
|
if (!get(config, this.widgetConfigPath())) {
|
|
4755
4767
|
const newConfig = { ...config };
|
|
4756
|
-
const mappings = structuredClone(this.initialMappings());
|
|
4768
|
+
const mappings = structuredClone(this.initialMappings() ?? {});
|
|
4757
4769
|
for (const [key, mapping] of Object.entries(mappings)) {
|
|
4758
4770
|
if (mapping.assetProperty && !mapping.assetProperty.asset) {
|
|
4759
4771
|
if (!config.device) {
|
|
@@ -4815,7 +4827,7 @@ class AssetPropertyMappingsComponent {
|
|
|
4815
4827
|
set(newConfig, this.widgetConfigPath(), mappings);
|
|
4816
4828
|
this.widgetConfigService.updateConfig(newConfig);
|
|
4817
4829
|
}
|
|
4818
|
-
catch
|
|
4830
|
+
catch {
|
|
4819
4831
|
// cancelled
|
|
4820
4832
|
}
|
|
4821
4833
|
finally {
|
|
@@ -4855,7 +4867,7 @@ class AssetPropertyMappingsComponent {
|
|
|
4855
4867
|
set(newConfig, this.widgetConfigPath(), mappings);
|
|
4856
4868
|
this.widgetConfigService.updateConfig(newConfig);
|
|
4857
4869
|
}
|
|
4858
|
-
catch
|
|
4870
|
+
catch {
|
|
4859
4871
|
// cancelled
|
|
4860
4872
|
}
|
|
4861
4873
|
finally {
|
|
@@ -4869,7 +4881,8 @@ class AssetPropertyMappingsComponent {
|
|
|
4869
4881
|
}
|
|
4870
4882
|
async copyMappingToClipboard(name, mapping) {
|
|
4871
4883
|
const mappingToTextFn = this.onBeforeCopyMappingToClipboard();
|
|
4872
|
-
const
|
|
4884
|
+
const config = await firstValueFrom(this.widgetConfigService.currentConfig$);
|
|
4885
|
+
const text = mappingToTextFn({ name, ...mapping }, config);
|
|
4873
4886
|
await this.clipboardService.writeText(text);
|
|
4874
4887
|
}
|
|
4875
4888
|
async removeMapping(name) {
|
|
@@ -4897,11 +4910,17 @@ class AssetPropertyMappingsComponent {
|
|
|
4897
4910
|
}
|
|
4898
4911
|
getNameValidators(key) {
|
|
4899
4912
|
if (!this.nameValidatorCache.has(key)) {
|
|
4913
|
+
const regex = this.mappingNameFormatRegex();
|
|
4900
4914
|
this.nameValidatorCache.set(key, [
|
|
4901
4915
|
Validators.required,
|
|
4902
4916
|
ctrl => this.isNameAlreadyUsed(ctrl.value, key, this.keysSignal())
|
|
4903
4917
|
? { 'key-already-used': true }
|
|
4904
|
-
: null
|
|
4918
|
+
: null,
|
|
4919
|
+
...(regex
|
|
4920
|
+
? [
|
|
4921
|
+
(ctrl) => regex.test(ctrl.value?.trim()) ? null : { 'key-invalid-format': true }
|
|
4922
|
+
]
|
|
4923
|
+
: [])
|
|
4905
4924
|
]);
|
|
4906
4925
|
}
|
|
4907
4926
|
return this.nameValidatorCache.get(key);
|
|
@@ -4956,7 +4975,7 @@ class AssetPropertyMappingsComponent {
|
|
|
4956
4975
|
return result;
|
|
4957
4976
|
}
|
|
4958
4977
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: AssetPropertyMappingsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4959
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: AssetPropertyMappingsComponent, isStandalone: true, selector: "c8y-asset-property-mappings", inputs: { widgetConfigPath: { classPropertyName: "widgetConfigPath", publicName: "widgetConfigPath", isSignal: true, isRequired: false, transformFunction: null }, initialMappings: { classPropertyName: "initialMappings", publicName: "initialMappings", isSignal: true, isRequired: false, transformFunction: null }, allowAddingNewMappings: { classPropertyName: "allowAddingNewMappings", publicName: "allowAddingNewMappings", isSignal: true, isRequired: false, transformFunction: null }, allowRenamingMappings: { classPropertyName: "allowRenamingMappings", publicName: "allowRenamingMappings", isSignal: true, isRequired: false, transformFunction: null }, allowRelabellingMappings: { classPropertyName: "allowRelabellingMappings", publicName: "allowRelabellingMappings", isSignal: true, isRequired: false, transformFunction: null }, allowEditingMappings: { classPropertyName: "allowEditingMappings", publicName: "allowEditingMappings", isSignal: true, isRequired: false, transformFunction: null }, allowRemovingMappings: { classPropertyName: "allowRemovingMappings", publicName: "allowRemovingMappings", isSignal: true, isRequired: false, transformFunction: null }, showLabels: { classPropertyName: "showLabels", publicName: "showLabels", isSignal: true, isRequired: false, transformFunction: null }, showNames: { classPropertyName: "showNames", publicName: "showNames", isSignal: true, isRequired: false, transformFunction: null }, showAssets: { classPropertyName: "showAssets", publicName: "showAssets", isSignal: true, isRequired: false, transformFunction: null }, showProperties: { classPropertyName: "showProperties", publicName: "showProperties", isSignal: true, isRequired: false, transformFunction: null }, showValues: { classPropertyName: "showValues", publicName: "showValues", isSignal: true, isRequired: false, transformFunction: null }, actionsColumnSpan: { classPropertyName: "actionsColumnSpan", publicName: "actionsColumnSpan", isSignal: true, isRequired: false, transformFunction: null }, onBeforeCopyMappingToClipboard: { classPropertyName: "onBeforeCopyMappingToClipboard", publicName: "onBeforeCopyMappingToClipboard", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div\n class=\"responsive-grid-table-wrapper--300 responsive-grid-table-wrapper--striped inner-scroll separator-top\"\n style=\"max-height: 300px\"\n>\n @let keys = keys$ | async;\n @let resolvedAssets = resolvedAssets$ | async;\n @let allMappings = mappings$ | async;\n @if (!keys?.length) {\n <div class=\"p-24\">\n <c8y-ui-empty-state\n icon=\"code\"\n [title]=\"emptyStateTitle | translate\"\n [subtitle]=\"emptyStateSubtitle | translate\"\n ></c8y-ui-empty-state>\n </div>\n } @else {\n @for (key of keys; track key) {\n @let mapping = allMappings?.[key];\n @let property = mapping?.assetProperty;\n @let asset = resolvedAssets?.get(property?.asset?.id);\n <div\n class=\"responsive-grid-table responsive-grid-table__body responsive-grid-table--condensed responsive-grid-table--separator p-l-16\"\n >\n @if (showLabels()) {\n <div\n [class]=\"'col-' + row1ColumnSpans.label\"\n [attr.aria-label]=\"'Label' | translate\"\n >\n <div class=\"fit-w\">\n <p class=\"text-label-small\">{{ 'Label' | translate }}</p>\n @if (allowRelabellingMappings()) {\n <c8y-input-group-editable\n name=\"label-{{ key }}\"\n size=\"sm\"\n [ariaLabel]=\"'Label' | translate\"\n [ngModel]=\"mapping?.label || key\"\n [validators]=\"getLabelValidators(key)\"\n (ngModelChange)=\"saveLabel(key, $event)\"\n >\n <c8y-message\n name=\"label-already-used\"\n [text]=\"'Label already used. Use a different one.' | translate\"\n ></c8y-message>\n </c8y-input-group-editable>\n } @else {\n <span class=\"tag tag--default text-bold\">{{ mapping?.label || key }}</span>\n }\n </div>\n </div>\n }\n @if (showNames()) {\n <div\n [class]=\"'col-' + row1ColumnSpans.name\"\n [attr.aria-label]=\"'Name' | translate\"\n >\n <div class=\"fit-w\">\n <p class=\"text-label-small\">{{ 'Name' | translate }}</p>\n @if (allowRenamingMappings()) {\n <c8y-input-group-editable\n class=\"text-bold\"\n name=\"name-{{ key }}\"\n size=\"sm\"\n [ariaLabel]=\"'Name' | translate\"\n [ngModel]=\"key\"\n [validators]=\"getNameValidators(key)\"\n (ngModelChange)=\"saveName(key, $event)\"\n >\n <c8y-message\n name=\"key-already-used\"\n [text]=\"'Name already used. Use a different one.' | translate\"\n ></c8y-message>\n </c8y-input-group-editable>\n } @else {\n {{ key }}\n }\n </div>\n </div>\n }\n <div [class]=\"'showOnHover col-' + actionsColumnSpan()\">\n <div class=\"col-actions fit-w min-width-0\">\n <button\n class=\"btn-dot btn-sm m-0\"\n [attr.aria-label]=\"'Copy mapping to clipboard' | translate\"\n tooltip=\"{{ 'Copy mapping to clipboard' | translate }}\"\n type=\"button\"\n [delay]=\"500\"\n (click)=\"copyMappingToClipboard(key, mapping!)\"\n >\n <i\n class=\"icon-14\"\n c8yIcon=\"clipboard\"\n aria-hidden=\"true\"\n ></i>\n </button>\n @if (allowEditingMappings() && !mapping?.assetProperty) {\n <button\n class=\"btn-dot btn-sm m-0\"\n [attr.aria-label]=\"'Assign property' | translate\"\n tooltip=\"{{ 'Assign property' | translate }}\"\n type=\"button\"\n [delay]=\"500\"\n [disabled]=\"isDrawerOpen()\"\n (click)=\"editMapping(key, mapping!)\"\n >\n <i\n class=\"icon-14\"\n c8yIcon=\"pencil\"\n aria-hidden=\"true\"\n ></i>\n </button>\n }\n @if (allowEditingMappings() && mapping?.assetProperty) {\n <button\n class=\"btn-dot btn-sm m-0\"\n [attr.aria-label]=\"'Clear mapping' | translate\"\n tooltip=\"{{ 'Clear mapping' | translate }}\"\n type=\"button\"\n [delay]=\"500\"\n (click)=\"clearMapping(key)\"\n >\n <i\n class=\"icon-14\"\n c8yIcon=\"remove-property\"\n aria-hidden=\"true\"\n ></i>\n </button>\n }\n @if (allowRemovingMappings()) {\n <button\n class=\"btn-dot btn-sm btn-dot--danger m-0\"\n [attr.aria-label]=\"'Remove mapping' | translate\"\n tooltip=\"{{ 'Remove mapping' | translate }}\"\n type=\"button\"\n [delay]=\"500\"\n (click)=\"removeMapping(key)\"\n >\n <i\n class=\"icon-14\"\n c8yIcon=\"minus-circle\"\n aria-hidden=\"true\"\n ></i>\n </button>\n }\n </div>\n </div>\n @if (showAssets()) {\n <div\n [class]=\"'p-b-16 col-' + row2ColumnSpans.asset\"\n [attr.aria-label]=\"'Asset' | translate\"\n >\n <div class=\"min-width-0\">\n <p class=\"text-label-small\">{{ 'Asset' | translate }}</p>\n {{ mapping?.assetProperty?.asset?.name || mapping?.assetProperty?.asset?.id || '\u2014' }}\n </div>\n </div>\n }\n @if (showProperties()) {\n <div\n [class]=\"'p-b-16 col-' + row2ColumnSpans.property\"\n [attr.aria-label]=\"'Property' | translate\"\n >\n <div class=\"min-width-0\">\n <p class=\"text-label-small\">{{ 'Property' | translate }}</p>\n {{ property?.label || property?.name || '\u2014' }}\n </div>\n </div>\n }\n @if (showValues()) {\n <div\n [class]=\"'p-b-16 col-' + row2ColumnSpans.value\"\n [attr.aria-label]=\"'Value' | translate\"\n >\n <div class=\"min-width-0\">\n <p class=\"text-label-small\">{{ 'Value' | translate }}</p>\n @if (property && asset) {\n @let value = (property | c8yAssetPropertyValue: asset | async) ?? '\u2014';\n <samp\n class=\"text-truncate min-width-0\"\n title=\"{{ value }}\"\n >\n {{ value }}\n </samp>\n }\n </div>\n </div>\n }\n </div>\n }\n }\n</div>\n@if (allowAddingNewMappings() || (allowRemovingMappings() && (keys$ | async)?.length)) {\n <div class=\"p-16 separator-top d-flex j-c-between a-i-center\">\n @if (allowAddingNewMappings()) {\n <button\n class=\"btn btn-default btn-sm\"\n type=\"button\"\n [disabled]=\"isDrawerOpen()\"\n (click)=\"addMappings()\"\n >\n <i\n c8yIcon=\"plus-circle\"\n aria-hidden=\"true\"\n ></i>\n {{ 'Add mappings' | translate }}\n </button>\n }\n @if (allowRemovingMappings() && (keys$ | async)?.length) {\n <button\n class=\"btn btn-danger btn-sm\"\n type=\"button\"\n [disabled]=\"isDrawerOpen()\"\n (click)=\"removeAllMappings()\"\n >\n <i\n c8yIcon=\"minus-circle\"\n aria-hidden=\"true\"\n ></i>\n {{ 'Remove all mappings' | translate }}\n </button>\n }\n </div>\n}\n\n<c8y-widget-config-feedback>\n <span\n class=\"tag tag--info chip text-12 m-4\"\n ngNonBindable\n translate\n [translateParams]=\"{\n count: (keys$ | async)?.length ?? 0\n }\"\n >\n {{ count }} selected\n </span>\n</c8y-widget-config-feedback>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "component", type: InputGroupEditableComponent, selector: "c8y-input-group-editable", inputs: ["ariaLabel", "name", "size", "placeholder", "validators", "asyncValidators"], outputs: ["save", "cancel"] }, { kind: "directive", type: MessageDirective, selector: "c8y-message", inputs: ["name", "text"] }, { kind: "component", type: EmptyStateComponent, selector: "c8y-ui-empty-state", inputs: ["icon", "title", "subtitle", "horizontal"] }, { kind: "ngmodule", type: BsDropdownModule }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i2$4.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: WidgetConfigFeedbackComponent, selector: "c8y-widget-config-feedback" }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: AssetPropertyValuePipe, name: "c8yAssetPropertyValue" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4978
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: AssetPropertyMappingsComponent, isStandalone: true, selector: "c8y-asset-property-mappings", inputs: { widgetConfigPath: { classPropertyName: "widgetConfigPath", publicName: "widgetConfigPath", isSignal: true, isRequired: false, transformFunction: null }, initialMappings: { classPropertyName: "initialMappings", publicName: "initialMappings", isSignal: true, isRequired: false, transformFunction: null }, allowAddingNewMappings: { classPropertyName: "allowAddingNewMappings", publicName: "allowAddingNewMappings", isSignal: true, isRequired: false, transformFunction: null }, allowRenamingMappings: { classPropertyName: "allowRenamingMappings", publicName: "allowRenamingMappings", isSignal: true, isRequired: false, transformFunction: null }, allowRelabellingMappings: { classPropertyName: "allowRelabellingMappings", publicName: "allowRelabellingMappings", isSignal: true, isRequired: false, transformFunction: null }, mappingNameFormatRegex: { classPropertyName: "mappingNameFormatRegex", publicName: "mappingNameFormatRegex", isSignal: true, isRequired: false, transformFunction: null }, mappingNameFormatErrorMessage: { classPropertyName: "mappingNameFormatErrorMessage", publicName: "mappingNameFormatErrorMessage", isSignal: true, isRequired: false, transformFunction: null }, allowEditingMappings: { classPropertyName: "allowEditingMappings", publicName: "allowEditingMappings", isSignal: true, isRequired: false, transformFunction: null }, allowRemovingMappings: { classPropertyName: "allowRemovingMappings", publicName: "allowRemovingMappings", isSignal: true, isRequired: false, transformFunction: null }, showLabels: { classPropertyName: "showLabels", publicName: "showLabels", isSignal: true, isRequired: false, transformFunction: null }, showNames: { classPropertyName: "showNames", publicName: "showNames", isSignal: true, isRequired: false, transformFunction: null }, showAssets: { classPropertyName: "showAssets", publicName: "showAssets", isSignal: true, isRequired: false, transformFunction: null }, showProperties: { classPropertyName: "showProperties", publicName: "showProperties", isSignal: true, isRequired: false, transformFunction: null }, showValues: { classPropertyName: "showValues", publicName: "showValues", isSignal: true, isRequired: false, transformFunction: null }, actionsColumnSpan: { classPropertyName: "actionsColumnSpan", publicName: "actionsColumnSpan", isSignal: true, isRequired: false, transformFunction: null }, onBeforeCopyMappingToClipboard: { classPropertyName: "onBeforeCopyMappingToClipboard", publicName: "onBeforeCopyMappingToClipboard", isSignal: true, isRequired: false, transformFunction: null }, emptyStateTitle: { classPropertyName: "emptyStateTitle", publicName: "emptyStateTitle", isSignal: true, isRequired: false, transformFunction: null }, emptyStateSubtitle: { classPropertyName: "emptyStateSubtitle", publicName: "emptyStateSubtitle", isSignal: true, isRequired: false, transformFunction: null }, feedbackMessage: { classPropertyName: "feedbackMessage", publicName: "feedbackMessage", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div\n class=\"responsive-grid-table-wrapper--300 responsive-grid-table-wrapper--striped inner-scroll separator-top\"\n style=\"max-height: 300px\"\n>\n @let keys = keys$ | async;\n @let resolvedAssets = resolvedAssets$ | async;\n @let allMappings = mappings$ | async;\n @if (!keys?.length) {\n <div class=\"p-24\">\n <c8y-ui-empty-state\n icon=\"code\"\n [title]=\"emptyStateTitle() | translate\"\n [subtitle]=\"emptyStateSubtitle() | translate\"\n ></c8y-ui-empty-state>\n </div>\n } @else {\n @for (key of keys; track key) {\n @let mapping = allMappings?.[key];\n @let property = mapping?.assetProperty;\n @let asset = resolvedAssets?.get(property?.asset?.id);\n <div\n class=\"responsive-grid-table responsive-grid-table__body responsive-grid-table--condensed responsive-grid-table--separator p-l-16\"\n >\n @if (showLabels()) {\n <div\n [class]=\"'col-' + row1ColumnSpans.label\"\n [attr.aria-label]=\"'Label' | translate\"\n >\n <div class=\"fit-w\">\n <p class=\"text-label-small\">{{ 'Label' | translate }}</p>\n @if (allowRelabellingMappings()) {\n <c8y-input-group-editable\n name=\"label-{{ key }}\"\n size=\"sm\"\n [ariaLabel]=\"'Label' | translate\"\n [ngModel]=\"mapping?.label || key\"\n [validators]=\"getLabelValidators(key)\"\n (ngModelChange)=\"saveLabel(key, $event)\"\n >\n <c8y-message\n name=\"label-already-used\"\n [text]=\"'Label already used. Use a different one.' | translate\"\n ></c8y-message>\n </c8y-input-group-editable>\n } @else {\n <span class=\"tag tag--default text-bold\">{{ mapping?.label || key }}</span>\n }\n </div>\n </div>\n }\n @if (showNames()) {\n <div\n [class]=\"'col-' + row1ColumnSpans.name\"\n [attr.aria-label]=\"'Name' | translate\"\n >\n <div class=\"fit-w\">\n <p class=\"text-label-small\">{{ 'Name' | translate }}</p>\n @if (allowRenamingMappings()) {\n <c8y-input-group-editable\n class=\"text-bold\"\n name=\"name-{{ key }}\"\n size=\"sm\"\n [ariaLabel]=\"'Name' | translate\"\n [ngModel]=\"key\"\n [validators]=\"getNameValidators(key)\"\n (ngModelChange)=\"saveName(key, $event)\"\n >\n <c8y-message\n name=\"key-already-used\"\n [text]=\"'Name already used. Use a different one.' | translate\"\n ></c8y-message>\n <c8y-message\n name=\"key-invalid-format\"\n [text]=\"mappingNameFormatErrorMessage() | translate\"\n ></c8y-message>\n </c8y-input-group-editable>\n } @else {\n {{ key }}\n }\n </div>\n </div>\n }\n <div [class]=\"'showOnHover col-' + actionsColumnSpan()\">\n <div class=\"col-actions fit-w min-width-0\">\n <button\n class=\"btn-dot btn-sm m-0\"\n [attr.aria-label]=\"'Copy mapping to clipboard' | translate\"\n tooltip=\"{{ 'Copy mapping to clipboard' | translate }}\"\n type=\"button\"\n [delay]=\"500\"\n (click)=\"copyMappingToClipboard(key, mapping!)\"\n >\n <i\n class=\"icon-14\"\n c8yIcon=\"clipboard\"\n aria-hidden=\"true\"\n ></i>\n </button>\n @if (allowEditingMappings() && !mapping?.assetProperty) {\n <button\n class=\"btn-dot btn-sm m-0\"\n [attr.aria-label]=\"'Assign property' | translate\"\n tooltip=\"{{ 'Assign property' | translate }}\"\n type=\"button\"\n [delay]=\"500\"\n [disabled]=\"isDrawerOpen()\"\n (click)=\"editMapping(key, mapping!)\"\n >\n <i\n class=\"icon-14\"\n c8yIcon=\"pencil\"\n aria-hidden=\"true\"\n ></i>\n </button>\n }\n @if (allowEditingMappings() && mapping?.assetProperty) {\n <button\n class=\"btn-dot btn-sm m-0\"\n [attr.aria-label]=\"'Clear mapping' | translate\"\n tooltip=\"{{ 'Clear mapping' | translate }}\"\n type=\"button\"\n [delay]=\"500\"\n (click)=\"clearMapping(key)\"\n >\n <i\n class=\"icon-14\"\n c8yIcon=\"remove-property\"\n aria-hidden=\"true\"\n ></i>\n </button>\n }\n @if (allowRemovingMappings()) {\n <button\n class=\"btn-dot btn-sm btn-dot--danger m-0\"\n [attr.aria-label]=\"'Remove mapping' | translate\"\n tooltip=\"{{ 'Remove mapping' | translate }}\"\n type=\"button\"\n [delay]=\"500\"\n (click)=\"removeMapping(key)\"\n >\n <i\n class=\"icon-14\"\n c8yIcon=\"minus-circle\"\n aria-hidden=\"true\"\n ></i>\n </button>\n }\n </div>\n </div>\n @if (showAssets()) {\n <div\n [class]=\"'p-b-16 col-' + row2ColumnSpans.asset\"\n [attr.aria-label]=\"'Asset' | translate\"\n >\n <div class=\"min-width-0\">\n <p class=\"text-label-small\">{{ 'Asset' | translate }}</p>\n {{ mapping?.assetProperty?.asset?.name || mapping?.assetProperty?.asset?.id || '\u2014' }}\n </div>\n </div>\n }\n @if (showProperties()) {\n <div\n [class]=\"'p-b-16 col-' + row2ColumnSpans.property\"\n [attr.aria-label]=\"'Property' | translate\"\n >\n <div class=\"min-width-0\">\n <p class=\"text-label-small\">{{ 'Property' | translate }}</p>\n {{ property?.label || property?.name || '\u2014' }}\n </div>\n </div>\n }\n @if (showValues()) {\n <div\n [class]=\"'p-b-16 col-' + row2ColumnSpans.value\"\n [attr.aria-label]=\"'Value' | translate\"\n >\n <div class=\"min-width-0\">\n <p class=\"text-label-small\">{{ 'Value' | translate }}</p>\n @if (property && asset) {\n @let value = (property | c8yAssetPropertyValue: asset | async) ?? '\u2014';\n <samp\n class=\"text-truncate min-width-0\"\n title=\"{{ value }}\"\n >\n {{ value }}\n </samp>\n }\n </div>\n </div>\n }\n </div>\n }\n }\n</div>\n@if (allowAddingNewMappings() || (allowRemovingMappings() && (keys$ | async)?.length)) {\n <div class=\"p-16 separator-top d-flex j-c-between a-i-center\">\n @if (allowAddingNewMappings()) {\n <button\n class=\"btn btn-default btn-sm\"\n type=\"button\"\n [disabled]=\"isDrawerOpen()\"\n (click)=\"addMappings()\"\n >\n <i\n c8yIcon=\"plus-circle\"\n aria-hidden=\"true\"\n ></i>\n {{ 'Add mappings' | translate }}\n </button>\n }\n @if (allowRemovingMappings() && (keys$ | async)?.length) {\n <button\n class=\"btn btn-danger btn-sm\"\n type=\"button\"\n [disabled]=\"isDrawerOpen()\"\n (click)=\"removeAllMappings()\"\n >\n <i\n c8yIcon=\"minus-circle\"\n aria-hidden=\"true\"\n ></i>\n {{ 'Remove all mappings' | translate }}\n </button>\n }\n </div>\n}\n\n<c8y-widget-config-feedback>\n <span class=\"tag tag--info chip text-12 m-4\">\n {{ feedbackMessage() | translate: { count: keys?.length ?? 0 } }}\n </span>\n</c8y-widget-config-feedback>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "component", type: InputGroupEditableComponent, selector: "c8y-input-group-editable", inputs: ["ariaLabel", "name", "size", "placeholder", "validators", "asyncValidators", "autocomplete"], outputs: ["save", "cancel"] }, { kind: "directive", type: MessageDirective, selector: "c8y-message", inputs: ["name", "text"] }, { kind: "component", type: EmptyStateComponent, selector: "c8y-ui-empty-state", inputs: ["icon", "title", "subtitle", "horizontal"] }, { kind: "ngmodule", type: BsDropdownModule }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i2$4.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: WidgetConfigFeedbackComponent, selector: "c8y-widget-config-feedback" }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: AssetPropertyValuePipe, name: "c8yAssetPropertyValue" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4960
4979
|
}
|
|
4961
4980
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: AssetPropertyMappingsComponent, decorators: [{
|
|
4962
4981
|
type: Component,
|
|
@@ -4965,7 +4984,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
4965
4984
|
FormsModule,
|
|
4966
4985
|
IconDirective,
|
|
4967
4986
|
C8yTranslatePipe,
|
|
4968
|
-
C8yTranslateDirective,
|
|
4969
4987
|
InputGroupEditableComponent,
|
|
4970
4988
|
MessageDirective,
|
|
4971
4989
|
EmptyStateComponent,
|
|
@@ -4973,12 +4991,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
4973
4991
|
BsDropdownModule,
|
|
4974
4992
|
TooltipModule,
|
|
4975
4993
|
WidgetConfigFeedbackComponent
|
|
4976
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"responsive-grid-table-wrapper--300 responsive-grid-table-wrapper--striped inner-scroll separator-top\"\n style=\"max-height: 300px\"\n>\n @let keys = keys$ | async;\n @let resolvedAssets = resolvedAssets$ | async;\n @let allMappings = mappings$ | async;\n @if (!keys?.length) {\n <div class=\"p-24\">\n <c8y-ui-empty-state\n icon=\"code\"\n [title]=\"emptyStateTitle | translate\"\n [subtitle]=\"emptyStateSubtitle | translate\"\n ></c8y-ui-empty-state>\n </div>\n } @else {\n @for (key of keys; track key) {\n @let mapping = allMappings?.[key];\n @let property = mapping?.assetProperty;\n @let asset = resolvedAssets?.get(property?.asset?.id);\n <div\n class=\"responsive-grid-table responsive-grid-table__body responsive-grid-table--condensed responsive-grid-table--separator p-l-16\"\n >\n @if (showLabels()) {\n <div\n [class]=\"'col-' + row1ColumnSpans.label\"\n [attr.aria-label]=\"'Label' | translate\"\n >\n <div class=\"fit-w\">\n <p class=\"text-label-small\">{{ 'Label' | translate }}</p>\n @if (allowRelabellingMappings()) {\n <c8y-input-group-editable\n name=\"label-{{ key }}\"\n size=\"sm\"\n [ariaLabel]=\"'Label' | translate\"\n [ngModel]=\"mapping?.label || key\"\n [validators]=\"getLabelValidators(key)\"\n (ngModelChange)=\"saveLabel(key, $event)\"\n >\n <c8y-message\n name=\"label-already-used\"\n [text]=\"'Label already used. Use a different one.' | translate\"\n ></c8y-message>\n </c8y-input-group-editable>\n } @else {\n <span class=\"tag tag--default text-bold\">{{ mapping?.label || key }}</span>\n }\n </div>\n </div>\n }\n @if (showNames()) {\n <div\n [class]=\"'col-' + row1ColumnSpans.name\"\n [attr.aria-label]=\"'Name' | translate\"\n >\n <div class=\"fit-w\">\n <p class=\"text-label-small\">{{ 'Name' | translate }}</p>\n @if (allowRenamingMappings()) {\n <c8y-input-group-editable\n class=\"text-bold\"\n name=\"name-{{ key }}\"\n size=\"sm\"\n [ariaLabel]=\"'Name' | translate\"\n [ngModel]=\"key\"\n [validators]=\"getNameValidators(key)\"\n (ngModelChange)=\"saveName(key, $event)\"\n >\n <c8y-message\n name=\"key-already-used\"\n [text]=\"'Name already used. Use a different one.' | translate\"\n ></c8y-message>\n </c8y-input-group-editable>\n } @else {\n {{ key }}\n }\n </div>\n </div>\n }\n <div [class]=\"'showOnHover col-' + actionsColumnSpan()\">\n <div class=\"col-actions fit-w min-width-0\">\n <button\n class=\"btn-dot btn-sm m-0\"\n [attr.aria-label]=\"'Copy mapping to clipboard' | translate\"\n tooltip=\"{{ 'Copy mapping to clipboard' | translate }}\"\n type=\"button\"\n [delay]=\"500\"\n (click)=\"copyMappingToClipboard(key, mapping!)\"\n >\n <i\n class=\"icon-14\"\n c8yIcon=\"clipboard\"\n aria-hidden=\"true\"\n ></i>\n </button>\n @if (allowEditingMappings() && !mapping?.assetProperty) {\n <button\n class=\"btn-dot btn-sm m-0\"\n [attr.aria-label]=\"'Assign property' | translate\"\n tooltip=\"{{ 'Assign property' | translate }}\"\n type=\"button\"\n [delay]=\"500\"\n [disabled]=\"isDrawerOpen()\"\n (click)=\"editMapping(key, mapping!)\"\n >\n <i\n class=\"icon-14\"\n c8yIcon=\"pencil\"\n aria-hidden=\"true\"\n ></i>\n </button>\n }\n @if (allowEditingMappings() && mapping?.assetProperty) {\n <button\n class=\"btn-dot btn-sm m-0\"\n [attr.aria-label]=\"'Clear mapping' | translate\"\n tooltip=\"{{ 'Clear mapping' | translate }}\"\n type=\"button\"\n [delay]=\"500\"\n (click)=\"clearMapping(key)\"\n >\n <i\n class=\"icon-14\"\n c8yIcon=\"remove-property\"\n aria-hidden=\"true\"\n ></i>\n </button>\n }\n @if (allowRemovingMappings()) {\n <button\n class=\"btn-dot btn-sm btn-dot--danger m-0\"\n [attr.aria-label]=\"'Remove mapping' | translate\"\n tooltip=\"{{ 'Remove mapping' | translate }}\"\n type=\"button\"\n [delay]=\"500\"\n (click)=\"removeMapping(key)\"\n >\n <i\n class=\"icon-14\"\n c8yIcon=\"minus-circle\"\n aria-hidden=\"true\"\n ></i>\n </button>\n }\n </div>\n </div>\n @if (showAssets()) {\n <div\n [class]=\"'p-b-16 col-' + row2ColumnSpans.asset\"\n [attr.aria-label]=\"'Asset' | translate\"\n >\n <div class=\"min-width-0\">\n <p class=\"text-label-small\">{{ 'Asset' | translate }}</p>\n {{ mapping?.assetProperty?.asset?.name || mapping?.assetProperty?.asset?.id || '\u2014' }}\n </div>\n </div>\n }\n @if (showProperties()) {\n <div\n [class]=\"'p-b-16 col-' + row2ColumnSpans.property\"\n [attr.aria-label]=\"'Property' | translate\"\n >\n <div class=\"min-width-0\">\n <p class=\"text-label-small\">{{ 'Property' | translate }}</p>\n {{ property?.label || property?.name || '\u2014' }}\n </div>\n </div>\n }\n @if (showValues()) {\n <div\n [class]=\"'p-b-16 col-' + row2ColumnSpans.value\"\n [attr.aria-label]=\"'Value' | translate\"\n >\n <div class=\"min-width-0\">\n <p class=\"text-label-small\">{{ 'Value' | translate }}</p>\n @if (property && asset) {\n @let value = (property | c8yAssetPropertyValue: asset | async) ?? '\u2014';\n <samp\n class=\"text-truncate min-width-0\"\n title=\"{{ value }}\"\n >\n {{ value }}\n </samp>\n }\n </div>\n </div>\n }\n </div>\n }\n }\n</div>\n@if (allowAddingNewMappings() || (allowRemovingMappings() && (keys$ | async)?.length)) {\n <div class=\"p-16 separator-top d-flex j-c-between a-i-center\">\n @if (allowAddingNewMappings()) {\n <button\n class=\"btn btn-default btn-sm\"\n type=\"button\"\n [disabled]=\"isDrawerOpen()\"\n (click)=\"addMappings()\"\n >\n <i\n c8yIcon=\"plus-circle\"\n aria-hidden=\"true\"\n ></i>\n {{ 'Add mappings' | translate }}\n </button>\n }\n @if (allowRemovingMappings() && (keys$ | async)?.length) {\n <button\n class=\"btn btn-danger btn-sm\"\n type=\"button\"\n [disabled]=\"isDrawerOpen()\"\n (click)=\"removeAllMappings()\"\n >\n <i\n c8yIcon=\"minus-circle\"\n aria-hidden=\"true\"\n ></i>\n {{ 'Remove all mappings' | translate }}\n </button>\n }\n </div>\n}\n\n<c8y-widget-config-feedback>\n <span
|
|
4977
|
-
}], propDecorators: { widgetConfigPath: [{ type: i0.Input, args: [{ isSignal: true, alias: "widgetConfigPath", required: false }] }], initialMappings: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialMappings", required: false }] }], allowAddingNewMappings: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowAddingNewMappings", required: false }] }], allowRenamingMappings: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowRenamingMappings", required: false }] }], allowRelabellingMappings: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowRelabellingMappings", required: false }] }], allowEditingMappings: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowEditingMappings", required: false }] }], allowRemovingMappings: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowRemovingMappings", required: false }] }], showLabels: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLabels", required: false }] }], showNames: [{ type: i0.Input, args: [{ isSignal: true, alias: "showNames", required: false }] }], showAssets: [{ type: i0.Input, args: [{ isSignal: true, alias: "showAssets", required: false }] }], showProperties: [{ type: i0.Input, args: [{ isSignal: true, alias: "showProperties", required: false }] }], showValues: [{ type: i0.Input, args: [{ isSignal: true, alias: "showValues", required: false }] }], actionsColumnSpan: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionsColumnSpan", required: false }] }], onBeforeCopyMappingToClipboard: [{ type: i0.Input, args: [{ isSignal: true, alias: "onBeforeCopyMappingToClipboard", required: false }] }] } });
|
|
4994
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"responsive-grid-table-wrapper--300 responsive-grid-table-wrapper--striped inner-scroll separator-top\"\n style=\"max-height: 300px\"\n>\n @let keys = keys$ | async;\n @let resolvedAssets = resolvedAssets$ | async;\n @let allMappings = mappings$ | async;\n @if (!keys?.length) {\n <div class=\"p-24\">\n <c8y-ui-empty-state\n icon=\"code\"\n [title]=\"emptyStateTitle() | translate\"\n [subtitle]=\"emptyStateSubtitle() | translate\"\n ></c8y-ui-empty-state>\n </div>\n } @else {\n @for (key of keys; track key) {\n @let mapping = allMappings?.[key];\n @let property = mapping?.assetProperty;\n @let asset = resolvedAssets?.get(property?.asset?.id);\n <div\n class=\"responsive-grid-table responsive-grid-table__body responsive-grid-table--condensed responsive-grid-table--separator p-l-16\"\n >\n @if (showLabels()) {\n <div\n [class]=\"'col-' + row1ColumnSpans.label\"\n [attr.aria-label]=\"'Label' | translate\"\n >\n <div class=\"fit-w\">\n <p class=\"text-label-small\">{{ 'Label' | translate }}</p>\n @if (allowRelabellingMappings()) {\n <c8y-input-group-editable\n name=\"label-{{ key }}\"\n size=\"sm\"\n [ariaLabel]=\"'Label' | translate\"\n [ngModel]=\"mapping?.label || key\"\n [validators]=\"getLabelValidators(key)\"\n (ngModelChange)=\"saveLabel(key, $event)\"\n >\n <c8y-message\n name=\"label-already-used\"\n [text]=\"'Label already used. Use a different one.' | translate\"\n ></c8y-message>\n </c8y-input-group-editable>\n } @else {\n <span class=\"tag tag--default text-bold\">{{ mapping?.label || key }}</span>\n }\n </div>\n </div>\n }\n @if (showNames()) {\n <div\n [class]=\"'col-' + row1ColumnSpans.name\"\n [attr.aria-label]=\"'Name' | translate\"\n >\n <div class=\"fit-w\">\n <p class=\"text-label-small\">{{ 'Name' | translate }}</p>\n @if (allowRenamingMappings()) {\n <c8y-input-group-editable\n class=\"text-bold\"\n name=\"name-{{ key }}\"\n size=\"sm\"\n [ariaLabel]=\"'Name' | translate\"\n [ngModel]=\"key\"\n [validators]=\"getNameValidators(key)\"\n (ngModelChange)=\"saveName(key, $event)\"\n >\n <c8y-message\n name=\"key-already-used\"\n [text]=\"'Name already used. Use a different one.' | translate\"\n ></c8y-message>\n <c8y-message\n name=\"key-invalid-format\"\n [text]=\"mappingNameFormatErrorMessage() | translate\"\n ></c8y-message>\n </c8y-input-group-editable>\n } @else {\n {{ key }}\n }\n </div>\n </div>\n }\n <div [class]=\"'showOnHover col-' + actionsColumnSpan()\">\n <div class=\"col-actions fit-w min-width-0\">\n <button\n class=\"btn-dot btn-sm m-0\"\n [attr.aria-label]=\"'Copy mapping to clipboard' | translate\"\n tooltip=\"{{ 'Copy mapping to clipboard' | translate }}\"\n type=\"button\"\n [delay]=\"500\"\n (click)=\"copyMappingToClipboard(key, mapping!)\"\n >\n <i\n class=\"icon-14\"\n c8yIcon=\"clipboard\"\n aria-hidden=\"true\"\n ></i>\n </button>\n @if (allowEditingMappings() && !mapping?.assetProperty) {\n <button\n class=\"btn-dot btn-sm m-0\"\n [attr.aria-label]=\"'Assign property' | translate\"\n tooltip=\"{{ 'Assign property' | translate }}\"\n type=\"button\"\n [delay]=\"500\"\n [disabled]=\"isDrawerOpen()\"\n (click)=\"editMapping(key, mapping!)\"\n >\n <i\n class=\"icon-14\"\n c8yIcon=\"pencil\"\n aria-hidden=\"true\"\n ></i>\n </button>\n }\n @if (allowEditingMappings() && mapping?.assetProperty) {\n <button\n class=\"btn-dot btn-sm m-0\"\n [attr.aria-label]=\"'Clear mapping' | translate\"\n tooltip=\"{{ 'Clear mapping' | translate }}\"\n type=\"button\"\n [delay]=\"500\"\n (click)=\"clearMapping(key)\"\n >\n <i\n class=\"icon-14\"\n c8yIcon=\"remove-property\"\n aria-hidden=\"true\"\n ></i>\n </button>\n }\n @if (allowRemovingMappings()) {\n <button\n class=\"btn-dot btn-sm btn-dot--danger m-0\"\n [attr.aria-label]=\"'Remove mapping' | translate\"\n tooltip=\"{{ 'Remove mapping' | translate }}\"\n type=\"button\"\n [delay]=\"500\"\n (click)=\"removeMapping(key)\"\n >\n <i\n class=\"icon-14\"\n c8yIcon=\"minus-circle\"\n aria-hidden=\"true\"\n ></i>\n </button>\n }\n </div>\n </div>\n @if (showAssets()) {\n <div\n [class]=\"'p-b-16 col-' + row2ColumnSpans.asset\"\n [attr.aria-label]=\"'Asset' | translate\"\n >\n <div class=\"min-width-0\">\n <p class=\"text-label-small\">{{ 'Asset' | translate }}</p>\n {{ mapping?.assetProperty?.asset?.name || mapping?.assetProperty?.asset?.id || '\u2014' }}\n </div>\n </div>\n }\n @if (showProperties()) {\n <div\n [class]=\"'p-b-16 col-' + row2ColumnSpans.property\"\n [attr.aria-label]=\"'Property' | translate\"\n >\n <div class=\"min-width-0\">\n <p class=\"text-label-small\">{{ 'Property' | translate }}</p>\n {{ property?.label || property?.name || '\u2014' }}\n </div>\n </div>\n }\n @if (showValues()) {\n <div\n [class]=\"'p-b-16 col-' + row2ColumnSpans.value\"\n [attr.aria-label]=\"'Value' | translate\"\n >\n <div class=\"min-width-0\">\n <p class=\"text-label-small\">{{ 'Value' | translate }}</p>\n @if (property && asset) {\n @let value = (property | c8yAssetPropertyValue: asset | async) ?? '\u2014';\n <samp\n class=\"text-truncate min-width-0\"\n title=\"{{ value }}\"\n >\n {{ value }}\n </samp>\n }\n </div>\n </div>\n }\n </div>\n }\n }\n</div>\n@if (allowAddingNewMappings() || (allowRemovingMappings() && (keys$ | async)?.length)) {\n <div class=\"p-16 separator-top d-flex j-c-between a-i-center\">\n @if (allowAddingNewMappings()) {\n <button\n class=\"btn btn-default btn-sm\"\n type=\"button\"\n [disabled]=\"isDrawerOpen()\"\n (click)=\"addMappings()\"\n >\n <i\n c8yIcon=\"plus-circle\"\n aria-hidden=\"true\"\n ></i>\n {{ 'Add mappings' | translate }}\n </button>\n }\n @if (allowRemovingMappings() && (keys$ | async)?.length) {\n <button\n class=\"btn btn-danger btn-sm\"\n type=\"button\"\n [disabled]=\"isDrawerOpen()\"\n (click)=\"removeAllMappings()\"\n >\n <i\n c8yIcon=\"minus-circle\"\n aria-hidden=\"true\"\n ></i>\n {{ 'Remove all mappings' | translate }}\n </button>\n }\n </div>\n}\n\n<c8y-widget-config-feedback>\n <span class=\"tag tag--info chip text-12 m-4\">\n {{ feedbackMessage() | translate: { count: keys?.length ?? 0 } }}\n </span>\n</c8y-widget-config-feedback>\n" }]
|
|
4995
|
+
}], propDecorators: { widgetConfigPath: [{ type: i0.Input, args: [{ isSignal: true, alias: "widgetConfigPath", required: false }] }], initialMappings: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialMappings", required: false }] }], allowAddingNewMappings: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowAddingNewMappings", required: false }] }], allowRenamingMappings: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowRenamingMappings", required: false }] }], allowRelabellingMappings: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowRelabellingMappings", required: false }] }], mappingNameFormatRegex: [{ type: i0.Input, args: [{ isSignal: true, alias: "mappingNameFormatRegex", required: false }] }], mappingNameFormatErrorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "mappingNameFormatErrorMessage", required: false }] }], allowEditingMappings: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowEditingMappings", required: false }] }], allowRemovingMappings: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowRemovingMappings", required: false }] }], showLabels: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLabels", required: false }] }], showNames: [{ type: i0.Input, args: [{ isSignal: true, alias: "showNames", required: false }] }], showAssets: [{ type: i0.Input, args: [{ isSignal: true, alias: "showAssets", required: false }] }], showProperties: [{ type: i0.Input, args: [{ isSignal: true, alias: "showProperties", required: false }] }], showValues: [{ type: i0.Input, args: [{ isSignal: true, alias: "showValues", required: false }] }], actionsColumnSpan: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionsColumnSpan", required: false }] }], onBeforeCopyMappingToClipboard: [{ type: i0.Input, args: [{ isSignal: true, alias: "onBeforeCopyMappingToClipboard", required: false }] }], emptyStateTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyStateTitle", required: false }] }], emptyStateSubtitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyStateSubtitle", required: false }] }], feedbackMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "feedbackMessage", required: false }] }] } });
|
|
4978
4996
|
|
|
4979
4997
|
/**
|
|
4980
4998
|
* Generated bundle index. Do not edit.
|
|
4981
4999
|
*/
|
|
4982
5000
|
|
|
4983
|
-
export { ALL_GLOBAL_ROLES_SELECTED, AddDashboardComponent, AddDashboardFactory, AppearanceSettingsComponent, AssetPropertyMappingsComponent, AssetPropertyMappingsService, CONTEXT_DASHBOARD_CONFIG, ContextDashboardComponent, ContextDashboardModule, ContextDashboardService, ContextDashboardType, DASHBOARD_CHILDREN_STATE_NAME, DASHBOARD_DETAILS_OUTLET, DASHBOARD_DETAILS_TABS_OUTLET_NAME, DASHBOARD_SETTINGS_CHANGES, DASHBOARD_THEME_CLASSES, DashboardActionBarFactory, DashboardDetailComponent, DashboardDetailService, DashboardDetailsTabId, DeviceInfoDashboardComponent, DeviceInfoDashboardModule, DeviceManagementHomeDashboardComponent, DeviceManagementHomeDashboardModule, GlobalContextSectionComponent, HOOK_WIDGET_CONFIG, NewDashboardGuard, PRODUCT_EXPERIENCE, PasteDashboardActionComponent, REPORT_DEFAULT_NAVIGATION_NODE_PRIORITY, STYLING_CLASS_PREFIXES, TypeDashboardInfoComponent, WIDGET_CONTENT_CLASSES, WIDGET_HEADER_CLASSES, WidgetAssetSelectorComponent, WidgetConfigAppearanceComponent, WidgetConfigComponent, WidgetConfigFeedbackComponent, WidgetConfigGeneralComponent, WidgetConfigSectionComponent, WidgetConfigSectionService, WidgetConfigService, WidgetPreviewComponent, WidgetPreviewWrapperComponent, WidgetService, getPropertyBaseKey, hookWidgetConfig, newDashboardTab, quoteAndEscape, renamePropertyKeyInCode };
|
|
5001
|
+
export { ALL_GLOBAL_ROLES_SELECTED, AddDashboardComponent, AddDashboardFactory, AppearanceSettingsComponent, AssetPropertyMappingsComponent, AssetPropertyMappingsService, CONTEXT_DASHBOARD_CONFIG, ContextDashboardComponent, ContextDashboardModule, ContextDashboardService, ContextDashboardType, DASHBOARD_CHILDREN_STATE_NAME, DASHBOARD_DETAILS_OUTLET, DASHBOARD_DETAILS_TABS_OUTLET_NAME, DASHBOARD_SETTINGS_CHANGES, DASHBOARD_THEME_CLASSES, DashboardActionBarFactory, DashboardDetailComponent, DashboardDetailService, DashboardDetailsTabId, DeviceInfoDashboardComponent, DeviceInfoDashboardModule, DeviceManagementHomeDashboardComponent, DeviceManagementHomeDashboardModule, GlobalContextSectionComponent, HOOK_WIDGET_CONFIG, NewDashboardGuard, PRODUCT_EXPERIENCE, PasteDashboardActionComponent, REPORT_DEFAULT_NAVIGATION_NODE_PRIORITY, STYLING_CLASS_PREFIXES, TypeDashboardInfoComponent, WIDGET_CONTENT_CLASSES, WIDGET_HEADER_CLASSES, WidgetAssetSelectorComponent, WidgetConfigAppearanceComponent, WidgetConfigComponent, WidgetConfigFeedbackComponent, WidgetConfigGeneralComponent, WidgetConfigSectionComponent, WidgetConfigSectionService, WidgetConfigService, WidgetPreviewComponent, WidgetPreviewWrapperComponent, WidgetService, escapeForRegExp, getPropertyBaseKey, hookWidgetConfig, newDashboardTab, quoteAndEscape, renamePropertyKeyInCode };
|
|
4984
5002
|
//# sourceMappingURL=c8y-ngx-components-context-dashboard.mjs.map
|