Creates an overlay reference for the timepicker panel.
()
| 350 | |
| 351 | /** Creates an overlay reference for the timepicker panel. */ |
| 352 | private _getOverlayRef(): OverlayRef { |
| 353 | if (this._overlayRef) { |
| 354 | return this._overlayRef; |
| 355 | } |
| 356 | |
| 357 | const positionStrategy = createFlexibleConnectedPositionStrategy( |
| 358 | this._injector, |
| 359 | this._input()!.getOverlayOrigin(), |
| 360 | ) |
| 361 | .withFlexibleDimensions(false) |
| 362 | .withPush(false) |
| 363 | .withTransformOriginOn('.mat-timepicker-panel') |
| 364 | .withPopoverLocation('inline') |
| 365 | .withPositions([ |
| 366 | { |
| 367 | originX: 'start', |
| 368 | originY: 'bottom', |
| 369 | overlayX: 'start', |
| 370 | overlayY: 'top', |
| 371 | }, |
| 372 | { |
| 373 | originX: 'start', |
| 374 | originY: 'top', |
| 375 | overlayX: 'start', |
| 376 | overlayY: 'bottom', |
| 377 | panelClass: 'mat-timepicker-above', |
| 378 | }, |
| 379 | ]); |
| 380 | |
| 381 | this._overlayRef = createOverlayRef(this._injector, { |
| 382 | positionStrategy, |
| 383 | scrollStrategy: this._scrollStrategyFactory(), |
| 384 | direction: this._dir || 'ltr', |
| 385 | hasBackdrop: false, |
| 386 | disableAnimations: this._animationsDisabled, |
| 387 | panelClass: this.panelClass(), |
| 388 | }); |
| 389 | |
| 390 | this._overlayRef.detachments().subscribe(() => this.close()); |
| 391 | this._overlayRef.keydownEvents().subscribe(event => this._handleKeydown(event)); |
| 392 | this._overlayRef.outsidePointerEvents().subscribe(event => { |
| 393 | const target = _getEventTarget(event) as HTMLElement; |
| 394 | const origin = this._input()?.getOverlayOrigin().nativeElement; |
| 395 | |
| 396 | if (target && origin && target !== origin && !origin.contains(target)) { |
| 397 | this.close(); |
| 398 | } |
| 399 | }); |
| 400 | |
| 401 | return this._overlayRef; |
| 402 | } |
| 403 | |
| 404 | /** Generates the list of options from which the user can select.. */ |
| 405 | private _generateOptions(): void { |
no test coverage detected