Skip to content

Commit

Permalink
refactor(material/datepicker): remove deprecated APIs for v13 (#23574)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
crisbeto committed Sep 16, 2021
1 parent 7c33276 commit f8dc177
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
11 changes: 0 additions & 11 deletions src/material/datepicker/datepicker-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
FlexibleConnectedPositionStrategy,
} from '@angular/cdk/overlay';
import {ComponentPortal, ComponentType, TemplatePortal} from '@angular/cdk/portal';
import {DOCUMENT} from '@angular/common';
import {
AfterViewInit,
ChangeDetectionStrategy,
Expand Down Expand Up @@ -439,22 +438,12 @@ export abstract class MatDatepickerBase<C extends MatDatepickerControl<D>, S,
readonly stateChanges = new Subject<void>();

constructor(
/**
* @deprecated `_dialog` parameter is no longer being used and it will be removed.
* @breaking-change 13.0.0
*/
@Inject(ElementRef) _dialog: any,
private _overlay: Overlay,
private _ngZone: NgZone,
private _viewContainerRef: ViewContainerRef,
@Inject(MAT_DATEPICKER_SCROLL_STRATEGY) scrollStrategy: any,
@Optional() private _dateAdapter: DateAdapter<D>,
@Optional() private _dir: Directionality,
/**
* @deprecated No longer being used. To be removed.
* @breaking-change 13.0.0
*/
@Optional() @Inject(DOCUMENT) _document: any,
private _model: MatDateSelectionModel<S, D>) {
if (!this._dateAdapter && (typeof ngDevMode === 'undefined' || ngDevMode)) {
throw createMissingDateImplError('DateAdapter');
Expand Down
4 changes: 4 additions & 0 deletions src/material/schematics/ng-update/data/constructor-checks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ export const constructorChecks: VersionChanges<ConstructorChecksUpgradeData> = {
{
pr: 'https://github.com/angular/components/pull/23389',
changes: ['MatFormField']
},
{
pr: 'https://github.com/angular/components/pull/23573',
changes: ['MatDatepicker', 'MatDateRangePicker']
}
],
[TargetVersion.V12]: [
Expand Down
6 changes: 2 additions & 4 deletions tools/public_api_guard/material/datepicker.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,7 @@ export class MatDatepickerApply {

// @public
abstract class MatDatepickerBase<C extends MatDatepickerControl<D>, S, D = ExtractDateTypeFromSelection<S>> implements MatDatepickerPanel<C, S, D>, OnDestroy, OnChanges {
constructor(
_dialog: any, _overlay: Overlay, _ngZone: NgZone, _viewContainerRef: ViewContainerRef, scrollStrategy: any, _dateAdapter: DateAdapter<D>, _dir: Directionality,
_document: any, _model: MatDateSelectionModel<S, D>);
constructor(_overlay: Overlay, _ngZone: NgZone, _viewContainerRef: ViewContainerRef, scrollStrategy: any, _dateAdapter: DateAdapter<D>, _dir: Directionality, _model: MatDateSelectionModel<S, D>);
_applyPendingSelection(): void;
calendarHeaderComponent: ComponentType<any>;
close(): void;
Expand Down Expand Up @@ -409,7 +407,7 @@ abstract class MatDatepickerBase<C extends MatDatepickerControl<D>, S, D = Extra
// (undocumented)
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>;
// (undocumented)
static ɵfac: i0.ɵɵFactoryDeclaration<MatDatepickerBase<any, any, any>, [null, null, null, null, null, { optional: true; }, { optional: true; }, { optional: true; }, null]>;
static ɵfac: i0.ɵɵFactoryDeclaration<MatDatepickerBase<any, any, any>, [null, null, null, null, { optional: true; }, { optional: true; }, null]>;
}

// @public
Expand Down

0 comments on commit f8dc177

Please sign in to comment.