Files
angular__angular/src/lib/tree/padding.ts
T
Paul Gschwendtner 985774a4ea fix: material not working with ES2015 (#13709)
Fixes that Angular Material cannot be used with ES2015. See #12760 for detailed information. We already had a workaround applied, but this improves the workaround because it only partially worked for classes where no attributes were defined.

Fixes #13695.
2018-10-23 13:48:03 -07:00

30 lines
1.0 KiB
TypeScript

/**
* @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 {CdkTreeNodePadding} from '@angular/cdk/tree';
import {Directive, Input} from '@angular/core';
/**
* Wrapper for the CdkTree padding with Material design styles.
*/
@Directive({
selector: '[matTreeNodePadding]',
providers: [{provide: CdkTreeNodePadding, useExisting: MatTreeNodePadding}]
})
export class MatTreeNodePadding<T> extends CdkTreeNodePadding<T> {
/** The level of depth of the tree node. The padding will be `level * indent` pixels. */
@Input('matTreeNodePadding') level: number;
/** The indent for each level. Default number 40px from material design menu sub-menu spec. */
@Input('matTreeNodePaddingIndent') indent: number;
}
// TODO(devversion): workaround for https://github.com/angular/material2/issues/12760
(MatTreeNodePadding as any)['ctorParameters'] = () =>
(CdkTreeNodePadding as any)['ctorParameters'];