sort.d-i-bF_IaU.d.ts 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. import * as i0 from '@angular/core';
  2. import { InjectionToken, OnChanges, OnDestroy, OnInit, EventEmitter } from '@angular/core';
  3. import { Subject, Observable } from 'rxjs';
  4. import { S as SortDirection } from './sort-direction.d-CF7VUsH-.js';
  5. /** Position of the arrow that displays when sorted. */
  6. type SortHeaderArrowPosition = 'before' | 'after';
  7. /** Interface for a directive that holds sorting state consumed by `MatSortHeader`. */
  8. interface MatSortable {
  9. /** The id of the column being sorted. */
  10. id: string;
  11. /** Starting sort direction. */
  12. start: SortDirection;
  13. /** Whether to disable clearing the sorting state. */
  14. disableClear: boolean;
  15. }
  16. /** The current sort state. */
  17. interface Sort {
  18. /** The id of the column being sorted. */
  19. active: string;
  20. /** The sort direction. */
  21. direction: SortDirection;
  22. }
  23. /** Default options for `mat-sort`. */
  24. interface MatSortDefaultOptions {
  25. /** Whether to disable clearing the sorting state. */
  26. disableClear?: boolean;
  27. /** Position of the arrow that displays when sorted. */
  28. arrowPosition?: SortHeaderArrowPosition;
  29. }
  30. /** Injection token to be used to override the default options for `mat-sort`. */
  31. declare const MAT_SORT_DEFAULT_OPTIONS: InjectionToken<MatSortDefaultOptions>;
  32. /** Container for MatSortables to manage the sort state and provide default sort parameters. */
  33. declare class MatSort implements OnChanges, OnDestroy, OnInit {
  34. private _defaultOptions?;
  35. private _initializedStream;
  36. /** Collection of all registered sortables that this directive manages. */
  37. sortables: Map<string, MatSortable>;
  38. /** Used to notify any child components listening to state changes. */
  39. readonly _stateChanges: Subject<void>;
  40. /** The id of the most recently sorted MatSortable. */
  41. active: string;
  42. /**
  43. * The direction to set when an MatSortable is initially sorted.
  44. * May be overridden by the MatSortable's sort start.
  45. */
  46. start: SortDirection;
  47. /** The sort direction of the currently active MatSortable. */
  48. get direction(): SortDirection;
  49. set direction(direction: SortDirection);
  50. private _direction;
  51. /**
  52. * Whether to disable the user from clearing the sort by finishing the sort direction cycle.
  53. * May be overridden by the MatSortable's disable clear input.
  54. */
  55. disableClear: boolean;
  56. /** Whether the sortable is disabled. */
  57. disabled: boolean;
  58. /** Event emitted when the user changes either the active sort or sort direction. */
  59. readonly sortChange: EventEmitter<Sort>;
  60. /** Emits when the paginator is initialized. */
  61. initialized: Observable<void>;
  62. constructor(_defaultOptions?: MatSortDefaultOptions | undefined);
  63. /**
  64. * Register function to be used by the contained MatSortables. Adds the MatSortable to the
  65. * collection of MatSortables.
  66. */
  67. register(sortable: MatSortable): void;
  68. /**
  69. * Unregister function to be used by the contained MatSortables. Removes the MatSortable from the
  70. * collection of contained MatSortables.
  71. */
  72. deregister(sortable: MatSortable): void;
  73. /** Sets the active sort id and determines the new sort direction. */
  74. sort(sortable: MatSortable): void;
  75. /** Returns the next sort direction of the active sortable, checking for potential overrides. */
  76. getNextSortDirection(sortable: MatSortable): SortDirection;
  77. ngOnInit(): void;
  78. ngOnChanges(): void;
  79. ngOnDestroy(): void;
  80. static ɵfac: i0.ɵɵFactoryDeclaration<MatSort, [{ optional: true; }]>;
  81. static ɵdir: i0.ɵɵDirectiveDeclaration<MatSort, "[matSort]", ["matSort"], { "active": { "alias": "matSortActive"; "required": false; }; "start": { "alias": "matSortStart"; "required": false; }; "direction": { "alias": "matSortDirection"; "required": false; }; "disableClear": { "alias": "matSortDisableClear"; "required": false; }; "disabled": { "alias": "matSortDisabled"; "required": false; }; }, { "sortChange": "matSortChange"; }, never, never, true, never>;
  82. static ngAcceptInputType_disableClear: unknown;
  83. static ngAcceptInputType_disabled: unknown;
  84. }
  85. export { MatSort as a, MAT_SORT_DEFAULT_OPTIONS as d };
  86. export type { MatSortable as M, SortHeaderArrowPosition as S, Sort as b, MatSortDefaultOptions as c };