padding.d.ts 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 { Directionality } from '@angular/cdk/bidi';
  9. import { ElementRef, OnDestroy, Renderer2 } from '@angular/core';
  10. import { CdkTree, CdkTreeNode } from './tree';
  11. /**
  12. * Indent for the children tree dataNodes.
  13. * This directive will add left-padding to the node to show hierarchy.
  14. */
  15. export declare class CdkTreeNodePadding<T> implements OnDestroy {
  16. private _treeNode;
  17. private _tree;
  18. private _renderer;
  19. private _element;
  20. private _dir;
  21. /** Current padding value applied to the element. Used to avoid unnecessarily hitting the DOM. */
  22. private _currentPadding;
  23. /** Subject that emits when the component has been destroyed. */
  24. private _destroyed;
  25. /** CSS units used for the indentation value. */
  26. indentUnits: string;
  27. /** The level of depth of the tree node. The padding will be `level * indent` pixels. */
  28. level: number;
  29. _level: number;
  30. /**
  31. * The indent for each level. Can be a number or a CSS string.
  32. * Default number 40px from material design menu sub-menu spec.
  33. */
  34. indent: number | string;
  35. _indent: number;
  36. constructor(_treeNode: CdkTreeNode<T>, _tree: CdkTree<T>, _renderer: Renderer2, _element: ElementRef<HTMLElement>, _dir: Directionality);
  37. ngOnDestroy(): void;
  38. /** The padding indent value for the tree node. Returns a string with px numbers if not null. */
  39. _paddingIndent(): string | null;
  40. _setPadding(forceChange?: boolean): void;
  41. }