1 | /**
|
---|
2 | * @license
|
---|
3 | * Copyright Google LLC All Rights Reserved.
|
---|
4 | *
|
---|
5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
6 | * found in the LICENSE file at https://angular.io/license
|
---|
7 | */
|
---|
8 | import { Directive, Inject, InjectionToken, Optional, TemplateRef, ViewContainerRef, } from '@angular/core';
|
---|
9 | import { CdkPortal } from '@angular/cdk/portal';
|
---|
10 | /**
|
---|
11 | * Injection token that can be used to reference instances of `MatTabLabel`. It serves as
|
---|
12 | * alternative token to the actual `MatTabLabel` class which could cause unnecessary
|
---|
13 | * retention of the class and its directive metadata.
|
---|
14 | */
|
---|
15 | export const MAT_TAB_LABEL = new InjectionToken('MatTabLabel');
|
---|
16 | /**
|
---|
17 | * Used to provide a tab label to a tab without causing a circular dependency.
|
---|
18 | * @docs-private
|
---|
19 | */
|
---|
20 | export const MAT_TAB = new InjectionToken('MAT_TAB');
|
---|
21 | /** Used to flag tab labels for use with the portal directive */
|
---|
22 | export class MatTabLabel extends CdkPortal {
|
---|
23 | constructor(templateRef, viewContainerRef, _closestTab) {
|
---|
24 | super(templateRef, viewContainerRef);
|
---|
25 | this._closestTab = _closestTab;
|
---|
26 | }
|
---|
27 | }
|
---|
28 | MatTabLabel.decorators = [
|
---|
29 | { type: Directive, args: [{
|
---|
30 | selector: '[mat-tab-label], [matTabLabel]',
|
---|
31 | providers: [{ provide: MAT_TAB_LABEL, useExisting: MatTabLabel }],
|
---|
32 | },] }
|
---|
33 | ];
|
---|
34 | MatTabLabel.ctorParameters = () => [
|
---|
35 | { type: TemplateRef },
|
---|
36 | { type: ViewContainerRef },
|
---|
37 | { type: undefined, decorators: [{ type: Inject, args: [MAT_TAB,] }, { type: Optional }] }
|
---|
38 | ];
|
---|
39 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFiLWxhYmVsLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vL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