Skip to content

Commit 524fe62

Browse files
authored
fix(material/datepicker): remove dependency on NgClass (#28865)
We can set classes directly through `[class]` instead of having to import `NgClass`.
1 parent b3298f1 commit 524fe62

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

src/material/datepicker/datepicker-base.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ import {
7474
MatDateRangeSelectionStrategy,
7575
} from './date-range-selection-strategy';
7676
import {MatDatepickerIntl} from './datepicker-intl';
77-
import {DOCUMENT, NgClass} from '@angular/common';
77+
import {DOCUMENT} from '@angular/common';
7878
import {MatButton} from '@angular/material/button';
7979
import {CdkTrapFocus} from '@angular/cdk/a11y';
8080

@@ -135,7 +135,7 @@ export const MAT_DATEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER = {
135135
encapsulation: ViewEncapsulation.None,
136136
changeDetection: ChangeDetectionStrategy.OnPush,
137137
standalone: true,
138-
imports: [CdkTrapFocus, MatCalendar, NgClass, CdkPortalOutlet, MatButton],
138+
imports: [CdkTrapFocus, MatCalendar, CdkPortalOutlet, MatButton],
139139
})
140140
export class MatDatepickerContent<S, D = ExtractDateTypeFromSelection<S>>
141141
implements OnInit, AfterViewInit, OnDestroy
@@ -446,10 +446,7 @@ export abstract class MatDatepickerBase<
446446
/** Emits when the datepicker has been closed. */
447447
@Output('closed') readonly closedStream = new EventEmitter<void>();
448448

449-
/**
450-
* Classes to be passed to the date picker panel.
451-
* Supports string and string array values, similar to `ngClass`.
452-
*/
449+
/** Classes to be passed to the date picker panel. */
453450
@Input()
454451
get panelClass(): string | string[] {
455452
return this._panelClass;

src/material/datepicker/datepicker-content.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
[class.mat-datepicker-content-container-with-actions]="_actionsPortal">
99
<mat-calendar
1010
[id]="datepicker.id"
11-
[ngClass]="datepicker.panelClass"
11+
[class]="datepicker.panelClass"
1212
[startAt]="datepicker.startAt"
1313
[startView]="datepicker.startView"
1414
[minDate]="datepicker._getMinDate()"

0 commit comments

Comments
 (0)