expansion-panel.d.ts 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 { AnimationEvent } from '@angular/animations';
  9. import { CdkAccordionItem } from '@angular/cdk/accordion';
  10. import { UniqueSelectionDispatcher } from '@angular/cdk/collections';
  11. import { TemplatePortal } from '@angular/cdk/portal';
  12. import { AfterContentInit, ChangeDetectorRef, EventEmitter, ElementRef, OnChanges, OnDestroy, SimpleChanges, ViewContainerRef, InjectionToken } from '@angular/core';
  13. import { Subject } from 'rxjs';
  14. import { MatExpansionPanelContent } from './expansion-panel-content';
  15. import { MatAccordionBase, MatAccordionTogglePosition } from './accordion-base';
  16. /** MatExpansionPanel's states. */
  17. export declare type MatExpansionPanelState = 'expanded' | 'collapsed';
  18. /**
  19. * Object that can be used to override the default options
  20. * for all of the expansion panels in a module.
  21. */
  22. export interface MatExpansionPanelDefaultOptions {
  23. /** Height of the header while the panel is expanded. */
  24. expandedHeight: string;
  25. /** Height of the header while the panel is collapsed. */
  26. collapsedHeight: string;
  27. /** Whether the toggle indicator should be hidden. */
  28. hideToggle: boolean;
  29. }
  30. /**
  31. * Injection token that can be used to configure the defalt
  32. * options for the expansion panel component.
  33. */
  34. export declare const MAT_EXPANSION_PANEL_DEFAULT_OPTIONS: InjectionToken<MatExpansionPanelDefaultOptions>;
  35. /**
  36. * `<mat-expansion-panel>`
  37. *
  38. * This component can be used as a single element to show expandable content, or as one of
  39. * multiple children of an element with the MatAccordion directive attached.
  40. */
  41. export declare class MatExpansionPanel extends CdkAccordionItem implements AfterContentInit, OnChanges, OnDestroy {
  42. private _viewContainerRef;
  43. _animationMode: string;
  44. private _document;
  45. private _hideToggle;
  46. private _togglePosition;
  47. /** Whether the toggle indicator should be hidden. */
  48. hideToggle: boolean;
  49. /** The position of the expansion indicator. */
  50. togglePosition: MatAccordionTogglePosition;
  51. /** An event emitted after the body's expansion animation happens. */
  52. afterExpand: EventEmitter<void>;
  53. /** An event emitted after the body's collapse animation happens. */
  54. afterCollapse: EventEmitter<void>;
  55. /** Stream that emits for changes in `@Input` properties. */
  56. readonly _inputChanges: Subject<SimpleChanges>;
  57. /** Optionally defined accordion the expansion panel belongs to. */
  58. accordion: MatAccordionBase;
  59. /** Content that will be rendered lazily. */
  60. _lazyContent: MatExpansionPanelContent;
  61. /** Element containing the panel's user-provided content. */
  62. _body: ElementRef<HTMLElement>;
  63. /** Portal holding the user's content. */
  64. _portal: TemplatePortal;
  65. /** ID for the associated header element. Used for a11y labelling. */
  66. _headerId: string;
  67. /** Stream of body animation done events. */
  68. _bodyAnimationDone: Subject<AnimationEvent>;
  69. constructor(accordion: MatAccordionBase, _changeDetectorRef: ChangeDetectorRef, _uniqueSelectionDispatcher: UniqueSelectionDispatcher, _viewContainerRef: ViewContainerRef, _document: any, _animationMode: string, defaultOptions?: MatExpansionPanelDefaultOptions);
  70. /** Determines whether the expansion panel should have spacing between it and its siblings. */
  71. _hasSpacing(): boolean;
  72. /** Gets the expanded state string. */
  73. _getExpandedState(): MatExpansionPanelState;
  74. ngAfterContentInit(): void;
  75. ngOnChanges(changes: SimpleChanges): void;
  76. ngOnDestroy(): void;
  77. /** Checks whether the expansion panel's content contains the currently-focused element. */
  78. _containsFocus(): boolean;
  79. }
  80. export declare class MatExpansionPanelActionRow {
  81. }