Skip to content

Commit f8dc177

Browse files
authored
refactor(material/datepicker): remove deprecated APIs for v13 (#23574)
Removes the APIs that were marked for removal in v13. BREAKING CHANGE: * The `_document` and `_dialog` parameters have been removed from the `MatDatepicker` and `MatDateRangePicker` constructors.
1 parent 7c33276 commit f8dc177

File tree

3 files changed

+6
-15
lines changed

3 files changed

+6
-15
lines changed

src/material/datepicker/datepicker-base.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {
1717
FlexibleConnectedPositionStrategy,
1818
} from '@angular/cdk/overlay';
1919
import {ComponentPortal, ComponentType, TemplatePortal} from '@angular/cdk/portal';
20-
import {DOCUMENT} from '@angular/common';
2120
import {
2221
AfterViewInit,
2322
ChangeDetectionStrategy,
@@ -439,22 +438,12 @@ export abstract class MatDatepickerBase<C extends MatDatepickerControl<D>, S,
439438
readonly stateChanges = new Subject<void>();
440439

441440
constructor(
442-
/**
443-
* @deprecated `_dialog` parameter is no longer being used and it will be removed.
444-
* @breaking-change 13.0.0
445-
*/
446-
@Inject(ElementRef) _dialog: any,
447441
private _overlay: Overlay,
448442
private _ngZone: NgZone,
449443
private _viewContainerRef: ViewContainerRef,
450444
@Inject(MAT_DATEPICKER_SCROLL_STRATEGY) scrollStrategy: any,
451445
@Optional() private _dateAdapter: DateAdapter<D>,
452446
@Optional() private _dir: Directionality,
453-
/**
454-
* @deprecated No longer being used. To be removed.
455-
* @breaking-change 13.0.0
456-
*/
457-
@Optional() @Inject(DOCUMENT) _document: any,
458447
private _model: MatDateSelectionModel<S, D>) {
459448
if (!this._dateAdapter && (typeof ngDevMode === 'undefined' || ngDevMode)) {
460449
throw createMissingDateImplError('DateAdapter');

src/material/schematics/ng-update/data/constructor-checks.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ export const constructorChecks: VersionChanges<ConstructorChecksUpgradeData> = {
1818
{
1919
pr: 'https://github.com/angular/components/pull/23389',
2020
changes: ['MatFormField']
21+
},
22+
{
23+
pr: 'https://github.com/angular/components/pull/23573',
24+
changes: ['MatDatepicker', 'MatDateRangePicker']
2125
}
2226
],
2327
[TargetVersion.V12]: [

tools/public_api_guard/material/datepicker.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,9 +347,7 @@ export class MatDatepickerApply {
347347

348348
// @public
349349
abstract class MatDatepickerBase<C extends MatDatepickerControl<D>, S, D = ExtractDateTypeFromSelection<S>> implements MatDatepickerPanel<C, S, D>, OnDestroy, OnChanges {
350-
constructor(
351-
_dialog: any, _overlay: Overlay, _ngZone: NgZone, _viewContainerRef: ViewContainerRef, scrollStrategy: any, _dateAdapter: DateAdapter<D>, _dir: Directionality,
352-
_document: any, _model: MatDateSelectionModel<S, D>);
350+
constructor(_overlay: Overlay, _ngZone: NgZone, _viewContainerRef: ViewContainerRef, scrollStrategy: any, _dateAdapter: DateAdapter<D>, _dir: Directionality, _model: MatDateSelectionModel<S, D>);
353351
_applyPendingSelection(): void;
354352
calendarHeaderComponent: ComponentType<any>;
355353
close(): void;
@@ -409,7 +407,7 @@ abstract class MatDatepickerBase<C extends MatDatepickerControl<D>, S, D = Extra
409407
// (undocumented)
410408
static ɵdir: i0.ɵɵDirectiveDeclaration<MatDatepickerBase<any, any, any>, never, never, { "calendarHeaderComponent": "calendarHeaderComponent"; "startAt": "startAt"; "startView": "startView"; "color": "color"; "touchUi": "touchUi"; "disabled": "disabled"; "xPosition": "xPosition"; "yPosition": "yPosition"; "restoreFocus": "restoreFocus"; "dateClass": "dateClass"; "panelClass": "panelClass"; "opened": "opened"; }, { "yearSelected": "yearSelected"; "monthSelected": "monthSelected"; "viewChanged": "viewChanged"; "openedStream": "opened"; "closedStream": "closed"; }, never>;
411409
// (undocumented)
412-
static ɵfac: i0.ɵɵFactoryDeclaration<MatDatepickerBase<any, any, any>, [null, null, null, null, null, { optional: true; }, { optional: true; }, { optional: true; }, null]>;
410+
static ɵfac: i0.ɵɵFactoryDeclaration<MatDatepickerBase<any, any, any>, [null, null, null, null, { optional: true; }, { optional: true; }, null]>;
413411
}
414412

415413
// @public

0 commit comments

Comments
 (0)