@angular/cdk 18.2.0 → 18.2.2

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.2.0');
4
+ const VERSION = new Version('18.2.2');
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.2.0');\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.2.2');\n"],"names":[],"mappings":";;AAUA;MACa,OAAO,GAAG,IAAI,OAAO,CAAC,mBAAmB;;;;"}
@@ -342,7 +342,7 @@ class PreviewRef {
342
342
  parent.appendChild(this._preview);
343
343
  // The null check is necessary for browsers that don't support the popover API.
344
344
  // Note that we use a string access for compatibility with Closure.
345
- if ('showPopover' in this._preview) {
345
+ if (supportsPopover(this._preview)) {
346
346
  this._preview['showPopover']();
347
347
  }
348
348
  }
@@ -400,8 +400,12 @@ class PreviewRef {
400
400
  // It's important that we disable the pointer events on the preview, because
401
401
  // it can throw off the `document.elementFromPoint` calls in the `CdkDropList`.
402
402
  'pointer-events': 'none',
403
- // We have to reset the margin, because it can throw off positioning relative to the viewport.
404
- 'margin': '0',
403
+ // If the preview has a margin, it can throw off our positioning so we reset it. The reset
404
+ // value for `margin-right` needs to be `auto` when opened as a popover, because our
405
+ // positioning is always top/left based, but native popover seems to position itself
406
+ // to the top/right if `<html>` or `<body>` have `dir="rtl"` (see #29604). Setting it
407
+ // to `auto` pushed it to the top/left corner in RTL and is a noop in LTR.
408
+ 'margin': supportsPopover(preview) ? '0 auto 0 0' : '0',
405
409
  'position': 'fixed',
406
410
  'top': '0',
407
411
  'left': '0',
@@ -422,6 +426,10 @@ class PreviewRef {
422
426
  return preview;
423
427
  }
424
428
  }
429
+ /** Checks whether a specific element supports the popover API. */
430
+ function supportsPopover(element) {
431
+ return 'showPopover' in element;
432
+ }
425
433
 
426
434
  /** Options that can be used to bind a passive event listener. */
427
435
  const passiveEventListenerOptions = normalizePassiveListenerOptions({ passive: true });
@@ -930,7 +938,8 @@ class DragRef {
930
938
  const parent = element.parentNode;
931
939
  const placeholder = (this._placeholder = this._createPlaceholderElement());
932
940
  const anchor = (this._anchor =
933
- this._anchor || this._document.createComment(ngDevMode ? 'cdk-drag-anchor' : ''));
941
+ this._anchor ||
942
+ this._document.createComment(typeof ngDevMode === 'undefined' || ngDevMode ? 'cdk-drag-anchor' : ''));
934
943
  // Insert an anchor node so that we can restore the element's position in the DOM.
935
944
  parent.insertBefore(anchor, element);
936
945
  // There's no risk of transforms stacking when inside a drop container so