calendar-body.d.ts 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 { ElementRef, EventEmitter, NgZone, OnChanges, SimpleChanges } from '@angular/core';
  9. /**
  10. * Extra CSS classes that can be associated with a calendar cell.
  11. */
  12. export declare type MatCalendarCellCssClasses = string | string[] | Set<string> | {
  13. [key: string]: any;
  14. };
  15. /**
  16. * An internal class that represents the data corresponding to a single calendar cell.
  17. * @docs-private
  18. */
  19. export declare class MatCalendarCell {
  20. value: number;
  21. displayValue: string;
  22. ariaLabel: string;
  23. enabled: boolean;
  24. cssClasses?: string | Set<string> | {
  25. [key: string]: any;
  26. } | string[] | undefined;
  27. constructor(value: number, displayValue: string, ariaLabel: string, enabled: boolean, cssClasses?: string | Set<string> | {
  28. [key: string]: any;
  29. } | string[] | undefined);
  30. }
  31. /**
  32. * An internal component used to display calendar data in a table.
  33. * @docs-private
  34. */
  35. export declare class MatCalendarBody implements OnChanges {
  36. private _elementRef;
  37. private _ngZone;
  38. /** The label for the table. (e.g. "Jan 2017"). */
  39. label: string;
  40. /** The cells to display in the table. */
  41. rows: MatCalendarCell[][];
  42. /** The value in the table that corresponds to today. */
  43. todayValue: number;
  44. /** The value in the table that is currently selected. */
  45. selectedValue: number;
  46. /** The minimum number of free cells needed to fit the label in the first row. */
  47. labelMinRequiredCells: number;
  48. /** The number of columns in the table. */
  49. numCols: number;
  50. /** The cell number of the active cell in the table. */
  51. activeCell: number;
  52. /**
  53. * The aspect ratio (width / height) to use for the cells in the table. This aspect ratio will be
  54. * maintained even as the table resizes.
  55. */
  56. cellAspectRatio: number;
  57. /** Emits when a new value is selected. */
  58. readonly selectedValueChange: EventEmitter<number>;
  59. /** The number of blank cells to put at the beginning for the first row. */
  60. _firstRowOffset: number;
  61. /** Padding for the individual date cells. */
  62. _cellPadding: string;
  63. /** Width of an individual cell. */
  64. _cellWidth: string;
  65. constructor(_elementRef: ElementRef<HTMLElement>, _ngZone: NgZone);
  66. _cellClicked(cell: MatCalendarCell): void;
  67. ngOnChanges(changes: SimpleChanges): void;
  68. _isActiveCell(rowIndex: number, colIndex: number): boolean;
  69. /** Focuses the active cell after the microtask queue is empty. */
  70. _focusActiveCell(): void;
  71. }