Skip to content

Commit cbe0a78

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

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
@@ -72,7 +72,7 @@ import {
7272
MatDateRangeSelectionStrategy,
7373
} from './date-range-selection-strategy';
7474
import {MatDatepickerIntl} from './datepicker-intl';
75-
import {DOCUMENT, NgClass} from '@angular/common';
75+
import {DOCUMENT} from '@angular/common';
7676
import {MatButton} from '@angular/material/button';
7777
import {CdkTrapFocus} from '@angular/cdk/a11y';
7878

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

447-
/**
448-
* Classes to be passed to the date picker panel.
449-
* Supports string and string array values, similar to `ngClass`.
450-
*/
447+
/** Classes to be passed to the date picker panel. */
451448
@Input()
452449
get panelClass(): string | string[] {
453450
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)