@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
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
8
|
(function (global, factory) {
|
|
9
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
10
|
-
typeof define === 'function' && define.amd ? define('@angular/cdk/coercion', ['exports'], factory) :
|
|
11
|
-
(factory((global.ng = global.ng || {}, global.ng.cdk = global.ng.cdk || {}, global.ng.cdk.coercion = {})));
|
|
12
|
-
}(this, (function (exports) { 'use strict';
|
|
9
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core')) :
|
|
10
|
+
typeof define === 'function' && define.amd ? define('@angular/cdk/coercion', ['exports', '@angular/core'], factory) :
|
|
11
|
+
(factory((global.ng = global.ng || {}, global.ng.cdk = global.ng.cdk || {}, global.ng.cdk.coercion = {}),global.ng.core));
|
|
12
|
+
}(this, (function (exports,core) { 'use strict';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* @fileoverview added by tsickle
|
|
@@ -84,11 +84,27 @@ function coerceCssPixelValue(value) {
|
|
|
84
84
|
return typeof value === 'string' ? value : value + "px";
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
+
/**
|
|
88
|
+
* @fileoverview added by tsickle
|
|
89
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
90
|
+
*/
|
|
91
|
+
/**
|
|
92
|
+
* Coerces an ElementRef or an Element into an element.
|
|
93
|
+
* Useful for APIs that can accept either a ref or the native element itself.
|
|
94
|
+
* @template T
|
|
95
|
+
* @param {?} elementOrRef
|
|
96
|
+
* @return {?}
|
|
97
|
+
*/
|
|
98
|
+
function coerceElement(elementOrRef) {
|
|
99
|
+
return elementOrRef instanceof core.ElementRef ? elementOrRef.nativeElement : elementOrRef;
|
|
100
|
+
}
|
|
101
|
+
|
|
87
102
|
exports.coerceBooleanProperty = coerceBooleanProperty;
|
|
88
103
|
exports.coerceNumberProperty = coerceNumberProperty;
|
|
89
104
|
exports._isNumberValue = _isNumberValue;
|
|
90
105
|
exports.coerceArray = coerceArray;
|
|
91
106
|
exports.coerceCssPixelValue = coerceCssPixelValue;
|
|
107
|
+
exports.coerceElement = coerceElement;
|
|
92
108
|
|
|
93
109
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
94
110
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdk-coercion.umd.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":"cdk-coercion.umd.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":["ElementRef"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AISA,SAAgB,qBAAqB,CAAC,KAAU,EAAhD;IACE,OAAO,KAAK,IAAI,IAAI,IAAI,EAA1B,GAA6B,KAAO,KAAK,OAAO,CAAC;CAChD;;;;;;;;;;;;ADAD,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,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,SAAgB,WAAW,CAAI,KAAc,EAA7C;IACE,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC;CAC/C;;;;;;;;;;;;ADFD,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,SAAgB,aAAa,CAAI,YAA+B,EAAhE;IACE,OAAO,YAAY,YAAYA,eAAU,GAAG,YAAY,CAAC,aAAa,GAAG,YAAY,CAAC;CACvF;;;;;;;;;;;;;;;;;"}
|
|
@@ -5,5 +5,5 @@
|
|
|
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
|
-
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define("@angular/cdk/coercion",["exports"],n):n((e.ng=e.ng||{},e.ng.cdk=e.ng.cdk||{},e.ng.cdk.coercion={}))}(this,function(e){"use strict";function
|
|
8
|
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@angular/core")):"function"==typeof define&&define.amd?define("@angular/cdk/coercion",["exports","@angular/core"],n):n((e.ng=e.ng||{},e.ng.cdk=e.ng.cdk||{},e.ng.cdk.coercion={}),e.ng.core)}(this,function(e,n){"use strict";function r(e){return null!=e&&""+e!="false"}function o(e,n){return void 0===n&&(n=0),t(e)?Number(e):n}function t(e){return!isNaN(parseFloat(e))&&!isNaN(Number(e))}function c(e){return Array.isArray(e)?e:[e]}function u(e){return null==e?"":"string"==typeof e?e:e+"px"}function i(e){return e instanceof n.ElementRef?e.nativeElement:e}e.coerceBooleanProperty=r,e.coerceNumberProperty=o,e._isNumberValue=t,e.coerceArray=c,e.coerceCssPixelValue=u,e.coerceElement=i,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
9
9
|
//# sourceMappingURL=cdk-coercion.umd.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdk-coercion.umd.min.js","sources":["../../src/cdk/coercion/boolean-property.ts","../../src/cdk/coercion/number-property.ts","../../src/cdk/coercion/array.ts","../../src/cdk/coercion/css-pixel-value.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 data-bound value (typically a string) to a boolean. */\nexport function coerceBooleanProperty(value: any): boolean {\n return value != null && `${value}` !== 'false';\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/** 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 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"],"names":["coerceBooleanProperty","value","coerceNumberProperty","fallbackValue","_isNumberValue","Number","isNaN","parseFloat","coerceArray","Array","isArray","coerceCssPixelValue"],"mappings":"
|
|
1
|
+
{"version":3,"file":"cdk-coercion.umd.min.js","sources":["../../src/cdk/coercion/boolean-property.ts","../../src/cdk/coercion/number-property.ts","../../src/cdk/coercion/array.ts","../../src/cdk/coercion/css-pixel-value.ts","../../src/cdk/coercion/element.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 data-bound value (typically a string) to a boolean. */\nexport function coerceBooleanProperty(value: any): boolean {\n return value != null && `${value}` !== 'false';\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/** 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 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\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"],"names":["coerceBooleanProperty","value","coerceNumberProperty","fallbackValue","_isNumberValue","Number","isNaN","parseFloat","coerceArray","Array","isArray","coerceCssPixelValue","coerceElement","elementOrRef","ElementRef","nativeElement"],"mappings":";;;;;;;oTASA,SAAgBA,GAAsBC,GACpC,MAAgB,OAATA,GAAiB,GAAGA,GAAY,QCCzC,QAAgBC,GAAqBD,EAAYE,GAC/C,WADF,KAAAA,IAAiDA,EAAjD,GACSC,EAAeH,GAASI,OAAOJ,GAASE,EAOjD,QAAgBC,GAAeH,GAI7B,OAAQK,MAAMC,WAAU,MAAoBD,MAAMD,OAAOJ,ICd3D,QAAgBO,GAAeP,GAC7B,MAAOQ,OAAMC,QAAQT,GAASA,GAASA,GCDzC,QAAgBU,GAAoBV,GAClC,MAAa,OAATA,EACK,GAGe,gBAAVA,GAAqBA,EAAWA,EAAhD,KCAA,QAAgBW,GAAiBC,GAC/B,MAAOA,aAAwBC,GAAAA,WAAaD,EAAaE,cAAgBF"}
|
|
@@ -698,13 +698,13 @@ DragRef = /** @class */ (function () {
|
|
|
698
698
|
*/
|
|
699
699
|
this._boundaryElement = null;
|
|
700
700
|
/**
|
|
701
|
-
*
|
|
701
|
+
* Whether the native dragging interactions have been enabled on the root element.
|
|
702
702
|
*/
|
|
703
|
-
this.
|
|
703
|
+
this._nativeInteractionsEnabled = true;
|
|
704
704
|
/**
|
|
705
|
-
*
|
|
705
|
+
* Elements that can be used to drag the draggable item.
|
|
706
706
|
*/
|
|
707
|
-
this.
|
|
707
|
+
this._handles = [];
|
|
708
708
|
this._disabled = false;
|
|
709
709
|
/**
|
|
710
710
|
* Emits as the drag sequence is being prepared.
|
|
@@ -892,7 +892,12 @@ DragRef = /** @class */ (function () {
|
|
|
892
892
|
* @return {?}
|
|
893
893
|
*/
|
|
894
894
|
function (value) {
|
|
895
|
-
|
|
895
|
+
/** @type {?} */
|
|
896
|
+
var newValue = coercion.coerceBooleanProperty(value);
|
|
897
|
+
if (newValue !== this._disabled) {
|
|
898
|
+
this._disabled = newValue;
|
|
899
|
+
this._toggleNativeDragInteractions();
|
|
900
|
+
}
|
|
896
901
|
},
|
|
897
902
|
enumerable: true,
|
|
898
903
|
configurable: true
|
|
@@ -1660,10 +1665,11 @@ DragRef = /** @class */ (function () {
|
|
|
1660
1665
|
* @return {?}
|
|
1661
1666
|
*/
|
|
1662
1667
|
function () {
|
|
1668
|
+
if (!this._rootElement || !this._handles) {
|
|
1669
|
+
return;
|
|
1670
|
+
}
|
|
1663
1671
|
/** @type {?} */
|
|
1664
|
-
var shouldEnable = this._handles.length > 0;
|
|
1665
|
-
// We go through the trouble of keeping track of whether the interactions are enabled,
|
|
1666
|
-
// because we want to avoid triggering style recalculations unless we really have to.
|
|
1672
|
+
var shouldEnable = this.disabled || this._handles.length > 0;
|
|
1667
1673
|
if (shouldEnable !== this._nativeInteractionsEnabled) {
|
|
1668
1674
|
this._nativeInteractionsEnabled = shouldEnable;
|
|
1669
1675
|
toggleNativeDragInteractions(this._rootElement, shouldEnable);
|
|
@@ -1850,6 +1856,7 @@ var CdkDrag = /** @class */ (function () {
|
|
|
1850
1856
|
*/
|
|
1851
1857
|
function (value) {
|
|
1852
1858
|
this._disabled = coercion.coerceBooleanProperty(value);
|
|
1859
|
+
this._dragRef.disabled = this._disabled;
|
|
1853
1860
|
},
|
|
1854
1861
|
enumerable: true,
|
|
1855
1862
|
configurable: true
|
|
@@ -1910,13 +1917,7 @@ var CdkDrag = /** @class */ (function () {
|
|
|
1910
1917
|
this._rootElementInitSubscription = this._ngZone.onStable.asObservable()
|
|
1911
1918
|
.pipe(operators.take(1))
|
|
1912
1919
|
.subscribe(function () {
|
|
1913
|
-
|
|
1914
|
-
var rootElement = _this._getRootElement();
|
|
1915
|
-
if (rootElement.nodeType !== _this._document.ELEMENT_NODE) {
|
|
1916
|
-
throw Error("cdkDrag must be attached to an element node. " +
|
|
1917
|
-
("Currently attached to \"" + rootElement.nodeName + "\"."));
|
|
1918
|
-
}
|
|
1919
|
-
_this._dragRef.withRootElement(rootElement);
|
|
1920
|
+
_this._updateRootElement();
|
|
1920
1921
|
_this._handles.changes
|
|
1921
1922
|
.pipe(operators.startWith(_this._handles))
|
|
1922
1923
|
.subscribe(function (handleList) {
|
|
@@ -1924,6 +1925,23 @@ var CdkDrag = /** @class */ (function () {
|
|
|
1924
1925
|
});
|
|
1925
1926
|
});
|
|
1926
1927
|
};
|
|
1928
|
+
/**
|
|
1929
|
+
* @param {?} changes
|
|
1930
|
+
* @return {?}
|
|
1931
|
+
*/
|
|
1932
|
+
CdkDrag.prototype.ngOnChanges = /**
|
|
1933
|
+
* @param {?} changes
|
|
1934
|
+
* @return {?}
|
|
1935
|
+
*/
|
|
1936
|
+
function (changes) {
|
|
1937
|
+
/** @type {?} */
|
|
1938
|
+
var rootSelectorChange = changes.rootElementSelector;
|
|
1939
|
+
// We don't have to react to the first change since it's being
|
|
1940
|
+
// handled in `ngAfterViewInit` where it needs to be deferred.
|
|
1941
|
+
if (rootSelectorChange && !rootSelectorChange.firstChange) {
|
|
1942
|
+
this._updateRootElement();
|
|
1943
|
+
}
|
|
1944
|
+
};
|
|
1927
1945
|
/**
|
|
1928
1946
|
* @return {?}
|
|
1929
1947
|
*/
|
|
@@ -1934,14 +1952,14 @@ var CdkDrag = /** @class */ (function () {
|
|
|
1934
1952
|
this._rootElementInitSubscription.unsubscribe();
|
|
1935
1953
|
this._dragRef.dispose();
|
|
1936
1954
|
};
|
|
1937
|
-
/**
|
|
1955
|
+
/** Syncs the root element with the `DragRef`. */
|
|
1938
1956
|
/**
|
|
1939
|
-
*
|
|
1957
|
+
* Syncs the root element with the `DragRef`.
|
|
1940
1958
|
* @private
|
|
1941
1959
|
* @return {?}
|
|
1942
1960
|
*/
|
|
1943
|
-
CdkDrag.prototype.
|
|
1944
|
-
*
|
|
1961
|
+
CdkDrag.prototype._updateRootElement = /**
|
|
1962
|
+
* Syncs the root element with the `DragRef`.
|
|
1945
1963
|
* @private
|
|
1946
1964
|
* @return {?}
|
|
1947
1965
|
*/
|
|
@@ -1950,8 +1968,12 @@ var CdkDrag = /** @class */ (function () {
|
|
|
1950
1968
|
var element = this.element.nativeElement;
|
|
1951
1969
|
/** @type {?} */
|
|
1952
1970
|
var rootElement = this.rootElementSelector ?
|
|
1953
|
-
getClosestMatchingAncestor(element, this.rootElementSelector) :
|
|
1954
|
-
|
|
1971
|
+
getClosestMatchingAncestor(element, this.rootElementSelector) : element;
|
|
1972
|
+
if (rootElement && rootElement.nodeType !== this._document.ELEMENT_NODE) {
|
|
1973
|
+
throw Error("cdkDrag must be attached to an element node. " +
|
|
1974
|
+
("Currently attached to \"" + rootElement.nodeName + "\"."));
|
|
1975
|
+
}
|
|
1976
|
+
this._dragRef.withRootElement(rootElement || element);
|
|
1955
1977
|
};
|
|
1956
1978
|
/** Gets the boundary element, based on the `boundaryElementSelector`. */
|
|
1957
1979
|
/**
|