[6a3a178] | 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 { CdkTree } from '@angular/cdk/tree';
|
---|
| 9 | import { ChangeDetectionStrategy, Component, ViewChild, ViewEncapsulation } from '@angular/core';
|
---|
| 10 | import { MatTreeNodeOutlet } from './outlet';
|
---|
| 11 | /**
|
---|
| 12 | * Wrapper for the CdkTable with Material design styles.
|
---|
| 13 | */
|
---|
| 14 | export class MatTree extends CdkTree {
|
---|
| 15 | }
|
---|
| 16 | MatTree.decorators = [
|
---|
| 17 | { type: Component, args: [{
|
---|
| 18 | selector: 'mat-tree',
|
---|
| 19 | exportAs: 'matTree',
|
---|
| 20 | template: `<ng-container matTreeNodeOutlet></ng-container>`,
|
---|
| 21 | host: {
|
---|
| 22 | // The 'cdk-tree' class needs to be included here because classes set in the host in the
|
---|
| 23 | // parent class are not inherited with View Engine. The 'cdk-tree' class in CdkTreeNode has
|
---|
| 24 | // to be set in the host because:
|
---|
| 25 | // if it is set as a @HostBinding it is not set by the time the tree nodes try to read the
|
---|
| 26 | // class from it.
|
---|
| 27 | // the ElementRef is not available in the constructor so the class can't be applied directly
|
---|
| 28 | // without a breaking constructor change.
|
---|
| 29 | 'class': 'mat-tree cdk-tree',
|
---|
| 30 | 'role': 'tree',
|
---|
| 31 | },
|
---|
| 32 | encapsulation: ViewEncapsulation.None,
|
---|
| 33 | // See note on CdkTree for explanation on why this uses the default change detection strategy.
|
---|
| 34 | // tslint:disable-next-line:validate-decorators
|
---|
| 35 | changeDetection: ChangeDetectionStrategy.Default,
|
---|
| 36 | providers: [{ provide: CdkTree, useExisting: MatTree }],
|
---|
| 37 | styles: [".mat-tree{display:block}.mat-tree-node{display:flex;align-items:center;flex:1;word-wrap:break-word}.mat-nested-tree-node{border-bottom-width:0}\n"]
|
---|
| 38 | },] }
|
---|
| 39 | ];
|
---|
| 40 | MatTree.propDecorators = {
|
---|
| 41 | _nodeOutlet: [{ type: ViewChild, args: [MatTreeNodeOutlet, { static: true },] }]
|
---|
| 42 | };
|
---|
| 43 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJlZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy9tYXRlcmlhbC90cmVlL3RyZWUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HO0FBRUgsT0FBTyxFQUFDLE9BQU8sRUFBQyxNQUFNLG1CQUFtQixDQUFDO0FBQzFDLE9BQU8sRUFDTCx1QkFBdUIsRUFDdkIsU0FBUyxFQUNULFNBQVMsRUFDVCxpQkFBaUIsRUFDbEIsTUFBTSxlQUFlLENBQUM7QUFDdkIsT0FBTyxFQUFDLGlCQUFpQixFQUFDLE1BQU0sVUFBVSxDQUFDO0FBRTNDOztHQUVHO0FBdUJILE1BQU0sT0FBTyxPQUFrQixTQUFRLE9BQWE7OztZQXRCbkQsU0FBUyxTQUFDO2dCQUNULFFBQVEsRUFBRSxVQUFVO2dCQUNwQixRQUFRLEVBQUUsU0FBUztnQkFDbkIsUUFBUSxFQUFFLGlEQUFpRDtnQkFDM0QsSUFBSSxFQUFFO29CQUNKLHdGQUF3RjtvQkFDeEYsMkZBQTJGO29CQUMzRixpQ0FBaUM7b0JBQ2pDLDBGQUEwRjtvQkFDMUYsaUJBQWlCO29CQUNqQiw0RkFBNEY7b0JBQzVGLHlDQUF5QztvQkFDekMsT0FBTyxFQUFFLG1CQUFtQjtvQkFDNUIsTUFBTSxFQUFFLE1BQU07aUJBQ2Y7Z0JBRUQsYUFBYSxFQUFFLGlCQUFpQixDQUFDLElBQUk7Z0JBQ3JDLDhGQUE4RjtnQkFDOUYsK0NBQStDO2dCQUMvQyxlQ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