@siemens/element-ng 47.0.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.
- package/LICENSE.md +20 -0
- package/README.md +27 -0
- package/application-header/index.d.ts +17 -0
- package/application-header/launchpad/si-launchpad-app.component.d.ts +21 -0
- package/application-header/launchpad/si-launchpad-factory.component.d.ts +83 -0
- package/application-header/launchpad/si-launchpad.model.d.ts +33 -0
- package/application-header/package.json +3 -0
- package/application-header/si-application-header.component.d.ts +60 -0
- package/application-header/si-header-account-item.component.d.ts +13 -0
- package/application-header/si-header-action-item-icon-base.directive.d.ts +26 -0
- package/application-header/si-header-action-item.base.d.ts +19 -0
- package/application-header/si-header-action-item.component.d.ts +9 -0
- package/application-header/si-header-actions.directive.d.ts +5 -0
- package/application-header/si-header-brand.directive.d.ts +5 -0
- package/application-header/si-header-collapsible-actions.component.d.ts +33 -0
- package/application-header/si-header-logo.directive.d.ts +6 -0
- package/application-header/si-header-navigation-item.component.d.ts +10 -0
- package/application-header/si-header-navigation.component.d.ts +11 -0
- package/application-header/si-header-selection-item.component.d.ts +12 -0
- package/application-header/si-header-siemens-logo.component.d.ts +20 -0
- package/avatar/index.d.ts +6 -0
- package/avatar/package.json +3 -0
- package/avatar/si-avatar-background-color.directive.d.ts +35 -0
- package/avatar/si-avatar.component.d.ts +50 -0
- package/common/decorators/index.d.ts +5 -0
- package/common/decorators/webcomponent.decorator.d.ts +6 -0
- package/common/helpers/animation.helpers.d.ts +10 -0
- package/common/helpers/global-events.helpers.d.ts +5 -0
- package/common/helpers/index.d.ts +10 -0
- package/common/helpers/overlay-helper.d.ts +24 -0
- package/common/helpers/positioning.helpers.d.ts +58 -0
- package/common/helpers/rtl.d.ts +6 -0
- package/common/helpers/track-by.helper.d.ts +27 -0
- package/common/index.d.ts +8 -0
- package/common/models/color-variant.model.d.ts +8 -0
- package/common/models/index.d.ts +8 -0
- package/common/models/menu.model.d.ts +85 -0
- package/common/models/positions.model.d.ts +18 -0
- package/common/models/status-type.model.d.ts +19 -0
- package/common/package.json +3 -0
- package/common/services/blink.service.d.ts +41 -0
- package/common/services/index.d.ts +8 -0
- package/common/services/scrollbar-helper.service.d.ts +17 -0
- package/common/services/si-uistate.service.d.ts +61 -0
- package/common/services/text-measure.service.d.ts +21 -0
- package/element-ng.scss +14 -0
- package/fesm2022/siemens-element-ng-application-header.mjs +747 -0
- package/fesm2022/siemens-element-ng-application-header.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-avatar.mjs +185 -0
- package/fesm2022/siemens-element-ng-avatar.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-common.mjs +946 -0
- package/fesm2022/siemens-element-ng-common.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-header-dropdown.mjs +384 -0
- package/fesm2022/siemens-element-ng-header-dropdown.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-icon.mjs +236 -0
- package/fesm2022/siemens-element-ng-icon.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-link.mjs +233 -0
- package/fesm2022/siemens-element-ng-link.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-resize-observer.mjs +332 -0
- package/fesm2022/siemens-element-ng-resize-observer.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-theme.mjs +770 -0
- package/fesm2022/siemens-element-ng-theme.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-translate.mjs +22 -0
- package/fesm2022/siemens-element-ng-translate.mjs.map +1 -0
- package/fesm2022/siemens-element-ng.mjs +12 -0
- package/fesm2022/siemens-element-ng.mjs.map +1 -0
- package/header-dropdown/index.d.ts +9 -0
- package/header-dropdown/package.json +3 -0
- package/header-dropdown/si-header-dropdown-item.component.d.ts +23 -0
- package/header-dropdown/si-header-dropdown-items-factory.component.d.ts +14 -0
- package/header-dropdown/si-header-dropdown-trigger.directive.d.ts +57 -0
- package/header-dropdown/si-header-dropdown.component.d.ts +20 -0
- package/header-dropdown/si-header.model.d.ts +37 -0
- package/icon/element-icons.d.ts +12 -0
- package/icon/index.d.ts +9 -0
- package/icon/package.json +3 -0
- package/icon/si-icon-next.component.d.ts +68 -0
- package/icon/si-icon.component.d.ts +23 -0
- package/icon/si-icon.module.d.ts +7 -0
- package/icon/si-icons.d.ts +31 -0
- package/index.d.ts +5 -0
- package/link/aria-current.model.d.ts +5 -0
- package/link/index.d.ts +8 -0
- package/link/link.model.d.ts +57 -0
- package/link/package.json +3 -0
- package/link/si-link-action.service.d.ts +17 -0
- package/link/si-link.directive.d.ts +42 -0
- package/link/si-link.module.d.ts +7 -0
- package/package.json +86 -0
- package/public-api.d.ts +5 -0
- package/resize-observer/index.d.ts +8 -0
- package/resize-observer/package.json +3 -0
- package/resize-observer/resize-observer.service.d.ts +41 -0
- package/resize-observer/si-resize-observer.directive.d.ts +29 -0
- package/resize-observer/si-resize-observer.module.d.ts +8 -0
- package/resize-observer/si-responsive-container.directive.d.ts +73 -0
- package/theme/index.d.ts +7 -0
- package/theme/package.json +3 -0
- package/theme/si-theme-store.d.ts +82 -0
- package/theme/si-theme.model.d.ts +48 -0
- package/theme/si-theme.service.d.ts +129 -0
- package/translate/index.d.ts +7 -0
- package/translate/package.json +3 -0
- package/translate/si-translatable-keys.interface.d.ts +11 -0
- package/translate/si-translatable-overrides.provider.d.ts +7 -0
|
@@ -0,0 +1,747 @@
|
|
|
1
|
+
import * as i2 from '@angular/cdk/a11y';
|
|
2
|
+
import { CdkTrapFocus, A11yModule } from '@angular/cdk/a11y';
|
|
3
|
+
import { BreakpointObserver } from '@angular/cdk/layout';
|
|
4
|
+
import { NgClass, NgTemplateOutlet, CommonModule } from '@angular/common';
|
|
5
|
+
import * as i0 from '@angular/core';
|
|
6
|
+
import { input, signal, inject, Injector, viewChild, ChangeDetectionStrategy, Component, HostListener, Directive, computed, booleanAttribute, model, output } from '@angular/core';
|
|
7
|
+
import { SI_HEADER_WITH_DROPDOWNS, SiHeaderDropdownTriggerDirective, SI_HEADER_DROPDOWN_OPTIONS } from '@siemens/element-ng/header-dropdown';
|
|
8
|
+
import { addIcons, elementMenu, elementThumbnails, SiIconNextComponent, elementDown2, elementOptionsVertical, elementFavoritesFilled, elementFavorites, elementExport, elementCancel } from '@siemens/element-ng/icon';
|
|
9
|
+
import { BOOTSTRAP_BREAKPOINTS } from '@siemens/element-ng/resize-observer';
|
|
10
|
+
import * as i1 from '@siemens/element-translate-ng/translate';
|
|
11
|
+
import { SiTranslateModule } from '@siemens/element-translate-ng/translate';
|
|
12
|
+
import { Subject, defer, of } from 'rxjs';
|
|
13
|
+
import { map, skip, takeUntil } from 'rxjs/operators';
|
|
14
|
+
import { SiAvatarComponent } from '@siemens/element-ng/avatar';
|
|
15
|
+
import { SiLinkModule } from '@siemens/element-ng/link';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Copyright Siemens 2016 - 2025.
|
|
19
|
+
* SPDX-License-Identifier: MIT
|
|
20
|
+
*/
|
|
21
|
+
/** Root component for the application header. */
|
|
22
|
+
class SiApplicationHeaderComponent {
|
|
23
|
+
static idCounter = 0;
|
|
24
|
+
/**
|
|
25
|
+
* Defines the minimum breakpoint which must be matched to expand the header / switch to desktop mode.
|
|
26
|
+
*
|
|
27
|
+
* @defaultValue 'sm'
|
|
28
|
+
*/
|
|
29
|
+
expandBreakpoint = input('sm');
|
|
30
|
+
launchpad = input();
|
|
31
|
+
/**
|
|
32
|
+
* @defaultValue
|
|
33
|
+
* ```
|
|
34
|
+
* $localize`:@@SI_APPLICATION_HEADER.LAUNCHPAD:Launchpad`
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
launchpadLabel = input($localize `:@@SI_APPLICATION_HEADER.LAUNCHPAD:Launchpad`);
|
|
38
|
+
/** @internal */
|
|
39
|
+
closeMobileMenus = new Subject();
|
|
40
|
+
/** @internal */
|
|
41
|
+
mobileNavigationExpanded = signal(false);
|
|
42
|
+
/** @internal */
|
|
43
|
+
hasNavigation = signal(false);
|
|
44
|
+
openDropdownCount = signal(0);
|
|
45
|
+
launchpadOpen = signal(false);
|
|
46
|
+
id = `__si-application-header-${SiApplicationHeaderComponent.idCounter++}`;
|
|
47
|
+
toggleNavigation = $localize `:@@SI_APPLICATION_HEADER.TOGGLE_NAVIGATION:Toggle navigation`;
|
|
48
|
+
injector = inject(Injector);
|
|
49
|
+
icons = addIcons({ elementThumbnails, elementMenu });
|
|
50
|
+
navigationToggle = viewChild('navigationToggle');
|
|
51
|
+
focusTrap = viewChild.required(CdkTrapFocus);
|
|
52
|
+
breakpointObserver = inject(BreakpointObserver);
|
|
53
|
+
openDropdown;
|
|
54
|
+
closeMobileSub = this.closeMobileMenus.subscribe(() => {
|
|
55
|
+
this.closeMobileNavigation();
|
|
56
|
+
this.closeLaunchpad();
|
|
57
|
+
});
|
|
58
|
+
/** @internal */
|
|
59
|
+
// defer is required to re-check the current breakpoint as it may change.
|
|
60
|
+
inlineDropdown = defer(() => {
|
|
61
|
+
const expandBreakpoint = this.expandBreakpoint();
|
|
62
|
+
if (expandBreakpoint === 'never') {
|
|
63
|
+
return of(true);
|
|
64
|
+
}
|
|
65
|
+
return this.breakpointObserver
|
|
66
|
+
.observe(`(min-width: ${BOOTSTRAP_BREAKPOINTS[(expandBreakpoint + 'Minimum')]}px)`)
|
|
67
|
+
.pipe(map(({ matches }) => !matches));
|
|
68
|
+
});
|
|
69
|
+
ngOnDestroy() {
|
|
70
|
+
this.closeMobileSub.unsubscribe();
|
|
71
|
+
this.closeMobileMenus.next();
|
|
72
|
+
this.closeMobileMenus.complete();
|
|
73
|
+
}
|
|
74
|
+
/** @internal */
|
|
75
|
+
onDropdownItemTriggered() {
|
|
76
|
+
this.closeMobileMenus.next();
|
|
77
|
+
}
|
|
78
|
+
/** @internal */
|
|
79
|
+
dropdownClosed(trigger) {
|
|
80
|
+
this.openDropdownCount.update(v => v - 1);
|
|
81
|
+
if (trigger === this.openDropdown) {
|
|
82
|
+
this.openDropdown = undefined;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/** @internal */
|
|
86
|
+
dropdownOpened(trigger) {
|
|
87
|
+
this.openDropdown ??= trigger;
|
|
88
|
+
this.openDropdownCount.update(v => v + 1);
|
|
89
|
+
this.closeLaunchpad();
|
|
90
|
+
}
|
|
91
|
+
/** @internal */
|
|
92
|
+
closeLaunchpad() {
|
|
93
|
+
if (this.launchpadOpen()) {
|
|
94
|
+
this.launchpadOpen.set(false);
|
|
95
|
+
this.dropdownClosed();
|
|
96
|
+
if (this.hasNavigation()) {
|
|
97
|
+
// This is also fine in expanded view when the mobile toggle is not visible.
|
|
98
|
+
// Then the focus call will be ignored.
|
|
99
|
+
this.navigationToggle()?.nativeElement.focus();
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/** @internal */
|
|
104
|
+
openLaunchpad() {
|
|
105
|
+
if (!this.launchpadOpen()) {
|
|
106
|
+
this.dropdownOpened();
|
|
107
|
+
this.closeMobileMenus.next();
|
|
108
|
+
this.launchpadOpen.set(true);
|
|
109
|
+
this.inlineDropdown
|
|
110
|
+
.pipe(skip(1), takeUntil(this.closeMobileMenus))
|
|
111
|
+
.subscribe(() => this.closeMobileMenus.next());
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
toggleMobileNavigationExpanded() {
|
|
115
|
+
if (this.mobileNavigationExpanded()) {
|
|
116
|
+
this.closeMobileNavigation();
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
this.openMobileNavigation();
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
toggleLaunchpad() {
|
|
123
|
+
if (this.launchpadOpen()) {
|
|
124
|
+
this.closeLaunchpad();
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
this.openLaunchpad();
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
navigationEscapePressed() {
|
|
131
|
+
this.closeMobileNavigation();
|
|
132
|
+
this.navigationToggle()?.nativeElement.focus();
|
|
133
|
+
}
|
|
134
|
+
backdropClicked() {
|
|
135
|
+
this.closeMobileMenus.next();
|
|
136
|
+
}
|
|
137
|
+
openMobileNavigation() {
|
|
138
|
+
if (!this.mobileNavigationExpanded()) {
|
|
139
|
+
this.closeMobileMenus.next();
|
|
140
|
+
this.mobileNavigationExpanded.set(true);
|
|
141
|
+
this.dropdownOpened();
|
|
142
|
+
this.inlineDropdown
|
|
143
|
+
.pipe(skip(1), takeUntil(this.closeMobileMenus))
|
|
144
|
+
.subscribe(() => this.closeMobileMenus.next());
|
|
145
|
+
this.focusTrap().focusTrap.focusFirstTabbableElementWhenReady();
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
closeMobileNavigation() {
|
|
149
|
+
if (this.mobileNavigationExpanded()) {
|
|
150
|
+
this.mobileNavigationExpanded.set(false);
|
|
151
|
+
this.openDropdown?.close();
|
|
152
|
+
this.dropdownClosed();
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiApplicationHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
156
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: SiApplicationHeaderComponent, isStandalone: true, selector: "si-application-header", inputs: { expandBreakpoint: { classPropertyName: "expandBreakpoint", publicName: "expandBreakpoint", isSignal: true, isRequired: false, transformFunction: null }, launchpad: { classPropertyName: "launchpad", publicName: "launchpad", isSignal: true, isRequired: false, transformFunction: null }, launchpadLabel: { classPropertyName: "launchpadLabel", publicName: "launchpadLabel", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: SI_HEADER_WITH_DROPDOWNS, useExisting: SiApplicationHeaderComponent }], viewQueries: [{ propertyName: "navigationToggle", first: true, predicate: ["navigationToggle"], descendants: true, isSignal: true }, { propertyName: "focusTrap", first: true, predicate: CdkTrapFocus, descendants: true, isSignal: true }], ngImport: i0, template: "<header\n class=\"application-header\"\n [ngClass]=\"'expand-' + expandBreakpoint()\"\n [class.show-navigation]=\"mobileNavigationExpanded()\"\n>\n @if (launchpad()) {\n <button\n type=\"button\"\n class=\"header-toggle focus-inside\"\n [class.show]=\"launchpadOpen()\"\n [class.d-none]=\"hasNavigation()\"\n [ngClass]=\"'d-' + expandBreakpoint() + '-block'\"\n [attr.aria-expanded]=\"launchpadOpen()\"\n [attr.aria-label]=\"launchpadLabel() | translate\"\n [attr.aria-controls]=\"id + '-launchpad'\"\n (click)=\"toggleLaunchpad()\"\n >\n <si-icon-next [icon]=\"icons.elementThumbnails\" />\n </button>\n }\n @if (hasNavigation()) {\n <button\n #navigationToggle\n type=\"button\"\n class=\"header-toggle focus-inside\"\n [class.show]=\"mobileNavigationExpanded()\"\n [attr.aria-expanded]=\"mobileNavigationExpanded()\"\n [attr.aria-label]=\"toggleNavigation | translate\"\n [attr.aria-controls]=\"id + '-navigation-wrapper'\"\n (click)=\"toggleMobileNavigationExpanded()\"\n >\n <si-icon-next [icon]=\"icons.elementMenu\" />\n </button>\n }\n <ng-content select=\"si-header-brand, element-header-brand\">\n <div class=\"header-brand\"></div>\n </ng-content>\n\n <div\n class=\"d-contents\"\n [id]=\"id + '-navigation-wrapper'\"\n [cdkTrapFocus]=\"mobileNavigationExpanded()\"\n (keydown.escape)=\"navigationEscapePressed()\"\n >\n <ng-content select=\"si-header-navigation, element-header-navigation\">\n <div class=\"header-navigation\"></div>\n </ng-content>\n </div>\n\n <ng-content select=\"si-header-actions, element-header-actions\">\n <div class=\"header-actions\"></div>\n </ng-content>\n</header>\n\n@if (launchpadOpen() && launchpad()) {\n <div [id]=\"id + '-launchpad'\">\n <ng-template [ngTemplateOutlet]=\"launchpad()!\" [ngTemplateOutletInjector]=\"injector\" />\n </div>\n}\n\n@if (openDropdownCount() || launchpadOpen()) {\n <div\n class=\"modal-backdrop\"\n [ngClass]=\"launchpadOpen() ? 'd-block' : 'd-' + expandBreakpoint() + '-none'\"\n (click)=\"backdropClicked()\"\n ></div>\n}\n", styles: [".modal-backdrop{z-index:1032}\n"], dependencies: [{ kind: "ngmodule", type: SiTranslateModule }, { kind: "pipe", type: i1.SiTranslatePipe, name: "translate" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i2.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: SiIconNextComponent, selector: "si-icon-next", inputs: ["icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
157
|
+
}
|
|
158
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiApplicationHeaderComponent, decorators: [{
|
|
159
|
+
type: Component,
|
|
160
|
+
args: [{ selector: 'si-application-header', imports: [SiTranslateModule, NgClass, A11yModule, NgTemplateOutlet, SiIconNextComponent], changeDetection: ChangeDetectionStrategy.OnPush, providers: [{ provide: SI_HEADER_WITH_DROPDOWNS, useExisting: SiApplicationHeaderComponent }], template: "<header\n class=\"application-header\"\n [ngClass]=\"'expand-' + expandBreakpoint()\"\n [class.show-navigation]=\"mobileNavigationExpanded()\"\n>\n @if (launchpad()) {\n <button\n type=\"button\"\n class=\"header-toggle focus-inside\"\n [class.show]=\"launchpadOpen()\"\n [class.d-none]=\"hasNavigation()\"\n [ngClass]=\"'d-' + expandBreakpoint() + '-block'\"\n [attr.aria-expanded]=\"launchpadOpen()\"\n [attr.aria-label]=\"launchpadLabel() | translate\"\n [attr.aria-controls]=\"id + '-launchpad'\"\n (click)=\"toggleLaunchpad()\"\n >\n <si-icon-next [icon]=\"icons.elementThumbnails\" />\n </button>\n }\n @if (hasNavigation()) {\n <button\n #navigationToggle\n type=\"button\"\n class=\"header-toggle focus-inside\"\n [class.show]=\"mobileNavigationExpanded()\"\n [attr.aria-expanded]=\"mobileNavigationExpanded()\"\n [attr.aria-label]=\"toggleNavigation | translate\"\n [attr.aria-controls]=\"id + '-navigation-wrapper'\"\n (click)=\"toggleMobileNavigationExpanded()\"\n >\n <si-icon-next [icon]=\"icons.elementMenu\" />\n </button>\n }\n <ng-content select=\"si-header-brand, element-header-brand\">\n <div class=\"header-brand\"></div>\n </ng-content>\n\n <div\n class=\"d-contents\"\n [id]=\"id + '-navigation-wrapper'\"\n [cdkTrapFocus]=\"mobileNavigationExpanded()\"\n (keydown.escape)=\"navigationEscapePressed()\"\n >\n <ng-content select=\"si-header-navigation, element-header-navigation\">\n <div class=\"header-navigation\"></div>\n </ng-content>\n </div>\n\n <ng-content select=\"si-header-actions, element-header-actions\">\n <div class=\"header-actions\"></div>\n </ng-content>\n</header>\n\n@if (launchpadOpen() && launchpad()) {\n <div [id]=\"id + '-launchpad'\">\n <ng-template [ngTemplateOutlet]=\"launchpad()!\" [ngTemplateOutletInjector]=\"injector\" />\n </div>\n}\n\n@if (openDropdownCount() || launchpadOpen()) {\n <div\n class=\"modal-backdrop\"\n [ngClass]=\"launchpadOpen() ? 'd-block' : 'd-' + expandBreakpoint() + '-none'\"\n (click)=\"backdropClicked()\"\n ></div>\n}\n", styles: [".modal-backdrop{z-index:1032}\n"] }]
|
|
161
|
+
}] });
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Copyright Siemens 2016 - 2025.
|
|
165
|
+
* SPDX-License-Identifier: MIT
|
|
166
|
+
*/
|
|
167
|
+
/** Adds a navigation item to the header. Should be located inside `.header-navigation`. */
|
|
168
|
+
class SiHeaderNavigationItemComponent {
|
|
169
|
+
/** @internal */
|
|
170
|
+
dropdownTrigger = inject(SiHeaderDropdownTriggerDirective, {
|
|
171
|
+
self: true,
|
|
172
|
+
optional: true
|
|
173
|
+
});
|
|
174
|
+
icons = addIcons({ elementDown2 });
|
|
175
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiHeaderNavigationItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
176
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: SiHeaderNavigationItemComponent, isStandalone: true, selector: "button[si-header-navigation-item], a[si-header-navigation-item]", host: { properties: { "class.dropdown-toggle": "!!dropdownTrigger" }, classAttribute: "header-item focus-inside" }, providers: [
|
|
177
|
+
{ provide: SI_HEADER_DROPDOWN_OPTIONS, useValue: { disableRootFocusTrapForInlineMode: true } }
|
|
178
|
+
], ngImport: i0, template: `
|
|
179
|
+
<div class="item-title">
|
|
180
|
+
<ng-content />
|
|
181
|
+
</div>
|
|
182
|
+
@if (dropdownTrigger) {
|
|
183
|
+
<si-icon-next class="dropdown-caret" [icon]="icons.elementDown2" />
|
|
184
|
+
}
|
|
185
|
+
`, isInline: true, dependencies: [{ kind: "component", type: SiIconNextComponent, selector: "si-icon-next", inputs: ["icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
186
|
+
}
|
|
187
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiHeaderNavigationItemComponent, decorators: [{
|
|
188
|
+
type: Component,
|
|
189
|
+
args: [{
|
|
190
|
+
// eslint-disable-next-line @angular-eslint/component-selector
|
|
191
|
+
selector: 'button[si-header-navigation-item], a[si-header-navigation-item]',
|
|
192
|
+
template: `
|
|
193
|
+
<div class="item-title">
|
|
194
|
+
<ng-content />
|
|
195
|
+
</div>
|
|
196
|
+
@if (dropdownTrigger) {
|
|
197
|
+
<si-icon-next class="dropdown-caret" [icon]="icons.elementDown2" />
|
|
198
|
+
}
|
|
199
|
+
`,
|
|
200
|
+
host: {
|
|
201
|
+
class: 'header-item focus-inside',
|
|
202
|
+
'[class.dropdown-toggle]': '!!dropdownTrigger'
|
|
203
|
+
},
|
|
204
|
+
providers: [
|
|
205
|
+
{ provide: SI_HEADER_DROPDOWN_OPTIONS, useValue: { disableRootFocusTrapForInlineMode: true } }
|
|
206
|
+
],
|
|
207
|
+
imports: [SiIconNextComponent],
|
|
208
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
209
|
+
}]
|
|
210
|
+
}] });
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Copyright Siemens 2016 - 2025.
|
|
214
|
+
* SPDX-License-Identifier: MIT
|
|
215
|
+
*/
|
|
216
|
+
/** Container for actions that should be collapsed in mobile mode. */
|
|
217
|
+
class SiHeaderCollapsibleActionsComponent {
|
|
218
|
+
static idCounter = 0;
|
|
219
|
+
/**
|
|
220
|
+
* Accessible label of the toggle button if actions are collapsed.
|
|
221
|
+
*
|
|
222
|
+
* @defaultValue
|
|
223
|
+
* ```
|
|
224
|
+
* $localize`:@@SI_APPLICATION_HEADER.TOGGLE_ACTIONS:Toggle actions`
|
|
225
|
+
* ```
|
|
226
|
+
*/
|
|
227
|
+
mobileToggleLabel = input($localize `:@@SI_APPLICATION_HEADER.TOGGLE_ACTIONS:Toggle actions`);
|
|
228
|
+
/** @internal **/
|
|
229
|
+
mobileExpanded = signal(false);
|
|
230
|
+
/** @internal **/
|
|
231
|
+
badgeCount = signal(0);
|
|
232
|
+
id = `__si-header-collapsible-actions-${SiHeaderCollapsibleActionsComponent.idCounter++}`;
|
|
233
|
+
icons = addIcons({ elementOptionsVertical });
|
|
234
|
+
toggle = viewChild.required('toggle');
|
|
235
|
+
focusTrap = viewChild.required(CdkTrapFocus);
|
|
236
|
+
header = inject(SiApplicationHeaderComponent);
|
|
237
|
+
closeMobileSub = this.header.closeMobileMenus.subscribe(() => this.closeMobile());
|
|
238
|
+
inlineChangeSubscription;
|
|
239
|
+
ngOnDestroy() {
|
|
240
|
+
this.closeMobileSub.unsubscribe();
|
|
241
|
+
this.inlineChangeSubscription?.unsubscribe();
|
|
242
|
+
}
|
|
243
|
+
toggleMobileExpanded() {
|
|
244
|
+
if (this.mobileExpanded()) {
|
|
245
|
+
this.closeMobile();
|
|
246
|
+
}
|
|
247
|
+
else {
|
|
248
|
+
this.openMobile();
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
escapePressed() {
|
|
252
|
+
this.closeMobile();
|
|
253
|
+
this.toggle().nativeElement.focus();
|
|
254
|
+
}
|
|
255
|
+
openMobile() {
|
|
256
|
+
if (!this.mobileExpanded()) {
|
|
257
|
+
this.header.closeMobileMenus.next();
|
|
258
|
+
this.header.dropdownOpened();
|
|
259
|
+
this.mobileExpanded.set(true);
|
|
260
|
+
this.inlineChangeSubscription = this.header.inlineDropdown
|
|
261
|
+
.pipe(skip(1), takeUntil(this.header.closeMobileMenus))
|
|
262
|
+
.subscribe(() => this.header.closeMobileMenus.next());
|
|
263
|
+
this.focusTrap().focusTrap.focusFirstTabbableElementWhenReady();
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
closeMobile() {
|
|
267
|
+
if (this.mobileExpanded()) {
|
|
268
|
+
this.header.dropdownClosed();
|
|
269
|
+
this.mobileExpanded.set(false);
|
|
270
|
+
this.toggle().nativeElement.focus();
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiHeaderCollapsibleActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
274
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.0.6", type: SiHeaderCollapsibleActionsComponent, isStandalone: true, selector: "si-header-collapsible-actions", inputs: { mobileToggleLabel: { classPropertyName: "mobileToggleLabel", publicName: "mobileToggleLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "d-contents" }, providers: [
|
|
275
|
+
{ provide: SI_HEADER_DROPDOWN_OPTIONS, useValue: { disableRootFocusTrapForInlineMode: true } }
|
|
276
|
+
], viewQueries: [{ propertyName: "toggle", first: true, predicate: ["toggle"], descendants: true, isSignal: true }, { propertyName: "focusTrap", first: true, predicate: CdkTrapFocus, descendants: true, isSignal: true }], ngImport: i0, template: "<button\n #toggle\n type=\"button\"\n class=\"header-toggle focus-inside\"\n [class.show]=\"mobileExpanded()\"\n [attr.aria-expanded]=\"mobileExpanded()\"\n [attr.aria-label]=\"mobileToggleLabel() | translate\"\n [attr.aria-controls]=\"id + '-content'\"\n (click)=\"toggleMobileExpanded()\"\n>\n <si-icon-next [icon]=\"icons.elementOptionsVertical\" [class.badge-dot]=\"badgeCount()\" />\n</button>\n<div\n class=\"header-collapsible-actions\"\n [id]=\"id + '-content'\"\n [class.show]=\"mobileExpanded()\"\n [cdkTrapFocus]=\"mobileExpanded()\"\n (keydown.escape)=\"escapePressed()\"\n>\n <ng-content />\n</div>\n", styles: [".badge-dot:after{inset-inline-end:4px}\n"], dependencies: [{ kind: "ngmodule", type: SiTranslateModule }, { kind: "pipe", type: i1.SiTranslatePipe, name: "translate" }, { kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i2.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: SiIconNextComponent, selector: "si-icon-next", inputs: ["icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
277
|
+
}
|
|
278
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiHeaderCollapsibleActionsComponent, decorators: [{
|
|
279
|
+
type: Component,
|
|
280
|
+
args: [{ selector: 'si-header-collapsible-actions', imports: [SiTranslateModule, A11yModule, SiIconNextComponent], host: { class: 'd-contents' }, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
281
|
+
{ provide: SI_HEADER_DROPDOWN_OPTIONS, useValue: { disableRootFocusTrapForInlineMode: true } }
|
|
282
|
+
], template: "<button\n #toggle\n type=\"button\"\n class=\"header-toggle focus-inside\"\n [class.show]=\"mobileExpanded()\"\n [attr.aria-expanded]=\"mobileExpanded()\"\n [attr.aria-label]=\"mobileToggleLabel() | translate\"\n [attr.aria-controls]=\"id + '-content'\"\n (click)=\"toggleMobileExpanded()\"\n>\n <si-icon-next [icon]=\"icons.elementOptionsVertical\" [class.badge-dot]=\"badgeCount()\" />\n</button>\n<div\n class=\"header-collapsible-actions\"\n [id]=\"id + '-content'\"\n [class.show]=\"mobileExpanded()\"\n [cdkTrapFocus]=\"mobileExpanded()\"\n (keydown.escape)=\"escapePressed()\"\n>\n <ng-content />\n</div>\n", styles: [".badge-dot:after{inset-inline-end:4px}\n"] }]
|
|
283
|
+
}] });
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Copyright Siemens 2016 - 2025.
|
|
287
|
+
* SPDX-License-Identifier: MIT
|
|
288
|
+
*/
|
|
289
|
+
class SiHeaderActionItemBase {
|
|
290
|
+
/** @internal */
|
|
291
|
+
dropdownTrigger = inject(SiHeaderDropdownTriggerDirective, {
|
|
292
|
+
self: true,
|
|
293
|
+
optional: true
|
|
294
|
+
});
|
|
295
|
+
collapsibleActions = inject(SiHeaderCollapsibleActionsComponent, { optional: true });
|
|
296
|
+
icons = addIcons({ elementDown2 });
|
|
297
|
+
header = inject(SiApplicationHeaderComponent);
|
|
298
|
+
ngOnInit() {
|
|
299
|
+
if (this.dropdownTrigger) {
|
|
300
|
+
this.header.closeMobileMenus.subscribe(() => this.dropdownTrigger.close());
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
click() {
|
|
304
|
+
if (!this.dropdownTrigger?.isOpen && !this.collapsibleActions?.mobileExpanded()) {
|
|
305
|
+
// we must close other immediately as we would close the dropdown else wise immediately after opening.
|
|
306
|
+
this.header.closeMobileMenus.next();
|
|
307
|
+
}
|
|
308
|
+
else if (!this.dropdownTrigger || !this.collapsibleActions?.mobileExpanded()) {
|
|
309
|
+
// we must use queueMicrotask, otherwise the dropdown gets re-opened immediately.
|
|
310
|
+
queueMicrotask(() => this.header.closeMobileMenus.next());
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiHeaderActionItemBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
314
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.6", type: SiHeaderActionItemBase, isStandalone: true, host: { listeners: { "click": "click()" } }, ngImport: i0 });
|
|
315
|
+
}
|
|
316
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiHeaderActionItemBase, decorators: [{
|
|
317
|
+
type: Directive,
|
|
318
|
+
args: [{}]
|
|
319
|
+
}], propDecorators: { click: [{
|
|
320
|
+
type: HostListener,
|
|
321
|
+
args: ['click']
|
|
322
|
+
}] } });
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Copyright Siemens 2016 - 2025.
|
|
326
|
+
* SPDX-License-Identifier: MIT
|
|
327
|
+
*/
|
|
328
|
+
/**
|
|
329
|
+
* Base for icon based actions.
|
|
330
|
+
* @internal
|
|
331
|
+
*/
|
|
332
|
+
class SiHeaderActionIconItemBase extends SiHeaderActionItemBase {
|
|
333
|
+
/**
|
|
334
|
+
* Adds a badge to the header item.
|
|
335
|
+
* If type
|
|
336
|
+
* - =number, the number will be shown and automatically trimmed if \>99
|
|
337
|
+
* - =true, an empty red dot will be shown
|
|
338
|
+
*/
|
|
339
|
+
badge = input();
|
|
340
|
+
badgeDot = computed(() => typeof this.badge() === 'boolean' ? this.badge() : false);
|
|
341
|
+
badgeValue = computed(() => {
|
|
342
|
+
const badge = this.badge();
|
|
343
|
+
return typeof badge === 'number'
|
|
344
|
+
? `${badge > 99 ? '+' : ''}${Math.min(99, Math.round(badge))}`
|
|
345
|
+
: undefined;
|
|
346
|
+
});
|
|
347
|
+
ngOnChanges(changes) {
|
|
348
|
+
if ('badge' in changes) {
|
|
349
|
+
if (changes.badge.currentValue && !changes.badge.previousValue) {
|
|
350
|
+
this.collapsibleActions?.badgeCount.update(count => count + 1);
|
|
351
|
+
}
|
|
352
|
+
else if (!changes.badge.currentValue && changes.badge.previousValue) {
|
|
353
|
+
this.collapsibleActions?.badgeCount.update(count => count - 1);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
get visuallyHideTitle() {
|
|
358
|
+
return !this.collapsibleActions?.mobileExpanded();
|
|
359
|
+
}
|
|
360
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiHeaderActionIconItemBase, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
361
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.6", type: SiHeaderActionIconItemBase, isStandalone: true, inputs: { badge: { classPropertyName: "badge", publicName: "badge", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, usesOnChanges: true, ngImport: i0 });
|
|
362
|
+
}
|
|
363
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiHeaderActionIconItemBase, decorators: [{
|
|
364
|
+
type: Directive,
|
|
365
|
+
args: [{}]
|
|
366
|
+
}] });
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* Copyright Siemens 2016 - 2025.
|
|
370
|
+
* SPDX-License-Identifier: MIT
|
|
371
|
+
*/
|
|
372
|
+
/** Adds an action item to the header. Should be located inside `.header-actions`. */
|
|
373
|
+
class SiHeaderActionItemComponent extends SiHeaderActionIconItemBase {
|
|
374
|
+
/** The icon to be shown. */
|
|
375
|
+
icon = input.required();
|
|
376
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiHeaderActionItemComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
377
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: SiHeaderActionItemComponent, isStandalone: true, selector: "button[si-header-action-item], a[si-header-action-item]", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "class.dropdown-toggle": "!!dropdownTrigger" }, classAttribute: "header-item focus-inside" }, usesInheritance: true, ngImport: i0, template: "<si-icon-next class=\"icon\" [class.badge-dot]=\"badgeDot()\" [icon]=\"icon()\" />\n@if (badgeValue()) {\n <span class=\"badge-text\">{{ badgeValue() }}</span>\n}\n<ng-content select=\"si-avatar\" />\n<div class=\"item-title\" [class.visually-hidden]=\"visuallyHideTitle\">\n <ng-content />\n</div>\n@if (dropdownTrigger) {\n <si-icon-next class=\"dropdown-caret\" [icon]=\"icons.elementDown2\" />\n}\n", dependencies: [{ kind: "component", type: SiIconNextComponent, selector: "si-icon-next", inputs: ["icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
378
|
+
}
|
|
379
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiHeaderActionItemComponent, decorators: [{
|
|
380
|
+
type: Component,
|
|
381
|
+
args: [{ selector: 'button[si-header-action-item], a[si-header-action-item]', imports: [SiIconNextComponent], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
382
|
+
class: 'header-item focus-inside',
|
|
383
|
+
'[class.dropdown-toggle]': '!!dropdownTrigger'
|
|
384
|
+
}, template: "<si-icon-next class=\"icon\" [class.badge-dot]=\"badgeDot()\" [icon]=\"icon()\" />\n@if (badgeValue()) {\n <span class=\"badge-text\">{{ badgeValue() }}</span>\n}\n<ng-content select=\"si-avatar\" />\n<div class=\"item-title\" [class.visually-hidden]=\"visuallyHideTitle\">\n <ng-content />\n</div>\n@if (dropdownTrigger) {\n <si-icon-next class=\"dropdown-caret\" [icon]=\"icons.elementDown2\" />\n}\n" }]
|
|
385
|
+
}] });
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* Copyright Siemens 2016 - 2025.
|
|
389
|
+
* SPDX-License-Identifier: MIT
|
|
390
|
+
*/
|
|
391
|
+
/** Adds an account item to the header. Should be located inside `.header-actions`. */
|
|
392
|
+
class SiHeaderAccountItemComponent extends SiHeaderActionIconItemBase {
|
|
393
|
+
/** Name of the account. */
|
|
394
|
+
name = input.required();
|
|
395
|
+
/** Initials of the account. If not provided, they will be calculated. */
|
|
396
|
+
initials = input();
|
|
397
|
+
/** URL to an image which should be shown instead of the initials. */
|
|
398
|
+
imageUrl = input();
|
|
399
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiHeaderAccountItemComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
400
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: SiHeaderAccountItemComponent, isStandalone: true, selector: "button[si-header-account-item]", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, initials: { classPropertyName: "initials", publicName: "initials", isSignal: true, isRequired: false, transformFunction: null }, imageUrl: { classPropertyName: "imageUrl", publicName: "imageUrl", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.dropdown-toggle": "!!dropdownTrigger" }, classAttribute: "header-item focus-inside p-4" }, usesInheritance: true, ngImport: i0, template: "<si-avatar\n size=\"small\"\n color=\"0\"\n [altText]=\"name()\"\n [initials]=\"initials()\"\n [imageUrl]=\"imageUrl()\"\n/>\n<div class=\"item-title\" aria-hidden=\"true\" [class.d-none]=\"visuallyHideTitle\">\n {{ name() }}\n</div>\n@if (badgeValue()) {\n <div class=\"badge-text\">{{ badgeValue() }}</div>\n}\n@if (dropdownTrigger) {\n <si-icon-next class=\"dropdown-caret\" [icon]=\"icons.elementDown2\" />\n}\n", dependencies: [{ kind: "component", type: SiAvatarComponent, selector: "si-avatar", inputs: ["size", "imageUrl", "icon", "initials", "color", "altText", "status", "statusAriaLabel"] }, { kind: "component", type: SiIconNextComponent, selector: "si-icon-next", inputs: ["icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
401
|
+
}
|
|
402
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiHeaderAccountItemComponent, decorators: [{
|
|
403
|
+
type: Component,
|
|
404
|
+
args: [{ selector: 'button[si-header-account-item]', imports: [SiAvatarComponent, SiIconNextComponent], host: {
|
|
405
|
+
class: 'header-item focus-inside p-4',
|
|
406
|
+
'[class.dropdown-toggle]': '!!dropdownTrigger'
|
|
407
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<si-avatar\n size=\"small\"\n color=\"0\"\n [altText]=\"name()\"\n [initials]=\"initials()\"\n [imageUrl]=\"imageUrl()\"\n/>\n<div class=\"item-title\" aria-hidden=\"true\" [class.d-none]=\"visuallyHideTitle\">\n {{ name() }}\n</div>\n@if (badgeValue()) {\n <div class=\"badge-text\">{{ badgeValue() }}</div>\n}\n@if (dropdownTrigger) {\n <si-icon-next class=\"dropdown-caret\" [icon]=\"icons.elementDown2\" />\n}\n" }]
|
|
408
|
+
}] });
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* Copyright Siemens 2016 - 2025.
|
|
412
|
+
* SPDX-License-Identifier: MIT
|
|
413
|
+
*/
|
|
414
|
+
class SiHeaderSelectionItemComponent extends SiHeaderActionItemBase {
|
|
415
|
+
/**
|
|
416
|
+
* Sets the open state which will only affect the arrow. Only use this property when not using {@link SiHeaderDropdownTriggerDirective}.
|
|
417
|
+
*
|
|
418
|
+
* @defaultValue false
|
|
419
|
+
*/
|
|
420
|
+
open = input(false);
|
|
421
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiHeaderSelectionItemComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
422
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.6", type: SiHeaderSelectionItemComponent, isStandalone: true, selector: "button[si-header-selection-item]", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.show": "open()" }, classAttribute: "header-item header-selection-item focus-inside dropdown-toggle" }, usesInheritance: true, ngImport: i0, template: "<div class=\"item-title\">\n <ng-content />\n</div>\n<si-icon-next class=\"d-block dropdown-caret\" [icon]=\"icons.elementDown2\" />\n", dependencies: [{ kind: "component", type: SiIconNextComponent, selector: "si-icon-next", inputs: ["icon"] }] });
|
|
423
|
+
}
|
|
424
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiHeaderSelectionItemComponent, decorators: [{
|
|
425
|
+
type: Component,
|
|
426
|
+
args: [{ selector: 'button[si-header-selection-item]', imports: [SiIconNextComponent], host: {
|
|
427
|
+
class: 'header-item header-selection-item focus-inside dropdown-toggle',
|
|
428
|
+
'[class.show]': 'open()'
|
|
429
|
+
}, template: "<div class=\"item-title\">\n <ng-content />\n</div>\n<si-icon-next class=\"d-block dropdown-caret\" [icon]=\"icons.elementDown2\" />\n" }]
|
|
430
|
+
}] });
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* Copyright Siemens 2016 - 2025.
|
|
434
|
+
* SPDX-License-Identifier: MIT
|
|
435
|
+
*/
|
|
436
|
+
/**
|
|
437
|
+
* The siemens logo.
|
|
438
|
+
* Should be located inside `.header-brand`.
|
|
439
|
+
*
|
|
440
|
+
* @deprecated Use the {@link SiHeaderLogoDirective} instead.
|
|
441
|
+
* The new component will use the logo provided by the global theme instead
|
|
442
|
+
* of containing a hard coded siemens logo.
|
|
443
|
+
* ```html
|
|
444
|
+
* // previous
|
|
445
|
+
* <a si-header-siemens-logo routerLink="/" aria-label="Siemens" class="d-none d-md-flex"></a>
|
|
446
|
+
* // new
|
|
447
|
+
* <a siHeaderLogo routerLink="/" class="d-none d-md-flex"></a>
|
|
448
|
+
* ```
|
|
449
|
+
*
|
|
450
|
+
*/
|
|
451
|
+
class SiHeaderSiemensLogoComponent {
|
|
452
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiHeaderSiemensLogoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
453
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.6", type: SiHeaderSiemensLogoComponent, isStandalone: true, selector: "si-header-siemens-logo, [si-header-siemens-logo]", host: { classAttribute: "header-logo px-6 focus-inside" }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
454
|
+
}
|
|
455
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiHeaderSiemensLogoComponent, decorators: [{
|
|
456
|
+
type: Component,
|
|
457
|
+
args: [{
|
|
458
|
+
selector: 'si-header-siemens-logo, [si-header-siemens-logo]',
|
|
459
|
+
template: '',
|
|
460
|
+
host: {
|
|
461
|
+
class: 'header-logo px-6 focus-inside'
|
|
462
|
+
},
|
|
463
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
464
|
+
}]
|
|
465
|
+
}] });
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* Copyright Siemens 2016 - 2025.
|
|
469
|
+
* SPDX-License-Identifier: MIT
|
|
470
|
+
*/
|
|
471
|
+
/** The siemens logo. Should be located inside `.header-brand`. */
|
|
472
|
+
class SiHeaderLogoDirective {
|
|
473
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiHeaderLogoDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
474
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.6", type: SiHeaderLogoDirective, isStandalone: true, selector: "si-header-logo, [siHeaderLogo]", host: { classAttribute: "header-logo px-6 focus-inside" }, ngImport: i0 });
|
|
475
|
+
}
|
|
476
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiHeaderLogoDirective, decorators: [{
|
|
477
|
+
type: Directive,
|
|
478
|
+
args: [{
|
|
479
|
+
selector: 'si-header-logo, [siHeaderLogo]',
|
|
480
|
+
host: {
|
|
481
|
+
class: 'header-logo px-6 focus-inside'
|
|
482
|
+
}
|
|
483
|
+
}]
|
|
484
|
+
}] });
|
|
485
|
+
|
|
486
|
+
/**
|
|
487
|
+
* Copyright Siemens 2016 - 2025.
|
|
488
|
+
* SPDX-License-Identifier: MIT
|
|
489
|
+
*/
|
|
490
|
+
class SiHeaderActionsDirective {
|
|
491
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiHeaderActionsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
492
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.6", type: SiHeaderActionsDirective, isStandalone: true, selector: "si-header-actions", host: { classAttribute: "header-actions" }, ngImport: i0 });
|
|
493
|
+
}
|
|
494
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiHeaderActionsDirective, decorators: [{
|
|
495
|
+
type: Directive,
|
|
496
|
+
args: [{
|
|
497
|
+
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
498
|
+
selector: 'si-header-actions',
|
|
499
|
+
host: { class: 'header-actions' }
|
|
500
|
+
}]
|
|
501
|
+
}] });
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* Copyright Siemens 2016 - 2025.
|
|
505
|
+
* SPDX-License-Identifier: MIT
|
|
506
|
+
*/
|
|
507
|
+
class SiHeaderBrandDirective {
|
|
508
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiHeaderBrandDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
509
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.6", type: SiHeaderBrandDirective, isStandalone: true, selector: "si-header-brand", host: { classAttribute: "header-brand" }, ngImport: i0 });
|
|
510
|
+
}
|
|
511
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiHeaderBrandDirective, decorators: [{
|
|
512
|
+
type: Directive,
|
|
513
|
+
args: [{
|
|
514
|
+
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
515
|
+
selector: 'si-header-brand',
|
|
516
|
+
host: { class: 'header-brand' }
|
|
517
|
+
}]
|
|
518
|
+
}] });
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* Copyright Siemens 2016 - 2025.
|
|
522
|
+
* SPDX-License-Identifier: MIT
|
|
523
|
+
*/
|
|
524
|
+
class SiHeaderNavigationComponent {
|
|
525
|
+
header = inject(SiApplicationHeaderComponent);
|
|
526
|
+
icons = addIcons({ elementThumbnails });
|
|
527
|
+
constructor() {
|
|
528
|
+
this.header.hasNavigation.set(true);
|
|
529
|
+
}
|
|
530
|
+
ngOnDestroy() {
|
|
531
|
+
this.header.hasNavigation.set(false);
|
|
532
|
+
}
|
|
533
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiHeaderNavigationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
534
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: SiHeaderNavigationComponent, isStandalone: true, selector: "si-header-navigation", host: { attributes: { "role": "navigation" }, classAttribute: "header-navigation" }, ngImport: i0, template: `
|
|
535
|
+
@if (header.launchpad()) {
|
|
536
|
+
<button
|
|
537
|
+
class="header-item focus-inside"
|
|
538
|
+
type="button"
|
|
539
|
+
[ngClass]="'d-' + header.expandBreakpoint() + '-none'"
|
|
540
|
+
(click)="header.openLaunchpad()"
|
|
541
|
+
>
|
|
542
|
+
<si-icon-next class="icon pe-5" [icon]="icons.elementThumbnails" />
|
|
543
|
+
{{ header.launchpadLabel() | translate }}
|
|
544
|
+
</button>
|
|
545
|
+
}
|
|
546
|
+
<ng-content />
|
|
547
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: SiTranslateModule }, { kind: "pipe", type: i1.SiTranslatePipe, name: "translate" }, { kind: "component", type: SiIconNextComponent, selector: "si-icon-next", inputs: ["icon"] }] });
|
|
548
|
+
}
|
|
549
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiHeaderNavigationComponent, decorators: [{
|
|
550
|
+
type: Component,
|
|
551
|
+
args: [{
|
|
552
|
+
selector: 'si-header-navigation',
|
|
553
|
+
template: `
|
|
554
|
+
@if (header.launchpad()) {
|
|
555
|
+
<button
|
|
556
|
+
class="header-item focus-inside"
|
|
557
|
+
type="button"
|
|
558
|
+
[ngClass]="'d-' + header.expandBreakpoint() + '-none'"
|
|
559
|
+
(click)="header.openLaunchpad()"
|
|
560
|
+
>
|
|
561
|
+
<si-icon-next class="icon pe-5" [icon]="icons.elementThumbnails" />
|
|
562
|
+
{{ header.launchpadLabel() | translate }}
|
|
563
|
+
</button>
|
|
564
|
+
}
|
|
565
|
+
<ng-content />
|
|
566
|
+
`,
|
|
567
|
+
imports: [NgClass, SiTranslateModule, SiIconNextComponent],
|
|
568
|
+
host: { class: 'header-navigation', role: 'navigation' }
|
|
569
|
+
}]
|
|
570
|
+
}], ctorParameters: () => [] });
|
|
571
|
+
|
|
572
|
+
/**
|
|
573
|
+
* Copyright Siemens 2016 - 2025.
|
|
574
|
+
* SPDX-License-Identifier: MIT
|
|
575
|
+
*/
|
|
576
|
+
class SiLaunchpadAppComponent {
|
|
577
|
+
/** @defaultValue false */
|
|
578
|
+
external = input(false, { transform: booleanAttribute });
|
|
579
|
+
/** @defaultValue false */
|
|
580
|
+
active = input(false, { transform: booleanAttribute });
|
|
581
|
+
/** @defaultValue false */
|
|
582
|
+
enableFavoriteToggle = input(false, { transform: booleanAttribute });
|
|
583
|
+
/** @defaultValue false */
|
|
584
|
+
favorite = model(false);
|
|
585
|
+
/** @defaultValue false */
|
|
586
|
+
action = input(false, { transform: booleanAttribute });
|
|
587
|
+
iconUrl = input();
|
|
588
|
+
iconClass = input();
|
|
589
|
+
icons = addIcons({ elementExport, elementFavorites, elementFavoritesFilled });
|
|
590
|
+
header = inject(SiApplicationHeaderComponent);
|
|
591
|
+
favoriteClicked(event) {
|
|
592
|
+
event.stopPropagation();
|
|
593
|
+
event.preventDefault();
|
|
594
|
+
this.favorite.update(old => !old);
|
|
595
|
+
}
|
|
596
|
+
click() {
|
|
597
|
+
this.header.closeLaunchpad();
|
|
598
|
+
}
|
|
599
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiLaunchpadAppComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
600
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: SiLaunchpadAppComponent, isStandalone: true, selector: "a[si-launchpad-app]", inputs: { external: { classPropertyName: "external", publicName: "external", isSignal: true, isRequired: false, transformFunction: null }, active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: false, transformFunction: null }, enableFavoriteToggle: { classPropertyName: "enableFavoriteToggle", publicName: "enableFavoriteToggle", isSignal: true, isRequired: false, transformFunction: null }, favorite: { classPropertyName: "favorite", publicName: "favorite", isSignal: true, isRequired: false, transformFunction: null }, action: { classPropertyName: "action", publicName: "action", isSignal: true, isRequired: false, transformFunction: null }, iconUrl: { classPropertyName: "iconUrl", publicName: "iconUrl", isSignal: true, isRequired: false, transformFunction: null }, iconClass: { classPropertyName: "iconClass", publicName: "iconClass", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { favorite: "favoriteChange" }, host: { listeners: { "keydown.space": "favoriteClicked($event)", "click": "click()" }, properties: { "class.active": "active()", "class.action": "action()" }, classAttribute: "focus-inside" }, ngImport: i0, template: "@if (iconUrl()) {\n <img alt=\"\" width=\"64\" height=\"64\" class=\"app-icon\" [src]=\"iconUrl()\" />\n} @else if (iconClass()) {\n <si-icon-next class=\"app-icon\" [icon]=\"iconClass()!\" />\n}\n<div class=\"si-title-2 text-truncate mw-100\">\n <ng-content select=\"[app-name]\" />\n @if (external()) {\n <si-icon-next class=\"icon mt-n2\" [icon]=\"icons.elementExport\" />\n }\n</div>\n<div class=\"si-body-2 text-truncate mw-100\">\n <ng-content select=\"[app-systemName]\" />\n</div>\n@if (enableFavoriteToggle()) {\n <si-icon-next\n class=\"favorite-icon\"\n [class.is-favorite]=\"favorite()\"\n [icon]=\"favorite() ? icons.elementFavoritesFilled : icons.elementFavorites\"\n (click)=\"favoriteClicked($event)\"\n />\n}\n", styles: [":host{display:flex;align-items:center;flex-flow:column nowrap;position:relative;padding-block:20px;inline-size:152px;max-inline-size:152px;padding-inline:4px;color:var(--element-text-primary);border-radius:var(--element-radius-2)}:host.active{border:1px solid var(--element-ui-0);background-color:var(--element-base-1-hover)}:host.action{color:var(--element-action-primary)}:host:hover{color:var(--element-text-primary);text-decoration:none;background-color:var(--element-base-1-hover)}.app-icon{display:flex;align-items:center;justify-content:center;inline-size:48px;block-size:48px;margin-block-end:8px;border-radius:var(--element-radius-2)}.favorite-icon{font-size:20px;position:absolute;inset-inline-end:22px;inset-block-start:10px;padding:2px;color:var(--element-text-primary)}.is-favorite{color:var(--element-status-caution)}\n"], dependencies: [{ kind: "component", type: SiIconNextComponent, selector: "si-icon-next", inputs: ["icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
601
|
+
}
|
|
602
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiLaunchpadAppComponent, decorators: [{
|
|
603
|
+
type: Component,
|
|
604
|
+
args: [{ selector: 'a[si-launchpad-app]', imports: [SiIconNextComponent], host: {
|
|
605
|
+
class: 'focus-inside',
|
|
606
|
+
'[class.active]': 'active()',
|
|
607
|
+
'[class.action]': 'action()'
|
|
608
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (iconUrl()) {\n <img alt=\"\" width=\"64\" height=\"64\" class=\"app-icon\" [src]=\"iconUrl()\" />\n} @else if (iconClass()) {\n <si-icon-next class=\"app-icon\" [icon]=\"iconClass()!\" />\n}\n<div class=\"si-title-2 text-truncate mw-100\">\n <ng-content select=\"[app-name]\" />\n @if (external()) {\n <si-icon-next class=\"icon mt-n2\" [icon]=\"icons.elementExport\" />\n }\n</div>\n<div class=\"si-body-2 text-truncate mw-100\">\n <ng-content select=\"[app-systemName]\" />\n</div>\n@if (enableFavoriteToggle()) {\n <si-icon-next\n class=\"favorite-icon\"\n [class.is-favorite]=\"favorite()\"\n [icon]=\"favorite() ? icons.elementFavoritesFilled : icons.elementFavorites\"\n (click)=\"favoriteClicked($event)\"\n />\n}\n", styles: [":host{display:flex;align-items:center;flex-flow:column nowrap;position:relative;padding-block:20px;inline-size:152px;max-inline-size:152px;padding-inline:4px;color:var(--element-text-primary);border-radius:var(--element-radius-2)}:host.active{border:1px solid var(--element-ui-0);background-color:var(--element-base-1-hover)}:host.action{color:var(--element-action-primary)}:host:hover{color:var(--element-text-primary);text-decoration:none;background-color:var(--element-base-1-hover)}.app-icon{display:flex;align-items:center;justify-content:center;inline-size:48px;block-size:48px;margin-block-end:8px;border-radius:var(--element-radius-2)}.favorite-icon{font-size:20px;position:absolute;inset-inline-end:22px;inset-block-start:10px;padding:2px;color:var(--element-text-primary)}.is-favorite{color:var(--element-status-caution)}\n"] }]
|
|
609
|
+
}], propDecorators: { favoriteClicked: [{
|
|
610
|
+
type: HostListener,
|
|
611
|
+
args: ['keydown.space', ['$event']]
|
|
612
|
+
}], click: [{
|
|
613
|
+
type: HostListener,
|
|
614
|
+
args: ['click']
|
|
615
|
+
}] } });
|
|
616
|
+
|
|
617
|
+
/**
|
|
618
|
+
* Copyright Siemens 2016 - 2025.
|
|
619
|
+
* SPDX-License-Identifier: MIT
|
|
620
|
+
*/
|
|
621
|
+
class SiLaunchpadFactoryComponent {
|
|
622
|
+
/**
|
|
623
|
+
* Text to close the launchpad. Needed for a11y.
|
|
624
|
+
*
|
|
625
|
+
* @defaultValue
|
|
626
|
+
* ```
|
|
627
|
+
* $localize`:@@SI_LAUNCHPAD.CLOSE:Close launchpad`
|
|
628
|
+
* ```
|
|
629
|
+
*/
|
|
630
|
+
closeText = input($localize `:@@SI_LAUNCHPAD.CLOSE:Close launchpad`);
|
|
631
|
+
/**
|
|
632
|
+
* Title of the launchpad.
|
|
633
|
+
*
|
|
634
|
+
* @defaultValue
|
|
635
|
+
* ```
|
|
636
|
+
* $localize`:@@SI_LAUNCHPAD.TITLE:Launchpad`
|
|
637
|
+
* ```
|
|
638
|
+
*/
|
|
639
|
+
titleText = input($localize `:@@SI_LAUNCHPAD.TITLE:Launchpad`);
|
|
640
|
+
/**
|
|
641
|
+
* Subtitle of the launchpad.
|
|
642
|
+
*
|
|
643
|
+
* @defaultValue
|
|
644
|
+
* ```
|
|
645
|
+
* $localize`:@@SI_LAUNCHPAD.SUBTITLE:Access all your apps`
|
|
646
|
+
* ```
|
|
647
|
+
*/
|
|
648
|
+
subtitleText = input($localize `:@@SI_LAUNCHPAD.SUBTITLE:Access all your apps`);
|
|
649
|
+
/** All app items shown in the launchpad. */
|
|
650
|
+
apps = input.required();
|
|
651
|
+
/**
|
|
652
|
+
* Allow the user to select favorite apps which will then be displayed at the top.
|
|
653
|
+
*
|
|
654
|
+
* @defaultValue false
|
|
655
|
+
*/
|
|
656
|
+
enableFavorites = input(false, { transform: booleanAttribute });
|
|
657
|
+
/**
|
|
658
|
+
* Title of the favorite apps section.
|
|
659
|
+
*
|
|
660
|
+
* @defaultValue
|
|
661
|
+
* ```
|
|
662
|
+
* $localize`:@@SI_LAUNCHPAD.FAVORITE_APPS:Favorite apps`
|
|
663
|
+
* ```
|
|
664
|
+
*/
|
|
665
|
+
favoriteAppsText = input($localize `:@@SI_LAUNCHPAD.FAVORITE_APPS:Favorite apps`);
|
|
666
|
+
/**
|
|
667
|
+
* Title of the show more apps button.
|
|
668
|
+
*
|
|
669
|
+
* @defaultValue
|
|
670
|
+
* ```
|
|
671
|
+
* $localize`:@@SI_LAUNCHPAD.SHOW_MORE:Show more`
|
|
672
|
+
* ```
|
|
673
|
+
*/
|
|
674
|
+
showMoreAppsText = input($localize `:@@SI_LAUNCHPAD.SHOW_MORE:Show more`);
|
|
675
|
+
/**
|
|
676
|
+
* Title of the show less apps button.
|
|
677
|
+
*
|
|
678
|
+
* @defaultValue
|
|
679
|
+
* ```
|
|
680
|
+
* $localize`:@@SI_LAUNCHPAD.SHOW_LESS:Show less`
|
|
681
|
+
* ```
|
|
682
|
+
*/
|
|
683
|
+
showLessAppsText = input($localize `:@@SI_LAUNCHPAD.SHOW_LESS:Show less`);
|
|
684
|
+
favoriteChange = output();
|
|
685
|
+
showAllApps = false;
|
|
686
|
+
categories = computed(() => {
|
|
687
|
+
const apps = this.apps();
|
|
688
|
+
const favorites = this.favorites();
|
|
689
|
+
const categories = [];
|
|
690
|
+
if (this.enableFavorites() && this.hasFavorites()) {
|
|
691
|
+
categories.push({
|
|
692
|
+
name: this.favoriteAppsText(),
|
|
693
|
+
apps: favorites
|
|
694
|
+
});
|
|
695
|
+
}
|
|
696
|
+
if (this.isCategories(apps)) {
|
|
697
|
+
categories.push(...apps);
|
|
698
|
+
}
|
|
699
|
+
else {
|
|
700
|
+
categories.push({ name: '', apps: [...apps] });
|
|
701
|
+
}
|
|
702
|
+
return categories;
|
|
703
|
+
});
|
|
704
|
+
favorites = computed(() => this.apps()
|
|
705
|
+
.flatMap(app => ('apps' in app ? app.apps : app))
|
|
706
|
+
.filter(app => app.favorite));
|
|
707
|
+
hasFavorites = computed(() => this.favorites().length > 0);
|
|
708
|
+
icons = addIcons({ elementDown2, elementCancel });
|
|
709
|
+
header = inject(SiApplicationHeaderComponent);
|
|
710
|
+
closeLaunchpad() {
|
|
711
|
+
this.header.closeLaunchpad();
|
|
712
|
+
}
|
|
713
|
+
toggleFavorite(app, favorite) {
|
|
714
|
+
this.favoriteChange.emit({ app, favorite });
|
|
715
|
+
}
|
|
716
|
+
escape() {
|
|
717
|
+
this.closeLaunchpad();
|
|
718
|
+
}
|
|
719
|
+
isCategories(items) {
|
|
720
|
+
return items.some(item => 'apps' in item);
|
|
721
|
+
}
|
|
722
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiLaunchpadFactoryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
723
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: SiLaunchpadFactoryComponent, isStandalone: true, selector: "si-launchpad-factory", inputs: { closeText: { classPropertyName: "closeText", publicName: "closeText", isSignal: true, isRequired: false, transformFunction: null }, titleText: { classPropertyName: "titleText", publicName: "titleText", isSignal: true, isRequired: false, transformFunction: null }, subtitleText: { classPropertyName: "subtitleText", publicName: "subtitleText", isSignal: true, isRequired: false, transformFunction: null }, apps: { classPropertyName: "apps", publicName: "apps", isSignal: true, isRequired: true, transformFunction: null }, enableFavorites: { classPropertyName: "enableFavorites", publicName: "enableFavorites", isSignal: true, isRequired: false, transformFunction: null }, favoriteAppsText: { classPropertyName: "favoriteAppsText", publicName: "favoriteAppsText", isSignal: true, isRequired: false, transformFunction: null }, showMoreAppsText: { classPropertyName: "showMoreAppsText", publicName: "showMoreAppsText", isSignal: true, isRequired: false, transformFunction: null }, showLessAppsText: { classPropertyName: "showLessAppsText", publicName: "showLessAppsText", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { favoriteChange: "favoriteChange" }, ngImport: i0, template: "<div\n class=\"app-switcher pt-8 g-5 g-sm-9 container-fluid\"\n cdkTrapFocus\n cdkTrapFocusAutoCapture\n (keydown.escape)=\"escape()\"\n>\n @if (titleText()) {\n <p class=\"mb-4 si-title-1 lh-1\">{{ titleText() | translate }}</p>\n }\n @if (subtitleText()) {\n <p class=\"si-body-2 text-secondary mb-4\">{{ subtitleText() | translate }}</p>\n }\n <div class=\"apps-scroll pb-8 ms-n2 ps-2\">\n @for (category of categories(); track category; let first = $first) {\n @if (!enableFavorites() || !hasFavorites() || first || showAllApps) {\n <div class=\"mt-4\">\n @if (category.name) {\n <span class=\"si-title-1\">\n {{ category.name | translate }}\n </span>\n }\n <div class=\"mt-4 d-flex flex-wrap gap-4\">\n @for (app of category.apps; track app) {\n <!-- eslint-disable @angular-eslint/template/no-any -->\n <!-- temporary until old primary-navbar is removed -->\n <a\n si-launchpad-app\n [enableFavoriteToggle]=\"enableFavorites() && !$any(app)._noFavorite\"\n [favorite]=\"!!app.favorite\"\n [href]=\"app.href\"\n [target]=\"app.target ?? ''\"\n [active]=\"app.active\"\n [external]=\"app.external\"\n [iconUrl]=\"app.iconUrl\"\n [iconClass]=\"app.iconClass\"\n (favoriteChange)=\"toggleFavorite(app, $event)\"\n >\n <span app-name>{{ app.name | translate }}</span>\n <span app-systemName>{{ app.systemName | translate }}</span>\n </a>\n <!-- eslint-enable @angular-eslint/template/no-any -->\n }\n </div>\n </div>\n }\n\n @if (enableFavorites() && first && hasFavorites()) {\n <button\n type=\"button\"\n class=\"btn btn-link dropdown-toggle text-decoration-none my-4 si-title-2\"\n [class.show]=\"showAllApps\"\n (click)=\"showAllApps = !showAllApps\"\n >\n <b>{{ (showAllApps ? showLessAppsText() : showMoreAppsText()) | translate }}</b>\n <si-icon-next class=\"dropdown-caret icon\" [icon]=\"icons.elementDown2\" />\n </button>\n }\n }\n </div>\n <button\n type=\"button\"\n class=\"btn btn-circle btn-sm btn-ghost position-absolute top-0 end-0 mt-6 me-4\"\n [attr.aria-label]=\"closeText() | translate\"\n (click)=\"closeLaunchpad()\"\n >\n <si-icon-next [icon]=\"icons.elementCancel\" />\n </button>\n</div>\n", styles: [".app-switcher{position:fixed;inset-block-start:calc(48px + var(--element-titlebar-spacing, 0px) + var(--element-system-banner-spacing, 0px));inset-inline:0;min-block-size:200px;max-block-size:calc(100vh - 48px - var(--element-titlebar-spacing, 0px) - var(--element-system-banner-spacing, 0px));display:flex;flex-direction:column;z-index:1033;background-color:var(--element-base-1);box-shadow:inset 0 0 4px var(--element-box-shadow-color-1),inset 0 4px 4px var(--element-box-shadow-color-2)}.apps-scroll{overflow-y:auto}\n"], dependencies: [{ kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i2.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: SiLinkModule }, { kind: "ngmodule", type: SiTranslateModule }, { kind: "pipe", type: i1.SiTranslatePipe, name: "translate" }, { kind: "component", type: SiLaunchpadAppComponent, selector: "a[si-launchpad-app]", inputs: ["external", "active", "enableFavoriteToggle", "favorite", "action", "iconUrl", "iconClass"], outputs: ["favoriteChange"] }, { kind: "component", type: SiIconNextComponent, selector: "si-icon-next", inputs: ["icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
724
|
+
}
|
|
725
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiLaunchpadFactoryComponent, decorators: [{
|
|
726
|
+
type: Component,
|
|
727
|
+
args: [{ selector: 'si-launchpad-factory', imports: [
|
|
728
|
+
A11yModule,
|
|
729
|
+
CommonModule,
|
|
730
|
+
SiLinkModule,
|
|
731
|
+
SiTranslateModule,
|
|
732
|
+
SiLaunchpadAppComponent,
|
|
733
|
+
SiIconNextComponent
|
|
734
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"app-switcher pt-8 g-5 g-sm-9 container-fluid\"\n cdkTrapFocus\n cdkTrapFocusAutoCapture\n (keydown.escape)=\"escape()\"\n>\n @if (titleText()) {\n <p class=\"mb-4 si-title-1 lh-1\">{{ titleText() | translate }}</p>\n }\n @if (subtitleText()) {\n <p class=\"si-body-2 text-secondary mb-4\">{{ subtitleText() | translate }}</p>\n }\n <div class=\"apps-scroll pb-8 ms-n2 ps-2\">\n @for (category of categories(); track category; let first = $first) {\n @if (!enableFavorites() || !hasFavorites() || first || showAllApps) {\n <div class=\"mt-4\">\n @if (category.name) {\n <span class=\"si-title-1\">\n {{ category.name | translate }}\n </span>\n }\n <div class=\"mt-4 d-flex flex-wrap gap-4\">\n @for (app of category.apps; track app) {\n <!-- eslint-disable @angular-eslint/template/no-any -->\n <!-- temporary until old primary-navbar is removed -->\n <a\n si-launchpad-app\n [enableFavoriteToggle]=\"enableFavorites() && !$any(app)._noFavorite\"\n [favorite]=\"!!app.favorite\"\n [href]=\"app.href\"\n [target]=\"app.target ?? ''\"\n [active]=\"app.active\"\n [external]=\"app.external\"\n [iconUrl]=\"app.iconUrl\"\n [iconClass]=\"app.iconClass\"\n (favoriteChange)=\"toggleFavorite(app, $event)\"\n >\n <span app-name>{{ app.name | translate }}</span>\n <span app-systemName>{{ app.systemName | translate }}</span>\n </a>\n <!-- eslint-enable @angular-eslint/template/no-any -->\n }\n </div>\n </div>\n }\n\n @if (enableFavorites() && first && hasFavorites()) {\n <button\n type=\"button\"\n class=\"btn btn-link dropdown-toggle text-decoration-none my-4 si-title-2\"\n [class.show]=\"showAllApps\"\n (click)=\"showAllApps = !showAllApps\"\n >\n <b>{{ (showAllApps ? showLessAppsText() : showMoreAppsText()) | translate }}</b>\n <si-icon-next class=\"dropdown-caret icon\" [icon]=\"icons.elementDown2\" />\n </button>\n }\n }\n </div>\n <button\n type=\"button\"\n class=\"btn btn-circle btn-sm btn-ghost position-absolute top-0 end-0 mt-6 me-4\"\n [attr.aria-label]=\"closeText() | translate\"\n (click)=\"closeLaunchpad()\"\n >\n <si-icon-next [icon]=\"icons.elementCancel\" />\n </button>\n</div>\n", styles: [".app-switcher{position:fixed;inset-block-start:calc(48px + var(--element-titlebar-spacing, 0px) + var(--element-system-banner-spacing, 0px));inset-inline:0;min-block-size:200px;max-block-size:calc(100vh - 48px - var(--element-titlebar-spacing, 0px) - var(--element-system-banner-spacing, 0px));display:flex;flex-direction:column;z-index:1033;background-color:var(--element-base-1);box-shadow:inset 0 0 4px var(--element-box-shadow-color-1),inset 0 4px 4px var(--element-box-shadow-color-2)}.apps-scroll{overflow-y:auto}\n"] }]
|
|
735
|
+
}] });
|
|
736
|
+
|
|
737
|
+
/**
|
|
738
|
+
* Copyright Siemens 2016 - 2025.
|
|
739
|
+
* SPDX-License-Identifier: MIT
|
|
740
|
+
*/
|
|
741
|
+
|
|
742
|
+
/**
|
|
743
|
+
* Generated bundle index. Do not edit.
|
|
744
|
+
*/
|
|
745
|
+
|
|
746
|
+
export { SiApplicationHeaderComponent, SiHeaderAccountItemComponent, SiHeaderActionItemComponent, SiHeaderActionsDirective, SiHeaderBrandDirective, SiHeaderCollapsibleActionsComponent, SiHeaderLogoDirective, SiHeaderNavigationComponent, SiHeaderNavigationItemComponent, SiHeaderSelectionItemComponent, SiHeaderSiemensLogoComponent, SiLaunchpadFactoryComponent };
|
|
747
|
+
//# sourceMappingURL=siemens-element-ng-application-header.mjs.map
|