mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
985774a4ea
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.
30 lines
1.0 KiB
TypeScript
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'];
|