@angular/cdk 7.2.2 → 7.3.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/bundles/cdk-drag-drop.umd.js +2798 -2597
- package/bundles/cdk-drag-drop.umd.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.min.js +2 -2
- package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
- package/bundles/cdk-overlay.umd.js +86 -15
- package/bundles/cdk-overlay.umd.js.map +1 -1
- package/bundles/cdk-overlay.umd.min.js +2 -2
- package/bundles/cdk-overlay.umd.min.js.map +1 -1
- package/bundles/cdk-stepper.umd.js +2 -2
- package/bundles/cdk-stepper.umd.js.map +1 -1
- package/bundles/cdk-stepper.umd.min.js.map +1 -1
- package/bundles/cdk.umd.js +1 -1
- package/bundles/cdk.umd.js.map +1 -1
- package/bundles/cdk.umd.min.js +1 -1
- package/bundles/cdk.umd.min.js.map +1 -1
- package/drag-drop/typings/directives/drag.d.ts +8 -4
- package/drag-drop/typings/directives/drop-list.d.ts +17 -3
- package/drag-drop/typings/drag-drop.d.ts +33 -0
- package/drag-drop/typings/drag-ref.d.ts +20 -13
- package/drag-drop/typings/drop-list-ref.d.ts +8 -4
- package/drag-drop/typings/index.d.ts +2 -2
- package/drag-drop/typings/index.metadata.json +1 -1
- package/drag-drop/typings/public-api.d.ts +4 -1
- package/esm2015/cdk.js +1 -1
- package/esm2015/cdk.js.map +1 -1
- package/esm2015/drag-drop.js +2213 -2058
- package/esm2015/drag-drop.js.map +1 -1
- package/esm2015/overlay.js +58 -11
- package/esm2015/overlay.js.map +1 -1
- package/esm2015/stepper.js +1 -1
- package/esm2015/stepper.js.map +1 -1
- package/esm5/cdk.es5.js +1 -1
- package/esm5/cdk.es5.js.map +1 -1
- package/esm5/drag-drop.es5.js +2792 -2594
- package/esm5/drag-drop.es5.js.map +1 -1
- package/esm5/overlay.es5.js +88 -17
- package/esm5/overlay.es5.js.map +1 -1
- package/esm5/stepper.es5.js +2 -2
- package/esm5/stepper.es5.js.map +1 -1
- package/overlay/typings/index.metadata.json +1 -1
- package/overlay/typings/overlay-ref.d.ts +4 -0
- package/overlay/typings/position/flexible-connected-position-strategy.d.ts +17 -4
- package/overlay/typings/position/overlay-position-builder.d.ts +3 -3
- package/package.json +4 -4
- package/stepper/typings/stepper.d.ts +1 -1
- package/typings/drag-drop/directives/drag.d.ts +8 -4
- package/typings/drag-drop/directives/drop-list.d.ts +17 -3
- package/typings/drag-drop/drag-drop.d.ts +33 -0
- package/typings/drag-drop/drag-ref.d.ts +20 -13
- package/typings/drag-drop/drop-list-ref.d.ts +8 -4
- package/typings/drag-drop/index.d.ts +2 -2
- package/typings/drag-drop/index.metadata.json +1 -1
- package/typings/drag-drop/public-api.d.ts +4 -1
- package/typings/esm5/drag-drop/directives/drag.d.ts +8 -4
- package/typings/esm5/drag-drop/directives/drop-list.d.ts +17 -3
- package/typings/esm5/drag-drop/drag-drop.d.ts +33 -0
- package/typings/esm5/drag-drop/drag-ref.d.ts +20 -13
- package/typings/esm5/drag-drop/drop-list-ref.d.ts +8 -4
- package/typings/esm5/drag-drop/index.d.ts +2 -2
- package/typings/esm5/drag-drop/index.metadata.json +1 -1
- package/typings/esm5/drag-drop/public-api.d.ts +4 -1
- package/typings/esm5/index.metadata.json +1 -1
- package/typings/esm5/overlay/index.metadata.json +1 -1
- package/typings/esm5/overlay/overlay-ref.d.ts +4 -0
- package/typings/esm5/overlay/position/flexible-connected-position-strategy.d.ts +17 -4
- package/typings/esm5/overlay/position/overlay-position-builder.d.ts +3 -3
- package/typings/esm5/stepper/stepper.d.ts +1 -1
- package/typings/index.metadata.json +1 -1
- package/typings/overlay/index.metadata.json +1 -1
- package/typings/overlay/overlay-ref.d.ts +4 -0
- package/typings/overlay/position/flexible-connected-position-strategy.d.ts +17 -4
- package/typings/overlay/position/overlay-position-builder.d.ts +3 -3
- package/typings/stepper/stepper.d.ts +1 -1
package/esm2015/overlay.js
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
|
-
import { coerceCssPixelValue, coerceArray,
|
|
8
|
+
import { coerceCssPixelValue, coerceArray, coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
9
9
|
import { ScrollDispatcher, ViewportRuler, ScrollingModule, VIEWPORT_RULER_PROVIDER } from '@angular/cdk/scrolling';
|
|
10
10
|
export { ViewportRuler, VIEWPORT_RULER_PROVIDER, CdkScrollable, ScrollDispatcher } from '@angular/cdk/scrolling';
|
|
11
11
|
import { DOCUMENT, Location } from '@angular/common';
|
|
12
|
-
import { Inject, Injectable, NgZone, Optional, NgModule, SkipSelf, ApplicationRef, ComponentFactoryResolver, Injector,
|
|
12
|
+
import { Inject, Injectable, NgZone, Optional, NgModule, SkipSelf, ApplicationRef, ComponentFactoryResolver, Injector, ElementRef, Directive, EventEmitter, InjectionToken, Input, Output, TemplateRef, ViewContainerRef, defineInjectable, inject } from '@angular/core';
|
|
13
13
|
import { Observable, Subject, merge, Subscription } from 'rxjs';
|
|
14
14
|
import { take, takeUntil } from 'rxjs/operators';
|
|
15
15
|
import { Platform } from '@angular/cdk/platform';
|
|
@@ -1034,6 +1034,26 @@ class OverlayRef {
|
|
|
1034
1034
|
this._config = Object.assign({}, this._config, { direction: dir });
|
|
1035
1035
|
this._updateElementDirection();
|
|
1036
1036
|
}
|
|
1037
|
+
/**
|
|
1038
|
+
* Add a CSS class or an array of classes to the overlay pane.
|
|
1039
|
+
* @param {?} classes
|
|
1040
|
+
* @return {?}
|
|
1041
|
+
*/
|
|
1042
|
+
addPanelClass(classes) {
|
|
1043
|
+
if (this._pane) {
|
|
1044
|
+
this._toggleClasses(this._pane, classes, true);
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
/**
|
|
1048
|
+
* Remove a CSS class or an array of classes from the overlay pane.
|
|
1049
|
+
* @param {?} classes
|
|
1050
|
+
* @return {?}
|
|
1051
|
+
*/
|
|
1052
|
+
removePanelClass(classes) {
|
|
1053
|
+
if (this._pane) {
|
|
1054
|
+
this._toggleClasses(this._pane, classes, false);
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1037
1057
|
/**
|
|
1038
1058
|
* Returns the layout direction of the overlay panel.
|
|
1039
1059
|
* @return {?}
|
|
@@ -1390,7 +1410,7 @@ class FlexibleConnectedPositionStrategy {
|
|
|
1390
1410
|
// the overlay relative to the origin.
|
|
1391
1411
|
// We use the viewport rect to determine whether a position would go off-screen.
|
|
1392
1412
|
this._viewportRect = this._getNarrowedViewportRect();
|
|
1393
|
-
this._originRect = this.
|
|
1413
|
+
this._originRect = this._getOriginRect();
|
|
1394
1414
|
this._overlayRect = this._pane.getBoundingClientRect();
|
|
1395
1415
|
/** @type {?} */
|
|
1396
1416
|
const originRect = this._originRect;
|
|
@@ -1525,7 +1545,7 @@ class FlexibleConnectedPositionStrategy {
|
|
|
1525
1545
|
*/
|
|
1526
1546
|
reapplyLastPosition() {
|
|
1527
1547
|
if (!this._isDisposed && (!this._platform || this._platform.isBrowser)) {
|
|
1528
|
-
this._originRect = this.
|
|
1548
|
+
this._originRect = this._getOriginRect();
|
|
1529
1549
|
this._overlayRect = this._pane.getBoundingClientRect();
|
|
1530
1550
|
this._viewportRect = this._getNarrowedViewportRect();
|
|
1531
1551
|
/** @type {?} */
|
|
@@ -1620,14 +1640,17 @@ class FlexibleConnectedPositionStrategy {
|
|
|
1620
1640
|
return (/** @type {?} */ (this));
|
|
1621
1641
|
}
|
|
1622
1642
|
/**
|
|
1623
|
-
* Sets the origin
|
|
1643
|
+
* Sets the origin, relative to which to position the overlay.
|
|
1644
|
+
* Using an element origin is useful for building components that need to be positioned
|
|
1645
|
+
* relatively to a trigger (e.g. dropdown menus or tooltips), whereas using a point can be
|
|
1646
|
+
* used for cases like contextual menus which open relative to the user's pointer.
|
|
1624
1647
|
* @template THIS
|
|
1625
1648
|
* @this {THIS}
|
|
1626
|
-
* @param {?} origin Reference to the new origin
|
|
1649
|
+
* @param {?} origin Reference to the new origin.
|
|
1627
1650
|
* @return {THIS}
|
|
1628
1651
|
*/
|
|
1629
1652
|
setOrigin(origin) {
|
|
1630
|
-
(/** @type {?} */ (this))._origin =
|
|
1653
|
+
(/** @type {?} */ (this))._origin = origin;
|
|
1631
1654
|
return (/** @type {?} */ (this));
|
|
1632
1655
|
}
|
|
1633
1656
|
/**
|
|
@@ -2245,7 +2268,7 @@ class FlexibleConnectedPositionStrategy {
|
|
|
2245
2268
|
_getScrollVisibility() {
|
|
2246
2269
|
// Note: needs fresh rects since the position could've changed.
|
|
2247
2270
|
/** @type {?} */
|
|
2248
|
-
const originBounds = this.
|
|
2271
|
+
const originBounds = this._getOriginRect();
|
|
2249
2272
|
/** @type {?} */
|
|
2250
2273
|
const overlayBounds = this._pane.getBoundingClientRect();
|
|
2251
2274
|
// TODO(jelbourn): instead of needing all of the client rects for these scrolling containers
|
|
@@ -2376,6 +2399,30 @@ class FlexibleConnectedPositionStrategy {
|
|
|
2376
2399
|
this._appliedPanelClasses = [];
|
|
2377
2400
|
}
|
|
2378
2401
|
}
|
|
2402
|
+
/**
|
|
2403
|
+
* Returns the ClientRect of the current origin.
|
|
2404
|
+
* @private
|
|
2405
|
+
* @return {?}
|
|
2406
|
+
*/
|
|
2407
|
+
_getOriginRect() {
|
|
2408
|
+
/** @type {?} */
|
|
2409
|
+
const origin = this._origin;
|
|
2410
|
+
if (origin instanceof ElementRef) {
|
|
2411
|
+
return origin.nativeElement.getBoundingClientRect();
|
|
2412
|
+
}
|
|
2413
|
+
if (origin instanceof HTMLElement) {
|
|
2414
|
+
return origin.getBoundingClientRect();
|
|
2415
|
+
}
|
|
2416
|
+
// If the origin is a point, return a client rect as if it was a 0x0 element at the point.
|
|
2417
|
+
return {
|
|
2418
|
+
top: origin.y,
|
|
2419
|
+
bottom: origin.y,
|
|
2420
|
+
left: origin.x,
|
|
2421
|
+
right: origin.x,
|
|
2422
|
+
height: 0,
|
|
2423
|
+
width: 0
|
|
2424
|
+
};
|
|
2425
|
+
}
|
|
2379
2426
|
}
|
|
2380
2427
|
/**
|
|
2381
2428
|
* Shallow-extends a stylesheet object with another stylesheet object.
|
|
@@ -2875,11 +2922,11 @@ class OverlayPositionBuilder {
|
|
|
2875
2922
|
}
|
|
2876
2923
|
/**
|
|
2877
2924
|
* Creates a flexible position strategy.
|
|
2878
|
-
* @param {?}
|
|
2925
|
+
* @param {?} origin Origin relative to which to position the overlay.
|
|
2879
2926
|
* @return {?}
|
|
2880
2927
|
*/
|
|
2881
|
-
flexibleConnectedTo(
|
|
2882
|
-
return new FlexibleConnectedPositionStrategy(
|
|
2928
|
+
flexibleConnectedTo(origin) {
|
|
2929
|
+
return new FlexibleConnectedPositionStrategy(origin, this._viewportRuler, this._document, this._platform, this._overlayContainer);
|
|
2883
2930
|
}
|
|
2884
2931
|
}
|
|
2885
2932
|
OverlayPositionBuilder.decorators = [
|