@fundamental-ngx/core 0.35.2-rc.28 → 0.35.2-rc.30
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/action-bar/package.json +1 -1
- package/action-sheet/package.json +1 -1
- package/alert/package.json +1 -1
- package/avatar/package.json +1 -1
- package/avatar-group/package.json +1 -1
- package/bar/package.json +1 -1
- package/breadcrumb/breadcrumb.component.d.ts +18 -14
- package/breadcrumb/esm2020/breadcrumb.component.mjs +32 -21
- package/breadcrumb/fesm2015/fundamental-ngx-core-breadcrumb.mjs +30 -19
- package/breadcrumb/fesm2015/fundamental-ngx-core-breadcrumb.mjs.map +1 -1
- package/breadcrumb/fesm2020/fundamental-ngx-core-breadcrumb.mjs +30 -19
- package/breadcrumb/fesm2020/fundamental-ngx-core-breadcrumb.mjs.map +1 -1
- package/breadcrumb/package.json +1 -1
- package/busy-indicator/package.json +1 -1
- package/button/package.json +1 -1
- package/calendar/package.json +1 -1
- package/card/package.json +1 -1
- package/carousel/package.json +1 -1
- package/checkbox/package.json +1 -1
- package/combobox/package.json +1 -1
- package/content-density/package.json +3 -3
- package/date-picker/package.json +1 -1
- package/datetime/package.json +1 -1
- package/datetime-picker/package.json +1 -1
- package/dialog/package.json +1 -1
- package/dynamic-page/package.json +1 -1
- package/dynamic-side-content/package.json +1 -1
- package/esm2020/breadcrumb/breadcrumb.component.mjs +32 -21
- package/esm2020/illustrated-message/illustrated-message.component.mjs +28 -21
- package/esm2020/utils/interfaces/require.interface.mjs +2 -0
- package/esm2020/utils/public_api.mjs +2 -1
- package/facets/package.json +1 -1
- package/feed-input/package.json +1 -1
- package/feed-list-item/package.json +1 -1
- package/fesm2015/fundamental-ngx-core-breadcrumb.mjs +30 -19
- package/fesm2015/fundamental-ngx-core-breadcrumb.mjs.map +1 -1
- package/fesm2015/fundamental-ngx-core-illustrated-message.mjs +27 -21
- package/fesm2015/fundamental-ngx-core-illustrated-message.mjs.map +1 -1
- package/fesm2020/fundamental-ngx-core-breadcrumb.mjs +30 -19
- package/fesm2020/fundamental-ngx-core-breadcrumb.mjs.map +1 -1
- package/fesm2020/fundamental-ngx-core-illustrated-message.mjs +26 -20
- package/fesm2020/fundamental-ngx-core-illustrated-message.mjs.map +1 -1
- package/file-uploader/package.json +1 -1
- package/fixed-card-layout/package.json +1 -1
- package/flexible-column-layout/package.json +1 -1
- package/form/package.json +1 -1
- package/formatted-text/package.json +1 -1
- package/grid-list/package.json +1 -1
- package/icon/package.json +1 -1
- package/illustrated-message/esm2020/illustrated-message.component.mjs +28 -21
- package/illustrated-message/fesm2015/fundamental-ngx-core-illustrated-message.mjs +27 -21
- package/illustrated-message/fesm2015/fundamental-ngx-core-illustrated-message.mjs.map +1 -1
- package/illustrated-message/fesm2020/fundamental-ngx-core-illustrated-message.mjs +26 -20
- package/illustrated-message/fesm2020/fundamental-ngx-core-illustrated-message.mjs.map +1 -1
- package/illustrated-message/illustrated-message.component.d.ts +17 -15
- package/illustrated-message/package.json +1 -1
- package/infinite-scroll/package.json +1 -1
- package/info-label/package.json +1 -1
- package/inline-help/package.json +1 -1
- package/input-group/package.json +1 -1
- package/layout-grid/package.json +1 -1
- package/layout-panel/package.json +1 -1
- package/link/package.json +1 -1
- package/list/package.json +1 -1
- package/menu/package.json +1 -1
- package/message-box/package.json +1 -1
- package/message-strip/package.json +1 -1
- package/message-toast/package.json +1 -1
- package/micro-process-flow/package.json +1 -1
- package/mobile-mode/package.json +1 -1
- package/multi-input/package.json +1 -1
- package/nested-list/package.json +1 -1
- package/notification/package.json +1 -1
- package/object-identifier/package.json +1 -1
- package/object-marker/package.json +1 -1
- package/object-number/package.json +1 -1
- package/object-status/package.json +1 -1
- package/overflow-layout/package.json +13 -13
- package/package.json +1 -1
- package/pagination/package.json +1 -1
- package/panel/package.json +1 -1
- package/popover/package.json +1 -1
- package/product-switch/package.json +1 -1
- package/progress-indicator/package.json +1 -1
- package/quick-view/package.json +1 -1
- package/radio/package.json +1 -1
- package/rating-indicator/package.json +1 -1
- package/resizable-card-layout/package.json +1 -1
- package/scroll-spy/package.json +1 -1
- package/scrollbar/package.json +1 -1
- package/segmented-button/package.json +1 -1
- package/select/package.json +1 -1
- package/shared/package.json +1 -1
- package/shellbar/package.json +1 -1
- package/side-navigation/package.json +1 -1
- package/slider/package.json +1 -1
- package/split-button/package.json +1 -1
- package/splitter/package.json +1 -1
- package/status-indicator/package.json +1 -1
- package/step-input/package.json +1 -1
- package/switch/package.json +1 -1
- package/table/package.json +1 -1
- package/tabs/package.json +1 -1
- package/text/package.json +1 -1
- package/theming/package.json +1 -1
- package/tile/package.json +1 -1
- package/time/package.json +1 -1
- package/time-picker/package.json +1 -1
- package/timeline/package.json +1 -1
- package/title/package.json +1 -1
- package/token/package.json +1 -1
- package/toolbar/package.json +1 -1
- package/tree/package.json +1 -1
- package/upload-collection/package.json +1 -1
- package/utils/esm2020/interfaces/require.interface.mjs +2 -0
- package/utils/esm2020/public_api.mjs +2 -1
- package/utils/interfaces/require.interface.d.ts +6 -0
- package/utils/package.json +1 -1
- package/utils/public_api.d.ts +1 -0
- package/vertical-navigation/package.json +1 -1
- package/wizard/package.json +1 -1
|
@@ -6,7 +6,7 @@ import * as i3 from '@fundamental-ngx/core/link';
|
|
|
6
6
|
import { LinkComponent, LinkModule } from '@fundamental-ngx/core/link';
|
|
7
7
|
import * as i6 from '@angular/cdk/portal';
|
|
8
8
|
import { DomPortal, PortalModule } from '@angular/cdk/portal';
|
|
9
|
-
import { BehaviorSubject, Subscription, startWith, map, tap, firstValueFrom } from 'rxjs';
|
|
9
|
+
import { BehaviorSubject, Subscription, startWith, map, tap, firstValueFrom, debounceTime } from 'rxjs';
|
|
10
10
|
import * as i2 from '@fundamental-ngx/core/menu';
|
|
11
11
|
import { MenuComponent, MenuModule } from '@fundamental-ngx/core/menu';
|
|
12
12
|
import * as i1 from '@fundamental-ngx/core/utils';
|
|
@@ -90,9 +90,9 @@ class BreadcrumbComponent {
|
|
|
90
90
|
this._resizeObserver = _resizeObserver;
|
|
91
91
|
this._ngZone = _ngZone;
|
|
92
92
|
/** @hidden */
|
|
93
|
-
this.
|
|
93
|
+
this._collapsedBreadcrumbItems = [];
|
|
94
94
|
/** @hidden */
|
|
95
|
-
this.
|
|
95
|
+
this._placement$ = new BehaviorSubject('bottom-start');
|
|
96
96
|
/** Whether to append items to the overflow dropdown in reverse order. Default is true. */
|
|
97
97
|
this.reverse = false;
|
|
98
98
|
/** @hidden */
|
|
@@ -103,16 +103,19 @@ class BreadcrumbComponent {
|
|
|
103
103
|
/** @hidden */
|
|
104
104
|
ngOnInit() {
|
|
105
105
|
if (this._rtlService) {
|
|
106
|
-
this._subscriptions.add(this._rtlService.rtl.subscribe((value) => this.
|
|
106
|
+
this._subscriptions.add(this._rtlService.rtl.subscribe((value) => this._placement$.next(value ? 'bottom-end' : 'bottom-start')));
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
+
/** @hidden */
|
|
109
110
|
ngAfterViewInit() {
|
|
110
|
-
this._subscriptions.add(this.
|
|
111
|
-
.pipe(startWith(this.
|
|
111
|
+
this._subscriptions.add(this._breadcrumbItems.changes
|
|
112
|
+
.pipe(startWith(this._breadcrumbItems), map((items) => items.toArray()), map((items) => items.map((item) => [item, item.width])), tap((itemToSize) => (this._itemToSize = new Map(itemToSize))))
|
|
112
113
|
.subscribe());
|
|
113
114
|
firstValueFrom(this._ngZone.onStable).then(() => {
|
|
114
115
|
this._subscriptions.add(this._resizeObserver
|
|
115
116
|
.observe(this.containerElement || this.elementRef.nativeElement.parentElement)
|
|
117
|
+
// Add small delay for performance reasons.
|
|
118
|
+
.pipe(debounceTime(30))
|
|
116
119
|
.subscribe(() => this.onResize()));
|
|
117
120
|
});
|
|
118
121
|
}
|
|
@@ -120,24 +123,29 @@ class BreadcrumbComponent {
|
|
|
120
123
|
ngOnDestroy() {
|
|
121
124
|
this._subscriptions.unsubscribe();
|
|
122
125
|
}
|
|
123
|
-
/**
|
|
126
|
+
/**
|
|
127
|
+
* Callback function when breadcrumbs container has been resized.
|
|
128
|
+
*/
|
|
124
129
|
onResize() {
|
|
125
130
|
if (!this.elementRef.nativeElement.parentElement) {
|
|
126
131
|
return;
|
|
127
132
|
}
|
|
128
|
-
this.
|
|
133
|
+
this._containerBoundary = this.elementRef.nativeElement.parentElement.getBoundingClientRect().width;
|
|
129
134
|
if (this.containerElement) {
|
|
130
|
-
this.
|
|
135
|
+
this._containerBoundary = this.containerElement.getBoundingClientRect().width;
|
|
136
|
+
}
|
|
137
|
+
if (this._overflowContainer) {
|
|
138
|
+
this._containerBoundary -= this._overflowContainer.nativeElement.getBoundingClientRect().width;
|
|
131
139
|
}
|
|
132
140
|
let visibleSum = 0;
|
|
133
|
-
const breadcrumbItemComponents = this.
|
|
141
|
+
const breadcrumbItemComponents = this._breadcrumbItems.toArray();
|
|
134
142
|
let i;
|
|
135
143
|
for (i = breadcrumbItemComponents.length - 1; i >= 0; i--) {
|
|
136
144
|
const breadcrumbItem = breadcrumbItemComponents[i];
|
|
137
145
|
const itemSize = this._itemToSize.has(breadcrumbItem)
|
|
138
146
|
? this._itemToSize.get(breadcrumbItem)
|
|
139
147
|
: breadcrumbItem.width;
|
|
140
|
-
if (visibleSum + itemSize <= this.
|
|
148
|
+
if (visibleSum + itemSize <= this._containerBoundary) {
|
|
141
149
|
visibleSum += itemSize;
|
|
142
150
|
breadcrumbItem.show();
|
|
143
151
|
}
|
|
@@ -146,13 +154,13 @@ class BreadcrumbComponent {
|
|
|
146
154
|
}
|
|
147
155
|
}
|
|
148
156
|
const collapsedBreadcrumbItems = breadcrumbItemComponents.slice(0, ++i);
|
|
149
|
-
this.
|
|
150
|
-
this.
|
|
157
|
+
this._collapsedBreadcrumbItems = this.reverse ? collapsedBreadcrumbItems : collapsedBreadcrumbItems.reverse();
|
|
158
|
+
this._collapsedBreadcrumbItems.forEach((item) => item.hide());
|
|
151
159
|
this._cdRef.detectChanges();
|
|
152
160
|
}
|
|
153
161
|
/** @hidden */
|
|
154
|
-
|
|
155
|
-
this.
|
|
162
|
+
_keyDownHandle(event) {
|
|
163
|
+
this._menuComponent.toggle();
|
|
156
164
|
event.preventDefault();
|
|
157
165
|
}
|
|
158
166
|
/**
|
|
@@ -167,22 +175,25 @@ class BreadcrumbComponent {
|
|
|
167
175
|
}
|
|
168
176
|
}
|
|
169
177
|
BreadcrumbComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: BreadcrumbComponent, deps: [{ token: i0.ElementRef }, { token: i1.RtlService, optional: true }, { token: i0.ChangeDetectorRef }, { token: i1.ResizeObserverService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
170
|
-
BreadcrumbComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: BreadcrumbComponent, selector: "fd-breadcrumb", inputs: { containerElement: "containerElement", reverse: "reverse" }, host: { classAttribute: "fd-breadcrumb" }, queries: [{ propertyName: "
|
|
178
|
+
BreadcrumbComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: BreadcrumbComponent, selector: "fd-breadcrumb", inputs: { containerElement: "containerElement", reverse: "reverse" }, host: { classAttribute: "fd-breadcrumb" }, queries: [{ propertyName: "_breadcrumbItems", predicate: i0.forwardRef(function () { return BreadcrumbItemComponent; }) }], viewQueries: [{ propertyName: "_menuComponent", first: true, predicate: MenuComponent, descendants: true }, { propertyName: "_overflowContainer", first: true, predicate: ["overflowBreadcrumbsContainer"], descendants: true }], ngImport: i0, template: "<fd-menu #menu [closeOnEscapeKey]=\"true\" [focusAutoCapture]=\"true\" [placement]=\"_placement$ | async\">\n <ng-container *ngFor=\"let breadcrumbItem of _collapsedBreadcrumbItems\">\n <li fd-menu-item [disabled]=\"breadcrumbItem.breadcrumbLink ? breadcrumbItem.breadcrumbLink.disabled : false\">\n <a\n fd-menu-interactive\n (click)=\"itemClicked(breadcrumbItem, $event)\"\n (keydown.enter)=\"itemClicked(breadcrumbItem, $event)\"\n (keydown.space)=\"itemClicked(breadcrumbItem, $event)\"\n >\n <ng-container *ngIf=\"breadcrumbItem?.breadcrumbLink; else portalContent\">\n <ng-container *ngIf=\"breadcrumbItem.breadcrumbLink._prefixIconName\">\n <fd-menu-addon\n position=\"before\"\n [glyph]=\"breadcrumbItem.breadcrumbLink._prefixIconName\"\n ></fd-menu-addon>\n </ng-container>\n <span fd-menu-title>\n <ng-container [cdkPortalOutlet]=\"breadcrumbItem.linkContentPortal\"></ng-container>\n </span>\n <ng-container *ngIf=\"breadcrumbItem.breadcrumbLink._postfixIconName\">\n <fd-menu-addon [glyph]=\"breadcrumbItem.breadcrumbLink._postfixIconName\"></fd-menu-addon>\n </ng-container>\n </ng-container>\n <ng-template #portalContent>\n <span fd-menu-title>\n <ng-container [cdkPortalOutlet]=\"breadcrumbItem.breadcrumbItemPortal\"></ng-container>\n </span>\n </ng-template>\n </a>\n </li>\n </ng-container>\n</fd-menu>\n\n<span\n class=\"fd-breadcrumb__item\"\n *ngIf=\"_collapsedBreadcrumbItems.length\"\n [fdMenuTrigger]=\"menu\"\n #overflowBreadcrumbsContainer\n>\n <a\n fd-link\n tabindex=\"0\"\n class=\"fd-breadcrumb__collapsed\"\n (keydown.enter)=\"_keyDownHandle($event)\"\n (keydown.space)=\"_keyDownHandle($event)\"\n >\n ...\n <fd-icon glyph=\"slim-arrow-down\"></fd-icon>\n </a>\n</span>\n\n<ng-content></ng-content>\n", styles: ["/*!\n * Fundamental Library Styles v0.24.2\n * Copyright (c) 2022 SAP SE or an SAP affiliate company.\n * Licensed under Apache License 2.0 (https://github.com/SAP/fundamental-styles/blob/main/LICENSE)\n *//*!\n.fd-breadcrumb\n .fd-breadcrumb__item\n .fd-breadcrump__link\n*/.fd-breadcrumb{-webkit-box-sizing:border-box;-ms-flex-wrap:wrap;align-items:center;border:0;box-sizing:border-box;color:var(--sapTextColor);display:flex;flex-wrap:wrap;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;line-height:var(--sapContent_LineHeight);list-style:none;margin:0;padding:0}.fd-breadcrumb:after,.fd-breadcrumb:before{box-sizing:inherit;font-size:inherit}.fd-breadcrumb__item{-webkit-box-sizing:border-box;border:0;box-sizing:border-box;color:var(--sapTextColor);color:var(--sapContent_LabelColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;line-height:var(--sapContent_LineHeight);margin:0;padding:0}.fd-breadcrumb__item:after,.fd-breadcrumb__item:before{box-sizing:inherit;font-size:inherit}.fd-breadcrumb__item:after{color:var(--sapContent_LabelColor);content:\"/\";margin-left:.25rem;margin-right:.25rem}.fd-breadcrumb__item:last-child:after{content:none}.fd-breadcrumb__item .fd-breadcrumb__popover-body{border:none;border-top-left-radius:.125rem;border-top-right-radius:.125rem}.fd-breadcrumb{display:inline-block;white-space:nowrap}.fd-breadcrumb .fd-breadcrumb__collapsed{cursor:pointer}\n"], components: [{ type: i2.MenuComponent, selector: "fd-menu", inputs: ["mobile", "disabled", "focusTrapped", "openOnHoverTime", "mobileConfig", "ariaLabel", "ariaLabelledby", "id"], outputs: ["activePath"] }, { type: i2.MenuItemComponent, selector: "li[fd-menu-item]", inputs: ["disabled", "itemId", "submenu"], outputs: ["onSelect"], exportAs: ["fd-menu-item"] }, { type: i2.MenuAddonDirective, selector: "fd-menu-addon", inputs: ["position", "glyph", "submenuIndicator", "ariaHidden"] }, { type: i3.LinkComponent, selector: "[fdLink], [fd-link], [fd-breadcrumb-link]", inputs: ["class", "emphasized", "disabled", "inverted", "subtle", "undecorated"] }, { type: i4.IconComponent, selector: "fd-icon", inputs: ["glyph", "font", "class", "ariaLabel"] }], directives: [{ type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.MenuInteractiveDirective, selector: "[fd-menu-interactive]" }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.MenuTitleDirective, selector: "[fd-menu-title]" }, { type: i6.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { type: i2.MenuTriggerDirective, selector: "[fdMenuTrigger]", inputs: ["fdMenuTrigger"] }], pipes: { "async": i5.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
171
179
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: BreadcrumbComponent, decorators: [{
|
|
172
180
|
type: Component,
|
|
173
181
|
args: [{ selector: 'fd-breadcrumb', host: {
|
|
174
182
|
class: 'fd-breadcrumb'
|
|
175
|
-
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<fd-menu #menu [closeOnEscapeKey]=\"true\" [focusAutoCapture]=\"true\" [placement]=\"
|
|
183
|
+
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<fd-menu #menu [closeOnEscapeKey]=\"true\" [focusAutoCapture]=\"true\" [placement]=\"_placement$ | async\">\n <ng-container *ngFor=\"let breadcrumbItem of _collapsedBreadcrumbItems\">\n <li fd-menu-item [disabled]=\"breadcrumbItem.breadcrumbLink ? breadcrumbItem.breadcrumbLink.disabled : false\">\n <a\n fd-menu-interactive\n (click)=\"itemClicked(breadcrumbItem, $event)\"\n (keydown.enter)=\"itemClicked(breadcrumbItem, $event)\"\n (keydown.space)=\"itemClicked(breadcrumbItem, $event)\"\n >\n <ng-container *ngIf=\"breadcrumbItem?.breadcrumbLink; else portalContent\">\n <ng-container *ngIf=\"breadcrumbItem.breadcrumbLink._prefixIconName\">\n <fd-menu-addon\n position=\"before\"\n [glyph]=\"breadcrumbItem.breadcrumbLink._prefixIconName\"\n ></fd-menu-addon>\n </ng-container>\n <span fd-menu-title>\n <ng-container [cdkPortalOutlet]=\"breadcrumbItem.linkContentPortal\"></ng-container>\n </span>\n <ng-container *ngIf=\"breadcrumbItem.breadcrumbLink._postfixIconName\">\n <fd-menu-addon [glyph]=\"breadcrumbItem.breadcrumbLink._postfixIconName\"></fd-menu-addon>\n </ng-container>\n </ng-container>\n <ng-template #portalContent>\n <span fd-menu-title>\n <ng-container [cdkPortalOutlet]=\"breadcrumbItem.breadcrumbItemPortal\"></ng-container>\n </span>\n </ng-template>\n </a>\n </li>\n </ng-container>\n</fd-menu>\n\n<span\n class=\"fd-breadcrumb__item\"\n *ngIf=\"_collapsedBreadcrumbItems.length\"\n [fdMenuTrigger]=\"menu\"\n #overflowBreadcrumbsContainer\n>\n <a\n fd-link\n tabindex=\"0\"\n class=\"fd-breadcrumb__collapsed\"\n (keydown.enter)=\"_keyDownHandle($event)\"\n (keydown.space)=\"_keyDownHandle($event)\"\n >\n ...\n <fd-icon glyph=\"slim-arrow-down\"></fd-icon>\n </a>\n</span>\n\n<ng-content></ng-content>\n", styles: ["/*!\n * Fundamental Library Styles v0.24.2\n * Copyright (c) 2022 SAP SE or an SAP affiliate company.\n * Licensed under Apache License 2.0 (https://github.com/SAP/fundamental-styles/blob/main/LICENSE)\n *//*!\n.fd-breadcrumb\n .fd-breadcrumb__item\n .fd-breadcrump__link\n*/.fd-breadcrumb{-webkit-box-sizing:border-box;-ms-flex-wrap:wrap;align-items:center;border:0;box-sizing:border-box;color:var(--sapTextColor);display:flex;flex-wrap:wrap;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;line-height:var(--sapContent_LineHeight);list-style:none;margin:0;padding:0}.fd-breadcrumb:after,.fd-breadcrumb:before{box-sizing:inherit;font-size:inherit}.fd-breadcrumb__item{-webkit-box-sizing:border-box;border:0;box-sizing:border-box;color:var(--sapTextColor);color:var(--sapContent_LabelColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;line-height:var(--sapContent_LineHeight);margin:0;padding:0}.fd-breadcrumb__item:after,.fd-breadcrumb__item:before{box-sizing:inherit;font-size:inherit}.fd-breadcrumb__item:after{color:var(--sapContent_LabelColor);content:\"/\";margin-left:.25rem;margin-right:.25rem}.fd-breadcrumb__item:last-child:after{content:none}.fd-breadcrumb__item .fd-breadcrumb__popover-body{border:none;border-top-left-radius:.125rem;border-top-right-radius:.125rem}.fd-breadcrumb{display:inline-block;white-space:nowrap}.fd-breadcrumb .fd-breadcrumb__collapsed{cursor:pointer}\n"] }]
|
|
176
184
|
}], ctorParameters: function () {
|
|
177
185
|
return [{ type: i0.ElementRef }, { type: i1.RtlService, decorators: [{
|
|
178
186
|
type: Optional
|
|
179
187
|
}] }, { type: i0.ChangeDetectorRef }, { type: i1.ResizeObserverService }, { type: i0.NgZone }];
|
|
180
|
-
}, propDecorators: {
|
|
188
|
+
}, propDecorators: { _breadcrumbItems: [{
|
|
181
189
|
type: ContentChildren,
|
|
182
190
|
args: [forwardRef(() => BreadcrumbItemComponent)]
|
|
183
|
-
}],
|
|
191
|
+
}], _menuComponent: [{
|
|
184
192
|
type: ViewChild,
|
|
185
193
|
args: [MenuComponent]
|
|
194
|
+
}], _overflowContainer: [{
|
|
195
|
+
type: ViewChild,
|
|
196
|
+
args: ['overflowBreadcrumbsContainer']
|
|
186
197
|
}], containerElement: [{
|
|
187
198
|
type: Input
|
|
188
199
|
}], reverse: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fundamental-ngx-core-breadcrumb.mjs","sources":["../../../../libs/core/src/lib/breadcrumb/breadcrumb-item.component.ts","../../../../libs/core/src/lib/breadcrumb/breadcrumb.component.ts","../../../../libs/core/src/lib/breadcrumb/breadcrumb.component.html","../../../../libs/core/src/lib/breadcrumb/deprecated-breadcrumbs-compact.directive.ts","../../../../libs/core/src/lib/breadcrumb/breadcrumb.module.ts","../../../../libs/core/src/lib/breadcrumb/fundamental-ngx-core-breadcrumb.ts"],"sourcesContent":["import {\n AfterViewInit,\n ChangeDetectorRef,\n Component,\n ContentChild,\n ElementRef,\n forwardRef,\n Renderer2\n} from '@angular/core';\nimport { LinkComponent } from '@fundamental-ngx/core/link';\nimport { DomPortal } from '@angular/cdk/portal';\n\n/**\n * Breadcrumb item directive. Must have child breadcrumb link directives.\n *\n * ```html\n * <fd-breadcrumb-item>\n * <a fd-link [routerLink]=\"'#'\">Breadcrumb Link</a>\n * </fd-breadcrumb-item>\n * ```\n */\n@Component({\n selector: 'fd-breadcrumb-item',\n template: '<div style=\"display: inline\"><ng-content></ng-content></div>',\n host: {\n class: 'fd-breadcrumb__item'\n }\n})\nexport class BreadcrumbItemComponent implements AfterViewInit {\n /** @hidden */\n get elementRef(): ElementRef<HTMLElement> {\n return this._elementRef;\n }\n\n /** @hidden */\n @ContentChild(forwardRef(() => LinkComponent))\n breadcrumbLink: LinkComponent;\n\n /** @hidden */\n get width(): number {\n return this._elementRef.nativeElement.getBoundingClientRect().width;\n }\n\n /** In case there is no link in Item and breadcrumb item is non-interactive, we move whole item content to menu item title */\n breadcrumbItemPortal: DomPortal<Element>;\n\n /** When breadcrumb item has link in it, we are moving link content to menu item title */\n linkContentPortal: DomPortal;\n\n constructor(\n private _elementRef: ElementRef<HTMLElement>,\n private renderer2: Renderer2,\n private _cdR: ChangeDetectorRef\n ) {}\n\n /** @hidden */\n get needsClickProxy(): boolean {\n return (\n !!this.breadcrumbLink?.elementRef().nativeElement.getAttribute('href') || !!this.breadcrumbLink.routerLink\n );\n }\n\n show = (): void => this.renderer2.setStyle(this._elementRef.nativeElement, 'display', 'inline-block');\n hide = (): void => this.renderer2.setStyle(this._elementRef.nativeElement, 'display', 'none');\n\n /** @hidden */\n ngAfterViewInit(): void {\n if (this.breadcrumbLink) {\n this.linkContentPortal = new DomPortal<HTMLElement>(this.breadcrumbLink.contentSpan.nativeElement);\n }\n this.breadcrumbItemPortal = new DomPortal(this.elementRef.nativeElement.firstElementChild as Element);\n this._cdR.detectChanges();\n }\n}\n","import {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n ElementRef,\n forwardRef,\n Input,\n NgZone,\n OnDestroy,\n OnInit,\n Optional,\n QueryList,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport { BreadcrumbItemComponent } from './breadcrumb-item.component';\nimport { ResizeObserverService, RtlService } from '@fundamental-ngx/core/utils';\nimport { BehaviorSubject, firstValueFrom, map, startWith, Subscription, tap } from 'rxjs';\nimport { MenuComponent } from '@fundamental-ngx/core/menu';\nimport { Placement } from '@fundamental-ngx/core/shared';\n\n/**\n * Breadcrumb parent wrapper directive. Must have breadcrumb item child directives.\n *\n * ```html\n * <fd-breadcrumb>\n * <fd-breadcrumb-item>\n * <a fd-link [routerLink]=\"'#'\">Breadcrumb Link</a>\n * </fd-breadcrumb-item>\n * </fd-breadcrumb>\n * ```\n */\n@Component({\n // TODO to be discussed\n // eslint-disable-next-line\n selector: 'fd-breadcrumb',\n host: {\n class: 'fd-breadcrumb'\n },\n templateUrl: './breadcrumb.component.html',\n styleUrls: ['./breadcrumb.component.scss'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class BreadcrumbComponent implements AfterViewInit, OnInit, OnDestroy {\n /** @hidden */\n @ContentChildren(forwardRef(() => BreadcrumbItemComponent))\n breadcrumbItems: QueryList<BreadcrumbItemComponent>;\n\n /** @hidden */\n @ViewChild(MenuComponent)\n menuComponent: MenuComponent;\n\n /** @hidden */\n collapsedBreadcrumbItems: Array<BreadcrumbItemComponent> = [];\n\n /** @hidden */\n placement$ = new BehaviorSubject<Placement>('bottom-start');\n\n /**\n * The element to act as the breadcrumb container. When provided, the breadcrumb's responsive collapsing behavior\n * performs better. When not provided, the immediate parent element's width will be used.\n */\n @Input()\n containerElement: HTMLElement;\n\n /** Whether to append items to the overflow dropdown in reverse order. Default is true. */\n @Input()\n reverse = false;\n\n /** @hidden */\n containerBoundary: number;\n\n /** @hidden */\n private _subscriptions = new Subscription();\n\n /** @hidden */\n private _itemToSize = new Map<BreadcrumbItemComponent, number>();\n\n constructor(\n public elementRef: ElementRef<Element>,\n @Optional() private _rtlService: RtlService,\n private _cdRef: ChangeDetectorRef,\n private _resizeObserver: ResizeObserverService,\n private _ngZone: NgZone\n ) {}\n\n /** @hidden */\n ngOnInit(): void {\n if (this._rtlService) {\n this._subscriptions.add(\n this._rtlService.rtl.subscribe((value) => this.placement$.next(value ? 'bottom-end' : 'bottom-start'))\n );\n }\n }\n\n ngAfterViewInit(): void {\n this._subscriptions.add(\n this.breadcrumbItems.changes\n .pipe(\n startWith(this.breadcrumbItems),\n map((items) => items.toArray() as BreadcrumbItemComponent[]),\n map((items) => items.map((item) => [item, item.width]) as [BreadcrumbItemComponent, number][]),\n tap((itemToSize: [BreadcrumbItemComponent, number][]) => (this._itemToSize = new Map(itemToSize)))\n )\n .subscribe()\n );\n firstValueFrom(this._ngZone.onStable).then(() => {\n this._subscriptions.add(\n this._resizeObserver\n .observe(this.containerElement || (this.elementRef.nativeElement.parentElement as Element))\n .subscribe(() => this.onResize())\n );\n });\n }\n\n /** @hidden */\n ngOnDestroy(): void {\n this._subscriptions.unsubscribe();\n }\n\n /** @hidden */\n onResize(): void {\n if (!this.elementRef.nativeElement.parentElement) {\n return;\n }\n this.containerBoundary = this.elementRef.nativeElement.parentElement.getBoundingClientRect().width;\n\n if (this.containerElement) {\n this.containerBoundary = this.containerElement.getBoundingClientRect().width;\n }\n\n let visibleSum = 0;\n const breadcrumbItemComponents = this.breadcrumbItems.toArray();\n let i;\n for (i = breadcrumbItemComponents.length - 1; i >= 0; i--) {\n const breadcrumbItem = breadcrumbItemComponents[i];\n const itemSize = this._itemToSize.has(breadcrumbItem)\n ? (this._itemToSize.get(breadcrumbItem) as number)\n : breadcrumbItem.width;\n if (visibleSum + itemSize <= this.containerBoundary) {\n visibleSum += itemSize;\n breadcrumbItem.show();\n } else {\n break;\n }\n }\n const collapsedBreadcrumbItems = breadcrumbItemComponents.slice(0, ++i);\n this.collapsedBreadcrumbItems = this.reverse ? collapsedBreadcrumbItems : collapsedBreadcrumbItems.reverse();\n this.collapsedBreadcrumbItems.forEach((item) => item.hide());\n this._cdRef.detectChanges();\n }\n\n /** @hidden */\n keyDownHandle(event: Event): void {\n this.menuComponent.toggle();\n event.preventDefault();\n }\n\n /**\n * We catch interactions with item, Enter, Space, Mouse click and Touch click,\n * if original element had router link we are proxying click to that element\n * */\n itemClicked(breadcrumbItem: BreadcrumbItemComponent, $event: any): void {\n if (breadcrumbItem.needsClickProxy) {\n $event.preventDefault();\n breadcrumbItem.breadcrumbLink.elementRef().nativeElement.click();\n }\n }\n}\n","<fd-menu #menu [closeOnEscapeKey]=\"true\" [focusAutoCapture]=\"true\" [placement]=\"placement$ | async\">\n <ng-container *ngFor=\"let breadcrumbItem of collapsedBreadcrumbItems\">\n <li fd-menu-item [disabled]=\"breadcrumbItem.breadcrumbLink ? breadcrumbItem.breadcrumbLink.disabled : false\">\n <a\n fd-menu-interactive\n (click)=\"itemClicked(breadcrumbItem, $event)\"\n (keydown.enter)=\"itemClicked(breadcrumbItem, $event)\"\n (keydown.space)=\"itemClicked(breadcrumbItem, $event)\"\n >\n <ng-container *ngIf=\"breadcrumbItem?.breadcrumbLink; else portalContent\">\n <ng-container *ngIf=\"breadcrumbItem.breadcrumbLink._prefixIconName\">\n <fd-menu-addon\n position=\"before\"\n [glyph]=\"breadcrumbItem.breadcrumbLink._prefixIconName\"\n ></fd-menu-addon>\n </ng-container>\n <span fd-menu-title>\n <ng-container [cdkPortalOutlet]=\"breadcrumbItem.linkContentPortal\"></ng-container>\n </span>\n <ng-container *ngIf=\"breadcrumbItem.breadcrumbLink._postfixIconName\">\n <fd-menu-addon [glyph]=\"breadcrumbItem.breadcrumbLink._postfixIconName\"></fd-menu-addon>\n </ng-container>\n </ng-container>\n <ng-template #portalContent>\n <span fd-menu-title>\n <ng-container [cdkPortalOutlet]=\"breadcrumbItem.breadcrumbItemPortal\"></ng-container>\n </span>\n </ng-template>\n </a>\n </li>\n </ng-container>\n</fd-menu>\n\n<span class=\"fd-breadcrumb__item\" *ngIf=\"collapsedBreadcrumbItems.length\" [fdMenuTrigger]=\"menu\">\n <a\n fd-link\n tabindex=\"0\"\n class=\"fd-breadcrumb__collapsed\"\n (keydown.enter)=\"keyDownHandle($event)\"\n (keydown.space)=\"keyDownHandle($event)\"\n >\n ...\n <fd-icon glyph=\"slim-arrow-down\"></fd-icon>\n </a>\n</span>\n\n<ng-content></ng-content>\n","import { Directive, forwardRef } from '@angular/core';\nimport { CONTENT_DENSITY_DIRECTIVE, DeprecatedCompactDirective } from '@fundamental-ngx/core/content-density';\n\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: 'fd-breadcrumb[compact]',\n providers: [\n {\n provide: CONTENT_DENSITY_DIRECTIVE,\n useExisting: forwardRef(() => DeprecatedBreadcrumbsCompactDirective)\n }\n ]\n})\nexport class DeprecatedBreadcrumbsCompactDirective extends DeprecatedCompactDirective {\n constructor() {\n super('fd-breadcrumb');\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { BreadcrumbComponent } from './breadcrumb.component';\nimport { BreadcrumbItemComponent } from './breadcrumb-item.component';\nimport { IconModule } from '@fundamental-ngx/core/icon';\nimport { PopoverModule } from '@fundamental-ngx/core/popover';\nimport { MenuModule } from '@fundamental-ngx/core/menu';\nimport { LinkModule } from '@fundamental-ngx/core/link';\nimport { PortalModule } from '@angular/cdk/portal';\nimport { PipeModule } from '@fundamental-ngx/core/utils';\nimport { DeprecatedBreadcrumbsCompactDirective } from './deprecated-breadcrumbs-compact.directive';\nimport { ContentDensityModule } from '@fundamental-ngx/core/content-density';\n\n@NgModule({\n imports: [\n CommonModule,\n IconModule,\n PopoverModule,\n MenuModule,\n LinkModule,\n PortalModule,\n PipeModule,\n ContentDensityModule\n ],\n exports: [\n BreadcrumbComponent,\n BreadcrumbItemComponent,\n LinkModule,\n DeprecatedBreadcrumbsCompactDirective,\n ContentDensityModule\n ],\n declarations: [BreadcrumbComponent, BreadcrumbItemComponent, DeprecatedBreadcrumbsCompactDirective]\n})\nexport class BreadcrumbModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAYA;;;;;;;;;MAgBa,uBAAuB;IAqBhC,YACY,WAAoC,EACpC,SAAoB,EACpB,IAAuB;QAFvB,gBAAW,GAAX,WAAW,CAAyB;QACpC,cAAS,GAAT,SAAS,CAAW;QACpB,SAAI,GAAJ,IAAI,CAAmB;QAUnC,SAAI,GAAG,MAAY,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC;QACtG,SAAI,GAAG,MAAY,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;KAV1F;;IAvBJ,IAAI,UAAU;QACV,OAAO,IAAI,CAAC,WAAW,CAAC;KAC3B;;IAOD,IAAI,KAAK;QACL,OAAO,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,qBAAqB,EAAE,CAAC,KAAK,CAAC;KACvE;;IAeD,IAAI,eAAe;;QACf,QACI,CAAC,EAAC,MAAA,IAAI,CAAC,cAAc,0CAAE,UAAU,GAAG,aAAa,CAAC,YAAY,CAAC,MAAM,CAAC,CAAA,IAAI,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,UAAU,EAC5G;KACL;;IAMD,eAAe;QACX,IAAI,IAAI,CAAC,cAAc,EAAE;YACrB,IAAI,CAAC,iBAAiB,GAAG,IAAI,SAAS,CAAc,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;SACtG;QACD,IAAI,CAAC,oBAAoB,GAAG,IAAI,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,iBAA4B,CAAC,CAAC;QACtG,IAAI,CAAC,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AU;wBACV,oBAAoB;qBACvB;oBACD,OAAO,EAAE;wBACL,mBAAmB;wBACnB,uBAAuB;wBACvB,UAAU;wBACV,qCAAqC;wBACrC,oBAAoB;qBACvB;oBACD,YAAY,EAAE,CAAC,mBAAmB,EAAE,uBAAuB,EAAE,qCAAqC,CAAC;iBACtG;;;ACjCD;;;;;;"}
|
|
1
|
+
{"version":3,"file":"fundamental-ngx-core-breadcrumb.mjs","sources":["../../../../libs/core/src/lib/breadcrumb/breadcrumb-item.component.ts","../../../../libs/core/src/lib/breadcrumb/breadcrumb.component.ts","../../../../libs/core/src/lib/breadcrumb/breadcrumb.component.html","../../../../libs/core/src/lib/breadcrumb/deprecated-breadcrumbs-compact.directive.ts","../../../../libs/core/src/lib/breadcrumb/breadcrumb.module.ts","../../../../libs/core/src/lib/breadcrumb/fundamental-ngx-core-breadcrumb.ts"],"sourcesContent":["import {\n AfterViewInit,\n ChangeDetectorRef,\n Component,\n ContentChild,\n ElementRef,\n forwardRef,\n Renderer2\n} from '@angular/core';\nimport { LinkComponent } from '@fundamental-ngx/core/link';\nimport { DomPortal } from '@angular/cdk/portal';\n\n/**\n * Breadcrumb item directive. Must have child breadcrumb link directives.\n *\n * ```html\n * <fd-breadcrumb-item>\n * <a fd-link [routerLink]=\"'#'\">Breadcrumb Link</a>\n * </fd-breadcrumb-item>\n * ```\n */\n@Component({\n selector: 'fd-breadcrumb-item',\n template: '<div style=\"display: inline\"><ng-content></ng-content></div>',\n host: {\n class: 'fd-breadcrumb__item'\n }\n})\nexport class BreadcrumbItemComponent implements AfterViewInit {\n /** @hidden */\n get elementRef(): ElementRef<HTMLElement> {\n return this._elementRef;\n }\n\n /** @hidden */\n @ContentChild(forwardRef(() => LinkComponent))\n breadcrumbLink: LinkComponent;\n\n /** @hidden */\n get width(): number {\n return this._elementRef.nativeElement.getBoundingClientRect().width;\n }\n\n /** In case there is no link in Item and breadcrumb item is non-interactive, we move whole item content to menu item title */\n breadcrumbItemPortal: DomPortal<Element>;\n\n /** When breadcrumb item has link in it, we are moving link content to menu item title */\n linkContentPortal: DomPortal;\n\n constructor(\n private _elementRef: ElementRef<HTMLElement>,\n private renderer2: Renderer2,\n private _cdR: ChangeDetectorRef\n ) {}\n\n /** @hidden */\n get needsClickProxy(): boolean {\n return (\n !!this.breadcrumbLink?.elementRef().nativeElement.getAttribute('href') || !!this.breadcrumbLink.routerLink\n );\n }\n\n show = (): void => this.renderer2.setStyle(this._elementRef.nativeElement, 'display', 'inline-block');\n hide = (): void => this.renderer2.setStyle(this._elementRef.nativeElement, 'display', 'none');\n\n /** @hidden */\n ngAfterViewInit(): void {\n if (this.breadcrumbLink) {\n this.linkContentPortal = new DomPortal<HTMLElement>(this.breadcrumbLink.contentSpan.nativeElement);\n }\n this.breadcrumbItemPortal = new DomPortal(this.elementRef.nativeElement.firstElementChild as Element);\n this._cdR.detectChanges();\n }\n}\n","import {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n ElementRef,\n forwardRef,\n Input,\n NgZone,\n OnDestroy,\n OnInit,\n Optional,\n QueryList,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport { BreadcrumbItemComponent } from './breadcrumb-item.component';\nimport { ResizeObserverService, RtlService } from '@fundamental-ngx/core/utils';\nimport { BehaviorSubject, debounceTime, firstValueFrom, map, startWith, Subscription, tap } from 'rxjs';\nimport { MenuComponent } from '@fundamental-ngx/core/menu';\nimport { Placement } from '@fundamental-ngx/core/shared';\n\n/**\n * Breadcrumb parent wrapper directive. Must have breadcrumb item child directives.\n *\n * ```html\n * <fd-breadcrumb>\n * <fd-breadcrumb-item>\n * <a fd-link [routerLink]=\"'#'\">Breadcrumb Link</a>\n * </fd-breadcrumb-item>\n * </fd-breadcrumb>\n * ```\n */\n@Component({\n // TODO to be discussed\n // eslint-disable-next-line\n selector: 'fd-breadcrumb',\n host: {\n class: 'fd-breadcrumb'\n },\n templateUrl: './breadcrumb.component.html',\n styleUrls: ['./breadcrumb.component.scss'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class BreadcrumbComponent implements AfterViewInit, OnInit, OnDestroy {\n /** @hidden */\n @ContentChildren(forwardRef(() => BreadcrumbItemComponent))\n _breadcrumbItems: QueryList<BreadcrumbItemComponent>;\n\n /** @hidden */\n @ViewChild(MenuComponent)\n _menuComponent: MenuComponent;\n\n @ViewChild('overflowBreadcrumbsContainer')\n private readonly _overflowContainer: ElementRef<HTMLElement>;\n\n /** @hidden */\n _collapsedBreadcrumbItems: Array<BreadcrumbItemComponent> = [];\n\n /** @hidden */\n _placement$ = new BehaviorSubject<Placement>('bottom-start');\n\n /**\n * The element to act as the breadcrumb container. When provided, the breadcrumb's responsive collapsing behavior\n * performs better. When not provided, the immediate parent element's width will be used.\n */\n @Input()\n containerElement: HTMLElement;\n\n /** Whether to append items to the overflow dropdown in reverse order. Default is true. */\n @Input()\n reverse = false;\n\n /** @hidden */\n _containerBoundary: number;\n\n /** @hidden */\n private _subscriptions = new Subscription();\n\n /** @hidden */\n private _itemToSize = new Map<BreadcrumbItemComponent, number>();\n\n constructor(\n public readonly elementRef: ElementRef<Element>,\n @Optional() private readonly _rtlService: RtlService | null,\n private readonly _cdRef: ChangeDetectorRef,\n private readonly _resizeObserver: ResizeObserverService,\n private readonly _ngZone: NgZone\n ) {}\n\n /** @hidden */\n ngOnInit(): void {\n if (this._rtlService) {\n this._subscriptions.add(\n this._rtlService.rtl.subscribe((value) => this._placement$.next(value ? 'bottom-end' : 'bottom-start'))\n );\n }\n }\n\n /** @hidden */\n ngAfterViewInit(): void {\n this._subscriptions.add(\n this._breadcrumbItems.changes\n .pipe(\n startWith(this._breadcrumbItems),\n map((items) => items.toArray() as BreadcrumbItemComponent[]),\n map((items) => items.map((item) => [item, item.width]) as [BreadcrumbItemComponent, number][]),\n tap((itemToSize: [BreadcrumbItemComponent, number][]) => (this._itemToSize = new Map(itemToSize)))\n )\n .subscribe()\n );\n firstValueFrom(this._ngZone.onStable).then(() => {\n this._subscriptions.add(\n this._resizeObserver\n .observe(this.containerElement || (this.elementRef.nativeElement.parentElement as Element))\n // Add small delay for performance reasons.\n .pipe(debounceTime(30))\n .subscribe(() => this.onResize())\n );\n });\n }\n\n /** @hidden */\n ngOnDestroy(): void {\n this._subscriptions.unsubscribe();\n }\n\n /**\n * Callback function when breadcrumbs container has been resized.\n */\n onResize(): void {\n if (!this.elementRef.nativeElement.parentElement) {\n return;\n }\n this._containerBoundary = this.elementRef.nativeElement.parentElement.getBoundingClientRect().width;\n\n if (this.containerElement) {\n this._containerBoundary = this.containerElement.getBoundingClientRect().width;\n }\n\n if (this._overflowContainer) {\n this._containerBoundary -= this._overflowContainer.nativeElement.getBoundingClientRect().width;\n }\n\n let visibleSum = 0;\n const breadcrumbItemComponents = this._breadcrumbItems.toArray();\n let i;\n for (i = breadcrumbItemComponents.length - 1; i >= 0; i--) {\n const breadcrumbItem = breadcrumbItemComponents[i];\n const itemSize = this._itemToSize.has(breadcrumbItem)\n ? (this._itemToSize.get(breadcrumbItem) as number)\n : breadcrumbItem.width;\n if (visibleSum + itemSize <= this._containerBoundary) {\n visibleSum += itemSize;\n breadcrumbItem.show();\n } else {\n break;\n }\n }\n const collapsedBreadcrumbItems = breadcrumbItemComponents.slice(0, ++i);\n this._collapsedBreadcrumbItems = this.reverse ? collapsedBreadcrumbItems : collapsedBreadcrumbItems.reverse();\n this._collapsedBreadcrumbItems.forEach((item) => item.hide());\n this._cdRef.detectChanges();\n }\n\n /** @hidden */\n _keyDownHandle(event: Event): void {\n this._menuComponent.toggle();\n event.preventDefault();\n }\n\n /**\n * We catch interactions with item, Enter, Space, Mouse click and Touch click,\n * if original element had router link we are proxying click to that element\n * */\n itemClicked(breadcrumbItem: BreadcrumbItemComponent, $event: any): void {\n if (breadcrumbItem.needsClickProxy) {\n $event.preventDefault();\n breadcrumbItem.breadcrumbLink.elementRef().nativeElement.click();\n }\n }\n}\n","<fd-menu #menu [closeOnEscapeKey]=\"true\" [focusAutoCapture]=\"true\" [placement]=\"_placement$ | async\">\n <ng-container *ngFor=\"let breadcrumbItem of _collapsedBreadcrumbItems\">\n <li fd-menu-item [disabled]=\"breadcrumbItem.breadcrumbLink ? breadcrumbItem.breadcrumbLink.disabled : false\">\n <a\n fd-menu-interactive\n (click)=\"itemClicked(breadcrumbItem, $event)\"\n (keydown.enter)=\"itemClicked(breadcrumbItem, $event)\"\n (keydown.space)=\"itemClicked(breadcrumbItem, $event)\"\n >\n <ng-container *ngIf=\"breadcrumbItem?.breadcrumbLink; else portalContent\">\n <ng-container *ngIf=\"breadcrumbItem.breadcrumbLink._prefixIconName\">\n <fd-menu-addon\n position=\"before\"\n [glyph]=\"breadcrumbItem.breadcrumbLink._prefixIconName\"\n ></fd-menu-addon>\n </ng-container>\n <span fd-menu-title>\n <ng-container [cdkPortalOutlet]=\"breadcrumbItem.linkContentPortal\"></ng-container>\n </span>\n <ng-container *ngIf=\"breadcrumbItem.breadcrumbLink._postfixIconName\">\n <fd-menu-addon [glyph]=\"breadcrumbItem.breadcrumbLink._postfixIconName\"></fd-menu-addon>\n </ng-container>\n </ng-container>\n <ng-template #portalContent>\n <span fd-menu-title>\n <ng-container [cdkPortalOutlet]=\"breadcrumbItem.breadcrumbItemPortal\"></ng-container>\n </span>\n </ng-template>\n </a>\n </li>\n </ng-container>\n</fd-menu>\n\n<span\n class=\"fd-breadcrumb__item\"\n *ngIf=\"_collapsedBreadcrumbItems.length\"\n [fdMenuTrigger]=\"menu\"\n #overflowBreadcrumbsContainer\n>\n <a\n fd-link\n tabindex=\"0\"\n class=\"fd-breadcrumb__collapsed\"\n (keydown.enter)=\"_keyDownHandle($event)\"\n (keydown.space)=\"_keyDownHandle($event)\"\n >\n ...\n <fd-icon glyph=\"slim-arrow-down\"></fd-icon>\n </a>\n</span>\n\n<ng-content></ng-content>\n","import { Directive, forwardRef } from '@angular/core';\nimport { CONTENT_DENSITY_DIRECTIVE, DeprecatedCompactDirective } from '@fundamental-ngx/core/content-density';\n\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: 'fd-breadcrumb[compact]',\n providers: [\n {\n provide: CONTENT_DENSITY_DIRECTIVE,\n useExisting: forwardRef(() => DeprecatedBreadcrumbsCompactDirective)\n }\n ]\n})\nexport class DeprecatedBreadcrumbsCompactDirective extends DeprecatedCompactDirective {\n constructor() {\n super('fd-breadcrumb');\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { BreadcrumbComponent } from './breadcrumb.component';\nimport { BreadcrumbItemComponent } from './breadcrumb-item.component';\nimport { IconModule } from '@fundamental-ngx/core/icon';\nimport { PopoverModule } from '@fundamental-ngx/core/popover';\nimport { MenuModule } from '@fundamental-ngx/core/menu';\nimport { LinkModule } from '@fundamental-ngx/core/link';\nimport { PortalModule } from '@angular/cdk/portal';\nimport { PipeModule } from '@fundamental-ngx/core/utils';\nimport { DeprecatedBreadcrumbsCompactDirective } from './deprecated-breadcrumbs-compact.directive';\nimport { ContentDensityModule } from '@fundamental-ngx/core/content-density';\n\n@NgModule({\n imports: [\n CommonModule,\n IconModule,\n PopoverModule,\n MenuModule,\n LinkModule,\n PortalModule,\n PipeModule,\n ContentDensityModule\n ],\n exports: [\n BreadcrumbComponent,\n BreadcrumbItemComponent,\n LinkModule,\n DeprecatedBreadcrumbsCompactDirective,\n ContentDensityModule\n ],\n declarations: [BreadcrumbComponent, BreadcrumbItemComponent, DeprecatedBreadcrumbsCompactDirective]\n})\nexport class BreadcrumbModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAYA;;;;;;;;;MAgBa,uBAAuB;IAqBhC,YACY,WAAoC,EACpC,SAAoB,EACpB,IAAuB;QAFvB,gBAAW,GAAX,WAAW,CAAyB;QACpC,cAAS,GAAT,SAAS,CAAW;QACpB,SAAI,GAAJ,IAAI,CAAmB;QAUnC,SAAI,GA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;wBACV,qCAAqC;wBACrC,oBAAoB;qBACvB;oBACD,YAAY,EAAE,CAAC,mBAAmB,EAAE,uBAAuB,EAAE,qCAAqC,CAAC;iBACtG;;;ACjCD;;;;;;"}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Component, ViewEncapsulation, ChangeDetectionStrategy, Input, HostBinding, Directive, NgModule } from '@angular/core';
|
|
3
|
-
import * as
|
|
3
|
+
import * as i2 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
import { __decorate, __metadata } from 'tslib';
|
|
6
6
|
import { applyCssClass } from '@fundamental-ngx/core/utils';
|
|
7
7
|
import { Subscription, fromEvent } from 'rxjs';
|
|
8
|
+
import * as i1 from '@angular/platform-browser';
|
|
8
9
|
|
|
9
10
|
let illustratedMessageUniqueId = 0;
|
|
10
11
|
class IllustratedMessageComponent {
|
|
11
12
|
/** @hidden */
|
|
12
|
-
constructor(_elementRef, _cdRef) {
|
|
13
|
+
constructor(_elementRef, _cdRef, _sanitizer) {
|
|
13
14
|
this._elementRef = _elementRef;
|
|
14
15
|
this._cdRef = _cdRef;
|
|
16
|
+
this._sanitizer = _sanitizer;
|
|
15
17
|
/**
|
|
16
18
|
* The type of the Illustrated Message
|
|
17
19
|
* Options include: 'scene' | 'spot' | 'dialog'
|
|
@@ -63,40 +65,43 @@ class IllustratedMessageComponent {
|
|
|
63
65
|
}
|
|
64
66
|
/** @hidden */
|
|
65
67
|
_constructHref() {
|
|
66
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
68
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
69
|
+
let inlineSvg;
|
|
70
|
+
this._inlineSvg = undefined;
|
|
67
71
|
if (this.svgConfig) {
|
|
68
72
|
switch (this.type) {
|
|
69
73
|
case 'scene':
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
this._cdRef.detectChanges();
|
|
76
|
-
}
|
|
74
|
+
this._isSmallScreen = window.innerWidth < 600;
|
|
75
|
+
inlineSvg = this._isSmallScreen ? (_a = this.svgConfig.dialog) === null || _a === void 0 ? void 0 : _a.file : (_b = this.svgConfig.scene) === null || _b === void 0 ? void 0 : _b.file;
|
|
76
|
+
this._href = this._isSmallScreen
|
|
77
|
+
? `${((_c = this.svgConfig.dialog) === null || _c === void 0 ? void 0 : _c.url) || ''}#${(_d = this.svgConfig.dialog) === null || _d === void 0 ? void 0 : _d.id}`
|
|
78
|
+
: `${((_e = this.svgConfig.scene) === null || _e === void 0 ? void 0 : _e.url) || ''}#${(_f = this.svgConfig.scene) === null || _f === void 0 ? void 0 : _f.id}`;
|
|
77
79
|
break;
|
|
78
80
|
case 'dialog':
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
81
|
+
inlineSvg = (_g = this.svgConfig.dialog) === null || _g === void 0 ? void 0 : _g.file;
|
|
82
|
+
this._href = `${((_h = this.svgConfig.dialog) === null || _h === void 0 ? void 0 : _h.url) || ''}#${(_j = this.svgConfig.dialog) === null || _j === void 0 ? void 0 : _j.id}`;
|
|
82
83
|
break;
|
|
83
84
|
case 'spot':
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
85
|
+
inlineSvg = (_k = this.svgConfig.spot) === null || _k === void 0 ? void 0 : _k.file;
|
|
86
|
+
this._href = `${((_l = this.svgConfig.spot) === null || _l === void 0 ? void 0 : _l.url) || ''}#${(_m = this.svgConfig.spot) === null || _m === void 0 ? void 0 : _m.id}`;
|
|
87
87
|
break;
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
+
if (inlineSvg) {
|
|
91
|
+
this._inlineSvg = this._sanitizer.bypassSecurityTrustHtml(inlineSvg);
|
|
92
|
+
}
|
|
93
|
+
this._cdRef.detectChanges();
|
|
90
94
|
}
|
|
91
95
|
}
|
|
92
|
-
IllustratedMessageComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: IllustratedMessageComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
96
|
+
IllustratedMessageComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: IllustratedMessageComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
|
|
93
97
|
IllustratedMessageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: IllustratedMessageComponent, selector: "[fd-illustrated-message]", inputs: { type: "type", svgConfig: "svgConfig", noSvg: "noSvg", id: "id", class: "class" }, host: { properties: { "attr.id": "this.id" } }, usesOnChanges: true, ngImport: i0, template: `
|
|
94
|
-
<svg class="fd-illustrated-message__illustration" *ngIf="!noSvg">
|
|
98
|
+
<svg class="fd-illustrated-message__illustration" *ngIf="!noSvg || _inlineSvg">
|
|
95
99
|
<use [attr.href]="_href"></use>
|
|
96
100
|
</svg>
|
|
101
|
+
<div *ngIf="_inlineSvg" style="display: none;" [innerHTML]="_inlineSvg"></div>
|
|
97
102
|
<ng-content select="[fd-illustrated-message-figcaption]"></ng-content>
|
|
98
103
|
<ng-content select="fd-illustrated-message-actions"></ng-content>
|
|
99
|
-
`, isInline: true, styles: ["/*!\n * Fundamental Library Styles v0.24.2\n * Copyright (c) 2022 SAP SE or an SAP affiliate company.\n * Licensed under Apache License 2.0 (https://github.com/SAP/fundamental-styles/blob/main/LICENSE)\n */.fd-illustrated-message{-webkit-box-sizing:border-box;align-items:center;border:0;box-sizing:border-box;color:var(--sapTextColor);display:flex;flex-direction:column;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;height:auto;line-height:var(--sapContent_LineHeight);margin:5rem 0 0;max-width:30rem;padding:1rem;text-align:center;width:100%}.fd-illustrated-message:after,.fd-illustrated-message:before{box-sizing:inherit;font-size:inherit}.fd-illustrated-message__illustration{-webkit-box-sizing:border-box;border:0;box-sizing:border-box;color:var(--sapTextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;height:15rem;line-height:var(--sapContent_LineHeight);margin:0;padding:0;width:20rem}.fd-illustrated-message__illustration:after,.fd-illustrated-message__illustration:before{box-sizing:inherit;font-size:inherit}.fd-illustrated-message__figcaption{-webkit-box-sizing:border-box;align-items:center;border:0;box-sizing:border-box;color:var(--sapTextColor);display:flex;flex-direction:column;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;line-height:var(--sapContent_LineHeight);margin:0;padding:0;width:100%}.fd-illustrated-message__figcaption:after,.fd-illustrated-message__figcaption:before{box-sizing:inherit;font-size:inherit}.fd-illustrated-message__title{-webkit-box-sizing:border-box;border:0;box-sizing:border-box;color:var(--sapTextColor);color:var(--sapGroup_TitleTextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-size:var(--sapFontHeader2Size);font-weight:400;font-weight:var(--sapFontHeaderWeight);line-height:var(--sapContent_LineHeight);line-height:1.3;margin:2rem 0 .5rem;padding:0;text-align:center;width:100%}.fd-illustrated-message__title:after,.fd-illustrated-message__title:before{box-sizing:inherit;font-size:inherit}.fd-illustrated-message__text{-webkit-box-sizing:border-box;border:0;box-sizing:border-box;color:var(--sapTextColor);color:var(--sapContent_LabelColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-size:var(--sapFontLargeSize);font-weight:400;line-height:var(--sapContent_LineHeight);line-height:1.4;margin:0 0 2rem;padding:0;text-align:center;width:100%}.fd-illustrated-message__text:after,.fd-illustrated-message__text:before{box-sizing:inherit;font-size:inherit}.fd-illustrated-message__actions{-webkit-box-sizing:border-box;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;border:0;box-sizing:border-box;color:var(--sapTextColor);display:flex;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;justify-content:center;line-height:var(--sapContent_LineHeight);margin:0 0 2rem;padding:0;width:100%}.fd-illustrated-message__actions:after,.fd-illustrated-message__actions:before{box-sizing:inherit;font-size:inherit}.fd-illustrated-message__actions *{margin:0 .25rem}@media screen and (max-width: 599px){.fd-illustrated-message{max-width:20rem}.fd-illustrated-message .fd-illustrated-message__illustration{height:10rem;width:10rem}}.fd-illustrated-message--dialog{margin-top:0;max-width:100%}.fd-illustrated-message--dialog .fd-illustrated-message__illustration{height:10rem;margin-bottom:2rem;margin-top:1rem;width:10rem}.fd-illustrated-message--dialog .fd-illustrated-message__title{font-size:var(--sapFontHeader4Size);margin:0 0 .25rem;max-width:25rem;padding:0}.fd-illustrated-message--dialog .fd-illustrated-message__text{color:var(--sapTile_TextColor);font-size:var(--sapFontSize);max-width:25rem}@media screen and (max-width: 599px){.fd-illustrated-message--dialog .fd-illustrated-message__text,.fd-illustrated-message--dialog .fd-illustrated-message__title{max-width:18rem}}.fd-illustrated-message--spot{margin-top:0;max-width:100%}.fd-illustrated-message--spot .fd-illustrated-message__illustration{height:8rem;margin:.5rem 0;padding:0;width:8rem}.fd-illustrated-message--spot .fd-illustrated-message__title{font-size:var(--sapFontHeader5Size);line-height:1.25;margin:0 0 .25rem;max-width:25rem;padding:0}.fd-illustrated-message--spot .fd-illustrated-message__text{color:var(--sapTile_TextColor);font-size:var(--sapFontSize);margin:0 0 1rem;max-width:25rem;padding:0}.fd-illustrated-message--spot .fd-illustrated-message__actions{margin:.5rem 0 1rem;padding:0}@media screen and (max-width: 599px){.fd-illustrated-message--spot .fd-illustrated-message__text,.fd-illustrated-message--spot .fd-illustrated-message__title{max-width:18rem}}\n"], directives: [{ type:
|
|
104
|
+
`, isInline: true, styles: ["/*!\n * Fundamental Library Styles v0.24.2\n * Copyright (c) 2022 SAP SE or an SAP affiliate company.\n * Licensed under Apache License 2.0 (https://github.com/SAP/fundamental-styles/blob/main/LICENSE)\n */.fd-illustrated-message{-webkit-box-sizing:border-box;align-items:center;border:0;box-sizing:border-box;color:var(--sapTextColor);display:flex;flex-direction:column;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;height:auto;line-height:var(--sapContent_LineHeight);margin:5rem 0 0;max-width:30rem;padding:1rem;text-align:center;width:100%}.fd-illustrated-message:after,.fd-illustrated-message:before{box-sizing:inherit;font-size:inherit}.fd-illustrated-message__illustration{-webkit-box-sizing:border-box;border:0;box-sizing:border-box;color:var(--sapTextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;height:15rem;line-height:var(--sapContent_LineHeight);margin:0;padding:0;width:20rem}.fd-illustrated-message__illustration:after,.fd-illustrated-message__illustration:before{box-sizing:inherit;font-size:inherit}.fd-illustrated-message__figcaption{-webkit-box-sizing:border-box;align-items:center;border:0;box-sizing:border-box;color:var(--sapTextColor);display:flex;flex-direction:column;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;line-height:var(--sapContent_LineHeight);margin:0;padding:0;width:100%}.fd-illustrated-message__figcaption:after,.fd-illustrated-message__figcaption:before{box-sizing:inherit;font-size:inherit}.fd-illustrated-message__title{-webkit-box-sizing:border-box;border:0;box-sizing:border-box;color:var(--sapTextColor);color:var(--sapGroup_TitleTextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-size:var(--sapFontHeader2Size);font-weight:400;font-weight:var(--sapFontHeaderWeight);line-height:var(--sapContent_LineHeight);line-height:1.3;margin:2rem 0 .5rem;padding:0;text-align:center;width:100%}.fd-illustrated-message__title:after,.fd-illustrated-message__title:before{box-sizing:inherit;font-size:inherit}.fd-illustrated-message__text{-webkit-box-sizing:border-box;border:0;box-sizing:border-box;color:var(--sapTextColor);color:var(--sapContent_LabelColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-size:var(--sapFontLargeSize);font-weight:400;line-height:var(--sapContent_LineHeight);line-height:1.4;margin:0 0 2rem;padding:0;text-align:center;width:100%}.fd-illustrated-message__text:after,.fd-illustrated-message__text:before{box-sizing:inherit;font-size:inherit}.fd-illustrated-message__actions{-webkit-box-sizing:border-box;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;border:0;box-sizing:border-box;color:var(--sapTextColor);display:flex;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;justify-content:center;line-height:var(--sapContent_LineHeight);margin:0 0 2rem;padding:0;width:100%}.fd-illustrated-message__actions:after,.fd-illustrated-message__actions:before{box-sizing:inherit;font-size:inherit}.fd-illustrated-message__actions *{margin:0 .25rem}@media screen and (max-width: 599px){.fd-illustrated-message{max-width:20rem}.fd-illustrated-message .fd-illustrated-message__illustration{height:10rem;width:10rem}}.fd-illustrated-message--dialog{margin-top:0;max-width:100%}.fd-illustrated-message--dialog .fd-illustrated-message__illustration{height:10rem;margin-bottom:2rem;margin-top:1rem;width:10rem}.fd-illustrated-message--dialog .fd-illustrated-message__title{font-size:var(--sapFontHeader4Size);margin:0 0 .25rem;max-width:25rem;padding:0}.fd-illustrated-message--dialog .fd-illustrated-message__text{color:var(--sapTile_TextColor);font-size:var(--sapFontSize);max-width:25rem}@media screen and (max-width: 599px){.fd-illustrated-message--dialog .fd-illustrated-message__text,.fd-illustrated-message--dialog .fd-illustrated-message__title{max-width:18rem}}.fd-illustrated-message--spot{margin-top:0;max-width:100%}.fd-illustrated-message--spot .fd-illustrated-message__illustration{height:8rem;margin:.5rem 0;padding:0;width:8rem}.fd-illustrated-message--spot .fd-illustrated-message__title{font-size:var(--sapFontHeader5Size);line-height:1.25;margin:0 0 .25rem;max-width:25rem;padding:0}.fd-illustrated-message--spot .fd-illustrated-message__text{color:var(--sapTile_TextColor);font-size:var(--sapFontSize);margin:0 0 1rem;max-width:25rem;padding:0}.fd-illustrated-message--spot .fd-illustrated-message__actions{margin:.5rem 0 1rem;padding:0}@media screen and (max-width: 599px){.fd-illustrated-message--spot .fd-illustrated-message__text,.fd-illustrated-message--spot .fd-illustrated-message__title{max-width:18rem}}\n"], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
100
105
|
__decorate([
|
|
101
106
|
applyCssClass,
|
|
102
107
|
__metadata("design:type", Function),
|
|
@@ -106,13 +111,14 @@ __decorate([
|
|
|
106
111
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: IllustratedMessageComponent, decorators: [{
|
|
107
112
|
type: Component,
|
|
108
113
|
args: [{ selector: '[fd-illustrated-message]', template: `
|
|
109
|
-
<svg class="fd-illustrated-message__illustration" *ngIf="!noSvg">
|
|
114
|
+
<svg class="fd-illustrated-message__illustration" *ngIf="!noSvg || _inlineSvg">
|
|
110
115
|
<use [attr.href]="_href"></use>
|
|
111
116
|
</svg>
|
|
117
|
+
<div *ngIf="_inlineSvg" style="display: none;" [innerHTML]="_inlineSvg"></div>
|
|
112
118
|
<ng-content select="[fd-illustrated-message-figcaption]"></ng-content>
|
|
113
119
|
<ng-content select="fd-illustrated-message-actions"></ng-content>
|
|
114
120
|
`, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, styles: ["/*!\n * Fundamental Library Styles v0.24.2\n * Copyright (c) 2022 SAP SE or an SAP affiliate company.\n * Licensed under Apache License 2.0 (https://github.com/SAP/fundamental-styles/blob/main/LICENSE)\n */.fd-illustrated-message{-webkit-box-sizing:border-box;align-items:center;border:0;box-sizing:border-box;color:var(--sapTextColor);display:flex;flex-direction:column;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;height:auto;line-height:var(--sapContent_LineHeight);margin:5rem 0 0;max-width:30rem;padding:1rem;text-align:center;width:100%}.fd-illustrated-message:after,.fd-illustrated-message:before{box-sizing:inherit;font-size:inherit}.fd-illustrated-message__illustration{-webkit-box-sizing:border-box;border:0;box-sizing:border-box;color:var(--sapTextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;height:15rem;line-height:var(--sapContent_LineHeight);margin:0;padding:0;width:20rem}.fd-illustrated-message__illustration:after,.fd-illustrated-message__illustration:before{box-sizing:inherit;font-size:inherit}.fd-illustrated-message__figcaption{-webkit-box-sizing:border-box;align-items:center;border:0;box-sizing:border-box;color:var(--sapTextColor);display:flex;flex-direction:column;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;line-height:var(--sapContent_LineHeight);margin:0;padding:0;width:100%}.fd-illustrated-message__figcaption:after,.fd-illustrated-message__figcaption:before{box-sizing:inherit;font-size:inherit}.fd-illustrated-message__title{-webkit-box-sizing:border-box;border:0;box-sizing:border-box;color:var(--sapTextColor);color:var(--sapGroup_TitleTextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-size:var(--sapFontHeader2Size);font-weight:400;font-weight:var(--sapFontHeaderWeight);line-height:var(--sapContent_LineHeight);line-height:1.3;margin:2rem 0 .5rem;padding:0;text-align:center;width:100%}.fd-illustrated-message__title:after,.fd-illustrated-message__title:before{box-sizing:inherit;font-size:inherit}.fd-illustrated-message__text{-webkit-box-sizing:border-box;border:0;box-sizing:border-box;color:var(--sapTextColor);color:var(--sapContent_LabelColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-size:var(--sapFontLargeSize);font-weight:400;line-height:var(--sapContent_LineHeight);line-height:1.4;margin:0 0 2rem;padding:0;text-align:center;width:100%}.fd-illustrated-message__text:after,.fd-illustrated-message__text:before{box-sizing:inherit;font-size:inherit}.fd-illustrated-message__actions{-webkit-box-sizing:border-box;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;border:0;box-sizing:border-box;color:var(--sapTextColor);display:flex;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;justify-content:center;line-height:var(--sapContent_LineHeight);margin:0 0 2rem;padding:0;width:100%}.fd-illustrated-message__actions:after,.fd-illustrated-message__actions:before{box-sizing:inherit;font-size:inherit}.fd-illustrated-message__actions *{margin:0 .25rem}@media screen and (max-width: 599px){.fd-illustrated-message{max-width:20rem}.fd-illustrated-message .fd-illustrated-message__illustration{height:10rem;width:10rem}}.fd-illustrated-message--dialog{margin-top:0;max-width:100%}.fd-illustrated-message--dialog .fd-illustrated-message__illustration{height:10rem;margin-bottom:2rem;margin-top:1rem;width:10rem}.fd-illustrated-message--dialog .fd-illustrated-message__title{font-size:var(--sapFontHeader4Size);margin:0 0 .25rem;max-width:25rem;padding:0}.fd-illustrated-message--dialog .fd-illustrated-message__text{color:var(--sapTile_TextColor);font-size:var(--sapFontSize);max-width:25rem}@media screen and (max-width: 599px){.fd-illustrated-message--dialog .fd-illustrated-message__text,.fd-illustrated-message--dialog .fd-illustrated-message__title{max-width:18rem}}.fd-illustrated-message--spot{margin-top:0;max-width:100%}.fd-illustrated-message--spot .fd-illustrated-message__illustration{height:8rem;margin:.5rem 0;padding:0;width:8rem}.fd-illustrated-message--spot .fd-illustrated-message__title{font-size:var(--sapFontHeader5Size);line-height:1.25;margin:0 0 .25rem;max-width:25rem;padding:0}.fd-illustrated-message--spot .fd-illustrated-message__text{color:var(--sapTile_TextColor);font-size:var(--sapFontSize);margin:0 0 1rem;max-width:25rem;padding:0}.fd-illustrated-message--spot .fd-illustrated-message__actions{margin:.5rem 0 1rem;padding:0}@media screen and (max-width: 599px){.fd-illustrated-message--spot .fd-illustrated-message__text,.fd-illustrated-message--spot .fd-illustrated-message__title{max-width:18rem}}\n"] }]
|
|
115
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { type: [{
|
|
121
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i1.DomSanitizer }]; }, propDecorators: { type: [{
|
|
116
122
|
type: Input
|
|
117
123
|
}], svgConfig: [{
|
|
118
124
|
type: Input
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fundamental-ngx-core-illustrated-message.mjs","sources":["../../../../libs/core/src/lib/illustrated-message/illustrated-message.component.ts","../../../../libs/core/src/lib/illustrated-message/components/illustrated-message-actions/illustrated-message-actions.component.ts","../../../../libs/core/src/lib/illustrated-message/components/illustrated-message-figcaption/illustrated-message-figcaption.component.ts","../../../../libs/core/src/lib/illustrated-message/directives/illustrated-message-text/illustrated-message-text.directive.ts","../../../../libs/core/src/lib/illustrated-message/directives/illustrated-message-title/illustrated-message-title.directive.ts","../../../../libs/core/src/lib/illustrated-message/illustrated-message.module.ts","../../../../libs/core/src/lib/illustrated-message/fundamental-ngx-core-illustrated-message.ts"],"sourcesContent":["import {\n AfterViewInit,\n ChangeDetectorRef,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostBinding,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n ViewEncapsulation\n} from '@angular/core';\nimport { applyCssClass } from '@fundamental-ngx/core/utils';\nimport { CssClassBuilder } from '@fundamental-ngx/core/utils';\nimport { fromEvent, Subscription } from 'rxjs';\n\nexport interface SvgConfig {\n scene?: { url: string; id: string };\n dialog?: { url: string; id: string };\n spot?: { url: string; id: string };\n}\n\nlet illustratedMessageUniqueId = 0;\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: '[fd-illustrated-message]',\n template: `\n <svg class=\"fd-illustrated-message__illustration\" *ngIf=\"!noSvg\">\n <use [attr.href]=\"_href\"></use>\n </svg>\n <ng-content select=\"[fd-illustrated-message-figcaption]\"></ng-content>\n <ng-content select=\"fd-illustrated-message-actions\"></ng-content>\n `,\n styleUrls: ['./illustrated-message.component.scss'],\n\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class IllustratedMessageComponent implements AfterViewInit, OnChanges, OnDestroy, OnInit, CssClassBuilder {\n /**\n * The type of the Illustrated Message\n * Options include: 'scene' | 'spot' | 'dialog'\n * The default type is set to 'scene'\n */\n @Input() type: 'scene' | 'dialog' | 'spot' = 'scene';\n\n /**\n * An object containing url and id for each type used to construct the svg href\n * For 'scene' type 'scene' and 'dialog' values are required\n * In small screens (less than 600px) 'dialog' svg will be applied for 'scene' type\n */\n @Input() svgConfig: SvgConfig;\n\n /**\n * When set to true will remove the illustration from the Illustrated Message\n * The default is set to false\n */\n @Input() noSvg = false;\n\n /**\n * Id of the Illustrated Message\n * If not provided, a default one is generated\n */\n @Input()\n @HostBinding('attr.id')\n id: string = 'fd-illustrated-message-' + illustratedMessageUniqueId++;\n\n /** User's custom classes */\n @Input()\n class: string;\n\n /** @hidden */\n _href: string;\n\n /** @hidden */\n _isSmallScreen: boolean;\n\n /** @hidden */\n private _subscriptions = new Subscription();\n\n /** @hidden */\n constructor(private _elementRef: ElementRef, private _cdRef: ChangeDetectorRef) {}\n\n /** @hidden */\n ngOnChanges(): void {\n this.buildComponentCssClass();\n }\n\n /** @hidden */\n ngOnInit(): void {\n this.buildComponentCssClass();\n this._constructHref();\n }\n\n /** @hidden */\n ngAfterViewInit(): void {\n if (this.type === 'scene') {\n this._subscriptions.add(fromEvent(window, 'resize').subscribe(() => this._constructHref()));\n }\n }\n\n /** @hidden */\n ngOnDestroy(): void {\n this._subscriptions.unsubscribe();\n }\n\n /** @hidden */\n elementRef(): ElementRef<any> {\n return this._elementRef;\n }\n\n @applyCssClass\n /** CssClassBuilder interface implementation\n * function must return single string\n * function is responsible for order which css classes are applied\n */\n buildComponentCssClass(): string[] {\n return ['fd-illustrated-message', this.type ? `fd-illustrated-message--${this.type}` : '', this.class];\n }\n\n /** @hidden */\n private _constructHref(): void {\n if (this.svgConfig) {\n switch (this.type) {\n case 'scene':\n {\n this._isSmallScreen = window.innerWidth < 600;\n\n this._href = this._isSmallScreen\n ? `${this.svgConfig.dialog?.url}#${this.svgConfig.dialog?.id}`\n : `${this.svgConfig.scene?.url}#${this.svgConfig.scene?.id}`;\n this._cdRef.detectChanges();\n }\n break;\n\n case 'dialog':\n {\n this._href = `${this.svgConfig.dialog?.url}#${this.svgConfig.dialog?.id}`;\n }\n break;\n\n case 'spot':\n {\n this._href = `${this.svgConfig.spot?.url}#${this.svgConfig.spot?.id}`;\n }\n break;\n }\n }\n }\n}\n","import { Component, ChangeDetectionStrategy } from '@angular/core';\n\n@Component({\n selector: 'fd-illustrated-message-actions',\n template: `<ng-content></ng-content>`,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'fd-illustrated-message__actions'\n }\n})\nexport class IllustratedMessageActionsComponent {}\n","import { Component, ChangeDetectionStrategy } from '@angular/core';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: '[fd-illustrated-message-figcaption]',\n template: `\n <ng-content select=\"[fd-illustrated-message-title]\"></ng-content>\n <ng-content select=\"[fd-illustrated-message-text]\"></ng-content>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'fd-illustrated-message__figcaption'\n }\n})\nexport class IllustratedMessageFigcaptionComponent {}\n","import { Directive, HostBinding } from '@angular/core';\n\n@Directive({\n // TODO to be discussed\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: '[fd-illustrated-message-text]'\n})\nexport class IllustratedMessageTextDirective {\n /** @hidden */\n @HostBinding('class.fd-illustrated-message__text')\n fdIllustratedMessageTextClass = true;\n}\n","import { Directive, HostBinding } from '@angular/core';\n\n@Directive({\n // TODO to be discussed\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: '[fd-illustrated-message-title]'\n})\nexport class IllustratedMessageTitleDirective {\n /** @hidden */\n @HostBinding('class.fd-illustrated-message__title')\n fdIllustratedMessageTitleClass = true;\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { IllustratedMessageComponent } from './illustrated-message.component';\nimport { IllustratedMessageActionsComponent } from './components/illustrated-message-actions/illustrated-message-actions.component';\n// eslint-disable-next-line max-len\nimport { IllustratedMessageFigcaptionComponent } from './components/illustrated-message-figcaption/illustrated-message-figcaption.component';\nimport { IllustratedMessageTextDirective } from './directives/illustrated-message-text/illustrated-message-text.directive';\nimport { IllustratedMessageTitleDirective } from './directives/illustrated-message-title/illustrated-message-title.directive';\n\n@NgModule({\n declarations: [\n IllustratedMessageComponent,\n IllustratedMessageActionsComponent,\n IllustratedMessageFigcaptionComponent,\n IllustratedMessageTextDirective,\n IllustratedMessageTitleDirective\n ],\n imports: [CommonModule],\n exports: [\n IllustratedMessageComponent,\n IllustratedMessageActionsComponent,\n IllustratedMessageFigcaptionComponent,\n IllustratedMessageTextDirective,\n IllustratedMessageTitleDirective\n ]\n})\nexport class IllustratedMessageModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;AAuBA,IAAI,0BAA0B,GAAG,CAAC,CAAC;MAiBtB,2BAA2B;;IA2CpC,YAAoB,WAAuB,EAAU,MAAyB;QAA1D,gBAAW,GAAX,WAAW,CAAY;QAAU,WAAM,GAAN,MAAM,CAAmB;;;;;;QArCrE,SAAI,GAAgC,OAAO,CAAC;;;;;QAa5C,UAAK,GAAG,KAAK,CAAC;;;;;QAQvB,OAAE,GAAW,yBAAyB,GAAG,0BAA0B,EAAE,CAAC;;QAa9D,mBAAc,GAAG,IAAI,YAAY,EAAE,CAAC;KAGsC;;IAGlF,WAAW;QACP,IAAI,CAAC,sBAAsB,EAAE,CAAC;KACjC;;IAGD,QAAQ;QACJ,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAC9B,IAAI,CAAC,cAAc,EAAE,CAAC;KACzB;;IAGD,eAAe;QACX,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE;YACvB,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,SAAS,CAAC,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;SAC/F;KACJ;;IAGD,WAAW;QACP,IAAI,CAAC,cAAc,CAAC,WAAW,EAAE,CAAC;KACrC;;IAGD,UAAU;QACN,OAAO,IAAI,CAAC,WAAW,CAAC;KAC3B;;;;;IAOD,sBAAsB;QAClB,OAAO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C;;;MCkBzC,wBAAwB;;qHAAxB,wBAAwB;sHAAxB,wBAAwB,iBAf7B,2BAA2B;QAC3B,kCAAkC;QAClC,qCAAqC;QACrC,+BAA+B;QAC/B,gCAAgC,aAE1B,YAAY,aAElB,2BAA2B;QAC3B,kCAAkC;QAClC,qCAAqC;QACrC,+BAA+B;QAC/B,gCAAgC;sHAG3B,wBAAwB,YATxB,CAAC,YAAY,CAAC;2FASd,wBAAwB;kBAjBpC,QAAQ;mBAAC;oBACN,YAAY,EAAE;wBACV,2BAA2B;wBAC3B,kCAAkC;wBAClC,qCAAqC;wBACrC,+BAA+B;wBAC/B,gCAAgC;qBACnC;oBACD,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,OAAO,EAAE;wBACL,2BAA2B;wBAC3B,kCAAkC;wBAClC,qCAAqC;wBACrC,+BAA+B;wBAC/B,gCAAgC;qBACnC;iBACJ;;;AC1BD;;;;;;"}
|
|
1
|
+
{"version":3,"file":"fundamental-ngx-core-illustrated-message.mjs","sources":["../../../../libs/core/src/lib/illustrated-message/illustrated-message.component.ts","../../../../libs/core/src/lib/illustrated-message/components/illustrated-message-actions/illustrated-message-actions.component.ts","../../../../libs/core/src/lib/illustrated-message/components/illustrated-message-figcaption/illustrated-message-figcaption.component.ts","../../../../libs/core/src/lib/illustrated-message/directives/illustrated-message-text/illustrated-message-text.directive.ts","../../../../libs/core/src/lib/illustrated-message/directives/illustrated-message-title/illustrated-message-title.directive.ts","../../../../libs/core/src/lib/illustrated-message/illustrated-message.module.ts","../../../../libs/core/src/lib/illustrated-message/fundamental-ngx-core-illustrated-message.ts"],"sourcesContent":["import {\n AfterViewInit,\n ChangeDetectorRef,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostBinding,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n ViewEncapsulation\n} from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { applyCssClass, RequireOnlyOne } from '@fundamental-ngx/core/utils';\nimport { CssClassBuilder } from '@fundamental-ngx/core/utils';\nimport { fromEvent, Subscription } from 'rxjs';\n\nexport interface SvgConfig {\n scene?: RequireOnlyOne<SvgItemConfig, 'url' | 'file'>;\n dialog?: RequireOnlyOne<SvgItemConfig, 'url' | 'file'>;\n spot?: RequireOnlyOne<SvgItemConfig, 'url' | 'file'>;\n}\n\nexport interface SvgItemConfig {\n url: string;\n id: string;\n file: string;\n}\n\nexport type IllustratedMessageType = 'scene' | 'dialog' | 'spot';\n\nlet illustratedMessageUniqueId = 0;\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: '[fd-illustrated-message]',\n template: `\n <svg class=\"fd-illustrated-message__illustration\" *ngIf=\"!noSvg || _inlineSvg\">\n <use [attr.href]=\"_href\"></use>\n </svg>\n <div *ngIf=\"_inlineSvg\" style=\"display: none;\" [innerHTML]=\"_inlineSvg\"></div>\n <ng-content select=\"[fd-illustrated-message-figcaption]\"></ng-content>\n <ng-content select=\"fd-illustrated-message-actions\"></ng-content>\n `,\n styleUrls: ['./illustrated-message.component.scss'],\n\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class IllustratedMessageComponent implements AfterViewInit, OnChanges, OnDestroy, OnInit, CssClassBuilder {\n /**\n * The type of the Illustrated Message\n * Options include: 'scene' | 'spot' | 'dialog'\n * The default type is set to 'scene'\n */\n @Input()\n type: IllustratedMessageType = 'scene';\n\n /**\n * An object containing url and id for each type used to construct the svg href\n * For 'scene' type 'scene' and 'dialog' values are required\n * In small screens (less than 600px) 'dialog' svg will be applied for 'scene' type\n */\n @Input()\n svgConfig: SvgConfig;\n\n /**\n * When set to true will remove the illustration from the Illustrated Message\n * The default is set to false\n */\n @Input()\n noSvg = false;\n\n /**\n * Id of the Illustrated Message\n * If not provided, a default one is generated\n */\n @Input()\n @HostBinding('attr.id')\n id: string = 'fd-illustrated-message-' + illustratedMessageUniqueId++;\n\n /** User's custom classes */\n @Input()\n class: string;\n\n /** @hidden */\n _href: string;\n\n /** @hidden */\n _isSmallScreen: boolean;\n\n /** @hidden */\n _inlineSvg: SafeHtml | undefined;\n\n /** @hidden */\n private _subscriptions = new Subscription();\n\n /** @hidden */\n constructor(private _elementRef: ElementRef, private _cdRef: ChangeDetectorRef, private _sanitizer: DomSanitizer) {}\n\n /** @hidden */\n ngOnChanges(): void {\n this.buildComponentCssClass();\n }\n\n /** @hidden */\n ngOnInit(): void {\n this.buildComponentCssClass();\n this._constructHref();\n }\n\n /** @hidden */\n ngAfterViewInit(): void {\n if (this.type === 'scene') {\n this._subscriptions.add(fromEvent(window, 'resize').subscribe(() => this._constructHref()));\n }\n }\n\n /** @hidden */\n ngOnDestroy(): void {\n this._subscriptions.unsubscribe();\n }\n\n /** @hidden */\n elementRef(): ElementRef {\n return this._elementRef;\n }\n\n @applyCssClass\n /** CssClassBuilder interface implementation\n * function must return single string\n * function is responsible for order which css classes are applied\n */\n buildComponentCssClass(): string[] {\n return ['fd-illustrated-message', this.type ? `fd-illustrated-message--${this.type}` : '', this.class];\n }\n\n /** @hidden */\n private _constructHref(): void {\n let inlineSvg;\n this._inlineSvg = undefined;\n if (this.svgConfig) {\n switch (this.type) {\n case 'scene':\n this._isSmallScreen = window.innerWidth < 600;\n\n inlineSvg = this._isSmallScreen ? this.svgConfig.dialog?.file : this.svgConfig.scene?.file;\n\n this._href = this._isSmallScreen\n ? `${this.svgConfig.dialog?.url || ''}#${this.svgConfig.dialog?.id}`\n : `${this.svgConfig.scene?.url || ''}#${this.svgConfig.scene?.id}`;\n break;\n\n case 'dialog':\n inlineSvg = this.svgConfig.dialog?.file;\n this._href = `${this.svgConfig.dialog?.url || ''}#${this.svgConfig.dialog?.id}`;\n break;\n\n case 'spot':\n inlineSvg = this.svgConfig.spot?.file;\n this._href = `${this.svgConfig.spot?.url || ''}#${this.svgConfig.spot?.id}`;\n break;\n }\n }\n if (inlineSvg) {\n this._inlineSvg = this._sanitizer.bypassSecurityTrustHtml(inlineSvg);\n }\n\n this._cdRef.detectChanges();\n }\n}\n","import { Component, ChangeDetectionStrategy } from '@angular/core';\n\n@Component({\n selector: 'fd-illustrated-message-actions',\n template: `<ng-content></ng-content>`,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'fd-illustrated-message__actions'\n }\n})\nexport class IllustratedMessageActionsComponent {}\n","import { Component, ChangeDetectionStrategy } from '@angular/core';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: '[fd-illustrated-message-figcaption]',\n template: `\n <ng-content select=\"[fd-illustrated-message-title]\"></ng-content>\n <ng-content select=\"[fd-illustrated-message-text]\"></ng-content>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'fd-illustrated-message__figcaption'\n }\n})\nexport class IllustratedMessageFigcaptionComponent {}\n","import { Directive, HostBinding } from '@angular/core';\n\n@Directive({\n // TODO to be discussed\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: '[fd-illustrated-message-text]'\n})\nexport class IllustratedMessageTextDirective {\n /** @hidden */\n @HostBinding('class.fd-illustrated-message__text')\n fdIllustratedMessageTextClass = true;\n}\n","import { Directive, HostBinding } from '@angular/core';\n\n@Directive({\n // TODO to be discussed\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: '[fd-illustrated-message-title]'\n})\nexport class IllustratedMessageTitleDirective {\n /** @hidden */\n @HostBinding('class.fd-illustrated-message__title')\n fdIllustratedMessageTitleClass = true;\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { IllustratedMessageComponent } from './illustrated-message.component';\nimport { IllustratedMessageActionsComponent } from './components/illustrated-message-actions/illustrated-message-actions.component';\n// eslint-disable-next-line max-len\nimport { IllustratedMessageFigcaptionComponent } from './components/illustrated-message-figcaption/illustrated-message-figcaption.component';\nimport { IllustratedMessageTextDirective } from './directives/illustrated-message-text/illustrated-message-text.directive';\nimport { IllustratedMessageTitleDirective } from './directives/illustrated-message-title/illustrated-message-title.directive';\n\n@NgModule({\n declarations: [\n IllustratedMessageComponent,\n IllustratedMessageActionsComponent,\n IllustratedMessageFigcaptionComponent,\n IllustratedMessageTextDirective,\n IllustratedMessageTitleDirective\n ],\n imports: [CommonModule],\n exports: [\n IllustratedMessageComponent,\n IllustratedMessageActionsComponent,\n IllustratedMessageFigcaptionComponent,\n IllustratedMessageTextDirective,\n IllustratedMessageTitleDirective\n ]\n})\nexport class IllustratedMessageModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;AAgCA,IAAI,0BAA0B,GAAG,CAAC,CAAC;MAkBtB,2BAA2B;;IAiDpC,YAAoB,WAAuB,EAAU,MAAyB,EAAU,UAAwB;QAA5F,gBAAW,GAAX,WAAW,CAAY;QAAU,WAAM,GAAN,MAAM,CAAmB;QAAU,eAAU,GAAV,UAAU,CAAc;;;;;;QA1ChH,SAAI,GAA2B,OAAO,CAAC;;;;;QAevC,UAAK,GAAG,KAAK,CAAC;;;;;QAQd,OAAE,GAAW,yBAAyB,GAAG,0BAA0B,EAAE,CAAC;;QAgB9D,mBAAc,GAAG,IAAI,YAAY,EAAE,CAAC;KAGwE;;IAGpH,WAAW;QACP,IAAI,CAAC,sBAAsB,EAAE,CAAC;KACjC;;IAGD,QAAQ;QACJ,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAC9B,IAAI,CAAC,cAAc,EAAE,CAAC;KACzB;;IAGD,eAAe;QACX,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE;YACvB,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,SAAS,CAAC,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;SAC/F;KACJ;;IAGD,WAAW;QACP,IAAI,CAAC,cAAc,CAAC,WAAW,EAAE,CAAC;KACrC;;IAGD,UAAU;QACN,OAAO,IAAI,CAAC,WAAW,CAAC;KAC3B;;;;;IA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