@siemens/element-ng 47.5.0 → 47.6.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/breadcrumb-router/index.d.ts +8 -0
- package/breadcrumb-router/package.json +3 -0
- package/breadcrumb-router/si-breadcrumb-default-resolver.service.d.ts +23 -0
- package/breadcrumb-router/si-breadcrumb-router.component.d.ts +30 -0
- package/breadcrumb-router/si-breadcrumb-router.model.d.ts +53 -0
- package/breadcrumb-router/si-breadcrumb-router.module.d.ts +7 -0
- package/date-range-filter/si-date-range-filter.component.d.ts +5 -1
- package/fesm2022/siemens-element-ng-breadcrumb-router.mjs +263 -0
- package/fesm2022/siemens-element-ng-breadcrumb-router.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-breadcrumb.mjs +1 -1
- package/fesm2022/siemens-element-ng-breadcrumb.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-date-range-filter.mjs +26 -5
- package/fesm2022/siemens-element-ng-date-range-filter.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-formly.mjs +2 -2
- package/fesm2022/siemens-element-ng-formly.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-icon.mjs +8 -22
- package/fesm2022/siemens-element-ng-icon.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-main-detail-container.mjs +269 -0
- package/fesm2022/siemens-element-ng-main-detail-container.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-modal.mjs +1 -1
- package/fesm2022/siemens-element-ng-modal.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-navbar-vertical.mjs +802 -0
- package/fesm2022/siemens-element-ng-navbar-vertical.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-resize-observer.mjs +6 -3
- package/fesm2022/siemens-element-ng-resize-observer.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-side-panel.mjs +1 -1
- package/fesm2022/siemens-element-ng-side-panel.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-status-bar.mjs +1 -1
- package/fesm2022/siemens-element-ng-status-bar.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-tabs-next.mjs +29 -164
- package/fesm2022/siemens-element-ng-tabs-next.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-tabs.mjs +1 -1
- package/fesm2022/siemens-element-ng-tabs.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-threshold.mjs +319 -0
- package/fesm2022/siemens-element-ng-threshold.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-tour.mjs +384 -0
- package/fesm2022/siemens-element-ng-tour.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-translate.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-tree-view.mjs +1 -1
- package/fesm2022/siemens-element-ng-tree-view.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-wizard.mjs +1 -1
- package/fesm2022/siemens-element-ng-wizard.mjs.map +1 -1
- package/icon/si-status-icon.component.d.ts +1 -6
- package/main-detail-container/index.d.ts +6 -0
- package/main-detail-container/package.json +3 -0
- package/main-detail-container/si-main-detail-container.component.d.ts +151 -0
- package/main-detail-container/si-main-detail-container.module.d.ts +7 -0
- package/navbar-vertical/index.d.ts +7 -0
- package/navbar-vertical/package.json +3 -0
- package/navbar-vertical/si-navbar-vertical-divider.component.d.ts +5 -0
- package/navbar-vertical/si-navbar-vertical-group-trigger.directive.d.ts +38 -0
- package/navbar-vertical/si-navbar-vertical-group.component.d.ts +16 -0
- package/navbar-vertical/si-navbar-vertical-header.component.d.ts +6 -0
- package/navbar-vertical/si-navbar-vertical-item-legacy.component.d.ts +17 -0
- package/navbar-vertical/si-navbar-vertical-item.component.d.ts +21 -0
- package/navbar-vertical/si-navbar-vertical.component.d.ts +148 -0
- package/navbar-vertical/si-navbar-vertical.model.d.ts +77 -0
- package/navbar-vertical/si-navbar-vertical.module.d.ts +7 -0
- package/navbar-vertical/si-navbar-vertical.provider.d.ts +7 -0
- package/package.json +24 -4
- package/resize-observer/si-resize-observer.directive.d.ts +3 -1
- package/tabs-next/si-tab-next-base.directive.d.ts +2 -5
- package/tabs-next/si-tab-next-link.component.d.ts +0 -2
- package/tabs-next/si-tabset-next.component.d.ts +3 -18
- package/template-i18n.json +16 -0
- package/threshold/index.d.ts +6 -0
- package/threshold/package.json +3 -0
- package/threshold/si-readonly-threshold-option.component.d.ts +11 -0
- package/threshold/si-threshold.component.d.ts +147 -0
- package/threshold/si-threshold.module.d.ts +7 -0
- package/tour/index.d.ts +6 -0
- package/tour/package.json +3 -0
- package/tour/si-tour-highlight.component.d.ts +15 -0
- package/tour/si-tour-token.model.d.ts +27 -0
- package/tour/si-tour.component.d.ts +31 -0
- package/tour/si-tour.model.d.ts +51 -0
- package/tour/si-tour.service.d.ts +62 -0
- package/translate/si-translatable-keys.interface.d.ts +16 -0
- package/tree-view/si-tree-view.component.d.ts +1 -1
|
@@ -0,0 +1,802 @@
|
|
|
1
|
+
import { trigger, state, transition, style, animate, query, group, animateChild } from '@angular/animations';
|
|
2
|
+
import { BreakpointObserver } from '@angular/cdk/layout';
|
|
3
|
+
import { NgClass, NgTemplateOutlet } from '@angular/common';
|
|
4
|
+
import * as i0 from '@angular/core';
|
|
5
|
+
import { Component, InjectionToken, input, model, signal, inject, ViewContainerRef, Injector, computed, HostListener, Directive, ChangeDetectionStrategy, viewChildren, booleanAttribute, numberAttribute, output, viewChild, HostBinding, NgModule } from '@angular/core';
|
|
6
|
+
import { RouterLinkActive, ActivatedRoute, RouterLink } from '@angular/router';
|
|
7
|
+
import { SI_UI_STATE_SERVICE } from '@siemens/element-ng/common';
|
|
8
|
+
import { BOOTSTRAP_BREAKPOINTS } from '@siemens/element-ng/resize-observer';
|
|
9
|
+
import { SiSearchBarComponent } from '@siemens/element-ng/search-bar';
|
|
10
|
+
import { SiSkipLinkTargetDirective } from '@siemens/element-ng/skip-links';
|
|
11
|
+
import * as i1 from '@siemens/element-translate-ng/translate';
|
|
12
|
+
import { SiTranslateModule } from '@siemens/element-translate-ng/translate';
|
|
13
|
+
import { Subject } from 'rxjs';
|
|
14
|
+
import { takeUntil } from 'rxjs/operators';
|
|
15
|
+
import { Overlay } from '@angular/cdk/overlay';
|
|
16
|
+
import { TemplatePortal } from '@angular/cdk/portal';
|
|
17
|
+
import { CdkTrapFocus } from '@angular/cdk/a11y';
|
|
18
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
19
|
+
import { SiLinkDirective } from '@siemens/element-ng/link';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Copyright Siemens 2016 - 2025.
|
|
23
|
+
* SPDX-License-Identifier: MIT
|
|
24
|
+
*/
|
|
25
|
+
// We need a component to attach the stylesheet
|
|
26
|
+
class SiNavbarVerticalDividerComponent {
|
|
27
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiNavbarVerticalDividerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
28
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.6", type: SiNavbarVerticalDividerComponent, isStandalone: true, selector: "si-navbar-vertical-divider", ngImport: i0, template: '', isInline: true, styles: [":host{display:block;block-size:1px;background-color:var(--element-ui-4);margin-block:6px;margin-inline:12px}\n"] });
|
|
29
|
+
}
|
|
30
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiNavbarVerticalDividerComponent, decorators: [{
|
|
31
|
+
type: Component,
|
|
32
|
+
args: [{ selector: 'si-navbar-vertical-divider', template: '', styles: [":host{display:block;block-size:1px;background-color:var(--element-ui-4);margin-block:6px;margin-inline:12px}\n"] }]
|
|
33
|
+
}] });
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Copyright Siemens 2016 - 2025.
|
|
37
|
+
* SPDX-License-Identifier: MIT
|
|
38
|
+
*/
|
|
39
|
+
const SI_NAVBAR_VERTICAL = new InjectionToken('SI_NAVBAR_VERTICAL');
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Copyright Siemens 2016 - 2025.
|
|
43
|
+
* SPDX-License-Identifier: MIT
|
|
44
|
+
*/
|
|
45
|
+
/**
|
|
46
|
+
* Using this component, to anchor the flyout inside the navbar within the a11y tree.
|
|
47
|
+
* Otherwise, without aria-owns, screen reader will announce the leaving of the navbar when moving to the flyout.
|
|
48
|
+
* Aria-owns cannot be put directly on the trigger
|
|
49
|
+
* as chrome will include the flyout children in the a11y label of the trigger.
|
|
50
|
+
*/
|
|
51
|
+
class SiNavbarFlyoutAnchorComponent {
|
|
52
|
+
groupId = input();
|
|
53
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiNavbarFlyoutAnchorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
54
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.6", type: SiNavbarFlyoutAnchorComponent, isStandalone: true, selector: "si-navbar-flyout-anchor", inputs: { groupId: { classPropertyName: "groupId", publicName: "groupId", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.aria-owns": "groupId()" } }, ngImport: i0, template: '', isInline: true });
|
|
55
|
+
}
|
|
56
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiNavbarFlyoutAnchorComponent, decorators: [{
|
|
57
|
+
type: Component,
|
|
58
|
+
args: [{
|
|
59
|
+
selector: 'si-navbar-flyout-anchor',
|
|
60
|
+
template: '',
|
|
61
|
+
host: { '[attr.aria-owns]': 'groupId()' }
|
|
62
|
+
}]
|
|
63
|
+
}] });
|
|
64
|
+
class SiNavbarVerticalGroupTriggerDirective {
|
|
65
|
+
static idCounter = 0;
|
|
66
|
+
/** @internal */
|
|
67
|
+
groupId = `si-navbar-vertical-group-${SiNavbarVerticalGroupTriggerDirective.idCounter++}`;
|
|
68
|
+
id = `${this.groupId}-trigger`;
|
|
69
|
+
groupTemplate = input.required({
|
|
70
|
+
alias: 'siNavbarVerticalGroupTriggerFor'
|
|
71
|
+
});
|
|
72
|
+
groupData = input();
|
|
73
|
+
stateId = input();
|
|
74
|
+
expanded = model.required();
|
|
75
|
+
/** @internal */
|
|
76
|
+
flyout = signal(false);
|
|
77
|
+
/** @internal */
|
|
78
|
+
active = signal(false);
|
|
79
|
+
navbar = inject(SI_NAVBAR_VERTICAL);
|
|
80
|
+
flyoutOutsideClickSubscription;
|
|
81
|
+
viewContainer = inject(ViewContainerRef);
|
|
82
|
+
overlay = inject(Overlay);
|
|
83
|
+
injector = Injector.create({ parent: inject(Injector), providers: [] });
|
|
84
|
+
overlayRef = this.overlay.create({
|
|
85
|
+
positionStrategy: this.overlay
|
|
86
|
+
.position()
|
|
87
|
+
.flexibleConnectedTo(this.viewContainer.element)
|
|
88
|
+
.withPositions([
|
|
89
|
+
{ originX: 'end', originY: 'top', overlayX: 'start', overlayY: 'top' },
|
|
90
|
+
{ originX: 'end', originY: 'bottom', overlayX: 'start', overlayY: 'bottom' }
|
|
91
|
+
])
|
|
92
|
+
});
|
|
93
|
+
groupView;
|
|
94
|
+
flyoutAnchorComponentRef;
|
|
95
|
+
templatePortal = computed(() => new TemplatePortal(this.groupTemplate(), this.viewContainer, this.groupData(), this.injector));
|
|
96
|
+
ngOnInit() {
|
|
97
|
+
this.attachInline();
|
|
98
|
+
}
|
|
99
|
+
/** @internal */
|
|
100
|
+
hideFlyout() {
|
|
101
|
+
if (this.flyout()) {
|
|
102
|
+
this.flyout.set(false);
|
|
103
|
+
this.flyoutAnchorComponentRef?.destroy();
|
|
104
|
+
this.flyoutAnchorComponentRef = undefined;
|
|
105
|
+
this.attachInline();
|
|
106
|
+
this.flyoutOutsideClickSubscription?.unsubscribe();
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
triggered() {
|
|
110
|
+
if (this.navbar.collapsed()) {
|
|
111
|
+
this.toggleFlyout();
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
this.expanded.set(!this.expanded());
|
|
115
|
+
this.navbar.groupTriggered();
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
toggleFlyout() {
|
|
119
|
+
if (this.flyout()) {
|
|
120
|
+
this.hideFlyout();
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
this.flyout.set(true);
|
|
124
|
+
this.attachFlyout();
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
attachInline() {
|
|
128
|
+
this.overlayRef.detach();
|
|
129
|
+
this.groupView?.destroy(); // we need ?. for first attachment
|
|
130
|
+
this.groupView = this.viewContainer.createEmbeddedView(this.groupTemplate(), this.groupData(), {
|
|
131
|
+
injector: this.injector
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
attachFlyout() {
|
|
135
|
+
this.groupView.destroy();
|
|
136
|
+
this.groupView = this.overlayRef.attach(this.templatePortal());
|
|
137
|
+
this.flyoutAnchorComponentRef = this.viewContainer.createComponent(SiNavbarFlyoutAnchorComponent);
|
|
138
|
+
this.flyoutAnchorComponentRef.setInput('groupId', this.groupId);
|
|
139
|
+
this.flyoutOutsideClickSubscription = this.overlayRef
|
|
140
|
+
.outsidePointerEvents()
|
|
141
|
+
.subscribe(() => this.hideFlyout());
|
|
142
|
+
}
|
|
143
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiNavbarVerticalGroupTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
144
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.6", type: SiNavbarVerticalGroupTriggerDirective, isStandalone: true, selector: "button[siNavbarVerticalGroupTriggerFor]", inputs: { groupTemplate: { classPropertyName: "groupTemplate", publicName: "siNavbarVerticalGroupTriggerFor", isSignal: true, isRequired: true, transformFunction: null }, groupData: { classPropertyName: "groupData", publicName: "groupData", isSignal: true, isRequired: false, transformFunction: null }, stateId: { classPropertyName: "stateId", publicName: "stateId", isSignal: true, isRequired: false, transformFunction: null }, expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { expanded: "expandedChange" }, host: { listeners: { "click": "triggered()" }, properties: { "id": "id", "class.show": "expanded()", "attr.aria-controls": "groupId", "attr.aria-expanded": "expanded()" }, classAttribute: "dropdown-toggle" }, ngImport: i0 });
|
|
145
|
+
}
|
|
146
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiNavbarVerticalGroupTriggerDirective, decorators: [{
|
|
147
|
+
type: Directive,
|
|
148
|
+
args: [{
|
|
149
|
+
selector: 'button[siNavbarVerticalGroupTriggerFor]',
|
|
150
|
+
host: {
|
|
151
|
+
class: 'dropdown-toggle',
|
|
152
|
+
'[id]': 'id',
|
|
153
|
+
'[class.show]': 'expanded()',
|
|
154
|
+
'[attr.aria-controls]': 'groupId',
|
|
155
|
+
'[attr.aria-expanded]': 'expanded()'
|
|
156
|
+
}
|
|
157
|
+
}]
|
|
158
|
+
}], propDecorators: { triggered: [{
|
|
159
|
+
type: HostListener,
|
|
160
|
+
args: ['click']
|
|
161
|
+
}] } });
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Copyright Siemens 2016 - 2025.
|
|
165
|
+
* SPDX-License-Identifier: MIT
|
|
166
|
+
*/
|
|
167
|
+
class SiNavbarVerticalItemComponent {
|
|
168
|
+
item = input.required({
|
|
169
|
+
alias: 'si-navbar-vertical-item'
|
|
170
|
+
});
|
|
171
|
+
activeOverride = input();
|
|
172
|
+
navbar = inject(SI_NAVBAR_VERTICAL);
|
|
173
|
+
parent = inject(SiNavbarVerticalItemComponent, {
|
|
174
|
+
skipSelf: true,
|
|
175
|
+
optional: true
|
|
176
|
+
});
|
|
177
|
+
group = inject(SiNavbarVerticalGroupTriggerDirective, {
|
|
178
|
+
optional: true,
|
|
179
|
+
self: true
|
|
180
|
+
});
|
|
181
|
+
routerLinkActive = inject(RouterLinkActive, { optional: true });
|
|
182
|
+
siLink = inject(SiLinkDirective, { optional: true });
|
|
183
|
+
ngOnInit() {
|
|
184
|
+
if (this.group && this.active) {
|
|
185
|
+
this.group.expanded.set(true);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
triggered() {
|
|
189
|
+
const item = this.item();
|
|
190
|
+
if (item.type === 'action') {
|
|
191
|
+
item.action(item);
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
this.parent?.group?.hideFlyout();
|
|
195
|
+
if (!this.group) {
|
|
196
|
+
this.navbar.itemTriggered();
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
get active() {
|
|
200
|
+
return (this.activeOverride() ||
|
|
201
|
+
this.routerLinkActive?.isActive ||
|
|
202
|
+
this.siLink?.active() ||
|
|
203
|
+
((!this.group?.expanded() || this.navbar.collapsed()) && this.group?.active()) ||
|
|
204
|
+
false);
|
|
205
|
+
/* eslint-disable-enable @typescript-eslint/prefer-nullish-coalescing */
|
|
206
|
+
}
|
|
207
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiNavbarVerticalItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
208
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: SiNavbarVerticalItemComponent, isStandalone: true, selector: "a[si-navbar-vertical-item], button[si-navbar-vertical-item]", inputs: { item: { classPropertyName: "item", publicName: "si-navbar-vertical-item", isSignal: true, isRequired: true, transformFunction: null }, activeOverride: { classPropertyName: "activeOverride", publicName: "activeOverride", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "triggered()" }, properties: { "class.dropdown-item": "this.parent?.group?.flyout()", "class.navbar-vertical-item": "!this.parent?.group?.flyout()", "class.active": "active" }, classAttribute: "focus-inside" }, ngImport: i0, template: "@if (item().icon) {\n <i class=\"icon me-n2\" aria-hidden=\"true\" [ngClass]=\"[item().icon]\"></i>\n}\n@if (item().icon && item().badge) {\n <span class=\"badge-text\">{{ item().badge }}</span>\n}\n<div\n class=\"item-title text-truncate si-title-2\"\n [class.visually-hidden]=\"!this.parent && this.navbar.collapsed()\"\n>\n <ng-content />\n</div>\n@if (item().badge) {\n <span class=\"badge\" [ngClass]=\"'bg-' + item().badgeColor\">\n {{ item().badge }}\n </span>\n}\n@if (group) {\n <span aria-hidden=\"true\" class=\"dropdown-caret element-down-2 me-0 text-body\"></span>\n}\n", styles: [":host(.navbar-vertical-item){display:flex;align-items:center;position:relative;color:var(--element-text-primary);background:none;border:0;font-size:.875rem;padding-block:8px;padding-inline:0 12px;min-inline-size:0;min-block-size:40px;inline-size:100%}:host(.navbar-vertical-item) .item-title{margin-inline-start:12px}:host(.navbar-vertical-item) .icon{margin-inline-start:12px}:host(.navbar-vertical-item) .icon+.item-title{margin-inline-start:12px}:host(.navbar-vertical-item).active{color:var(--element-text-active);background:var(--element-base-1-selected)}:host(.navbar-vertical-item).active:after{content:\"\";position:absolute;inset-block:0;inset-inline-start:0;inline-size:4px;background:var(--element-ui-0)}:host(.navbar-vertical-item):hover{text-decoration:none;background:var(--element-base-1-hover)}:host-context(.nav-scroll > .navbar-vertical-item)+:host(.navbar-vertical-item),:host-context(.nav-scroll > si-navbar-vertical-group)+:host(.navbar-vertical-item),:host-context(.nav-scroll > si-navbar-flyout-anchor)+:host(.navbar-vertical-item){margin-block-start:8px}:host-context(.nav-text-only si-navbar-vertical-group) .item-title{margin-inline-start:0}:host-context(si-navbar-vertical-group) :host(.navbar-vertical-item){padding-inline-start:32px}:host-context(si-navbar-vertical-group) :host(.navbar-vertical-item) .item-title{font-weight:400}:host(.dropdown-item) .item-title{font-weight:400}:host-context(.nav-collapsed) :is(.badge,.dropdown-caret){display:none}:host-context(si-navbar-vertical:not(.nav-collapsed)) .badge-text{display:none}:host-context(.link-with-items)>:host(button){padding-inline:12px}:host-context(.link-with-items)>:host(button) .item-title,:host-context(.link-with-items)>:host(button) .icon{display:none}:host-context(.link-with-items)>:host(button) .dropdown-caret{padding-inline:0}:host-context(.link-with-items)>:host(button):after{display:none}:host-context(.nav-collapsed .link-with-items)>:host(button){padding-inline:0}:host-context(.nav-collapsed .link-with-items)>:host(button):after{display:block}:host-context(.nav-collapsed .link-with-items)>:host(button) .icon{display:block}:host-context(.nav-collapsed .link-with-items)>:host(a){display:none}.badge{margin-inline:auto 0}.badge-text{inset-block-start:-8px;inset-inline-start:-6px}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
209
|
+
}
|
|
210
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiNavbarVerticalItemComponent, decorators: [{
|
|
211
|
+
type: Component,
|
|
212
|
+
args: [{ selector: 'a[si-navbar-vertical-item], button[si-navbar-vertical-item]', imports: [NgClass], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
213
|
+
'class': 'focus-inside',
|
|
214
|
+
'[class.dropdown-item]': 'this.parent?.group?.flyout()',
|
|
215
|
+
'[class.navbar-vertical-item]': '!this.parent?.group?.flyout()',
|
|
216
|
+
'[class.active]': 'active'
|
|
217
|
+
}, template: "@if (item().icon) {\n <i class=\"icon me-n2\" aria-hidden=\"true\" [ngClass]=\"[item().icon]\"></i>\n}\n@if (item().icon && item().badge) {\n <span class=\"badge-text\">{{ item().badge }}</span>\n}\n<div\n class=\"item-title text-truncate si-title-2\"\n [class.visually-hidden]=\"!this.parent && this.navbar.collapsed()\"\n>\n <ng-content />\n</div>\n@if (item().badge) {\n <span class=\"badge\" [ngClass]=\"'bg-' + item().badgeColor\">\n {{ item().badge }}\n </span>\n}\n@if (group) {\n <span aria-hidden=\"true\" class=\"dropdown-caret element-down-2 me-0 text-body\"></span>\n}\n", styles: [":host(.navbar-vertical-item){display:flex;align-items:center;position:relative;color:var(--element-text-primary);background:none;border:0;font-size:.875rem;padding-block:8px;padding-inline:0 12px;min-inline-size:0;min-block-size:40px;inline-size:100%}:host(.navbar-vertical-item) .item-title{margin-inline-start:12px}:host(.navbar-vertical-item) .icon{margin-inline-start:12px}:host(.navbar-vertical-item) .icon+.item-title{margin-inline-start:12px}:host(.navbar-vertical-item).active{color:var(--element-text-active);background:var(--element-base-1-selected)}:host(.navbar-vertical-item).active:after{content:\"\";position:absolute;inset-block:0;inset-inline-start:0;inline-size:4px;background:var(--element-ui-0)}:host(.navbar-vertical-item):hover{text-decoration:none;background:var(--element-base-1-hover)}:host-context(.nav-scroll > .navbar-vertical-item)+:host(.navbar-vertical-item),:host-context(.nav-scroll > si-navbar-vertical-group)+:host(.navbar-vertical-item),:host-context(.nav-scroll > si-navbar-flyout-anchor)+:host(.navbar-vertical-item){margin-block-start:8px}:host-context(.nav-text-only si-navbar-vertical-group) .item-title{margin-inline-start:0}:host-context(si-navbar-vertical-group) :host(.navbar-vertical-item){padding-inline-start:32px}:host-context(si-navbar-vertical-group) :host(.navbar-vertical-item) .item-title{font-weight:400}:host(.dropdown-item) .item-title{font-weight:400}:host-context(.nav-collapsed) :is(.badge,.dropdown-caret){display:none}:host-context(si-navbar-vertical:not(.nav-collapsed)) .badge-text{display:none}:host-context(.link-with-items)>:host(button){padding-inline:12px}:host-context(.link-with-items)>:host(button) .item-title,:host-context(.link-with-items)>:host(button) .icon{display:none}:host-context(.link-with-items)>:host(button) .dropdown-caret{padding-inline:0}:host-context(.link-with-items)>:host(button):after{display:none}:host-context(.nav-collapsed .link-with-items)>:host(button){padding-inline:0}:host-context(.nav-collapsed .link-with-items)>:host(button):after{display:block}:host-context(.nav-collapsed .link-with-items)>:host(button) .icon{display:block}:host-context(.nav-collapsed .link-with-items)>:host(a){display:none}.badge{margin-inline:auto 0}.badge-text{inset-block-start:-8px;inset-inline-start:-6px}\n"] }]
|
|
218
|
+
}], propDecorators: { triggered: [{
|
|
219
|
+
type: HostListener,
|
|
220
|
+
args: ['click']
|
|
221
|
+
}] } });
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Copyright Siemens 2016 - 2025.
|
|
225
|
+
* SPDX-License-Identifier: MIT
|
|
226
|
+
*/
|
|
227
|
+
// We have to use a component to build animations.
|
|
228
|
+
class SiNavbarVerticalGroupComponent {
|
|
229
|
+
navbar = inject(SI_NAVBAR_VERTICAL);
|
|
230
|
+
groupTrigger = inject(SiNavbarVerticalGroupTriggerDirective);
|
|
231
|
+
groupParent = inject(SiNavbarVerticalItemComponent);
|
|
232
|
+
routerLinkActive = inject(RouterLinkActive, { optional: true });
|
|
233
|
+
// Store initial value, as the mode for an instance never changes.
|
|
234
|
+
flyout = this.groupTrigger.flyout();
|
|
235
|
+
visible = computed(() => {
|
|
236
|
+
return this.flyout || (!this.navbar.collapsed() && this.groupTrigger.expanded());
|
|
237
|
+
});
|
|
238
|
+
state = computed(() => {
|
|
239
|
+
if (this.flyout) {
|
|
240
|
+
return 'flyout';
|
|
241
|
+
}
|
|
242
|
+
if (this.groupTrigger.expanded() && !this.navbar.collapsed()) {
|
|
243
|
+
return 'expanded';
|
|
244
|
+
}
|
|
245
|
+
return 'collapsed';
|
|
246
|
+
});
|
|
247
|
+
constructor() {
|
|
248
|
+
this.routerLinkActive?.isActiveChange
|
|
249
|
+
.pipe(takeUntilDestroyed())
|
|
250
|
+
.subscribe(active => this.groupTrigger.active.set(active));
|
|
251
|
+
}
|
|
252
|
+
close() {
|
|
253
|
+
this.groupTrigger.hideFlyout();
|
|
254
|
+
}
|
|
255
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiNavbarVerticalGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
256
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.6", type: SiNavbarVerticalGroupComponent, isStandalone: true, selector: "si-navbar-vertical-group", host: { attributes: { "role": "group" }, listeners: { "keydown.escape": "close()" }, properties: { "id": "groupTrigger.groupId", "attr.aria-labelledby": "groupTrigger.id", "class.dropdown-menu": "flyout", "@collapse": "state() ?? \"collapsed\"" } }, ngImport: i0, template: `<div [cdkTrapFocus]="flyout" [cdkTrapFocusAutoCapture]="flyout">
|
|
257
|
+
<ng-content />
|
|
258
|
+
</div>`, isInline: true, styles: [":host{display:block;overflow:hidden}\n"], dependencies: [{ kind: "directive", type: CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }], animations: [
|
|
259
|
+
trigger('collapse', [
|
|
260
|
+
state('collapsed', style({ display: 'none' })),
|
|
261
|
+
// Prevents initial animation. See: https://stackoverflow.com/a/50791299
|
|
262
|
+
transition(':enter', []),
|
|
263
|
+
transition('collapsed => expanded', [
|
|
264
|
+
style({ 'display': 'block', 'block-size': '0' }),
|
|
265
|
+
animate('0.5s ease', style({ 'block-size': '*' }))
|
|
266
|
+
]),
|
|
267
|
+
transition('expanded => collapsed', [animate('0.5s ease', style({ 'block-size': '0' }))])
|
|
268
|
+
])
|
|
269
|
+
] });
|
|
270
|
+
}
|
|
271
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiNavbarVerticalGroupComponent, decorators: [{
|
|
272
|
+
type: Component,
|
|
273
|
+
args: [{ selector: 'si-navbar-vertical-group', template: `<div [cdkTrapFocus]="flyout" [cdkTrapFocusAutoCapture]="flyout">
|
|
274
|
+
<ng-content />
|
|
275
|
+
</div>`, host: {
|
|
276
|
+
role: 'group',
|
|
277
|
+
'[id]': 'groupTrigger.groupId',
|
|
278
|
+
'[attr.aria-labelledby]': 'groupTrigger.id',
|
|
279
|
+
'[class.dropdown-menu]': 'flyout',
|
|
280
|
+
'[@collapse]': 'state() ?? "collapsed"'
|
|
281
|
+
}, imports: [CdkTrapFocus], animations: [
|
|
282
|
+
trigger('collapse', [
|
|
283
|
+
state('collapsed', style({ display: 'none' })),
|
|
284
|
+
// Prevents initial animation. See: https://stackoverflow.com/a/50791299
|
|
285
|
+
transition(':enter', []),
|
|
286
|
+
transition('collapsed => expanded', [
|
|
287
|
+
style({ 'display': 'block', 'block-size': '0' }),
|
|
288
|
+
animate('0.5s ease', style({ 'block-size': '*' }))
|
|
289
|
+
]),
|
|
290
|
+
transition('expanded => collapsed', [animate('0.5s ease', style({ 'block-size': '0' }))])
|
|
291
|
+
])
|
|
292
|
+
], styles: [":host{display:block;overflow:hidden}\n"] }]
|
|
293
|
+
}], ctorParameters: () => [], propDecorators: { close: [{
|
|
294
|
+
type: HostListener,
|
|
295
|
+
args: ['keydown.escape']
|
|
296
|
+
}] } });
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Copyright Siemens 2016 - 2025.
|
|
300
|
+
* SPDX-License-Identifier: MIT
|
|
301
|
+
*/
|
|
302
|
+
class SiNavbarVerticalHeaderComponent {
|
|
303
|
+
navbar = inject(SI_NAVBAR_VERTICAL);
|
|
304
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiNavbarVerticalHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
305
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: SiNavbarVerticalHeaderComponent, isStandalone: true, selector: "si-navbar-vertical-header", host: { properties: { "@headerCollapse": "navbar.collapsed()" } }, ngImport: i0, template: `
|
|
306
|
+
@if (!navbar.collapsed()) {
|
|
307
|
+
<div class="si-title-2 text-secondary p-5">
|
|
308
|
+
<ng-content />
|
|
309
|
+
</div>
|
|
310
|
+
} @else {
|
|
311
|
+
<si-navbar-vertical-divider />
|
|
312
|
+
}
|
|
313
|
+
`, isInline: true, styles: [":host{display:flex;align-items:center}si-navbar-vertical-divider{flex:1;margin-block:0}\n"], dependencies: [{ kind: "component", type: SiNavbarVerticalDividerComponent, selector: "si-navbar-vertical-divider" }], animations: [
|
|
314
|
+
trigger('headerCollapse', [
|
|
315
|
+
// Prevents initial animation. See: https://stackoverflow.com/a/50791299
|
|
316
|
+
transition(':enter', []),
|
|
317
|
+
state('true', style({ blockSize: '13px' })),
|
|
318
|
+
state('false', style({ blockSize: '40px' })),
|
|
319
|
+
transition('* <=> *', [
|
|
320
|
+
query('.si-title-2', style({ position: 'absolute' }), { optional: true }),
|
|
321
|
+
group([
|
|
322
|
+
query(':leave', [style({ opacity: '1' }), animate('0.2s ease-in', style({ opacity: '0' }))], { optional: true }),
|
|
323
|
+
query(':enter', [style({ opacity: '0' }), animate('0.2s 0.3s ease-out', style({ opacity: '1' }))], { optional: true }),
|
|
324
|
+
animate('0.5s ease')
|
|
325
|
+
])
|
|
326
|
+
])
|
|
327
|
+
])
|
|
328
|
+
] });
|
|
329
|
+
}
|
|
330
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiNavbarVerticalHeaderComponent, decorators: [{
|
|
331
|
+
type: Component,
|
|
332
|
+
args: [{ selector: 'si-navbar-vertical-header', imports: [SiNavbarVerticalDividerComponent], template: `
|
|
333
|
+
@if (!navbar.collapsed()) {
|
|
334
|
+
<div class="si-title-2 text-secondary p-5">
|
|
335
|
+
<ng-content />
|
|
336
|
+
</div>
|
|
337
|
+
} @else {
|
|
338
|
+
<si-navbar-vertical-divider />
|
|
339
|
+
}
|
|
340
|
+
`, animations: [
|
|
341
|
+
trigger('headerCollapse', [
|
|
342
|
+
// Prevents initial animation. See: https://stackoverflow.com/a/50791299
|
|
343
|
+
transition(':enter', []),
|
|
344
|
+
state('true', style({ blockSize: '13px' })),
|
|
345
|
+
state('false', style({ blockSize: '40px' })),
|
|
346
|
+
transition('* <=> *', [
|
|
347
|
+
query('.si-title-2', style({ position: 'absolute' }), { optional: true }),
|
|
348
|
+
group([
|
|
349
|
+
query(':leave', [style({ opacity: '1' }), animate('0.2s ease-in', style({ opacity: '0' }))], { optional: true }),
|
|
350
|
+
query(':enter', [style({ opacity: '0' }), animate('0.2s 0.3s ease-out', style({ opacity: '1' }))], { optional: true }),
|
|
351
|
+
animate('0.5s ease')
|
|
352
|
+
])
|
|
353
|
+
])
|
|
354
|
+
])
|
|
355
|
+
], host: { '[@headerCollapse]': 'navbar.collapsed()' }, styles: [":host{display:flex;align-items:center}si-navbar-vertical-divider{flex:1;margin-block:0}\n"] }]
|
|
356
|
+
}] });
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* Copyright Siemens 2016 - 2025.
|
|
360
|
+
* SPDX-License-Identifier: MIT
|
|
361
|
+
*/
|
|
362
|
+
class SiNavbarVerticalItemLegacyComponent {
|
|
363
|
+
item = input.required();
|
|
364
|
+
navbarExpandButtonText = input.required();
|
|
365
|
+
navbarCollapseButtonText = input.required();
|
|
366
|
+
expanded = model.required();
|
|
367
|
+
flyoutItems = computed(() => {
|
|
368
|
+
if (!this.navbar.collapsed()) {
|
|
369
|
+
return this.item().items;
|
|
370
|
+
}
|
|
371
|
+
else {
|
|
372
|
+
return [
|
|
373
|
+
this.isLink() ? { ...this.item(), items: undefined } : [],
|
|
374
|
+
this.item().items ?? []
|
|
375
|
+
].flat();
|
|
376
|
+
}
|
|
377
|
+
});
|
|
378
|
+
isLink = computed(() => {
|
|
379
|
+
const item = this.item();
|
|
380
|
+
return !!item.action || !!item.link || !!item.href;
|
|
381
|
+
});
|
|
382
|
+
toggleButtonLabel = computed(() => this.navbar.collapsed()
|
|
383
|
+
? this.navbarExpandButtonText()
|
|
384
|
+
: this.expanded()
|
|
385
|
+
? this.navbarCollapseButtonText()
|
|
386
|
+
: this.navbarExpandButtonText());
|
|
387
|
+
siLinks = viewChildren(SiLinkDirective);
|
|
388
|
+
itemActive = computed(() => (this.navbar.collapsed() || !this.expanded()) && this.siLinks().some(link => link.active()));
|
|
389
|
+
navbar = inject(SI_NAVBAR_VERTICAL);
|
|
390
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiNavbarVerticalItemLegacyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
391
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: SiNavbarVerticalItemLegacyComponent, isStandalone: true, selector: "si-navbar-vertical-item-legacy", inputs: { item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: true, transformFunction: null }, navbarExpandButtonText: { classPropertyName: "navbarExpandButtonText", publicName: "navbarExpandButtonText", isSignal: true, isRequired: true, transformFunction: null }, navbarCollapseButtonText: { classPropertyName: "navbarCollapseButtonText", publicName: "navbarCollapseButtonText", isSignal: true, isRequired: true, transformFunction: null }, expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { expanded: "expandedChange" }, host: { classAttribute: "d-block mb-4" }, viewQueries: [{ propertyName: "siLinks", predicate: SiLinkDirective, descendants: true, isSignal: true }], ngImport: i0, template: "<!-- section header -->\n@if (!isLink() && !item().items) {\n <si-navbar-vertical-header>\n {{ item().title | translate }}\n </si-navbar-vertical-header>\n} @else if (isLink() && !item().items) {\n <a [si-navbar-vertical-item]=\"item()\" [siLink]=\"item()\">\n {{ item().title | translate }}\n </a>\n} @else if (isLink() && item().items) {\n <div class=\"link-with-items\">\n <a\n #mainLink\n [si-navbar-vertical-item]=\"item()\"\n [siLink]=\"item()\"\n [activeOverride]=\"itemActive()\"\n >\n {{ item().title | translate }}\n </a>\n <button\n type=\"button\"\n class=\"mt-0\"\n [si-navbar-vertical-item]=\"item()\"\n [siNavbarVerticalGroupTriggerFor]=\"group\"\n [activeOverride]=\"mainLink.active\"\n [attr.aria-label]=\"toggleButtonLabel() + ' ' + item().title | translate\"\n [(expanded)]=\"expanded\"\n >\n {{ item().title | translate }}\n </button>\n </div>\n} @else if (item().items) {\n <button\n type=\"button\"\n [si-navbar-vertical-item]=\"item()\"\n [siNavbarVerticalGroupTriggerFor]=\"group\"\n [activeOverride]=\"itemActive()\"\n [(expanded)]=\"expanded\"\n >\n {{ item().title | translate }}\n </button>\n}\n\n<ng-template #group>\n <si-navbar-vertical-group>\n @for (subitem of flyoutItems(); track $index) {\n <a activeClass=\"active\" [si-navbar-vertical-item]=\"subitem\" [siLink]=\"subitem\">\n {{ subitem.title | translate }}\n </a>\n }\n </si-navbar-vertical-group>\n</ng-template>\n", styles: [".link-with-items{display:grid;grid-template-columns:1fr auto;grid-template-areas:\"- -\" \"items items\"}si-navbar-vertical-group{grid-area:items}\n"], dependencies: [{ kind: "directive", type: SiLinkDirective, selector: "[siLink]", inputs: ["siLink", "siLinkDefaultTarget", "actionParam", "activeClass", "exactMatch", "ariaCurrent"], outputs: ["activeChange"], exportAs: ["siLink"] }, { kind: "ngmodule", type: SiTranslateModule }, { kind: "pipe", type: i1.SiTranslatePipe, name: "translate" }, { kind: "component", type: SiNavbarVerticalItemComponent, selector: "a[si-navbar-vertical-item], button[si-navbar-vertical-item]", inputs: ["si-navbar-vertical-item", "activeOverride"] }, { kind: "directive", type: SiNavbarVerticalGroupTriggerDirective, selector: "button[siNavbarVerticalGroupTriggerFor]", inputs: ["siNavbarVerticalGroupTriggerFor", "groupData", "stateId", "expanded"], outputs: ["expandedChange"] }, { kind: "component", type: SiNavbarVerticalGroupComponent, selector: "si-navbar-vertical-group" }, { kind: "component", type: SiNavbarVerticalHeaderComponent, selector: "si-navbar-vertical-header" }] });
|
|
392
|
+
}
|
|
393
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiNavbarVerticalItemLegacyComponent, decorators: [{
|
|
394
|
+
type: Component,
|
|
395
|
+
args: [{ selector: 'si-navbar-vertical-item-legacy', imports: [
|
|
396
|
+
SiLinkDirective,
|
|
397
|
+
SiTranslateModule,
|
|
398
|
+
SiNavbarVerticalItemComponent,
|
|
399
|
+
SiNavbarVerticalGroupTriggerDirective,
|
|
400
|
+
SiNavbarVerticalGroupComponent,
|
|
401
|
+
SiNavbarVerticalHeaderComponent
|
|
402
|
+
], host: {
|
|
403
|
+
'class': 'd-block mb-4'
|
|
404
|
+
}, template: "<!-- section header -->\n@if (!isLink() && !item().items) {\n <si-navbar-vertical-header>\n {{ item().title | translate }}\n </si-navbar-vertical-header>\n} @else if (isLink() && !item().items) {\n <a [si-navbar-vertical-item]=\"item()\" [siLink]=\"item()\">\n {{ item().title | translate }}\n </a>\n} @else if (isLink() && item().items) {\n <div class=\"link-with-items\">\n <a\n #mainLink\n [si-navbar-vertical-item]=\"item()\"\n [siLink]=\"item()\"\n [activeOverride]=\"itemActive()\"\n >\n {{ item().title | translate }}\n </a>\n <button\n type=\"button\"\n class=\"mt-0\"\n [si-navbar-vertical-item]=\"item()\"\n [siNavbarVerticalGroupTriggerFor]=\"group\"\n [activeOverride]=\"mainLink.active\"\n [attr.aria-label]=\"toggleButtonLabel() + ' ' + item().title | translate\"\n [(expanded)]=\"expanded\"\n >\n {{ item().title | translate }}\n </button>\n </div>\n} @else if (item().items) {\n <button\n type=\"button\"\n [si-navbar-vertical-item]=\"item()\"\n [siNavbarVerticalGroupTriggerFor]=\"group\"\n [activeOverride]=\"itemActive()\"\n [(expanded)]=\"expanded\"\n >\n {{ item().title | translate }}\n </button>\n}\n\n<ng-template #group>\n <si-navbar-vertical-group>\n @for (subitem of flyoutItems(); track $index) {\n <a activeClass=\"active\" [si-navbar-vertical-item]=\"subitem\" [siLink]=\"subitem\">\n {{ subitem.title | translate }}\n </a>\n }\n </si-navbar-vertical-group>\n</ng-template>\n", styles: [".link-with-items{display:grid;grid-template-columns:1fr auto;grid-template-areas:\"- -\" \"items items\"}si-navbar-vertical-group{grid-area:items}\n"] }]
|
|
405
|
+
}] });
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* Copyright Siemens 2016 - 2025.
|
|
409
|
+
* SPDX-License-Identifier: MIT
|
|
410
|
+
*/
|
|
411
|
+
/** Required to have compiler checks on the factory template */
|
|
412
|
+
class SiNavbarVerticalItemGuardDirective {
|
|
413
|
+
static ngTemplateContextGuard(dir, ctx) {
|
|
414
|
+
return true;
|
|
415
|
+
}
|
|
416
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiNavbarVerticalItemGuardDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
417
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.6", type: SiNavbarVerticalItemGuardDirective, isStandalone: true, selector: "[siNavbarVerticalItemGuard]", ngImport: i0 });
|
|
418
|
+
}
|
|
419
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiNavbarVerticalItemGuardDirective, decorators: [{
|
|
420
|
+
type: Directive,
|
|
421
|
+
args: [{ selector: '[siNavbarVerticalItemGuard]' }]
|
|
422
|
+
}] });
|
|
423
|
+
class SiNavbarVerticalComponent {
|
|
424
|
+
/**
|
|
425
|
+
* Whether the navbar-vertical is collapsed.
|
|
426
|
+
*
|
|
427
|
+
* @defaultValue false
|
|
428
|
+
*/
|
|
429
|
+
collapsed = model(false);
|
|
430
|
+
/**
|
|
431
|
+
* Toggles search bar
|
|
432
|
+
*
|
|
433
|
+
* @defaultValue false
|
|
434
|
+
*/
|
|
435
|
+
searchable = input(false, { transform: booleanAttribute });
|
|
436
|
+
/**
|
|
437
|
+
* Placeholder text for search
|
|
438
|
+
*
|
|
439
|
+
* @defaultValue
|
|
440
|
+
* ```
|
|
441
|
+
* $localize`:@@SI_NAVBAR_VERTICAL.SEARCH_PLACEHOLDER:Search ...`
|
|
442
|
+
* ```
|
|
443
|
+
*/
|
|
444
|
+
searchPlaceholder = input($localize `:@@SI_NAVBAR_VERTICAL.SEARCH_PLACEHOLDER:Search ...`);
|
|
445
|
+
/**
|
|
446
|
+
* List of vertical navigation items
|
|
447
|
+
*
|
|
448
|
+
* @defaultValue []
|
|
449
|
+
*/
|
|
450
|
+
items = model([]);
|
|
451
|
+
/**
|
|
452
|
+
* Set to `true` if there are no icons
|
|
453
|
+
*
|
|
454
|
+
* @defaultValue false
|
|
455
|
+
*/
|
|
456
|
+
/**
|
|
457
|
+
* Set to `true` if there are no icons
|
|
458
|
+
*
|
|
459
|
+
* @defaultValue false
|
|
460
|
+
*/
|
|
461
|
+
textOnly = input(false, { transform: booleanAttribute });
|
|
462
|
+
/**
|
|
463
|
+
* Set to false to hide the vertical navbar
|
|
464
|
+
*
|
|
465
|
+
* @defaultValue true
|
|
466
|
+
*/
|
|
467
|
+
/**
|
|
468
|
+
* Set to false to hide the vertical navbar
|
|
469
|
+
*
|
|
470
|
+
* @defaultValue true
|
|
471
|
+
*/
|
|
472
|
+
visible = input(true, { transform: booleanAttribute });
|
|
473
|
+
/**
|
|
474
|
+
* @deprecated dropped without replacement.
|
|
475
|
+
*
|
|
476
|
+
* @defaultValue undefined
|
|
477
|
+
*/
|
|
478
|
+
autoCollapseDelay = input(undefined, { transform: numberAttribute });
|
|
479
|
+
/**
|
|
480
|
+
* Text for the navbar expand button. Required for a11y
|
|
481
|
+
*
|
|
482
|
+
* @defaultValue
|
|
483
|
+
* ```
|
|
484
|
+
* $localize`:@@SI_NAVBAR_VERTICAL.EXPAND:Expand`
|
|
485
|
+
* ```
|
|
486
|
+
*/
|
|
487
|
+
navbarExpandButtonText = input($localize `:@@SI_NAVBAR_VERTICAL.EXPAND:Expand`);
|
|
488
|
+
/**
|
|
489
|
+
* Text for the navbar collapse button. Required for a11y
|
|
490
|
+
*
|
|
491
|
+
* @defaultValue
|
|
492
|
+
* ```
|
|
493
|
+
* $localize`:@@SI_NAVBAR_VERTICAL.COLLAPSE:Collapse`
|
|
494
|
+
* ```
|
|
495
|
+
*/
|
|
496
|
+
navbarCollapseButtonText = input($localize `:@@SI_NAVBAR_VERTICAL.COLLAPSE:Collapse`);
|
|
497
|
+
/**
|
|
498
|
+
* An optional stateId to uniquely identify a component instance.
|
|
499
|
+
* Required for persistence of ui state.
|
|
500
|
+
*/
|
|
501
|
+
stateId = input();
|
|
502
|
+
/**
|
|
503
|
+
* Label for the skip link to the vertical navbar
|
|
504
|
+
*
|
|
505
|
+
* @defaultValue
|
|
506
|
+
* ```
|
|
507
|
+
* $localize`:@@SI_NAVBAR_VERTICAL.SKIP_LINK.NAVIGATION_LABEL:Navigation`
|
|
508
|
+
* ```
|
|
509
|
+
*/
|
|
510
|
+
skipLinkNavigationLabel = input($localize `:@@SI_NAVBAR_VERTICAL.SKIP_LINK.NAVIGATION_LABEL:Navigation`);
|
|
511
|
+
/**
|
|
512
|
+
* Label for the skip link to main content
|
|
513
|
+
*
|
|
514
|
+
* @defaultValue
|
|
515
|
+
* ```
|
|
516
|
+
* $localize`:@@SI_NAVBAR_VERTICAL.SKIP_LINK.MAIN_LABEL:Main content`
|
|
517
|
+
* ```
|
|
518
|
+
*/
|
|
519
|
+
skipLinkMainContentLabel = input($localize `:@@SI_NAVBAR_VERTICAL.SKIP_LINK.MAIN_LABEL:Main content`);
|
|
520
|
+
/**
|
|
521
|
+
* Output for search bar input
|
|
522
|
+
*/
|
|
523
|
+
searchEvent = output();
|
|
524
|
+
searchBar = viewChild.required(SiSearchBarComponent);
|
|
525
|
+
activatedRoute = inject(ActivatedRoute, { optional: true });
|
|
526
|
+
// Is required to prevent the navbar from running the padding animation on creation.
|
|
527
|
+
ready = true;
|
|
528
|
+
searchInputDelay = 400;
|
|
529
|
+
uiStateService = inject(SI_UI_STATE_SERVICE, { optional: true });
|
|
530
|
+
breakpointObserver = inject(BreakpointObserver);
|
|
531
|
+
navbarItems = viewChildren(SiNavbarVerticalItemComponent);
|
|
532
|
+
navbarItemsLegacy = viewChildren(SiNavbarVerticalItemLegacyComponent);
|
|
533
|
+
itemsToComponents = computed(() => new Map([...this.navbarItems(), ...this.navbarItemsLegacy()].map(component => [
|
|
534
|
+
component.item(), // to have a broader key type allowed
|
|
535
|
+
component
|
|
536
|
+
])));
|
|
537
|
+
smallScreen = signal(false);
|
|
538
|
+
uiStateExpandedItems = signal({});
|
|
539
|
+
destroyer = new Subject();
|
|
540
|
+
// Indicates if the user prefers a collapsed navbar. Relevant for resizing.
|
|
541
|
+
preferCollapse = false;
|
|
542
|
+
constructor() {
|
|
543
|
+
this.breakpointObserver
|
|
544
|
+
.observe(`(max-width: ${BOOTSTRAP_BREAKPOINTS.lgMinimum}px)`)
|
|
545
|
+
.pipe(takeUntil(this.destroyer))
|
|
546
|
+
.subscribe(({ matches }) => {
|
|
547
|
+
this.collapsed.set(matches || this.preferCollapse);
|
|
548
|
+
this.smallScreen.set(matches);
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
ngOnChanges(changes) {
|
|
552
|
+
if (changes.collapsed) {
|
|
553
|
+
this.preferCollapse = this.collapsed();
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
ngOnInit() {
|
|
557
|
+
const stateId = this.stateId();
|
|
558
|
+
if (this.uiStateService && stateId) {
|
|
559
|
+
this.uiStateService.load(stateId).then(uiState => {
|
|
560
|
+
if (uiState) {
|
|
561
|
+
this.preferCollapse = uiState.preferCollapse;
|
|
562
|
+
this.collapsed.set(this.smallScreen() ? this.collapsed() : this.preferCollapse);
|
|
563
|
+
this.uiStateExpandedItems.set(uiState.expandedItems);
|
|
564
|
+
}
|
|
565
|
+
});
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
ngOnDestroy() {
|
|
569
|
+
this.destroyer.next();
|
|
570
|
+
this.destroyer.complete();
|
|
571
|
+
}
|
|
572
|
+
toggleCollapse() {
|
|
573
|
+
if (this.collapsed()) {
|
|
574
|
+
this.expand();
|
|
575
|
+
}
|
|
576
|
+
else {
|
|
577
|
+
this.collapse();
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
/** Expands the vertical navbar. */
|
|
581
|
+
expand() {
|
|
582
|
+
this.collapsed.set(false);
|
|
583
|
+
if (!this.smallScreen()) {
|
|
584
|
+
this.preferCollapse = this.collapsed();
|
|
585
|
+
const autoCollapseDelay = this.autoCollapseDelay();
|
|
586
|
+
if (autoCollapseDelay) {
|
|
587
|
+
setTimeout(() => {
|
|
588
|
+
if (!this.collapsed()) {
|
|
589
|
+
this.toggleCollapse();
|
|
590
|
+
}
|
|
591
|
+
}, autoCollapseDelay);
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
this.saveUIState();
|
|
595
|
+
}
|
|
596
|
+
/** Collapses the vertical navbar. */
|
|
597
|
+
collapse() {
|
|
598
|
+
this.collapsed.set(true);
|
|
599
|
+
if (!this.smallScreen()) {
|
|
600
|
+
this.preferCollapse = this.collapsed();
|
|
601
|
+
}
|
|
602
|
+
this.saveUIState();
|
|
603
|
+
}
|
|
604
|
+
expandForSearch() {
|
|
605
|
+
this.expand();
|
|
606
|
+
setTimeout(() => this.searchBar().focus());
|
|
607
|
+
}
|
|
608
|
+
doSearch(event) {
|
|
609
|
+
this.searchEvent.emit(event);
|
|
610
|
+
}
|
|
611
|
+
/** @internal */
|
|
612
|
+
groupTriggered() {
|
|
613
|
+
this.saveUIState();
|
|
614
|
+
const itemToComponentMap = this.itemsToComponents();
|
|
615
|
+
this.items.set(this.items().map(item => {
|
|
616
|
+
const component = itemToComponentMap.get(item);
|
|
617
|
+
if (!component) {
|
|
618
|
+
return item;
|
|
619
|
+
}
|
|
620
|
+
if (component instanceof SiNavbarVerticalItemLegacyComponent) {
|
|
621
|
+
return {
|
|
622
|
+
...item,
|
|
623
|
+
expanded: component.expanded()
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
if (component.group) {
|
|
627
|
+
return {
|
|
628
|
+
...item,
|
|
629
|
+
expanded: component.group.expanded()
|
|
630
|
+
};
|
|
631
|
+
}
|
|
632
|
+
return item;
|
|
633
|
+
}));
|
|
634
|
+
this.collapsed.set(false);
|
|
635
|
+
}
|
|
636
|
+
saveUIState() {
|
|
637
|
+
const stateId = this.stateId();
|
|
638
|
+
if (!this.uiStateService || !stateId) {
|
|
639
|
+
return;
|
|
640
|
+
}
|
|
641
|
+
const expandedGroups = this.navbarItems()
|
|
642
|
+
.filter(item => item.item().id && item.group?.expanded())
|
|
643
|
+
.map(item => [item.item().id, true]);
|
|
644
|
+
const expandedGroupsLegacy = this.navbarItemsLegacy()
|
|
645
|
+
.filter(item => item.item().id && item.expanded())
|
|
646
|
+
.map(item => [item.item().id, true]);
|
|
647
|
+
this.uiStateService.save(stateId, {
|
|
648
|
+
preferCollapse: this.preferCollapse,
|
|
649
|
+
expandedItems: Object.fromEntries([...expandedGroups, ...expandedGroupsLegacy])
|
|
650
|
+
});
|
|
651
|
+
}
|
|
652
|
+
/** @internal */
|
|
653
|
+
itemTriggered() {
|
|
654
|
+
if (this.smallScreen()) {
|
|
655
|
+
this.collapsed.set(true);
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
isLegacyStyle(item) {
|
|
659
|
+
return !('type' in item && item.type !== 'check' && item.type !== 'radio');
|
|
660
|
+
}
|
|
661
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiNavbarVerticalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
662
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: SiNavbarVerticalComponent, isStandalone: true, selector: "si-navbar-vertical", inputs: { collapsed: { classPropertyName: "collapsed", publicName: "collapsed", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, textOnly: { classPropertyName: "textOnly", publicName: "textOnly", isSignal: true, isRequired: false, transformFunction: null }, visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null }, autoCollapseDelay: { classPropertyName: "autoCollapseDelay", publicName: "autoCollapseDelay", isSignal: true, isRequired: false, transformFunction: null }, navbarExpandButtonText: { classPropertyName: "navbarExpandButtonText", publicName: "navbarExpandButtonText", isSignal: true, isRequired: false, transformFunction: null }, navbarCollapseButtonText: { classPropertyName: "navbarCollapseButtonText", publicName: "navbarCollapseButtonText", isSignal: true, isRequired: false, transformFunction: null }, stateId: { classPropertyName: "stateId", publicName: "stateId", isSignal: true, isRequired: false, transformFunction: null }, skipLinkNavigationLabel: { classPropertyName: "skipLinkNavigationLabel", publicName: "skipLinkNavigationLabel", isSignal: true, isRequired: false, transformFunction: null }, skipLinkMainContentLabel: { classPropertyName: "skipLinkMainContentLabel", publicName: "skipLinkMainContentLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { collapsed: "collapsedChange", items: "itemsChange", searchEvent: "searchEvent" }, host: { properties: { "class.nav-collapsed": "collapsed()", "class.nav-text-only": "textOnly()", "class.visible": "visible()", "class.ready": "this.ready" }, classAttribute: "si-layout-inner" }, providers: [{ provide: SI_NAVBAR_VERTICAL, useExisting: SiNavbarVerticalComponent }], viewQueries: [{ propertyName: "searchBar", first: true, predicate: SiSearchBarComponent, descendants: true, isSignal: true }, { propertyName: "navbarItems", predicate: SiNavbarVerticalItemComponent, descendants: true, isSignal: true }, { propertyName: "navbarItemsLegacy", predicate: SiNavbarVerticalItemLegacyComponent, descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "@if (visible()) {\n @if (smallScreen() && !collapsed()) {\n <div\n class=\"modal-backdrop\"\n [@backdrop]=\"smallScreen() && !collapsed() ? 'show' : 'hide'\"\n (click)=\"toggleCollapse()\"\n ></div>\n }\n <nav\n tabindex=\"-1\"\n class=\"bg-base-1 focus-sub-inside\"\n [siSkipLinkTarget]=\"skipLinkNavigationLabel()\"\n [@collapse]=\"collapsed() ? 'collapsed' : 'expanded'\"\n [class.text-only]=\"textOnly()\"\n >\n <div class=\"collapse-toggle ms-auto\">\n <div class=\"mobile-drawer focus-inside navbar-vertical-no-collapse\">\n <button\n type=\"button\"\n class=\"btn btn-circle btn-sm btn-ghost flip-rtl\"\n [class.element-double-left]=\"!collapsed()\"\n [class.element-double-right]=\"collapsed()\"\n [attr.aria-label]=\"\n (collapsed() ? navbarExpandButtonText() : navbarCollapseButtonText()) | translate\n \"\n [attr.aria-expanded]=\"!collapsed()\"\n (click)=\"toggleCollapse()\"\n >\n </button>\n </div>\n </div>\n @if (searchable()) {\n <div class=\"nav-search\">\n <si-search-bar\n class=\"mx-4\"\n colorVariant=\"base-0\"\n prohibitedCharacters=\"*?\"\n [placeholder]=\"searchPlaceholder() | translate\"\n [debounceTime]=\"searchInputDelay\"\n [showIcon]=\"true\"\n (searchChange)=\"doSearch($event)\"\n />\n <button\n type=\"button\"\n class=\"btn-search bg-base-0 p-2 mx-4 mobile navbar-vertical-no-collapse text-secondary\"\n [attr.aria-label]=\"searchPlaceholder() | translate\"\n (click)=\"expandForSearch()\"\n >\n <i class=\"icon element-search\"></i>\n </button>\n </div>\n }\n <div class=\"nav-scroll\">\n @for (item of items(); track $index) {\n @if (isLegacyStyle(item)) {\n <si-navbar-vertical-item-legacy\n [item]=\"item\"\n [navbarExpandButtonText]=\"navbarExpandButtonText() | translate\"\n [navbarCollapseButtonText]=\"navbarCollapseButtonText() | translate\"\n [expanded]=\"\n (item.id ? uiStateExpandedItems()[item.id] : undefined) ?? item.expanded ?? false\n \"\n />\n } @else {\n <ng-container *ngTemplateOutlet=\"navbarItems; context: { item }\" />\n }\n }\n </div>\n </nav>\n}\n<main\n class=\"si-layout-inner focus-none\"\n tabindex=\"-1\"\n [siSkipLinkTarget]=\"skipLinkMainContentLabel()\"\n>\n <ng-content />\n</main>\n\n<ng-template #navbarItems let-item=\"item\" siNavbarVerticalItemGuard>\n @switch (item.type) {\n @case ('group') {\n <button\n type=\"button\"\n [si-navbar-vertical-item]=\"item\"\n [stateId]=\"item.id\"\n [siNavbarVerticalGroupTriggerFor]=\"group\"\n [groupData]=\"{ group: item }\"\n [expanded]=\"\n (item.id ? uiStateExpandedItems()[item.id] : undefined) ?? item.expanded ?? false\n \"\n >\n {{ item.label | translate }}\n </button>\n }\n @case ('action') {\n <button type=\"button\" [si-navbar-vertical-item]=\"item\" [activeOverride]=\"item.active\">\n {{ item.label | translate }}\n </button>\n }\n @case ('router-link') {\n <a\n routerLinkActive\n [routerLinkActiveOptions]=\"item.activeMatchOptions ?? { exact: false }\"\n [si-navbar-vertical-item]=\"item\"\n [routerLink]=\"item.routerLink\"\n [queryParams]=\"item.extras?.queryParams\"\n [queryParamsHandling]=\"item.extras?.queryParamsHandling\"\n [fragment]=\"item.extras?.fragment\"\n [state]=\"item.extras?.state\"\n [relativeTo]=\"item.extras?.relativeTo ?? this.activatedRoute\"\n [preserveFragment]=\"item.extras?.preserveFragment\"\n [skipLocationChange]=\"item.extras?.skipLocationChange\"\n [replaceUrl]=\"item.extras?.replaceUrl\"\n >\n {{ item.label | translate }}\n </a>\n }\n @case ('link') {\n <a [si-navbar-vertical-item]=\"item\" [href]=\"item.href\" [target]=\"item.target\">\n {{ item.label | translate }}\n </a>\n }\n @case ('divider') {\n <si-navbar-vertical-divider />\n }\n @case ('header') {\n <si-navbar-vertical-header>\n {{ item.label | translate }}\n </si-navbar-vertical-header>\n }\n }\n</ng-template>\n\n<ng-template #group let-group=\"group\" siNavbarVerticalItemGuard>\n <si-navbar-vertical-group routerLinkActive>\n @for (item of group.children; track $index) {\n <!-- a copy from above, but we have to nest the items to make routerLink active work -->\n @switch (item.type) {\n @case ('router-link') {\n <a\n routerLinkActive\n [routerLinkActiveOptions]=\"item.activeMatchOptions ?? { exact: false }\"\n [si-navbar-vertical-item]=\"item\"\n [routerLink]=\"item.routerLink\"\n [queryParams]=\"item.extras?.queryParams\"\n [queryParamsHandling]=\"item.extras?.queryParamsHandling\"\n [fragment]=\"item.extras?.fragment\"\n [state]=\"item.extras?.state\"\n [relativeTo]=\"item.extras?.relativeTo ?? this.activatedRoute\"\n [preserveFragment]=\"item.extras?.preserveFragment\"\n [skipLocationChange]=\"item.extras?.skipLocationChange\"\n [replaceUrl]=\"item.extras?.replaceUrl\"\n >\n {{ item.label | translate }}\n </a>\n }\n @case ('action') {\n <button type=\"button\" [si-navbar-vertical-item]=\"item\" [activeOverride]=\"item.active\">\n {{ item.label | translate }}\n </button>\n }\n @case ('link') {\n <a [si-navbar-vertical-item]=\"item\" [href]=\"item.href\" [target]=\"item.target\">\n {{ item.label | translate }}\n </a>\n }\n }\n }\n </si-navbar-vertical-group>\n</ng-template>\n", styles: [":host{display:block;transition:padding-inline-start calc(.5s * var(--element-animations-enabled, 1));--si-layout-header-first-element-offset: 40px}:host.ready:not(.visible){padding-inline-start:0!important}nav{display:flex;flex-direction:column;position:fixed;z-index:1031;inset-block-start:calc(48px + var(--element-titlebar-spacing, 0px) + var(--element-system-banner-spacing, 0px));inset-block-end:0;inset-inline-start:0;inline-size:0}:host(.nav-collapsed) nav{z-index:1030}.nav-scroll{overflow-x:hidden;min-block-size:0;flex:1 0 0;overflow-y:auto;margin-block-start:8px}:host(.nav-collapsed) .nav-scroll{display:none}.mobile-drawer{display:block;text-align:end;border:0;inline-size:48px;color:var(--element-text-primary);padding-block:4px;padding-inline:8px;margin-block-start:8px;border-start-end-radius:var(--element-radius-2);border-end-end-radius:var(--element-radius-2)}.nav-search{display:flex;align-items:center;block-size:40px;margin-block-start:8px;overflow-x:hidden}:host(.nav-collapsed) .nav-search{display:none}si-search-bar{inline-size:100%}.btn-search{display:none;border:0;border-radius:var(--element-radius-2)}:host.nav-collapsed .mobile-drawer{border:0;color:var(--element-text-primary);background:var(--element-base-1);text-align:end;box-shadow:0 0 4px var(--element-box-shadow-color-1),0 4px 4px var(--element-box-shadow-color-2)}:host.nav-collapsed si-search-bar{display:none}.modal-backdrop{z-index:1031;opacity:0}@media (min-width: 576px){:host:not(.nav-text-only),:host:not(.nav-collapsed){--si-layout-header-first-element-offset: 0}:host:not(.nav-text-only){padding-inline-start:48px}:host:not(.nav-text-only) .mobile-drawer{background:transparent;box-shadow:none}:host:not(.nav-text-only).nav-collapsed .nav-scroll{display:block}:host:not(.nav-text-only).nav-collapsed .nav-search{display:flex}.btn-search{display:none}:host.nav-collapsed .btn-search{display:block}:host:not(.nav-text-only) nav{inline-size:48px}}@media (min-width: 992px){:host:not(.nav-collapsed){padding-inline-start:240px}}\n"], dependencies: [{ kind: "component", type: SiNavbarVerticalItemLegacyComponent, selector: "si-navbar-vertical-item-legacy", inputs: ["item", "navbarExpandButtonText", "navbarCollapseButtonText", "expanded"], outputs: ["expandedChange"] }, { kind: "component", type: SiSearchBarComponent, selector: "si-search-bar", inputs: ["debounceTime", "prohibitedCharacters", "placeholder", "showIcon", "tabbable", "value", "readonly", "colorVariant", "disabled"], outputs: ["searchChange"] }, { kind: "directive", type: SiSkipLinkTargetDirective, selector: "[siSkipLinkTarget]", inputs: ["siSkipLinkTarget"] }, { kind: "ngmodule", type: SiTranslateModule }, { kind: "pipe", type: i1.SiTranslatePipe, name: "translate" }, { kind: "component", type: SiNavbarVerticalItemComponent, selector: "a[si-navbar-vertical-item], button[si-navbar-vertical-item]", inputs: ["si-navbar-vertical-item", "activeOverride"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: SiNavbarVerticalItemGuardDirective, selector: "[siNavbarVerticalItemGuard]" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: SiNavbarVerticalGroupComponent, selector: "si-navbar-vertical-group" }, { kind: "directive", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "directive", type: SiNavbarVerticalGroupTriggerDirective, selector: "button[siNavbarVerticalGroupTriggerFor]", inputs: ["siNavbarVerticalGroupTriggerFor", "groupData", "stateId", "expanded"], outputs: ["expandedChange"] }, { kind: "component", type: SiNavbarVerticalDividerComponent, selector: "si-navbar-vertical-divider" }, { kind: "component", type: SiNavbarVerticalHeaderComponent, selector: "si-navbar-vertical-header" }], animations: [
|
|
663
|
+
trigger('collapse', [
|
|
664
|
+
state('expanded', style({ 'inline-size': '240px' })),
|
|
665
|
+
state('collapsed', style({ 'inline-size': '*' })),
|
|
666
|
+
transition('collapsed => expanded', [
|
|
667
|
+
group([
|
|
668
|
+
animate('0.5s ease'),
|
|
669
|
+
query('si-navbar-vertical-group, si-navbar-vertical-header', animateChild(), {
|
|
670
|
+
optional: true
|
|
671
|
+
}),
|
|
672
|
+
query('.dropdown-caret', [style({ 'opacity': '0' }), animate('0.5s ease', style({ 'opacity': '1' }))], { optional: true }),
|
|
673
|
+
query('.mobile-drawer', style({ 'box-shadow': 'none', background: 'var(--element-base-1)' })),
|
|
674
|
+
query('.mobile-drawer', [
|
|
675
|
+
style({ 'inline-size': '*', 'box-shadow': '*' }),
|
|
676
|
+
animate('0.5s ease', style({ 'inline-size': '240px' })),
|
|
677
|
+
style({ 'inline-size': '240px' })
|
|
678
|
+
])
|
|
679
|
+
])
|
|
680
|
+
]),
|
|
681
|
+
transition('expanded => collapsed', [
|
|
682
|
+
query('.nav-search', style({ 'display': 'flex' }), { optional: true }),
|
|
683
|
+
query('.nav-scroll', style({ 'display': 'block' })),
|
|
684
|
+
group([
|
|
685
|
+
animate('0.5s ease'),
|
|
686
|
+
query('si-navbar-vertical-group, si-navbar-vertical-header', animateChild(), {
|
|
687
|
+
optional: true
|
|
688
|
+
}),
|
|
689
|
+
query('.section-item', style({ visibility: 'hidden' }), { optional: true }),
|
|
690
|
+
query('si-navbar-vertical-group', style({ visibility: 'hidden' }), { optional: true }),
|
|
691
|
+
query('.mobile-drawer', [
|
|
692
|
+
style({ 'inline-size': '240px', 'box-shadow': 'none' }),
|
|
693
|
+
animate('0.5s ease', style({ 'inline-size': '*' })),
|
|
694
|
+
style({ 'inline-size': '*' })
|
|
695
|
+
])
|
|
696
|
+
])
|
|
697
|
+
])
|
|
698
|
+
]),
|
|
699
|
+
trigger('backdrop', [
|
|
700
|
+
state('show', style({ 'opacity': '1' })),
|
|
701
|
+
state('hide', style({ 'opacity': '0' })),
|
|
702
|
+
transition('* <=> *', [animate('0.15s linear')])
|
|
703
|
+
])
|
|
704
|
+
] });
|
|
705
|
+
}
|
|
706
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiNavbarVerticalComponent, decorators: [{
|
|
707
|
+
type: Component,
|
|
708
|
+
args: [{ selector: 'si-navbar-vertical', host: {
|
|
709
|
+
class: 'si-layout-inner',
|
|
710
|
+
'[class.nav-collapsed]': 'collapsed()',
|
|
711
|
+
'[class.nav-text-only]': 'textOnly()',
|
|
712
|
+
'[class.visible]': 'visible()'
|
|
713
|
+
}, providers: [{ provide: SI_NAVBAR_VERTICAL, useExisting: SiNavbarVerticalComponent }], animations: [
|
|
714
|
+
trigger('collapse', [
|
|
715
|
+
state('expanded', style({ 'inline-size': '240px' })),
|
|
716
|
+
state('collapsed', style({ 'inline-size': '*' })),
|
|
717
|
+
transition('collapsed => expanded', [
|
|
718
|
+
group([
|
|
719
|
+
animate('0.5s ease'),
|
|
720
|
+
query('si-navbar-vertical-group, si-navbar-vertical-header', animateChild(), {
|
|
721
|
+
optional: true
|
|
722
|
+
}),
|
|
723
|
+
query('.dropdown-caret', [style({ 'opacity': '0' }), animate('0.5s ease', style({ 'opacity': '1' }))], { optional: true }),
|
|
724
|
+
query('.mobile-drawer', style({ 'box-shadow': 'none', background: 'var(--element-base-1)' })),
|
|
725
|
+
query('.mobile-drawer', [
|
|
726
|
+
style({ 'inline-size': '*', 'box-shadow': '*' }),
|
|
727
|
+
animate('0.5s ease', style({ 'inline-size': '240px' })),
|
|
728
|
+
style({ 'inline-size': '240px' })
|
|
729
|
+
])
|
|
730
|
+
])
|
|
731
|
+
]),
|
|
732
|
+
transition('expanded => collapsed', [
|
|
733
|
+
query('.nav-search', style({ 'display': 'flex' }), { optional: true }),
|
|
734
|
+
query('.nav-scroll', style({ 'display': 'block' })),
|
|
735
|
+
group([
|
|
736
|
+
animate('0.5s ease'),
|
|
737
|
+
query('si-navbar-vertical-group, si-navbar-vertical-header', animateChild(), {
|
|
738
|
+
optional: true
|
|
739
|
+
}),
|
|
740
|
+
query('.section-item', style({ visibility: 'hidden' }), { optional: true }),
|
|
741
|
+
query('si-navbar-vertical-group', style({ visibility: 'hidden' }), { optional: true }),
|
|
742
|
+
query('.mobile-drawer', [
|
|
743
|
+
style({ 'inline-size': '240px', 'box-shadow': 'none' }),
|
|
744
|
+
animate('0.5s ease', style({ 'inline-size': '*' })),
|
|
745
|
+
style({ 'inline-size': '*' })
|
|
746
|
+
])
|
|
747
|
+
])
|
|
748
|
+
])
|
|
749
|
+
]),
|
|
750
|
+
trigger('backdrop', [
|
|
751
|
+
state('show', style({ 'opacity': '1' })),
|
|
752
|
+
state('hide', style({ 'opacity': '0' })),
|
|
753
|
+
transition('* <=> *', [animate('0.15s linear')])
|
|
754
|
+
])
|
|
755
|
+
], imports: [
|
|
756
|
+
SiNavbarVerticalItemLegacyComponent,
|
|
757
|
+
SiSearchBarComponent,
|
|
758
|
+
SiSkipLinkTargetDirective,
|
|
759
|
+
SiTranslateModule,
|
|
760
|
+
SiNavbarVerticalItemComponent,
|
|
761
|
+
RouterLink,
|
|
762
|
+
SiNavbarVerticalItemGuardDirective,
|
|
763
|
+
NgTemplateOutlet,
|
|
764
|
+
SiNavbarVerticalGroupComponent,
|
|
765
|
+
RouterLinkActive,
|
|
766
|
+
SiNavbarVerticalGroupTriggerDirective,
|
|
767
|
+
SiNavbarVerticalDividerComponent,
|
|
768
|
+
SiNavbarVerticalHeaderComponent
|
|
769
|
+
], template: "@if (visible()) {\n @if (smallScreen() && !collapsed()) {\n <div\n class=\"modal-backdrop\"\n [@backdrop]=\"smallScreen() && !collapsed() ? 'show' : 'hide'\"\n (click)=\"toggleCollapse()\"\n ></div>\n }\n <nav\n tabindex=\"-1\"\n class=\"bg-base-1 focus-sub-inside\"\n [siSkipLinkTarget]=\"skipLinkNavigationLabel()\"\n [@collapse]=\"collapsed() ? 'collapsed' : 'expanded'\"\n [class.text-only]=\"textOnly()\"\n >\n <div class=\"collapse-toggle ms-auto\">\n <div class=\"mobile-drawer focus-inside navbar-vertical-no-collapse\">\n <button\n type=\"button\"\n class=\"btn btn-circle btn-sm btn-ghost flip-rtl\"\n [class.element-double-left]=\"!collapsed()\"\n [class.element-double-right]=\"collapsed()\"\n [attr.aria-label]=\"\n (collapsed() ? navbarExpandButtonText() : navbarCollapseButtonText()) | translate\n \"\n [attr.aria-expanded]=\"!collapsed()\"\n (click)=\"toggleCollapse()\"\n >\n </button>\n </div>\n </div>\n @if (searchable()) {\n <div class=\"nav-search\">\n <si-search-bar\n class=\"mx-4\"\n colorVariant=\"base-0\"\n prohibitedCharacters=\"*?\"\n [placeholder]=\"searchPlaceholder() | translate\"\n [debounceTime]=\"searchInputDelay\"\n [showIcon]=\"true\"\n (searchChange)=\"doSearch($event)\"\n />\n <button\n type=\"button\"\n class=\"btn-search bg-base-0 p-2 mx-4 mobile navbar-vertical-no-collapse text-secondary\"\n [attr.aria-label]=\"searchPlaceholder() | translate\"\n (click)=\"expandForSearch()\"\n >\n <i class=\"icon element-search\"></i>\n </button>\n </div>\n }\n <div class=\"nav-scroll\">\n @for (item of items(); track $index) {\n @if (isLegacyStyle(item)) {\n <si-navbar-vertical-item-legacy\n [item]=\"item\"\n [navbarExpandButtonText]=\"navbarExpandButtonText() | translate\"\n [navbarCollapseButtonText]=\"navbarCollapseButtonText() | translate\"\n [expanded]=\"\n (item.id ? uiStateExpandedItems()[item.id] : undefined) ?? item.expanded ?? false\n \"\n />\n } @else {\n <ng-container *ngTemplateOutlet=\"navbarItems; context: { item }\" />\n }\n }\n </div>\n </nav>\n}\n<main\n class=\"si-layout-inner focus-none\"\n tabindex=\"-1\"\n [siSkipLinkTarget]=\"skipLinkMainContentLabel()\"\n>\n <ng-content />\n</main>\n\n<ng-template #navbarItems let-item=\"item\" siNavbarVerticalItemGuard>\n @switch (item.type) {\n @case ('group') {\n <button\n type=\"button\"\n [si-navbar-vertical-item]=\"item\"\n [stateId]=\"item.id\"\n [siNavbarVerticalGroupTriggerFor]=\"group\"\n [groupData]=\"{ group: item }\"\n [expanded]=\"\n (item.id ? uiStateExpandedItems()[item.id] : undefined) ?? item.expanded ?? false\n \"\n >\n {{ item.label | translate }}\n </button>\n }\n @case ('action') {\n <button type=\"button\" [si-navbar-vertical-item]=\"item\" [activeOverride]=\"item.active\">\n {{ item.label | translate }}\n </button>\n }\n @case ('router-link') {\n <a\n routerLinkActive\n [routerLinkActiveOptions]=\"item.activeMatchOptions ?? { exact: false }\"\n [si-navbar-vertical-item]=\"item\"\n [routerLink]=\"item.routerLink\"\n [queryParams]=\"item.extras?.queryParams\"\n [queryParamsHandling]=\"item.extras?.queryParamsHandling\"\n [fragment]=\"item.extras?.fragment\"\n [state]=\"item.extras?.state\"\n [relativeTo]=\"item.extras?.relativeTo ?? this.activatedRoute\"\n [preserveFragment]=\"item.extras?.preserveFragment\"\n [skipLocationChange]=\"item.extras?.skipLocationChange\"\n [replaceUrl]=\"item.extras?.replaceUrl\"\n >\n {{ item.label | translate }}\n </a>\n }\n @case ('link') {\n <a [si-navbar-vertical-item]=\"item\" [href]=\"item.href\" [target]=\"item.target\">\n {{ item.label | translate }}\n </a>\n }\n @case ('divider') {\n <si-navbar-vertical-divider />\n }\n @case ('header') {\n <si-navbar-vertical-header>\n {{ item.label | translate }}\n </si-navbar-vertical-header>\n }\n }\n</ng-template>\n\n<ng-template #group let-group=\"group\" siNavbarVerticalItemGuard>\n <si-navbar-vertical-group routerLinkActive>\n @for (item of group.children; track $index) {\n <!-- a copy from above, but we have to nest the items to make routerLink active work -->\n @switch (item.type) {\n @case ('router-link') {\n <a\n routerLinkActive\n [routerLinkActiveOptions]=\"item.activeMatchOptions ?? { exact: false }\"\n [si-navbar-vertical-item]=\"item\"\n [routerLink]=\"item.routerLink\"\n [queryParams]=\"item.extras?.queryParams\"\n [queryParamsHandling]=\"item.extras?.queryParamsHandling\"\n [fragment]=\"item.extras?.fragment\"\n [state]=\"item.extras?.state\"\n [relativeTo]=\"item.extras?.relativeTo ?? this.activatedRoute\"\n [preserveFragment]=\"item.extras?.preserveFragment\"\n [skipLocationChange]=\"item.extras?.skipLocationChange\"\n [replaceUrl]=\"item.extras?.replaceUrl\"\n >\n {{ item.label | translate }}\n </a>\n }\n @case ('action') {\n <button type=\"button\" [si-navbar-vertical-item]=\"item\" [activeOverride]=\"item.active\">\n {{ item.label | translate }}\n </button>\n }\n @case ('link') {\n <a [si-navbar-vertical-item]=\"item\" [href]=\"item.href\" [target]=\"item.target\">\n {{ item.label | translate }}\n </a>\n }\n }\n }\n </si-navbar-vertical-group>\n</ng-template>\n", styles: [":host{display:block;transition:padding-inline-start calc(.5s * var(--element-animations-enabled, 1));--si-layout-header-first-element-offset: 40px}:host.ready:not(.visible){padding-inline-start:0!important}nav{display:flex;flex-direction:column;position:fixed;z-index:1031;inset-block-start:calc(48px + var(--element-titlebar-spacing, 0px) + var(--element-system-banner-spacing, 0px));inset-block-end:0;inset-inline-start:0;inline-size:0}:host(.nav-collapsed) nav{z-index:1030}.nav-scroll{overflow-x:hidden;min-block-size:0;flex:1 0 0;overflow-y:auto;margin-block-start:8px}:host(.nav-collapsed) .nav-scroll{display:none}.mobile-drawer{display:block;text-align:end;border:0;inline-size:48px;color:var(--element-text-primary);padding-block:4px;padding-inline:8px;margin-block-start:8px;border-start-end-radius:var(--element-radius-2);border-end-end-radius:var(--element-radius-2)}.nav-search{display:flex;align-items:center;block-size:40px;margin-block-start:8px;overflow-x:hidden}:host(.nav-collapsed) .nav-search{display:none}si-search-bar{inline-size:100%}.btn-search{display:none;border:0;border-radius:var(--element-radius-2)}:host.nav-collapsed .mobile-drawer{border:0;color:var(--element-text-primary);background:var(--element-base-1);text-align:end;box-shadow:0 0 4px var(--element-box-shadow-color-1),0 4px 4px var(--element-box-shadow-color-2)}:host.nav-collapsed si-search-bar{display:none}.modal-backdrop{z-index:1031;opacity:0}@media (min-width: 576px){:host:not(.nav-text-only),:host:not(.nav-collapsed){--si-layout-header-first-element-offset: 0}:host:not(.nav-text-only){padding-inline-start:48px}:host:not(.nav-text-only) .mobile-drawer{background:transparent;box-shadow:none}:host:not(.nav-text-only).nav-collapsed .nav-scroll{display:block}:host:not(.nav-text-only).nav-collapsed .nav-search{display:flex}.btn-search{display:none}:host.nav-collapsed .btn-search{display:block}:host:not(.nav-text-only) nav{inline-size:48px}}@media (min-width: 992px){:host:not(.nav-collapsed){padding-inline-start:240px}}\n"] }]
|
|
770
|
+
}], ctorParameters: () => [], propDecorators: { ready: [{
|
|
771
|
+
type: HostBinding,
|
|
772
|
+
args: ['class.ready']
|
|
773
|
+
}] } });
|
|
774
|
+
|
|
775
|
+
/**
|
|
776
|
+
* Copyright Siemens 2016 - 2025.
|
|
777
|
+
* SPDX-License-Identifier: MIT
|
|
778
|
+
*/
|
|
779
|
+
class SiNavbarVerticalModule {
|
|
780
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiNavbarVerticalModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
781
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: SiNavbarVerticalModule, imports: [SiNavbarVerticalComponent], exports: [SiNavbarVerticalComponent] });
|
|
782
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiNavbarVerticalModule, imports: [SiNavbarVerticalComponent] });
|
|
783
|
+
}
|
|
784
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiNavbarVerticalModule, decorators: [{
|
|
785
|
+
type: NgModule,
|
|
786
|
+
args: [{
|
|
787
|
+
imports: [SiNavbarVerticalComponent],
|
|
788
|
+
exports: [SiNavbarVerticalComponent]
|
|
789
|
+
}]
|
|
790
|
+
}] });
|
|
791
|
+
|
|
792
|
+
/**
|
|
793
|
+
* Copyright Siemens 2016 - 2025.
|
|
794
|
+
* SPDX-License-Identifier: MIT
|
|
795
|
+
*/
|
|
796
|
+
|
|
797
|
+
/**
|
|
798
|
+
* Generated bundle index. Do not edit.
|
|
799
|
+
*/
|
|
800
|
+
|
|
801
|
+
export { SiNavbarVerticalComponent, SiNavbarVerticalItemGuardDirective, SiNavbarVerticalModule };
|
|
802
|
+
//# sourceMappingURL=siemens-element-ng-navbar-vertical.mjs.map
|