@festo-ui/angular 9.0.1-dev.802 → 9.0.1-dev.804
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/festo-ui-angular.mjs +41 -6
- package/fesm2022/festo-ui-angular.mjs.map +1 -1
- package/index.d.ts +12 -2
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { ViewEncapsulation, Component, ContentChild, SimpleChange, ContentChildren, Input, EventEmitter, Output, HostListener, Directive, HostBinding, Optional, TemplateRef, Injector, Injectable,
|
|
2
|
+
import { ViewEncapsulation, Component, ContentChild, SimpleChange, ContentChildren, Input, EventEmitter, ViewChild, Output, HostListener, Directive, HostBinding, Optional, TemplateRef, Injector, Injectable, Pipe, signal, output, DOCUMENT, Inject, ChangeDetectionStrategy, inject, ViewContainerRef, ElementRef, NgModule, forwardRef, CUSTOM_ELEMENTS_SCHEMA, LOCALE_ID, SecurityContext } from '@angular/core';
|
|
3
3
|
import { Subject, BehaviorSubject, noop, Subscription } from 'rxjs';
|
|
4
4
|
import * as i1 from '@angular/router';
|
|
5
5
|
import { RouterModule, NavigationStart } from '@angular/router';
|
|
@@ -271,19 +271,48 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
271
271
|
}] });
|
|
272
272
|
|
|
273
273
|
class FngBreadcrumbComponent {
|
|
274
|
-
constructor() {
|
|
274
|
+
constructor(cdr) {
|
|
275
|
+
this.cdr = cdr;
|
|
275
276
|
this.useRouterLink = false;
|
|
276
277
|
this.locations = [];
|
|
277
278
|
this.ariaLabel = 'Breadcrumb';
|
|
278
279
|
this.navigate = new EventEmitter();
|
|
280
|
+
this.isMobile = false;
|
|
281
|
+
this.onResize = () => this.measure();
|
|
282
|
+
}
|
|
283
|
+
ngAfterViewInit() {
|
|
284
|
+
this.measure();
|
|
285
|
+
if (typeof ResizeObserver !== 'undefined') {
|
|
286
|
+
this.resizeObserver = new ResizeObserver(() => this.measure());
|
|
287
|
+
this.resizeObserver.observe(this.containerEl.nativeElement);
|
|
288
|
+
this.resizeObserver.observe(this.measureEl.nativeElement);
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
window.addEventListener('resize', this.onResize);
|
|
292
|
+
}
|
|
279
293
|
}
|
|
280
|
-
|
|
281
|
-
|
|
294
|
+
ngOnDestroy() {
|
|
295
|
+
this.resizeObserver?.disconnect();
|
|
296
|
+
window.removeEventListener('resize', this.onResize);
|
|
297
|
+
}
|
|
298
|
+
measure() {
|
|
299
|
+
const container = this.containerEl?.nativeElement;
|
|
300
|
+
const measure = this.measureEl?.nativeElement;
|
|
301
|
+
if (!container || !measure)
|
|
302
|
+
return;
|
|
303
|
+
const nextIsMobile = measure.scrollWidth > container.clientWidth;
|
|
304
|
+
if (this.isMobile !== nextIsMobile) {
|
|
305
|
+
this.isMobile = nextIsMobile;
|
|
306
|
+
this.cdr.detectChanges();
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: FngBreadcrumbComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
310
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: FngBreadcrumbComponent, isStandalone: true, selector: "fng-breadcrumb", inputs: { useRouterLink: "useRouterLink", locations: "locations", ariaLabel: "ariaLabel" }, outputs: { navigate: "navigate" }, viewQueries: [{ propertyName: "containerEl", first: true, predicate: ["containerEl"], descendants: true }, { propertyName: "measureEl", first: true, predicate: ["measureEl"], descendants: true }], ngImport: i0, template: "<div>\n <!-- Hidden measurement nav \u2014 renders all items at natural width to detect overflow -->\n <nav\n aria-hidden=\"true\"\n class=\"fwe-breadcrumb\"\n #measureEl\n style=\"position: absolute; visibility: hidden; pointer-events: none; white-space: nowrap; height: 0; overflow: hidden;\">\n <ol>\n @for (location of locations; track location) {\n <li><a>{{ location.label }}</a></li>\n }\n </ol>\n </nav>\n\n <nav\n [attr.aria-label]=\"ariaLabel\"\n class=\"fwe-breadcrumb fng-breadcrumb\"\n [class.fwe-breadcrumb--mobile]=\"isMobile\"\n #containerEl>\n <ol>\n @for (location of locations; track location; let isLast = $last) {\n @if (useRouterLink) {\n <li>\n <a [routerLink]=\"isLast ? null : location.url\" [attr.aria-current]=\"isLast ? 'page' : null\">{{ location.label }}</a>\n </li>\n } @else {\n <li>\n <a (click)=\"isLast || navigate.emit(location.url)\" [attr.aria-current]=\"isLast ? 'page' : null\">{{ location.label }}</a>\n </li>\n }\n }\n </ol>\n </nav>\n</div>\n", styles: [".fng-breadcrumb a{cursor:pointer}\n"], dependencies: [{ kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
282
311
|
}
|
|
283
312
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: FngBreadcrumbComponent, decorators: [{
|
|
284
313
|
type: Component,
|
|
285
|
-
args: [{ imports: [RouterModule], selector: 'fng-breadcrumb', encapsulation: ViewEncapsulation.None, template: "<nav [attr.aria-label]=\"ariaLabel\"
|
|
286
|
-
}], propDecorators: { useRouterLink: [{
|
|
314
|
+
args: [{ imports: [RouterModule], selector: 'fng-breadcrumb', encapsulation: ViewEncapsulation.None, template: "<div>\n <!-- Hidden measurement nav \u2014 renders all items at natural width to detect overflow -->\n <nav\n aria-hidden=\"true\"\n class=\"fwe-breadcrumb\"\n #measureEl\n style=\"position: absolute; visibility: hidden; pointer-events: none; white-space: nowrap; height: 0; overflow: hidden;\">\n <ol>\n @for (location of locations; track location) {\n <li><a>{{ location.label }}</a></li>\n }\n </ol>\n </nav>\n\n <nav\n [attr.aria-label]=\"ariaLabel\"\n class=\"fwe-breadcrumb fng-breadcrumb\"\n [class.fwe-breadcrumb--mobile]=\"isMobile\"\n #containerEl>\n <ol>\n @for (location of locations; track location; let isLast = $last) {\n @if (useRouterLink) {\n <li>\n <a [routerLink]=\"isLast ? null : location.url\" [attr.aria-current]=\"isLast ? 'page' : null\">{{ location.label }}</a>\n </li>\n } @else {\n <li>\n <a (click)=\"isLast || navigate.emit(location.url)\" [attr.aria-current]=\"isLast ? 'page' : null\">{{ location.label }}</a>\n </li>\n }\n }\n </ol>\n </nav>\n</div>\n", styles: [".fng-breadcrumb a{cursor:pointer}\n"] }]
|
|
315
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { useRouterLink: [{
|
|
287
316
|
type: Input
|
|
288
317
|
}], locations: [{
|
|
289
318
|
type: Input
|
|
@@ -291,6 +320,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
291
320
|
type: Input
|
|
292
321
|
}], navigate: [{
|
|
293
322
|
type: Output
|
|
323
|
+
}], containerEl: [{
|
|
324
|
+
type: ViewChild,
|
|
325
|
+
args: ['containerEl']
|
|
326
|
+
}], measureEl: [{
|
|
327
|
+
type: ViewChild,
|
|
328
|
+
args: ['measureEl']
|
|
294
329
|
}] } });
|
|
295
330
|
|
|
296
331
|
class FngButtonComponent {
|