Skip to content

Commit 5da747a

Browse files
committed
fix(datepicker): compilation errors with ViewEngine
Fixes a few compilation errors that only happen when the date range picker is compiled with `ViewEngine`.
1 parent 8008218 commit 5da747a

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

src/material/datepicker/date-range-input-parts.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,15 @@ import {BooleanInput} from '@angular/cdk/coercion';
4141
import {BACKSPACE} from '@angular/cdk/keycodes';
4242
import {MatDatepickerInputBase, DateFilterFn} from './datepicker-input-base';
4343
import {DateRange, MatDateSelectionModel} from './date-selection-model';
44+
import {MatDateRangePicker} from './date-range-picker';
4445

4546
/** Parent component that should be wrapped around `MatStartDate` and `MatEndDate`. */
4647
export interface MatDateRangeInputParent<D> {
4748
id: string;
4849
min: D | null;
4950
max: D | null;
5051
dateFilter: DateFilterFn<D>;
52+
rangePicker: MatDateRangePicker<D>;
5153
_startInput: MatDateRangeInputPartBase<D>;
5254
_endInput: MatDateRangeInputPartBase<D>;
5355
_groupDisabled: boolean;
@@ -138,12 +140,12 @@ abstract class MatDateRangeInputPartBase<D>
138140
}
139141

140142
/** Gets the minimum date from the range input. */
141-
protected _getMinDate() {
143+
_getMinDate() {
142144
return this._rangeInput.min;
143145
}
144146

145147
/** Gets the maximum date from the range input. */
146-
protected _getMaxDate() {
148+
_getMaxDate() {
147149
return this._rangeInput.max;
148150
}
149151

src/material/datepicker/datepicker-input-base.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,10 @@ export abstract class MatDatepickerInputBase<S, D = ExtractDateTypeFromSelection
174174
}
175175

176176
/** Gets the minimum date for the input. Used for validation. */
177-
protected abstract _getMinDate(): D | null;
177+
abstract _getMinDate(): D | null;
178178

179179
/** Gets the maximum date for the input. Used for validation. */
180-
protected abstract _getMaxDate(): D | null;
180+
abstract _getMaxDate(): D | null;
181181

182182
/** Gets the date filter function. Used for validation. */
183183
protected abstract _getDateFilter(): DateFilterFn<D> | undefined;

src/material/datepicker/datepicker-input.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,12 @@ export class MatDatepickerInput<D> extends MatDatepickerInputBase<D | null, D>
162162
}
163163

164164
/** Gets the input's minimum date. */
165-
protected _getMinDate() {
165+
_getMinDate() {
166166
return this._min;
167167
}
168168

169169
/** Gets the input's maximum date. */
170-
protected _getMaxDate() {
170+
_getMaxDate() {
171171
return this._max;
172172
}
173173

tools/public_api_guard/material/datepicker.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ export declare class MatDatepickerInput<D> extends MatDatepickerInputBase<D | nu
217217
constructor(elementRef: ElementRef<HTMLInputElement>, dateAdapter: DateAdapter<D>, dateFormats: MatDateFormats, _formField: MatFormField);
218218
protected _assignValueToModel(value: D | null): void;
219219
protected _getDateFilter(): DateFilterFn<D | null>;
220-
protected _getMaxDate(): D | null;
221-
protected _getMinDate(): D | null;
220+
_getMaxDate(): D | null;
221+
_getMinDate(): D | null;
222222
protected _getValueFromModel(modelValue: D | null): D | null;
223223
protected _openPopup(): void;
224224
getConnectedOverlayOrigin(): ElementRef;

0 commit comments

Comments
 (0)