|
26 | 26 | [style.paddingBottom]="_cellPadding">
|
27 | 27 | {{_firstRowOffset >= labelMinRequiredCells ? label : ''}}
|
28 | 28 | </td>
|
29 |
| - <td *ngFor="let item of row; let colIndex = index" |
30 |
| - role="gridcell" |
31 |
| - class="mat-calendar-body-cell" |
32 |
| - [ngClass]="item.cssClasses" |
33 |
| - [tabindex]="_isActiveCell(rowIndex, colIndex) ? 0 : -1" |
34 |
| - [attr.data-mat-row]="rowIndex" |
35 |
| - [attr.data-mat-col]="colIndex" |
36 |
| - [class.mat-calendar-body-disabled]="!item.enabled" |
37 |
| - [class.mat-calendar-body-active]="_isActiveCell(rowIndex, colIndex)" |
38 |
| - [class.mat-calendar-body-range-start]="_isRangeStart(item.compareValue)" |
39 |
| - [class.mat-calendar-body-range-end]="_isRangeEnd(item.compareValue)" |
40 |
| - [class.mat-calendar-body-in-range]="_isInRange(item.compareValue)" |
41 |
| - [class.mat-calendar-body-comparison-bridge-start]="_isComparisonBridgeStart(item.compareValue, rowIndex, colIndex)" |
42 |
| - [class.mat-calendar-body-comparison-bridge-end]="_isComparisonBridgeEnd(item.compareValue, rowIndex, colIndex)" |
43 |
| - [class.mat-calendar-body-comparison-start]="_isComparisonStart(item.compareValue)" |
44 |
| - [class.mat-calendar-body-comparison-end]="_isComparisonEnd(item.compareValue)" |
45 |
| - [class.mat-calendar-body-in-comparison-range]="_isInComparisonRange(item.compareValue)" |
46 |
| - [class.mat-calendar-body-preview-start]="_isPreviewStart(item.compareValue)" |
47 |
| - [class.mat-calendar-body-preview-end]="_isPreviewEnd(item.compareValue)" |
48 |
| - [class.mat-calendar-body-in-preview]="_isInPreview(item.compareValue)" |
49 |
| - [attr.aria-label]="item.ariaLabel" |
50 |
| - [attr.aria-disabled]="!item.enabled || null" |
51 |
| - [attr.aria-selected]="_isSelected(item.compareValue)" |
52 |
| - [attr.aria-current]="todayValue === item.compareValue ? 'date' : null" |
53 |
| - (click)="_cellClicked(item, $event)" |
54 |
| - [style.width]="_cellWidth" |
55 |
| - [style.paddingTop]="_cellPadding" |
56 |
| - [style.paddingBottom]="_cellPadding"> |
57 |
| - <div class="mat-calendar-body-cell-content mat-focus-indicator" |
58 |
| - [class.mat-calendar-body-selected]="_isSelected(item.compareValue)" |
59 |
| - [class.mat-calendar-body-comparison-identical]="_isComparisonIdentical(item.compareValue)" |
60 |
| - [class.mat-calendar-body-today]="todayValue === item.compareValue"> |
61 |
| - {{item.displayValue}} |
62 |
| - </div> |
63 |
| - <div class="mat-calendar-body-cell-preview" aria-hidden="true"></div> |
| 29 | + <!-- |
| 30 | + Each gridcell in the calendar contains a button, which signals to assistive technology that the |
| 31 | + cell is interactable, as well as the selection state via `aria-pressed`. See #23476 for |
| 32 | + background. |
| 33 | + --> |
| 34 | + <td |
| 35 | + *ngFor="let item of row; let colIndex = index" |
| 36 | + role="gridcell" |
| 37 | + class="mat-calendar-body-cell-container" |
| 38 | + [style.width]="_cellWidth" |
| 39 | + [style.paddingTop]="_cellPadding" |
| 40 | + [style.paddingBottom]="_cellPadding" |
| 41 | + [attr.data-mat-row]="rowIndex" |
| 42 | + [attr.data-mat-col]="colIndex" |
| 43 | + > |
| 44 | + <button |
| 45 | + type="button" |
| 46 | + class="mat-calendar-body-cell" |
| 47 | + [ngClass]="item.cssClasses" |
| 48 | + [tabindex]="_isActiveCell(rowIndex, colIndex) ? 0 : -1" |
| 49 | + [class.mat-calendar-body-disabled]="!item.enabled" |
| 50 | + [class.mat-calendar-body-active]="_isActiveCell(rowIndex, colIndex)" |
| 51 | + [class.mat-calendar-body-range-start]="_isRangeStart(item.compareValue)" |
| 52 | + [class.mat-calendar-body-range-end]="_isRangeEnd(item.compareValue)" |
| 53 | + [class.mat-calendar-body-in-range]="_isInRange(item.compareValue)" |
| 54 | + [class.mat-calendar-body-comparison-bridge-start]="_isComparisonBridgeStart(item.compareValue, rowIndex, colIndex)" |
| 55 | + [class.mat-calendar-body-comparison-bridge-end]="_isComparisonBridgeEnd(item.compareValue, rowIndex, colIndex)" |
| 56 | + [class.mat-calendar-body-comparison-start]="_isComparisonStart(item.compareValue)" |
| 57 | + [class.mat-calendar-body-comparison-end]="_isComparisonEnd(item.compareValue)" |
| 58 | + [class.mat-calendar-body-in-comparison-range]="_isInComparisonRange(item.compareValue)" |
| 59 | + [class.mat-calendar-body-preview-start]="_isPreviewStart(item.compareValue)" |
| 60 | + [class.mat-calendar-body-preview-end]="_isPreviewEnd(item.compareValue)" |
| 61 | + [class.mat-calendar-body-in-preview]="_isInPreview(item.compareValue)" |
| 62 | + [attr.aria-label]="item.ariaLabel" |
| 63 | + [attr.aria-disabled]="!item.enabled || null" |
| 64 | + [attr.aria-pressed]="_isSelected(item.compareValue)" |
| 65 | + [attr.aria-current]="todayValue === item.compareValue ? 'date' : null" |
| 66 | + (click)="_cellClicked(item, $event)"> |
| 67 | + <div class="mat-calendar-body-cell-content mat-focus-indicator" |
| 68 | + [class.mat-calendar-body-selected]="_isSelected(item.compareValue)" |
| 69 | + [class.mat-calendar-body-comparison-identical]="_isComparisonIdentical(item.compareValue)" |
| 70 | + [class.mat-calendar-body-today]="todayValue === item.compareValue"> |
| 71 | + {{item.displayValue}} |
| 72 | + </div> |
| 73 | + <div class="mat-calendar-body-cell-preview" aria-hidden="true"></div> |
| 74 | + </button> |
64 | 75 | </td>
|
65 | 76 | </tr>
|
0 commit comments