overlay.mjs 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. import { O as OverlayContainer } from './overlay-module-BUj0D19H.mjs';
  2. export { B as BlockScrollStrategy, b as CdkConnectedOverlay, C as CdkOverlayOrigin, l as CloseScrollStrategy, i as ConnectedOverlayPositionChange, g as ConnectionPositionPair, F as FlexibleConnectedPositionStrategy, G as GlobalPositionStrategy, N as NoopScrollStrategy, a as Overlay, f as OverlayConfig, o as OverlayKeyboardDispatcher, m as OverlayModule, n as OverlayOutsideClickDispatcher, d as OverlayPositionBuilder, c as OverlayRef, R as RepositionScrollStrategy, S as STANDARD_DROPDOWN_ADJACENT_POSITIONS, e as STANDARD_DROPDOWN_BELOW_POSITIONS, k as ScrollStrategyOptions, h as ScrollingVisibility, j as validateHorizontalPosition, v as validateVerticalPosition } from './overlay-module-BUj0D19H.mjs';
  3. import * as i0 from '@angular/core';
  4. import { inject, RendererFactory2, Injectable } from '@angular/core';
  5. export { CdkScrollable, ScrollDispatcher, ViewportRuler, CdkFixedSizeVirtualScroll as ɵɵCdkFixedSizeVirtualScroll, CdkScrollableModule as ɵɵCdkScrollableModule, CdkVirtualForOf as ɵɵCdkVirtualForOf, CdkVirtualScrollViewport as ɵɵCdkVirtualScrollViewport, CdkVirtualScrollableElement as ɵɵCdkVirtualScrollableElement, CdkVirtualScrollableWindow as ɵɵCdkVirtualScrollableWindow } from './scrolling.mjs';
  6. export { Dir as ɵɵDir } from './bidi.mjs';
  7. import '@angular/common';
  8. import './platform-DmdVEw_C.mjs';
  9. import './backwards-compatibility-DHR38MsD.mjs';
  10. import './shadow-dom-B0oHn41l.mjs';
  11. import './test-environment-CT0XxPyp.mjs';
  12. import './style-loader-Cu9AvjH9.mjs';
  13. import 'rxjs';
  14. import 'rxjs/operators';
  15. import './css-pixel-value-C_HEqLhI.mjs';
  16. import './array-I1yfCXUO.mjs';
  17. import './scrolling-BkvA05C8.mjs';
  18. import './portal-directives-Bw5woq8I.mjs';
  19. import './directionality-CBXD4hga.mjs';
  20. import './id-generator-Dw_9dSDu.mjs';
  21. import './keycodes-CpHkExLC.mjs';
  22. import './keycodes.mjs';
  23. import './element-x4z00URv.mjs';
  24. import './recycle-view-repeater-strategy-DoWdPqVw.mjs';
  25. import './data-source-D34wiQZj.mjs';
  26. /**
  27. * Alternative to OverlayContainer that supports correct displaying of overlay elements in
  28. * Fullscreen mode
  29. * https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullScreen
  30. *
  31. * Should be provided in the root component.
  32. */
  33. class FullscreenOverlayContainer extends OverlayContainer {
  34. _renderer = inject(RendererFactory2).createRenderer(null, null);
  35. _fullScreenEventName;
  36. _cleanupFullScreenListener;
  37. constructor() {
  38. super();
  39. }
  40. ngOnDestroy() {
  41. super.ngOnDestroy();
  42. this._cleanupFullScreenListener?.();
  43. }
  44. _createContainer() {
  45. const eventName = this._getEventName();
  46. super._createContainer();
  47. this._adjustParentForFullscreenChange();
  48. if (eventName) {
  49. this._cleanupFullScreenListener?.();
  50. this._cleanupFullScreenListener = this._renderer.listen('document', eventName, () => {
  51. this._adjustParentForFullscreenChange();
  52. });
  53. }
  54. }
  55. _adjustParentForFullscreenChange() {
  56. if (this._containerElement) {
  57. const fullscreenElement = this.getFullscreenElement();
  58. const parent = fullscreenElement || this._document.body;
  59. parent.appendChild(this._containerElement);
  60. }
  61. }
  62. _getEventName() {
  63. if (!this._fullScreenEventName) {
  64. const _document = this._document;
  65. if (_document.fullscreenEnabled) {
  66. this._fullScreenEventName = 'fullscreenchange';
  67. }
  68. else if (_document.webkitFullscreenEnabled) {
  69. this._fullScreenEventName = 'webkitfullscreenchange';
  70. }
  71. else if (_document.mozFullScreenEnabled) {
  72. this._fullScreenEventName = 'mozfullscreenchange';
  73. }
  74. else if (_document.msFullscreenEnabled) {
  75. this._fullScreenEventName = 'MSFullscreenChange';
  76. }
  77. }
  78. return this._fullScreenEventName;
  79. }
  80. /**
  81. * When the page is put into fullscreen mode, a specific element is specified.
  82. * Only that element and its children are visible when in fullscreen mode.
  83. */
  84. getFullscreenElement() {
  85. const _document = this._document;
  86. return (_document.fullscreenElement ||
  87. _document.webkitFullscreenElement ||
  88. _document.mozFullScreenElement ||
  89. _document.msFullscreenElement ||
  90. null);
  91. }
  92. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: FullscreenOverlayContainer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
  93. static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: FullscreenOverlayContainer, providedIn: 'root' });
  94. }
  95. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: FullscreenOverlayContainer, decorators: [{
  96. type: Injectable,
  97. args: [{ providedIn: 'root' }]
  98. }], ctorParameters: () => [] });
  99. export { FullscreenOverlayContainer, OverlayContainer };
  100. //# sourceMappingURL=overlay.mjs.map