@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/a11y/index.d.ts +5 -1
- package/esm2022/a11y/key-manager/tree-key-manager-strategy.mjs +1 -1
- package/esm2022/a11y/key-manager/tree-key-manager.mjs +22 -12
- package/esm2022/drag-drop/drag-ref.mjs +3 -2
- package/esm2022/drag-drop/preview-ref.mjs +12 -4
- package/esm2022/tree/tree.mjs +23 -6
- package/esm2022/version.mjs +1 -1
- package/fesm2022/a11y.mjs +21 -11
- package/fesm2022/a11y.mjs.map +1 -1
- package/fesm2022/cdk.mjs +1 -1
- package/fesm2022/cdk.mjs.map +1 -1
- package/fesm2022/drag-drop.mjs +13 -4
- package/fesm2022/drag-drop.mjs.map +1 -1
- package/fesm2022/tree.mjs +26 -7
- package/fesm2022/tree.mjs.map +1 -1
- package/package.json +1 -1
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/tree/index.d.ts +4 -1
package/fesm2022/cdk.mjs
CHANGED
package/fesm2022/cdk.mjs.map
CHANGED
|
@@ -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.
|
|
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;;;;"}
|
package/fesm2022/drag-drop.mjs
CHANGED
|
@@ -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 (
|
|
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
|
-
//
|
|
404
|
-
|
|
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 ||
|
|
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
|