@@ -53,7 +53,6 @@ import {TemplatePortal} from '@angular/cdk/portal';
5353import { _getEventTarget } from '@angular/cdk/platform' ;
5454import { ENTER , ESCAPE , hasModifierKey , TAB } from '@angular/cdk/keycodes' ;
5555import { _IdGenerator , ActiveDescendantKeyManager } from '@angular/cdk/a11y' ;
56- import type { MatTimepickerInput } from './timepicker-input' ;
5756import {
5857 generateOptions ,
5958 MAT_TIMEPICKER_CONFIG ,
@@ -81,6 +80,33 @@ export const MAT_TIMEPICKER_SCROLL_STRATEGY = new InjectionToken<() => ScrollStr
8180 } ,
8281) ;
8382
83+ /** Represents an input that is connected to a `mat-timepicker`. */
84+ export interface MatTimepickerConnectedInput < D > {
85+ /** Current value of the input. */
86+ value : Signal < D | null > ;
87+
88+ /** Minimum allowed time. */
89+ min : Signal < D | null > ;
90+
91+ /** Maximum allowed time. */
92+ max : Signal < D | null > ;
93+
94+ /** Whether the input is disabled. */
95+ disabled : Signal < boolean > ;
96+
97+ /** Focuses the input. */
98+ focus ( ) : void ;
99+
100+ /** Gets the element to which to connect the timepicker overlay. */
101+ getOverlayOrigin ( ) : ElementRef < HTMLElement > ;
102+
103+ /** Gets the ID of the input's label. */
104+ getLabelId ( ) : string | null ;
105+
106+ /** Callback invoked when the timepicker assigns a value. */
107+ timepickerValueAssigned ( value : D | null ) : void ;
108+ }
109+
84110/**
85111 * Renders out a listbox that can be used to select a time of day.
86112 * Intended to be used together with `MatTimepickerInput`.
@@ -113,7 +139,7 @@ export class MatTimepicker<D> implements OnDestroy, MatOptionParentComponent {
113139 private _isOpen = signal ( false ) ;
114140 private _activeDescendant = signal < string | null > ( null ) ;
115141
116- private _input = signal < MatTimepickerInput < D > | null > ( null ) ;
142+ private _input = signal < MatTimepickerConnectedInput < D > | null > ( null ) ;
117143 private _overlayRef : OverlayRef | null = null ;
118144 private _portal : TemplatePortal < unknown > | null = null ;
119145 private _optionsCacheKey : string | null = null ;
@@ -269,7 +295,7 @@ export class MatTimepicker<D> implements OnDestroy, MatOptionParentComponent {
269295 }
270296
271297 /** Registers an input with the timepicker. */
272- registerInput ( input : MatTimepickerInput < D > ) : void {
298+ registerInput ( input : MatTimepickerConnectedInput < D > ) : void {
273299 const currentInput = this . _input ( ) ;
274300
275301 if ( currentInput && input !== currentInput && ( typeof ngDevMode === 'undefined' || ngDevMode ) ) {
@@ -297,7 +323,7 @@ export class MatTimepicker<D> implements OnDestroy, MatOptionParentComponent {
297323 }
298324 } ) ;
299325 // Notify the input first so it can sync up the form control before emitting to `selected`.
300- this . _input ( ) ?. _timepickerValueAssigned ( option . value ) ;
326+ this . _input ( ) ?. timepickerValueAssigned ( option . value ) ;
301327 this . selected . emit ( { value : option . value , source : this } ) ;
302328 this . _input ( ) ?. focus ( ) ;
303329 }
@@ -307,7 +333,7 @@ export class MatTimepicker<D> implements OnDestroy, MatOptionParentComponent {
307333 if ( this . ariaLabel ( ) ) {
308334 return null ;
309335 }
310- return this . ariaLabelledby ( ) || this . _input ( ) ?. _getLabelId ( ) || null ;
336+ return this . ariaLabelledby ( ) || this . _input ( ) ?. getLabelId ( ) || null ;
311337 }
312338
313339 /** Handles animation events coming from the panel. */
0 commit comments