Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(material/datepicker): remove dependency on NgClass #28865

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 3 additions & 6 deletions src/material/datepicker/datepicker-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ import {
MatDateRangeSelectionStrategy,
} from './date-range-selection-strategy';
import {MatDatepickerIntl} from './datepicker-intl';
import {DOCUMENT, NgClass} from '@angular/common';
import {DOCUMENT} from '@angular/common';
import {MatButton} from '@angular/material/button';
import {CdkTrapFocus} from '@angular/cdk/a11y';

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

/**
* Classes to be passed to the date picker panel.
* Supports string and string array values, similar to `ngClass`.
*/
/** Classes to be passed to the date picker panel. */
@Input()
get panelClass(): string | string[] {
return this._panelClass;
Expand Down
2 changes: 1 addition & 1 deletion src/material/datepicker/datepicker-content.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[class.mat-datepicker-content-container-with-actions]="_actionsPortal">
<mat-calendar
[id]="datepicker.id"
[ngClass]="datepicker.panelClass"
[class]="datepicker.panelClass"
[startAt]="datepicker.startAt"
[startView]="datepicker.startView"
[minDate]="datepicker._getMinDate()"
Expand Down