@angular/cdk 21.0.0-rc.2 → 21.0.0
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/_adev_assets/cdk_drag_drop.json +5 -0
- package/_adev_assets/cdk_testing.json +6 -0
- package/fesm2022/_overlay-module-chunk.mjs +35 -11
- package/fesm2022/_overlay-module-chunk.mjs.map +1 -1
- package/fesm2022/cdk.mjs +1 -1
- package/fesm2022/cdk.mjs.map +1 -1
- package/package.json +3 -3
- package/schematics/ng-add/index.js +1 -1
- package/types/_overlay-module-chunk.d.ts +14 -3
|
@@ -179,6 +179,7 @@
|
|
|
179
179
|
"rawComment": "/** Possible values that can be used to configure the drag start delay. */",
|
|
180
180
|
"description": "Possible values that can be used to configure the drag start delay.",
|
|
181
181
|
"jsdocTags": [],
|
|
182
|
+
"members": [],
|
|
182
183
|
"source": {
|
|
183
184
|
"filePath": "src/cdk/drag-drop/directives/config.ts",
|
|
184
185
|
"startLine": 13,
|
|
@@ -193,6 +194,7 @@
|
|
|
193
194
|
"rawComment": "/** Possible axis along which dragging can be locked. */",
|
|
194
195
|
"description": "Possible axis along which dragging can be locked.",
|
|
195
196
|
"jsdocTags": [],
|
|
197
|
+
"members": [],
|
|
196
198
|
"source": {
|
|
197
199
|
"filePath": "src/cdk/drag-drop/directives/config.ts",
|
|
198
200
|
"startLine": 16,
|
|
@@ -225,6 +227,7 @@
|
|
|
225
227
|
"rawComment": "/** Possible orientations for a drop list. */",
|
|
226
228
|
"description": "Possible orientations for a drop list.",
|
|
227
229
|
"jsdocTags": [],
|
|
230
|
+
"members": [],
|
|
228
231
|
"source": {
|
|
229
232
|
"filePath": "src/cdk/drag-drop/directives/config.ts",
|
|
230
233
|
"startLine": 19,
|
|
@@ -4564,6 +4567,7 @@
|
|
|
4564
4567
|
"rawComment": "/** Function that can be used to constrain the position of a dragged element. */",
|
|
4565
4568
|
"description": "Function that can be used to constrain the position of a dragged element.",
|
|
4566
4569
|
"jsdocTags": [],
|
|
4570
|
+
"members": [],
|
|
4567
4571
|
"source": {
|
|
4568
4572
|
"filePath": "/src/cdk/drag-drop/drag-ref.ts",
|
|
4569
4573
|
"startLine": 61,
|
|
@@ -4774,6 +4778,7 @@
|
|
|
4774
4778
|
"rawComment": "/**\n * Possible places into which the preview of a drag item can be inserted.\n * - `global` - Preview will be inserted at the bottom of the `<body>`. The advantage is that\n * you don't have to worry about `overflow: hidden` or `z-index`, but the item won't retain\n * its inherited styles.\n * - `parent` - Preview will be inserted into the parent of the drag item. The advantage is that\n * inherited styles will be preserved, but it may be clipped by `overflow: hidden` or not be\n * visible due to `z-index`. Furthermore, the preview is going to have an effect over selectors\n * like `:nth-child` and some flexbox configurations.\n * - `ElementRef<HTMLElement> | HTMLElement` - Preview will be inserted into a specific element.\n * Same advantages and disadvantages as `parent`.\n */",
|
|
4775
4779
|
"description": "Possible places into which the preview of a drag item can be inserted.\n- `global` - Preview will be inserted at the bottom of the `<body>`. The advantage is that\nyou don't have to worry about `overflow: hidden` or `z-index`, but the item won't retain\nits inherited styles.\n- `parent` - Preview will be inserted into the parent of the drag item. The advantage is that\ninherited styles will be preserved, but it may be clipped by `overflow: hidden` or not be\nvisible due to `z-index`. Furthermore, the preview is going to have an effect over selectors\nlike `:nth-child` and some flexbox configurations.\n- `ElementRef<HTMLElement> | HTMLElement` - Preview will be inserted into a specific element.\nSame advantages and disadvantages as `parent`.",
|
|
4776
4780
|
"jsdocTags": [],
|
|
4781
|
+
"members": [],
|
|
4777
4782
|
"source": {
|
|
4778
4783
|
"filePath": "/src/cdk/drag-drop/drag-ref.ts",
|
|
4779
4784
|
"startLine": 125,
|
|
@@ -221,6 +221,7 @@
|
|
|
221
221
|
"comment": ""
|
|
222
222
|
}
|
|
223
223
|
],
|
|
224
|
+
"members": [],
|
|
224
225
|
"source": {
|
|
225
226
|
"filePath": "src/cdk/testing/component-harness.ts",
|
|
226
227
|
"startLine": 18,
|
|
@@ -235,6 +236,7 @@
|
|
|
235
236
|
"rawComment": "/** Data that can be attached to a custom event dispatched from a `TestElement`. */",
|
|
236
237
|
"description": "Data that can be attached to a custom event dispatched from a `TestElement`.",
|
|
237
238
|
"jsdocTags": [],
|
|
239
|
+
"members": [],
|
|
238
240
|
"source": {
|
|
239
241
|
"filePath": "/src/cdk/testing/test-element.ts",
|
|
240
242
|
"startLine": 20,
|
|
@@ -253,6 +255,7 @@
|
|
|
253
255
|
"rawComment": "/** An async function that takes an item and returns a boolean promise */",
|
|
254
256
|
"description": "An async function that takes an item and returns a boolean promise",
|
|
255
257
|
"jsdocTags": [],
|
|
258
|
+
"members": [],
|
|
256
259
|
"source": {
|
|
257
260
|
"filePath": "src/cdk/testing/component-harness.ts",
|
|
258
261
|
"startLine": 21,
|
|
@@ -567,6 +570,7 @@
|
|
|
567
570
|
"rawComment": "/** An async function that takes an item and an option value and returns a boolean promise. */",
|
|
568
571
|
"description": "An async function that takes an item and an option value and returns a boolean promise.",
|
|
569
572
|
"jsdocTags": [],
|
|
573
|
+
"members": [],
|
|
570
574
|
"source": {
|
|
571
575
|
"filePath": "src/cdk/testing/component-harness.ts",
|
|
572
576
|
"startLine": 24,
|
|
@@ -586,6 +590,7 @@
|
|
|
586
590
|
"rawComment": "/**\n * A query for a `ComponentHarness`, which is expressed as either a `ComponentHarnessConstructor` or\n * a `HarnessPredicate`.\n */",
|
|
587
591
|
"description": "A query for a `ComponentHarness`, which is expressed as either a `ComponentHarnessConstructor` or\na `HarnessPredicate`.",
|
|
588
592
|
"jsdocTags": [],
|
|
593
|
+
"members": [],
|
|
589
594
|
"source": {
|
|
590
595
|
"filePath": "src/cdk/testing/component-harness.ts",
|
|
591
596
|
"startLine": 30,
|
|
@@ -610,6 +615,7 @@
|
|
|
610
615
|
"comment": "### Example\n\nThe type:\n```ts\nLocatorFnResult<[\n ComponentHarnessConstructor<MyHarness>,\n HarnessPredicate<MyOtherHarness>,\n string\n]>\n```\n\nis equivalent to:\n\n```ts\nMyHarness | MyOtherHarness | TestElement\n```"
|
|
611
616
|
}
|
|
612
617
|
],
|
|
618
|
+
"members": [],
|
|
613
619
|
"source": {
|
|
614
620
|
"filePath": "src/cdk/testing/component-harness.ts",
|
|
615
621
|
"startLine": 64,
|
|
@@ -942,7 +942,13 @@ class OverlayRef {
|
|
|
942
942
|
if (!this._host.parentElement) {
|
|
943
943
|
const customInsertionPoint = this._config.usePopover ? this._positionStrategy?.getPopoverInsertionPoint?.() : null;
|
|
944
944
|
if (customInsertionPoint) {
|
|
945
|
-
customInsertionPoint
|
|
945
|
+
if (customInsertionPoint instanceof Element) {
|
|
946
|
+
customInsertionPoint.after(this._host);
|
|
947
|
+
} else {
|
|
948
|
+
if (customInsertionPoint.type === 'parent') {
|
|
949
|
+
customInsertionPoint.element?.appendChild(this._host);
|
|
950
|
+
}
|
|
951
|
+
}
|
|
946
952
|
} else {
|
|
947
953
|
this._previousHostParent?.appendChild(this._host);
|
|
948
954
|
}
|
|
@@ -1291,13 +1297,26 @@ class FlexibleConnectedPositionStrategy {
|
|
|
1291
1297
|
if (this._popoverLocation === 'global') {
|
|
1292
1298
|
return null;
|
|
1293
1299
|
}
|
|
1294
|
-
|
|
1295
|
-
if (
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1300
|
+
let hostElement = null;
|
|
1301
|
+
if (this._popoverLocation === 'inline') {
|
|
1302
|
+
if (this._origin instanceof ElementRef) {
|
|
1303
|
+
hostElement = this._origin.nativeElement;
|
|
1304
|
+
} else if (this._origin instanceof Element) {
|
|
1305
|
+
hostElement = this._origin;
|
|
1306
|
+
}
|
|
1307
|
+
} else {
|
|
1308
|
+
hostElement = this._popoverLocation.element;
|
|
1309
|
+
}
|
|
1310
|
+
if (this._popoverLocation === 'inline') {
|
|
1311
|
+
return hostElement;
|
|
1299
1312
|
}
|
|
1300
|
-
|
|
1313
|
+
if (hostElement) {
|
|
1314
|
+
return {
|
|
1315
|
+
type: 'parent',
|
|
1316
|
+
element: hostElement
|
|
1317
|
+
};
|
|
1318
|
+
}
|
|
1319
|
+
return null;
|
|
1301
1320
|
}
|
|
1302
1321
|
_getOriginPoint(originRect, containerRect, pos) {
|
|
1303
1322
|
let x;
|
|
@@ -2056,10 +2075,15 @@ function createOverlayRef(injector, config) {
|
|
|
2056
2075
|
host.classList.add('cdk-overlay-popover');
|
|
2057
2076
|
}
|
|
2058
2077
|
const customInsertionPoint = overlayConfig.usePopover ? overlayConfig.positionStrategy?.getPopoverInsertionPoint?.() : null;
|
|
2078
|
+
overlayContainer.getContainerElement().appendChild(host);
|
|
2059
2079
|
if (customInsertionPoint) {
|
|
2060
|
-
customInsertionPoint
|
|
2061
|
-
|
|
2062
|
-
|
|
2080
|
+
if (customInsertionPoint instanceof Element) {
|
|
2081
|
+
customInsertionPoint.after(host);
|
|
2082
|
+
} else {
|
|
2083
|
+
if (customInsertionPoint.type === 'parent') {
|
|
2084
|
+
customInsertionPoint.element?.appendChild(host);
|
|
2085
|
+
}
|
|
2086
|
+
}
|
|
2063
2087
|
}
|
|
2064
2088
|
return new OverlayRef(new DomPortalOutlet(pane, appRef, injector), host, pane, overlayConfig, injector.get(NgZone), injector.get(OverlayKeyboardDispatcher), doc, injector.get(Location), injector.get(OverlayOutsideClickDispatcher), config?.disableAnimations ?? injector.get(ANIMATION_MODULE_TYPE, null, {
|
|
2065
2089
|
optional: true
|
|
@@ -2342,7 +2366,7 @@ class CdkConnectedOverlay {
|
|
|
2342
2366
|
offsetY: currentPosition.offsetY || this.offsetY,
|
|
2343
2367
|
panelClass: currentPosition.panelClass || undefined
|
|
2344
2368
|
}));
|
|
2345
|
-
return positionStrategy.setOrigin(this._getOrigin()).withPositions(positions).withFlexibleDimensions(this.flexibleDimensions).withPush(this.push).withGrowAfterOpen(this.growAfterOpen).withViewportMargin(this.viewportMargin).withLockedPosition(this.lockPosition).withTransformOriginOn(this.transformOriginSelector).withPopoverLocation(this.usePopover ===
|
|
2369
|
+
return positionStrategy.setOrigin(this._getOrigin()).withPositions(positions).withFlexibleDimensions(this.flexibleDimensions).withPush(this.push).withGrowAfterOpen(this.growAfterOpen).withViewportMargin(this.viewportMargin).withLockedPosition(this.lockPosition).withTransformOriginOn(this.transformOriginSelector).withPopoverLocation(this.usePopover === null ? 'global' : this.usePopover);
|
|
2346
2370
|
}
|
|
2347
2371
|
_createPositionStrategy() {
|
|
2348
2372
|
const strategy = createFlexibleConnectedPositionStrategy(this._injector, this._getOrigin());
|