@angular/cdk 17.0.3 → 17.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/LICENSE +1 -1
- package/dialog/index.d.ts +1 -0
- package/drag-drop/index.d.ts +5 -5
- package/esm2022/a11y/aria-describer/aria-reference.mjs +8 -5
- package/esm2022/a11y/focus-trap/focus-trap.mjs +16 -11
- package/esm2022/collections/selection-model.mjs +5 -4
- package/esm2022/dialog/dialog-container.mjs +14 -9
- package/esm2022/drag-drop/directives/drag.mjs +1 -1
- package/esm2022/drag-drop/dom/dom-rect.mjs +64 -0
- package/esm2022/drag-drop/dom/parent-position-tracker.mjs +3 -3
- package/esm2022/drag-drop/drag-ref.mjs +13 -13
- package/esm2022/drag-drop/drop-list-ref.mjs +34 -20
- package/esm2022/drag-drop/sorting/single-axis-sort-strategy.mjs +5 -5
- package/esm2022/overlay/overlay-directives.mjs +9 -3
- package/esm2022/overlay/position/flexible-connected-position-strategy.mjs +5 -5
- package/esm2022/overlay/position/scroll-clip.mjs +1 -1
- package/esm2022/scrolling/viewport-ruler.mjs +2 -2
- package/esm2022/scrolling/virtual-scrollable.mjs +1 -1
- package/esm2022/version.mjs +1 -1
- package/fesm2022/a11y.mjs +21 -13
- package/fesm2022/a11y.mjs.map +1 -1
- package/fesm2022/cdk.mjs +1 -1
- package/fesm2022/cdk.mjs.map +1 -1
- package/fesm2022/collections.mjs +4 -3
- package/fesm2022/collections.mjs.map +1 -1
- package/fesm2022/dialog.mjs +13 -8
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/drag-drop.mjs +71 -57
- package/fesm2022/drag-drop.mjs.map +1 -1
- package/fesm2022/overlay.mjs +12 -6
- package/fesm2022/overlay.mjs.map +1 -1
- package/fesm2022/scrolling.mjs +1 -1
- package/fesm2022/scrolling.mjs.map +1 -1
- package/overlay/index.d.ts +1 -1
- package/package.json +1 -1
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +3 -3
- package/scrolling/index.d.ts +2 -2
- package/esm2022/drag-drop/dom/client-rect.mjs +0 -64
package/fesm2022/overlay.mjs
CHANGED
|
@@ -4,7 +4,7 @@ export { CdkScrollable, ScrollDispatcher, ViewportRuler } from '@angular/cdk/scr
|
|
|
4
4
|
import * as i6 from '@angular/common';
|
|
5
5
|
import { DOCUMENT } from '@angular/common';
|
|
6
6
|
import * as i0 from '@angular/core';
|
|
7
|
-
import { Injectable, Inject, Optional, ElementRef, ApplicationRef, ANIMATION_MODULE_TYPE, InjectionToken, Directive, EventEmitter, booleanAttribute, Input, Output, NgModule } from '@angular/core';
|
|
7
|
+
import { Injectable, Inject, Optional, ElementRef, ApplicationRef, ANIMATION_MODULE_TYPE, InjectionToken, inject, Directive, EventEmitter, booleanAttribute, Input, Output, NgModule } from '@angular/core';
|
|
8
8
|
import { coerceCssPixelValue, coerceArray } from '@angular/cdk/coercion';
|
|
9
9
|
import * as i1$1 from '@angular/cdk/platform';
|
|
10
10
|
import { supportsScrollBehavior, _getEventTarget, _isTestEnvironment } from '@angular/cdk/platform';
|
|
@@ -1706,7 +1706,7 @@ class FlexibleConnectedPositionStrategy {
|
|
|
1706
1706
|
else if (position.overlayY === 'bottom') {
|
|
1707
1707
|
// Overlay is opening "upward" and thus is bound by the top viewport edge. We need to add
|
|
1708
1708
|
// the viewport margin back in, because the viewport rect is narrowed down to remove the
|
|
1709
|
-
// margin, whereas the `origin` position is calculated based on its `
|
|
1709
|
+
// margin, whereas the `origin` position is calculated based on its `DOMRect`.
|
|
1710
1710
|
bottom = viewport.height - origin.y + this._viewportMargin * 2;
|
|
1711
1711
|
height = viewport.height - bottom + this._viewportMargin;
|
|
1712
1712
|
}
|
|
@@ -2032,7 +2032,7 @@ class FlexibleConnectedPositionStrategy {
|
|
|
2032
2032
|
this._appliedPanelClasses = [];
|
|
2033
2033
|
}
|
|
2034
2034
|
}
|
|
2035
|
-
/** Returns the
|
|
2035
|
+
/** Returns the DOMRect of the current origin. */
|
|
2036
2036
|
_getOriginRect() {
|
|
2037
2037
|
const origin = this._origin;
|
|
2038
2038
|
if (origin instanceof ElementRef) {
|
|
@@ -2076,9 +2076,9 @@ function getPixelValue(input) {
|
|
|
2076
2076
|
return input || null;
|
|
2077
2077
|
}
|
|
2078
2078
|
/**
|
|
2079
|
-
* Gets a version of an element's bounding `
|
|
2079
|
+
* Gets a version of an element's bounding `DOMRect` where all the values are rounded down to
|
|
2080
2080
|
* the nearest pixel. This allows us to account for the cases where there may be sub-pixel
|
|
2081
|
-
* deviations in the `
|
|
2081
|
+
* deviations in the `DOMRect` returned by the browser (e.g. when zoomed in with a percentage
|
|
2082
2082
|
* size, see #21350).
|
|
2083
2083
|
*/
|
|
2084
2084
|
function getRoundedBoundingClientRect(clientRect) {
|
|
@@ -2494,7 +2494,13 @@ const defaultPositionList = [
|
|
|
2494
2494
|
},
|
|
2495
2495
|
];
|
|
2496
2496
|
/** Injection token that determines the scroll handling while the connected overlay is open. */
|
|
2497
|
-
const CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY = new InjectionToken('cdk-connected-overlay-scroll-strategy'
|
|
2497
|
+
const CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY = new InjectionToken('cdk-connected-overlay-scroll-strategy', {
|
|
2498
|
+
providedIn: 'root',
|
|
2499
|
+
factory: () => {
|
|
2500
|
+
const overlay = inject(Overlay);
|
|
2501
|
+
return () => overlay.scrollStrategies.reposition();
|
|
2502
|
+
},
|
|
2503
|
+
});
|
|
2498
2504
|
/**
|
|
2499
2505
|
* Directive applied to an element to make it usable as an origin for an Overlay using a
|
|
2500
2506
|
* ConnectedPositionStrategy.
|