@angular/cdk 18.0.3 → 18.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/fesm2022/cdk.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Version } from '@angular/core';
2
2
 
3
3
  /** Current version of the Angular Component Development Kit. */
4
- const VERSION = new Version('18.0.3');
4
+ const VERSION = new Version('18.0.5');
5
5
 
6
6
  export { VERSION };
7
7
  //# sourceMappingURL=cdk.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"cdk.mjs","sources":["../../../../../../src/cdk/version.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Version} from '@angular/core';\n\n/** Current version of the Angular Component Development Kit. */\nexport const VERSION = new Version('18.0.3');\n"],"names":[],"mappings":";;AAUA;MACa,OAAO,GAAG,IAAI,OAAO,CAAC,mBAAmB;;;;"}
1
+ {"version":3,"file":"cdk.mjs","sources":["../../../../../../src/cdk/version.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Version} from '@angular/core';\n\n/** Current version of the Angular Component Development Kit. */\nexport const VERSION = new Version('18.0.5');\n"],"names":[],"mappings":";;AAUA;MACa,OAAO,GAAG,IAAI,OAAO,CAAC,mBAAmB;;;;"}
@@ -568,8 +568,8 @@ class OverlayOutsideClickDispatcher extends BaseOverlayDispatcher {
568
568
  // If it's a click inside the overlay, just break - we should do nothing
569
569
  // If it's an outside click (both origin and target of the click) dispatch the mouse event,
570
570
  // and proceed with the next overlay
571
- if (overlayRef.overlayElement.contains(target) ||
572
- overlayRef.overlayElement.contains(origin)) {
571
+ if (containsPierceShadowDom(overlayRef.overlayElement, target) ||
572
+ containsPierceShadowDom(overlayRef.overlayElement, origin)) {
573
573
  break;
574
574
  }
575
575
  const outsidePointerEvents = overlayRef._outsidePointerEvents;
@@ -644,6 +644,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImpor
644
644
  }] }, { type: i1$1.Platform }, { type: i0.NgZone, decorators: [{
645
645
  type: Optional
646
646
  }] }] });
647
+ /** Version of `Element.contains` that transcends shadow DOM boundaries. */
648
+ function containsPierceShadowDom(parent, child) {
649
+ const supportsShadowRoot = typeof ShadowRoot !== 'undefined' && ShadowRoot;
650
+ let current = child;
651
+ while (current) {
652
+ if (current === parent) {
653
+ return true;
654
+ }
655
+ current =
656
+ supportsShadowRoot && current instanceof ShadowRoot ? current.host : current.parentNode;
657
+ }
658
+ return false;
659
+ }
647
660
 
648
661
  /** Container inside which all overlays will render. */
649
662
  class OverlayContainer {