index.d.ts 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. import * as i0 from '@angular/core';
  2. import { Optional, OnDestroy, OnInit, AfterViewInit } from '@angular/core';
  3. import { M as MatCommonModule } from '../common-module.d-C8xzHJDr.js';
  4. import { M as MatSortable, a as MatSort, S as SortHeaderArrowPosition } from '../sort.d-i-bF_IaU.js';
  5. export { d as MAT_SORT_DEFAULT_OPTIONS, c as MatSortDefaultOptions, b as Sort } from '../sort.d-i-bF_IaU.js';
  6. import { S as SortDirection } from '../sort-direction.d-CF7VUsH-.js';
  7. import { Subject } from 'rxjs';
  8. import '@angular/cdk/bidi';
  9. /**
  10. * To modify the labels and text displayed, create a new instance of MatSortHeaderIntl and
  11. * include it in a custom provider.
  12. */
  13. declare class MatSortHeaderIntl {
  14. /**
  15. * Stream that emits whenever the labels here are changed. Use this to notify
  16. * components if the labels have changed after initialization.
  17. */
  18. readonly changes: Subject<void>;
  19. static ɵfac: i0.ɵɵFactoryDeclaration<MatSortHeaderIntl, never>;
  20. static ɵprov: i0.ɵɵInjectableDeclaration<MatSortHeaderIntl>;
  21. }
  22. /**
  23. * @docs-private
  24. * @deprecated No longer used, will be removed.
  25. * @breaking-change 21.0.0
  26. */
  27. declare function MAT_SORT_HEADER_INTL_PROVIDER_FACTORY(parentIntl: MatSortHeaderIntl): MatSortHeaderIntl;
  28. /**
  29. * @docs-private
  30. * @deprecated No longer used, will be removed.
  31. * @breaking-change 21.0.0
  32. */
  33. declare const MAT_SORT_HEADER_INTL_PROVIDER: {
  34. provide: typeof MatSortHeaderIntl;
  35. deps: Optional[][];
  36. useFactory: typeof MAT_SORT_HEADER_INTL_PROVIDER_FACTORY;
  37. };
  38. /**
  39. * Valid positions for the arrow to be in for its opacity and translation. If the state is a
  40. * sort direction, the position of the arrow will be above/below and opacity 0. If the state is
  41. * hint, the arrow will be in the center with a slight opacity. Active state means the arrow will
  42. * be fully opaque in the center.
  43. *
  44. * @docs-private
  45. * @deprecated No longer being used, to be removed.
  46. * @breaking-change 21.0.0
  47. */
  48. type ArrowViewState = SortDirection | 'hint' | 'active';
  49. /**
  50. * States describing the arrow's animated position (animating fromState to toState).
  51. * If the fromState is not defined, there will be no animated transition to the toState.
  52. * @docs-private
  53. * @deprecated No longer being used, to be removed.
  54. * @breaking-change 21.0.0
  55. */
  56. interface ArrowViewStateTransition {
  57. fromState?: ArrowViewState;
  58. toState?: ArrowViewState;
  59. }
  60. /** Column definition associated with a `MatSortHeader`. */
  61. interface MatSortHeaderColumnDef {
  62. name: string;
  63. }
  64. /**
  65. * Applies sorting behavior (click to change sort) and styles to an element, including an
  66. * arrow to display the current sort direction.
  67. *
  68. * Must be provided with an id and contained within a parent MatSort directive.
  69. *
  70. * If used on header cells in a CdkTable, it will automatically default its id from its containing
  71. * column definition.
  72. */
  73. declare class MatSortHeader implements MatSortable, OnDestroy, OnInit, AfterViewInit {
  74. _intl: MatSortHeaderIntl;
  75. _sort: MatSort;
  76. _columnDef: MatSortHeaderColumnDef | null;
  77. private _changeDetectorRef;
  78. private _focusMonitor;
  79. private _elementRef;
  80. private _ariaDescriber;
  81. private _renderChanges;
  82. protected _animationModule: "NoopAnimations" | "BrowserAnimations" | null;
  83. /**
  84. * Indicates which state was just cleared from the sort header.
  85. * Will be reset on the next interaction. Used for coordinating animations.
  86. */
  87. protected _recentlyCleared: i0.WritableSignal<SortDirection | null>;
  88. /**
  89. * The element with role="button" inside this component's view. We need this
  90. * in order to apply a description with AriaDescriber.
  91. */
  92. private _sortButton;
  93. /**
  94. * ID of this sort header. If used within the context of a CdkColumnDef, this will default to
  95. * the column's name.
  96. */
  97. id: string;
  98. /** Sets the position of the arrow that displays when sorted. */
  99. arrowPosition: SortHeaderArrowPosition;
  100. /** Overrides the sort start value of the containing MatSort for this MatSortable. */
  101. start: SortDirection;
  102. /** whether the sort header is disabled. */
  103. disabled: boolean;
  104. /**
  105. * Description applied to MatSortHeader's button element with aria-describedby. This text should
  106. * describe the action that will occur when the user clicks the sort header.
  107. */
  108. get sortActionDescription(): string;
  109. set sortActionDescription(value: string);
  110. private _sortActionDescription;
  111. /** Overrides the disable clear value of the containing MatSort for this MatSortable. */
  112. disableClear: boolean;
  113. constructor(...args: unknown[]);
  114. ngOnInit(): void;
  115. ngAfterViewInit(): void;
  116. ngOnDestroy(): void;
  117. /** Triggers the sort on this sort header and removes the indicator hint. */
  118. _toggleOnInteraction(): void;
  119. _handleKeydown(event: KeyboardEvent): void;
  120. /** Whether this MatSortHeader is currently sorted in either ascending or descending order. */
  121. _isSorted(): boolean;
  122. _isDisabled(): boolean;
  123. /**
  124. * Gets the aria-sort attribute that should be applied to this sort header. If this header
  125. * is not sorted, returns null so that the attribute is removed from the host element. Aria spec
  126. * says that the aria-sort property should only be present on one header at a time, so removing
  127. * ensures this is true.
  128. */
  129. _getAriaSortAttribute(): "none" | "ascending" | "descending";
  130. /** Whether the arrow inside the sort header should be rendered. */
  131. _renderArrow(): boolean;
  132. private _updateSortActionDescription;
  133. static ɵfac: i0.ɵɵFactoryDeclaration<MatSortHeader, never>;
  134. static ɵcmp: i0.ɵɵComponentDeclaration<MatSortHeader, "[mat-sort-header]", ["matSortHeader"], { "id": { "alias": "mat-sort-header"; "required": false; }; "arrowPosition": { "alias": "arrowPosition"; "required": false; }; "start": { "alias": "start"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "sortActionDescription": { "alias": "sortActionDescription"; "required": false; }; "disableClear": { "alias": "disableClear"; "required": false; }; }, {}, never, ["*"], true, never>;
  135. static ngAcceptInputType_disabled: unknown;
  136. static ngAcceptInputType_disableClear: unknown;
  137. }
  138. declare class MatSortModule {
  139. static ɵfac: i0.ɵɵFactoryDeclaration<MatSortModule, never>;
  140. static ɵmod: i0.ɵɵNgModuleDeclaration<MatSortModule, never, [typeof MatCommonModule, typeof MatSort, typeof MatSortHeader], [typeof MatSort, typeof MatSortHeader]>;
  141. static ɵinj: i0.ɵɵInjectorDeclaration<MatSortModule>;
  142. }
  143. /**
  144. * Animations used by MatSort.
  145. * @docs-private
  146. * @deprecated No longer being used, to be removed.
  147. * @breaking-change 21.0.0
  148. */
  149. declare const matSortAnimations: {
  150. readonly indicator: any;
  151. readonly leftPointer: any;
  152. readonly rightPointer: any;
  153. readonly arrowOpacity: any;
  154. readonly arrowPosition: any;
  155. readonly allowChildren: any;
  156. };
  157. export { MAT_SORT_HEADER_INTL_PROVIDER, MAT_SORT_HEADER_INTL_PROVIDER_FACTORY, MatSort, MatSortHeader, MatSortHeaderIntl, MatSortModule, MatSortable, SortDirection, SortHeaderArrowPosition, matSortAnimations };
  158. export type { ArrowViewState, ArrowViewStateTransition };