/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import { ChangeDetectionStrategy, Component, ContentChild, Directive, Inject, InjectionToken, Input, Optional, TemplateRef, ViewChild, ViewContainerRef, ViewEncapsulation, } from '@angular/core'; import { MatTabContent } from './tab-content'; import { MAT_TAB, MatTabLabel } from './tab-label'; import { mixinDisabled } from '@angular/material/core'; import { TemplatePortal } from '@angular/cdk/portal'; import { Subject } from 'rxjs'; import * as i0 from "@angular/core"; // Boilerplate for applying mixins to MatTab. /** @docs-private */ const _MatTabMixinBase = mixinDisabled(class { }); /** * Used to provide a tab group to a tab without causing a circular dependency. * @docs-private */ export const MAT_TAB_GROUP = new InjectionToken('MAT_TAB_GROUP'); /** @docs-private */ export class _MatTabBase extends _MatTabMixinBase { /** @docs-private */ get content() { return this._contentPortal; } constructor(_viewContainerRef, _closestTabGroup) { super(); this._viewContainerRef = _viewContainerRef; this._closestTabGroup = _closestTabGroup; /** Plain text label for the tab, used when there is no template label. */ this.textLabel = ''; /** Portal that will be the hosted content of the tab */ this._contentPortal = null; /** Emits whenever the internal state of the tab changes. */ this._stateChanges = new Subject(); /** * The relatively indexed position where 0 represents the center, negative is left, and positive * represents the right. */ this.position = null; /** * The initial relatively index origin of the tab if it was created and selected after there * was already a selected tab. Provides context of what position the tab should originate from. */ this.origin = null; /** * Whether the tab is currently active. */ this.isActive = false; } ngOnChanges(changes) { if (changes.hasOwnProperty('textLabel') || changes.hasOwnProperty('disabled')) { this._stateChanges.next(); } } ngOnDestroy() { this._stateChanges.complete(); } ngOnInit() { this._contentPortal = new TemplatePortal(this._explicitContent || this._implicitContent, this._viewContainerRef); } /** * This has been extracted to a util because of TS 4 and VE. * View Engine doesn't support property rename inheritance. * TS 4.0 doesn't allow properties to override accessors or vice-versa. * @docs-private */ _setTemplateLabelInput(value) { // Only update the label if the query managed to find one. This works around an issue where a // user may have manually set `templateLabel` during creation mode, which would then get // clobbered by `undefined` when the query resolves. Also note that we check that the closest // tab matches the current one so that we don't pick up labels from nested tabs. if (value && value._closestTab === this) { this._templateLabel = value; } } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: _MatTabBase, deps: [{ token: i0.ViewContainerRef }, { token: MAT_TAB_GROUP, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); } static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.1", type: _MatTabBase, inputs: { textLabel: ["label", "textLabel"], ariaLabel: ["aria-label", "ariaLabel"], ariaLabelledby: ["aria-labelledby", "ariaLabelledby"], labelClass: "labelClass", bodyClass: "bodyClass" }, viewQueries: [{ propertyName: "_implicitContent", first: true, predicate: TemplateRef, descendants: true, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0 }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: _MatTabBase, decorators: [{ type: Directive }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: undefined, decorators: [{ type: Inject, args: [MAT_TAB_GROUP] }, { type: Optional }] }]; }, propDecorators: { _implicitContent: [{ type: ViewChild, args: [TemplateRef, { static: true }] }], textLabel: [{ type: Input, args: ['label'] }], ariaLabel: [{ type: Input, args: ['aria-label'] }], ariaLabelledby: [{ type: Input, args: ['aria-labelledby'] }], labelClass: [{ type: Input }], bodyClass: [{ type: Input }] } }); export class MatTab extends _MatTabBase { constructor() { super(...arguments); /** * Template provided in the tab content that will be used if present, used to enable lazy-loading */ this._explicitContent = undefined; } /** Content for the tab label given by ``. */ get templateLabel() { return this._templateLabel; } set templateLabel(value) { this._setTemplateLabelInput(value); } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: MatTab, deps: null, target: i0.ɵɵFactoryTarget.Component }); } static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.1", type: MatTab, selector: "mat-tab", inputs: { disabled: "disabled" }, providers: [{ provide: MAT_TAB, useExisting: MatTab }], queries: [{ propertyName: "_explicitContent", first: true, predicate: MatTabContent, descendants: true, read: TemplateRef, static: true }, { propertyName: "templateLabel", first: true, predicate: MatTabLabel, descendants: true }], exportAs: ["matTab"], usesInheritance: true, ngImport: i0, template: "\n\n", changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: MatTab, decorators: [{ type: Component, args: [{ selector: 'mat-tab', inputs: ['disabled'], changeDetection: ChangeDetectionStrategy.Default, encapsulation: ViewEncapsulation.None, exportAs: 'matTab', providers: [{ provide: MAT_TAB, useExisting: MatTab }], template: "\n\n" }] }], propDecorators: { _explicitContent: [{ type: ContentChild, args: [MatTabContent, { read: TemplateRef, static: true }] }], templateLabel: [{ type: ContentChild, args: [MatTabLabel] }] } }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFiLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL21hdGVyaWFsL3RhYnMvdGFiLnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL21hdGVyaWFsL3RhYnMvdGFiLmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HO0FBRUgsT0FBTyxFQUNMLHVCQUF1QixFQUN2QixTQUFTLEVBQ1QsWUFBWSxFQUNaLFNBQVMsRUFDVCxNQUFNLEVBQ04sY0FBYyxFQUNkLEtBQUssRUFJTCxRQUFRLEVBRVIsV0FBVyxFQUNYLFNBQVMsRUFDVCxnQkFBZ0IsRUFDaEIsaUJBQWlCLEdBQ2xCLE1BQU0sZUFBZSxDQUFDO0FBQ3ZCLE9BQU8sRUFBQyxhQUFhLEVBQUMsTUFBTS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