@angular/cdk 14.1.0-rc.0 → 14.1.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 +8 -8
- package/bidi/index.d.ts +1 -1
- package/clipboard/index.d.ts +2 -2
- package/drag-drop/index.d.ts +4 -4
- package/esm2020/a11y/live-announcer/live-announcer.mjs +1 -1
- package/esm2020/bidi/dir-document-token.mjs +2 -2
- package/esm2020/clipboard/pending-copy.mjs +3 -3
- package/esm2020/dialog/dialog.mjs +2 -2
- package/esm2020/drag-drop/directives/drag.mjs +1 -1
- package/esm2020/drag-drop/drag-drop-registry.mjs +2 -2
- package/esm2020/drag-drop/drag-ref.mjs +3 -3
- package/esm2020/drag-drop/sorting/single-axis-sort-strategy.mjs +2 -2
- package/esm2020/menu/menu-item-radio.mjs +2 -2
- package/esm2020/overlay/overlay-config.mjs +2 -2
- package/esm2020/overlay/overlay-ref.mjs +19 -1
- package/esm2020/overlay/position/flexible-connected-position-strategy.mjs +6 -6
- package/esm2020/scrolling/scroll-dispatcher.mjs +2 -2
- package/esm2020/stepper/stepper.mjs +3 -3
- package/esm2020/table/sticky-position-listener.mjs +1 -1
- package/esm2020/table/table-errors.mjs +2 -2
- package/esm2020/table/table.mjs +3 -3
- package/esm2020/version.mjs +1 -1
- package/fesm2015/a11y.mjs.map +1 -1
- package/fesm2015/bidi.mjs +1 -1
- package/fesm2015/bidi.mjs.map +1 -1
- package/fesm2015/cdk.mjs +1 -1
- package/fesm2015/cdk.mjs.map +1 -1
- package/fesm2015/clipboard.mjs +2 -2
- package/fesm2015/clipboard.mjs.map +1 -1
- package/fesm2015/dialog.mjs +1 -1
- package/fesm2015/dialog.mjs.map +1 -1
- package/fesm2015/drag-drop.mjs +4 -4
- package/fesm2015/drag-drop.mjs.map +1 -1
- package/fesm2015/menu.mjs +1 -1
- package/fesm2015/menu.mjs.map +1 -1
- package/fesm2015/overlay.mjs +24 -6
- package/fesm2015/overlay.mjs.map +1 -1
- package/fesm2015/scrolling.mjs +1 -1
- package/fesm2015/scrolling.mjs.map +1 -1
- package/fesm2015/stepper.mjs +2 -2
- package/fesm2015/stepper.mjs.map +1 -1
- package/fesm2015/table.mjs +3 -3
- package/fesm2015/table.mjs.map +1 -1
- package/fesm2020/a11y.mjs.map +1 -1
- package/fesm2020/bidi.mjs +1 -1
- package/fesm2020/bidi.mjs.map +1 -1
- package/fesm2020/cdk.mjs +1 -1
- package/fesm2020/cdk.mjs.map +1 -1
- package/fesm2020/clipboard.mjs +2 -2
- package/fesm2020/clipboard.mjs.map +1 -1
- package/fesm2020/dialog.mjs +1 -1
- package/fesm2020/dialog.mjs.map +1 -1
- package/fesm2020/drag-drop.mjs +4 -4
- package/fesm2020/drag-drop.mjs.map +1 -1
- package/fesm2020/menu.mjs +1 -1
- package/fesm2020/menu.mjs.map +1 -1
- package/fesm2020/overlay.mjs +24 -6
- package/fesm2020/overlay.mjs.map +1 -1
- package/fesm2020/scrolling.mjs +1 -1
- package/fesm2020/scrolling.mjs.map +1 -1
- package/fesm2020/stepper.mjs +2 -2
- package/fesm2020/stepper.mjs.map +1 -1
- package/fesm2020/table.mjs +3 -3
- package/fesm2020/table.mjs.map +1 -1
- package/menu/index.d.ts +1 -1
- package/overlay/index.d.ts +3 -3
- package/package.json +1 -1
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/schematics/update-tool/component-resource-collector.js +10 -3
- package/schematics/update-tool/component-resource-collector.mjs +10 -3
- package/scrolling/index.d.ts +1 -1
- package/table/index.d.ts +4 -4
package/fesm2015/overlay.mjs
CHANGED
|
@@ -365,7 +365,7 @@ class OverlayConfig {
|
|
|
365
365
|
if (config[key] !== undefined) {
|
|
366
366
|
// TypeScript, as of version 3.5, sees the left-hand-side of this expression
|
|
367
367
|
// as "I don't know *which* key this is, so the only valid value is the intersection
|
|
368
|
-
// of all the
|
|
368
|
+
// of all the possible values." In this case, that happens to be `undefined`. TypeScript
|
|
369
369
|
// is not smart enough to see that the right-hand-side is actually an access of the same
|
|
370
370
|
// exact type with the same exact key, meaning that the value type must be identical.
|
|
371
371
|
// So we use `any` to work around this.
|
|
@@ -570,6 +570,24 @@ class OverlayRef {
|
|
|
570
570
|
this._locationChanges = this._location.subscribe(() => this.dispose());
|
|
571
571
|
}
|
|
572
572
|
this._outsideClickDispatcher.add(this);
|
|
573
|
+
// TODO(crisbeto): the null check is here, because the portal outlet returns `any`.
|
|
574
|
+
// We should be guaranteed for the result to be `ComponentRef | EmbeddedViewRef`, but
|
|
575
|
+
// `instanceof EmbeddedViewRef` doesn't appear to work at the moment.
|
|
576
|
+
if (typeof (attachResult === null || attachResult === void 0 ? void 0 : attachResult.onDestroy) === 'function') {
|
|
577
|
+
// In most cases we control the portal and we know when it is being detached so that
|
|
578
|
+
// we can finish the disposal process. The exception is if the user passes in a custom
|
|
579
|
+
// `ViewContainerRef` that isn't destroyed through the overlay API. Note that we use
|
|
580
|
+
// `detach` here instead of `dispose`, because we don't know if the user intends to
|
|
581
|
+
// reattach the overlay at a later point. It also has the advantage of waiting for animations.
|
|
582
|
+
attachResult.onDestroy(() => {
|
|
583
|
+
if (this.hasAttached()) {
|
|
584
|
+
// We have to delay the `detach` call, because detaching immediately prevents
|
|
585
|
+
// other destroy hooks from running. This is likely a framework bug similar to
|
|
586
|
+
// https://github.com/angular/angular/issues/46119
|
|
587
|
+
this._ngZone.runOutsideAngular(() => Promise.resolve().then(() => this.detach()));
|
|
588
|
+
}
|
|
589
|
+
});
|
|
590
|
+
}
|
|
573
591
|
return attachResult;
|
|
574
592
|
}
|
|
575
593
|
/**
|
|
@@ -1043,7 +1061,7 @@ class FlexibleConnectedPositionStrategy {
|
|
|
1043
1061
|
* The selection of a position goes as follows:
|
|
1044
1062
|
* - If any positions fit completely within the viewport as-is,
|
|
1045
1063
|
* choose the first position that does so.
|
|
1046
|
-
* - If flexible dimensions are enabled and at least one
|
|
1064
|
+
* - If flexible dimensions are enabled and at least one satisfies the given minimum width/height,
|
|
1047
1065
|
* choose the position with the greatest available size modified by the positions' weight.
|
|
1048
1066
|
* - If pushing is enabled, take the position that went off-screen the least and push it
|
|
1049
1067
|
* on-screen.
|
|
@@ -1416,7 +1434,7 @@ class FlexibleConnectedPositionStrategy {
|
|
|
1416
1434
|
}
|
|
1417
1435
|
/**
|
|
1418
1436
|
* Gets the point at which the overlay can be "pushed" on-screen. If the overlay is larger than
|
|
1419
|
-
* the viewport, the top-left corner will be pushed on-screen (with overflow
|
|
1437
|
+
* the viewport, the top-left corner will be pushed on-screen (with overflow occurring on the
|
|
1420
1438
|
* right and bottom).
|
|
1421
1439
|
*
|
|
1422
1440
|
* @param start Starting point from which the overlay is pushed.
|
|
@@ -1485,7 +1503,7 @@ class FlexibleConnectedPositionStrategy {
|
|
|
1485
1503
|
this._lastPosition = position;
|
|
1486
1504
|
// Notify that the position has been changed along with its change properties.
|
|
1487
1505
|
// We only emit if we've got any subscriptions, because the scroll visibility
|
|
1488
|
-
//
|
|
1506
|
+
// calculations can be somewhat expensive.
|
|
1489
1507
|
if (this._positionChanges.observers.length) {
|
|
1490
1508
|
const scrollableViewProperties = this._getScrollVisibility();
|
|
1491
1509
|
const changeEvent = new ConnectedOverlayPositionChange(position, scrollableViewProperties);
|
|
@@ -1579,7 +1597,7 @@ class FlexibleConnectedPositionStrategy {
|
|
|
1579
1597
|
}
|
|
1580
1598
|
/**
|
|
1581
1599
|
* Sets the position and size of the overlay's sizing wrapper. The wrapper is positioned on the
|
|
1582
|
-
* origin's connection point and
|
|
1600
|
+
* origin's connection point and stretches to the bounds of the viewport.
|
|
1583
1601
|
*
|
|
1584
1602
|
* @param origin The point on the origin element where the overlay is connected.
|
|
1585
1603
|
* @param position The position preference
|
|
@@ -1817,7 +1835,7 @@ class FlexibleConnectedPositionStrategy {
|
|
|
1817
1835
|
_getOffset(position, axis) {
|
|
1818
1836
|
if (axis === 'x') {
|
|
1819
1837
|
// We don't do something like `position['offset' + axis]` in
|
|
1820
|
-
// order to avoid
|
|
1838
|
+
// order to avoid breaking minifiers that rename properties.
|
|
1821
1839
|
return position.offsetX == null ? this._offsetX : position.offsetX;
|
|
1822
1840
|
}
|
|
1823
1841
|
return position.offsetY == null ? this._offsetY : position.offsetY;
|