@c8y/ngx-components 1023.14.175 → 1023.14.177

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.
@@ -349,6 +349,11 @@ declare const PRODUCT_EXPERIENCE: {
349
349
  interface CanDeactivateComponent {
350
350
  canDeactivate: () => boolean | Observable<boolean> | Promise<boolean>;
351
351
  }
352
+ declare const FOUNDATION_CLASSES: readonly ["c8y-dark-theme", "c8y-light-theme", "panel-content-branded"];
353
+ type FoundationClass = (typeof FOUNDATION_CLASSES)[number];
354
+ declare const THEME_FOUNDATION_MAP: Record<string, FoundationClass>;
355
+ declare const WIDGET_FOUNDATION_MAP: Record<string, FoundationClass>;
356
+ declare const DASHBOARD_FOUNDATION_MAP: Record<string, FoundationClass>;
352
357
  declare const REPORT_DEFAULT_NAVIGATION_NODE_PRIORITY = 30;
353
358
  type AllowTypeDashboard = 'allow' | 'disallow' | 'allow_if_type_filled';
354
359
  declare const DASHBOARD_DETAILS_OUTLET: "dashboard-details";
@@ -932,6 +937,7 @@ declare class ContextDashboardComponent implements OnInit, OnDestroy, CanDeactiv
932
937
  private dataSub;
933
938
  private hasPermissionToEditDashboard;
934
939
  private destroy$;
940
+ private actionBarFoundationClass;
935
941
  constructor(route: ActivatedRoute, router: Router, contextDashboardService: ContextDashboardService, alert: AlertService, renderer: Renderer2, moduleConfig: ContextDashboardConfig, widgetService: WidgetService, bottomDrawerService: BottomDrawerService, gainsightService: GainsightService, actionBarService: ActionBarService, translateService: TranslateService, modal: ModalService, destroyRef: DestroyRef, contextDashboardStateService: ContextDashboardStateService<{
936
942
  [key: string]: any;
937
943
  }>, editModeService: DashboardEditModeService);
@@ -1040,6 +1046,18 @@ declare class ContextDashboardComponent implements OnInit, OnDestroy, CanDeactiv
1040
1046
  private componentToWidget;
1041
1047
  private addReportDashboardSettings;
1042
1048
  private getDashboardCopyPermissionState;
1049
+ /**
1050
+ * Adds a CSS foundation theme class (c8y-dark-theme / c8y-light-theme)
1051
+ * to dashboard classes based on the selected dashboard theme.
1052
+ * This enables branding overrides to cascade via the standard theme selectors.
1053
+ */
1054
+ private addFoundationClasses;
1055
+ /**
1056
+ * Adds/removes the foundation theme class on the action bar element,
1057
+ * which lives outside the dashboard container and cannot inherit tokens from it.
1058
+ */
1059
+ private updateActionBarTheme;
1060
+ private removeActionBarFoundationClass;
1043
1061
  private setNewState;
1044
1062
  private getDescriptionForNewState;
1045
1063
  private mapStateToHistoryDescription;
@@ -1482,10 +1500,18 @@ declare class WidgetConfigComponent implements AfterContentInit, AfterViewInit,
1482
1500
  declare class WidgetPreviewComponent {
1483
1501
  widgetConfigService: WidgetConfigService;
1484
1502
  widgetConfig: WidgetConfigComponent;
1485
- previewClasses: {
1503
+ private injector;
1504
+ showContent: i0.WritableSignal<boolean>;
1505
+ private previousClassKey;
1506
+ private _previewClasses;
1507
+ set previewClasses(value: {
1508
+ [key: string]: boolean;
1509
+ });
1510
+ get previewClasses(): {
1486
1511
  [key: string]: boolean;
1487
1512
  };
1488
1513
  get translateWidgetTitle(): boolean;
1514
+ private activeClassKey;
1489
1515
  static ɵfac: i0.ɵɵFactoryDeclaration<WidgetPreviewComponent, never>;
1490
1516
  static ɵcmp: i0.ɵɵComponentDeclaration<WidgetPreviewComponent, "c8y-widget-preview", never, { "previewClasses": { "alias": "previewClasses"; "required": false; }; }, {}, never, never, true, never>;
1491
1517
  }
@@ -1739,6 +1765,6 @@ declare class WidgetConfigFeedbackComponent implements AfterViewInit {
1739
1765
  static ɵcmp: i0.ɵɵComponentDeclaration<WidgetConfigFeedbackComponent, "c8y-widget-config-feedback", never, {}, {}, never, ["*"], true, never>;
1740
1766
  }
1741
1767
 
1742
- export { ALL_GLOBAL_ROLES_SELECTED, AddDashboardComponent, AddDashboardFactory, AppearanceSettingsComponent, 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, hookWidgetConfig, newDashboardTab };
1743
- export type { AllowTypeDashboard, CanDeactivateComponent, ContextDashboard, ContextDashboardConfig, ContextDashboardManagedObject, ContextWidgetConfig, DashboardAndWidgetThemeDefinition, DashboardChildrenState, DashboardContext, DashboardCopyClipboard, DashboardDetailsTabs, DashboardGlobalRoles, DashboardHistoryDescription, DashboardMetadata, WidgetConfigSection, WidgetConfigSectionBase, WidgetConfigSectionDefinition, WidgetConfigSectionExtension };
1768
+ export { ALL_GLOBAL_ROLES_SELECTED, AddDashboardComponent, AddDashboardFactory, AppearanceSettingsComponent, CONTEXT_DASHBOARD_CONFIG, ContextDashboardComponent, ContextDashboardModule, ContextDashboardService, ContextDashboardType, DASHBOARD_CHILDREN_STATE_NAME, DASHBOARD_DETAILS_OUTLET, DASHBOARD_DETAILS_TABS_OUTLET_NAME, DASHBOARD_FOUNDATION_MAP, DASHBOARD_SETTINGS_CHANGES, DASHBOARD_THEME_CLASSES, DashboardActionBarFactory, DashboardDetailComponent, DashboardDetailService, DashboardDetailsTabId, DeviceInfoDashboardComponent, DeviceInfoDashboardModule, DeviceManagementHomeDashboardComponent, DeviceManagementHomeDashboardModule, FOUNDATION_CLASSES, GlobalContextSectionComponent, HOOK_WIDGET_CONFIG, NewDashboardGuard, PRODUCT_EXPERIENCE, PasteDashboardActionComponent, REPORT_DEFAULT_NAVIGATION_NODE_PRIORITY, STYLING_CLASS_PREFIXES, THEME_FOUNDATION_MAP, TypeDashboardInfoComponent, WIDGET_CONTENT_CLASSES, WIDGET_FOUNDATION_MAP, WIDGET_HEADER_CLASSES, WidgetAssetSelectorComponent, WidgetConfigAppearanceComponent, WidgetConfigComponent, WidgetConfigFeedbackComponent, WidgetConfigGeneralComponent, WidgetConfigSectionComponent, WidgetConfigSectionService, WidgetConfigService, WidgetPreviewComponent, WidgetPreviewWrapperComponent, WidgetService, hookWidgetConfig, newDashboardTab };
1769
+ export type { AllowTypeDashboard, CanDeactivateComponent, ContextDashboard, ContextDashboardConfig, ContextDashboardManagedObject, ContextWidgetConfig, DashboardAndWidgetThemeDefinition, DashboardChildrenState, DashboardContext, DashboardCopyClipboard, DashboardDetailsTabs, DashboardGlobalRoles, DashboardHistoryDescription, DashboardMetadata, FoundationClass, WidgetConfigSection, WidgetConfigSectionBase, WidgetConfigSectionDefinition, WidgetConfigSectionExtension };
1744
1770
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sources":["../../context-dashboard/add-dashboard.component.ts","../../context-dashboard/add-dashboard.factory.ts","../../context-dashboard/context-dashboard.model.ts","../../context-dashboard/context-dashboard.service.ts","../../context-dashboard/dashboard-detail.service.ts","../../context-dashboard/dashboard-detail.component.ts","../../context-dashboard/memento/dashboard-originator.service.ts","../../context-dashboard/memento/dashboard-caretaker.service.ts","../../context-dashboard/memento/dashboard-edit-mode.service.ts","../../context-dashboard/widget.service.ts","../../context-dashboard/context-dashboard.component.ts","../../context-dashboard/widget-config/appearance-settings.component.ts","../../context-dashboard/type-dashboard-info/type-dashboard-info.component.ts","../../context-dashboard/widget-config-hook/widget-config-hook.model.ts","../../context-dashboard/widget-config-hook/widget-config-hook.service.ts","../../context-dashboard/widget-config.service.ts","../../context-dashboard/widget-config/widget-config-root.component.ts","../../context-dashboard/widget-config.component.ts","../../context-dashboard/widget-config/widget-preview.component.ts","../../context-dashboard/widget-config/widget-config-section.component.ts","../../context-dashboard/widget-config/widget-preview-wrapper.component.ts","../../context-dashboard/paste-dashboard-action.component.ts","../../context-dashboard/context-dashboard.module.ts","../../context-dashboard/dashboard-action-bar.factory.ts","../../context-dashboard/device-info-dashboard/device-info-dashboard.component.ts","../../context-dashboard/device-info-dashboard/device-info-dashboard.module.ts","../../context-dashboard/device-management-home-dashboard/device-management-home-dashboard.component.ts","../../context-dashboard/device-management-home-dashboard/device-management-home-dashboard.module.ts","../../context-dashboard/widget-config/widget-config-appearance.component.ts","../../context-dashboard/widget-config/widget-config-general.component.ts","../../context-dashboard/widget-config/widget-asset-selector.component.ts","../../context-dashboard/new-dashboard.guard.ts","../../context-dashboard/widget-config/global-context-section.component.ts","../../context-dashboard/widget-config/widget-config-feedback.component.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAKA;AAQI;AACA;AADQ;;;;AAoBX;;ACpBD;AACE;;;;AAMM;;AAoCP;;ACzCD;AACA;;;;;;;;;;;;;;;;;AAkBE;;AAEG;AACH;AACD;;AAGC;;;AAGG;;AAGH;;AAEG;;AAGH;;AAEG;AACH;AACE;;AAEG;AACH;;AAEF;;;AAGG;AACH;AACE;;AAEA;;AAEF;;;;;AAKG;AACH;AACA;;;;;;AAMG;AACH;AAEA;;AAEG;AACH;AACD;AAEK;;;AAGJ;AACD;;AAGC;AACA;AACA;AACA;AACA;AACA;AACA;AAAY;AAAwB;AACpC;AAAkB;AAAwB;AAC1C;AACA;AACA;AACA;AACA;;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;;ACvDD;AAOE;AACwB;AAExB;;;AAGD;;;"}
1
+ {"version":3,"file":"index.d.ts","sources":["../../context-dashboard/add-dashboard.component.ts","../../context-dashboard/add-dashboard.factory.ts","../../context-dashboard/context-dashboard.model.ts","../../context-dashboard/context-dashboard.service.ts","../../context-dashboard/dashboard-detail.service.ts","../../context-dashboard/dashboard-detail.component.ts","../../context-dashboard/memento/dashboard-originator.service.ts","../../context-dashboard/memento/dashboard-caretaker.service.ts","../../context-dashboard/memento/dashboard-edit-mode.service.ts","../../context-dashboard/widget.service.ts","../../context-dashboard/context-dashboard.component.ts","../../context-dashboard/widget-config/appearance-settings.component.ts","../../context-dashboard/type-dashboard-info/type-dashboard-info.component.ts","../../context-dashboard/widget-config-hook/widget-config-hook.model.ts","../../context-dashboard/widget-config-hook/widget-config-hook.service.ts","../../context-dashboard/widget-config.service.ts","../../context-dashboard/widget-config/widget-config-root.component.ts","../../context-dashboard/widget-config.component.ts","../../context-dashboard/widget-config/widget-preview.component.ts","../../context-dashboard/widget-config/widget-config-section.component.ts","../../context-dashboard/widget-config/widget-preview-wrapper.component.ts","../../context-dashboard/paste-dashboard-action.component.ts","../../context-dashboard/context-dashboard.module.ts","../../context-dashboard/dashboard-action-bar.factory.ts","../../context-dashboard/device-info-dashboard/device-info-dashboard.component.ts","../../context-dashboard/device-info-dashboard/device-info-dashboard.module.ts","../../context-dashboard/device-management-home-dashboard/device-management-home-dashboard.component.ts","../../context-dashboard/device-management-home-dashboard/device-management-home-dashboard.module.ts","../../context-dashboard/widget-config/widget-config-appearance.component.ts","../../context-dashboard/widget-config/widget-config-general.component.ts","../../context-dashboard/widget-config/widget-asset-selector.component.ts","../../context-dashboard/new-dashboard.guard.ts","../../context-dashboard/widget-config/global-context-section.component.ts","../../context-dashboard/widget-config/widget-config-feedback.component.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":[],"mappings":";;;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;;;;;;AAOA;AACA;;AAkRU;;;;;AAuEV;;;AAGD;;AC9VD;;;;AAiByC;;ACpCzC;AAuBc;AAjBZ;AACA;;;AAgBoB;;AAUpB;;;AAGD;;ACpCD;;;;AAkBmD;;ACnBnD;AAOE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACoE;;;AACrE;;ACPD;AAOE;;;AAQA;AAOA;;;AAGD;;ACdD;AAmBE;AACA;AACA;AACA;AAEA;;AAEG;AAEH;AAEA;;AAEG;;AAIH;;AAEG;;AAIH;;AAEG;;AAIH;;AAEG;;AAIH;;;AAGG;AACH;AAEA;;AAEG;AACG;AAsCN;;;;AAIG;AACH;AAIA;;;AAGG;AACH;;;;;AAcD;;AC7ID;AAUA;;;;;AAqBC;;ACrBD;AAaE;;AAIA;;AAIA;;;AAOA;;;;AAO+E;;;AAMhF;;ACvDD;AAOE;AACwB;AAExB;;;AAGD;;;"}
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, Component, inject, InjectionToken, EventEmitter, Output, Input, TemplateRef, ViewChild, Optional, Inject, HostListener, input, HostBinding, NgModule } from '@angular/core';
2
+ import { Injectable, Component, inject, InjectionToken, EventEmitter, Output, Input, TemplateRef, ViewChild, Injector, signal, afterNextRender, Optional, Inject, HostListener, input, HostBinding, NgModule } from '@angular/core';
3
3
  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 } from '@c8y/ngx-components';
5
5
  import * as i1 from '@angular/router';
@@ -272,6 +272,24 @@ const PRODUCT_EXPERIENCE = {
272
272
  }
273
273
  }
274
274
  };
275
+ const FOUNDATION_CLASSES = [
276
+ 'c8y-dark-theme',
277
+ 'c8y-light-theme',
278
+ 'panel-content-branded'
279
+ ];
280
+ const THEME_FOUNDATION_MAP = {
281
+ 'dashboard-theme-dark': 'c8y-dark-theme',
282
+ 'dashboard-theme-white': 'c8y-light-theme',
283
+ 'dashboard-theme-branded': 'panel-content-branded'
284
+ };
285
+ const WIDGET_FOUNDATION_MAP = {
286
+ 'panel-content-dark': 'c8y-dark-theme',
287
+ 'panel-content-white': 'c8y-light-theme'
288
+ };
289
+ const DASHBOARD_FOUNDATION_MAP = {
290
+ 'dashboard-theme-dark': 'c8y-dark-theme',
291
+ 'dashboard-theme-white': 'c8y-light-theme'
292
+ };
275
293
  const REPORT_DEFAULT_NAVIGATION_NODE_PRIORITY = 30;
276
294
  const DASHBOARD_DETAILS_OUTLET = 'dashboard-details';
277
295
  const DASHBOARD_DETAILS_TABS_OUTLET_NAME = 'dashboardTabs';
@@ -2388,20 +2406,43 @@ class WidgetPreviewComponent {
2388
2406
  constructor() {
2389
2407
  this.widgetConfigService = inject(WidgetConfigService);
2390
2408
  this.widgetConfig = inject(WidgetConfigComponent);
2391
- this.previewClasses = {
2409
+ this.injector = inject(Injector);
2410
+ // charts don't observe CSS vars — force destroy/recreate when theme changes
2411
+ this.showContent = signal(true, ...(ngDevMode ? [{ debugName: "showContent" }] : []));
2412
+ this.previousClassKey = '';
2413
+ this._previewClasses = {
2392
2414
  'dashboard-theme-light': true,
2393
2415
  'panel-title-regular': true
2394
2416
  };
2395
2417
  }
2418
+ set previewClasses(value) {
2419
+ this._previewClasses = value;
2420
+ const classKey = this.activeClassKey(value);
2421
+ if (this.previousClassKey && classKey !== this.previousClassKey) {
2422
+ this.showContent.set(false);
2423
+ afterNextRender(() => this.showContent.set(true), { injector: this.injector });
2424
+ }
2425
+ this.previousClassKey = classKey;
2426
+ }
2427
+ get previewClasses() {
2428
+ return this._previewClasses;
2429
+ }
2396
2430
  get translateWidgetTitle() {
2397
2431
  return this.widgetConfig?.mo.c8y_Dashboard.translateWidgetTitle ?? false;
2398
2432
  }
2433
+ activeClassKey(classes) {
2434
+ return Object.entries(classes ?? {})
2435
+ .filter(([, v]) => v)
2436
+ .map(([k]) => k)
2437
+ .sort()
2438
+ .join(' ');
2439
+ }
2399
2440
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: WidgetPreviewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2400
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: WidgetPreviewComponent, isStandalone: true, selector: "c8y-widget-preview", inputs: { previewClasses: "previewClasses" }, ngImport: i0, template: "<fieldset class=\"c8y-fieldset p-l-24 p-r-24 p-t-16 p-b-16\">\n <legend>{{ 'Preview' | translate }}</legend>\n <c8y-dashboard\n class=\"dashboard-preview-slot\"\n [columns]=\"1\"\n [ngClass]=\"previewClasses\"\n >\n <c8y-dashboard-child\n [isFrozen]=\"true\"\n [width]=\"1\"\n [height]=\"6\"\n >\n <c8y-dashboard-child-title>\n <span>\n {{\n (widgetConfigService.selected$ | async)?.data?.title\n | translate: { noTranslateRemoveContext: !translateWidgetTitle }\n }}\n </span>\n </c8y-dashboard-child-title>\n\n @if ((widgetConfigService.previewViewState$ | async) === 'noPreview') {\n <div class=\"fit-h d-flex d-col j-c-center a-i-center\">\n <c8y-ui-empty-state\n [icon]=\"'visibility-off'\"\n [title]=\"'No preview available.' | translate\"\n [subtitle]=\"'This widget does not provide any preview.' | translate\"\n [horizontal]=\"false\"\n ></c8y-ui-empty-state>\n </div>\n }\n\n @if ((widgetConfigService.previewViewState$ | async) === 'configPreview') {\n <c8y-dynamic-component\n [componentId]=\"(widgetConfigService.selected$ | async)?.id\"\n [config]=\"(widgetConfigService.currentConfig$ | async)?.config\"\n ></c8y-dynamic-component>\n }\n\n @if ((widgetConfigService.previewViewState$ | async) === 'templatePreview') {\n <ng-template [ngTemplateOutlet]=\"widgetConfigService.preview$ | async\"></ng-template>\n }\n </c8y-dashboard-child>\n </c8y-dashboard>\n</fieldset>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: CoreModule }, { kind: "component", type: i2.EmptyStateComponent, selector: "c8y-ui-empty-state", inputs: ["icon", "title", "subtitle", "horizontal"] }, { kind: "component", type: i2.DynamicComponentComponent, selector: "c8y-dynamic-component", inputs: ["componentId", "config", "mode", "notFoundError", "executeResolvers"], outputs: ["updateWidgetClasses"] }, { kind: "component", type: i2.DashboardComponent, selector: "c8y-dashboard", inputs: ["columns", "gap", "rows"], outputs: ["dashboardChange"] }, { kind: "component", type: i2.DashboardChildComponent, selector: "c8y-dashboard-child", inputs: ["x", "y", "width", "height", "data", "margin", "useIntersection", "isFrozen", "canToggleFullscreen", "editMode", "class"], outputs: ["changeStart", "changeEnd", "toggleFullscreen"] }, { kind: "component", type: i2.DashboardChildTitleComponent, selector: "c8y-dashboard-child-title" }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }] }); }
2441
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: WidgetPreviewComponent, isStandalone: true, selector: "c8y-widget-preview", inputs: { previewClasses: "previewClasses" }, ngImport: i0, template: "<fieldset class=\"c8y-fieldset p-l-24 p-r-24 p-t-16 p-b-16 flex-grow d-flex d-col min-height-0\">\n <legend>{{ 'Preview' | translate }}</legend>\n <c8y-dashboard\n class=\"dashboard-preview-slot flex-grow min-height-0\"\n [columns]=\"1\"\n [ngClass]=\"previewClasses\"\n >\n @if (showContent()) {\n <c8y-dashboard-child\n [isFrozen]=\"true\"\n [width]=\"1\"\n [height]=\"6\"\n >\n @let widgetTitle =\n (widgetConfigService.selected$ | async)?.data?.title\n | translate: { noTranslateRemoveContext: !translateWidgetTitle };\n <c8y-dashboard-child-title [attr.title]=\"widgetTitle\">\n <span>\n {{ widgetTitle }}\n </span>\n </c8y-dashboard-child-title>\n\n @if ((widgetConfigService.previewViewState$ | async) === 'noPreview') {\n <div class=\"fit-h d-flex d-col j-c-center a-i-center\">\n <c8y-ui-empty-state\n [icon]=\"'visibility-off'\"\n [title]=\"'No preview available.' | translate\"\n [subtitle]=\"'This widget does not provide any preview.' | translate\"\n [horizontal]=\"false\"\n ></c8y-ui-empty-state>\n </div>\n }\n\n @if ((widgetConfigService.previewViewState$ | async) === 'configPreview') {\n <c8y-dynamic-component\n [componentId]=\"(widgetConfigService.selected$ | async)?.id\"\n [config]=\"(widgetConfigService.currentConfig$ | async)?.config\"\n ></c8y-dynamic-component>\n }\n\n @if ((widgetConfigService.previewViewState$ | async) === 'templatePreview') {\n <ng-template [ngTemplateOutlet]=\"widgetConfigService.preview$ | async\"></ng-template>\n }\n </c8y-dashboard-child>\n }\n </c8y-dashboard>\n</fieldset>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: CoreModule }, { kind: "component", type: i2.EmptyStateComponent, selector: "c8y-ui-empty-state", inputs: ["icon", "title", "subtitle", "horizontal"] }, { kind: "component", type: i2.DynamicComponentComponent, selector: "c8y-dynamic-component", inputs: ["componentId", "config", "mode", "notFoundError", "executeResolvers"], outputs: ["updateWidgetClasses"] }, { kind: "component", type: i2.DashboardComponent, selector: "c8y-dashboard", inputs: ["columns", "gap", "rows"], outputs: ["dashboardChange"] }, { kind: "component", type: i2.DashboardChildComponent, selector: "c8y-dashboard-child", inputs: ["x", "y", "width", "height", "data", "margin", "useIntersection", "isFrozen", "canToggleFullscreen", "editMode", "class"], outputs: ["changeStart", "changeEnd", "toggleFullscreen"] }, { kind: "component", type: i2.DashboardChildTitleComponent, selector: "c8y-dashboard-child-title" }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }] }); }
2401
2442
  }
2402
2443
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: WidgetPreviewComponent, decorators: [{
2403
2444
  type: Component,
2404
- args: [{ selector: 'c8y-widget-preview', standalone: true, imports: [NgClass, C8yTranslatePipe, CommonModule, CoreModule], template: "<fieldset class=\"c8y-fieldset p-l-24 p-r-24 p-t-16 p-b-16\">\n <legend>{{ 'Preview' | translate }}</legend>\n <c8y-dashboard\n class=\"dashboard-preview-slot\"\n [columns]=\"1\"\n [ngClass]=\"previewClasses\"\n >\n <c8y-dashboard-child\n [isFrozen]=\"true\"\n [width]=\"1\"\n [height]=\"6\"\n >\n <c8y-dashboard-child-title>\n <span>\n {{\n (widgetConfigService.selected$ | async)?.data?.title\n | translate: { noTranslateRemoveContext: !translateWidgetTitle }\n }}\n </span>\n </c8y-dashboard-child-title>\n\n @if ((widgetConfigService.previewViewState$ | async) === 'noPreview') {\n <div class=\"fit-h d-flex d-col j-c-center a-i-center\">\n <c8y-ui-empty-state\n [icon]=\"'visibility-off'\"\n [title]=\"'No preview available.' | translate\"\n [subtitle]=\"'This widget does not provide any preview.' | translate\"\n [horizontal]=\"false\"\n ></c8y-ui-empty-state>\n </div>\n }\n\n @if ((widgetConfigService.previewViewState$ | async) === 'configPreview') {\n <c8y-dynamic-component\n [componentId]=\"(widgetConfigService.selected$ | async)?.id\"\n [config]=\"(widgetConfigService.currentConfig$ | async)?.config\"\n ></c8y-dynamic-component>\n }\n\n @if ((widgetConfigService.previewViewState$ | async) === 'templatePreview') {\n <ng-template [ngTemplateOutlet]=\"widgetConfigService.preview$ | async\"></ng-template>\n }\n </c8y-dashboard-child>\n </c8y-dashboard>\n</fieldset>\n" }]
2445
+ args: [{ selector: 'c8y-widget-preview', standalone: true, imports: [NgClass, C8yTranslatePipe, CommonModule, CoreModule], template: "<fieldset class=\"c8y-fieldset p-l-24 p-r-24 p-t-16 p-b-16 flex-grow d-flex d-col min-height-0\">\n <legend>{{ 'Preview' | translate }}</legend>\n <c8y-dashboard\n class=\"dashboard-preview-slot flex-grow min-height-0\"\n [columns]=\"1\"\n [ngClass]=\"previewClasses\"\n >\n @if (showContent()) {\n <c8y-dashboard-child\n [isFrozen]=\"true\"\n [width]=\"1\"\n [height]=\"6\"\n >\n @let widgetTitle =\n (widgetConfigService.selected$ | async)?.data?.title\n | translate: { noTranslateRemoveContext: !translateWidgetTitle };\n <c8y-dashboard-child-title [attr.title]=\"widgetTitle\">\n <span>\n {{ widgetTitle }}\n </span>\n </c8y-dashboard-child-title>\n\n @if ((widgetConfigService.previewViewState$ | async) === 'noPreview') {\n <div class=\"fit-h d-flex d-col j-c-center a-i-center\">\n <c8y-ui-empty-state\n [icon]=\"'visibility-off'\"\n [title]=\"'No preview available.' | translate\"\n [subtitle]=\"'This widget does not provide any preview.' | translate\"\n [horizontal]=\"false\"\n ></c8y-ui-empty-state>\n </div>\n }\n\n @if ((widgetConfigService.previewViewState$ | async) === 'configPreview') {\n <c8y-dynamic-component\n [componentId]=\"(widgetConfigService.selected$ | async)?.id\"\n [config]=\"(widgetConfigService.currentConfig$ | async)?.config\"\n ></c8y-dynamic-component>\n }\n\n @if ((widgetConfigService.previewViewState$ | async) === 'templatePreview') {\n <ng-template [ngTemplateOutlet]=\"widgetConfigService.preview$ | async\"></ng-template>\n }\n </c8y-dashboard-child>\n }\n </c8y-dashboard>\n</fieldset>\n" }]
2405
2446
  }], propDecorators: { previewClasses: [{
2406
2447
  type: Input
2407
2448
  }] } });
@@ -2641,7 +2682,37 @@ class WidgetConfigComponent {
2641
2682
  cssClasses[this.styling.contentClass] = true;
2642
2683
  }
2643
2684
  if (isPreview) {
2644
- cssClasses[`dashboard-theme-${this.defaultStyling.contentClass.split('-').pop()}`] = true;
2685
+ // When the widget has its own explicit theme (dark/white/branded), the preview
2686
+ // should use the widget's theme — not the dashboard's. In the actual dashboard,
2687
+ // dark/white widgets only get their own theme tokens, not the dashboard's branded
2688
+ // overrides. "Match dashboard" (panel-content-light) and non-theme content classes
2689
+ // (e.g. transparent) inherit the dashboard theme.
2690
+ const widgetSuffix = this.styling.contentClass.split('-').pop();
2691
+ const explicitWidgetThemes = new Set(['dark', 'white', 'branded']);
2692
+ const themeSuffix = explicitWidgetThemes.has(widgetSuffix)
2693
+ ? widgetSuffix
2694
+ : this.defaultStyling.contentClass.split('-').pop();
2695
+ cssClasses[`dashboard-theme-${themeSuffix}`] = true;
2696
+ }
2697
+ // Add foundation theme class so branding overrides cascade into the preview.
2698
+ // Widget-level content class takes priority over dashboard-level theme.
2699
+ let foundationClass = null;
2700
+ for (const [cls, fc] of Object.entries(WIDGET_FOUNDATION_MAP)) {
2701
+ if (cssClasses[cls]) {
2702
+ foundationClass = fc;
2703
+ break;
2704
+ }
2705
+ }
2706
+ if (!foundationClass) {
2707
+ for (const [cls, fc] of Object.entries(DASHBOARD_FOUNDATION_MAP)) {
2708
+ if (cssClasses[cls]) {
2709
+ foundationClass = fc;
2710
+ break;
2711
+ }
2712
+ }
2713
+ }
2714
+ if (foundationClass) {
2715
+ cssClasses[foundationClass] = true;
2645
2716
  }
2646
2717
  return cssClasses;
2647
2718
  }
@@ -2792,6 +2863,7 @@ class ContextDashboardComponent {
2792
2863
  other instances.`);
2793
2864
  this.hasPermissionToEditDashboard = false;
2794
2865
  this.destroy$ = new Subject();
2866
+ this.actionBarFoundationClass = null;
2795
2867
  }
2796
2868
  ngOnInit() {
2797
2869
  if (!this.name) {
@@ -2831,6 +2903,7 @@ class ContextDashboardComponent {
2831
2903
  if (this.dataSub) {
2832
2904
  this.dataSub.unsubscribe();
2833
2905
  }
2906
+ this.removeActionBarFoundationClass();
2834
2907
  this.contextDashboardStateService.setSelectedDashboard(null);
2835
2908
  }
2836
2909
  /**
@@ -3024,7 +3097,7 @@ class ContextDashboardComponent {
3024
3097
  ]);
3025
3098
  }
3026
3099
  }
3027
- catch (ex) {
3100
+ catch {
3028
3101
  // intended empty
3029
3102
  }
3030
3103
  }
@@ -3108,7 +3181,9 @@ class ContextDashboardComponent {
3108
3181
  */
3109
3182
  addDashboardClassToBody() {
3110
3183
  this.class.split(' ').forEach(cssClass => {
3111
- this.renderer.addClass(document.body, cssClass);
3184
+ if (!FOUNDATION_CLASSES.includes(cssClass)) {
3185
+ this.renderer.addClass(document.body, cssClass);
3186
+ }
3112
3187
  });
3113
3188
  }
3114
3189
  /**
@@ -3117,7 +3192,9 @@ class ContextDashboardComponent {
3117
3192
  */
3118
3193
  removeDashboardClassFromBody() {
3119
3194
  this.class.split(' ').forEach(cssClass => {
3120
- this.renderer.removeClass(document.body, cssClass);
3195
+ if (!FOUNDATION_CLASSES.includes(cssClass)) {
3196
+ this.renderer.removeClass(document.body, cssClass);
3197
+ }
3121
3198
  });
3122
3199
  }
3123
3200
  async onLoad(trackExperience) {
@@ -3136,6 +3213,8 @@ class ContextDashboardComponent {
3136
3213
  dashboard: true,
3137
3214
  ...this.dashboard?.classes
3138
3215
  };
3216
+ this.addFoundationClasses(dashboardClasses);
3217
+ this.updateActionBarTheme(dashboardClasses);
3139
3218
  this.isCopyDisabled = this.dashboard
3140
3219
  ? this.getDashboardCopyPermissionState()
3141
3220
  : { state: false, reason: null };
@@ -3164,6 +3243,8 @@ class ContextDashboardComponent {
3164
3243
  dashboard: true,
3165
3244
  ...layoutChanges.classes
3166
3245
  };
3246
+ this.addFoundationClasses(dashboardClasses);
3247
+ this.updateActionBarTheme(dashboardClasses);
3167
3248
  this.class = Object.keys(dashboardClasses).join(' ');
3168
3249
  }
3169
3250
  else if (this.dashboard) {
@@ -3267,6 +3348,45 @@ class ContextDashboardComponent {
3267
3348
  }
3268
3349
  return { state: true };
3269
3350
  }
3351
+ /**
3352
+ * Adds a CSS foundation theme class (c8y-dark-theme / c8y-light-theme)
3353
+ * to dashboard classes based on the selected dashboard theme.
3354
+ * This enables branding overrides to cascade via the standard theme selectors.
3355
+ */
3356
+ addFoundationClasses(dashboardClasses) {
3357
+ for (const [themeClass, foundationClass] of Object.entries(THEME_FOUNDATION_MAP)) {
3358
+ if (dashboardClasses[themeClass]) {
3359
+ dashboardClasses[foundationClass] = true;
3360
+ }
3361
+ }
3362
+ }
3363
+ /**
3364
+ * Adds/removes the foundation theme class on the action bar element,
3365
+ * which lives outside the dashboard container and cannot inherit tokens from it.
3366
+ */
3367
+ updateActionBarTheme(dashboardClasses) {
3368
+ const actionBar = document.querySelector('.c8y-ui-action-bar');
3369
+ if (!actionBar) {
3370
+ return;
3371
+ }
3372
+ this.removeActionBarFoundationClass();
3373
+ for (const [themeClass, foundationClass] of Object.entries(THEME_FOUNDATION_MAP)) {
3374
+ if (dashboardClasses[themeClass]) {
3375
+ this.renderer.addClass(actionBar, foundationClass);
3376
+ this.actionBarFoundationClass = foundationClass;
3377
+ break;
3378
+ }
3379
+ }
3380
+ }
3381
+ removeActionBarFoundationClass() {
3382
+ if (this.actionBarFoundationClass) {
3383
+ const actionBar = document.querySelector('.c8y-ui-action-bar');
3384
+ if (actionBar) {
3385
+ this.renderer.removeClass(actionBar, this.actionBarFoundationClass);
3386
+ }
3387
+ this.actionBarFoundationClass = null;
3388
+ }
3389
+ }
3270
3390
  setNewState(state, descriptionProp, widgetsChanged) {
3271
3391
  const description = this.getDescriptionForNewState(descriptionProp, widgetsChanged);
3272
3392
  this.editModeService.newState({ ...state, changeHistory: description });
@@ -4390,5 +4510,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
4390
4510
  * Generated bundle index. Do not edit.
4391
4511
  */
4392
4512
 
4393
- export { ALL_GLOBAL_ROLES_SELECTED, AddDashboardComponent, AddDashboardFactory, AppearanceSettingsComponent, 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, hookWidgetConfig, newDashboardTab };
4513
+ export { ALL_GLOBAL_ROLES_SELECTED, AddDashboardComponent, AddDashboardFactory, AppearanceSettingsComponent, CONTEXT_DASHBOARD_CONFIG, ContextDashboardComponent, ContextDashboardModule, ContextDashboardService, ContextDashboardType, DASHBOARD_CHILDREN_STATE_NAME, DASHBOARD_DETAILS_OUTLET, DASHBOARD_DETAILS_TABS_OUTLET_NAME, DASHBOARD_FOUNDATION_MAP, DASHBOARD_SETTINGS_CHANGES, DASHBOARD_THEME_CLASSES, DashboardActionBarFactory, DashboardDetailComponent, DashboardDetailService, DashboardDetailsTabId, DeviceInfoDashboardComponent, DeviceInfoDashboardModule, DeviceManagementHomeDashboardComponent, DeviceManagementHomeDashboardModule, FOUNDATION_CLASSES, GlobalContextSectionComponent, HOOK_WIDGET_CONFIG, NewDashboardGuard, PRODUCT_EXPERIENCE, PasteDashboardActionComponent, REPORT_DEFAULT_NAVIGATION_NODE_PRIORITY, STYLING_CLASS_PREFIXES, THEME_FOUNDATION_MAP, TypeDashboardInfoComponent, WIDGET_CONTENT_CLASSES, WIDGET_FOUNDATION_MAP, WIDGET_HEADER_CLASSES, WidgetAssetSelectorComponent, WidgetConfigAppearanceComponent, WidgetConfigComponent, WidgetConfigFeedbackComponent, WidgetConfigGeneralComponent, WidgetConfigSectionComponent, WidgetConfigSectionService, WidgetConfigService, WidgetPreviewComponent, WidgetPreviewWrapperComponent, WidgetService, hookWidgetConfig, newDashboardTab };
4394
4514
  //# sourceMappingURL=c8y-ngx-components-context-dashboard.mjs.map