@siemens/element-ng 51.3.0 → 51.4.0

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.
Files changed (40) hide show
  1. package/fesm2022/siemens-element-ng-breadcrumb.mjs +8 -46
  2. package/fesm2022/siemens-element-ng-breadcrumb.mjs.map +1 -1
  3. package/fesm2022/siemens-element-ng-chat-messages.mjs +2 -2
  4. package/fesm2022/siemens-element-ng-chat-messages.mjs.map +1 -1
  5. package/fesm2022/siemens-element-ng-common.mjs +5 -0
  6. package/fesm2022/siemens-element-ng-common.mjs.map +1 -1
  7. package/fesm2022/siemens-element-ng-dashboard.mjs +2 -3
  8. package/fesm2022/siemens-element-ng-dashboard.mjs.map +1 -1
  9. package/fesm2022/siemens-element-ng-filtered-search.mjs +255 -160
  10. package/fesm2022/siemens-element-ng-filtered-search.mjs.map +1 -1
  11. package/fesm2022/siemens-element-ng-formly.mjs +12 -8
  12. package/fesm2022/siemens-element-ng-formly.mjs.map +1 -1
  13. package/fesm2022/siemens-element-ng-maplibre.mjs +293 -10
  14. package/fesm2022/siemens-element-ng-maplibre.mjs.map +1 -1
  15. package/fesm2022/siemens-element-ng-markdown-extensions-katex.mjs +2 -2
  16. package/fesm2022/siemens-element-ng-markdown-extensions-katex.mjs.map +1 -1
  17. package/fesm2022/siemens-element-ng-popover.mjs +3 -1
  18. package/fesm2022/siemens-element-ng-popover.mjs.map +1 -1
  19. package/fesm2022/siemens-element-ng-shadow-root.mjs +54 -1
  20. package/fesm2022/siemens-element-ng-shadow-root.mjs.map +1 -1
  21. package/fesm2022/siemens-element-ng-theme.mjs +59 -23
  22. package/fesm2022/siemens-element-ng-theme.mjs.map +1 -1
  23. package/fesm2022/siemens-element-ng-tooltip.mjs +82 -10
  24. package/fesm2022/siemens-element-ng-tooltip.mjs.map +1 -1
  25. package/fesm2022/siemens-element-ng-translate.mjs.map +1 -1
  26. package/fesm2022/siemens-element-ng-tree-view.mjs +2 -2
  27. package/fesm2022/siemens-element-ng-tree-view.mjs.map +1 -1
  28. package/maplibre/styles/maplibre-gl.scss +4 -0
  29. package/package.json +7 -7
  30. package/template-i18n.json +6 -0
  31. package/types/siemens-element-ng-breadcrumb.d.ts +1 -1
  32. package/types/siemens-element-ng-common.d.ts +5 -0
  33. package/types/siemens-element-ng-dashboard.d.ts +0 -1
  34. package/types/siemens-element-ng-filtered-search.d.ts +26 -10
  35. package/types/siemens-element-ng-maplibre.d.ts +112 -5
  36. package/types/siemens-element-ng-popover.d.ts +1 -0
  37. package/types/siemens-element-ng-shadow-root.d.ts +16 -1
  38. package/types/siemens-element-ng-theme.d.ts +35 -7
  39. package/types/siemens-element-ng-tooltip.d.ts +14 -1
  40. package/types/siemens-element-ng-translate.d.ts +6 -0
@@ -1 +1 @@
1
- {"version":3,"file":"siemens-element-ng-markdown-extensions-katex.mjs","sources":["../../../../projects/element-ng/markdown/extensions/katex/si-markdown-katex.component.ts","../../../../projects/element-ng/markdown/extensions/katex/si-markdown-katex.extension.ts","../../../../projects/element-ng/markdown/extensions/katex/index.ts","../../../../projects/element-ng/markdown/extensions/katex/siemens-element-ng-markdown-extensions-katex.ts"],"sourcesContent":["/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport {\n Component,\n computed,\n effect,\n ElementRef,\n inject,\n input,\n ViewEncapsulation\n} from '@angular/core';\nimport { type SiMarkdownExtensionComponent } from '@siemens/element-ng/markdown';\nimport { type KatexOptions, render } from 'katex';\nimport { Literal, type Node, type Parent } from 'mdast';\n\n@Component({\n selector: 'si-markdown-katex',\n template: '',\n styleUrl: 'si-markdown-katex.component.scss',\n // this is necessary for the styles to work correctly\n // eslint-disable-next-line @angular-eslint/use-component-view-encapsulation\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'katex-container',\n '[attr.data-line]': 'node().position?.start?.line',\n '[class.d-block]': 'displayMode()'\n }\n})\nexport class SiMarkdownKatexComponent implements SiMarkdownExtensionComponent {\n private readonly elementRef = inject(ElementRef);\n\n readonly node = input.required<Node>();\n readonly parent = input.required<Parent>();\n readonly options = input<KatexOptions>();\n\n protected readonly displayMode = computed(() => this.node().type === 'math');\n private readonly expr = computed(() => (this.node() as Literal).value);\n\n constructor() {\n effect(() => this.render());\n }\n\n private render(): void {\n const expr = this.expr();\n const options = this.options() ?? {};\n render(expr, this.elementRef.nativeElement, {\n ...options,\n displayMode: this.displayMode(),\n throwOnError: false\n });\n }\n}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { type SiMarkdownExtension } from '@siemens/element-ng/markdown';\n/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { type KatexOptions } from 'katex';\nimport remarkMath, { type Options } from 'remark-math';\n\nimport { SiMarkdownKatexComponent } from './si-markdown-katex.component';\n\n/**\n * An extension to render LaTeX math expressions using KaTeX. Uses `remark-math` to parse\n * the expressions inside the markdown document.\n * @param parseOptions - options passed to `remark-math`\n * @param katexOptions - options passed to `katex`\n * @returns extension for `SiMarkdownOption.installExtension()`\n */\nexport const siMarkdownMathKaTeX = (\n parseOptions?: Options,\n katexOptions?: KatexOptions\n): SiMarkdownExtension => {\n katexOptions ??= {\n output: 'html'\n };\n\n return {\n plugins: [{ plugin: remarkMath, options: parseOptions }],\n types: [\n { type: 'math', component: SiMarkdownKatexComponent, options: katexOptions },\n { type: 'inlineMath', component: SiMarkdownKatexComponent, options: katexOptions }\n ]\n };\n};\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nexport * from './si-markdown-katex.extension';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;AAGG;MA2BU,wBAAwB,CAAA;AAClB,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;IAEvC,IAAI,GAAG,KAAK,CAAC,QAAQ;6EAAQ;IAC7B,MAAM,GAAG,KAAK,CAA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B,wBAAA,kBAAkB,EAAE,8BAA8B;AAClD,wBAAA,iBAAiB,EAAE;AACpB,qBAAA,EAAA,MAAA,EAAA,CAAA,yqj5CAAA,CAAA,EAAA;;;ACdH;;;;;;AAMG;MACU,mBAAmB,GAAG,CACjC,YAAsB,EACtB,YAA2B,KACJ;AACvB,IAAA,YAAY,KAAK;AACf,QAAA,MAAM,EAAE;KACT;IAED,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;AACxD,QAAA,KAAK,EAAE;YACL,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,wBAAwB,EAAE,OAAO,EAAE,YAAY,EAAE;YAC5E,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,wBAAwB,EAAE,OAAO,EAAE,YAAY;AACjF;KACF;AACH;;ACpCA;;;AAGG;;ACHH;;AAEG;;"}
1
+ {"version":3,"file":"siemens-element-ng-markdown-extensions-katex.mjs","sources":["../../../../projects/element-ng/markdown/extensions/katex/si-markdown-katex.component.ts","../../../../projects/element-ng/markdown/extensions/katex/si-markdown-katex.extension.ts","../../../../projects/element-ng/markdown/extensions/katex/index.ts","../../../../projects/element-ng/markdown/extensions/katex/siemens-element-ng-markdown-extensions-katex.ts"],"sourcesContent":["/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport {\n Component,\n computed,\n effect,\n ElementRef,\n inject,\n input,\n ViewEncapsulation\n} from '@angular/core';\nimport { type SiMarkdownExtensionComponent } from '@siemens/element-ng/markdown';\nimport { type KatexOptions, render } from 'katex';\nimport { Literal, type Node, type Parent } from 'mdast';\n\n@Component({\n selector: 'si-markdown-katex',\n template: '',\n styleUrl: 'si-markdown-katex.component.scss',\n // this is necessary for the styles to work correctly\n // eslint-disable-next-line @angular-eslint/use-component-view-encapsulation\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'katex-container',\n '[attr.data-line]': 'node().position?.start?.line',\n '[class.d-block]': 'displayMode()'\n }\n})\nexport class SiMarkdownKatexComponent implements SiMarkdownExtensionComponent {\n private readonly elementRef = inject(ElementRef);\n\n readonly node = input.required<Node>();\n readonly parent = input.required<Parent>();\n readonly options = input<KatexOptions>();\n\n protected readonly displayMode = computed(() => this.node().type === 'math');\n private readonly expr = computed(() => (this.node() as Literal).value);\n\n constructor() {\n effect(() => this.render());\n }\n\n private render(): void {\n const expr = this.expr();\n const options = this.options() ?? {};\n render(expr, this.elementRef.nativeElement, {\n ...options,\n displayMode: this.displayMode(),\n throwOnError: false\n });\n }\n}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { type SiMarkdownExtension } from '@siemens/element-ng/markdown';\n/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { type KatexOptions } from 'katex';\nimport remarkMath, { type Options } from 'remark-math';\n\nimport { SiMarkdownKatexComponent } from './si-markdown-katex.component';\n\n/**\n * An extension to render LaTeX math expressions using KaTeX. Uses `remark-math` to parse\n * the expressions inside the markdown document.\n * @param parseOptions - options passed to `remark-math`\n * @param katexOptions - options passed to `katex`\n * @returns extension for `SiMarkdownOption.installExtension()`\n */\nexport const siMarkdownMathKaTeX = (\n parseOptions?: Options,\n katexOptions?: KatexOptions\n): SiMarkdownExtension => {\n katexOptions ??= {\n output: 'html'\n };\n\n return {\n plugins: [{ plugin: remarkMath, options: parseOptions }],\n types: [\n { type: 'math', component: SiMarkdownKatexComponent, options: katexOptions },\n { type: 'inlineMath', component: SiMarkdownKatexComponent, options: katexOptions }\n ]\n };\n};\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nexport * from './si-markdown-katex.extension';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;AAGG;MA2BU,wBAAwB,CAAA;AAClB,IAAA,UAAU,GAAG,MAAM,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AAA,aAAA,EAIG,iBAAiB,CAAC,IAAI,EAAA,IAAA,EAC/B;AACJ,wBAAA,KAAK,EAAE,iBAAiB;AACxB,wBAAA,kBAAkB,EAAE,8BAA8B;AAClD,wBAAA,iBAAiB,EAAE;AACpB,qBAAA,EAAA,MAAA,EAAA,CAAA,8qj5CAAA,CAAA,EAAA;;;ACdH;;;;;;AAMG;MACU,mBAAmB,GAAG,CACjC,YAAsB,EACtB,YAA2B,KACJ;AACvB,IAAA,YAAY,KAAK;AACf,QAAA,MAAM,EAAE;KACT;IAED,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;AACxD,QAAA,KAAK,EAAE;YACL,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,wBAAwB,EAAE,OAAO,EAAE,YAAY,EAAE;YAC5E,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,wBAAwB,EAAE,OAAO,EAAE,YAAY;AACjF;KACF;AACH;;ACpCA;;;AAGG;;ACHH;;AAEG;;"}
@@ -37,6 +37,7 @@ class PopoverComponent {
37
37
  elementRef = inject(ElementRef);
38
38
  focusTrapFactory = inject(ConfigurableFocusTrapFactory);
39
39
  focusTrap;
40
+ focusTimeoutId;
40
41
  previouslyActiveElement = inject(DOCUMENT).activeElement;
41
42
  ngOnInit() {
42
43
  const popoverDirective = this.popoverDirective();
@@ -49,6 +50,7 @@ class PopoverComponent {
49
50
  this.applyFocus();
50
51
  }
51
52
  ngOnDestroy() {
53
+ clearTimeout(this.focusTimeoutId);
52
54
  this.focusTrap?.destroy();
53
55
  if (this.previouslyActiveElement &&
54
56
  'focus' in this.previouslyActiveElement &&
@@ -69,7 +71,7 @@ class PopoverComponent {
69
71
  }
70
72
  applyFocus() {
71
73
  // Using setTimeout ensures that SR first read `expanded` before we move the focus.
72
- setTimeout(async () => {
74
+ this.focusTimeoutId = setTimeout(async () => {
73
75
  const popoverWrapperEl = this.popoverWrapper().nativeElement;
74
76
  this.focusTrap = this.focusTrapFactory.create(this.popoverWrapper().nativeElement);
75
77
  const moved = await this.focusTrap.focusFirstTabbableElementWhenReady();
@@ -1 +1 @@
1
- {"version":3,"file":"siemens-element-ng-popover.mjs","sources":["../../../../projects/element-ng/popover/si-popover.component.ts","../../../../projects/element-ng/popover/si-popover.component.html","../../../../projects/element-ng/popover/si-popover.directive.ts","../../../../projects/element-ng/popover/si-popover-title.directive.ts","../../../../projects/element-ng/popover/si-popover-body.directive.ts","../../../../projects/element-ng/popover/index.ts","../../../../projects/element-ng/popover/siemens-element-ng-popover.ts"],"sourcesContent":["/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { ConfigurableFocusTrap, ConfigurableFocusTrapFactory } from '@angular/cdk/a11y';\nimport { ConnectedOverlayPositionChange } from '@angular/cdk/overlay';\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n Component,\n ElementRef,\n inject,\n Injector,\n input,\n OnDestroy,\n OnInit,\n signal,\n TemplateRef,\n viewChild,\n DOCUMENT,\n computed,\n ChangeDetectionStrategy\n} from '@angular/core';\nimport { calculateOverlayArrowPosition, OverlayArrowPosition } from '@siemens/element-ng/common';\nimport { SiIconComponent } from '@siemens/element-ng/icon';\nimport { SiTranslatePipe } from '@siemens/element-translate-ng/translate';\n\nimport { SiPopoverDirective } from './si-popover.directive';\n\n@Component({\n selector: 'si-popover',\n imports: [NgTemplateOutlet, SiIconComponent, SiTranslatePipe],\n templateUrl: './si-popover.component.html',\n changeDetection: ChangeDetectionStrategy.Eager,\n host: {\n '[id]': 'this.popoverDirective().popoverId'\n }\n})\nexport class PopoverComponent implements OnInit, OnDestroy {\n /** The directive that supplies and controls the popover content. */\n readonly popoverDirective = input.required<SiPopoverDirective>();\n readonly popoverWrapper = viewChild.required<ElementRef>('popoverWrapper');\n\n /** @internal */\n labelledBy: string | undefined;\n /** @internal */\n describedBy: string | undefined;\n protected readonly positionClass = signal('');\n protected readonly arrowPos = signal<OverlayArrowPosition | undefined>(undefined);\n protected readonly description = computed(() => {\n const description = this.popoverDirective().siPopover();\n return !(description instanceof TemplateRef) ? description : undefined;\n });\n protected popoverTemplate: TemplateRef<any> | null = null;\n protected injector = inject(Injector);\n\n private elementRef = inject(ElementRef);\n private focusTrapFactory = inject(ConfigurableFocusTrapFactory);\n private focusTrap?: ConfigurableFocusTrap;\n private readonly previouslyActiveElement = inject(DOCUMENT).activeElement;\n\n ngOnInit(): void {\n const popoverDirective = this.popoverDirective();\n const popover = popoverDirective.siPopover();\n if (popover instanceof TemplateRef) {\n this.popoverTemplate = popover;\n }\n this.labelledBy = `__popover-title_${popoverDirective.popoverCounter}`;\n this.describedBy = `__popover-body_${popoverDirective.popoverCounter}`;\n\n this.applyFocus();\n }\n\n ngOnDestroy(): void {\n this.focusTrap?.destroy();\n if (\n this.previouslyActiveElement &&\n 'focus' in this.previouslyActiveElement &&\n typeof this.previouslyActiveElement.focus === 'function'\n ) {\n this.previouslyActiveElement.focus();\n }\n }\n\n /** @internal */\n updateArrow(change: ConnectedOverlayPositionChange, anchor?: ElementRef): void {\n const positionClass = `popover-${change.connectionPair.overlayX}-${change.connectionPair.overlayY}`;\n // need two updates as class changes affect the position\n this.positionClass.set(positionClass);\n const arrowPos = calculateOverlayArrowPosition(change, this.elementRef, anchor);\n this.arrowPos.set(arrowPos);\n }\n\n hide(): void {\n this.popoverDirective().hide();\n }\n\n private applyFocus(): void {\n // Using setTimeout ensures that SR first read `expanded` before we move the focus.\n setTimeout(async () => {\n const popoverWrapperEl = this.popoverWrapper().nativeElement;\n this.focusTrap = this.focusTrapFactory.create(this.popoverWrapper().nativeElement);\n const moved = await this.focusTrap.focusFirstTabbableElementWhenReady();\n if (!moved) {\n popoverWrapperEl.tabIndex = 0;\n popoverWrapperEl.focus();\n }\n });\n }\n}\n","@let popover = popoverDirective();\n<div\n #popoverWrapper\n role=\"dialog\"\n [class]=\"[\n 'popover',\n 'position-relative',\n 'focus-inside',\n positionClass(),\n popover.containerClass()\n ]\"\n [attr.aria-labelledby]=\"labelledBy\"\n [attr.aria-describedby]=\"describedBy\"\n (keydown.escape)=\"hide()\"\n>\n <div\n class=\"popover-arrow\"\n [style.left.px]=\"arrowPos()?.left\"\n [style.right.px]=\"arrowPos()?.right\"\n ></div>\n @if (popover.title()) {\n <div class=\"popover-header\">\n @let iconValue = popover.icon();\n @if (iconValue) {\n <si-icon class=\"icon me-1\" [icon]=\"iconValue\" />\n }\n <span class=\"si-h5\" [id]=\"labelledBy\">{{ popover.title() | translate }}</span>\n </div>\n }\n @if (!popoverTemplate) {\n <div class=\"popover-body\">\n <div class=\"si-body\" [id]=\"describedBy\">{{ description() | translate }}</div>\n </div>\n } @else {\n <!-- If title is already provided, we wrap the template with the `popover-body` class\n since the template may not be in the popover body directive. Also used by SiHelpButtonComponent -->\n @if (popover.title()) {\n <div class=\"popover-body\">\n <ng-template\n [ngTemplateOutlet]=\"popoverTemplate\"\n [ngTemplateOutletContext]=\"popover.context()\"\n [ngTemplateOutletInjector]=\"injector\"\n />\n </div>\n } @else {\n <ng-template\n [ngTemplateOutlet]=\"popoverTemplate\"\n [ngTemplateOutletContext]=\"popover.context()\"\n [ngTemplateOutletInjector]=\"injector\"\n />\n }\n }\n</div>\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { Overlay, OverlayRef } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport {\n ComponentRef,\n computed,\n Directive,\n ElementRef,\n inject,\n input,\n OnDestroy,\n output,\n signal,\n TemplateRef\n} from '@angular/core';\nimport {\n defaultConnectedOverlayScrollStrategy,\n isRTL,\n positions\n} from '@siemens/element-ng/common';\nimport { TranslatableString } from '@siemens/element-translate-ng/translate-types';\nimport { Subject, takeUntil } from 'rxjs';\n\nimport { PopoverComponent } from './si-popover.component';\n\n@Directive({\n selector: '[siPopover]',\n host: {\n '[attr.aria-expanded]': 'isOpen()',\n '[attr.aria-controls]': 'popoverId',\n '(click)': 'onClick()'\n },\n exportAs: 'si-popover'\n})\nexport class SiPopoverDirective implements OnDestroy {\n private static idCounter = 0;\n\n /**\n * The popover text to be displayed\n */\n readonly siPopover = input<TranslatableString | TemplateRef<unknown>>();\n\n /**\n * The placement of the popover. One of 'top', 'start', 'end', 'bottom'\n *\n * @defaultValue 'auto'\n */\n readonly placement = input<keyof typeof positions>('auto', { alias: 'siPopoverPlacement' });\n\n readonly placementInternal = computed(() => {\n if (\n this.placement() !== 'top' &&\n this.placement() !== 'bottom' &&\n this.placement() !== 'start' &&\n this.placement() !== 'end'\n ) {\n return 'auto';\n } else {\n return this.placement();\n }\n });\n\n /**\n * The title to be displayed on top for the popover\n *\n * @defaultValue undefined\n */\n readonly title = input<TranslatableString>(undefined, { alias: 'siPopoverTitle' });\n\n /**\n * The class that will be applied to container of the popover\n *\n * @defaultValue ''\n */\n readonly containerClass = input('', { alias: 'siPopoverContainerClass' });\n\n /**\n * The icon to be displayed besides popover title\n *\n * @defaultValue undefined\n */\n readonly icon = input<string>(undefined, { alias: 'siPopoverIcon' });\n\n /**\n * The context for the attached template\n *\n * @defaultValue undefined\n */\n readonly context = input<unknown>(undefined, { alias: 'siPopoverContext' });\n\n /**\n * CDK scroll strategy used for the popover overlay.\n *\n * @defaultValue defaultConnectedOverlayScrollStrategy()\n */\n readonly scrollStrategy = input(defaultConnectedOverlayScrollStrategy(), {\n alias: 'siPopoverScrollStrategy'\n });\n\n /**\n * Emits `true` when the popover is shown, `false` when the popover is hidden.\n */\n readonly visibilityChange = output<boolean>({ alias: 'siPopoverVisibilityChange' });\n\n /** @internal */\n readonly popoverCounter = SiPopoverDirective.idCounter++;\n /** @internal */\n readonly popoverId = `__popover_${this.popoverCounter}`;\n\n /** @internal */\n protected readonly isOpen = signal<boolean>(false);\n\n private overlayref?: OverlayRef;\n private popoverRef?: ComponentRef<PopoverComponent>;\n private overlay = inject(Overlay);\n private elementRef = inject(ElementRef);\n private destroyer = new Subject<void>();\n\n ngOnDestroy(): void {\n this.overlayref?.dispose();\n this.destroyer.next();\n this.destroyer.complete();\n }\n\n /**\n * Displays popover and emits 'shown' event.\n */\n show(): void {\n if (this.overlayref?.hasAttached()) {\n return;\n }\n\n this.overlayref ??= this.createOverlay();\n\n const popoverPortal = new ComponentPortal(PopoverComponent);\n this.popoverRef = this.overlayref.attach(popoverPortal);\n\n this.popoverRef.setInput('popoverDirective', this);\n\n this.isOpen.set(true);\n this.visibilityChange.emit(true);\n }\n\n /**\n * Hides the popover and emits 'hidden' event.\n */\n hide(): void {\n this.overlayref?.detach();\n }\n\n /**\n * Updates the position of the popover based on the position strategy.\n */\n updatePosition(): void {\n this.overlayref?.updatePosition();\n }\n\n protected onClick(): void {\n if (this.overlayref?.hasAttached()) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n private createOverlay(): OverlayRef {\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.elementRef)\n .withPush(false)\n .withGrowAfterOpen(true)\n .withFlexibleDimensions(false)\n .withPositions(positions[this.placementInternal()]);\n const overlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: this.scrollStrategy(),\n direction: isRTL() ? 'rtl' : 'ltr'\n });\n overlayRef\n .detachments()\n .pipe(takeUntil(this.destroyer))\n .subscribe(() => {\n this.popoverRef = undefined;\n if (this.isOpen()) {\n this.isOpen.set(false);\n this.visibilityChange.emit(false);\n }\n });\n overlayRef\n .outsidePointerEvents()\n .pipe(takeUntil(this.destroyer))\n .subscribe(({ target }) => {\n if (target !== this.elementRef.nativeElement) {\n this.hide();\n }\n });\n positionStrategy.positionChanges\n .pipe(takeUntil(this.destroyer))\n .subscribe(change => this.popoverRef?.instance.updateArrow(change, this.elementRef));\n return overlayRef;\n }\n}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { Directive, inject } from '@angular/core';\n\nimport { PopoverComponent } from './si-popover.component';\n\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: 'si-popover-title',\n host: {\n '[id]': 'this.popover.labelledBy',\n 'class': 'popover-header'\n }\n})\nexport class SiPopoverTitleDirective {\n readonly popover = inject(PopoverComponent);\n}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { Directive, inject } from '@angular/core';\n\nimport { PopoverComponent } from './si-popover.component';\n\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: 'si-popover-body',\n host: {\n '[id]': 'this.popover.describedBy',\n 'class': 'popover-body d-block'\n }\n})\nexport class SiPopoverBodyDirective {\n readonly popover = inject(PopoverComponent);\n}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nexport * from './si-popover.directive';\nexport * from './si-popover-title.directive';\nexport * from './si-popover-body.directive';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;AAGG;MAkCU,gBAAgB,CAAA;;IAElB,gBAAgB,GAAG,KAAK,CAAC,QAAQ;yFAAsB;AACvD,IAAA,cAAc,GAAG,SAAS,CAAC,QAAQ,CAAa,gBAAgB;uFAAC;;AAG1E,IAAA,UAAU;;AAEV,IAAA,WAAW;IACQ,aAAa,GAAG,MAAM,CAAC,EAAE;sFAAC;IAC1B,QAAQ,GAAG,MAAM,CAAmC,SAAS;iFAAC;AAC9D,IAAA,WAAW,GAAG,QAAQ,CAAC,MAAK;QAC7C,MAAM,WAAW,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC,SAAS,EAAE;AACvD,QAAA,OAAO,EAAE,WAAW,YAAY,WAAW,CAAC,GAAG,WAAW,GAAG,SAAS;IACxE,CAAC;oFAAC;IACQ,eAAe,GAA4B,IAAI;AAC/C,IAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAE7B,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAC/B,IAAA,gBA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AA,EAAA,EAAA,CAAA;;2FAAvB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBARnC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;;AAET,oBAAA,QAAQ,EAAE,kBAAkB;AAC5B,oBAAA,IAAI,EAAE;AACJ,wBAAA,MAAM,EAAE,yBAAyB;AACjC,wBAAA,OAAO,EAAE;AACV;AACF,iBAAA;;;ACfD;;;AAGG;MAaU,sBAAsB,CAAA;AACxB,IAAA,OAAO,GAAG,MAAM,CAAC,gBAAgB,CAAC;uGADhC,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAtB,sBAAsB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,IAAA,EAAA,0BAAA,EAAA,EAAA,cAAA,EAAA,sBAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAtB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBARlC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;;AAET,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,IAAI,EAAE;AACJ,wBAAA,MAAM,EAAE,0BAA0B;AAClC,wBAAA,OAAO,EAAE;AACV;AACF,iBAAA;;;ACfD;;;AAGG;;ACHH;;AAEG;;"}
1
+ {"version":3,"file":"siemens-element-ng-popover.mjs","sources":["../../../../projects/element-ng/popover/si-popover.component.ts","../../../../projects/element-ng/popover/si-popover.component.html","../../../../projects/element-ng/popover/si-popover.directive.ts","../../../../projects/element-ng/popover/si-popover-title.directive.ts","../../../../projects/element-ng/popover/si-popover-body.directive.ts","../../../../projects/element-ng/popover/index.ts","../../../../projects/element-ng/popover/siemens-element-ng-popover.ts"],"sourcesContent":["/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { ConfigurableFocusTrap, ConfigurableFocusTrapFactory } from '@angular/cdk/a11y';\nimport { ConnectedOverlayPositionChange } from '@angular/cdk/overlay';\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n Component,\n ElementRef,\n inject,\n Injector,\n input,\n OnDestroy,\n OnInit,\n signal,\n TemplateRef,\n viewChild,\n DOCUMENT,\n computed,\n ChangeDetectionStrategy\n} from '@angular/core';\nimport { calculateOverlayArrowPosition, OverlayArrowPosition } from '@siemens/element-ng/common';\nimport { SiIconComponent } from '@siemens/element-ng/icon';\nimport { SiTranslatePipe } from '@siemens/element-translate-ng/translate';\n\nimport { SiPopoverDirective } from './si-popover.directive';\n\n@Component({\n selector: 'si-popover',\n imports: [NgTemplateOutlet, SiIconComponent, SiTranslatePipe],\n templateUrl: './si-popover.component.html',\n changeDetection: ChangeDetectionStrategy.Eager,\n host: {\n '[id]': 'this.popoverDirective().popoverId'\n }\n})\nexport class PopoverComponent implements OnInit, OnDestroy {\n /** The directive that supplies and controls the popover content. */\n readonly popoverDirective = input.required<SiPopoverDirective>();\n readonly popoverWrapper = viewChild.required<ElementRef>('popoverWrapper');\n\n /** @internal */\n labelledBy: string | undefined;\n /** @internal */\n describedBy: string | undefined;\n protected readonly positionClass = signal('');\n protected readonly arrowPos = signal<OverlayArrowPosition | undefined>(undefined);\n protected readonly description = computed(() => {\n const description = this.popoverDirective().siPopover();\n return !(description instanceof TemplateRef) ? description : undefined;\n });\n protected popoverTemplate: TemplateRef<any> | null = null;\n protected injector = inject(Injector);\n\n private elementRef = inject(ElementRef);\n private focusTrapFactory = inject(ConfigurableFocusTrapFactory);\n private focusTrap?: ConfigurableFocusTrap;\n private focusTimeoutId?: ReturnType<typeof setTimeout>;\n private readonly previouslyActiveElement = inject(DOCUMENT).activeElement;\n\n ngOnInit(): void {\n const popoverDirective = this.popoverDirective();\n const popover = popoverDirective.siPopover();\n if (popover instanceof TemplateRef) {\n this.popoverTemplate = popover;\n }\n this.labelledBy = `__popover-title_${popoverDirective.popoverCounter}`;\n this.describedBy = `__popover-body_${popoverDirective.popoverCounter}`;\n\n this.applyFocus();\n }\n\n ngOnDestroy(): void {\n clearTimeout(this.focusTimeoutId);\n this.focusTrap?.destroy();\n if (\n this.previouslyActiveElement &&\n 'focus' in this.previouslyActiveElement &&\n typeof this.previouslyActiveElement.focus === 'function'\n ) {\n this.previouslyActiveElement.focus();\n }\n }\n\n /** @internal */\n updateArrow(change: ConnectedOverlayPositionChange, anchor?: ElementRef): void {\n const positionClass = `popover-${change.connectionPair.overlayX}-${change.connectionPair.overlayY}`;\n // need two updates as class changes affect the position\n this.positionClass.set(positionClass);\n const arrowPos = calculateOverlayArrowPosition(change, this.elementRef, anchor);\n this.arrowPos.set(arrowPos);\n }\n\n hide(): void {\n this.popoverDirective().hide();\n }\n\n private applyFocus(): void {\n // Using setTimeout ensures that SR first read `expanded` before we move the focus.\n this.focusTimeoutId = setTimeout(async () => {\n const popoverWrapperEl = this.popoverWrapper().nativeElement;\n this.focusTrap = this.focusTrapFactory.create(this.popoverWrapper().nativeElement);\n const moved = await this.focusTrap.focusFirstTabbableElementWhenReady();\n if (!moved) {\n popoverWrapperEl.tabIndex = 0;\n popoverWrapperEl.focus();\n }\n });\n }\n}\n","@let popover = popoverDirective();\n<div\n #popoverWrapper\n role=\"dialog\"\n [class]=\"[\n 'popover',\n 'position-relative',\n 'focus-inside',\n positionClass(),\n popover.containerClass()\n ]\"\n [attr.aria-labelledby]=\"labelledBy\"\n [attr.aria-describedby]=\"describedBy\"\n (keydown.escape)=\"hide()\"\n>\n <div\n class=\"popover-arrow\"\n [style.left.px]=\"arrowPos()?.left\"\n [style.right.px]=\"arrowPos()?.right\"\n ></div>\n @if (popover.title()) {\n <div class=\"popover-header\">\n @let iconValue = popover.icon();\n @if (iconValue) {\n <si-icon class=\"icon me-1\" [icon]=\"iconValue\" />\n }\n <span class=\"si-h5\" [id]=\"labelledBy\">{{ popover.title() | translate }}</span>\n </div>\n }\n @if (!popoverTemplate) {\n <div class=\"popover-body\">\n <div class=\"si-body\" [id]=\"describedBy\">{{ description() | translate }}</div>\n </div>\n } @else {\n <!-- If title is already provided, we wrap the template with the `popover-body` class\n since the template may not be in the popover body directive. Also used by SiHelpButtonComponent -->\n @if (popover.title()) {\n <div class=\"popover-body\">\n <ng-template\n [ngTemplateOutlet]=\"popoverTemplate\"\n [ngTemplateOutletContext]=\"popover.context()\"\n [ngTemplateOutletInjector]=\"injector\"\n />\n </div>\n } @else {\n <ng-template\n [ngTemplateOutlet]=\"popoverTemplate\"\n [ngTemplateOutletContext]=\"popover.context()\"\n [ngTemplateOutletInjector]=\"injector\"\n />\n }\n }\n</div>\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { Overlay, OverlayRef } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport {\n ComponentRef,\n computed,\n Directive,\n ElementRef,\n inject,\n input,\n OnDestroy,\n output,\n signal,\n TemplateRef\n} from '@angular/core';\nimport {\n defaultConnectedOverlayScrollStrategy,\n isRTL,\n positions\n} from '@siemens/element-ng/common';\nimport { TranslatableString } from '@siemens/element-translate-ng/translate-types';\nimport { Subject, takeUntil } from 'rxjs';\n\nimport { PopoverComponent } from './si-popover.component';\n\n@Directive({\n selector: '[siPopover]',\n host: {\n '[attr.aria-expanded]': 'isOpen()',\n '[attr.aria-controls]': 'popoverId',\n '(click)': 'onClick()'\n },\n exportAs: 'si-popover'\n})\nexport class SiPopoverDirective implements OnDestroy {\n private static idCounter = 0;\n\n /**\n * The popover text to be displayed\n */\n readonly siPopover = input<TranslatableString | TemplateRef<unknown>>();\n\n /**\n * The placement of the popover. One of 'top', 'start', 'end', 'bottom'\n *\n * @defaultValue 'auto'\n */\n readonly placement = input<keyof typeof positions>('auto', { alias: 'siPopoverPlacement' });\n\n readonly placementInternal = computed(() => {\n if (\n this.placement() !== 'top' &&\n this.placement() !== 'bottom' &&\n this.placement() !== 'start' &&\n this.placement() !== 'end'\n ) {\n return 'auto';\n } else {\n return this.placement();\n }\n });\n\n /**\n * The title to be displayed on top for the popover\n *\n * @defaultValue undefined\n */\n readonly title = input<TranslatableString>(undefined, { alias: 'siPopoverTitle' });\n\n /**\n * The class that will be applied to container of the popover\n *\n * @defaultValue ''\n */\n readonly containerClass = input('', { alias: 'siPopoverContainerClass' });\n\n /**\n * The icon to be displayed besides popover title\n *\n * @defaultValue undefined\n */\n readonly icon = input<string>(undefined, { alias: 'siPopoverIcon' });\n\n /**\n * The context for the attached template\n *\n * @defaultValue undefined\n */\n readonly context = input<unknown>(undefined, { alias: 'siPopoverContext' });\n\n /**\n * CDK scroll strategy used for the popover overlay.\n *\n * @defaultValue defaultConnectedOverlayScrollStrategy()\n */\n readonly scrollStrategy = input(defaultConnectedOverlayScrollStrategy(), {\n alias: 'siPopoverScrollStrategy'\n });\n\n /**\n * Emits `true` when the popover is shown, `false` when the popover is hidden.\n */\n readonly visibilityChange = output<boolean>({ alias: 'siPopoverVisibilityChange' });\n\n /** @internal */\n readonly popoverCounter = SiPopoverDirective.idCounter++;\n /** @internal */\n readonly popoverId = `__popover_${this.popoverCounter}`;\n\n /** @internal */\n protected readonly isOpen = signal<boolean>(false);\n\n private overlayref?: OverlayRef;\n private popoverRef?: ComponentRef<PopoverComponent>;\n private overlay = inject(Overlay);\n private elementRef = inject(ElementRef);\n private destroyer = new Subject<void>();\n\n ngOnDestroy(): void {\n this.overlayref?.dispose();\n this.destroyer.next();\n this.destroyer.complete();\n }\n\n /**\n * Displays popover and emits 'shown' event.\n */\n show(): void {\n if (this.overlayref?.hasAttached()) {\n return;\n }\n\n this.overlayref ??= this.createOverlay();\n\n const popoverPortal = new ComponentPortal(PopoverComponent);\n this.popoverRef = this.overlayref.attach(popoverPortal);\n\n this.popoverRef.setInput('popoverDirective', this);\n\n this.isOpen.set(true);\n this.visibilityChange.emit(true);\n }\n\n /**\n * Hides the popover and emits 'hidden' event.\n */\n hide(): void {\n this.overlayref?.detach();\n }\n\n /**\n * Updates the position of the popover based on the position strategy.\n */\n updatePosition(): void {\n this.overlayref?.updatePosition();\n }\n\n protected onClick(): void {\n if (this.overlayref?.hasAttached()) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n private createOverlay(): OverlayRef {\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.elementRef)\n .withPush(false)\n .withGrowAfterOpen(true)\n .withFlexibleDimensions(false)\n .withPositions(positions[this.placementInternal()]);\n const overlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: this.scrollStrategy(),\n direction: isRTL() ? 'rtl' : 'ltr'\n });\n overlayRef\n .detachments()\n .pipe(takeUntil(this.destroyer))\n .subscribe(() => {\n this.popoverRef = undefined;\n if (this.isOpen()) {\n this.isOpen.set(false);\n this.visibilityChange.emit(false);\n }\n });\n overlayRef\n .outsidePointerEvents()\n .pipe(takeUntil(this.destroyer))\n .subscribe(({ target }) => {\n if (target !== this.elementRef.nativeElement) {\n this.hide();\n }\n });\n positionStrategy.positionChanges\n .pipe(takeUntil(this.destroyer))\n .subscribe(change => this.popoverRef?.instance.updateArrow(change, this.elementRef));\n return overlayRef;\n }\n}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { Directive, inject } from '@angular/core';\n\nimport { PopoverComponent } from './si-popover.component';\n\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: 'si-popover-title',\n host: {\n '[id]': 'this.popover.labelledBy',\n 'class': 'popover-header'\n }\n})\nexport class SiPopoverTitleDirective {\n readonly popover = inject(PopoverComponent);\n}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { Directive, inject } from '@angular/core';\n\nimport { PopoverComponent } from './si-popover.component';\n\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: 'si-popover-body',\n host: {\n '[id]': 'this.popover.describedBy',\n 'class': 'popover-body d-block'\n }\n})\nexport class SiPopoverBodyDirective {\n readonly popover = inject(PopoverComponent);\n}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nexport * from './si-popover.directive';\nexport * from './si-popover-title.directive';\nexport * from './si-popover-body.directive';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;AAGG;MAkCU,gBAAgB,CAAA;;IAElB,gBAAgB,GAAG,KAAK,CAAC,QAAQ;yFAAsB;AACvD,IAAA,cAAc,GAAG,SAAS,CAAC,QAAQ,CAAa,gBAAgB;uFAAC;;AAG1E,IAAA,UAAU;;AAEV,IAAA,WAAW;IACQ,aAAa,GAAG,MAAM,CAAC,EAAE;sFAAC;IAC1B,QAAQ,GAAG,MAAM,CAAmC,SAAS;iFAAC;AAC9D,IAAA,WAAW,GAAG,QAAQ,CAAC,MAAK;QAC7C,MAAM,WAAW,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC,SAAS,EAAE;AACvD,QAAA,OAAO,EAAE,WAAW,YAAY,WAAW,CAAC,GAAG,WAAW,GAAG,SAAS;IACxE,CAAC;oFAAC;IACQ,eAAe,GAA4B,IAAI;AAC/C,IAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAE7B,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAC/B,IAAA,gBAAgB,GAAG,MAAM,CAAC,4BAA4B,CAAC;AACvD,IAAA,SAAS;AACT,IAAA,cAAc;AACL,IAAA,uBAAuB,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,aAAa;IAEzE,QAAQ,GAAA;AACN,QAAA,MAAM,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,EAAE;AAChD,QAAA,MAAM,OAAO,GAAG,gBAAgB,CAAC,SAAS,EAAE;AAC5C,QAAA,IAAI,OAAO,YAAY,WAAW,EAAE;AAClC,YAAA,IAAI,CAAC,eAAe,GAAG,OAAO;QAChC;QACA,IAAI,CAAC,UAAU,GAAG,CAAA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,GAAG,MAAM,CAAC,gBAAgB,CAAC;uGADhC,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAtB,sBAAsB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,IAAA,EAAA,0BAAA,EAAA,EAAA,cAAA,EAAA,sBAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAtB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBARlC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;;AAET,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,IAAI,EAAE;AACJ,wBAAA,MAAM,EAAE,0BAA0B;AAClC,wBAAA,OAAO,EAAE;AACV;AACF,iBAAA;;;ACfD;;;AAGG;;ACHH;;AAEG;;"}
@@ -1,6 +1,7 @@
1
1
  import { OverlayContainer, Overlay } from '@angular/cdk/overlay';
2
2
  import * as i0 from '@angular/core';
3
3
  import { inject, ElementRef, DOCUMENT, DestroyRef, Directive } from '@angular/core';
4
+ import { SI_THEME_DOM_TARGET, SiThemeService } from '@siemens/element-ng/theme';
4
5
 
5
6
  /**
6
7
  * Copyright (c) Siemens 2016 - 2026
@@ -36,10 +37,12 @@ class SiShadowRootDirective extends OverlayContainer {
36
37
  elementRef = inject(ElementRef);
37
38
  document = inject(DOCUMENT);
38
39
  destroyRef = inject(DestroyRef);
40
+ themeTarget = inject(SI_THEME_DOM_TARGET);
39
41
  // eslint-disable-next-line @typescript-eslint/naming-convention
40
42
  _createContainer() {
41
43
  const sourceShadow = this.elementRef.nativeElement.shadowRoot;
42
44
  const root = this.document.createElement('element-overlay-root');
45
+ const unregisterThemeTarget = this.themeTarget.registerElement?.(root);
43
46
  this.document.body.append(root);
44
47
  const shadow = root.attachShadow({ mode: 'open' });
45
48
  const shadowElement = this.document.createElement('div');
@@ -68,6 +71,7 @@ class SiShadowRootDirective extends OverlayContainer {
68
71
  observer.observe(sourceShadow, { childList: true });
69
72
  this.destroyRef.onDestroy(() => {
70
73
  observer.disconnect();
74
+ unregisterThemeTarget?.();
71
75
  root.remove();
72
76
  });
73
77
  this._containerElement = shadowElement;
@@ -83,6 +87,55 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
83
87
  }]
84
88
  }] });
85
89
 
90
+ /**
91
+ * Copyright (c) Siemens 2016 - 2026
92
+ * SPDX-License-Identifier: MIT
93
+ */
94
+ const createShadowRootThemeTarget = () => {
95
+ const element = inject(ElementRef).nativeElement;
96
+ const elements = new Set([element]);
97
+ const getShadowRoot = () => {
98
+ if (!element.shadowRoot) {
99
+ throw new Error('createShadowRootThemeTarget requires a component with Shadow DOM encapsulation.');
100
+ }
101
+ return element.shadowRoot;
102
+ };
103
+ return {
104
+ element,
105
+ rootSelector: ':host',
106
+ forEachElement: callback => elements.forEach(callback),
107
+ registerElement: registeredElement => {
108
+ elements.add(registeredElement);
109
+ registeredElement.classList.toggle('app--dark', element.classList.contains('app--dark'));
110
+ element.classList.forEach(className => {
111
+ if (className.startsWith('theme-')) {
112
+ registeredElement.classList.add(className);
113
+ }
114
+ });
115
+ registeredElement.style.colorScheme = element.style.colorScheme;
116
+ return () => elements.delete(registeredElement);
117
+ },
118
+ getStyleElement: id => getShadowRoot().getElementById(id),
119
+ appendStyleElement: style => getShadowRoot().append(style),
120
+ updateColorScheme: colorScheme => elements.forEach(themeElement => themeElement.style.setProperty('color-scheme', colorScheme))
121
+ };
122
+ };
123
+ /**
124
+ * Provides the shadow root specific theme service with a dedicated theme target
125
+ * for components using Shadow DOM encapsulation.
126
+ * Use this when the component defines and loads the Element theme in its own shadow root instead
127
+ * of reusing the theme defined on `:root`.
128
+ */
129
+ const provideShadowRootThemeTarget = () => {
130
+ return [
131
+ SiThemeService,
132
+ {
133
+ provide: SI_THEME_DOM_TARGET,
134
+ useFactory: createShadowRootThemeTarget
135
+ }
136
+ ];
137
+ };
138
+
86
139
  /**
87
140
  * Copyright (c) Siemens 2016 - 2026
88
141
  * SPDX-License-Identifier: MIT
@@ -92,5 +145,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
92
145
  * Generated bundle index. Do not edit.
93
146
  */
94
147
 
95
- export { SiShadowRootDirective };
148
+ export { SiShadowRootDirective, provideShadowRootThemeTarget };
96
149
  //# sourceMappingURL=siemens-element-ng-shadow-root.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"siemens-element-ng-shadow-root.mjs","sources":["../../../../projects/element-ng/shadow-root/si-shadow-root.directive.ts","../../../../projects/element-ng/shadow-root/index.ts","../../../../projects/element-ng/shadow-root/siemens-element-ng-shadow-root.ts"],"sourcesContent":["/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { Overlay, OverlayContainer } from '@angular/cdk/overlay';\nimport { Directive, ElementRef, inject, DOCUMENT, DestroyRef } from '@angular/core';\n\n/**\n * This directive is intended to be used in applications that do NOT load element styles in the root HTML element.\n * So typically module federation, single SPA apps or apps that bootstrap element manually in a shadow root.\n *\n * This directive will ensure that overlays created within this shadow root will have the correct styles applied.\n * It does this by creating a new shadow root in the document body\n * and copying the styles from this shadow root to new one.\n *\n * With that approach, we can ensure that overlay can span the entire screen without being limited to the current shadow root.\n *\n * To use this directive, add it to the component / element which creates the shadow root which holds the element styles.\n *\n * @example\n * ```ts\n * @Component({\n * selector: 'app-root',\n * encapsulation: ViewEncapsulation.ShadowDom,\n * hostDirectives: [SiShadowRootDirective],\n * stylesUrls: ['element-styles.scss'],\n * template: `<si-element-component />`\n * })\n * export class AppComponent { }\n *\n * ```\n *\n */\n@Directive({\n selector: '[siShadowRoot]',\n providers: [{ provide: OverlayContainer, useExisting: SiShadowRootDirective }, Overlay]\n})\nexport class SiShadowRootDirective extends OverlayContainer {\n private elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private document = inject(DOCUMENT);\n private destroyRef = inject(DestroyRef);\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n protected override _createContainer(): void {\n const sourceShadow = this.elementRef.nativeElement.shadowRoot!;\n const root = this.document.createElement('element-overlay-root');\n this.document.body.append(root);\n const shadow = root.attachShadow({ mode: 'open' });\n const shadowElement = this.document.createElement('div');\n shadowElement.classList.add('cdk-overlay-container');\n shadow.append(shadowElement);\n\n const styleCopies = new Map<CSSStyleSheet, Node>();\n const syncStyleElements = (): void => {\n const sourceStyleSheets = new Set(sourceShadow.styleSheets);\n\n styleCopies.forEach((copy, source) => {\n if (!sourceStyleSheets.has(source)) {\n copy.parentNode?.removeChild(copy);\n styleCopies.delete(source);\n }\n });\n\n sourceStyleSheets.forEach(source => {\n let copy = styleCopies.get(source);\n if (!copy) {\n copy = source.ownerNode!.cloneNode(true);\n styleCopies.set(source, copy);\n }\n shadow.insertBefore(copy, shadowElement);\n });\n };\n\n syncStyleElements();\n const observer = new MutationObserver(syncStyleElements);\n observer.observe(sourceShadow, { childList: true });\n this.destroyRef.onDestroy(() => {\n observer.disconnect();\n root.remove();\n });\n\n this._containerElement = shadowElement;\n }\n}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nexport * from './si-shadow-root.directive';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAAA;;;AAGG;AAIH;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;AAKG,MAAO,qBAAsB,SAAQ,gBAAgB,CAAA;AACjD,IAAA,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC;AACxD,IAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;;IAGpB,gBAAgB,GAAA;QACjC,MAAM,YAAY,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,UAAW;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iBAAiB,EAAE;AACnB,QAAA,MAAM,QAAQ,GAAG,IAAI,gBAAgB,CAAC,iBAAiB,CAAC;QACxD,QAAQ,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AACnD,QAAA,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,MAAK;YAC7B,QAAQ,CAAC,UAAU,EAAE;YACrB,IAAI,CAAC,MAAM,EAAE;AACf,QAAA,CAAC,CAAC;AAEF,QAAA,IAAI,CAAC,iBAAiB,GAAG,aAAa;IACxC;uGA7CW,qBAAqB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAArB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,SAAA,EAFrB,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,qBAAqB,EAAE,EAAE,OAAO,CAAC,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAE5E,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAJjC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,gBAAgB;AAC1B,oBAAA,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAA,qBAAuB,EAAE,EAAE,OAAO;AACvF,iBAAA;;;ACpCD;;;AAGG;;ACHH;;AAEG;;"}
1
+ {"version":3,"file":"siemens-element-ng-shadow-root.mjs","sources":["../../../../projects/element-ng/shadow-root/si-shadow-root.directive.ts","../../../../projects/element-ng/shadow-root/si-shadow-root-theme-target.ts","../../../../projects/element-ng/shadow-root/index.ts","../../../../projects/element-ng/shadow-root/siemens-element-ng-shadow-root.ts"],"sourcesContent":["/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { Overlay, OverlayContainer } from '@angular/cdk/overlay';\nimport { Directive, ElementRef, inject, DOCUMENT, DestroyRef } from '@angular/core';\nimport { SI_THEME_DOM_TARGET } from '@siemens/element-ng/theme';\n\n/**\n * This directive is intended to be used in applications that do NOT load element styles in the root HTML element.\n * So typically module federation, single SPA apps or apps that bootstrap element manually in a shadow root.\n *\n * This directive will ensure that overlays created within this shadow root will have the correct styles applied.\n * It does this by creating a new shadow root in the document body\n * and copying the styles from this shadow root to new one.\n *\n * With that approach, we can ensure that overlay can span the entire screen without being limited to the current shadow root.\n *\n * To use this directive, add it to the component / element which creates the shadow root which holds the element styles.\n *\n * @example\n * ```ts\n * @Component({\n * selector: 'app-root',\n * encapsulation: ViewEncapsulation.ShadowDom,\n * hostDirectives: [SiShadowRootDirective],\n * stylesUrls: ['element-styles.scss'],\n * template: `<si-element-component />`\n * })\n * export class AppComponent { }\n *\n * ```\n *\n */\n@Directive({\n selector: '[siShadowRoot]',\n providers: [{ provide: OverlayContainer, useExisting: SiShadowRootDirective }, Overlay]\n})\nexport class SiShadowRootDirective extends OverlayContainer {\n private elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private document = inject(DOCUMENT);\n private destroyRef = inject(DestroyRef);\n private themeTarget = inject(SI_THEME_DOM_TARGET);\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n protected override _createContainer(): void {\n const sourceShadow = this.elementRef.nativeElement.shadowRoot!;\n const root = this.document.createElement('element-overlay-root');\n const unregisterThemeTarget = this.themeTarget.registerElement?.(root);\n this.document.body.append(root);\n const shadow = root.attachShadow({ mode: 'open' });\n const shadowElement = this.document.createElement('div');\n shadowElement.classList.add('cdk-overlay-container');\n shadow.append(shadowElement);\n\n const styleCopies = new Map<CSSStyleSheet, Node>();\n const syncStyleElements = (): void => {\n const sourceStyleSheets = new Set(sourceShadow.styleSheets);\n\n styleCopies.forEach((copy, source) => {\n if (!sourceStyleSheets.has(source)) {\n copy.parentNode?.removeChild(copy);\n styleCopies.delete(source);\n }\n });\n\n sourceStyleSheets.forEach(source => {\n let copy = styleCopies.get(source);\n if (!copy) {\n copy = source.ownerNode!.cloneNode(true);\n styleCopies.set(source, copy);\n }\n shadow.insertBefore(copy, shadowElement);\n });\n };\n\n syncStyleElements();\n const observer = new MutationObserver(syncStyleElements);\n observer.observe(sourceShadow, { childList: true });\n this.destroyRef.onDestroy(() => {\n observer.disconnect();\n unregisterThemeTarget?.();\n root.remove();\n });\n\n this._containerElement = shadowElement;\n }\n}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { ElementRef, inject, Provider } from '@angular/core';\nimport { SI_THEME_DOM_TARGET, SiThemeDomTarget, SiThemeService } from '@siemens/element-ng/theme';\n\nconst createShadowRootThemeTarget = (): SiThemeDomTarget => {\n const element = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n const elements = new Set([element]);\n const getShadowRoot = (): ShadowRoot => {\n if (!element.shadowRoot) {\n throw new Error(\n 'createShadowRootThemeTarget requires a component with Shadow DOM encapsulation.'\n );\n }\n return element.shadowRoot;\n };\n\n return {\n element,\n rootSelector: ':host',\n forEachElement: callback => elements.forEach(callback),\n registerElement: registeredElement => {\n elements.add(registeredElement);\n registeredElement.classList.toggle('app--dark', element.classList.contains('app--dark'));\n element.classList.forEach(className => {\n if (className.startsWith('theme-')) {\n registeredElement.classList.add(className);\n }\n });\n registeredElement.style.colorScheme = element.style.colorScheme;\n return () => elements.delete(registeredElement);\n },\n getStyleElement: id => getShadowRoot().getElementById(id) as HTMLStyleElement | null,\n appendStyleElement: style => getShadowRoot().append(style),\n updateColorScheme: colorScheme =>\n elements.forEach(themeElement => themeElement.style.setProperty('color-scheme', colorScheme))\n };\n};\n\n/**\n * Provides the shadow root specific theme service with a dedicated theme target\n * for components using Shadow DOM encapsulation.\n * Use this when the component defines and loads the Element theme in its own shadow root instead\n * of reusing the theme defined on `:root`.\n */\nexport const provideShadowRootThemeTarget = (): Provider => {\n return [\n SiThemeService,\n {\n provide: SI_THEME_DOM_TARGET,\n useFactory: createShadowRootThemeTarget\n }\n ];\n};\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nexport * from './si-shadow-root.directive';\nexport * from './si-shadow-root-theme-target';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;AAGG;AAKH;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;AAKG,MAAO,qBAAsB,SAAQ,gBAAgB,CAAA;AACjD,IAAA,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC;AACxD,IAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAC/B,IAAA,WAAW,GAAG,MAAM,CAAC,mBAAmB,CAAC;;IAG9B,gBAAgB,GAAA;QACjC,MAAM,YAAY,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,UAAW;QAC9D,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,sBAAsB,CAAC;QAChE,MAAM,qBAAqB,GAAG,IAAI,CAAC,WAAW,CAAC,eAAe,GAAG,IAAI,CAAC;QACtE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;AAC/B,QAAA,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QAClD,MAAM,aAAa,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC;AACxD,QAAA,aAAa,CAAC,SAAS,CAAC,GAAG,CAAC,uBAAuB,CAAC;AACpD,QAAA,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC;AAE5B,QAAA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AAC,WAAW,EAAE,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AACxF,YAAA,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,SAAS,IAAG;AACpC,gBAAA,IAAI,SAAS,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;AAClC,oBAAA,iBAAiB,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC;gBAC5C;AACF,YAAA,CAAC,CAAC;YACF,iBAAiB,CAAC,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,WAAW;YAC/D,OAAO,MAAM,QAAQ,CAAC,MAAM,CAAC,iBAAiB,CAAC;QACjD,CAAC;QACD,eAAe,EAAE,EAAE,IAAI,aAAa,EAAE,CAAC,cAAc,CAAC,EAAE,CAA4B;QACpF,kBAAkB,EAAE,KAAK,IAAI,aAAa,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC;QAC1D,iBAAiB,EAAE,WAAW,IAC5B,QAAQ,CAAC,OAAO,CAAC,YAAY,IAAI,YAAY,CAAC,KAAK,CAAC,WAAW,CAAC,cAAc,EAAE,WAAW,CAAC;KAC/F;AACH,CAAC;AAED;;;;;AAKG;AACI,MAAM,4BAA4B,GAAG,MAAe;IACzD,OAAO;QACL,cAAc;AACd,QAAA;AACE,YAAA,OAAO,EAAE,mBAAmB;AAC5B,YAAA,UAAU,EAAE;AACb;KACF;AACH;;ACvDA;;;AAGG;;ACHH;;AAEG;;"}
@@ -1,8 +1,8 @@
1
1
  import { of, ReplaySubject, throwError, fromEvent, map as map$1 } from 'rxjs';
2
- import { isPlatformBrowser } from '@angular/common';
3
2
  import * as i0 from '@angular/core';
4
- import { EventEmitter, signal, inject, PLATFORM_ID, DOCUMENT, Injectable } from '@angular/core';
3
+ import { InjectionToken, inject, DOCUMENT, EventEmitter, signal, PLATFORM_ID, Injectable } from '@angular/core';
5
4
  import { Meta } from '@angular/platform-browser';
5
+ import { isPlatformBrowser } from '@angular/common';
6
6
  import { take, tap, map, switchMap } from 'rxjs/operators';
7
7
  import { toSignal } from '@angular/core/rxjs-interop';
8
8
 
@@ -109,6 +109,30 @@ class SiDefaultThemeStore extends SiThemeStore {
109
109
  }
110
110
  }
111
111
 
112
+ /**
113
+ * Copyright (c) Siemens 2016 - 2026
114
+ * SPDX-License-Identifier: MIT
115
+ */
116
+ /**
117
+ * Theme DOM target. The default implementation targets the current document.
118
+ */
119
+ const SI_THEME_DOM_TARGET = new InjectionToken('SI_THEME_DOM_TARGET', {
120
+ providedIn: 'root',
121
+ factory: () => {
122
+ const document = inject(DOCUMENT);
123
+ const meta = inject(Meta);
124
+ return {
125
+ element: document.documentElement,
126
+ rootSelector: ':root',
127
+ eventTarget: document.defaultView ?? undefined,
128
+ forEachElement: callback => callback(document.documentElement),
129
+ getStyleElement: id => document.getElementById(id),
130
+ appendStyleElement: style => document.body.append(style),
131
+ updateColorScheme: colorScheme => meta.updateTag({ name: 'color-scheme', content: colorScheme })
132
+ };
133
+ }
134
+ });
135
+
112
136
  const ELEMENT_THEME_NAME = 'element';
113
137
  const elementTheme = {
114
138
  name: 'element',
@@ -409,9 +433,12 @@ class SiThemeService {
409
433
  isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
410
434
  previewTheme;
411
435
  themeStore = inject(SiThemeStore, { optional: true }) ?? new SiDefaultThemeStore(this.isBrowser);
412
- meta = inject(Meta);
413
436
  document = inject(DOCUMENT);
437
+ themeTarget = inject(SI_THEME_DOM_TARGET);
414
438
  constructor() {
439
+ this._resolvedColorScheme = this.themeTarget.element.classList.contains('app--dark')
440
+ ? 'dark'
441
+ : 'light';
415
442
  this.resolvedColorScheme$.subscribe(scheme => (this._resolvedColorScheme = scheme));
416
443
  this.themeNames$.subscribe(names => (this._themeNames = names));
417
444
  if (this.isBrowser) {
@@ -585,7 +612,7 @@ class SiThemeService {
585
612
  return result;
586
613
  }
587
614
  /**
588
- * Apply `light` or `dark` theme to the document.
615
+ * Apply `light` or `dark` theme to the configured theme target.
589
616
  */
590
617
  applyThemeType(type) {
591
618
  if (type === this._resolvedColorScheme || !this.darkMediaQuery || !this.mediaQueryListener) {
@@ -604,7 +631,7 @@ class SiThemeService {
604
631
  }
605
632
  }
606
633
  /**
607
- * Applies the given theme to the document. If no theme is given, the active theme is applied.
634
+ * Applies the given theme to the configured theme target. If no theme is given, the active theme is applied.
608
635
  */
609
636
  applyTheme(theme, type, overwrite) {
610
637
  if (theme) {
@@ -628,7 +655,7 @@ class SiThemeService {
628
655
  }
629
656
  this.previewTheme.schemes[type][name] = value;
630
657
  this.createThemeCSS(this.previewTheme);
631
- this.document.documentElement.classList.add('theme-__preview');
658
+ this.themeTarget.forEachElement(element => element.classList.add('theme-__preview'));
632
659
  this.dispatchThemeSwitchEvent();
633
660
  }
634
661
  /**
@@ -667,34 +694,42 @@ class SiThemeService {
667
694
  this.themeChange.emit(theme);
668
695
  }
669
696
  activateTheme(theme) {
670
- const classList = this.document.documentElement.classList;
671
- classList.forEach(c => {
672
- if (c.startsWith('theme-')) {
673
- classList.remove(c);
697
+ this.themeTarget.forEachElement(element => {
698
+ const classList = element.classList;
699
+ classList.forEach(className => {
700
+ if (className.startsWith('theme-')) {
701
+ classList.remove(className);
702
+ }
703
+ });
704
+ if (theme) {
705
+ classList.add(`theme-${theme.name}`);
674
706
  }
675
707
  });
676
- if (theme) {
677
- classList.add(`theme-${theme.name}`);
678
- }
679
708
  }
680
709
  hasThemeCSS(theme) {
681
710
  const id = `__theme-${theme.name}`;
682
- return !!this.document.getElementById(id);
711
+ return !!this.themeTarget.getStyleElement(id);
683
712
  }
684
713
  createThemeCSS(theme) {
685
714
  let css = '';
686
- const themeSelector = `:root.theme-${theme.name}`;
715
+ const themeSelector = this.createThemeSelector(theme.name);
687
716
  if (theme.schemes.light) {
688
717
  css = this.createThemeVariantCSS(css, themeSelector, theme.schemes.light);
689
718
  }
690
719
  if (theme.schemes.dark) {
691
- css = this.createThemeVariantCSS(css, themeSelector + '.app--dark', theme.schemes.dark);
720
+ css = this.createThemeVariantCSS(css, this.createThemeSelector(theme.name, true), theme.schemes.dark);
692
721
  }
693
722
  this.removeThemeCSS(theme.name);
694
723
  const cssElement = this.document.createElement('style');
695
724
  cssElement.id = `__theme-${theme.name}`;
696
725
  cssElement.textContent = css;
697
- this.document.body.appendChild(cssElement);
726
+ this.themeTarget.appendStyleElement(cssElement);
727
+ }
728
+ createThemeSelector(name, dark = false) {
729
+ const classes = `.theme-${name}${dark ? '.app--dark' : ''}`;
730
+ return this.themeTarget.rootSelector === ':host'
731
+ ? `:host(${classes})`
732
+ : `${this.themeTarget.rootSelector}${classes}`;
698
733
  }
699
734
  createThemeVariantCSS(css, selector, scheme) {
700
735
  css += `${selector} {\n`;
@@ -706,16 +741,16 @@ class SiThemeService {
706
741
  }
707
742
  removeThemeCSS(name) {
708
743
  const id = `__theme-${name}`;
709
- this.document.getElementById(id)?.remove();
710
- this.document.documentElement.classList.remove(`theme-${name}`);
744
+ this.themeTarget.getStyleElement(id)?.remove();
745
+ this.themeTarget.forEachElement(element => element.classList.remove(`theme-${name}`));
711
746
  }
712
747
  toggleDark(dark) {
713
748
  if (!this.isBrowser) {
714
749
  return;
715
750
  }
716
- this.document.documentElement.classList.toggle('app--dark', dark);
751
+ this.themeTarget.forEachElement(element => element.classList.toggle('app--dark', dark));
717
752
  const colorScheme = dark ? 'dark' : 'light';
718
- this.meta.updateTag({ name: 'color-scheme', content: colorScheme });
753
+ this.themeTarget.updateColorScheme(colorScheme);
719
754
  this.resolvedColorSchemeSub.next(colorScheme);
720
755
  this.dispatchThemeSwitchEvent();
721
756
  }
@@ -761,8 +796,9 @@ const injectIsDarkTheme = () => {
761
796
  if (!isPlatformBrowser(inject(PLATFORM_ID))) {
762
797
  return signal(false);
763
798
  }
799
+ const targetDom = inject(SI_THEME_DOM_TARGET);
764
800
  return toSignal(fromEvent(window, 'theme-switch').pipe(map$1(e => e.detail.dark)), {
765
- initialValue: document.documentElement.classList.contains('app--dark')
801
+ initialValue: targetDom.element.classList.contains('app--dark')
766
802
  });
767
803
  };
768
804
 
@@ -775,5 +811,5 @@ const injectIsDarkTheme = () => {
775
811
  * Generated bundle index. Do not edit.
776
812
  */
777
813
 
778
- export { ELEMENT_THEME_NAME, SI_THEME_LOCAL_STORAGE_KEY, SiDefaultThemeStore, SiThemeService, SiThemeStore, elementTheme, injectIsDarkTheme };
814
+ export { ELEMENT_THEME_NAME, SI_THEME_DOM_TARGET, SI_THEME_LOCAL_STORAGE_KEY, SiDefaultThemeStore, SiThemeService, SiThemeStore, elementTheme, injectIsDarkTheme };
779
815
  //# sourceMappingURL=siemens-element-ng-theme.mjs.map