index.d.ts 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. import { _AbstractConstructor } from '@angular/material/core';
  2. import { AfterContentInit } from '@angular/core';
  3. import { AfterViewInit } from '@angular/core';
  4. import { AnimationEvent as AnimationEvent_2 } from '@angular/animations';
  5. import { AnimationTriggerMetadata } from '@angular/animations';
  6. import { BooleanInput } from '@angular/cdk/coercion';
  7. import { CdkAccordion } from '@angular/cdk/accordion';
  8. import { CdkAccordionItem } from '@angular/cdk/accordion';
  9. import { ChangeDetectorRef } from '@angular/core';
  10. import { _Constructor } from '@angular/material/core';
  11. import { ElementRef } from '@angular/core';
  12. import { EventEmitter } from '@angular/core';
  13. import { FocusableOption } from '@angular/cdk/a11y';
  14. import { FocusMonitor } from '@angular/cdk/a11y';
  15. import { FocusOrigin } from '@angular/cdk/a11y';
  16. import { HasTabIndex } from '@angular/material/core';
  17. import * as i0 from '@angular/core';
  18. import * as i5 from '@angular/common';
  19. import * as i6 from '@angular/material/core';
  20. import * as i7 from '@angular/cdk/accordion';
  21. import * as i8 from '@angular/cdk/portal';
  22. import { InjectionToken } from '@angular/core';
  23. import { OnChanges } from '@angular/core';
  24. import { OnDestroy } from '@angular/core';
  25. import { QueryList } from '@angular/core';
  26. import { SimpleChanges } from '@angular/core';
  27. import { Subject } from 'rxjs';
  28. import { TemplatePortal } from '@angular/cdk/portal';
  29. import { TemplateRef } from '@angular/core';
  30. import { UniqueSelectionDispatcher } from '@angular/cdk/collections';
  31. import { ViewContainerRef } from '@angular/core';
  32. /** Time and timing curve for expansion panel animations. */
  33. export declare const EXPANSION_PANEL_ANIMATION_TIMING = "225ms cubic-bezier(0.4,0.0,0.2,1)";
  34. declare namespace i1 {
  35. export {
  36. MatAccordion
  37. }
  38. }
  39. declare namespace i2 {
  40. export {
  41. MatExpansionPanelState,
  42. MatExpansionPanelDefaultOptions,
  43. MAT_EXPANSION_PANEL_DEFAULT_OPTIONS,
  44. MatExpansionPanel,
  45. MatExpansionPanelActionRow
  46. }
  47. }
  48. declare namespace i3 {
  49. export {
  50. MatExpansionPanelHeader,
  51. MatExpansionPanelDescription,
  52. MatExpansionPanelTitle
  53. }
  54. }
  55. declare namespace i4 {
  56. export {
  57. MatExpansionPanelContent
  58. }
  59. }
  60. /**
  61. * Token used to provide a `MatAccordion` to `MatExpansionPanel`.
  62. * Used primarily to avoid circular imports between `MatAccordion` and `MatExpansionPanel`.
  63. */
  64. export declare const MAT_ACCORDION: InjectionToken<MatAccordionBase>;
  65. /**
  66. * Token used to provide a `MatExpansionPanel` to `MatExpansionPanelContent`.
  67. * Used to avoid circular imports between `MatExpansionPanel` and `MatExpansionPanelContent`.
  68. */
  69. export declare const MAT_EXPANSION_PANEL: InjectionToken<MatExpansionPanelBase>;
  70. /**
  71. * Injection token that can be used to configure the default
  72. * options for the expansion panel component.
  73. */
  74. export declare const MAT_EXPANSION_PANEL_DEFAULT_OPTIONS: InjectionToken<MatExpansionPanelDefaultOptions>;
  75. /**
  76. * Directive for a Material Design Accordion.
  77. */
  78. export declare class MatAccordion extends CdkAccordion implements MatAccordionBase, AfterContentInit, OnDestroy {
  79. private _keyManager;
  80. /** Headers belonging to this accordion. */
  81. private _ownHeaders;
  82. /** All headers inside the accordion. Includes headers inside nested accordions. */
  83. _headers: QueryList<MatExpansionPanelHeader>;
  84. /** Whether the expansion indicator should be hidden. */
  85. get hideToggle(): boolean;
  86. set hideToggle(show: BooleanInput);
  87. private _hideToggle;
  88. /**
  89. * Display mode used for all expansion panels in the accordion. Currently two display
  90. * modes exist:
  91. * default - a gutter-like spacing is placed around any expanded panel, placing the expanded
  92. * panel at a different elevation from the rest of the accordion.
  93. * flat - no spacing is placed around expanded panels, showing all panels at the same
  94. * elevation.
  95. */
  96. displayMode: MatAccordionDisplayMode;
  97. /** The position of the expansion indicator. */
  98. togglePosition: MatAccordionTogglePosition;
  99. ngAfterContentInit(): void;
  100. /** Handles keyboard events coming in from the panel headers. */
  101. _handleHeaderKeydown(event: KeyboardEvent): void;
  102. _handleHeaderFocus(header: MatExpansionPanelHeader): void;
  103. ngOnDestroy(): void;
  104. static ɵfac: i0.ɵɵFactoryDeclaration<MatAccordion, never>;
  105. static ɵdir: i0.ɵɵDirectiveDeclaration<MatAccordion, "mat-accordion", ["matAccordion"], { "multi": { "alias": "multi"; "required": false; }; "hideToggle": { "alias": "hideToggle"; "required": false; }; "displayMode": { "alias": "displayMode"; "required": false; }; "togglePosition": { "alias": "togglePosition"; "required": false; }; }, {}, ["_headers"], never, false, never>;
  106. }
  107. /**
  108. * Base interface for a `MatAccordion`.
  109. * @docs-private
  110. */
  111. export declare interface MatAccordionBase extends CdkAccordion {
  112. /** Whether the expansion indicator should be hidden. */
  113. hideToggle: boolean;
  114. /** Display mode used for all expansion panels in the accordion. */
  115. displayMode: MatAccordionDisplayMode;
  116. /** The position of the expansion indicator. */
  117. togglePosition: MatAccordionTogglePosition;
  118. /** Handles keyboard events coming in from the panel headers. */
  119. _handleHeaderKeydown: (event: KeyboardEvent) => void;
  120. /** Handles focus events on the panel headers. */
  121. _handleHeaderFocus: (header: any) => void;
  122. }
  123. /** MatAccordion's display modes. */
  124. export declare type MatAccordionDisplayMode = 'default' | 'flat';
  125. /** MatAccordion's toggle positions. */
  126. export declare type MatAccordionTogglePosition = 'before' | 'after';
  127. /**
  128. * Animations used by the Material expansion panel.
  129. *
  130. * A bug in angular animation's `state` when ViewContainers are moved using ViewContainerRef.move()
  131. * causes the animation state of moved components to become `void` upon exit, and not update again
  132. * upon reentry into the DOM. This can lead a to situation for the expansion panel where the state
  133. * of the panel is `expanded` or `collapsed` but the animation state is `void`.
  134. *
  135. * To correctly handle animating to the next state, we animate between `void` and `collapsed` which
  136. * are defined to have the same styles. Since angular animates from the current styles to the
  137. * destination state's style definition, in situations where we are moving from `void`'s styles to
  138. * `collapsed` this acts a noop since no style values change.
  139. *
  140. * In the case where angular's animation state is out of sync with the expansion panel's state, the
  141. * expansion panel being `expanded` and angular animations being `void`, the animation from the
  142. * `expanded`'s effective styles (though in a `void` animation state) to the collapsed state will
  143. * occur as expected.
  144. *
  145. * Angular Bug: https://github.com/angular/angular/issues/18847
  146. *
  147. * @docs-private
  148. */
  149. export declare const matExpansionAnimations: {
  150. readonly indicatorRotate: AnimationTriggerMetadata;
  151. readonly bodyExpansion: AnimationTriggerMetadata;
  152. };
  153. export declare class MatExpansionModule {
  154. static ɵfac: i0.ɵɵFactoryDeclaration<MatExpansionModule, never>;
  155. static ɵmod: i0.ɵɵNgModuleDeclaration<MatExpansionModule, [typeof i1.MatAccordion, typeof i2.MatExpansionPanel, typeof i2.MatExpansionPanelActionRow, typeof i3.MatExpansionPanelHeader, typeof i3.MatExpansionPanelTitle, typeof i3.MatExpansionPanelDescription, typeof i4.MatExpansionPanelContent], [typeof i5.CommonModule, typeof i6.MatCommonModule, typeof i7.CdkAccordionModule, typeof i8.PortalModule], [typeof i1.MatAccordion, typeof i2.MatExpansionPanel, typeof i2.MatExpansionPanelActionRow, typeof i3.MatExpansionPanelHeader, typeof i3.MatExpansionPanelTitle, typeof i3.MatExpansionPanelDescription, typeof i4.MatExpansionPanelContent]>;
  156. static ɵinj: i0.ɵɵInjectorDeclaration<MatExpansionModule>;
  157. }
  158. /**
  159. * This component can be used as a single element to show expandable content, or as one of
  160. * multiple children of an element with the MatAccordion directive attached.
  161. */
  162. export declare class MatExpansionPanel extends CdkAccordionItem implements AfterContentInit, OnChanges, OnDestroy {
  163. private _viewContainerRef;
  164. _animationMode: string;
  165. private _document;
  166. private _hideToggle;
  167. private _togglePosition;
  168. /** Whether the toggle indicator should be hidden. */
  169. get hideToggle(): boolean;
  170. set hideToggle(value: BooleanInput);
  171. /** The position of the expansion indicator. */
  172. get togglePosition(): MatAccordionTogglePosition;
  173. set togglePosition(value: MatAccordionTogglePosition);
  174. /** An event emitted after the body's expansion animation happens. */
  175. readonly afterExpand: EventEmitter<void>;
  176. /** An event emitted after the body's collapse animation happens. */
  177. readonly afterCollapse: EventEmitter<void>;
  178. /** Stream that emits for changes in `@Input` properties. */
  179. readonly _inputChanges: Subject<SimpleChanges>;
  180. /** Optionally defined accordion the expansion panel belongs to. */
  181. accordion: MatAccordionBase;
  182. /** Content that will be rendered lazily. */
  183. _lazyContent: MatExpansionPanelContent;
  184. /** Element containing the panel's user-provided content. */
  185. _body: ElementRef<HTMLElement>;
  186. /** Portal holding the user's content. */
  187. _portal: TemplatePortal;
  188. /** ID for the associated header element. Used for a11y labelling. */
  189. _headerId: string;
  190. /** Stream of body animation done events. */
  191. readonly _bodyAnimationDone: Subject<AnimationEvent_2>;
  192. constructor(accordion: MatAccordionBase, _changeDetectorRef: ChangeDetectorRef, _uniqueSelectionDispatcher: UniqueSelectionDispatcher, _viewContainerRef: ViewContainerRef, _document: any, _animationMode: string, defaultOptions?: MatExpansionPanelDefaultOptions);
  193. /** Determines whether the expansion panel should have spacing between it and its siblings. */
  194. _hasSpacing(): boolean;
  195. /** Gets the expanded state string. */
  196. _getExpandedState(): MatExpansionPanelState;
  197. /** Toggles the expanded state of the expansion panel. */
  198. toggle(): void;
  199. /** Sets the expanded state of the expansion panel to false. */
  200. close(): void;
  201. /** Sets the expanded state of the expansion panel to true. */
  202. open(): void;
  203. ngAfterContentInit(): void;
  204. ngOnChanges(changes: SimpleChanges): void;
  205. ngOnDestroy(): void;
  206. /** Checks whether the expansion panel's content contains the currently-focused element. */
  207. _containsFocus(): boolean;
  208. static ɵfac: i0.ɵɵFactoryDeclaration<MatExpansionPanel, [{ optional: true; skipSelf: true; }, null, null, null, null, { optional: true; }, { optional: true; }]>;
  209. static ɵcmp: i0.ɵɵComponentDeclaration<MatExpansionPanel, "mat-expansion-panel", ["matExpansionPanel"], { "disabled": { "alias": "disabled"; "required": false; }; "expanded": { "alias": "expanded"; "required": false; }; "hideToggle": { "alias": "hideToggle"; "required": false; }; "togglePosition": { "alias": "togglePosition"; "required": false; }; }, { "opened": "opened"; "closed": "closed"; "expandedChange": "expandedChange"; "afterExpand": "afterExpand"; "afterCollapse": "afterCollapse"; }, ["_lazyContent"], ["mat-expansion-panel-header", "*", "mat-action-row"], false, never>;
  210. }
  211. /**
  212. * Actions of a `<mat-expansion-panel>`.
  213. */
  214. export declare class MatExpansionPanelActionRow {
  215. static ɵfac: i0.ɵɵFactoryDeclaration<MatExpansionPanelActionRow, never>;
  216. static ɵdir: i0.ɵɵDirectiveDeclaration<MatExpansionPanelActionRow, "mat-action-row", never, {}, {}, never, never, false, never>;
  217. }
  218. /**
  219. * Base interface for a `MatExpansionPanel`.
  220. * @docs-private
  221. */
  222. declare interface MatExpansionPanelBase extends CdkAccordionItem {
  223. /** Whether the toggle indicator should be hidden. */
  224. hideToggle: boolean;
  225. }
  226. /**
  227. * Expansion panel content that will be rendered lazily
  228. * after the panel is opened for the first time.
  229. */
  230. export declare class MatExpansionPanelContent {
  231. _template: TemplateRef<any>;
  232. _expansionPanel?: MatExpansionPanelBase | undefined;
  233. constructor(_template: TemplateRef<any>, _expansionPanel?: MatExpansionPanelBase | undefined);
  234. static ɵfac: i0.ɵɵFactoryDeclaration<MatExpansionPanelContent, [null, { optional: true; }]>;
  235. static ɵdir: i0.ɵɵDirectiveDeclaration<MatExpansionPanelContent, "ng-template[matExpansionPanelContent]", never, {}, {}, never, never, false, never>;
  236. }
  237. /**
  238. * Object that can be used to override the default options
  239. * for all of the expansion panels in a module.
  240. */
  241. export declare interface MatExpansionPanelDefaultOptions {
  242. /** Height of the header while the panel is expanded. */
  243. expandedHeight: string;
  244. /** Height of the header while the panel is collapsed. */
  245. collapsedHeight: string;
  246. /** Whether the toggle indicator should be hidden. */
  247. hideToggle: boolean;
  248. }
  249. /**
  250. * Description element of a `<mat-expansion-panel-header>`.
  251. */
  252. export declare class MatExpansionPanelDescription {
  253. static ɵfac: i0.ɵɵFactoryDeclaration<MatExpansionPanelDescription, never>;
  254. static ɵdir: i0.ɵɵDirectiveDeclaration<MatExpansionPanelDescription, "mat-panel-description", never, {}, {}, never, never, false, never>;
  255. }
  256. /**
  257. * Header element of a `<mat-expansion-panel>`.
  258. */
  259. export declare class MatExpansionPanelHeader extends _MatExpansionPanelHeaderMixinBase implements AfterViewInit, OnDestroy, FocusableOption, HasTabIndex {
  260. panel: MatExpansionPanel;
  261. private _element;
  262. private _focusMonitor;
  263. private _changeDetectorRef;
  264. _animationMode?: string | undefined;
  265. private _parentChangeSubscription;
  266. constructor(panel: MatExpansionPanel, _element: ElementRef, _focusMonitor: FocusMonitor, _changeDetectorRef: ChangeDetectorRef, defaultOptions?: MatExpansionPanelDefaultOptions, _animationMode?: string | undefined, tabIndex?: string);
  267. /** Height of the header while the panel is expanded. */
  268. expandedHeight: string;
  269. /** Height of the header while the panel is collapsed. */
  270. collapsedHeight: string;
  271. /**
  272. * Whether the associated panel is disabled. Implemented as a part of `FocusableOption`.
  273. * @docs-private
  274. */
  275. get disabled(): boolean;
  276. /** Toggles the expanded state of the panel. */
  277. _toggle(): void;
  278. /** Gets whether the panel is expanded. */
  279. _isExpanded(): boolean;
  280. /** Gets the expanded state string of the panel. */
  281. _getExpandedState(): string;
  282. /** Gets the panel id. */
  283. _getPanelId(): string;
  284. /** Gets the toggle position for the header. */
  285. _getTogglePosition(): MatAccordionTogglePosition;
  286. /** Gets whether the expand indicator should be shown. */
  287. _showToggle(): boolean;
  288. /**
  289. * Gets the current height of the header. Null if no custom height has been
  290. * specified, and if the default height from the stylesheet should be used.
  291. */
  292. _getHeaderHeight(): string | null;
  293. /** Handle keydown event calling to toggle() if appropriate. */
  294. _keydown(event: KeyboardEvent): void;
  295. /**
  296. * Focuses the panel header. Implemented as a part of `FocusableOption`.
  297. * @param origin Origin of the action that triggered the focus.
  298. * @docs-private
  299. */
  300. focus(origin?: FocusOrigin, options?: FocusOptions): void;
  301. ngAfterViewInit(): void;
  302. ngOnDestroy(): void;
  303. static ɵfac: i0.ɵɵFactoryDeclaration<MatExpansionPanelHeader, [{ host: true; }, null, null, null, { optional: true; }, { optional: true; }, { attribute: "tabindex"; }]>;
  304. static ɵcmp: i0.ɵɵComponentDeclaration<MatExpansionPanelHeader, "mat-expansion-panel-header", never, { "tabIndex": { "alias": "tabIndex"; "required": false; }; "expandedHeight": { "alias": "expandedHeight"; "required": false; }; "collapsedHeight": { "alias": "collapsedHeight"; "required": false; }; }, {}, never, ["mat-panel-title", "mat-panel-description", "*"], false, never>;
  305. }
  306. /** @docs-private */
  307. declare abstract class MatExpansionPanelHeaderBase {
  308. abstract readonly disabled: boolean;
  309. }
  310. declare const _MatExpansionPanelHeaderMixinBase: _Constructor<HasTabIndex> & _AbstractConstructor<HasTabIndex> & typeof MatExpansionPanelHeaderBase;
  311. /** MatExpansionPanel's states. */
  312. export declare type MatExpansionPanelState = 'expanded' | 'collapsed';
  313. /**
  314. * Title element of a `<mat-expansion-panel-header>`.
  315. */
  316. export declare class MatExpansionPanelTitle {
  317. static ɵfac: i0.ɵɵFactoryDeclaration<MatExpansionPanelTitle, never>;
  318. static ɵdir: i0.ɵɵDirectiveDeclaration<MatExpansionPanelTitle, "mat-panel-title", never, {}, {}, never, never, false, never>;
  319. }
  320. export { }