@siemens/element-ng 51.3.0 → 51.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/siemens-element-ng-breadcrumb.mjs +8 -46
- package/fesm2022/siemens-element-ng-breadcrumb.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-chat-messages.mjs +2 -2
- package/fesm2022/siemens-element-ng-chat-messages.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-common.mjs +5 -0
- package/fesm2022/siemens-element-ng-common.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-dashboard.mjs +2 -3
- package/fesm2022/siemens-element-ng-dashboard.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-filtered-search.mjs +255 -160
- package/fesm2022/siemens-element-ng-filtered-search.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-formly.mjs +12 -8
- package/fesm2022/siemens-element-ng-formly.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-maplibre.mjs +293 -10
- package/fesm2022/siemens-element-ng-maplibre.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-markdown-extensions-katex.mjs +2 -2
- package/fesm2022/siemens-element-ng-markdown-extensions-katex.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-popover.mjs +3 -1
- package/fesm2022/siemens-element-ng-popover.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-shadow-root.mjs +54 -1
- package/fesm2022/siemens-element-ng-shadow-root.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-theme.mjs +59 -23
- package/fesm2022/siemens-element-ng-theme.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-tooltip.mjs +82 -10
- package/fesm2022/siemens-element-ng-tooltip.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-translate.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-tree-view.mjs +2 -2
- package/fesm2022/siemens-element-ng-tree-view.mjs.map +1 -1
- package/maplibre/styles/maplibre-gl.scss +4 -0
- package/package.json +7 -7
- package/template-i18n.json +6 -0
- package/types/siemens-element-ng-breadcrumb.d.ts +1 -1
- package/types/siemens-element-ng-common.d.ts +5 -0
- package/types/siemens-element-ng-dashboard.d.ts +0 -1
- package/types/siemens-element-ng-filtered-search.d.ts +26 -10
- package/types/siemens-element-ng-maplibre.d.ts +112 -5
- package/types/siemens-element-ng-popover.d.ts +1 -0
- package/types/siemens-element-ng-shadow-root.d.ts +16 -1
- package/types/siemens-element-ng-theme.d.ts +35 -7
- package/types/siemens-element-ng-tooltip.d.ts +14 -1
- package/types/siemens-element-ng-translate.d.ts +6 -0
|
@@ -5,6 +5,7 @@ import { elementRight2, elementBreadcrumbRoot } from '@siemens/element-icons';
|
|
|
5
5
|
import { addIcons, SiIconComponent } from '@siemens/element-ng/icon';
|
|
6
6
|
import { SiLinkDirective } from '@siemens/element-ng/link';
|
|
7
7
|
import { SiResizeObserverDirective } from '@siemens/element-ng/resize-observer';
|
|
8
|
+
import { SiTooltipOverflowDirective } from '@siemens/element-ng/tooltip';
|
|
8
9
|
import { t, injectSiTranslateService, SiTranslatePipe } from '@siemens/element-translate-ng/translate';
|
|
9
10
|
import { merge, of } from 'rxjs';
|
|
10
11
|
import { switchMap } from 'rxjs/operators';
|
|
@@ -33,17 +34,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
33
34
|
* Defines how many items should be displayed at the end of the breadcrumb if possible.
|
|
34
35
|
*/
|
|
35
36
|
const NUMBER_OF_SHOWN_ITEMS_AT_END = 2;
|
|
36
|
-
/**
|
|
37
|
-
* Defines how long a display item can be without it being shortened.
|
|
38
|
-
* Cannot be lower than 4.
|
|
39
|
-
* If this is 0, titles will not be shortened
|
|
40
|
-
*/
|
|
41
|
-
const ITEM_MAX_LENGTH = 30;
|
|
42
|
-
/**
|
|
43
|
-
* Defines how many characters of an item are always displayed in the beginning.
|
|
44
|
-
* Must be at least 2 less than ITEM_MAX_LENGTH
|
|
45
|
-
*/
|
|
46
|
-
const ITEM_CHARACTERS_ALWAYS_DISPLAYED_IN_BEGINNING = 10;
|
|
47
37
|
/**
|
|
48
38
|
* Defines the width of the root icon in pixels.
|
|
49
39
|
*/
|
|
@@ -78,7 +68,6 @@ class SiBreadcrumbComponent {
|
|
|
78
68
|
ellipsesLevel = 0;
|
|
79
69
|
// Record to allow for -1 (root).
|
|
80
70
|
breadcrumbDropdownOpen = undefined;
|
|
81
|
-
addExpandDropdown = false;
|
|
82
71
|
controlId = `__si-breadcrumb-${controlIdCounter++}-`;
|
|
83
72
|
icons = addIcons({ elementBreadcrumbRoot, elementRight2 });
|
|
84
73
|
breadcrumbElement = viewChild.required('breadcrumb', /* @ts-ignore */
|
|
@@ -101,29 +90,11 @@ class SiBreadcrumbComponent {
|
|
|
101
90
|
this.translationSubscription = merge(this.translate.translationChange, of(undefined))
|
|
102
91
|
.pipe(switchMap(() => this.translate.translateAsync(this.items().map(item => item.title))))
|
|
103
92
|
.subscribe(translatedTitles => {
|
|
104
|
-
// Add the level
|
|
105
|
-
// If they need to be shortened, shorten them at a convenient place.
|
|
106
|
-
// Set the lastItem tag to true for the last item
|
|
93
|
+
// Add the level and mark the last item, keeping the full translated titles.
|
|
107
94
|
let counter = -1;
|
|
108
95
|
const enumeratedItems = this.items().map(item => {
|
|
109
96
|
counter++;
|
|
110
97
|
const title = translatedTitles[item.title];
|
|
111
|
-
let shortened = false;
|
|
112
|
-
let shortenedTitle = title;
|
|
113
|
-
// If this is not the last item and the title too long, shorten the title
|
|
114
|
-
if (counter !== this.numberOfItems - 1 && title && title.length > ITEM_MAX_LENGTH) {
|
|
115
|
-
shortened = true;
|
|
116
|
-
// This regex gets the last space, dash or underscore.
|
|
117
|
-
const regexMatch = title
|
|
118
|
-
.slice(ITEM_CHARACTERS_ALWAYS_DISPLAYED_IN_BEGINNING, ITEM_MAX_LENGTH - 2)
|
|
119
|
-
.match(/^.*[- _](?=.*?$)/);
|
|
120
|
-
if (regexMatch) {
|
|
121
|
-
shortenedTitle = title.slice(0, ITEM_CHARACTERS_ALWAYS_DISPLAYED_IN_BEGINNING + regexMatch[0].length - 1);
|
|
122
|
-
}
|
|
123
|
-
else {
|
|
124
|
-
shortenedTitle = title.slice(0, ITEM_MAX_LENGTH - 3);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
98
|
// If the root element should be displayed as text, set level not to 0.
|
|
128
99
|
// This is used to distinguish in the template between icon and text.
|
|
129
100
|
const level = counter === 0 && this.showRootAsText() ? -1 : counter;
|
|
@@ -132,8 +103,6 @@ class SiBreadcrumbComponent {
|
|
|
132
103
|
title,
|
|
133
104
|
level,
|
|
134
105
|
hide: false,
|
|
135
|
-
shortened,
|
|
136
|
-
shortenedTitle,
|
|
137
106
|
lastItem: counter === this.numberOfItems - 1
|
|
138
107
|
};
|
|
139
108
|
});
|
|
@@ -154,12 +123,7 @@ class SiBreadcrumbComponent {
|
|
|
154
123
|
this.resetBreadcrumb();
|
|
155
124
|
}
|
|
156
125
|
}
|
|
157
|
-
|
|
158
|
-
* Toggle dropdown (on click of ellipses), either for
|
|
159
|
-
* the general dropdown list if itemLevel is at ellipsesLevel
|
|
160
|
-
* or otherwise the name expansion at the specified item level.
|
|
161
|
-
* Close any open dropdown before opening a new one.
|
|
162
|
-
*/
|
|
126
|
+
/** Toggle the ellipses dropdown to show the hidden breadcrumb levels. */
|
|
163
127
|
toggleBreadcrumbDropdown(itemLevel) {
|
|
164
128
|
this.breadcrumbDropdownOpen = this.breadcrumbDropdownOpen === itemLevel ? undefined : itemLevel;
|
|
165
129
|
}
|
|
@@ -176,8 +140,7 @@ class SiBreadcrumbComponent {
|
|
|
176
140
|
if (this.itemsProcessed) {
|
|
177
141
|
this.numberOfItems = this.items().length;
|
|
178
142
|
// Add an additional the ellipses item to the end of the shownItems (breadcrumb items).
|
|
179
|
-
|
|
180
|
-
const ellipsesItem = { title: '...', level: this.numberOfItems, shortenedTitle: '' };
|
|
143
|
+
const ellipsesItem = { title: '...', level: this.numberOfItems };
|
|
181
144
|
this.itemsShown.push(ellipsesItem);
|
|
182
145
|
if (this.breadcrumbShortened) {
|
|
183
146
|
// If the breadcrumb was shortened before, remove the ellipses and add back itemsHidden (breadcrumb dropdown items).
|
|
@@ -185,14 +148,12 @@ class SiBreadcrumbComponent {
|
|
|
185
148
|
this.itemsShown.splice(this.ellipsesLevel, 1, ...this.itemsHidden);
|
|
186
149
|
this.itemsHidden = [];
|
|
187
150
|
}
|
|
188
|
-
this.addExpandDropdown = false;
|
|
189
151
|
// Wait for the next change detection cycle to measure the updated item length.
|
|
190
152
|
this.changeDetector.detectChanges();
|
|
191
153
|
this.calculateBreadcrumb();
|
|
192
154
|
}
|
|
193
155
|
}
|
|
194
156
|
calculateBreadcrumb() {
|
|
195
|
-
this.addExpandDropdown = true;
|
|
196
157
|
const maxWidth = this.breadcrumbElement().nativeElement.clientWidth;
|
|
197
158
|
const breadcrumbElementsList = this.breadcrumbElements().map(item => item);
|
|
198
159
|
// Measure the length of the last additional ellipses item, then remove it from itemsShown (breadcrumb items).
|
|
@@ -252,14 +213,14 @@ class SiBreadcrumbComponent {
|
|
|
252
213
|
if (this.breadcrumbShortened) {
|
|
253
214
|
this.ellipsesLevel = counter;
|
|
254
215
|
this.itemsHidden = this.itemsShown.slice(this.ellipsesLevel, reverseCounter);
|
|
255
|
-
const ellipsesItem = { title: '...', level: this.ellipsesLevel
|
|
216
|
+
const ellipsesItem = { title: '...', level: this.ellipsesLevel };
|
|
256
217
|
this.itemsShown.splice(this.ellipsesLevel, reverseCounter - this.ellipsesLevel, ellipsesItem);
|
|
257
218
|
}
|
|
258
219
|
// Manually detect changes to prevent them from not being detected on language change
|
|
259
220
|
this.changeDetector.detectChanges();
|
|
260
221
|
}
|
|
261
222
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiBreadcrumbComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
262
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: SiBreadcrumbComponent, isStandalone: true, selector: "si-breadcrumb", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, showRootAsText: { classPropertyName: "showRootAsText", publicName: "showRootAsText", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "document:click": "documentClick($event.target)" } }, viewQueries: [{ propertyName: "breadcrumbElement", first: true, predicate: ["breadcrumb"], descendants: true, isSignal: true }, { propertyName: "breadcrumbElements", predicate: ["breadcrumbItem"], descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "<nav class=\"py-2\" [attr.aria-label]=\"ariaLabel() | translate\">\n <ol #breadcrumb class=\"breadcrumb\" (siResizeObserver)=\"resetBreadcrumb()\">\n @for (item of itemsShown; track $index; let isFirst = $first) {\n @if (!breadcrumbShortened || item.level !== ellipsesLevel) {\n
|
|
223
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: SiBreadcrumbComponent, isStandalone: true, selector: "si-breadcrumb", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, showRootAsText: { classPropertyName: "showRootAsText", publicName: "showRootAsText", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "document:click": "documentClick($event.target)" } }, viewQueries: [{ propertyName: "breadcrumbElement", first: true, predicate: ["breadcrumb"], descendants: true, isSignal: true }, { propertyName: "breadcrumbElements", predicate: ["breadcrumbItem"], descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "<nav class=\"py-2\" [attr.aria-label]=\"ariaLabel() | translate\">\n <ol #breadcrumb class=\"breadcrumb\" (siResizeObserver)=\"resetBreadcrumb()\">\n @for (item of itemsShown; track $index; let isFirst = $first) {\n @if (!breadcrumbShortened || item.level !== ellipsesLevel) {\n <li #breadcrumbItem class=\"item\" [class.current-item]=\"item.lastItem\">\n @if (!isFirst) {\n <si-icon class=\"d-block icon-sm separator flip-rtl\" [icon]=\"icons.elementRight2\" />\n }\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { item: item }\" />\n </li>\n }\n @if (breadcrumbShortened && item.level === ellipsesLevel) {\n <li class=\"item breadcrumb-ellipses-item\">\n @if (!isFirst) {\n <si-icon class=\"d-block icon-sm separator flip-rtl\" [icon]=\"icons.elementRight2\" />\n }\n <div class=\"breadcrumb-dropdown-wrapper\">\n <ng-container *ngTemplateOutlet=\"toggleTemplate; context: { item: item }\" />\n <div\n class=\"dropdown-menu\"\n role=\"menu\"\n [id]=\"controlId + item.level\"\n [class.show]=\"breadcrumbDropdownOpen === item.level\"\n >\n @for (item of itemsHidden; track $index) {\n <ng-container *ngTemplateOutlet=\"dropdownTemplate; context: { item: item }\" />\n }\n </div>\n </div>\n </li>\n }\n }\n </ol>\n</nav>\n\n<ng-template #itemTemplate let-item=\"item\" siBreadcrumbItemTemplate>\n <a\n class=\"breadcrumb-link text-nowrap\"\n activeClass=\"active\"\n ariaCurrent=\"page\"\n siTooltipOverflow\n [class.disable-router-link]=\"!item.link && !item.action && !item.href\"\n [class.text-secondary]=\"item.lastItem\"\n [siLink]=\"item\"\n [exactMatch]=\"true\"\n [attr.aria-label]=\"item.title\"\n [attr.aria-disabled]=\"!item.link && !item.href && !item.action\"\n >\n @if (item.level === 0) {\n <si-icon class=\"d-block icon-sm flip-rtl\" [icon]=\"icons.elementBreadcrumbRoot\" />\n } @else {\n <span>{{ item.title }}</span>\n }\n </a>\n</ng-template>\n\n<ng-template #toggleTemplate let-item=\"item\" siBreadcrumbItemTemplate>\n <button\n type=\"button\"\n class=\"btn btn-link\"\n aria-haspopup=\"true\"\n [attr.aria-controls]=\"controlId + item.level\"\n [attr.aria-expanded]=\"breadcrumbDropdownOpen === item.level\"\n (click)=\"toggleBreadcrumbDropdown(item.level)\"\n >...</button\n >\n</ng-template>\n\n<ng-template #dropdownTemplate let-item=\"item\" siBreadcrumbItemTemplate>\n <a\n class=\"dropdown-item breadcrumb-link focus-inside\"\n activeClass=\"active\"\n ariaCurrent=\"page\"\n role=\"menuitem\"\n [class.disable-router-link]=\"!item.link && !item.action && !item.href\"\n [siLink]=\"item\"\n [exactMatch]=\"true\"\n [attr.aria-disabled]=\"!item.link && !item.action && !item.href\"\n >{{ item.title }}</a\n >\n</ng-template>\n", styles: [".breadcrumb{flex-wrap:nowrap}.item{display:flex;align-items:center;flex-shrink:0}.item:not(.current-item) .breadcrumb-link{max-inline-size:24ch}.separator{color:var(--si-sys-color-text-secondary);margin-block:0;margin-inline:0}.disable-router-link,.disable-router-link:hover{pointer-events:none;color:var(--si-sys-color-text-disabled)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: SiIconComponent, selector: "si-icon", inputs: ["icon"] }, { kind: "directive", type: SiLinkDirective, selector: "[siLink]", inputs: ["siLink", "siLinkDefaultTarget", "actionParam", "activeClass", "exactMatch", "ariaCurrent"], outputs: ["activeChange"], exportAs: ["siLink"] }, { kind: "directive", type: SiResizeObserverDirective, selector: "[siResizeObserver]", inputs: ["resizeThrottle", "emitInitial"], outputs: ["siResizeObserver"] }, { kind: "directive", type: SiTooltipOverflowDirective, selector: "[siTooltipOverflow]" }, { kind: "directive", type: SiBreadcrumbItemTemplateDirective, selector: "[siBreadcrumbItemTemplate]" }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
263
224
|
}
|
|
264
225
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiBreadcrumbComponent, decorators: [{
|
|
265
226
|
type: Component,
|
|
@@ -268,9 +229,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
268
229
|
SiIconComponent,
|
|
269
230
|
SiLinkDirective,
|
|
270
231
|
SiResizeObserverDirective,
|
|
232
|
+
SiTooltipOverflowDirective,
|
|
271
233
|
SiTranslatePipe,
|
|
272
234
|
SiBreadcrumbItemTemplateDirective
|
|
273
|
-
], changeDetection: ChangeDetectionStrategy.Eager, template: "<nav class=\"py-2\" [attr.aria-label]=\"ariaLabel() | translate\">\n <ol #breadcrumb class=\"breadcrumb\" (siResizeObserver)=\"resetBreadcrumb()\">\n @for (item of itemsShown; track $index; let isFirst = $first) {\n @if (!breadcrumbShortened || item.level !== ellipsesLevel) {\n
|
|
235
|
+
], changeDetection: ChangeDetectionStrategy.Eager, template: "<nav class=\"py-2\" [attr.aria-label]=\"ariaLabel() | translate\">\n <ol #breadcrumb class=\"breadcrumb\" (siResizeObserver)=\"resetBreadcrumb()\">\n @for (item of itemsShown; track $index; let isFirst = $first) {\n @if (!breadcrumbShortened || item.level !== ellipsesLevel) {\n <li #breadcrumbItem class=\"item\" [class.current-item]=\"item.lastItem\">\n @if (!isFirst) {\n <si-icon class=\"d-block icon-sm separator flip-rtl\" [icon]=\"icons.elementRight2\" />\n }\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { item: item }\" />\n </li>\n }\n @if (breadcrumbShortened && item.level === ellipsesLevel) {\n <li class=\"item breadcrumb-ellipses-item\">\n @if (!isFirst) {\n <si-icon class=\"d-block icon-sm separator flip-rtl\" [icon]=\"icons.elementRight2\" />\n }\n <div class=\"breadcrumb-dropdown-wrapper\">\n <ng-container *ngTemplateOutlet=\"toggleTemplate; context: { item: item }\" />\n <div\n class=\"dropdown-menu\"\n role=\"menu\"\n [id]=\"controlId + item.level\"\n [class.show]=\"breadcrumbDropdownOpen === item.level\"\n >\n @for (item of itemsHidden; track $index) {\n <ng-container *ngTemplateOutlet=\"dropdownTemplate; context: { item: item }\" />\n }\n </div>\n </div>\n </li>\n }\n }\n </ol>\n</nav>\n\n<ng-template #itemTemplate let-item=\"item\" siBreadcrumbItemTemplate>\n <a\n class=\"breadcrumb-link text-nowrap\"\n activeClass=\"active\"\n ariaCurrent=\"page\"\n siTooltipOverflow\n [class.disable-router-link]=\"!item.link && !item.action && !item.href\"\n [class.text-secondary]=\"item.lastItem\"\n [siLink]=\"item\"\n [exactMatch]=\"true\"\n [attr.aria-label]=\"item.title\"\n [attr.aria-disabled]=\"!item.link && !item.href && !item.action\"\n >\n @if (item.level === 0) {\n <si-icon class=\"d-block icon-sm flip-rtl\" [icon]=\"icons.elementBreadcrumbRoot\" />\n } @else {\n <span>{{ item.title }}</span>\n }\n </a>\n</ng-template>\n\n<ng-template #toggleTemplate let-item=\"item\" siBreadcrumbItemTemplate>\n <button\n type=\"button\"\n class=\"btn btn-link\"\n aria-haspopup=\"true\"\n [attr.aria-controls]=\"controlId + item.level\"\n [attr.aria-expanded]=\"breadcrumbDropdownOpen === item.level\"\n (click)=\"toggleBreadcrumbDropdown(item.level)\"\n >...</button\n >\n</ng-template>\n\n<ng-template #dropdownTemplate let-item=\"item\" siBreadcrumbItemTemplate>\n <a\n class=\"dropdown-item breadcrumb-link focus-inside\"\n activeClass=\"active\"\n ariaCurrent=\"page\"\n role=\"menuitem\"\n [class.disable-router-link]=\"!item.link && !item.action && !item.href\"\n [siLink]=\"item\"\n [exactMatch]=\"true\"\n [attr.aria-disabled]=\"!item.link && !item.action && !item.href\"\n >{{ item.title }}</a\n >\n</ng-template>\n", styles: [".breadcrumb{flex-wrap:nowrap}.item{display:flex;align-items:center;flex-shrink:0}.item:not(.current-item) .breadcrumb-link{max-inline-size:24ch}.separator{color:var(--si-sys-color-text-secondary);margin-block:0;margin-inline:0}.disable-router-link,.disable-router-link:hover{pointer-events:none;color:var(--si-sys-color-text-disabled)}\n"] }]
|
|
274
236
|
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }], showRootAsText: [{ type: i0.Input, args: [{ isSignal: true, alias: "showRootAsText", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], breadcrumbElement: [{ type: i0.ViewChild, args: ['breadcrumb', { isSignal: true }] }], breadcrumbElements: [{ type: i0.ViewChildren, args: ['breadcrumbItem', { isSignal: true }] }], documentClick: [{
|
|
275
237
|
type: HostListener,
|
|
276
238
|
args: ['document:click', ['$event.target']]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"siemens-element-ng-breadcrumb.mjs","sources":["../../../../projects/element-ng/breadcrumb/si-breadcrumb-item-template.directive.ts","../../../../projects/element-ng/breadcrumb/si-breadcrumb.component.ts","../../../../projects/element-ng/breadcrumb/si-breadcrumb.component.html","../../../../projects/element-ng/breadcrumb/si-breadcrumb.module.ts","../../../../projects/element-ng/breadcrumb/index.ts","../../../../projects/element-ng/breadcrumb/siemens-element-ng-breadcrumb.ts"],"sourcesContent":["/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { Directive } from '@angular/core';\n\nimport { EnumeratedBreadcrumbItem } from './breadcrumb-item.model';\n\n@Directive({ selector: '[siBreadcrumbItemTemplate]' })\nexport class SiBreadcrumbItemTemplateDirective {\n static ngTemplateContextGuard(\n directive: SiBreadcrumbItemTemplateDirective,\n context: unknown\n ): context is { item: EnumeratedBreadcrumbItem; title?: string } {\n return true;\n }\n}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n HostListener,\n inject,\n input,\n OnChanges,\n OnDestroy,\n viewChild,\n viewChildren\n} from '@angular/core';\nimport { elementBreadcrumbRoot, elementRight2 } from '@siemens/element-icons';\nimport { addIcons, SiIconComponent } from '@siemens/element-ng/icon';\nimport { SiLinkDirective } from '@siemens/element-ng/link';\nimport { SiResizeObserverDirective } from '@siemens/element-ng/resize-observer';\nimport {\n injectSiTranslateService,\n SiTranslatePipe,\n t\n} from '@siemens/element-translate-ng/translate';\nimport { merge, of, Subscription } from 'rxjs';\nimport { switchMap } from 'rxjs/operators';\n\nimport { BreadcrumbItem, EnumeratedBreadcrumbItem } from './breadcrumb-item.model';\nimport { SiBreadcrumbItemTemplateDirective } from './si-breadcrumb-item-template.directive';\n\n/**\n * Defines how many items should be displayed at the end of the breadcrumb if possible.\n */\nconst NUMBER_OF_SHOWN_ITEMS_AT_END = 2;\n\n/**\n * Defines how long a display item can be without it being shortened.\n * Cannot be lower than 4.\n * If this is 0, titles will not be shortened\n */\nconst ITEM_MAX_LENGTH = 30;\n\n/**\n * Defines how many characters of an item are always displayed in the beginning.\n * Must be at least 2 less than ITEM_MAX_LENGTH\n */\nconst ITEM_CHARACTERS_ALWAYS_DISPLAYED_IN_BEGINNING = 10;\n\n/**\n * Defines the width of the root icon in pixels.\n */\nconst ROOT_ICON_WIDTH = 24;\n\nlet controlIdCounter = 1;\n\n@Component({\n selector: 'si-breadcrumb',\n imports: [\n NgTemplateOutlet,\n SiIconComponent,\n SiLinkDirective,\n SiResizeObserverDirective,\n SiTranslatePipe,\n SiBreadcrumbItemTemplateDirective\n ],\n templateUrl: './si-breadcrumb.component.html',\n styleUrl: './si-breadcrumb.component.scss',\n changeDetection: ChangeDetectionStrategy.Eager\n})\nexport class SiBreadcrumbComponent implements OnChanges, OnDestroy {\n /** Array of breadcrumb items. */\n readonly items = input.required<BreadcrumbItem[]>();\n /**\n * Shows the \"root\" route as the provided title string instead of an icon.\n *\n * @defaultValue false\n */\n readonly showRootAsText = input(false, { transform: booleanAttribute });\n /**\n * Aria label for the main breadcrumb navigation. Needed for a11y.\n *\n * @defaultValue\n * ```\n * t(() => $localize`:@@SI_BREADCRUMB:Breadcrumb navigation`)\n * ```\n */\n readonly ariaLabel = input(t(() => $localize`:@@SI_BREADCRUMB:Breadcrumb navigation`));\n\n private translationSubscription?: Subscription;\n private itemsProcessed = false;\n private numberOfItems = 0;\n\n protected itemsShown: EnumeratedBreadcrumbItem[] = [];\n protected itemsHidden: EnumeratedBreadcrumbItem[] = [];\n protected breadcrumbShortened = false;\n protected ellipsesLevel = 0;\n // Record to allow for -1 (root).\n protected breadcrumbDropdownOpen: number | undefined = undefined;\n protected addExpandDropdown = false;\n protected controlId = `__si-breadcrumb-${controlIdCounter++}-`;\n protected readonly icons = addIcons({ elementBreadcrumbRoot, elementRight2 });\n\n private readonly breadcrumbElement = viewChild.required<ElementRef>('breadcrumb');\n private readonly breadcrumbElements = viewChildren<ElementRef>('breadcrumbItem');\n\n private changeDetector = inject(ChangeDetectorRef);\n private translate = injectSiTranslateService();\n\n ngOnChanges(): void {\n // Reprocess items on every change and on init\n this.processItems();\n }\n\n ngOnDestroy(): void {\n this.translationSubscription?.unsubscribe();\n }\n\n private processItems(): void {\n this.numberOfItems = this.items().length;\n\n this.translationSubscription?.unsubscribe();\n if (this.numberOfItems) {\n this.translationSubscription = merge(this.translate.translationChange, of(undefined))\n .pipe(switchMap(() => this.translate.translateAsync(this.items().map(item => item.title))))\n .subscribe(translatedTitles => {\n // Add the level to the items and check if they need to be shortened.\n // If they need to be shortened, shorten them at a convenient place.\n // Set the lastItem tag to true for the last item\n let counter = -1;\n const enumeratedItems = this.items().map(item => {\n counter++;\n const title = translatedTitles[item.title];\n let shortened = false;\n let shortenedTitle = title;\n // If this is not the last item and the title too long, shorten the title\n if (counter !== this.numberOfItems - 1 && title && title.length > ITEM_MAX_LENGTH) {\n shortened = true;\n // This regex gets the last space, dash or underscore.\n const regexMatch = title\n .slice(ITEM_CHARACTERS_ALWAYS_DISPLAYED_IN_BEGINNING, ITEM_MAX_LENGTH - 2)\n .match(/^.*[- _](?=.*?$)/);\n if (regexMatch) {\n shortenedTitle = title.slice(\n 0,\n ITEM_CHARACTERS_ALWAYS_DISPLAYED_IN_BEGINNING + regexMatch[0].length - 1\n );\n } else {\n shortenedTitle = title.slice(0, ITEM_MAX_LENGTH - 3);\n }\n }\n\n // If the root element should be displayed as text, set level not to 0.\n // This is used to distinguish in the template between icon and text.\n const level = counter === 0 && this.showRootAsText() ? -1 : counter;\n\n return {\n ...item,\n title,\n level,\n hide: false,\n shortened,\n shortenedTitle,\n lastItem: counter === this.numberOfItems - 1\n };\n });\n this.itemsShown = enumeratedItems;\n this.itemsHidden = [];\n this.breadcrumbShortened = false;\n this.breadcrumbDropdownOpen = undefined;\n this.itemsProcessed = true;\n this.resetBreadcrumb();\n });\n } else {\n this.itemsShown = [];\n this.itemsHidden = [];\n this.breadcrumbShortened = false;\n this.breadcrumbDropdownOpen = undefined;\n this.itemsProcessed = true;\n this.resetBreadcrumb();\n }\n }\n\n /*\n * Toggle dropdown (on click of ellipses), either for\n * the general dropdown list if itemLevel is at ellipsesLevel\n * or otherwise the name expansion at the specified item level.\n * Close any open dropdown before opening a new one.\n */\n protected toggleBreadcrumbDropdown(itemLevel: number): void {\n this.breadcrumbDropdownOpen = this.breadcrumbDropdownOpen === itemLevel ? undefined : itemLevel;\n }\n\n // Close dropdown on click anywhere else\n @HostListener('document:click', ['$event.target'])\n protected documentClick(targetElement: any): void {\n if (this.breadcrumbDropdownOpen) {\n if (!this.breadcrumbElement().nativeElement.contains(targetElement)) {\n // Close all dropdowns.\n this.breadcrumbDropdownOpen = undefined;\n }\n }\n }\n\n protected resetBreadcrumb(): void {\n if (this.itemsProcessed) {\n this.numberOfItems = this.items().length;\n // Add an additional the ellipses item to the end of the shownItems (breadcrumb items).\n // Disable addExpandDropdown for now, to make every item a proper SiBreadcrumbItemComponent.\n const ellipsesItem = { title: '...', level: this.numberOfItems, shortenedTitle: '' };\n this.itemsShown.push(ellipsesItem);\n if (this.breadcrumbShortened) {\n // If the breadcrumb was shortened before, remove the ellipses and add back itemsHidden (breadcrumb dropdown items).\n this.breadcrumbShortened = false;\n this.itemsShown.splice(this.ellipsesLevel, 1, ...this.itemsHidden);\n this.itemsHidden = [];\n }\n this.addExpandDropdown = false;\n // Wait for the next change detection cycle to measure the updated item length.\n this.changeDetector.detectChanges();\n this.calculateBreadcrumb();\n }\n }\n\n private calculateBreadcrumb(): void {\n this.addExpandDropdown = true;\n const maxWidth = this.breadcrumbElement().nativeElement.clientWidth;\n const breadcrumbElementsList = this.breadcrumbElements().map(item => item);\n // Measure the length of the last additional ellipses item, then remove it from itemsShown (breadcrumb items).\n const ellipsesWidth = breadcrumbElementsList[this.numberOfItems].nativeElement.offsetWidth;\n this.itemsShown.splice(this.numberOfItems, 1);\n let currentWidth = this.showRootAsText() ? 0 : ROOT_ICON_WIDTH;\n const numberOfItemsKeptAtEnd = Math.min(NUMBER_OF_SHOWN_ITEMS_AT_END, this.numberOfItems - 1);\n let reverseCounter = this.numberOfItems;\n // Test for numberOfItemsKeptAtEnd items from the end if they still fit, if not, set breadcrumbShortened to true.\n breadcrumbElementsList\n .slice(this.numberOfItems - numberOfItemsKeptAtEnd, this.numberOfItems)\n .reverse()\n .map(item => {\n if (!this.breadcrumbShortened) {\n const currentItemWidth = item.nativeElement.offsetWidth;\n if (currentWidth + currentItemWidth > maxWidth) {\n this.breadcrumbShortened = true;\n // Test if the ellipses item still fits, if not remove last (actually next in original order) item as well.\n if (currentWidth + ellipsesWidth > maxWidth) {\n reverseCounter++;\n }\n } else {\n currentWidth += currentItemWidth;\n reverseCounter--;\n }\n }\n });\n\n const start = this.showRootAsText() ? 0 : 1;\n let counter = start;\n // If breadcrumbShortened is not true yet, test for the rest of the items from the start\n // Whether they still fit, if not, set breadcrumbShortened to true.\n breadcrumbElementsList.slice(start, this.numberOfItems - numberOfItemsKeptAtEnd).map(item => {\n if (!this.breadcrumbShortened) {\n const currentItemWidth = item.nativeElement.offsetWidth;\n if (currentWidth + currentItemWidth > maxWidth) {\n this.breadcrumbShortened = true;\n // Test if the ellipses item still fits, if not remove last item as well.\n // If the counter is still on 1, instead remove last (actually next in original order) from\n // the previous reverse calculation\n if (currentWidth + ellipsesWidth > maxWidth) {\n if (counter > 1) {\n counter--;\n } else {\n reverseCounter++;\n }\n }\n } else {\n currentWidth += currentItemWidth;\n counter++;\n }\n }\n });\n // If breadcrumbShortened is true, move the items that do not fit to itemsHidden (breadcrumb dropdown items) and add ellipses item.\n if (this.breadcrumbShortened) {\n this.ellipsesLevel = counter;\n this.itemsHidden = this.itemsShown.slice(this.ellipsesLevel, reverseCounter);\n const ellipsesItem = { title: '...', level: this.ellipsesLevel, shortenedTitle: '' };\n this.itemsShown.splice(this.ellipsesLevel, reverseCounter - this.ellipsesLevel, ellipsesItem);\n }\n // Manually detect changes to prevent them from not being detected on language change\n this.changeDetector.detectChanges();\n }\n}\n","<nav class=\"py-2\" [attr.aria-label]=\"ariaLabel() | translate\">\n <ol #breadcrumb class=\"breadcrumb\" (siResizeObserver)=\"resetBreadcrumb()\">\n @for (item of itemsShown; track $index; let isFirst = $first) {\n @if (!breadcrumbShortened || item.level !== ellipsesLevel) {\n @if (item.shortened) {\n <li #breadcrumbItem class=\"item text-nowrap shortened\">\n @if (!isFirst) {\n <si-icon class=\"d-block separator flip-rtl\" [icon]=\"icons.elementRight2\" />\n }\n <div class=\"breadcrumb-dropdown-wrapper\">\n <ng-container\n *ngTemplateOutlet=\"\n toggleTemplate;\n context: { item: item, title: item.shortenedTitle }\n \"\n />\n @if (addExpandDropdown) {\n <div\n class=\"dropdown-menu\"\n role=\"menu\"\n [id]=\"controlId + item.level\"\n [class.show]=\"breadcrumbDropdownOpen === item.level\"\n >\n <ng-container *ngTemplateOutlet=\"dropdownTemplate; context: { item: item }\" />\n </div>\n }\n </div>\n </li>\n } @else {\n <li #breadcrumbItem class=\"item\">\n @if (!isFirst) {\n <si-icon class=\"d-block icon-sm separator flip-rtl\" [icon]=\"icons.elementRight2\" />\n }\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { item: item }\" />\n </li>\n }\n }\n @if (breadcrumbShortened && item.level === ellipsesLevel) {\n <li class=\"item breadcrumb-ellipses-item\">\n @if (!isFirst) {\n <si-icon class=\"d-block icon-sm separator flip-rtl\" [icon]=\"icons.elementRight2\" />\n }\n <div class=\"breadcrumb-dropdown-wrapper\">\n <ng-container *ngTemplateOutlet=\"toggleTemplate; context: { item: item, title: '' }\" />\n <div\n class=\"dropdown-menu\"\n role=\"menu\"\n [id]=\"controlId + item.level\"\n [class.show]=\"breadcrumbDropdownOpen === item.level\"\n >\n @for (item of itemsHidden; track $index) {\n <ng-container *ngTemplateOutlet=\"dropdownTemplate; context: { item: item }\" />\n }\n </div>\n </div>\n </li>\n }\n }\n </ol>\n</nav>\n\n<ng-template #itemTemplate let-item=\"item\" siBreadcrumbItemTemplate>\n <a\n class=\"breadcrumb-link text-nowrap\"\n activeClass=\"active\"\n ariaCurrent=\"page\"\n [class.disable-router-link]=\"!item.link && !item.action && !item.href\"\n [class.text-secondary]=\"item.lastItem\"\n [siLink]=\"item\"\n [exactMatch]=\"true\"\n [attr.aria-label]=\"item.title\"\n [attr.aria-disabled]=\"!item.link && !item.href && !item.action\"\n >\n @if (item.level === 0) {\n <si-icon class=\"d-block icon-sm flip-rtl\" [icon]=\"icons.elementBreadcrumbRoot\" />\n } @else {\n <span>{{ item.title }}</span>\n }\n </a>\n</ng-template>\n\n<ng-template #toggleTemplate let-item=\"item\" let-title=\"title\" siBreadcrumbItemTemplate>\n <button\n type=\"button\"\n class=\"btn btn-link\"\n aria-haspopup=\"true\"\n [attr.aria-controls]=\"controlId + item.level\"\n [attr.aria-expanded]=\"breadcrumbDropdownOpen === item.level\"\n (click)=\"toggleBreadcrumbDropdown(item.level)\"\n >{{ title }}...</button\n >\n</ng-template>\n\n<ng-template #dropdownTemplate let-item=\"item\" siBreadcrumbItemTemplate>\n <a\n class=\"dropdown-item breadcrumb-link focus-inside\"\n activeClass=\"active\"\n ariaCurrent=\"page\"\n role=\"menuitem\"\n [class.disable-router-link]=\"!item.link && !item.action && !item.href\"\n [siLink]=\"item\"\n [exactMatch]=\"true\"\n [attr.aria-disabled]=\"!item.link && !item.action && !item.href\"\n >{{ item.title }}</a\n >\n</ng-template>\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { NgModule } from '@angular/core';\n\nimport { SiBreadcrumbComponent } from './si-breadcrumb.component';\n\n@NgModule({\n imports: [SiBreadcrumbComponent],\n exports: [SiBreadcrumbComponent]\n})\nexport class SiBreadcrumbModule {}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nexport * from './breadcrumb-item.model';\nexport * from './si-breadcrumb.component';\nexport * from './si-breadcrumb.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;AAGG;MAMU,iCAAiC,CAAA;AAC5C,IAAA,OAAO,sBAAsB,CAC3B,SAA4C,EAC5C,OAAgB,EAAA;AAEhB,QAAA,OAAO,IAAI;IACb;uGANW,iCAAiC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAjC,iCAAiC,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,4BAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAjC,iCAAiC,EAAA,UAAA,EAAA,CAAA;kBAD7C,SAAS;mBAAC,EAAE,QAAQ,EAAE,4BAA4B,EAAE;;;ACRrD;;;AAGG;AA+BH;;AAEG;AACH,MAAM,4BAA4B,GAAG,CAAC;AAEtC;;;;AAIG;AACH,MAAM,eAAe,GAAG,EAAE;AAE1B;;;AAGG;AACH,MAAM,6CAA6C,GAAG,EAAE;AAExD;;AAEG;AACH,MAAM,eAAe,GAAG,EAAE;AAE1B,IAAI,gBAAgB,GAAG,CAAC;MAgBX,qBAAqB,CAAA;;IAEvB,KAAK,GAAG,KAAK,CAAC,QAAQ;8EAAoB;AACnD;;;;AAIG;IACM,cAAc,GAAG,KAAK,CAAC,KAAK,sFAAI,SA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AA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;wGAAlB,kBAAkB,EAAA,OAAA,EAAA,CAHnB,qBAAqB,CAAA,EAAA,OAAA,EAAA,CACrB,qBAAqB,CAAA,EAAA,CAAA;AAEpB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,YAHnB,qBAAqB,CAAA,EAAA,CAAA;;2FAGpB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,qBAAqB,CAAC;oBAChC,OAAO,EAAE,CAAC,qBAAqB;AAChC,iBAAA;;;ACXD;;;AAGG;;ACHH;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"siemens-element-ng-breadcrumb.mjs","sources":["../../../../projects/element-ng/breadcrumb/si-breadcrumb-item-template.directive.ts","../../../../projects/element-ng/breadcrumb/si-breadcrumb.component.ts","../../../../projects/element-ng/breadcrumb/si-breadcrumb.component.html","../../../../projects/element-ng/breadcrumb/si-breadcrumb.module.ts","../../../../projects/element-ng/breadcrumb/index.ts","../../../../projects/element-ng/breadcrumb/siemens-element-ng-breadcrumb.ts"],"sourcesContent":["/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { Directive } from '@angular/core';\n\nimport { EnumeratedBreadcrumbItem } from './breadcrumb-item.model';\n\n@Directive({ selector: '[siBreadcrumbItemTemplate]' })\nexport class SiBreadcrumbItemTemplateDirective {\n static ngTemplateContextGuard(\n directive: SiBreadcrumbItemTemplateDirective,\n context: unknown\n ): context is { item: EnumeratedBreadcrumbItem; title?: string } {\n return true;\n }\n}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n HostListener,\n inject,\n input,\n OnChanges,\n OnDestroy,\n viewChild,\n viewChildren\n} from '@angular/core';\nimport { elementBreadcrumbRoot, elementRight2 } from '@siemens/element-icons';\nimport { addIcons, SiIconComponent } from '@siemens/element-ng/icon';\nimport { SiLinkDirective } from '@siemens/element-ng/link';\nimport { SiResizeObserverDirective } from '@siemens/element-ng/resize-observer';\nimport { SiTooltipOverflowDirective } from '@siemens/element-ng/tooltip';\nimport {\n injectSiTranslateService,\n SiTranslatePipe,\n t\n} from '@siemens/element-translate-ng/translate';\nimport { merge, of, Subscription } from 'rxjs';\nimport { switchMap } from 'rxjs/operators';\n\nimport { BreadcrumbItem, EnumeratedBreadcrumbItem } from './breadcrumb-item.model';\nimport { SiBreadcrumbItemTemplateDirective } from './si-breadcrumb-item-template.directive';\n\n/**\n * Defines how many items should be displayed at the end of the breadcrumb if possible.\n */\nconst NUMBER_OF_SHOWN_ITEMS_AT_END = 2;\n\n/**\n * Defines the width of the root icon in pixels.\n */\nconst ROOT_ICON_WIDTH = 24;\n\nlet controlIdCounter = 1;\n\n@Component({\n selector: 'si-breadcrumb',\n imports: [\n NgTemplateOutlet,\n SiIconComponent,\n SiLinkDirective,\n SiResizeObserverDirective,\n SiTooltipOverflowDirective,\n SiTranslatePipe,\n SiBreadcrumbItemTemplateDirective\n ],\n templateUrl: './si-breadcrumb.component.html',\n styleUrl: './si-breadcrumb.component.scss',\n changeDetection: ChangeDetectionStrategy.Eager\n})\nexport class SiBreadcrumbComponent implements OnChanges, OnDestroy {\n /** Array of breadcrumb items. */\n readonly items = input.required<BreadcrumbItem[]>();\n /**\n * Shows the \"root\" route as the provided title string instead of an icon.\n *\n * @defaultValue false\n */\n readonly showRootAsText = input(false, { transform: booleanAttribute });\n /**\n * Aria label for the main breadcrumb navigation. Needed for a11y.\n *\n * @defaultValue\n * ```\n * t(() => $localize`:@@SI_BREADCRUMB:Breadcrumb navigation`)\n * ```\n */\n readonly ariaLabel = input(t(() => $localize`:@@SI_BREADCRUMB:Breadcrumb navigation`));\n\n private translationSubscription?: Subscription;\n private itemsProcessed = false;\n private numberOfItems = 0;\n\n protected itemsShown: EnumeratedBreadcrumbItem[] = [];\n protected itemsHidden: EnumeratedBreadcrumbItem[] = [];\n protected breadcrumbShortened = false;\n protected ellipsesLevel = 0;\n // Record to allow for -1 (root).\n protected breadcrumbDropdownOpen: number | undefined = undefined;\n protected controlId = `__si-breadcrumb-${controlIdCounter++}-`;\n protected readonly icons = addIcons({ elementBreadcrumbRoot, elementRight2 });\n\n private readonly breadcrumbElement = viewChild.required<ElementRef>('breadcrumb');\n private readonly breadcrumbElements = viewChildren<ElementRef>('breadcrumbItem');\n\n private changeDetector = inject(ChangeDetectorRef);\n private translate = injectSiTranslateService();\n\n ngOnChanges(): void {\n // Reprocess items on every change and on init\n this.processItems();\n }\n\n ngOnDestroy(): void {\n this.translationSubscription?.unsubscribe();\n }\n\n private processItems(): void {\n this.numberOfItems = this.items().length;\n\n this.translationSubscription?.unsubscribe();\n if (this.numberOfItems) {\n this.translationSubscription = merge(this.translate.translationChange, of(undefined))\n .pipe(switchMap(() => this.translate.translateAsync(this.items().map(item => item.title))))\n .subscribe(translatedTitles => {\n // Add the level and mark the last item, keeping the full translated titles.\n let counter = -1;\n const enumeratedItems = this.items().map(item => {\n counter++;\n const title = translatedTitles[item.title];\n\n // If the root element should be displayed as text, set level not to 0.\n // This is used to distinguish in the template between icon and text.\n const level = counter === 0 && this.showRootAsText() ? -1 : counter;\n\n return {\n ...item,\n title,\n level,\n hide: false,\n lastItem: counter === this.numberOfItems - 1\n };\n });\n this.itemsShown = enumeratedItems;\n this.itemsHidden = [];\n this.breadcrumbShortened = false;\n this.breadcrumbDropdownOpen = undefined;\n this.itemsProcessed = true;\n this.resetBreadcrumb();\n });\n } else {\n this.itemsShown = [];\n this.itemsHidden = [];\n this.breadcrumbShortened = false;\n this.breadcrumbDropdownOpen = undefined;\n this.itemsProcessed = true;\n this.resetBreadcrumb();\n }\n }\n\n /** Toggle the ellipses dropdown to show the hidden breadcrumb levels. */\n protected toggleBreadcrumbDropdown(itemLevel: number): void {\n this.breadcrumbDropdownOpen = this.breadcrumbDropdownOpen === itemLevel ? undefined : itemLevel;\n }\n\n // Close dropdown on click anywhere else\n @HostListener('document:click', ['$event.target'])\n protected documentClick(targetElement: any): void {\n if (this.breadcrumbDropdownOpen) {\n if (!this.breadcrumbElement().nativeElement.contains(targetElement)) {\n // Close all dropdowns.\n this.breadcrumbDropdownOpen = undefined;\n }\n }\n }\n\n protected resetBreadcrumb(): void {\n if (this.itemsProcessed) {\n this.numberOfItems = this.items().length;\n // Add an additional the ellipses item to the end of the shownItems (breadcrumb items).\n const ellipsesItem = { title: '...', level: this.numberOfItems };\n this.itemsShown.push(ellipsesItem);\n if (this.breadcrumbShortened) {\n // If the breadcrumb was shortened before, remove the ellipses and add back itemsHidden (breadcrumb dropdown items).\n this.breadcrumbShortened = false;\n this.itemsShown.splice(this.ellipsesLevel, 1, ...this.itemsHidden);\n this.itemsHidden = [];\n }\n // Wait for the next change detection cycle to measure the updated item length.\n this.changeDetector.detectChanges();\n this.calculateBreadcrumb();\n }\n }\n\n private calculateBreadcrumb(): void {\n const maxWidth = this.breadcrumbElement().nativeElement.clientWidth;\n const breadcrumbElementsList = this.breadcrumbElements().map(item => item);\n // Measure the length of the last additional ellipses item, then remove it from itemsShown (breadcrumb items).\n const ellipsesWidth = breadcrumbElementsList[this.numberOfItems].nativeElement.offsetWidth;\n this.itemsShown.splice(this.numberOfItems, 1);\n let currentWidth = this.showRootAsText() ? 0 : ROOT_ICON_WIDTH;\n const numberOfItemsKeptAtEnd = Math.min(NUMBER_OF_SHOWN_ITEMS_AT_END, this.numberOfItems - 1);\n let reverseCounter = this.numberOfItems;\n // Test for numberOfItemsKeptAtEnd items from the end if they still fit, if not, set breadcrumbShortened to true.\n breadcrumbElementsList\n .slice(this.numberOfItems - numberOfItemsKeptAtEnd, this.numberOfItems)\n .reverse()\n .map(item => {\n if (!this.breadcrumbShortened) {\n const currentItemWidth = item.nativeElement.offsetWidth;\n if (currentWidth + currentItemWidth > maxWidth) {\n this.breadcrumbShortened = true;\n // Test if the ellipses item still fits, if not remove last (actually next in original order) item as well.\n if (currentWidth + ellipsesWidth > maxWidth) {\n reverseCounter++;\n }\n } else {\n currentWidth += currentItemWidth;\n reverseCounter--;\n }\n }\n });\n\n const start = this.showRootAsText() ? 0 : 1;\n let counter = start;\n // If breadcrumbShortened is not true yet, test for the rest of the items from the start\n // Whether they still fit, if not, set breadcrumbShortened to true.\n breadcrumbElementsList.slice(start, this.numberOfItems - numberOfItemsKeptAtEnd).map(item => {\n if (!this.breadcrumbShortened) {\n const currentItemWidth = item.nativeElement.offsetWidth;\n if (currentWidth + currentItemWidth > maxWidth) {\n this.breadcrumbShortened = true;\n // Test if the ellipses item still fits, if not remove last item as well.\n // If the counter is still on 1, instead remove last (actually next in original order) from\n // the previous reverse calculation\n if (currentWidth + ellipsesWidth > maxWidth) {\n if (counter > 1) {\n counter--;\n } else {\n reverseCounter++;\n }\n }\n } else {\n currentWidth += currentItemWidth;\n counter++;\n }\n }\n });\n // If breadcrumbShortened is true, move the items that do not fit to itemsHidden (breadcrumb dropdown items) and add ellipses item.\n if (this.breadcrumbShortened) {\n this.ellipsesLevel = counter;\n this.itemsHidden = this.itemsShown.slice(this.ellipsesLevel, reverseCounter);\n const ellipsesItem = { title: '...', level: this.ellipsesLevel };\n this.itemsShown.splice(this.ellipsesLevel, reverseCounter - this.ellipsesLevel, ellipsesItem);\n }\n // Manually detect changes to prevent them from not being detected on language change\n this.changeDetector.detectChanges();\n }\n}\n","<nav class=\"py-2\" [attr.aria-label]=\"ariaLabel() | translate\">\n <ol #breadcrumb class=\"breadcrumb\" (siResizeObserver)=\"resetBreadcrumb()\">\n @for (item of itemsShown; track $index; let isFirst = $first) {\n @if (!breadcrumbShortened || item.level !== ellipsesLevel) {\n <li #breadcrumbItem class=\"item\" [class.current-item]=\"item.lastItem\">\n @if (!isFirst) {\n <si-icon class=\"d-block icon-sm separator flip-rtl\" [icon]=\"icons.elementRight2\" />\n }\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { item: item }\" />\n </li>\n }\n @if (breadcrumbShortened && item.level === ellipsesLevel) {\n <li class=\"item breadcrumb-ellipses-item\">\n @if (!isFirst) {\n <si-icon class=\"d-block icon-sm separator flip-rtl\" [icon]=\"icons.elementRight2\" />\n }\n <div class=\"breadcrumb-dropdown-wrapper\">\n <ng-container *ngTemplateOutlet=\"toggleTemplate; context: { item: item }\" />\n <div\n class=\"dropdown-menu\"\n role=\"menu\"\n [id]=\"controlId + item.level\"\n [class.show]=\"breadcrumbDropdownOpen === item.level\"\n >\n @for (item of itemsHidden; track $index) {\n <ng-container *ngTemplateOutlet=\"dropdownTemplate; context: { item: item }\" />\n }\n </div>\n </div>\n </li>\n }\n }\n </ol>\n</nav>\n\n<ng-template #itemTemplate let-item=\"item\" siBreadcrumbItemTemplate>\n <a\n class=\"breadcrumb-link text-nowrap\"\n activeClass=\"active\"\n ariaCurrent=\"page\"\n siTooltipOverflow\n [class.disable-router-link]=\"!item.link && !item.action && !item.href\"\n [class.text-secondary]=\"item.lastItem\"\n [siLink]=\"item\"\n [exactMatch]=\"true\"\n [attr.aria-label]=\"item.title\"\n [attr.aria-disabled]=\"!item.link && !item.href && !item.action\"\n >\n @if (item.level === 0) {\n <si-icon class=\"d-block icon-sm flip-rtl\" [icon]=\"icons.elementBreadcrumbRoot\" />\n } @else {\n <span>{{ item.title }}</span>\n }\n </a>\n</ng-template>\n\n<ng-template #toggleTemplate let-item=\"item\" siBreadcrumbItemTemplate>\n <button\n type=\"button\"\n class=\"btn btn-link\"\n aria-haspopup=\"true\"\n [attr.aria-controls]=\"controlId + item.level\"\n [attr.aria-expanded]=\"breadcrumbDropdownOpen === item.level\"\n (click)=\"toggleBreadcrumbDropdown(item.level)\"\n >...</button\n >\n</ng-template>\n\n<ng-template #dropdownTemplate let-item=\"item\" siBreadcrumbItemTemplate>\n <a\n class=\"dropdown-item breadcrumb-link focus-inside\"\n activeClass=\"active\"\n ariaCurrent=\"page\"\n role=\"menuitem\"\n [class.disable-router-link]=\"!item.link && !item.action && !item.href\"\n [siLink]=\"item\"\n [exactMatch]=\"true\"\n [attr.aria-disabled]=\"!item.link && !item.action && !item.href\"\n >{{ item.title }}</a\n >\n</ng-template>\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { NgModule } from '@angular/core';\n\nimport { SiBreadcrumbComponent } from './si-breadcrumb.component';\n\n@NgModule({\n imports: [SiBreadcrumbComponent],\n exports: [SiBreadcrumbComponent]\n})\nexport class SiBreadcrumbModule {}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nexport * from './breadcrumb-item.model';\nexport * from './si-breadcrumb.component';\nexport * from './si-breadcrumb.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;AAGG;MAMU,iCAAiC,CAAA;AAC5C,IAAA,OAAO,sBAAsB,CAC3B,SAA4C,EAC5C,OAAgB,EAAA;AAEhB,QAAA,OAAO,IAAI;IACb;uGANW,iCAAiC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAjC,iCAAiC,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,4BAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAjC,iCAAiC,EAAA,UAAA,EAAA,CAAA;kBAD7C,SAAS;mBAAC,EAAE,QAAQ,EAAE,4BAA4B,EAAE;;;ACRrD;;;AAGG;AAgCH;;AAEG;AACH,MAAM,4BAA4B,GAAG,CAAC;AAEtC;;AAEG;AACH,MAAM,eAAe,G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ement.focus();
|
|
565
565
|
}
|
|
566
566
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiChatContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
567
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.8", type: SiChatContainerComponent, isStandalone: true, selector: "si-chat-container", inputs: { colorVariant: { classPropertyName: "colorVariant", publicName: "colorVariant", isSignal: true, isRequired: false, transformFunction: null }, noAutoScroll: { classPropertyName: "noAutoScroll", publicName: "noAutoScroll", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "colorVariant()" }, classAttribute: "d-flex si-layout-inner flex-grow-1 flex-column h-100 w-100" }, viewQueries: [{ propertyName: "messagesContainer", first: true, predicate: ["messagesContainer"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"chat-container d-flex flex-column flex-grow-1 px-6
|
|
567
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.8", type: SiChatContainerComponent, isStandalone: true, selector: "si-chat-container", inputs: { colorVariant: { classPropertyName: "colorVariant", publicName: "colorVariant", isSignal: true, isRequired: false, transformFunction: null }, noAutoScroll: { classPropertyName: "noAutoScroll", publicName: "noAutoScroll", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "colorVariant()" }, classAttribute: "d-flex si-layout-inner flex-grow-1 flex-column h-100 w-100" }, viewQueries: [{ propertyName: "messagesContainer", first: true, predicate: ["messagesContainer"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"chat-container d-flex flex-column flex-grow-1 px-6 py-6 w-100\">\n <div\n #messagesContainer\n class=\"messages-container d-flex flex-column flex-grow-1 w-100 align-self-center\"\n tabindex=\"0\"\n (scroll)=\"onScroll()\"\n >\n <ng-content />\n </div>\n\n <div class=\"chat-input-area py-3 pt-0 mt-6 d-flex flex-column align-items-center\">\n <ng-content select=\"si-inline-notification\" />\n <ng-content select=\"si-chat-input,[siChatContainerInput]\" />\n </div>\n</div>\n", styles: [":host{overflow-y:hidden;overflow-x:visible}:host.base-0{background-color:var(--si-sys-color-background-0)}:host.base-1{background-color:var(--si-sys-color-background-1)}.chat-container.initialized{scroll-behavior:smooth}::ng-deep .chat-container:has(si-ai-welcome-screen){inline-size:100%;padding-inline-start:0!important;padding-inline-end:0!important}::ng-deep .chat-container:has(si-ai-welcome-screen) :is(.chat-input-area,si-ai-welcome-screen){padding-inline-start:var(--si-sys-sizing-spacing-x-60);padding-inline-end:var(--si-sys-sizing-spacing-x-60)}.chat-container{min-block-size:0;overflow-y:auto;overflow-x:visible}.messages-container{overflow-y:auto;overflow-x:visible;min-block-size:5rem;gap:calc(var(--si-sys-sizing-spacing-y-90) + var(--si-sys-sizing-spacing-y-40)) calc(var(--si-sys-sizing-spacing-x-90) + var(--si-sys-sizing-spacing-x-40))}.messages-container ::ng-deep si-user-message:not(.last),.messages-container>::ng-deep si-activity-message:has(+si-activity-message){margin-block-end:calc(-1 * (var(--si-sys-sizing-spacing-y-90) + var(--si-sys-sizing-spacing-y-40)))}.messages-container>::ng-deep :is(si-activity-message,si-activity-trace):has(+si-ai-message),.messages-container>::ng-deep si-ai-message:has(+:is(si-activity-message,si-activity-trace)){margin-block-end:calc(-1 * (var(--si-sys-sizing-spacing-y-90) + var(--si-sys-sizing-spacing-y-40)) + var(--si-sys-sizing-spacing-y-60))}::ng-deep .messages-container:not(:has(si-ai-welcome-screen)){max-inline-size:720px}::ng-deep .messages-container:has(si-ai-welcome-screen){inline-size:100%}.chat-input-area{justify-self:flex-end;align-self:center;overflow:visible;inline-size:100%}.chat-input-area>::ng-deep *{max-inline-size:720px}::ng-deep .chat-input-area:empty:not(:has(si-inline-notification)),::ng-deep .chat-input-area:has([sichatcontainerinput]:empty):not(:has(si-inline-notification)){display:none!important}.chat-input-area:empty ::ng-deep>si-inline-notification,.chat-input-area:empty ::ng-deep *>si-inline-notification,.chat-input-area:has([sichatcontainerinput]:empty) ::ng-deep>si-inline-notification,.chat-input-area:has([sichatcontainerinput]:empty) ::ng-deep *>si-inline-notification{margin-block-end:0!important}.chat-container:has(.messages-container:not(:empty)) .messages-empty-state{display:none!important}:host-context(.si-container-xs,.si-container-sm) ::ng-deep si-inline-notification :is(.alert,.alert-link){font-size:var(--si-sys-typography-font-size-body)}\n"] });
|
|
568
568
|
}
|
|
569
569
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiChatContainerComponent, decorators: [{
|
|
570
570
|
type: Component,
|
|
571
571
|
args: [{ selector: 'si-chat-container', host: {
|
|
572
572
|
class: 'd-flex si-layout-inner flex-grow-1 flex-column h-100 w-100',
|
|
573
573
|
'[class]': 'colorVariant()'
|
|
574
|
-
}, template: "<div class=\"chat-container d-flex flex-column flex-grow-1 px-6
|
|
574
|
+
}, template: "<div class=\"chat-container d-flex flex-column flex-grow-1 px-6 py-6 w-100\">\n <div\n #messagesContainer\n class=\"messages-container d-flex flex-column flex-grow-1 w-100 align-self-center\"\n tabindex=\"0\"\n (scroll)=\"onScroll()\"\n >\n <ng-content />\n </div>\n\n <div class=\"chat-input-area py-3 pt-0 mt-6 d-flex flex-column align-items-center\">\n <ng-content select=\"si-inline-notification\" />\n <ng-content select=\"si-chat-input,[siChatContainerInput]\" />\n </div>\n</div>\n", styles: [":host{overflow-y:hidden;overflow-x:visible}:host.base-0{background-color:var(--si-sys-color-background-0)}:host.base-1{background-color:var(--si-sys-color-background-1)}.chat-container.initialized{scroll-behavior:smooth}::ng-deep .chat-container:has(si-ai-welcome-screen){inline-size:100%;padding-inline-start:0!important;padding-inline-end:0!important}::ng-deep .chat-container:has(si-ai-welcome-screen) :is(.chat-input-area,si-ai-welcome-screen){padding-inline-start:var(--si-sys-sizing-spacing-x-60);padding-inline-end:var(--si-sys-sizing-spacing-x-60)}.chat-container{min-block-size:0;overflow-y:auto;overflow-x:visible}.messages-container{overflow-y:auto;overflow-x:visible;min-block-size:5rem;gap:calc(var(--si-sys-sizing-spacing-y-90) + var(--si-sys-sizing-spacing-y-40)) calc(var(--si-sys-sizing-spacing-x-90) + var(--si-sys-sizing-spacing-x-40))}.messages-container ::ng-deep si-user-message:not(.last),.messages-container>::ng-deep si-activity-message:has(+si-activity-message){margin-block-end:calc(-1 * (var(--si-sys-sizing-spacing-y-90) + var(--si-sys-sizing-spacing-y-40)))}.messages-container>::ng-deep :is(si-activity-message,si-activity-trace):has(+si-ai-message),.messages-container>::ng-deep si-ai-message:has(+:is(si-activity-message,si-activity-trace)){margin-block-end:calc(-1 * (var(--si-sys-sizing-spacing-y-90) + var(--si-sys-sizing-spacing-y-40)) + var(--si-sys-sizing-spacing-y-60))}::ng-deep .messages-container:not(:has(si-ai-welcome-screen)){max-inline-size:720px}::ng-deep .messages-container:has(si-ai-welcome-screen){inline-size:100%}.chat-input-area{justify-self:flex-end;align-self:center;overflow:visible;inline-size:100%}.chat-input-area>::ng-deep *{max-inline-size:720px}::ng-deep .chat-input-area:empty:not(:has(si-inline-notification)),::ng-deep .chat-input-area:has([sichatcontainerinput]:empty):not(:has(si-inline-notification)){display:none!important}.chat-input-area:empty ::ng-deep>si-inline-notification,.chat-input-area:empty ::ng-deep *>si-inline-notification,.chat-input-area:has([sichatcontainerinput]:empty) ::ng-deep>si-inline-notification,.chat-input-area:has([sichatcontainerinput]:empty) ::ng-deep *>si-inline-notification{margin-block-end:0!important}.chat-container:has(.messages-container:not(:empty)) .messages-empty-state{display:none!important}:host-context(.si-container-xs,.si-container-sm) ::ng-deep si-inline-notification :is(.alert,.alert-link){font-size:var(--si-sys-typography-font-size-body)}\n"] }]
|
|
575
575
|
}], ctorParameters: () => [], propDecorators: { messagesContainer: [{ type: i0.ViewChild, args: ['messagesContainer', { isSignal: true }] }], colorVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "colorVariant", required: false }] }], noAutoScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "noAutoScroll", required: false }] }] } });
|
|
576
576
|
|
|
577
577
|
/**
|