@coolon/angular-ui-powerups 16.1.0-alpha.274 → 16.1.0-alpha.275
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/esm2022/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.mjs +42 -4
- package/fesm2022/coolon-angular-ui-powerups.mjs +39 -2
- package/fesm2022/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.d.ts +16 -0
- package/package.json +1 -1
package/esm2022/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Component } from '@angular/core';
|
|
1
|
+
import { Component, HostBinding } from '@angular/core';
|
|
2
|
+
import { Dsl } from '@coolon/pectin';
|
|
2
3
|
import { slideDownOnEnterAnimation } from '../../../animations/slide-animations';
|
|
3
4
|
import { PlaceRouter } from '../../place-router';
|
|
4
5
|
import { AbstractPlaceNavigationComponent } from '../abstract-place-navigation.component';
|
|
@@ -11,14 +12,51 @@ import * as i5 from "../../../directives/command.directive";
|
|
|
11
12
|
import * as i6 from "../../../directives/garbage-collector.directive";
|
|
12
13
|
import * as i7 from "../../../components/commands/command-face/command-face.component";
|
|
13
14
|
export class TabbedPlaceNavigationComponent extends AbstractPlaceNavigationComponent {
|
|
15
|
+
/**
|
|
16
|
+
* Animations are suppressed while a navigation is in flight, and for a frame after it settles.
|
|
17
|
+
*
|
|
18
|
+
* The bar is `*ngIf`d, so without this its `:enter` fires on the initial render of EVERY tabbed
|
|
19
|
+
* place — every bar visibly slid in on every page load, which is noise: nobody is watching a
|
|
20
|
+
* transition while a page is still arriving. What should animate is a bar appearing or collapsing
|
|
21
|
+
* because state CHANGED on a page the user is already looking at (a place being enabled, a role
|
|
22
|
+
* granted, the last sibling tab disappearing).
|
|
23
|
+
*
|
|
24
|
+
* Keyed on the router's own in-flight signal rather than a timer, so it scales with however long
|
|
25
|
+
* the navigation actually takes. The trailing frame matters: the bar is often rendered in the same
|
|
26
|
+
* turn the navigation completes, so re-enabling immediately would let that first render animate
|
|
27
|
+
* anyway. Same disable-then-reset-after-a-frame shape as TableBodyComponent.
|
|
28
|
+
*/
|
|
29
|
+
animationsDisabled = true;
|
|
30
|
+
resetHandle = null;
|
|
14
31
|
constructor(router) {
|
|
15
32
|
super(router);
|
|
33
|
+
const { when } = Dsl.disposeWith(this);
|
|
34
|
+
when(router.navigationInProgress$).changes(inProgress => {
|
|
35
|
+
if (this.resetHandle !== null) {
|
|
36
|
+
cancelAnimationFrame(this.resetHandle);
|
|
37
|
+
this.resetHandle = null;
|
|
38
|
+
}
|
|
39
|
+
if (inProgress) {
|
|
40
|
+
this.animationsDisabled = true;
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
this.resetHandle = requestAnimationFrame(() => {
|
|
44
|
+
this.resetHandle = null;
|
|
45
|
+
this.animationsDisabled = false;
|
|
46
|
+
this.cdr.markForCheck();
|
|
47
|
+
});
|
|
48
|
+
// Trigger initially so a bar constructed outside a navigation still enables its animations
|
|
49
|
+
// (without this it would stay suppressed until the next navigation).
|
|
50
|
+
}, { initialValue: "triggerChange" });
|
|
16
51
|
}
|
|
17
52
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: TabbedPlaceNavigationComponent, deps: [{ token: i1.PlaceRouter }], target: i0.ɵɵFactoryTarget.Component });
|
|
18
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.9", type: TabbedPlaceNavigationComponent, selector: "aup-tabbed-place-navigation", usesInheritance: true, ngImport: i0, template: "<!-- Declared BEFORE the nav that references it: the nav lives in an *ngIf embedded view, and a\n template ref declared after it can be unresolved on that view's first render. -->\n<mat-tab-nav-panel #tabPanel></mat-tab-nav-panel>\n<!-- Tabs keep their natural width, packed to the left; Material stretches them to fill by default. -->\n<nav mat-tab-nav-bar [mat-stretch-tabs]=\"false\" [tabPanel]=\"tabPanel\"\n *ngIf=\"!hidden$.value\" [@slideDownOnEnter]>\n <ng-content select=\"[nav-start]\"></ng-content>\n <a mat-tab-link *ngFor=\"let item of menuItems.value; trackBy: trackByPlaceDef\"\n aup-gc #gc=\"aup-gc\"\n [pectinCommand]=\"commandFactory.create(item.place, {disposedWith: gc})\"\n [active]=\"item.active\"\n [matTooltip]=\"getNavigationFace(item.place).tooltip()\">\n <aup-command-face [faces]=\"[getNavigationFace(item.place)]\"></aup-command-face>\n </a>\n <ng-content select=\"[nav-end]\"></ng-content>\n</nav>\n", styles: [":host{display:block}nav{overflow:hidden}div.place-holder{border:1px solid green}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.MatTabNav, selector: "[mat-tab-nav-bar]", inputs: ["color", "fitInkBarToContent", "mat-stretch-tabs", "animationDuration"], exportAs: ["matTabNavBar", "matTabNav"] }, { kind: "component", type: i3.MatTabNavPanel, selector: "mat-tab-nav-panel", inputs: ["id"], exportAs: ["matTabNavPanel"] }, { kind: "component", type: i3.MatTabLink, selector: "[mat-tab-link], [matTabLink]", inputs: ["disabled", "disableRipple", "tabIndex", "active", "id"], exportAs: ["matTabLink"] }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "directive", type: i5.CommandDirective, selector: "[pectinCommand]", inputs: ["pectinCommand", "commandParameter", "preventDefault"] }, { kind: "directive", type: i6.GarbageCollectorDirective, selector: "[aup-gc]", exportAs: ["aup-gc"] }, { kind: "component", type: i7.CommandFaceComponent, selector: "aup-command-face", inputs: ["faces", "face", "ignoreIcon", "ignoreText", "includeMissingIconInLayout"] }], animations: [slideDownOnEnterAnimation] });
|
|
53
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.9", type: TabbedPlaceNavigationComponent, selector: "aup-tabbed-place-navigation", host: { properties: { "@.disabled": "this.animationsDisabled" } }, usesInheritance: true, ngImport: i0, template: "<!-- Declared BEFORE the nav that references it: the nav lives in an *ngIf embedded view, and a\n template ref declared after it can be unresolved on that view's first render. -->\n<mat-tab-nav-panel #tabPanel></mat-tab-nav-panel>\n<!-- Tabs keep their natural width, packed to the left; Material stretches them to fill by default. -->\n<nav mat-tab-nav-bar [mat-stretch-tabs]=\"false\" [tabPanel]=\"tabPanel\"\n *ngIf=\"!hidden$.value\" [@slideDownOnEnter]>\n <ng-content select=\"[nav-start]\"></ng-content>\n <a mat-tab-link *ngFor=\"let item of menuItems.value; trackBy: trackByPlaceDef\"\n aup-gc #gc=\"aup-gc\"\n [pectinCommand]=\"commandFactory.create(item.place, {disposedWith: gc})\"\n [active]=\"item.active\"\n [matTooltip]=\"getNavigationFace(item.place).tooltip()\">\n <aup-command-face [faces]=\"[getNavigationFace(item.place)]\"></aup-command-face>\n </a>\n <ng-content select=\"[nav-end]\"></ng-content>\n</nav>\n", styles: [":host{display:block}nav{overflow:hidden}div.place-holder{border:1px solid green}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.MatTabNav, selector: "[mat-tab-nav-bar]", inputs: ["color", "fitInkBarToContent", "mat-stretch-tabs", "animationDuration"], exportAs: ["matTabNavBar", "matTabNav"] }, { kind: "component", type: i3.MatTabNavPanel, selector: "mat-tab-nav-panel", inputs: ["id"], exportAs: ["matTabNavPanel"] }, { kind: "component", type: i3.MatTabLink, selector: "[mat-tab-link], [matTabLink]", inputs: ["disabled", "disableRipple", "tabIndex", "active", "id"], exportAs: ["matTabLink"] }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "directive", type: i5.CommandDirective, selector: "[pectinCommand]", inputs: ["pectinCommand", "commandParameter", "preventDefault"] }, { kind: "directive", type: i6.GarbageCollectorDirective, selector: "[aup-gc]", exportAs: ["aup-gc"] }, { kind: "component", type: i7.CommandFaceComponent, selector: "aup-command-face", inputs: ["faces", "face", "ignoreIcon", "ignoreText", "includeMissingIconInLayout"] }], animations: [slideDownOnEnterAnimation] });
|
|
19
54
|
}
|
|
20
55
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: TabbedPlaceNavigationComponent, decorators: [{
|
|
21
56
|
type: Component,
|
|
22
57
|
args: [{ selector: 'aup-tabbed-place-navigation', animations: [slideDownOnEnterAnimation], template: "<!-- Declared BEFORE the nav that references it: the nav lives in an *ngIf embedded view, and a\n template ref declared after it can be unresolved on that view's first render. -->\n<mat-tab-nav-panel #tabPanel></mat-tab-nav-panel>\n<!-- Tabs keep their natural width, packed to the left; Material stretches them to fill by default. -->\n<nav mat-tab-nav-bar [mat-stretch-tabs]=\"false\" [tabPanel]=\"tabPanel\"\n *ngIf=\"!hidden$.value\" [@slideDownOnEnter]>\n <ng-content select=\"[nav-start]\"></ng-content>\n <a mat-tab-link *ngFor=\"let item of menuItems.value; trackBy: trackByPlaceDef\"\n aup-gc #gc=\"aup-gc\"\n [pectinCommand]=\"commandFactory.create(item.place, {disposedWith: gc})\"\n [active]=\"item.active\"\n [matTooltip]=\"getNavigationFace(item.place).tooltip()\">\n <aup-command-face [faces]=\"[getNavigationFace(item.place)]\"></aup-command-face>\n </a>\n <ng-content select=\"[nav-end]\"></ng-content>\n</nav>\n", styles: [":host{display:block}nav{overflow:hidden}div.place-holder{border:1px solid green}\n"] }]
|
|
23
|
-
}], ctorParameters: function () { return [{ type: i1.PlaceRouter }]; }
|
|
24
|
-
|
|
58
|
+
}], ctorParameters: function () { return [{ type: i1.PlaceRouter }]; }, propDecorators: { animationsDisabled: [{
|
|
59
|
+
type: HostBinding,
|
|
60
|
+
args: ['@.disabled']
|
|
61
|
+
}] } });
|
|
62
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFiYmVkLXBsYWNlLW5hdmlnYXRpb24uY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9hbmd1bGFyLXVpLXBvd2VydXBzL3NyYy9saWIvcGxhY2UvY29tcG9uZW50cy90YWJiZWQtcGxhY2UtbmF2aWdhdGlvbi90YWJiZWQtcGxhY2UtbmF2aWdhdGlvbi5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9saWJzL2FuZ3VsYXItdWktcG93ZXJ1cHMvc3JjL2xpYi9wbGFjZS9jb21wb25lbnRzL3RhYmJlZC1wbGFjZS1uYXZpZ2F0aW9uL3RhYmJlZC1wbGFjZS1uYXZpZ2F0aW9uLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBQyxTQUFTLEVBQUUsV0FBVyxFQUFDLE1BQU0sZUFBZSxDQUFDO0FBQ3JELE9BQU8sRUFBQyxHQUFHLEVBQUMsTUFBTSxnQkFBZ0IsQ0FBQztBQUNuQyxPQUFPLEVBQUMseUJBQXlCLEVBQUMsTUFBTSxzQ0FBc0MsQ0FBQztBQUMvRSxPQUFPLEVBQUMsV0FBVyxFQUFDLE1BQU0sb0JBQW9CLENBQUM7QUFDL0MsT0FBTyxFQUFDLGdDQUFnQyxFQUFDLE1BQU0sd0NBQXdDLENBQUM7Ozs7Ozs7OztBQVd4RixNQUFNLE9BQU8sOEJBQStCLFNBQVEsZ0NBQWdDO0lBRWxGOzs7Ozs7Ozs7Ozs7O09BYUc7SUFFTyxrQkFBa0IsR0FBRyxJQUFJLENBQ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YmFyIFttYXQtc3RyZXRjaC10YWJzXT1cImZhbHNlXCIgW3RhYlBhbmVsXT1cInRhYlBhbmVsXCJcbiAgICAgKm5nSWY9XCIhaGlkZGVuJC52YWx1ZVwiIFtAc2xpZGVEb3duT25FbnRlcl0+XG4gIDxuZy1jb250ZW50IHNlbGVjdD1cIltuYXYtc3RhcnRdXCI+PC9uZy1jb250ZW50PlxuICA8YSBtYXQtdGFiLWxpbmsgKm5nRm9yPVwibGV0IGl0ZW0gb2YgbWVudUl0ZW1zLnZhbHVlOyB0cmFja0J5OiB0cmFja0J5UGxhY2VEZWZcIlxuICAgICBhdXAtZ2MgI2djPVwiYXVwLWdjXCJcbiAgICAgW3BlY3RpbkNvbW1hbmRdPVwiY29tbWFuZEZhY3RvcnkuY3JlYXRlKGl0ZW0ucGxhY2UsIHtkaXNwb3NlZFdpdGg6IGdjfSlcIlxuICAgICBbYWN0aXZlXT1cIml0ZW0uYWN0aXZlXCJcbiAgICAgW21hdFRvb2x0aXBdPVwiZ2V0TmF2aWdhdGlvbkZhY2UoaXRlbS5wbGFjZSkudG9vbHRpcCgpXCI+XG4gICAgPGF1cC1jb21tYW5kLWZhY2UgW2ZhY2VzXT1cIltnZXROYXZpZ2F0aW9uRmFjZShpdGVtLnBsYWNlKV1cIj48L2F1cC1jb21tYW5kLWZhY2U+XG4gIDwvYT5cbiAgPG5nLWNvbnRlbnQgc2VsZWN0PVwiW25hdi1lbmRdXCI+PC9uZy1jb250ZW50PlxuPC9uYXY+XG4iXX0=
|
|
@@ -13926,16 +13926,53 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.9", ngImpor
|
|
|
13926
13926
|
}] } });
|
|
13927
13927
|
|
|
13928
13928
|
class TabbedPlaceNavigationComponent extends AbstractPlaceNavigationComponent {
|
|
13929
|
+
/**
|
|
13930
|
+
* Animations are suppressed while a navigation is in flight, and for a frame after it settles.
|
|
13931
|
+
*
|
|
13932
|
+
* The bar is `*ngIf`d, so without this its `:enter` fires on the initial render of EVERY tabbed
|
|
13933
|
+
* place — every bar visibly slid in on every page load, which is noise: nobody is watching a
|
|
13934
|
+
* transition while a page is still arriving. What should animate is a bar appearing or collapsing
|
|
13935
|
+
* because state CHANGED on a page the user is already looking at (a place being enabled, a role
|
|
13936
|
+
* granted, the last sibling tab disappearing).
|
|
13937
|
+
*
|
|
13938
|
+
* Keyed on the router's own in-flight signal rather than a timer, so it scales with however long
|
|
13939
|
+
* the navigation actually takes. The trailing frame matters: the bar is often rendered in the same
|
|
13940
|
+
* turn the navigation completes, so re-enabling immediately would let that first render animate
|
|
13941
|
+
* anyway. Same disable-then-reset-after-a-frame shape as TableBodyComponent.
|
|
13942
|
+
*/
|
|
13943
|
+
animationsDisabled = true;
|
|
13944
|
+
resetHandle = null;
|
|
13929
13945
|
constructor(router) {
|
|
13930
13946
|
super(router);
|
|
13947
|
+
const { when } = Dsl.disposeWith(this);
|
|
13948
|
+
when(router.navigationInProgress$).changes(inProgress => {
|
|
13949
|
+
if (this.resetHandle !== null) {
|
|
13950
|
+
cancelAnimationFrame(this.resetHandle);
|
|
13951
|
+
this.resetHandle = null;
|
|
13952
|
+
}
|
|
13953
|
+
if (inProgress) {
|
|
13954
|
+
this.animationsDisabled = true;
|
|
13955
|
+
return;
|
|
13956
|
+
}
|
|
13957
|
+
this.resetHandle = requestAnimationFrame(() => {
|
|
13958
|
+
this.resetHandle = null;
|
|
13959
|
+
this.animationsDisabled = false;
|
|
13960
|
+
this.cdr.markForCheck();
|
|
13961
|
+
});
|
|
13962
|
+
// Trigger initially so a bar constructed outside a navigation still enables its animations
|
|
13963
|
+
// (without this it would stay suppressed until the next navigation).
|
|
13964
|
+
}, { initialValue: "triggerChange" });
|
|
13931
13965
|
}
|
|
13932
13966
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: TabbedPlaceNavigationComponent, deps: [{ token: PlaceRouter }], target: i0.ɵɵFactoryTarget.Component });
|
|
13933
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.9", type: TabbedPlaceNavigationComponent, selector: "aup-tabbed-place-navigation", usesInheritance: true, ngImport: i0, template: "<!-- Declared BEFORE the nav that references it: the nav lives in an *ngIf embedded view, and a\n template ref declared after it can be unresolved on that view's first render. -->\n<mat-tab-nav-panel #tabPanel></mat-tab-nav-panel>\n<!-- Tabs keep their natural width, packed to the left; Material stretches them to fill by default. -->\n<nav mat-tab-nav-bar [mat-stretch-tabs]=\"false\" [tabPanel]=\"tabPanel\"\n *ngIf=\"!hidden$.value\" [@slideDownOnEnter]>\n <ng-content select=\"[nav-start]\"></ng-content>\n <a mat-tab-link *ngFor=\"let item of menuItems.value; trackBy: trackByPlaceDef\"\n aup-gc #gc=\"aup-gc\"\n [pectinCommand]=\"commandFactory.create(item.place, {disposedWith: gc})\"\n [active]=\"item.active\"\n [matTooltip]=\"getNavigationFace(item.place).tooltip()\">\n <aup-command-face [faces]=\"[getNavigationFace(item.place)]\"></aup-command-face>\n </a>\n <ng-content select=\"[nav-end]\"></ng-content>\n</nav>\n", styles: [":host{display:block}nav{overflow:hidden}div.place-holder{border:1px solid green}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$2.MatTabNav, selector: "[mat-tab-nav-bar]", inputs: ["color", "fitInkBarToContent", "mat-stretch-tabs", "animationDuration"], exportAs: ["matTabNavBar", "matTabNav"] }, { kind: "component", type: i3$2.MatTabNavPanel, selector: "mat-tab-nav-panel", inputs: ["id"], exportAs: ["matTabNavPanel"] }, { kind: "component", type: i3$2.MatTabLink, selector: "[mat-tab-link], [matTabLink]", inputs: ["disabled", "disableRipple", "tabIndex", "active", "id"], exportAs: ["matTabLink"] }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "directive", type: CommandDirective, selector: "[pectinCommand]", inputs: ["pectinCommand", "commandParameter", "preventDefault"] }, { kind: "directive", type: GarbageCollectorDirective, selector: "[aup-gc]", exportAs: ["aup-gc"] }, { kind: "component", type: CommandFaceComponent, selector: "aup-command-face", inputs: ["faces", "face", "ignoreIcon", "ignoreText", "includeMissingIconInLayout"] }], animations: [slideDownOnEnterAnimation] });
|
|
13967
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.9", type: TabbedPlaceNavigationComponent, selector: "aup-tabbed-place-navigation", host: { properties: { "@.disabled": "this.animationsDisabled" } }, usesInheritance: true, ngImport: i0, template: "<!-- Declared BEFORE the nav that references it: the nav lives in an *ngIf embedded view, and a\n template ref declared after it can be unresolved on that view's first render. -->\n<mat-tab-nav-panel #tabPanel></mat-tab-nav-panel>\n<!-- Tabs keep their natural width, packed to the left; Material stretches them to fill by default. -->\n<nav mat-tab-nav-bar [mat-stretch-tabs]=\"false\" [tabPanel]=\"tabPanel\"\n *ngIf=\"!hidden$.value\" [@slideDownOnEnter]>\n <ng-content select=\"[nav-start]\"></ng-content>\n <a mat-tab-link *ngFor=\"let item of menuItems.value; trackBy: trackByPlaceDef\"\n aup-gc #gc=\"aup-gc\"\n [pectinCommand]=\"commandFactory.create(item.place, {disposedWith: gc})\"\n [active]=\"item.active\"\n [matTooltip]=\"getNavigationFace(item.place).tooltip()\">\n <aup-command-face [faces]=\"[getNavigationFace(item.place)]\"></aup-command-face>\n </a>\n <ng-content select=\"[nav-end]\"></ng-content>\n</nav>\n", styles: [":host{display:block}nav{overflow:hidden}div.place-holder{border:1px solid green}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$2.MatTabNav, selector: "[mat-tab-nav-bar]", inputs: ["color", "fitInkBarToContent", "mat-stretch-tabs", "animationDuration"], exportAs: ["matTabNavBar", "matTabNav"] }, { kind: "component", type: i3$2.MatTabNavPanel, selector: "mat-tab-nav-panel", inputs: ["id"], exportAs: ["matTabNavPanel"] }, { kind: "component", type: i3$2.MatTabLink, selector: "[mat-tab-link], [matTabLink]", inputs: ["disabled", "disableRipple", "tabIndex", "active", "id"], exportAs: ["matTabLink"] }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "directive", type: CommandDirective, selector: "[pectinCommand]", inputs: ["pectinCommand", "commandParameter", "preventDefault"] }, { kind: "directive", type: GarbageCollectorDirective, selector: "[aup-gc]", exportAs: ["aup-gc"] }, { kind: "component", type: CommandFaceComponent, selector: "aup-command-face", inputs: ["faces", "face", "ignoreIcon", "ignoreText", "includeMissingIconInLayout"] }], animations: [slideDownOnEnterAnimation] });
|
|
13934
13968
|
}
|
|
13935
13969
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: TabbedPlaceNavigationComponent, decorators: [{
|
|
13936
13970
|
type: Component,
|
|
13937
13971
|
args: [{ selector: 'aup-tabbed-place-navigation', animations: [slideDownOnEnterAnimation], template: "<!-- Declared BEFORE the nav that references it: the nav lives in an *ngIf embedded view, and a\n template ref declared after it can be unresolved on that view's first render. -->\n<mat-tab-nav-panel #tabPanel></mat-tab-nav-panel>\n<!-- Tabs keep their natural width, packed to the left; Material stretches them to fill by default. -->\n<nav mat-tab-nav-bar [mat-stretch-tabs]=\"false\" [tabPanel]=\"tabPanel\"\n *ngIf=\"!hidden$.value\" [@slideDownOnEnter]>\n <ng-content select=\"[nav-start]\"></ng-content>\n <a mat-tab-link *ngFor=\"let item of menuItems.value; trackBy: trackByPlaceDef\"\n aup-gc #gc=\"aup-gc\"\n [pectinCommand]=\"commandFactory.create(item.place, {disposedWith: gc})\"\n [active]=\"item.active\"\n [matTooltip]=\"getNavigationFace(item.place).tooltip()\">\n <aup-command-face [faces]=\"[getNavigationFace(item.place)]\"></aup-command-face>\n </a>\n <ng-content select=\"[nav-end]\"></ng-content>\n</nav>\n", styles: [":host{display:block}nav{overflow:hidden}div.place-holder{border:1px solid green}\n"] }]
|
|
13938
|
-
}], ctorParameters: function () { return [{ type: PlaceRouter }]; }
|
|
13972
|
+
}], ctorParameters: function () { return [{ type: PlaceRouter }]; }, propDecorators: { animationsDisabled: [{
|
|
13973
|
+
type: HostBinding,
|
|
13974
|
+
args: ['@.disabled']
|
|
13975
|
+
}] } });
|
|
13939
13976
|
|
|
13940
13977
|
class PlaceModule {
|
|
13941
13978
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: PlaceModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|