@siemens/element-ng 47.2.0 → 47.3.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 (172) hide show
  1. package/README.md +18 -6
  2. package/autocomplete/index.d.ts +8 -0
  3. package/autocomplete/package.json +3 -0
  4. package/autocomplete/si-autocomplete-listbox.directive.d.ts +31 -0
  5. package/autocomplete/si-autocomplete-option.directive.d.ts +31 -0
  6. package/autocomplete/si-autocomplete.directive.d.ts +14 -0
  7. package/autocomplete/si-autocomplete.model.d.ts +7 -0
  8. package/autocomplete/si-autocomplete.module.d.ts +9 -0
  9. package/badge/index.d.ts +5 -0
  10. package/badge/package.json +3 -0
  11. package/badge/si-badge.component.d.ts +17 -0
  12. package/content-action-bar/index.d.ts +7 -0
  13. package/content-action-bar/package.json +3 -0
  14. package/content-action-bar/si-content-action-bar-toggle.component.d.ts +6 -0
  15. package/content-action-bar/si-content-action-bar.component.d.ts +72 -0
  16. package/content-action-bar/si-content-action-bar.model.d.ts +9 -0
  17. package/content-action-bar/si-content-action-bar.module.d.ts +7 -0
  18. package/fesm2022/siemens-element-ng-application-header.mjs +2 -2
  19. package/fesm2022/siemens-element-ng-application-header.mjs.map +1 -1
  20. package/fesm2022/siemens-element-ng-autocomplete.mjs +235 -0
  21. package/fesm2022/siemens-element-ng-autocomplete.mjs.map +1 -0
  22. package/fesm2022/siemens-element-ng-badge.mjs +59 -0
  23. package/fesm2022/siemens-element-ng-badge.mjs.map +1 -0
  24. package/fesm2022/siemens-element-ng-common.mjs +1 -1
  25. package/fesm2022/siemens-element-ng-common.mjs.map +1 -1
  26. package/fesm2022/siemens-element-ng-content-action-bar.mjs +200 -0
  27. package/fesm2022/siemens-element-ng-content-action-bar.mjs.map +1 -0
  28. package/fesm2022/siemens-element-ng-form.mjs +827 -0
  29. package/fesm2022/siemens-element-ng-form.mjs.map +1 -0
  30. package/fesm2022/siemens-element-ng-icon-status.mjs +65 -0
  31. package/fesm2022/siemens-element-ng-icon-status.mjs.map +1 -0
  32. package/fesm2022/siemens-element-ng-icon.mjs +12 -2
  33. package/fesm2022/siemens-element-ng-icon.mjs.map +1 -1
  34. package/fesm2022/siemens-element-ng-language-switcher.mjs +90 -0
  35. package/fesm2022/siemens-element-ng-language-switcher.mjs.map +1 -0
  36. package/fesm2022/siemens-element-ng-number-input.mjs +267 -0
  37. package/fesm2022/siemens-element-ng-number-input.mjs.map +1 -0
  38. package/fesm2022/siemens-element-ng-password-strength.mjs +177 -0
  39. package/fesm2022/siemens-element-ng-password-strength.mjs.map +1 -0
  40. package/fesm2022/siemens-element-ng-pills-input.mjs +397 -0
  41. package/fesm2022/siemens-element-ng-pills-input.mjs.map +1 -0
  42. package/fesm2022/siemens-element-ng-popover-next.mjs +259 -0
  43. package/fesm2022/siemens-element-ng-popover-next.mjs.map +1 -0
  44. package/fesm2022/siemens-element-ng-popover.mjs +256 -0
  45. package/fesm2022/siemens-element-ng-popover.mjs.map +1 -0
  46. package/fesm2022/siemens-element-ng-progressbar.mjs +83 -0
  47. package/fesm2022/siemens-element-ng-progressbar.mjs.map +1 -0
  48. package/fesm2022/siemens-element-ng-select.mjs +1166 -0
  49. package/fesm2022/siemens-element-ng-select.mjs.map +1 -0
  50. package/fesm2022/siemens-element-ng-skip-links.mjs +117 -0
  51. package/fesm2022/siemens-element-ng-skip-links.mjs.map +1 -0
  52. package/fesm2022/siemens-element-ng-summary-widget.mjs +77 -0
  53. package/fesm2022/siemens-element-ng-summary-widget.mjs.map +1 -0
  54. package/fesm2022/siemens-element-ng-toast-notification.mjs +227 -0
  55. package/fesm2022/siemens-element-ng-toast-notification.mjs.map +1 -0
  56. package/fesm2022/siemens-element-ng-translate.mjs.map +1 -1
  57. package/fesm2022/siemens-element-ng-typeahead.mjs +746 -0
  58. package/fesm2022/siemens-element-ng-typeahead.mjs.map +1 -0
  59. package/fesm2022/siemens-element-ng-wizard.mjs +465 -0
  60. package/fesm2022/siemens-element-ng-wizard.mjs.map +1 -0
  61. package/form/form-fieldset/si-form-fieldset.component.d.ts +40 -0
  62. package/form/index.d.ts +14 -0
  63. package/form/package.json +3 -0
  64. package/form/si-form-container/si-form-container.component.d.ts +155 -0
  65. package/form/si-form-item/si-form-field-native.control.d.ts +22 -0
  66. package/form/si-form-item/si-form-item.component.d.ts +90 -0
  67. package/form/si-form-item-control-input.directive.d.ts +18 -0
  68. package/form/si-form-item.control.d.ts +35 -0
  69. package/form/si-form-validation-error.model.d.ts +55 -0
  70. package/form/si-form-validation-error.provider.d.ts +11 -0
  71. package/form/si-form-validation-error.service.d.ts +42 -0
  72. package/form/si-form-validation-tooltip/si-form-validation-tooltip.component.d.ts +13 -0
  73. package/form/si-form-validation-tooltip/si-form-validation-tooltip.directive.d.ts +42 -0
  74. package/form/si-form.module.d.ts +25 -0
  75. package/icon/element-icons.d.ts +10 -0
  76. package/icon-status/index.d.ts +6 -0
  77. package/icon-status/package.json +3 -0
  78. package/icon-status/si-icon-status.component.d.ts +24 -0
  79. package/icon-status/si-icon-status.module.d.ts +7 -0
  80. package/language-switcher/index.d.ts +7 -0
  81. package/language-switcher/iso-language-value.d.ts +14 -0
  82. package/language-switcher/package.json +3 -0
  83. package/language-switcher/si-language-switcher.component.d.ts +32 -0
  84. package/language-switcher/si-language-switcher.module.d.ts +7 -0
  85. package/number-input/index.d.ts +6 -0
  86. package/number-input/package.json +3 -0
  87. package/number-input/si-number-input.component.d.ts +106 -0
  88. package/number-input/si-number-input.module.d.ts +7 -0
  89. package/package.json +75 -3
  90. package/password-strength/index.d.ts +7 -0
  91. package/password-strength/package.json +3 -0
  92. package/password-strength/si-password-strength.component.d.ts +25 -0
  93. package/password-strength/si-password-strength.directive.d.ts +54 -0
  94. package/password-strength/si-password-strength.module.d.ts +8 -0
  95. package/pills-input/index.d.ts +9 -0
  96. package/pills-input/package.json +3 -0
  97. package/pills-input/si-input-pill.component.d.ts +9 -0
  98. package/pills-input/si-pills-input-csv.directive.d.ts +8 -0
  99. package/pills-input/si-pills-input-email.directive.d.ts +10 -0
  100. package/pills-input/si-pills-input-pattern-base.d.ts +19 -0
  101. package/pills-input/si-pills-input-value-handler.d.ts +12 -0
  102. package/pills-input/si-pills-input.component.d.ts +87 -0
  103. package/pills-input/si-pills-input.module.d.ts +9 -0
  104. package/popover/index.d.ts +6 -0
  105. package/popover/package.json +3 -0
  106. package/popover/si-popover.component.d.ts +26 -0
  107. package/popover/si-popover.directive.d.ts +89 -0
  108. package/popover/si-popover.module.d.ts +7 -0
  109. package/popover-next/index.d.ts +7 -0
  110. package/popover-next/package.json +3 -0
  111. package/popover-next/si-popover-description.directive.d.ts +7 -0
  112. package/popover-next/si-popover-next.directive.d.ts +61 -0
  113. package/popover-next/si-popover-title.directive.d.ts +7 -0
  114. package/popover-next/si-popover.component.d.ts +27 -0
  115. package/progressbar/index.d.ts +6 -0
  116. package/progressbar/package.json +3 -0
  117. package/progressbar/si-progressbar.component.d.ts +43 -0
  118. package/progressbar/si-progressbar.module.d.ts +7 -0
  119. package/select/index.d.ts +18 -0
  120. package/select/options/si-select-complex-options.directive.d.ts +69 -0
  121. package/select/options/si-select-lazy-options.directive.d.ts +38 -0
  122. package/select/options/si-select-option.source.d.ts +49 -0
  123. package/select/options/si-select-options-strategy.base.d.ts +35 -0
  124. package/select/options/si-select-options-strategy.d.ts +37 -0
  125. package/select/options/si-select-simple-options.directive.d.ts +34 -0
  126. package/select/package.json +3 -0
  127. package/select/select-input/si-select-input.component.d.ts +43 -0
  128. package/select/select-list/si-select-list-has-filter.component.d.ts +20 -0
  129. package/select/select-list/si-select-list.base.d.ts +37 -0
  130. package/select/select-list/si-select-list.component.d.ts +15 -0
  131. package/select/select-option/si-select-option-row.component.d.ts +16 -0
  132. package/select/select-option/si-select-option.component.d.ts +9 -0
  133. package/select/selection/si-select-multi-value.directive.d.ts +26 -0
  134. package/select/selection/si-select-selection-strategy.d.ts +58 -0
  135. package/select/selection/si-select-single-value.directive.d.ts +26 -0
  136. package/select/si-select-action.directive.d.ts +12 -0
  137. package/select/si-select-actions.directive.d.ts +5 -0
  138. package/select/si-select-group-template.directive.d.ts +20 -0
  139. package/select/si-select-option-row-template.directive.d.ts +9 -0
  140. package/select/si-select-option-template.directive.d.ts +21 -0
  141. package/select/si-select.component.d.ts +96 -0
  142. package/select/si-select.module.d.ts +15 -0
  143. package/select/si-select.types.d.ts +65 -0
  144. package/skip-links/index.d.ts +5 -0
  145. package/skip-links/package.json +3 -0
  146. package/skip-links/si-skip-link-target.directive.d.ts +27 -0
  147. package/skip-links/si-skip-links.component.d.ts +9 -0
  148. package/skip-links/skip-link.service.d.ts +14 -0
  149. package/summary-widget/index.d.ts +5 -0
  150. package/summary-widget/package.json +3 -0
  151. package/summary-widget/si-summary-widget.component.d.ts +44 -0
  152. package/template-i18n.json +29 -1
  153. package/toast-notification/index.d.ts +6 -0
  154. package/toast-notification/package.json +3 -0
  155. package/toast-notification/si-toast-notification/si-toast-notification.component.d.ts +17 -0
  156. package/toast-notification/si-toast-notification-drawer/si-toast-notification-drawer.component.d.ts +9 -0
  157. package/toast-notification/si-toast-notification.service.d.ts +41 -0
  158. package/toast-notification/si-toast.model.d.ts +25 -0
  159. package/translate/si-translatable-keys.interface.d.ts +28 -0
  160. package/typeahead/index.d.ts +8 -0
  161. package/typeahead/package.json +3 -0
  162. package/typeahead/si-typeahead-item-template.directive.d.ts +7 -0
  163. package/typeahead/si-typeahead.component.d.ts +22 -0
  164. package/typeahead/si-typeahead.directive.d.ts +196 -0
  165. package/typeahead/si-typeahead.model.d.ts +60 -0
  166. package/typeahead/si-typeahead.module.d.ts +8 -0
  167. package/typeahead/si-typeahead.sorting.d.ts +10 -0
  168. package/wizard/index.d.ts +7 -0
  169. package/wizard/package.json +3 -0
  170. package/wizard/si-wizard-step.component.d.ts +21 -0
  171. package/wizard/si-wizard.component.d.ts +196 -0
  172. package/wizard/si-wizard.module.d.ts +8 -0
@@ -0,0 +1,259 @@
1
+ import { Overlay } from '@angular/cdk/overlay';
2
+ import { ComponentPortal } from '@angular/cdk/portal';
3
+ import * as i0 from '@angular/core';
4
+ import { input, viewChild, signal, inject, Injector, ElementRef, TemplateRef, Component, computed, output, HostListener, Directive } from '@angular/core';
5
+ import { calculateOverlayArrowPosition, getOverlay, getPositionStrategy } from '@siemens/element-ng/common';
6
+ import { Subject, takeUntil } from 'rxjs';
7
+ import { ConfigurableFocusTrapFactory } from '@angular/cdk/a11y';
8
+ import { DOCUMENT, NgClass, NgTemplateOutlet } from '@angular/common';
9
+ import { SiIconNextComponent } from '@siemens/element-ng/icon';
10
+
11
+ /**
12
+ * Copyright Siemens 2016 - 2025.
13
+ * SPDX-License-Identifier: MIT
14
+ */
15
+ class PopoverComponent {
16
+ popoverDirective = input.required();
17
+ popoverWrapper = viewChild.required('popoverWrapper');
18
+ positionClass = signal('');
19
+ arrowPos = signal(undefined);
20
+ popoverTemplate = null;
21
+ injector = inject(Injector);
22
+ labelledBy;
23
+ describedBy;
24
+ elementRef = inject(ElementRef);
25
+ focusTrapFactory = inject(ConfigurableFocusTrapFactory);
26
+ focusTrap;
27
+ previouslyActiveElement = inject(DOCUMENT).activeElement;
28
+ ngOnInit() {
29
+ const popoverDirective = this.popoverDirective();
30
+ const popover = popoverDirective.siPopoverNext();
31
+ if (popover instanceof TemplateRef) {
32
+ this.popoverTemplate = popover;
33
+ }
34
+ this.labelledBy = `__popover-title_${popoverDirective.popoverCounter}`;
35
+ this.describedBy = `__popover-body_${popoverDirective.popoverCounter}`;
36
+ this.applyFocus();
37
+ }
38
+ ngOnDestroy() {
39
+ this.focusTrap?.destroy();
40
+ if (this.previouslyActiveElement &&
41
+ 'focus' in this.previouslyActiveElement &&
42
+ typeof this.previouslyActiveElement.focus === 'function') {
43
+ this.previouslyActiveElement.focus();
44
+ }
45
+ }
46
+ /** @internal */
47
+ updateArrow(change, anchor) {
48
+ const positionClass = `popover-${change.connectionPair.overlayX}-${change.connectionPair.overlayY}`;
49
+ // need two updates as class changes affect the position
50
+ this.positionClass.set(positionClass);
51
+ const arrowPos = calculateOverlayArrowPosition(change, this.elementRef, anchor);
52
+ this.arrowPos.set(arrowPos);
53
+ }
54
+ hide() {
55
+ this.popoverDirective().hide();
56
+ }
57
+ applyFocus() {
58
+ // Using setTimeout ensures that SR first read `expanded` before we move the focus.
59
+ setTimeout(async () => {
60
+ const popoverWrapperEl = this.popoverWrapper().nativeElement;
61
+ this.focusTrap = this.focusTrapFactory.create(this.popoverWrapper().nativeElement);
62
+ const moved = await this.focusTrap.focusFirstTabbableElementWhenReady();
63
+ if (!moved) {
64
+ popoverWrapperEl.tabIndex = 0;
65
+ popoverWrapperEl.focus();
66
+ }
67
+ });
68
+ }
69
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: PopoverComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
70
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: PopoverComponent, isStandalone: true, selector: "si-popover", inputs: { popoverDirective: { classPropertyName: "popoverDirective", publicName: "popoverDirective", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "id": "this.popoverDirective().popoverId" } }, viewQueries: [{ propertyName: "popoverWrapper", first: true, predicate: ["popoverWrapper"], descendants: true, isSignal: true }], ngImport: i0, template: "@let popover = popoverDirective();\n<div\n #popoverWrapper\n class=\"popover position-relative focus-inside\"\n role=\"dialog\"\n [attr.aria-labelledby]=\"labelledBy\"\n [attr.aria-describedby]=\"describedBy\"\n [ngClass]=\"[positionClass(), popover.containerClass()]\"\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.popoverTitle()) {\n <div class=\"popover-header\">\n @let iconValue = popover.icon();\n @if (iconValue) {\n <si-icon-next class=\"icon me-1\" [icon]=\"iconValue\" />\n }\n <span class=\"si-title-2\" [id]=\"labelledBy\">{{ popover.popoverTitle() }}</span>\n </div>\n }\n <div class=\"popover-body\">\n @if (!popoverTemplate) {\n <div class=\"si-body-2\" [id]=\"describedBy\" [innerHTML]=\"popover.siPopoverNext()\"></div>\n } @else {\n <ng-template\n [ngTemplateOutlet]=\"popoverTemplate\"\n [ngTemplateOutletContext]=\"popover.popoverContext()\"\n [ngTemplateOutletInjector]=\"injector\"\n />\n }\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: SiIconNextComponent, selector: "si-icon-next", inputs: ["icon"] }] });
71
+ }
72
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: PopoverComponent, decorators: [{
73
+ type: Component,
74
+ args: [{ selector: 'si-popover', imports: [NgClass, NgTemplateOutlet, SiIconNextComponent], host: {
75
+ '[id]': 'this.popoverDirective().popoverId'
76
+ }, template: "@let popover = popoverDirective();\n<div\n #popoverWrapper\n class=\"popover position-relative focus-inside\"\n role=\"dialog\"\n [attr.aria-labelledby]=\"labelledBy\"\n [attr.aria-describedby]=\"describedBy\"\n [ngClass]=\"[positionClass(), popover.containerClass()]\"\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.popoverTitle()) {\n <div class=\"popover-header\">\n @let iconValue = popover.icon();\n @if (iconValue) {\n <si-icon-next class=\"icon me-1\" [icon]=\"iconValue\" />\n }\n <span class=\"si-title-2\" [id]=\"labelledBy\">{{ popover.popoverTitle() }}</span>\n </div>\n }\n <div class=\"popover-body\">\n @if (!popoverTemplate) {\n <div class=\"si-body-2\" [id]=\"describedBy\" [innerHTML]=\"popover.siPopoverNext()\"></div>\n } @else {\n <ng-template\n [ngTemplateOutlet]=\"popoverTemplate\"\n [ngTemplateOutletContext]=\"popover.popoverContext()\"\n [ngTemplateOutletInjector]=\"injector\"\n />\n }\n </div>\n</div>\n" }]
77
+ }] });
78
+
79
+ /**
80
+ * Copyright Siemens 2016 - 2025.
81
+ * SPDX-License-Identifier: MIT
82
+ */
83
+ class SiPopoverNextDirective {
84
+ static idCounter = 0;
85
+ /**
86
+ * The popover text to be displayed
87
+ */
88
+ siPopoverNext = input();
89
+ /**
90
+ * The placement of the popover. One of 'top', 'start', end', 'bottom'
91
+ *
92
+ * @defaultValue 'auto'
93
+ */
94
+ placement = input('auto');
95
+ placementInternal = computed(() => {
96
+ if (this.placement() !== 'top' &&
97
+ this.placement() !== 'bottom' &&
98
+ this.placement() !== 'start' &&
99
+ this.placement() !== 'end') {
100
+ return 'auto';
101
+ }
102
+ else {
103
+ return this.placement();
104
+ }
105
+ });
106
+ /**
107
+ * The title to be displayed on top for the popover
108
+ */
109
+ popoverTitle = input();
110
+ /**
111
+ * The class that will be applied to container of the popover
112
+ *
113
+ * @defaultValue ''
114
+ */
115
+ containerClass = input('');
116
+ /**
117
+ * The icon to be displayed besides popover title
118
+ */
119
+ icon = input();
120
+ /**
121
+ * The context for the attached template
122
+ */
123
+ popoverContext = input();
124
+ /**
125
+ * Emits an event when the popover is shown/hidden
126
+ */
127
+ visibilityChange = output();
128
+ popoverCounter = SiPopoverNextDirective.idCounter++;
129
+ popoverId = `__popover_${this.popoverCounter}`;
130
+ isOpen = signal(false);
131
+ overlayref;
132
+ overlay = inject(Overlay);
133
+ elementRef = inject(ElementRef);
134
+ destroyer = new Subject();
135
+ ngOnDestroy() {
136
+ this.overlayref?.dispose();
137
+ this.destroyer.next();
138
+ this.destroyer.complete();
139
+ }
140
+ /**
141
+ * Displays popover and emits 'shown' event.
142
+ */
143
+ show() {
144
+ if (this.overlayref?.hasAttached()) {
145
+ return;
146
+ }
147
+ this.overlayref = getOverlay(this.elementRef, this.overlay, false, this.placementInternal());
148
+ this.overlayref
149
+ .outsidePointerEvents()
150
+ .pipe(takeUntil(this.destroyer))
151
+ .subscribe(({ target }) => {
152
+ if (target !== this.elementRef.nativeElement) {
153
+ this.hide();
154
+ }
155
+ });
156
+ const popoverPortal = new ComponentPortal(PopoverComponent);
157
+ const popoverRef = this.overlayref.attach(popoverPortal);
158
+ popoverRef.setInput('popoverDirective', this);
159
+ const positionStrategy = getPositionStrategy(this.overlayref);
160
+ positionStrategy?.positionChanges
161
+ .pipe(takeUntil(this.destroyer))
162
+ .subscribe(change => popoverRef.instance.updateArrow(change, this.elementRef));
163
+ this.isOpen.set(true);
164
+ this.visibilityChange.emit();
165
+ }
166
+ /**
167
+ * Hides the popover and emits 'hidden' event.
168
+ */
169
+ hide() {
170
+ if (this.overlayref?.hasAttached()) {
171
+ this.overlayref?.detach();
172
+ this.isOpen.set(false);
173
+ this.visibilityChange.emit();
174
+ this.destroyer.next();
175
+ }
176
+ }
177
+ /**
178
+ * Updates the position of the popover based on the position strategy.
179
+ */
180
+ updatePosition() {
181
+ this.overlayref?.updatePosition();
182
+ }
183
+ onClick() {
184
+ if (this.overlayref?.hasAttached()) {
185
+ this.hide();
186
+ }
187
+ else {
188
+ this.show();
189
+ }
190
+ }
191
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiPopoverNextDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
192
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.6", type: SiPopoverNextDirective, isStandalone: true, selector: "[siPopoverNext]", inputs: { siPopoverNext: { classPropertyName: "siPopoverNext", publicName: "siPopoverNext", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, popoverTitle: { classPropertyName: "popoverTitle", publicName: "popoverTitle", isSignal: true, isRequired: false, transformFunction: null }, containerClass: { classPropertyName: "containerClass", publicName: "containerClass", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, popoverContext: { classPropertyName: "popoverContext", publicName: "popoverContext", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visibilityChange: "visibilityChange" }, host: { listeners: { "click": "onClick()" }, properties: { "attr.aria-expanded": "isOpen()", "attr.aria-controls": "popoverId" } }, exportAs: ["si-popover-next"], ngImport: i0 });
193
+ }
194
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiPopoverNextDirective, decorators: [{
195
+ type: Directive,
196
+ args: [{
197
+ selector: '[siPopoverNext]',
198
+ exportAs: 'si-popover-next',
199
+ host: {
200
+ '[attr.aria-expanded]': 'isOpen()',
201
+ '[attr.aria-controls]': 'popoverId'
202
+ }
203
+ }]
204
+ }], propDecorators: { onClick: [{
205
+ type: HostListener,
206
+ args: ['click']
207
+ }] } });
208
+
209
+ /**
210
+ * Copyright Siemens 2016 - 2025.
211
+ * SPDX-License-Identifier: MIT
212
+ */
213
+ class SiPopoverTitleDirective {
214
+ popover = inject(PopoverComponent);
215
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiPopoverTitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
216
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.6", type: SiPopoverTitleDirective, isStandalone: true, selector: "si-popover-title", host: { properties: { "id": "this.popover.labelledBy" } }, ngImport: i0 });
217
+ }
218
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiPopoverTitleDirective, decorators: [{
219
+ type: Directive,
220
+ args: [{
221
+ // eslint-disable-next-line @angular-eslint/directive-selector
222
+ selector: 'si-popover-title',
223
+ host: {
224
+ '[id]': 'this.popover.labelledBy'
225
+ }
226
+ }]
227
+ }] });
228
+
229
+ /**
230
+ * Copyright Siemens 2016 - 2025.
231
+ * SPDX-License-Identifier: MIT
232
+ */
233
+ class SiPopoverDescriptionDirective {
234
+ popover = inject(PopoverComponent);
235
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiPopoverDescriptionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
236
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.6", type: SiPopoverDescriptionDirective, isStandalone: true, selector: "si-popover-description", host: { properties: { "id": "this.popover.describedBy" } }, ngImport: i0 });
237
+ }
238
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiPopoverDescriptionDirective, decorators: [{
239
+ type: Directive,
240
+ args: [{
241
+ // eslint-disable-next-line @angular-eslint/directive-selector
242
+ selector: 'si-popover-description',
243
+ host: {
244
+ '[id]': 'this.popover.describedBy'
245
+ }
246
+ }]
247
+ }] });
248
+
249
+ /**
250
+ * Copyright Siemens 2016 - 2025.
251
+ * SPDX-License-Identifier: MIT
252
+ */
253
+
254
+ /**
255
+ * Generated bundle index. Do not edit.
256
+ */
257
+
258
+ export { SiPopoverDescriptionDirective, SiPopoverNextDirective, SiPopoverTitleDirective };
259
+ //# sourceMappingURL=siemens-element-ng-popover-next.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"siemens-element-ng-popover-next.mjs","sources":["../../../../projects/element-ng/popover-next/si-popover.component.ts","../../../../projects/element-ng/popover-next/si-popover.component.html","../../../../projects/element-ng/popover-next/si-popover-next.directive.ts","../../../../projects/element-ng/popover-next/si-popover-title.directive.ts","../../../../projects/element-ng/popover-next/si-popover-description.directive.ts","../../../../projects/element-ng/popover-next/index.ts","../../../../projects/element-ng/popover-next/siemens-element-ng-popover-next.ts"],"sourcesContent":["/**\n * Copyright Siemens 2016 - 2025.\n * SPDX-License-Identifier: MIT\n */\nimport { ConfigurableFocusTrap, ConfigurableFocusTrapFactory } from '@angular/cdk/a11y';\nimport { ConnectedOverlayPositionChange } from '@angular/cdk/overlay';\nimport { DOCUMENT, NgClass, 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} from '@angular/core';\nimport { calculateOverlayArrowPosition, OverlayArrowPosition } from '@siemens/element-ng/common';\nimport { SiIconNextComponent } from '@siemens/element-ng/icon';\n\nimport { SiPopoverNextDirective } from './si-popover-next.directive';\n\n@Component({\n selector: 'si-popover',\n templateUrl: './si-popover.component.html',\n imports: [NgClass, NgTemplateOutlet, SiIconNextComponent],\n host: {\n '[id]': 'this.popoverDirective().popoverId'\n }\n})\nexport class PopoverComponent implements OnInit, OnDestroy {\n readonly popoverDirective = input.required<SiPopoverNextDirective>();\n readonly popoverWrapper = viewChild.required<ElementRef>('popoverWrapper');\n\n protected readonly positionClass = signal('');\n protected readonly arrowPos = signal<OverlayArrowPosition | undefined>(undefined);\n protected popoverTemplate: TemplateRef<any> | null = null;\n protected injector = inject(Injector);\n protected labelledBy: string | undefined;\n protected describedBy: string | undefined;\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.siPopoverNext();\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 class=\"popover position-relative focus-inside\"\n role=\"dialog\"\n [attr.aria-labelledby]=\"labelledBy\"\n [attr.aria-describedby]=\"describedBy\"\n [ngClass]=\"[positionClass(), popover.containerClass()]\"\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.popoverTitle()) {\n <div class=\"popover-header\">\n @let iconValue = popover.icon();\n @if (iconValue) {\n <si-icon-next class=\"icon me-1\" [icon]=\"iconValue\" />\n }\n <span class=\"si-title-2\" [id]=\"labelledBy\">{{ popover.popoverTitle() }}</span>\n </div>\n }\n <div class=\"popover-body\">\n @if (!popoverTemplate) {\n <div class=\"si-body-2\" [id]=\"describedBy\" [innerHTML]=\"popover.siPopoverNext()\"></div>\n } @else {\n <ng-template\n [ngTemplateOutlet]=\"popoverTemplate\"\n [ngTemplateOutletContext]=\"popover.popoverContext()\"\n [ngTemplateOutletInjector]=\"injector\"\n />\n }\n </div>\n</div>\n","/**\n * Copyright Siemens 2016 - 2025.\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 HostListener,\n inject,\n input,\n OnDestroy,\n output,\n signal,\n TemplateRef\n} from '@angular/core';\nimport { getOverlay, getPositionStrategy, positions } from '@siemens/element-ng/common';\nimport { Subject, takeUntil } from 'rxjs';\n\nimport { PopoverComponent } from './si-popover.component';\n\n@Directive({\n selector: '[siPopoverNext]',\n exportAs: 'si-popover-next',\n host: {\n '[attr.aria-expanded]': 'isOpen()',\n '[attr.aria-controls]': 'popoverId'\n }\n})\nexport class SiPopoverNextDirective implements OnDestroy {\n private static idCounter = 0;\n\n /**\n * The popover text to be displayed\n */\n readonly siPopoverNext = input<string | 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');\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 readonly popoverTitle = input<string>();\n\n /**\n * The class that will be applied to container of the popover\n *\n * @defaultValue ''\n */\n readonly containerClass = input('');\n\n /**\n * The icon to be displayed besides popover title\n */\n readonly icon = input<string>();\n\n /**\n * The context for the attached template\n */\n readonly popoverContext = input<unknown>();\n\n /**\n * Emits an event when the popover is shown/hidden\n */\n readonly visibilityChange = output<void>();\n\n readonly popoverCounter = SiPopoverNextDirective.idCounter++;\n readonly popoverId = `__popover_${this.popoverCounter}`;\n\n protected readonly isOpen = signal<boolean>(false);\n\n private overlayref?: OverlayRef;\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 this.overlayref = getOverlay(this.elementRef, this.overlay, false, this.placementInternal());\n this.overlayref\n .outsidePointerEvents()\n .pipe(takeUntil(this.destroyer))\n .subscribe(({ target }) => {\n if (target !== this.elementRef.nativeElement) {\n this.hide();\n }\n });\n\n const popoverPortal = new ComponentPortal(PopoverComponent);\n const popoverRef: ComponentRef<PopoverComponent> = this.overlayref.attach(popoverPortal);\n\n popoverRef.setInput('popoverDirective', this);\n\n const positionStrategy = getPositionStrategy(this.overlayref);\n positionStrategy?.positionChanges\n .pipe(takeUntil(this.destroyer))\n .subscribe(change => popoverRef.instance.updateArrow(change, this.elementRef));\n\n this.isOpen.set(true);\n this.visibilityChange.emit();\n }\n\n /**\n * Hides the popover and emits 'hidden' event.\n */\n hide(): void {\n if (this.overlayref?.hasAttached()) {\n this.overlayref?.detach();\n this.isOpen.set(false);\n this.visibilityChange.emit();\n this.destroyer.next();\n }\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 @HostListener('click')\n protected onClick(): void {\n if (this.overlayref?.hasAttached()) {\n this.hide();\n } else {\n this.show();\n }\n }\n}\n","/**\n * Copyright Siemens 2016 - 2025.\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 }\n})\nexport class SiPopoverTitleDirective {\n readonly popover = inject(PopoverComponent);\n}\n","/**\n * Copyright Siemens 2016 - 2025.\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-description',\n host: {\n '[id]': 'this.popover.describedBy'\n }\n})\nexport class SiPopoverDescriptionDirective {\n readonly popover = inject(PopoverComponent);\n}\n","/**\n * Copyright Siemens 2016 - 2025.\n * SPDX-License-Identifier: MIT\n */\nexport * from './si-popover-next.directive';\nexport * from './si-popover-title.directive';\nexport * from './si-popover-description.directive';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAAA;;;AAGG;MA6BU,gBAAgB,CAAA;AAClB,IAAA,gBAAgB,GAAG,KAAK,CAAC,QAAQ,EAA0B;AAC3D,IAAA,cAAc,GAAG,SAAS,CAAC,QAAQ,CAAa,gBAAgB,CAAC;AAEvD,IAAA,aAAa,GAAG,MAAM,CAAC,EAAE,CAAC;AAC1B,IAAA,QAAQ,GAAG,MAAM,CAAmC,SAAS,CAAC;IACvE,eAAe,GAA4B,IAAI;AAC/C,IAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,IAAA,UAAU;AACV,IAAA,WAAW;AAEb,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAC/B,IAAA,gBAAgB,GAAG,MAAM,CAAC,4BAA4B,CAAC;AACvD,IAAA,SAAS;AACA,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,aAAa,EAAE;AAChD,QAAA,IAAI,OAAO,YAAY,WAAW,EAAE;AAClC,YAAA,IAAI,CAAC,eAAe,GAAG,OAAO;;QAEhC,IAAI,CAAC,UAAU,GAAG,CAAA,gBAAA,EAAmB,gBAAgB,CAAC,cAAc,EAAE;QACtE,IAAI,CAAC,WAAW,GAAG,CAAA,eAAA,EAAkB,gBAAgB,CAAC,cAAc,EAAE;QAEtE,IAAI,CAAC,UAAU,EAAE;;IAGnB,WAAW,GAAA;AACT,QAAA,IAAI,CAAC,SAAS,EAAE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,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;;AAET,oBAAA,QAAQ,EAAE,wBAAwB;AAClC,oBAAA,IAAI,EAAE;AACJ,wBAAA,MAAM,EAAE;AACT;AACF,iBAAA;;;ACdD;;;AAGG;;ACHH;;AAEG;;;;"}
@@ -0,0 +1,256 @@
1
+ import { Overlay } from '@angular/cdk/overlay';
2
+ import { ComponentPortal } from '@angular/cdk/portal';
3
+ import * as i0 from '@angular/core';
4
+ import { input, signal, inject, ElementRef, TemplateRef, Component, computed, booleanAttribute, output, HostListener, Directive, NgModule } from '@angular/core';
5
+ import { calculateOverlayArrowPosition, hasTrigger, getOverlay, getPositionStrategy } from '@siemens/element-ng/common';
6
+ import { Subject, takeUntil } from 'rxjs';
7
+ import { NgClass, NgTemplateOutlet } from '@angular/common';
8
+ import { SiIconNextComponent } from '@siemens/element-ng/icon';
9
+
10
+ class PopoverComponent {
11
+ popover = input();
12
+ /** @defaultValue '' */
13
+ popoverTitle = input('');
14
+ /** @defaultValue '' */
15
+ containerClass = input('');
16
+ icon = input();
17
+ popoverContext = input();
18
+ positionClass = signal('');
19
+ arrowPos = signal(undefined);
20
+ popoverTemplate = null;
21
+ elementRef = inject(ElementRef);
22
+ ngOnInit() {
23
+ const popover = this.popover();
24
+ if (popover instanceof TemplateRef) {
25
+ this.popoverTemplate = popover;
26
+ }
27
+ }
28
+ /** @internal */
29
+ updateArrow(change, anchor) {
30
+ const positionClass = `popover-${change.connectionPair.overlayX}-${change.connectionPair.overlayY}`;
31
+ // need two updates as class changes affect the position
32
+ this.positionClass.set(positionClass);
33
+ const arrowPos = calculateOverlayArrowPosition(change, this.elementRef, anchor);
34
+ this.arrowPos.set(arrowPos);
35
+ }
36
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: PopoverComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
37
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: PopoverComponent, isStandalone: true, selector: "si-popover", inputs: { popover: { classPropertyName: "popover", publicName: "popover", isSignal: true, isRequired: false, transformFunction: null }, popoverTitle: { classPropertyName: "popoverTitle", publicName: "popoverTitle", isSignal: true, isRequired: false, transformFunction: null }, containerClass: { classPropertyName: "containerClass", publicName: "containerClass", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, popoverContext: { classPropertyName: "popoverContext", publicName: "popoverContext", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div\n class=\"popover position-relative focus-outline-padding\"\n [ngClass]=\"[containerClass(), positionClass()]\"\n>\n <div\n class=\"popover-arrow\"\n [style.left.px]=\"arrowPos()?.left\"\n [style.right.px]=\"arrowPos()?.right\"\n ></div>\n @if (popoverTitle()) {\n <div class=\"popover-header\">\n @let iconValue = icon();\n @if (iconValue) {\n <si-icon-next class=\"icon me-2\" [icon]=\"iconValue\" />\n }\n <span class=\"si-title-2\">{{ popoverTitle() }}</span>\n </div>\n }\n <div class=\"popover-body\">\n @if (!popoverTemplate) {\n <div class=\"si-body-2\" [innerHTML]=\"popover()\"></div>\n } @else {\n <ng-template\n [ngTemplateOutlet]=\"popoverTemplate\"\n [ngTemplateOutletContext]=\"popoverContext()\"\n />\n }\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: SiIconNextComponent, selector: "si-icon-next", inputs: ["icon"] }] });
38
+ }
39
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: PopoverComponent, decorators: [{
40
+ type: Component,
41
+ args: [{ selector: 'si-popover', imports: [NgClass, NgTemplateOutlet, SiIconNextComponent], template: "<div\n class=\"popover position-relative focus-outline-padding\"\n [ngClass]=\"[containerClass(), positionClass()]\"\n>\n <div\n class=\"popover-arrow\"\n [style.left.px]=\"arrowPos()?.left\"\n [style.right.px]=\"arrowPos()?.right\"\n ></div>\n @if (popoverTitle()) {\n <div class=\"popover-header\">\n @let iconValue = icon();\n @if (iconValue) {\n <si-icon-next class=\"icon me-2\" [icon]=\"iconValue\" />\n }\n <span class=\"si-title-2\">{{ popoverTitle() }}</span>\n </div>\n }\n <div class=\"popover-body\">\n @if (!popoverTemplate) {\n <div class=\"si-body-2\" [innerHTML]=\"popover()\"></div>\n } @else {\n <ng-template\n [ngTemplateOutlet]=\"popoverTemplate\"\n [ngTemplateOutletContext]=\"popoverContext()\"\n />\n }\n </div>\n</div>\n" }]
42
+ }] });
43
+
44
+ /**
45
+ * Copyright Siemens 2016 - 2025.
46
+ * SPDX-License-Identifier: MIT
47
+ */
48
+ class SiPopoverDirective {
49
+ /**
50
+ * The popover text to be displayed
51
+ */
52
+ siPopover = input();
53
+ /**
54
+ * The placement of the popover. One of 'top', 'start', end', 'bottom'
55
+ *
56
+ * @defaultValue 'auto'
57
+ */
58
+ placement = input('auto');
59
+ placementInternal = computed(() => {
60
+ if (this.placement() !== 'top' &&
61
+ this.placement() !== 'bottom' &&
62
+ this.placement() !== 'start' &&
63
+ this.placement() !== 'end') {
64
+ return 'auto';
65
+ }
66
+ else {
67
+ return this.placement();
68
+ }
69
+ });
70
+ /**
71
+ * The trigger event(s) on which the popover shall be displayed.
72
+ * Applications can pass multiple triggers separated by space.
73
+ * Supported events are 'click', 'hover' and 'focus'.
74
+ *
75
+ * **Limitations:**
76
+ * Safari browsers do not raise a 'focus' event on host element click and 'focus'
77
+ * on tab key has to be enabled in the advanced browser settings.
78
+ *
79
+ * @defaultValue 'click'
80
+ */
81
+ triggers = input('click');
82
+ /**
83
+ * The title to be displayed on top for the popover
84
+ *
85
+ * @defaultValue ''
86
+ */
87
+ popoverTitle = input('');
88
+ /**
89
+ * The class that will be applied to container of the popover
90
+ *
91
+ * @defaultValue ''
92
+ */
93
+ containerClass = input('');
94
+ /**
95
+ * The flag determines whether to close popover on clicking outside
96
+ *
97
+ * @defaultValue true
98
+ */
99
+ outsideClick = input(true, { transform: booleanAttribute });
100
+ /**
101
+ * The icon to be displayed besides popover title
102
+ */
103
+ icon = input();
104
+ /**
105
+ * Specify whether or not the popover is currently shown
106
+ *
107
+ * @defaultValue false
108
+ */
109
+ isOpen = input(false, { transform: booleanAttribute });
110
+ /**
111
+ * The context for the attached template
112
+ */
113
+ popoverContext = input();
114
+ /**
115
+ * Emits an event when the popover is shown
116
+ */
117
+ shown = output();
118
+ /**
119
+ * Emits an event when the popover is hidden
120
+ */
121
+ hidden = output();
122
+ overlayref;
123
+ overlay = inject(Overlay);
124
+ elementRef = inject(ElementRef);
125
+ destroyer = new Subject();
126
+ ngOnInit() {
127
+ if (this.isOpen()) {
128
+ this.show();
129
+ }
130
+ }
131
+ ngOnDestroy() {
132
+ this.overlayref?.dispose();
133
+ this.destroyer.next();
134
+ this.destroyer.complete();
135
+ }
136
+ /**
137
+ * Displays popover and emits 'shown' event.
138
+ */
139
+ show() {
140
+ if (!this.overlayref?.hasAttached()) {
141
+ const triggers = this.triggers();
142
+ const backdrop = this.outsideClick() && !hasTrigger('focus', triggers) && !hasTrigger('hover', triggers);
143
+ this.overlayref = getOverlay(this.elementRef, this.overlay, backdrop, this.placementInternal());
144
+ if (backdrop) {
145
+ this.overlayref
146
+ .backdropClick()
147
+ .pipe(takeUntil(this.destroyer))
148
+ .subscribe(() => this.hide());
149
+ }
150
+ }
151
+ if (this.overlayref.hasAttached()) {
152
+ return;
153
+ }
154
+ const popoverPortal = new ComponentPortal(PopoverComponent);
155
+ const popoverRef = this.overlayref.attach(popoverPortal);
156
+ popoverRef.setInput('popover', this.siPopover());
157
+ popoverRef.setInput('popoverTitle', this.popoverTitle());
158
+ popoverRef.setInput('icon', this.icon());
159
+ popoverRef.setInput('containerClass', this.containerClass());
160
+ popoverRef.setInput('popoverContext', this.popoverContext());
161
+ const positionStrategy = getPositionStrategy(this.overlayref);
162
+ positionStrategy?.positionChanges
163
+ .pipe(takeUntil(this.destroyer))
164
+ .subscribe(change => popoverRef.instance.updateArrow(change, this.elementRef));
165
+ this.shown.emit();
166
+ }
167
+ /**
168
+ * Hides the popover and emits 'hidden' event.
169
+ */
170
+ hide() {
171
+ if (this.overlayref?.hasAttached()) {
172
+ this.overlayref?.detach();
173
+ this.hidden.emit();
174
+ this.destroyer.next();
175
+ }
176
+ }
177
+ /**
178
+ * Updates the position of the popover based on the position strategy.
179
+ */
180
+ updatePosition() {
181
+ this.overlayref?.updatePosition();
182
+ }
183
+ onTrigger(trigger) {
184
+ if (hasTrigger(trigger, this.triggers())) {
185
+ if (this.overlayref?.hasAttached()) {
186
+ this.hide();
187
+ }
188
+ else {
189
+ this.show();
190
+ }
191
+ }
192
+ }
193
+ focusOut() {
194
+ if (hasTrigger('focus', this.triggers())) {
195
+ if (this.outsideClick()) {
196
+ this.hide();
197
+ }
198
+ }
199
+ }
200
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiPopoverDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
201
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.6", type: SiPopoverDirective, isStandalone: true, selector: "[siPopover]", inputs: { siPopover: { classPropertyName: "siPopover", publicName: "siPopover", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, triggers: { classPropertyName: "triggers", publicName: "triggers", isSignal: true, isRequired: false, transformFunction: null }, popoverTitle: { classPropertyName: "popoverTitle", publicName: "popoverTitle", isSignal: true, isRequired: false, transformFunction: null }, containerClass: { classPropertyName: "containerClass", publicName: "containerClass", isSignal: true, isRequired: false, transformFunction: null }, outsideClick: { classPropertyName: "outsideClick", publicName: "outsideClick", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null }, popoverContext: { classPropertyName: "popoverContext", publicName: "popoverContext", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { shown: "shown", hidden: "hidden" }, host: { listeners: { "mouseenter": "onTrigger(\"hover\")", "mouseleave": "onTrigger(\"hover\")", "focus": "onTrigger(\"focus\")", "click": "onTrigger(\"click\")", "touchstart": "focusOut()", "focusout": "focusOut()" } }, exportAs: ["si-popover"], ngImport: i0 });
202
+ }
203
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiPopoverDirective, decorators: [{
204
+ type: Directive,
205
+ args: [{
206
+ selector: '[siPopover]',
207
+ exportAs: 'si-popover'
208
+ }]
209
+ }], propDecorators: { onTrigger: [{
210
+ type: HostListener,
211
+ args: ['mouseenter', ['"hover"']]
212
+ }, {
213
+ type: HostListener,
214
+ args: ['mouseleave', ['"hover"']]
215
+ }, {
216
+ type: HostListener,
217
+ args: ['focus', ['"focus"']]
218
+ }, {
219
+ type: HostListener,
220
+ args: ['click', ['"click"']]
221
+ }], focusOut: [{
222
+ type: HostListener,
223
+ args: ['touchstart']
224
+ }, {
225
+ type: HostListener,
226
+ args: ['focusout']
227
+ }] } });
228
+
229
+ /**
230
+ * Copyright Siemens 2016 - 2025.
231
+ * SPDX-License-Identifier: MIT
232
+ */
233
+ class SiPopoverModule {
234
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiPopoverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
235
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: SiPopoverModule, imports: [SiPopoverDirective], exports: [SiPopoverDirective] });
236
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiPopoverModule });
237
+ }
238
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiPopoverModule, decorators: [{
239
+ type: NgModule,
240
+ args: [{
241
+ imports: [SiPopoverDirective],
242
+ exports: [SiPopoverDirective]
243
+ }]
244
+ }] });
245
+
246
+ /**
247
+ * Copyright Siemens 2016 - 2025.
248
+ * SPDX-License-Identifier: MIT
249
+ */
250
+
251
+ /**
252
+ * Generated bundle index. Do not edit.
253
+ */
254
+
255
+ export { SiPopoverDirective, SiPopoverModule };
256
+ //# sourceMappingURL=siemens-element-ng-popover.mjs.map
@@ -0,0 +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.module.ts","../../../../projects/element-ng/popover/index.ts","../../../../projects/element-ng/popover/siemens-element-ng-popover.ts"],"sourcesContent":["/**\n * Copyright Siemens 2016 - 2025.\n * SPDX-License-Identifier: MIT\n */\nimport { ConnectedOverlayPositionChange } from '@angular/cdk/overlay';\nimport { NgClass, NgTemplateOutlet } from '@angular/common';\nimport { Component, ElementRef, inject, input, OnInit, signal, TemplateRef } from '@angular/core';\nimport { calculateOverlayArrowPosition, OverlayArrowPosition } from '@siemens/element-ng/common';\nimport { SiIconNextComponent } from '@siemens/element-ng/icon';\n\n@Component({\n selector: 'si-popover',\n templateUrl: './si-popover.component.html',\n imports: [NgClass, NgTemplateOutlet, SiIconNextComponent]\n})\nexport class PopoverComponent implements OnInit {\n readonly popover = input<string | TemplateRef<any>>();\n /** @defaultValue '' */\n readonly popoverTitle = input('');\n /** @defaultValue '' */\n readonly containerClass = input('');\n readonly icon = input<string>();\n readonly popoverContext = input<unknown>();\n\n protected readonly positionClass = signal('');\n protected readonly arrowPos = signal<OverlayArrowPosition | undefined>(undefined);\n protected popoverTemplate: TemplateRef<any> | null = null;\n\n private elementRef = inject(ElementRef);\n\n ngOnInit(): void {\n const popover = this.popover();\n if (popover instanceof TemplateRef) {\n this.popoverTemplate = popover;\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","<div\n class=\"popover position-relative focus-outline-padding\"\n [ngClass]=\"[containerClass(), positionClass()]\"\n>\n <div\n class=\"popover-arrow\"\n [style.left.px]=\"arrowPos()?.left\"\n [style.right.px]=\"arrowPos()?.right\"\n ></div>\n @if (popoverTitle()) {\n <div class=\"popover-header\">\n @let iconValue = icon();\n @if (iconValue) {\n <si-icon-next class=\"icon me-2\" [icon]=\"iconValue\" />\n }\n <span class=\"si-title-2\">{{ popoverTitle() }}</span>\n </div>\n }\n <div class=\"popover-body\">\n @if (!popoverTemplate) {\n <div class=\"si-body-2\" [innerHTML]=\"popover()\"></div>\n } @else {\n <ng-template\n [ngTemplateOutlet]=\"popoverTemplate\"\n [ngTemplateOutletContext]=\"popoverContext()\"\n />\n }\n </div>\n</div>\n","/**\n * Copyright Siemens 2016 - 2025.\n * SPDX-License-Identifier: MIT\n */\nimport { Overlay, OverlayRef } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport {\n booleanAttribute,\n ComponentRef,\n computed,\n Directive,\n ElementRef,\n HostListener,\n inject,\n input,\n OnDestroy,\n OnInit,\n output,\n TemplateRef\n} from '@angular/core';\nimport { getOverlay, getPositionStrategy, hasTrigger, positions } from '@siemens/element-ng/common';\nimport { Subject, takeUntil } from 'rxjs';\n\nimport { PopoverComponent } from './si-popover.component';\n\n@Directive({\n selector: '[siPopover]',\n exportAs: 'si-popover'\n})\nexport class SiPopoverDirective implements OnInit, OnDestroy {\n /**\n * The popover text to be displayed\n */\n readonly siPopover = input<string | TemplateRef<any>>();\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');\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 trigger event(s) on which the popover shall be displayed.\n * Applications can pass multiple triggers separated by space.\n * Supported events are 'click', 'hover' and 'focus'.\n *\n * **Limitations:**\n * Safari browsers do not raise a 'focus' event on host element click and 'focus'\n * on tab key has to be enabled in the advanced browser settings.\n *\n * @defaultValue 'click'\n */\n readonly triggers = input('click');\n\n /**\n * The title to be displayed on top for the popover\n *\n * @defaultValue ''\n */\n readonly popoverTitle = input('');\n\n /**\n * The class that will be applied to container of the popover\n *\n * @defaultValue ''\n */\n readonly containerClass = input('');\n\n /**\n * The flag determines whether to close popover on clicking outside\n *\n * @defaultValue true\n */\n readonly outsideClick = input(true, { transform: booleanAttribute });\n\n /**\n * The icon to be displayed besides popover title\n */\n readonly icon = input<string>();\n\n /**\n * Specify whether or not the popover is currently shown\n *\n * @defaultValue false\n */\n readonly isOpen = input<boolean | undefined, unknown>(false, { transform: booleanAttribute });\n\n /**\n * The context for the attached template\n */\n readonly popoverContext = input<unknown>();\n\n /**\n * Emits an event when the popover is shown\n */\n readonly shown = output<void>();\n\n /**\n * Emits an event when the popover is hidden\n */\n readonly hidden = output<void>();\n\n private overlayref?: OverlayRef;\n private overlay = inject(Overlay);\n private elementRef = inject(ElementRef);\n private destroyer = new Subject<void>();\n\n ngOnInit(): void {\n if (this.isOpen()) {\n this.show();\n }\n }\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 const triggers = this.triggers();\n const backdrop =\n this.outsideClick() && !hasTrigger('focus', triggers) && !hasTrigger('hover', triggers);\n this.overlayref = getOverlay(\n this.elementRef,\n this.overlay,\n backdrop,\n this.placementInternal()\n );\n if (backdrop) {\n this.overlayref\n .backdropClick()\n .pipe(takeUntil(this.destroyer))\n .subscribe(() => this.hide());\n }\n }\n\n if (this.overlayref.hasAttached()) {\n return;\n }\n const popoverPortal = new ComponentPortal(PopoverComponent);\n const popoverRef: ComponentRef<PopoverComponent> = this.overlayref.attach(popoverPortal);\n\n popoverRef.setInput('popover', this.siPopover());\n popoverRef.setInput('popoverTitle', this.popoverTitle());\n popoverRef.setInput('icon', this.icon());\n popoverRef.setInput('containerClass', this.containerClass());\n popoverRef.setInput('popoverContext', this.popoverContext());\n\n const positionStrategy = getPositionStrategy(this.overlayref);\n positionStrategy?.positionChanges\n .pipe(takeUntil(this.destroyer))\n .subscribe(change => popoverRef.instance.updateArrow(change, this.elementRef));\n\n this.shown.emit();\n }\n\n /**\n * Hides the popover and emits 'hidden' event.\n */\n hide(): void {\n if (this.overlayref?.hasAttached()) {\n this.overlayref?.detach();\n this.hidden.emit();\n this.destroyer.next();\n }\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 @HostListener('mouseenter', ['\"hover\"'])\n @HostListener('mouseleave', ['\"hover\"'])\n @HostListener('focus', ['\"focus\"'])\n @HostListener('click', ['\"click\"'])\n protected onTrigger(trigger: string): void {\n if (hasTrigger(trigger, this.triggers())) {\n if (this.overlayref?.hasAttached()) {\n this.hide();\n } else {\n this.show();\n }\n }\n }\n\n @HostListener('touchstart')\n @HostListener('focusout')\n protected focusOut(): void {\n if (hasTrigger('focus', this.triggers())) {\n if (this.outsideClick()) {\n this.hide();\n }\n }\n }\n}\n","/**\n * Copyright Siemens 2016 - 2025.\n * SPDX-License-Identifier: MIT\n */\nimport { NgModule } from '@angular/core';\n\nimport { SiPopoverDirective } from './si-popover.directive';\n\n@NgModule({\n imports: [SiPopoverDirective],\n exports: [SiPopoverDirective]\n})\nexport class SiPopoverModule {}\n","/**\n * Copyright Siemens 2016 - 2025.\n * SPDX-License-Identifier: MIT\n */\nexport * from './si-popover.directive';\nexport * from './si-popover.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MAea,gBAAgB,CAAA;IAClB,OAAO,GAAG,KAAK,EAA6B;;AAE5C,IAAA,YAAY,GAAG,KAAK,CAAC,EAAE,CAAC;;AAExB,IAAA,cAAc,GAAG,KAAK,CAAC,EAAE,CAAC;IAC1B,IAAI,GAAG,KAAK,EAAU;IACtB,cAAc,GAAG,KAAK,EAAW;AAEvB,IAAA,aAAa,GAAG,MAAM,CAAC,EAAE,CAAC;AAC1B,IAAA,QAAQ,GAAG,MAAM,CAAmC,SAAS,CAAC;IACvE,eAAe,GAA4B,IAAI;AAEjD,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;IAEvC,QAAQ,GAAA;AACN,QAAA,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE;AAC9B,QAAA,IAAI,OAAO,YAAY,WAAW,EAAE;AAClC,YAAA,IAAI,CAAC,eAAe,GAAG,OAAO;;;;IAKlC,WAAW,CAAC,MAAsC,EAAE,MAAmB,EAAA;AACrE,QAAA,MAAM,aAAa,GAAG,CAAW,QAAA,EAAA,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAA,CAAA,EAAI,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE;;AAEnG,QAAA,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,aAAa,CAAC;AACrC,QAAA,MAAM,QAAQ,GAAG,6BAA6B,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC;AAC/E,QAAA,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC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