@angular/cdk 7.2.0 → 7.2.1
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/_a11y.scss +1 -1
- package/a11y/typings/focus-monitor/focus-monitor.d.ts +0 -1
- package/a11y/typings/focus-trap/focus-trap.d.ts +2 -0
- package/a11y/typings/index.metadata.json +1 -1
- package/bundles/cdk-a11y.umd.js +23 -22
- package/bundles/cdk-a11y.umd.js.map +1 -1
- package/bundles/cdk-a11y.umd.min.js +1 -1
- package/bundles/cdk-a11y.umd.min.js.map +1 -1
- package/bundles/cdk-coercion.umd.js +20 -4
- package/bundles/cdk-coercion.umd.js.map +1 -1
- package/bundles/cdk-coercion.umd.min.js +1 -1
- package/bundles/cdk-coercion.umd.min.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.js +43 -21
- 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-observers.umd.js +1 -1
- package/bundles/cdk-observers.umd.js.map +1 -1
- package/bundles/cdk-observers.umd.min.js +1 -1
- package/bundles/cdk-observers.umd.min.js.map +1 -1
- package/bundles/cdk-overlay.umd.js +9 -19
- 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-text-field.umd.js +6 -6
- package/bundles/cdk-text-field.umd.js.map +1 -1
- package/bundles/cdk-text-field.umd.min.js +1 -1
- package/bundles/cdk-text-field.umd.min.js.map +1 -1
- package/bundles/cdk-tree.umd.js.map +1 -1
- package/bundles/cdk-tree.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/coercion/typings/element.d.ts +13 -0
- package/coercion/typings/index.metadata.json +1 -1
- package/coercion/typings/public-api.d.ts +1 -0
- package/drag-drop/typings/directives/drag.d.ts +5 -4
- package/drag-drop/typings/drag-ref.d.ts +2 -2
- package/drag-drop/typings/index.metadata.json +1 -1
- package/esm2015/a11y.js +23 -18
- package/esm2015/a11y.js.map +1 -1
- package/esm2015/cdk.js +1 -1
- package/esm2015/cdk.js.map +1 -1
- package/esm2015/coercion.js +18 -1
- package/esm2015/coercion.js.map +1 -1
- package/esm2015/drag-drop.js +37 -19
- package/esm2015/drag-drop.js.map +1 -1
- package/esm2015/observers.js +2 -2
- package/esm2015/observers.js.map +1 -1
- package/esm2015/overlay.js +11 -15
- package/esm2015/overlay.js.map +1 -1
- package/esm2015/text-field.js +3 -3
- package/esm2015/text-field.js.map +1 -1
- package/esm2015/tree.js.map +1 -1
- package/esm5/a11y.es5.js +24 -23
- package/esm5/a11y.es5.js.map +1 -1
- package/esm5/cdk.es5.js +1 -1
- package/esm5/cdk.es5.js.map +1 -1
- package/esm5/coercion.es5.js +18 -1
- package/esm5/coercion.es5.js.map +1 -1
- package/esm5/drag-drop.es5.js +43 -21
- package/esm5/drag-drop.es5.js.map +1 -1
- package/esm5/observers.es5.js +2 -2
- package/esm5/observers.es5.js.map +1 -1
- package/esm5/overlay.es5.js +11 -21
- package/esm5/overlay.es5.js.map +1 -1
- package/esm5/text-field.es5.js +3 -3
- package/esm5/text-field.es5.js.map +1 -1
- package/esm5/tree.es5.js.map +1 -1
- package/overlay/typings/index.metadata.json +1 -1
- package/overlay/typings/overlay-directives.d.ts +0 -2
- package/package.json +4 -4
- package/text-field/typings/index.metadata.json +1 -1
- package/tree/typings/control/base-tree-control.d.ts +1 -1
- package/tree/typings/control/nested-tree-control.d.ts +2 -2
- package/tree/typings/control/tree-control.d.ts +1 -1
- package/typings/a11y/focus-monitor/focus-monitor.d.ts +0 -1
- package/typings/a11y/focus-trap/focus-trap.d.ts +2 -0
- package/typings/a11y/index.metadata.json +1 -1
- package/typings/coercion/element.d.ts +13 -0
- package/typings/coercion/index.metadata.json +1 -1
- package/typings/coercion/public-api.d.ts +1 -0
- package/typings/drag-drop/directives/drag.d.ts +5 -4
- package/typings/drag-drop/drag-ref.d.ts +2 -2
- package/typings/drag-drop/index.metadata.json +1 -1
- package/typings/esm5/a11y/focus-monitor/focus-monitor.d.ts +0 -1
- package/typings/esm5/a11y/focus-trap/focus-trap.d.ts +2 -0
- package/typings/esm5/a11y/index.metadata.json +1 -1
- package/typings/esm5/coercion/element.d.ts +13 -0
- package/typings/esm5/coercion/index.metadata.json +1 -1
- package/typings/esm5/coercion/public-api.d.ts +1 -0
- package/typings/esm5/drag-drop/directives/drag.d.ts +5 -4
- package/typings/esm5/drag-drop/drag-ref.d.ts +2 -2
- package/typings/esm5/drag-drop/index.metadata.json +1 -1
- package/typings/esm5/index.metadata.json +1 -1
- package/typings/esm5/overlay/index.metadata.json +1 -1
- package/typings/esm5/overlay/overlay-directives.d.ts +0 -2
- package/typings/esm5/text-field/index.metadata.json +1 -1
- package/typings/esm5/tree/control/base-tree-control.d.ts +1 -1
- package/typings/esm5/tree/control/nested-tree-control.d.ts +2 -2
- package/typings/esm5/tree/control/tree-control.d.ts +1 -1
- package/typings/index.metadata.json +1 -1
- package/typings/overlay/index.metadata.json +1 -1
- package/typings/overlay/overlay-directives.d.ts +0 -2
- package/typings/text-field/index.metadata.json +1 -1
- package/typings/tree/control/base-tree-control.d.ts +1 -1
- package/typings/tree/control/nested-tree-control.d.ts +2 -2
- package/typings/tree/control/tree-control.d.ts +1 -1
package/esm5/cdk.es5.js
CHANGED
package/esm5/cdk.es5.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdk.es5.js","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('7.2.
|
|
1
|
+
{"version":3,"file":"cdk.es5.js","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('7.2.1');\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAWA,AAAA,IAAa,OAAO,GAAG,IAAI,OAAO,CAAC,mBAAmB,CAAC;;;;;;;;;;;;;;"}
|
package/esm5/coercion.es5.js
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
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 { ElementRef } from '@angular/core';
|
|
9
|
+
|
|
8
10
|
/**
|
|
9
11
|
* @fileoverview added by tsickle
|
|
10
12
|
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
@@ -78,6 +80,21 @@ function coerceCssPixelValue(value) {
|
|
|
78
80
|
return typeof value === 'string' ? value : value + "px";
|
|
79
81
|
}
|
|
80
82
|
|
|
83
|
+
/**
|
|
84
|
+
* @fileoverview added by tsickle
|
|
85
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
86
|
+
*/
|
|
87
|
+
/**
|
|
88
|
+
* Coerces an ElementRef or an Element into an element.
|
|
89
|
+
* Useful for APIs that can accept either a ref or the native element itself.
|
|
90
|
+
* @template T
|
|
91
|
+
* @param {?} elementOrRef
|
|
92
|
+
* @return {?}
|
|
93
|
+
*/
|
|
94
|
+
function coerceElement(elementOrRef) {
|
|
95
|
+
return elementOrRef instanceof ElementRef ? elementOrRef.nativeElement : elementOrRef;
|
|
96
|
+
}
|
|
97
|
+
|
|
81
98
|
/**
|
|
82
99
|
* @fileoverview added by tsickle
|
|
83
100
|
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
@@ -88,5 +105,5 @@ function coerceCssPixelValue(value) {
|
|
|
88
105
|
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
89
106
|
*/
|
|
90
107
|
|
|
91
|
-
export { coerceBooleanProperty, coerceNumberProperty, _isNumberValue, coerceArray, coerceCssPixelValue };
|
|
108
|
+
export { coerceBooleanProperty, coerceNumberProperty, _isNumberValue, coerceArray, coerceCssPixelValue, coerceElement };
|
|
92
109
|
//# sourceMappingURL=coercion.es5.js.map
|
package/esm5/coercion.es5.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coercion.es5.js","sources":["../../../src/cdk/coercion/css-pixel-value.ts","../../../src/cdk/coercion/array.ts","../../../src/cdk/coercion/number-property.ts","../../../src/cdk/coercion/boolean-property.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\n/** Coerces a value to a CSS pixel value. */\nexport function coerceCssPixelValue(value: any): string {\n if (value == null) {\n return '';\n }\n\n return typeof value === 'string' ? value : `${value}px`;\n}\n","/**\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\n/** Wraps the provided value in an array, unless the provided value is an array. */\nexport function coerceArray<T>(value: T | T[]): T[] {\n return Array.isArray(value) ? value : [value];\n}\n","/**\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\n/** Coerces a data-bound value (typically a string) to a number. */\nexport function coerceNumberProperty(value: any): number;\nexport function coerceNumberProperty<D>(value: any, fallback: D): number | D;\nexport function coerceNumberProperty(value: any, fallbackValue = 0) {\n return _isNumberValue(value) ? Number(value) : fallbackValue;\n}\n\n/**\n * Whether the provided value is considered a number.\n * @docs-private\n */\nexport function _isNumberValue(value: any): boolean {\n // parseFloat(value) handles most of the cases we're interested in (it treats null, empty string,\n // and other non-number values as NaN, where Number just uses 0) but it considers the string\n // '123hello' to be a valid number. Therefore we also check if Number(value) is NaN.\n return !isNaN(parseFloat(value as any)) && !isNaN(Number(value));\n}\n","/**\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\n/** Coerces a data-bound value (typically a string) to a boolean. */\nexport function coerceBooleanProperty(value: any): boolean {\n return value != null && `${value}` !== 'false';\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"coercion.es5.js","sources":["../../../src/cdk/coercion/element.ts","../../../src/cdk/coercion/css-pixel-value.ts","../../../src/cdk/coercion/array.ts","../../../src/cdk/coercion/number-property.ts","../../../src/cdk/coercion/boolean-property.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 {ElementRef} from '@angular/core';\n\n/**\n * Coerces an ElementRef or an Element into an element.\n * Useful for APIs that can accept either a ref or the native element itself.\n */\nexport function coerceElement<T>(elementOrRef: ElementRef<T> | T): T {\n return elementOrRef instanceof ElementRef ? elementOrRef.nativeElement : elementOrRef;\n}\n","/**\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\n/** Coerces a value to a CSS pixel value. */\nexport function coerceCssPixelValue(value: any): string {\n if (value == null) {\n return '';\n }\n\n return typeof value === 'string' ? value : `${value}px`;\n}\n","/**\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\n/** Wraps the provided value in an array, unless the provided value is an array. */\nexport function coerceArray<T>(value: T | T[]): T[] {\n return Array.isArray(value) ? value : [value];\n}\n","/**\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\n/** Coerces a data-bound value (typically a string) to a number. */\nexport function coerceNumberProperty(value: any): number;\nexport function coerceNumberProperty<D>(value: any, fallback: D): number | D;\nexport function coerceNumberProperty(value: any, fallbackValue = 0) {\n return _isNumberValue(value) ? Number(value) : fallbackValue;\n}\n\n/**\n * Whether the provided value is considered a number.\n * @docs-private\n */\nexport function _isNumberValue(value: any): boolean {\n // parseFloat(value) handles most of the cases we're interested in (it treats null, empty string,\n // and other non-number values as NaN, where Number just uses 0) but it considers the string\n // '123hello' to be a valid number. Therefore we also check if Number(value) is NaN.\n return !isNaN(parseFloat(value as any)) && !isNaN(Number(value));\n}\n","/**\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\n/** Coerces a data-bound value (typically a string) to a boolean. */\nexport function coerceBooleanProperty(value: any): boolean {\n return value != null && `${value}` !== 'false';\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AISA,AAAA,SAAgB,qBAAqB,CAAC,KAAU,EAAhD;IACE,OAAO,KAAK,IAAI,IAAI,IAAI,EAA1B,GAA6B,KAAO,KAAK,OAAO,CAAC;CAChD;;;;;;;;;;;;ADAD,AAAA,SAAgB,oBAAoB,CAAC,KAAU,EAAE,aAAiB,EAAlE;IAAiD,IAAjD,aAAA,KAAA,KAAA,CAAA,EAAiD,EAAA,aAAjD,GAAA,CAAkE,CAAlE,EAAA;IACE,OAAO,cAAc,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,aAAa,CAAC;CAC9D;;;;;;;AAMD,AAAA,SAAgB,cAAc,CAAC,KAAU,EAAzC;;;;IAIE,OAAO,CAAC,KAAK,CAAC,UAAU,oBAAC,KAAK,GAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;CAClE;;;;;;;;;;;;;ADfD,AAAA,SAAgB,WAAW,CAAI,KAAc,EAA7C;IACE,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC;CAC/C;;;;;;;;;;;;ADFD,AAAA,SAAgB,mBAAmB,CAAC,KAAU,EAA9C;IACE,IAAI,KAAK,IAAI,IAAI,EAAE;QACjB,OAAO,EAAE,CAAC;KACX;IAED,OAAO,OAAO,KAAK,KAAK,QAAQ,GAAG,KAAK,GAAM,KAAK,GAArD,IAAyD,CAAC;CACzD;;;;;;;;;;;;;ADDD,AAAA,SAAgB,aAAa,CAAI,YAA+B,EAAhE;IACE,OAAO,YAAY,YAAY,UAAU,GAAG,YAAY,CAAC,aAAa,GAAG,YAAY,CAAC;CACvF;;;;;;;;;;;;;;"}
|
package/esm5/drag-drop.es5.js
CHANGED
|
@@ -701,13 +701,13 @@ DragRef = /** @class */ (function () {
|
|
|
701
701
|
*/
|
|
702
702
|
this._boundaryElement = null;
|
|
703
703
|
/**
|
|
704
|
-
*
|
|
704
|
+
* Whether the native dragging interactions have been enabled on the root element.
|
|
705
705
|
*/
|
|
706
|
-
this.
|
|
706
|
+
this._nativeInteractionsEnabled = true;
|
|
707
707
|
/**
|
|
708
|
-
*
|
|
708
|
+
* Elements that can be used to drag the draggable item.
|
|
709
709
|
*/
|
|
710
|
-
this.
|
|
710
|
+
this._handles = [];
|
|
711
711
|
this._disabled = false;
|
|
712
712
|
/**
|
|
713
713
|
* Emits as the drag sequence is being prepared.
|
|
@@ -895,7 +895,12 @@ DragRef = /** @class */ (function () {
|
|
|
895
895
|
* @return {?}
|
|
896
896
|
*/
|
|
897
897
|
function (value) {
|
|
898
|
-
|
|
898
|
+
/** @type {?} */
|
|
899
|
+
var newValue = coerceBooleanProperty(value);
|
|
900
|
+
if (newValue !== this._disabled) {
|
|
901
|
+
this._disabled = newValue;
|
|
902
|
+
this._toggleNativeDragInteractions();
|
|
903
|
+
}
|
|
899
904
|
},
|
|
900
905
|
enumerable: true,
|
|
901
906
|
configurable: true
|
|
@@ -1663,10 +1668,11 @@ DragRef = /** @class */ (function () {
|
|
|
1663
1668
|
* @return {?}
|
|
1664
1669
|
*/
|
|
1665
1670
|
function () {
|
|
1671
|
+
if (!this._rootElement || !this._handles) {
|
|
1672
|
+
return;
|
|
1673
|
+
}
|
|
1666
1674
|
/** @type {?} */
|
|
1667
|
-
var shouldEnable = this._handles.length > 0;
|
|
1668
|
-
// We go through the trouble of keeping track of whether the interactions are enabled,
|
|
1669
|
-
// because we want to avoid triggering style recalculations unless we really have to.
|
|
1675
|
+
var shouldEnable = this.disabled || this._handles.length > 0;
|
|
1670
1676
|
if (shouldEnable !== this._nativeInteractionsEnabled) {
|
|
1671
1677
|
this._nativeInteractionsEnabled = shouldEnable;
|
|
1672
1678
|
toggleNativeDragInteractions(this._rootElement, shouldEnable);
|
|
@@ -1853,6 +1859,7 @@ var CdkDrag = /** @class */ (function () {
|
|
|
1853
1859
|
*/
|
|
1854
1860
|
function (value) {
|
|
1855
1861
|
this._disabled = coerceBooleanProperty(value);
|
|
1862
|
+
this._dragRef.disabled = this._disabled;
|
|
1856
1863
|
},
|
|
1857
1864
|
enumerable: true,
|
|
1858
1865
|
configurable: true
|
|
@@ -1913,13 +1920,7 @@ var CdkDrag = /** @class */ (function () {
|
|
|
1913
1920
|
this._rootElementInitSubscription = this._ngZone.onStable.asObservable()
|
|
1914
1921
|
.pipe(take(1))
|
|
1915
1922
|
.subscribe(function () {
|
|
1916
|
-
|
|
1917
|
-
var rootElement = _this._getRootElement();
|
|
1918
|
-
if (rootElement.nodeType !== _this._document.ELEMENT_NODE) {
|
|
1919
|
-
throw Error("cdkDrag must be attached to an element node. " +
|
|
1920
|
-
("Currently attached to \"" + rootElement.nodeName + "\"."));
|
|
1921
|
-
}
|
|
1922
|
-
_this._dragRef.withRootElement(rootElement);
|
|
1923
|
+
_this._updateRootElement();
|
|
1923
1924
|
_this._handles.changes
|
|
1924
1925
|
.pipe(startWith(_this._handles))
|
|
1925
1926
|
.subscribe(function (handleList) {
|
|
@@ -1927,6 +1928,23 @@ var CdkDrag = /** @class */ (function () {
|
|
|
1927
1928
|
});
|
|
1928
1929
|
});
|
|
1929
1930
|
};
|
|
1931
|
+
/**
|
|
1932
|
+
* @param {?} changes
|
|
1933
|
+
* @return {?}
|
|
1934
|
+
*/
|
|
1935
|
+
CdkDrag.prototype.ngOnChanges = /**
|
|
1936
|
+
* @param {?} changes
|
|
1937
|
+
* @return {?}
|
|
1938
|
+
*/
|
|
1939
|
+
function (changes) {
|
|
1940
|
+
/** @type {?} */
|
|
1941
|
+
var rootSelectorChange = changes.rootElementSelector;
|
|
1942
|
+
// We don't have to react to the first change since it's being
|
|
1943
|
+
// handled in `ngAfterViewInit` where it needs to be deferred.
|
|
1944
|
+
if (rootSelectorChange && !rootSelectorChange.firstChange) {
|
|
1945
|
+
this._updateRootElement();
|
|
1946
|
+
}
|
|
1947
|
+
};
|
|
1930
1948
|
/**
|
|
1931
1949
|
* @return {?}
|
|
1932
1950
|
*/
|
|
@@ -1937,14 +1955,14 @@ var CdkDrag = /** @class */ (function () {
|
|
|
1937
1955
|
this._rootElementInitSubscription.unsubscribe();
|
|
1938
1956
|
this._dragRef.dispose();
|
|
1939
1957
|
};
|
|
1940
|
-
/**
|
|
1958
|
+
/** Syncs the root element with the `DragRef`. */
|
|
1941
1959
|
/**
|
|
1942
|
-
*
|
|
1960
|
+
* Syncs the root element with the `DragRef`.
|
|
1943
1961
|
* @private
|
|
1944
1962
|
* @return {?}
|
|
1945
1963
|
*/
|
|
1946
|
-
CdkDrag.prototype.
|
|
1947
|
-
*
|
|
1964
|
+
CdkDrag.prototype._updateRootElement = /**
|
|
1965
|
+
* Syncs the root element with the `DragRef`.
|
|
1948
1966
|
* @private
|
|
1949
1967
|
* @return {?}
|
|
1950
1968
|
*/
|
|
@@ -1953,8 +1971,12 @@ var CdkDrag = /** @class */ (function () {
|
|
|
1953
1971
|
var element = this.element.nativeElement;
|
|
1954
1972
|
/** @type {?} */
|
|
1955
1973
|
var rootElement = this.rootElementSelector ?
|
|
1956
|
-
getClosestMatchingAncestor(element, this.rootElementSelector) :
|
|
1957
|
-
|
|
1974
|
+
getClosestMatchingAncestor(element, this.rootElementSelector) : element;
|
|
1975
|
+
if (rootElement && rootElement.nodeType !== this._document.ELEMENT_NODE) {
|
|
1976
|
+
throw Error("cdkDrag must be attached to an element node. " +
|
|
1977
|
+
("Currently attached to \"" + rootElement.nodeName + "\"."));
|
|
1978
|
+
}
|
|
1979
|
+
this._dragRef.withRootElement(rootElement || element);
|
|
1958
1980
|
};
|
|
1959
1981
|
/** Gets the boundary element, based on the `boundaryElementSelector`. */
|
|
1960
1982
|
/**
|