@angular/cdk 7.1.1 → 7.2.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.
Files changed (122) hide show
  1. package/bundles/cdk-a11y.umd.js +5 -1
  2. package/bundles/cdk-a11y.umd.js.map +1 -1
  3. package/bundles/cdk-a11y.umd.min.js +1 -1
  4. package/bundles/cdk-a11y.umd.min.js.map +1 -1
  5. package/bundles/cdk-drag-drop.umd.js +2030 -1049
  6. package/bundles/cdk-drag-drop.umd.js.map +1 -1
  7. package/bundles/cdk-drag-drop.umd.min.js +2 -1
  8. package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
  9. package/bundles/cdk-stepper.umd.js +11 -3
  10. package/bundles/cdk-stepper.umd.js.map +1 -1
  11. package/bundles/cdk-stepper.umd.min.js +1 -1
  12. package/bundles/cdk-stepper.umd.min.js.map +1 -1
  13. package/bundles/cdk-text-field.umd.js +41 -16
  14. package/bundles/cdk-text-field.umd.js.map +1 -1
  15. package/bundles/cdk-text-field.umd.min.js +1 -1
  16. package/bundles/cdk-text-field.umd.min.js.map +1 -1
  17. package/bundles/cdk-tree.umd.js +1 -1
  18. package/bundles/cdk-tree.umd.js.map +1 -1
  19. package/bundles/cdk-tree.umd.min.js +1 -1
  20. package/bundles/cdk-tree.umd.min.js.map +1 -1
  21. package/bundles/cdk.umd.js +1 -1
  22. package/bundles/cdk.umd.js.map +1 -1
  23. package/bundles/cdk.umd.min.js +1 -1
  24. package/bundles/cdk.umd.min.js.map +1 -1
  25. package/drag-drop/typings/{drag-handle.d.ts → directives/drag-handle.d.ts} +0 -0
  26. package/drag-drop/typings/{drag-placeholder.d.ts → directives/drag-placeholder.d.ts} +0 -0
  27. package/drag-drop/typings/{drag-preview.d.ts → directives/drag-preview.d.ts} +0 -0
  28. package/drag-drop/typings/directives/drag.d.ts +108 -0
  29. package/{typings/esm5/drag-drop → drag-drop/typings/directives}/drop-list-group.d.ts +3 -0
  30. package/drag-drop/typings/directives/drop-list.d.ts +135 -0
  31. package/drag-drop/typings/drag-drop-registry.d.ts +8 -3
  32. package/drag-drop/typings/drag-events.d.ts +14 -7
  33. package/{typings/esm5/drag-drop/drag.d.ts → drag-drop/typings/drag-ref.d.ts} +143 -82
  34. package/drag-drop/typings/drop-list-container.d.ts +19 -3
  35. package/drag-drop/typings/{drop-list.d.ts → drop-list-ref.d.ts} +132 -84
  36. package/drag-drop/typings/index.d.ts +1 -0
  37. package/drag-drop/typings/index.metadata.json +1 -1
  38. package/drag-drop/typings/public-api.d.ts +13 -6
  39. package/esm2015/a11y.js +5 -1
  40. package/esm2015/a11y.js.map +1 -1
  41. package/esm2015/cdk.js +1 -1
  42. package/esm2015/cdk.js.map +1 -1
  43. package/esm2015/drag-drop.js +1546 -811
  44. package/esm2015/drag-drop.js.map +1 -1
  45. package/esm2015/stepper.js +11 -4
  46. package/esm2015/stepper.js.map +1 -1
  47. package/esm2015/text-field.js +28 -16
  48. package/esm2015/text-field.js.map +1 -1
  49. package/esm2015/tree.js +2 -2
  50. package/esm2015/tree.js.map +1 -1
  51. package/esm5/a11y.es5.js +5 -1
  52. package/esm5/a11y.es5.js.map +1 -1
  53. package/esm5/cdk.es5.js +1 -1
  54. package/esm5/cdk.es5.js.map +1 -1
  55. package/esm5/drag-drop.es5.js +2025 -1045
  56. package/esm5/drag-drop.es5.js.map +1 -1
  57. package/esm5/stepper.es5.js +11 -4
  58. package/esm5/stepper.es5.js.map +1 -1
  59. package/esm5/text-field.es5.js +41 -16
  60. package/esm5/text-field.es5.js.map +1 -1
  61. package/esm5/tree.es5.js +2 -2
  62. package/esm5/tree.es5.js.map +1 -1
  63. package/package.json +4 -4
  64. package/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts +2 -2
  65. package/schematics/ng-update/upgrade-data.js +2 -1
  66. package/schematics/ng-update/upgrade-data.js.map +1 -1
  67. package/schematics/ng-update/upgrade-rules/index.js +3 -2
  68. package/schematics/ng-update/upgrade-rules/index.js.map +1 -1
  69. package/schematics/utils/ast/ng-module-imports.d.ts +1 -1
  70. package/schematics/utils/ast/ng-module-imports.js +25 -13
  71. package/schematics/utils/ast/ng-module-imports.js.map +1 -1
  72. package/schematics/utils/get-project.js +2 -1
  73. package/schematics/utils/get-project.js.map +1 -1
  74. package/schematics/utils/parse5-element.js +3 -2
  75. package/schematics/utils/parse5-element.js.map +1 -1
  76. package/schematics/utils/project-targets.js +2 -1
  77. package/schematics/utils/project-targets.js.map +1 -1
  78. package/schematics/utils/version-agnostic-typescript.js +3 -2
  79. package/schematics/utils/version-agnostic-typescript.js.map +1 -1
  80. package/stepper/typings/index.metadata.json +1 -1
  81. package/stepper/typings/stepper.d.ts +6 -0
  82. package/text-field/typings/autosize.d.ts +6 -0
  83. package/text-field/typings/index.metadata.json +1 -1
  84. package/typings/drag-drop/{drag-handle.d.ts → directives/drag-handle.d.ts} +0 -0
  85. package/typings/drag-drop/{drag-placeholder.d.ts → directives/drag-placeholder.d.ts} +0 -0
  86. package/typings/drag-drop/{drag-preview.d.ts → directives/drag-preview.d.ts} +0 -0
  87. package/typings/drag-drop/directives/drag.d.ts +108 -0
  88. package/typings/drag-drop/{drop-list-group.d.ts → directives/drop-list-group.d.ts} +3 -0
  89. package/typings/drag-drop/directives/drop-list.d.ts +135 -0
  90. package/typings/drag-drop/drag-drop-registry.d.ts +8 -3
  91. package/typings/drag-drop/drag-events.d.ts +14 -7
  92. package/typings/drag-drop/{drag.d.ts → drag-ref.d.ts} +143 -82
  93. package/typings/drag-drop/drop-list-container.d.ts +19 -3
  94. package/typings/{esm5/drag-drop/drop-list.d.ts → drag-drop/drop-list-ref.d.ts} +132 -84
  95. package/typings/drag-drop/index.d.ts +1 -0
  96. package/typings/drag-drop/index.metadata.json +1 -1
  97. package/typings/drag-drop/public-api.d.ts +13 -6
  98. package/typings/esm5/drag-drop/{drag-handle.d.ts → directives/drag-handle.d.ts} +0 -0
  99. package/typings/esm5/drag-drop/{drag-placeholder.d.ts → directives/drag-placeholder.d.ts} +0 -0
  100. package/typings/esm5/drag-drop/{drag-preview.d.ts → directives/drag-preview.d.ts} +0 -0
  101. package/typings/esm5/drag-drop/directives/drag.d.ts +108 -0
  102. package/{drag-drop/typings → typings/esm5/drag-drop/directives}/drop-list-group.d.ts +3 -0
  103. package/typings/esm5/drag-drop/directives/drop-list.d.ts +135 -0
  104. package/typings/esm5/drag-drop/drag-drop-registry.d.ts +8 -3
  105. package/typings/esm5/drag-drop/drag-events.d.ts +14 -7
  106. package/{drag-drop/typings/drag.d.ts → typings/esm5/drag-drop/drag-ref.d.ts} +143 -82
  107. package/typings/esm5/drag-drop/drop-list-container.d.ts +19 -3
  108. package/typings/{drag-drop/drop-list.d.ts → esm5/drag-drop/drop-list-ref.d.ts} +132 -84
  109. package/typings/esm5/drag-drop/index.d.ts +1 -0
  110. package/typings/esm5/drag-drop/index.metadata.json +1 -1
  111. package/typings/esm5/drag-drop/public-api.d.ts +13 -6
  112. package/typings/esm5/index.metadata.json +1 -1
  113. package/typings/esm5/stepper/index.metadata.json +1 -1
  114. package/typings/esm5/stepper/stepper.d.ts +6 -0
  115. package/typings/esm5/text-field/autosize.d.ts +6 -0
  116. package/typings/esm5/text-field/index.metadata.json +1 -1
  117. package/typings/index.metadata.json +1 -1
  118. package/typings/schematics/utils/ast/ng-module-imports.d.ts +1 -1
  119. package/typings/stepper/index.metadata.json +1 -1
  120. package/typings/stepper/stepper.d.ts +6 -0
  121. package/typings/text-field/autosize.d.ts +6 -0
  122. package/typings/text-field/index.metadata.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"cdk-tree.umd.min.js","sources":["../../node_modules/tslib/tslib.es6.js","../../src/cdk/tree/tree-errors.ts","../../src/cdk/tree/control/base-tree-control.ts","../../src/cdk/tree/control/flat-tree-control.ts","../../src/cdk/tree/control/nested-tree-control.ts","../../src/cdk/tree/node.ts","../../src/cdk/tree/outlet.ts","../../src/cdk/tree/tree.ts","../../src/cdk/tree/nested-node.ts","../../src/cdk/tree/padding.ts","../../src/cdk/tree/toggle.ts","../../src/cdk/tree/tree-module.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\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/**\n * Returns an error to be thrown when there is no usable data.\n * @docs-private\n */\nexport function getTreeNoValidDataSourceError() {\n return Error(`A valid data source must be provided.`);\n}\n\n/**\n * Returns an error to be thrown when there are multiple nodes that are missing a when function.\n * @docs-private\n */\nexport function getTreeMultipleDefaultNodeDefsError() {\n return Error(`There can only be one default row without a when predicate function.`);\n}\n\n/**\n * Returns an error to be thrown when there are no matching node defs for a particular set of data.\n * @docs-private\n */\nexport function getTreeMissingMatchingNodeDefError() {\n return Error(`Could not find a matching node definition for the provided node data.`);\n}\n\n/**\n * Returns an error to be thrown when there are tree control.\n * @docs-private\n */\nexport function getTreeControlMissingError() {\n return Error(`Could not find a tree control for the tree.`);\n}\n\n/**\n * Returns an error to be thrown when tree control did not implement functions for flat/nested node.\n * @docs-private\n */\nexport function getTreeControlFunctionsMissingError() {\n return Error(`Could not find functions for nested/flat tree in tree control.`);\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 */\nimport {SelectionModel} from '@angular/cdk/collections';\nimport {Observable} from 'rxjs';\nimport {TreeControl} from './tree-control';\n\n/** Base tree control. It has basic toggle/expand/collapse operations on a single data node. */\nexport abstract class BaseTreeControl<T> implements TreeControl<T> {\n\n /** Gets a list of descendent data nodes of a subtree rooted at given data node recursively. */\n abstract getDescendants(dataNode: T): T[];\n\n /** Expands all data nodes in the tree. */\n abstract expandAll(): void;\n\n /** Saved data node for `expandAll` action. */\n dataNodes: T[];\n\n /** A selection model with multi-selection to track expansion status. */\n expansionModel: SelectionModel<T> = new SelectionModel<T>(true);\n\n /** Get depth of a given data node, return the level number. This is for flat tree node. */\n getLevel: (dataNode: T) => number;\n\n /**\n * Whether the data node is expandable. Returns true if expandable.\n * This is for flat tree node.\n */\n isExpandable: (dataNode: T) => boolean;\n\n /** Gets a stream that emits whenever the given data node's children change. */\n getChildren: (dataNode: T) => (Observable<T[]> | T[]);\n\n /** Toggles one single data node's expanded/collapsed state. */\n toggle(dataNode: T): void {\n this.expansionModel.toggle(dataNode);\n }\n\n /** Expands one single data node. */\n expand(dataNode: T): void {\n this.expansionModel.select(dataNode);\n }\n\n /** Collapses one single data node. */\n collapse(dataNode: T): void {\n this.expansionModel.deselect(dataNode);\n }\n\n /** Whether a given data node is expanded or not. Returns true if the data node is expanded. */\n isExpanded(dataNode: T): boolean {\n return this.expansionModel.isSelected(dataNode);\n }\n\n /** Toggles a subtree rooted at `node` recursively. */\n toggleDescendants(dataNode: T): void {\n this.expansionModel.isSelected(dataNode)\n ? this.collapseDescendants(dataNode)\n : this.expandDescendants(dataNode);\n }\n\n /** Collapse all dataNodes in the tree. */\n collapseAll(): void {\n this.expansionModel.clear();\n }\n\n /** Expands a subtree rooted at given data node recursively. */\n expandDescendants(dataNode: T): void {\n let toBeProcessed = [dataNode];\n toBeProcessed.push(...this.getDescendants(dataNode));\n this.expansionModel.select(...toBeProcessed);\n }\n\n /** Collapses a subtree rooted at given data node recursively. */\n collapseDescendants(dataNode: T): void {\n let toBeProcessed = [dataNode];\n toBeProcessed.push(...this.getDescendants(dataNode));\n this.expansionModel.deselect(...toBeProcessed);\n }\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 {BaseTreeControl} from './base-tree-control';\n\n/** Flat tree control. Able to expand/collapse a subtree recursively for flattened tree. */\nexport class FlatTreeControl<T> extends BaseTreeControl<T> {\n\n /** Construct with flat tree data node functions getLevel and isExpandable. */\n constructor(public getLevel: (dataNode: T) => number,\n public isExpandable: (dataNode: T) => boolean) {\n super();\n }\n\n /**\n * Gets a list of the data node's subtree of descendent data nodes.\n *\n * To make this working, the `dataNodes` of the TreeControl must be flattened tree nodes\n * with correct levels.\n */\n getDescendants(dataNode: T): T[] {\n const startIndex = this.dataNodes.indexOf(dataNode);\n const results: T[] = [];\n\n // Goes through flattened tree nodes in the `dataNodes` array, and get all descendants.\n // The level of descendants of a tree node must be greater than the level of the given\n // tree node.\n // If we reach a node whose level is equal to the level of the tree node, we hit a sibling.\n // If we reach a node whose level is greater than the level of the tree node, we hit a\n // sibling of an ancestor.\n for (let i = startIndex + 1;\n i < this.dataNodes.length && this.getLevel(dataNode) < this.getLevel(this.dataNodes[i]);\n i++) {\n results.push(this.dataNodes[i]);\n }\n return results;\n }\n\n /**\n * Expands all data nodes in the tree.\n *\n * To make this working, the `dataNodes` variable of the TreeControl must be set to all flattened\n * data nodes of the tree.\n */\n expandAll(): void {\n this.expansionModel.select(...this.dataNodes);\n }\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 */\nimport {Observable} from 'rxjs';\nimport {take} from 'rxjs/operators';\nimport {BaseTreeControl} from './base-tree-control';\n\n/** Nested tree control. Able to expand/collapse a subtree recursively for NestedNode type. */\nexport class NestedTreeControl<T> extends BaseTreeControl<T> {\n\n /** Construct with nested tree function getChildren. */\n constructor(public getChildren: (dataNode: T) => (Observable<T[]> | T[])) {\n super();\n }\n\n /**\n * Expands all dataNodes in the tree.\n *\n * To make this working, the `dataNodes` variable of the TreeControl must be set to all root level\n * data nodes of the tree.\n */\n expandAll(): void {\n this.expansionModel.clear();\n const allNodes = this.dataNodes.reduce((accumulator: T[], dataNode) =>\n [...accumulator, ...this.getDescendants(dataNode), dataNode], []);\n this.expansionModel.select(...allNodes);\n }\n\n /** Gets a list of descendant dataNodes of a subtree rooted at given data node recursively. */\n getDescendants(dataNode: T): T[] {\n const descendants: T[] = [];\n\n this._getDescendants(descendants, dataNode);\n // Remove the node itself\n return descendants.splice(1);\n }\n\n /** A helper function to get descendants recursively. */\n protected _getDescendants(descendants: T[], dataNode: T): void {\n descendants.push(dataNode);\n const childrenNodes = this.getChildren(dataNode);\n if (Array.isArray(childrenNodes)) {\n childrenNodes.forEach((child: T) => this._getDescendants(descendants, child));\n } else if (childrenNodes instanceof Observable) {\n childrenNodes.pipe(take(1)).subscribe(children => {\n children.forEach((child: T) => this._getDescendants(descendants, child));\n });\n }\n }\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 {Directive, TemplateRef} from '@angular/core';\n\n\n/** Context provided to the tree node component. */\nexport class CdkTreeNodeOutletContext<T> {\n /** Data for the node. */\n $implicit: T;\n\n /** Depth of the node. */\n level: number;\n\n /** Index location of the node. */\n index?: number;\n\n /** Length of the number of total dataNodes. */\n count?: number;\n\n constructor(data: T) {\n this.$implicit = data;\n }\n}\n\n/**\n * Data node definition for the CdkTree.\n * Captures the node's template and a when predicate that describes when this node should be used.\n */\n@Directive({\n selector: '[cdkTreeNodeDef]',\n inputs: [\n 'when: cdkTreeNodeDefWhen'\n ],\n})\nexport class CdkTreeNodeDef<T> {\n /**\n * Function that should return true if this node template should be used for the provided node\n * data and index. If left undefined, this node will be considered the default node template to\n * use when no other when functions return true for the data.\n * For every node, there must be at least one when function that passes or an undefined to\n * default.\n */\n when: (index: number, nodeData: T) => boolean;\n\n /** @docs-private */\n constructor(public template: TemplateRef<any>) {}\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 */\nimport {\n Directive,\n ViewContainerRef,\n} from '@angular/core';\n\n/**\n * Outlet for nested CdkNode. Put `[cdkTreeNodeOutlet]` on a tag to place children dataNodes\n * inside the outlet.\n */\n@Directive({\n selector: '[cdkTreeNodeOutlet]'\n})\nexport class CdkTreeNodeOutlet {\n constructor(public viewContainer: ViewContainerRef) {}\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 */\nimport {FocusableOption} from '@angular/cdk/a11y';\nimport {CollectionViewer, DataSource} from '@angular/cdk/collections';\nimport {\n AfterContentChecked,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n Directive,\n ElementRef,\n Input,\n IterableChangeRecord,\n IterableDiffer,\n IterableDiffers,\n OnDestroy,\n OnInit,\n QueryList,\n ViewChild,\n ViewContainerRef,\n ViewEncapsulation,\n TrackByFunction\n} from '@angular/core';\nimport {BehaviorSubject, Observable, of as observableOf, Subject, Subscription} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\nimport {TreeControl} from './control/tree-control';\nimport {CdkTreeNodeDef, CdkTreeNodeOutletContext} from './node';\nimport {CdkTreeNodeOutlet} from './outlet';\nimport {\n getTreeControlFunctionsMissingError,\n getTreeControlMissingError,\n getTreeMissingMatchingNodeDefError,\n getTreeMultipleDefaultNodeDefsError,\n getTreeNoValidDataSourceError\n} from './tree-errors';\n\n/**\n * CDK tree component that connects with a data source to retrieve data of type `T` and renders\n * dataNodes with hierarchy. Updates the dataNodes when new data is provided by the data source.\n */\n@Component({\n moduleId: module.id,\n selector: 'cdk-tree',\n exportAs: 'cdkTree',\n template: `<ng-container cdkTreeNodeOutlet></ng-container>`,\n host: {\n 'class': 'cdk-tree',\n 'role': 'tree',\n },\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class CdkTree<T>\n implements AfterContentChecked, CollectionViewer, OnDestroy, OnInit {\n /** Subject that emits when the component has been destroyed. */\n private _onDestroy = new Subject<void>();\n\n /** Differ used to find the changes in the data provided by the data source. */\n private _dataDiffer: IterableDiffer<T>;\n\n /** Stores the node definition that does not have a when predicate. */\n private _defaultNodeDef: CdkTreeNodeDef<T> | null;\n\n /** Data subscription */\n private _dataSubscription: Subscription | null;\n\n /** Level of nodes */\n private _levels: Map<T, number> = new Map<T, number>();\n\n /**\n * Provides a stream containing the latest data array to render. Influenced by the tree's\n * stream of view window (what dataNodes are currently on screen).\n * Data source can be an observable of data array, or a data array to render.\n */\n @Input()\n get dataSource(): DataSource<T> | Observable<T[]> | T[] { return this._dataSource; }\n set dataSource(dataSource: DataSource<T> | Observable<T[]> | T[]) {\n if (this._dataSource !== dataSource) {\n this._switchDataSource(dataSource);\n }\n }\n private _dataSource: DataSource<T> | Observable<T[]> | T[];\n\n /** The tree controller */\n @Input() treeControl: TreeControl<T>;\n\n /**\n * Tracking function that will be used to check the differences in data changes. Used similarly\n * to `ngFor` `trackBy` function. Optimize node operations by identifying a node based on its data\n * relative to the function to know if a node should be added/removed/moved.\n * Accepts a function that takes two parameters, `index` and `item`.\n */\n @Input() trackBy: TrackByFunction<T>;\n\n // Outlets within the tree's template where the dataNodes will be inserted.\n @ViewChild(CdkTreeNodeOutlet) _nodeOutlet: CdkTreeNodeOutlet;\n\n /** The tree node template for the tree */\n @ContentChildren(CdkTreeNodeDef) _nodeDefs: QueryList<CdkTreeNodeDef<T>>;\n\n // TODO(tinayuangao): Setup a listener for scrolling, emit the calculated view to viewChange.\n // Remove the MAX_VALUE in viewChange\n /**\n * Stream containing the latest information on what rows are being displayed on screen.\n * Can be used by the data source to as a heuristic of what data should be provided.\n */\n viewChange =\n new BehaviorSubject<{start: number, end: number}>({start: 0, end: Number.MAX_VALUE});\n\n constructor(private _differs: IterableDiffers,\n private _changeDetectorRef: ChangeDetectorRef) {}\n\n ngOnInit() {\n this._dataDiffer = this._differs.find([]).create(this.trackBy);\n if (!this.treeControl) {\n throw getTreeControlMissingError();\n }\n }\n\n ngOnDestroy() {\n this._nodeOutlet.viewContainer.clear();\n\n this._onDestroy.next();\n this._onDestroy.complete();\n\n if (this._dataSource && typeof (this._dataSource as DataSource<T>).disconnect === 'function') {\n (this.dataSource as DataSource<T>).disconnect(this);\n }\n\n if (this._dataSubscription) {\n this._dataSubscription.unsubscribe();\n this._dataSubscription = null;\n }\n }\n\n ngAfterContentChecked() {\n const defaultNodeDefs = this._nodeDefs.filter(def => !def.when);\n if (defaultNodeDefs.length > 1) {\n throw getTreeMultipleDefaultNodeDefsError();\n }\n this._defaultNodeDef = defaultNodeDefs[0];\n\n if (this.dataSource && this._nodeDefs && !this._dataSubscription) {\n this._observeRenderChanges();\n }\n }\n\n\n // TODO(tinayuangao): Work on keyboard traversal and actions, make sure it's working for RTL\n // and nested trees.\n\n /**\n * Switch to the provided data source by resetting the data and unsubscribing from the current\n * render change subscription if one exists. If the data source is null, interpret this by\n * clearing the node outlet. Otherwise start listening for new data.\n */\n private _switchDataSource(dataSource: DataSource<T> | Observable<T[]> | T[]) {\n if (this._dataSource && typeof (this._dataSource as DataSource<T>).disconnect === 'function') {\n (this.dataSource as DataSource<T>).disconnect(this);\n }\n\n if (this._dataSubscription) {\n this._dataSubscription.unsubscribe();\n this._dataSubscription = null;\n }\n\n // Remove the all dataNodes if there is now no data source\n if (!dataSource) {\n this._nodeOutlet.viewContainer.clear();\n }\n\n this._dataSource = dataSource;\n if (this._nodeDefs) {\n this._observeRenderChanges();\n }\n }\n\n /** Set up a subscription for the data provided by the data source. */\n private _observeRenderChanges() {\n let dataStream: Observable<T[] | ReadonlyArray<T>> | undefined;\n\n // Cannot use `instanceof DataSource` since the data source could be a literal with\n // `connect` function and may not extends DataSource.\n if (typeof (this._dataSource as DataSource<T>).connect === 'function') {\n dataStream = (this._dataSource as DataSource<T>).connect(this);\n } else if (this._dataSource instanceof Observable) {\n dataStream = this._dataSource;\n } else if (Array.isArray(this._dataSource)) {\n dataStream = observableOf(this._dataSource);\n }\n\n if (dataStream) {\n this._dataSubscription = dataStream.pipe(takeUntil(this._onDestroy))\n .subscribe(data => this.renderNodeChanges(data));\n } else {\n throw getTreeNoValidDataSourceError();\n }\n }\n\n /** Check for changes made in the data and render each change (node added/removed/moved). */\n renderNodeChanges(data: T[] | ReadonlyArray<T>, dataDiffer: IterableDiffer<T> = this._dataDiffer,\n viewContainer: ViewContainerRef = this._nodeOutlet.viewContainer,\n parentData?: T) {\n const changes = dataDiffer.diff(data);\n if (!changes) { return; }\n\n changes.forEachOperation((item: IterableChangeRecord<T>,\n adjustedPreviousIndex: number | null,\n currentIndex: number | null) => {\n if (item.previousIndex == null) {\n this.insertNode(data[currentIndex!], currentIndex!, viewContainer, parentData);\n } else if (currentIndex == null) {\n viewContainer.remove(adjustedPreviousIndex!);\n this._levels.delete(item.item);\n } else {\n const view = viewContainer.get(adjustedPreviousIndex!);\n viewContainer.move(view!, currentIndex);\n }\n });\n\n this._changeDetectorRef.detectChanges();\n }\n\n /**\n * Finds the matching node definition that should be used for this node data. If there is only\n * one node definition, it is returned. Otherwise, find the node definition that has a when\n * predicate that returns true with the data. If none return true, return the default node\n * definition.\n */\n _getNodeDef(data: T, i: number): CdkTreeNodeDef<T> {\n if (this._nodeDefs.length === 1) { return this._nodeDefs.first; }\n\n const nodeDef =\n this._nodeDefs.find(def => def.when && def.when(i, data)) || this._defaultNodeDef;\n if (!nodeDef) { throw getTreeMissingMatchingNodeDefError(); }\n\n return nodeDef;\n }\n\n /**\n * Create the embedded view for the data node template and place it in the correct index location\n * within the data node view container.\n */\n insertNode(nodeData: T, index: number, viewContainer?: ViewContainerRef, parentData?: T) {\n const node = this._getNodeDef(nodeData, index);\n\n // Node context that will be provided to created embedded view\n const context = new CdkTreeNodeOutletContext<T>(nodeData);\n\n // If the tree is flat tree, then use the `getLevel` function in flat tree control\n // Otherwise, use the level of parent node.\n if (this.treeControl.getLevel) {\n context.level = this.treeControl.getLevel(nodeData);\n } else if (typeof parentData !== 'undefined' && this._levels.has(parentData)) {\n context.level = this._levels.get(parentData)! + 1;\n } else {\n context.level = 0;\n }\n this._levels.set(nodeData, context.level);\n\n // Use default tree nodeOutlet, or nested node's nodeOutlet\n const container = viewContainer ? viewContainer : this._nodeOutlet.viewContainer;\n container.createEmbeddedView(node.template, context, index);\n\n // Set the data to just created `CdkTreeNode`.\n // The `CdkTreeNode` created from `createEmbeddedView` will be saved in static variable\n // `mostRecentTreeNode`. We get it from static variable and pass the node data to it.\n if (CdkTreeNode.mostRecentTreeNode) {\n CdkTreeNode.mostRecentTreeNode.data = nodeData;\n }\n }\n}\n\n\n/**\n * Tree node for CdkTree. It contains the data in the tree node.\n */\n@Directive({\n selector: 'cdk-tree-node',\n exportAs: 'cdkTreeNode',\n host: {\n '[attr.aria-expanded]': 'isExpanded',\n '[attr.aria-level]': 'role === \"treeitem\" ? level : null',\n '[attr.role]': 'role',\n 'class': 'cdk-tree-node',\n },\n})\nexport class CdkTreeNode<T> implements FocusableOption, OnDestroy {\n /**\n * The most recently created `CdkTreeNode`. We save it in static variable so we can retrieve it\n * in `CdkTree` and set the data to it.\n */\n static mostRecentTreeNode: CdkTreeNode<any> | null = null;\n\n /** Subject that emits when the component has been destroyed. */\n protected _destroyed = new Subject<void>();\n\n /** The tree node's data. */\n get data(): T { return this._data; }\n set data(value: T) {\n this._data = value;\n this._setRoleFromData();\n }\n protected _data: T;\n\n get isExpanded(): boolean {\n return this._tree.treeControl.isExpanded(this._data);\n }\n\n get level(): number {\n return this._tree.treeControl.getLevel ? this._tree.treeControl.getLevel(this._data) : 0;\n }\n\n /**\n * The role of the node should be 'group' if it's an internal node,\n * and 'treeitem' if it's a leaf node.\n */\n @Input() role: 'treeitem' | 'group' = 'treeitem';\n\n constructor(protected _elementRef: ElementRef<HTMLElement>,\n protected _tree: CdkTree<T>) {\n CdkTreeNode.mostRecentTreeNode = this as CdkTreeNode<T>;\n }\n\n ngOnDestroy() {\n // If this is the last tree node being destroyed,\n // clear out the reference to avoid leaking memory.\n if (CdkTreeNode.mostRecentTreeNode === this) {\n CdkTreeNode.mostRecentTreeNode = null;\n }\n\n this._destroyed.next();\n this._destroyed.complete();\n }\n\n /** Focuses the menu item. Implements for FocusableOption. */\n focus(): void {\n this._elementRef.nativeElement.focus();\n }\n\n protected _setRoleFromData(): void {\n if (this._tree.treeControl.isExpandable) {\n this.role = this._tree.treeControl.isExpandable(this._data) ? 'group' : 'treeitem';\n } else {\n if (!this._tree.treeControl.getChildren) {\n throw getTreeControlFunctionsMissingError();\n }\n const childrenNodes = this._tree.treeControl.getChildren(this._data);\n if (Array.isArray(childrenNodes)) {\n this._setRoleFromChildren(childrenNodes as T[]);\n } else if (childrenNodes instanceof Observable) {\n childrenNodes.pipe(takeUntil(this._destroyed))\n .subscribe(children => this._setRoleFromChildren(children));\n }\n }\n }\n\n protected _setRoleFromChildren(children: T[]) {\n this.role = children && children.length ? 'group' : 'treeitem';\n }\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 */\nimport {\n AfterContentInit,\n ContentChildren,\n Directive,\n ElementRef,\n IterableDiffers,\n IterableDiffer,\n OnDestroy,\n QueryList,\n} from '@angular/core';\nimport {Observable} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\n\nimport {CdkTree, CdkTreeNode} from './tree';\nimport {CdkTreeNodeOutlet} from './outlet';\nimport {getTreeControlFunctionsMissingError} from './tree-errors';\n\n/**\n * Nested node is a child of `<cdk-tree>`. It works with nested tree.\n * By using `cdk-nested-tree-node` component in tree node template, children of the parent node will\n * be added in the `cdkTreeNodeOutlet` in tree node template.\n * For example:\n * ```html\n * <cdk-nested-tree-node>\n * {{node.name}}\n * <ng-template cdkTreeNodeOutlet></ng-template>\n * </cdk-nested-tree-node>\n * ```\n * The children of node will be automatically added to `cdkTreeNodeOutlet`, the result dom will be\n * like this:\n * ```html\n * <cdk-nested-tree-node>\n * {{node.name}}\n * <cdk-nested-tree-node>{{child1.name}}</cdk-nested-tree-node>\n * <cdk-nested-tree-node>{{child2.name}}</cdk-nested-tree-node>\n * </cdk-nested-tree-node>\n * ```\n */\n@Directive({\n selector: 'cdk-nested-tree-node',\n exportAs: 'cdkNestedTreeNode',\n host: {\n '[attr.aria-expanded]': 'isExpanded',\n '[attr.role]': 'role',\n 'class': 'cdk-tree-node cdk-nested-tree-node',\n },\n providers: [{provide: CdkTreeNode, useExisting: CdkNestedTreeNode}]\n})\nexport class CdkNestedTreeNode<T> extends CdkTreeNode<T> implements AfterContentInit, OnDestroy {\n /** Differ used to find the changes in the data provided by the data source. */\n private _dataDiffer: IterableDiffer<T>;\n\n /** The children data dataNodes of current node. They will be placed in `CdkTreeNodeOutlet`. */\n protected _children: T[];\n\n /** The children node placeholder. */\n @ContentChildren(CdkTreeNodeOutlet) nodeOutlet: QueryList<CdkTreeNodeOutlet>;\n\n constructor(protected _elementRef: ElementRef<HTMLElement>,\n protected _tree: CdkTree<T>,\n protected _differs: IterableDiffers) {\n super(_elementRef, _tree);\n }\n\n ngAfterContentInit() {\n this._dataDiffer = this._differs.find([]).create(this._tree.trackBy);\n if (!this._tree.treeControl.getChildren) {\n throw getTreeControlFunctionsMissingError();\n }\n const childrenNodes = this._tree.treeControl.getChildren(this.data);\n if (Array.isArray(childrenNodes)) {\n this.updateChildrenNodes(childrenNodes as T[]);\n } else if (childrenNodes instanceof Observable) {\n childrenNodes.pipe(takeUntil(this._destroyed))\n .subscribe(result => this.updateChildrenNodes(result));\n }\n this.nodeOutlet.changes.pipe(takeUntil(this._destroyed))\n .subscribe(() => this.updateChildrenNodes());\n }\n\n ngOnDestroy() {\n this._clear();\n super.ngOnDestroy();\n }\n\n /** Add children dataNodes to the NodeOutlet */\n protected updateChildrenNodes(children?: T[]): void {\n if (children) {\n this._children = children;\n }\n if (this.nodeOutlet.length && this._children) {\n const viewContainer = this.nodeOutlet.first.viewContainer;\n this._tree.renderNodeChanges(this._children, this._dataDiffer, viewContainer, this._data);\n } else {\n // Reset the data differ if there's no children nodes displayed\n this._dataDiffer.diff([]);\n }\n }\n\n /** Clear the children dataNodes. */\n protected _clear(): void {\n if (this.nodeOutlet && this.nodeOutlet.first) {\n this.nodeOutlet.first.viewContainer.clear();\n this._dataDiffer.diff([]);\n }\n }\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 {Directionality} from '@angular/cdk/bidi';\nimport {coerceNumberProperty} from '@angular/cdk/coercion';\nimport {Directive, ElementRef, Input, OnDestroy, Optional, Renderer2} from '@angular/core';\nimport {takeUntil} from 'rxjs/operators';\nimport {Subject} from 'rxjs';\nimport {CdkTree, CdkTreeNode} from './tree';\n\n/** Regex used to split a string on its CSS units. */\nconst cssUnitPattern = /([A-Za-z%]+)$/;\n\n/**\n * Indent for the children tree dataNodes.\n * This directive will add left-padding to the node to show hierarchy.\n */\n@Directive({\n selector: '[cdkTreeNodePadding]',\n})\nexport class CdkTreeNodePadding<T> implements OnDestroy {\n /** Subject that emits when the component has been destroyed. */\n private _destroyed = new Subject<void>();\n\n /** CSS units used for the indentation value. */\n indentUnits = 'px';\n\n /** The level of depth of the tree node. The padding will be `level * indent` pixels. */\n @Input('cdkTreeNodePadding')\n get level(): number { return this._level; }\n set level(value: number) {\n this._level = coerceNumberProperty(value);\n this._setPadding();\n }\n _level: number;\n\n /**\n * The indent for each level. Can be a number or a CSS string.\n * Default number 40px from material design menu sub-menu spec.\n */\n @Input('cdkTreeNodePaddingIndent')\n get indent(): number | string { return this._indent; }\n set indent(indent: number | string) {\n let value = indent;\n let units = 'px';\n\n if (typeof indent === 'string') {\n const parts = indent.split(cssUnitPattern);\n value = parts[0];\n units = parts[1] || units;\n }\n\n this.indentUnits = units;\n this._indent = coerceNumberProperty(value);\n this._setPadding();\n }\n _indent: number = 40;\n\n constructor(private _treeNode: CdkTreeNode<T>,\n private _tree: CdkTree<T>,\n private _renderer: Renderer2,\n private _element: ElementRef<HTMLElement>,\n @Optional() private _dir: Directionality) {\n this._setPadding();\n if (this._dir) {\n this._dir.change.pipe(takeUntil(this._destroyed)).subscribe(() => this._setPadding());\n }\n }\n\n ngOnDestroy() {\n this._destroyed.next();\n this._destroyed.complete();\n }\n\n /** The padding indent value for the tree node. Returns a string with px numbers if not null. */\n _paddingIndent(): string|null {\n const nodeLevel = (this._treeNode.data && this._tree.treeControl.getLevel)\n ? this._tree.treeControl.getLevel(this._treeNode.data)\n : null;\n const level = this._level || nodeLevel;\n return level ? `${level * this._indent}${this.indentUnits}` : null;\n }\n\n _setPadding() {\n const padding = this._paddingIndent();\n const paddingProp = this._dir && this._dir.value === 'rtl' ? 'paddingRight' : 'paddingLeft';\n\n this._renderer.setStyle(this._element.nativeElement, paddingProp, padding);\n }\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 {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {\n Directive,\n Input,\n} from '@angular/core';\nimport {CdkTree, CdkTreeNode} from './tree';\n\n/**\n * Node toggle to expand/collapse the node.\n */\n@Directive({\n selector: '[cdkTreeNodeToggle]',\n host: {\n '(click)': '_toggle($event)',\n }\n})\nexport class CdkTreeNodeToggle<T> {\n /** Whether expand/collapse the node recursively. */\n @Input('cdkTreeNodeToggleRecursive')\n get recursive(): boolean { return this._recursive; }\n set recursive(value: boolean) { this._recursive = coerceBooleanProperty(value); }\n protected _recursive = false;\n\n constructor(protected _tree: CdkTree<T>,\n protected _treeNode: CdkTreeNode<T>) {}\n\n _toggle(event: Event): void {\n this.recursive\n ? this._tree.treeControl.toggleDescendants(this._treeNode.data)\n : this._tree.treeControl.toggle(this._treeNode.data);\n\n event.stopPropagation();\n }\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 {FocusMonitor} from '@angular/cdk/a11y';\nimport {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {CdkTreeNodeOutlet} from './outlet';\nimport {CdkTreeNodePadding} from './padding';\nimport {CdkTreeNodeToggle} from './toggle';\nimport {CdkTree, CdkTreeNode} from './tree';\nimport {CdkTreeNodeDef} from './node';\nimport {CdkNestedTreeNode} from './nested-node';\n\nconst EXPORTED_DECLARATIONS = [\n CdkNestedTreeNode,\n CdkTreeNodeDef,\n CdkTreeNodePadding,\n CdkTreeNodeToggle,\n CdkTree,\n CdkTreeNode,\n CdkTreeNodeOutlet,\n];\n\n@NgModule({\n imports: [CommonModule],\n exports: EXPORTED_DECLARATIONS,\n declarations: EXPORTED_DECLARATIONS,\n providers: [FocusMonitor, CdkTreeNodeDef]\n})\nexport class CdkTreeModule {}\n"],"names":["__extends","d","b","__","this","constructor","extendStatics","prototype","Object","create","getTreeNoValidDataSourceError","Error","getTreeMultipleDefaultNodeDefsError","getTreeMissingMatchingNodeDefError","getTreeControlMissingError","getTreeControlFunctionsMissingError","setPrototypeOf","__proto__","Array","p","hasOwnProperty","BaseTreeControl","expansionModel","SelectionModel","toggle","dataNode","expand","select","collapse","deselect","isExpanded","isSelected","toggleDescendants","collapseDescendants","expandDescendants","collapseAll","clear","toBeProcessed","push","apply","getDescendants","_a","FlatTreeControl","getLevel","isExpandable","_this","_super","call","tslib_1.__extends","startIndex","dataNodes","indexOf","results","i","length","expandAll","NestedTreeControl","getChildren","allNodes","reduce","accumulator","concat","descendants","_getDescendants","splice","childrenNodes","isArray","forEach","child","Observable","pipe","take","subscribe","children","CdkTreeNodeOutletContext","data","$implicit","CdkTreeNodeDef","template","type","Directive","args","selector","inputs","TemplateRef","CdkTreeNodeOutlet","viewContainer","ViewContainerRef","CdkTree","_differs","_changeDetectorRef","_onDestroy","Subject","_levels","Map","viewChange","BehaviorSubject","start","end","Number","MAX_VALUE","defineProperty","_dataSource","dataSource","_switchDataSource","ngOnInit","_dataDiffer","find","trackBy","treeControl","ngOnDestroy","_nodeOutlet","next","complete","disconnect","_dataSubscription","unsubscribe","ngAfterContentChecked","defaultNodeDefs","_nodeDefs","filter","def","when","_defaultNodeDef","_observeRenderChanges","dataStream","connect","observableOf","takeUntil","renderNodeChanges","dataDiffer","parentData","changes","diff","forEachOperation","item","adjustedPreviousIndex","currentIndex","previousIndex","insertNode","remove","delete","view","get","move","detectChanges","_getNodeDef","first","nodeDef","nodeData","index","node","context","level","has","set","createEmbeddedView","CdkTreeNode","mostRecentTreeNode","Component","exportAs","host","class","role","encapsulation","ViewEncapsulation","None","changeDetection","ChangeDetectionStrategy","OnPush","propDecorators","Input","ViewChild","ContentChildren","_elementRef","_tree","_setRoleFromData","enumerable","configurable","_destroyed","_data","_setRoleFromChildren","[attr.aria-expanded]","[attr.aria-level]","[attr.role]","CdkNestedTreeNode","ngAfterContentInit","updateChildrenNodes","result","nodeOutlet","_clear","_children","providers","provide","useExisting","ElementRef","IterableDiffers","cssUnitPattern","CdkTreeNodePadding","_treeNode","_renderer","_element","_dir","indentUnits","_indent","_setPadding","change","_level","value","coerceNumberProperty","indent","units","parts","split","_paddingIndent","nodeLevel","padding","paddingProp","setStyle","nativeElement","Renderer2","Directionality","decorators","Optional","CdkTreeNodeToggle","_recursive","coerceBooleanProperty","_toggle","event","recursive","stopPropagation","(click)","EXPORTED_DECLARATIONS","CdkTreeModule","NgModule","imports","CommonModule","exports","declarations","FocusMonitor"],"mappings":";;;;;;;0uBAuBA,SAAgBA,GAAUC,EAAGC,GAEzB,QAASC,KAAOC,KAAKC,YAAcJ,EADnCK,EAAcL,EAAGC,GAEjBD,EAAEM,UAAkB,OAANL,EAAaM,OAAOC,OAAOP,IAAMC,EAAGI,UAAYL,EAAEK,UAAW,GA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AKmM,UAAU5H,MAEjDyJ,EAAME,kCArBVvJ,KAACC,EAAAA,UAADC,OACEC,SAAU,sBACV+E,MACEsE,UAAW,2DARfxJ,KAAQS,IAART,KAAiB8E,uBAajBwE,YAAAtJ,KAAG4F,EAAAA,MAAH1F,MAAS,iCAeT+I,KCvBMQ,GACJ/C,EACA5G,EACAyH,EACA0B,EACAxI,EACAqE,EACAxE,GAGFoJ,EAAA,WAAA,QAAAA,MAM4B,sBAN5B1J,KAAC2J,EAAAA,SAADzJ,OACE0J,SAAUC,EAAAA,cACVC,QAASL,EACTM,aAAcN,EACdxC,WAAY+C,EAAAA,aAAclK,OAE5B4J"}
1
+ {"version":3,"file":"cdk-tree.umd.min.js","sources":["../../node_modules/tslib/tslib.es6.js","../../src/cdk/tree/tree-errors.ts","../../src/cdk/tree/control/base-tree-control.ts","../../src/cdk/tree/control/flat-tree-control.ts","../../src/cdk/tree/control/nested-tree-control.ts","../../src/cdk/tree/node.ts","../../src/cdk/tree/outlet.ts","../../src/cdk/tree/tree.ts","../../src/cdk/tree/nested-node.ts","../../src/cdk/tree/padding.ts","../../src/cdk/tree/toggle.ts","../../src/cdk/tree/tree-module.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\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/**\n * Returns an error to be thrown when there is no usable data.\n * @docs-private\n */\nexport function getTreeNoValidDataSourceError() {\n return Error(`A valid data source must be provided.`);\n}\n\n/**\n * Returns an error to be thrown when there are multiple nodes that are missing a when function.\n * @docs-private\n */\nexport function getTreeMultipleDefaultNodeDefsError() {\n return Error(`There can only be one default row without a when predicate function.`);\n}\n\n/**\n * Returns an error to be thrown when there are no matching node defs for a particular set of data.\n * @docs-private\n */\nexport function getTreeMissingMatchingNodeDefError() {\n return Error(`Could not find a matching node definition for the provided node data.`);\n}\n\n/**\n * Returns an error to be thrown when there are tree control.\n * @docs-private\n */\nexport function getTreeControlMissingError() {\n return Error(`Could not find a tree control for the tree.`);\n}\n\n/**\n * Returns an error to be thrown when tree control did not implement functions for flat/nested node.\n * @docs-private\n */\nexport function getTreeControlFunctionsMissingError() {\n return Error(`Could not find functions for nested/flat tree in tree control.`);\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 */\nimport {SelectionModel} from '@angular/cdk/collections';\nimport {Observable} from 'rxjs';\nimport {TreeControl} from './tree-control';\n\n/** Base tree control. It has basic toggle/expand/collapse operations on a single data node. */\nexport abstract class BaseTreeControl<T> implements TreeControl<T> {\n\n /** Gets a list of descendent data nodes of a subtree rooted at given data node recursively. */\n abstract getDescendants(dataNode: T): T[];\n\n /** Expands all data nodes in the tree. */\n abstract expandAll(): void;\n\n /** Saved data node for `expandAll` action. */\n dataNodes: T[];\n\n /** A selection model with multi-selection to track expansion status. */\n expansionModel: SelectionModel<T> = new SelectionModel<T>(true);\n\n /** Get depth of a given data node, return the level number. This is for flat tree node. */\n getLevel: (dataNode: T) => number;\n\n /**\n * Whether the data node is expandable. Returns true if expandable.\n * This is for flat tree node.\n */\n isExpandable: (dataNode: T) => boolean;\n\n /** Gets a stream that emits whenever the given data node's children change. */\n getChildren: (dataNode: T) => (Observable<T[]> | T[]);\n\n /** Toggles one single data node's expanded/collapsed state. */\n toggle(dataNode: T): void {\n this.expansionModel.toggle(dataNode);\n }\n\n /** Expands one single data node. */\n expand(dataNode: T): void {\n this.expansionModel.select(dataNode);\n }\n\n /** Collapses one single data node. */\n collapse(dataNode: T): void {\n this.expansionModel.deselect(dataNode);\n }\n\n /** Whether a given data node is expanded or not. Returns true if the data node is expanded. */\n isExpanded(dataNode: T): boolean {\n return this.expansionModel.isSelected(dataNode);\n }\n\n /** Toggles a subtree rooted at `node` recursively. */\n toggleDescendants(dataNode: T): void {\n this.expansionModel.isSelected(dataNode)\n ? this.collapseDescendants(dataNode)\n : this.expandDescendants(dataNode);\n }\n\n /** Collapse all dataNodes in the tree. */\n collapseAll(): void {\n this.expansionModel.clear();\n }\n\n /** Expands a subtree rooted at given data node recursively. */\n expandDescendants(dataNode: T): void {\n let toBeProcessed = [dataNode];\n toBeProcessed.push(...this.getDescendants(dataNode));\n this.expansionModel.select(...toBeProcessed);\n }\n\n /** Collapses a subtree rooted at given data node recursively. */\n collapseDescendants(dataNode: T): void {\n let toBeProcessed = [dataNode];\n toBeProcessed.push(...this.getDescendants(dataNode));\n this.expansionModel.deselect(...toBeProcessed);\n }\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 {BaseTreeControl} from './base-tree-control';\n\n/** Flat tree control. Able to expand/collapse a subtree recursively for flattened tree. */\nexport class FlatTreeControl<T> extends BaseTreeControl<T> {\n\n /** Construct with flat tree data node functions getLevel and isExpandable. */\n constructor(public getLevel: (dataNode: T) => number,\n public isExpandable: (dataNode: T) => boolean) {\n super();\n }\n\n /**\n * Gets a list of the data node's subtree of descendent data nodes.\n *\n * To make this working, the `dataNodes` of the TreeControl must be flattened tree nodes\n * with correct levels.\n */\n getDescendants(dataNode: T): T[] {\n const startIndex = this.dataNodes.indexOf(dataNode);\n const results: T[] = [];\n\n // Goes through flattened tree nodes in the `dataNodes` array, and get all descendants.\n // The level of descendants of a tree node must be greater than the level of the given\n // tree node.\n // If we reach a node whose level is equal to the level of the tree node, we hit a sibling.\n // If we reach a node whose level is greater than the level of the tree node, we hit a\n // sibling of an ancestor.\n for (let i = startIndex + 1;\n i < this.dataNodes.length && this.getLevel(dataNode) < this.getLevel(this.dataNodes[i]);\n i++) {\n results.push(this.dataNodes[i]);\n }\n return results;\n }\n\n /**\n * Expands all data nodes in the tree.\n *\n * To make this working, the `dataNodes` variable of the TreeControl must be set to all flattened\n * data nodes of the tree.\n */\n expandAll(): void {\n this.expansionModel.select(...this.dataNodes);\n }\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 */\nimport {Observable} from 'rxjs';\nimport {take, filter} from 'rxjs/operators';\nimport {BaseTreeControl} from './base-tree-control';\n\n/** Nested tree control. Able to expand/collapse a subtree recursively for NestedNode type. */\nexport class NestedTreeControl<T> extends BaseTreeControl<T> {\n\n /** Construct with nested tree function getChildren. */\n constructor(public getChildren: (dataNode: T) => (Observable<T[]> | T[])) {\n super();\n }\n\n /**\n * Expands all dataNodes in the tree.\n *\n * To make this working, the `dataNodes` variable of the TreeControl must be set to all root level\n * data nodes of the tree.\n */\n expandAll(): void {\n this.expansionModel.clear();\n const allNodes = this.dataNodes.reduce((accumulator: T[], dataNode) =>\n [...accumulator, ...this.getDescendants(dataNode), dataNode], []);\n this.expansionModel.select(...allNodes);\n }\n\n /** Gets a list of descendant dataNodes of a subtree rooted at given data node recursively. */\n getDescendants(dataNode: T): T[] {\n const descendants: T[] = [];\n\n this._getDescendants(descendants, dataNode);\n // Remove the node itself\n return descendants.splice(1);\n }\n\n /** A helper function to get descendants recursively. */\n protected _getDescendants(descendants: T[], dataNode: T): void {\n descendants.push(dataNode);\n const childrenNodes = this.getChildren(dataNode);\n if (Array.isArray(childrenNodes)) {\n childrenNodes.forEach((child: T) => this._getDescendants(descendants, child));\n } else if (childrenNodes instanceof Observable) {\n childrenNodes.pipe(take(1), filter(Boolean)).subscribe(children => {\n children.forEach((child: T) => this._getDescendants(descendants, child));\n });\n }\n }\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 {Directive, TemplateRef} from '@angular/core';\n\n\n/** Context provided to the tree node component. */\nexport class CdkTreeNodeOutletContext<T> {\n /** Data for the node. */\n $implicit: T;\n\n /** Depth of the node. */\n level: number;\n\n /** Index location of the node. */\n index?: number;\n\n /** Length of the number of total dataNodes. */\n count?: number;\n\n constructor(data: T) {\n this.$implicit = data;\n }\n}\n\n/**\n * Data node definition for the CdkTree.\n * Captures the node's template and a when predicate that describes when this node should be used.\n */\n@Directive({\n selector: '[cdkTreeNodeDef]',\n inputs: [\n 'when: cdkTreeNodeDefWhen'\n ],\n})\nexport class CdkTreeNodeDef<T> {\n /**\n * Function that should return true if this node template should be used for the provided node\n * data and index. If left undefined, this node will be considered the default node template to\n * use when no other when functions return true for the data.\n * For every node, there must be at least one when function that passes or an undefined to\n * default.\n */\n when: (index: number, nodeData: T) => boolean;\n\n /** @docs-private */\n constructor(public template: TemplateRef<any>) {}\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 */\nimport {\n Directive,\n ViewContainerRef,\n} from '@angular/core';\n\n/**\n * Outlet for nested CdkNode. Put `[cdkTreeNodeOutlet]` on a tag to place children dataNodes\n * inside the outlet.\n */\n@Directive({\n selector: '[cdkTreeNodeOutlet]'\n})\nexport class CdkTreeNodeOutlet {\n constructor(public viewContainer: ViewContainerRef) {}\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 */\nimport {FocusableOption} from '@angular/cdk/a11y';\nimport {CollectionViewer, DataSource} from '@angular/cdk/collections';\nimport {\n AfterContentChecked,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n Directive,\n ElementRef,\n Input,\n IterableChangeRecord,\n IterableDiffer,\n IterableDiffers,\n OnDestroy,\n OnInit,\n QueryList,\n ViewChild,\n ViewContainerRef,\n ViewEncapsulation,\n TrackByFunction\n} from '@angular/core';\nimport {BehaviorSubject, Observable, of as observableOf, Subject, Subscription} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\nimport {TreeControl} from './control/tree-control';\nimport {CdkTreeNodeDef, CdkTreeNodeOutletContext} from './node';\nimport {CdkTreeNodeOutlet} from './outlet';\nimport {\n getTreeControlFunctionsMissingError,\n getTreeControlMissingError,\n getTreeMissingMatchingNodeDefError,\n getTreeMultipleDefaultNodeDefsError,\n getTreeNoValidDataSourceError\n} from './tree-errors';\n\n/**\n * CDK tree component that connects with a data source to retrieve data of type `T` and renders\n * dataNodes with hierarchy. Updates the dataNodes when new data is provided by the data source.\n */\n@Component({\n moduleId: module.id,\n selector: 'cdk-tree',\n exportAs: 'cdkTree',\n template: `<ng-container cdkTreeNodeOutlet></ng-container>`,\n host: {\n 'class': 'cdk-tree',\n 'role': 'tree',\n },\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class CdkTree<T>\n implements AfterContentChecked, CollectionViewer, OnDestroy, OnInit {\n /** Subject that emits when the component has been destroyed. */\n private _onDestroy = new Subject<void>();\n\n /** Differ used to find the changes in the data provided by the data source. */\n private _dataDiffer: IterableDiffer<T>;\n\n /** Stores the node definition that does not have a when predicate. */\n private _defaultNodeDef: CdkTreeNodeDef<T> | null;\n\n /** Data subscription */\n private _dataSubscription: Subscription | null;\n\n /** Level of nodes */\n private _levels: Map<T, number> = new Map<T, number>();\n\n /**\n * Provides a stream containing the latest data array to render. Influenced by the tree's\n * stream of view window (what dataNodes are currently on screen).\n * Data source can be an observable of data array, or a data array to render.\n */\n @Input()\n get dataSource(): DataSource<T> | Observable<T[]> | T[] { return this._dataSource; }\n set dataSource(dataSource: DataSource<T> | Observable<T[]> | T[]) {\n if (this._dataSource !== dataSource) {\n this._switchDataSource(dataSource);\n }\n }\n private _dataSource: DataSource<T> | Observable<T[]> | T[];\n\n /** The tree controller */\n @Input() treeControl: TreeControl<T>;\n\n /**\n * Tracking function that will be used to check the differences in data changes. Used similarly\n * to `ngFor` `trackBy` function. Optimize node operations by identifying a node based on its data\n * relative to the function to know if a node should be added/removed/moved.\n * Accepts a function that takes two parameters, `index` and `item`.\n */\n @Input() trackBy: TrackByFunction<T>;\n\n // Outlets within the tree's template where the dataNodes will be inserted.\n @ViewChild(CdkTreeNodeOutlet) _nodeOutlet: CdkTreeNodeOutlet;\n\n /** The tree node template for the tree */\n @ContentChildren(CdkTreeNodeDef) _nodeDefs: QueryList<CdkTreeNodeDef<T>>;\n\n // TODO(tinayuangao): Setup a listener for scrolling, emit the calculated view to viewChange.\n // Remove the MAX_VALUE in viewChange\n /**\n * Stream containing the latest information on what rows are being displayed on screen.\n * Can be used by the data source to as a heuristic of what data should be provided.\n */\n viewChange =\n new BehaviorSubject<{start: number, end: number}>({start: 0, end: Number.MAX_VALUE});\n\n constructor(private _differs: IterableDiffers,\n private _changeDetectorRef: ChangeDetectorRef) {}\n\n ngOnInit() {\n this._dataDiffer = this._differs.find([]).create(this.trackBy);\n if (!this.treeControl) {\n throw getTreeControlMissingError();\n }\n }\n\n ngOnDestroy() {\n this._nodeOutlet.viewContainer.clear();\n\n this._onDestroy.next();\n this._onDestroy.complete();\n\n if (this._dataSource && typeof (this._dataSource as DataSource<T>).disconnect === 'function') {\n (this.dataSource as DataSource<T>).disconnect(this);\n }\n\n if (this._dataSubscription) {\n this._dataSubscription.unsubscribe();\n this._dataSubscription = null;\n }\n }\n\n ngAfterContentChecked() {\n const defaultNodeDefs = this._nodeDefs.filter(def => !def.when);\n if (defaultNodeDefs.length > 1) {\n throw getTreeMultipleDefaultNodeDefsError();\n }\n this._defaultNodeDef = defaultNodeDefs[0];\n\n if (this.dataSource && this._nodeDefs && !this._dataSubscription) {\n this._observeRenderChanges();\n }\n }\n\n\n // TODO(tinayuangao): Work on keyboard traversal and actions, make sure it's working for RTL\n // and nested trees.\n\n /**\n * Switch to the provided data source by resetting the data and unsubscribing from the current\n * render change subscription if one exists. If the data source is null, interpret this by\n * clearing the node outlet. Otherwise start listening for new data.\n */\n private _switchDataSource(dataSource: DataSource<T> | Observable<T[]> | T[]) {\n if (this._dataSource && typeof (this._dataSource as DataSource<T>).disconnect === 'function') {\n (this.dataSource as DataSource<T>).disconnect(this);\n }\n\n if (this._dataSubscription) {\n this._dataSubscription.unsubscribe();\n this._dataSubscription = null;\n }\n\n // Remove the all dataNodes if there is now no data source\n if (!dataSource) {\n this._nodeOutlet.viewContainer.clear();\n }\n\n this._dataSource = dataSource;\n if (this._nodeDefs) {\n this._observeRenderChanges();\n }\n }\n\n /** Set up a subscription for the data provided by the data source. */\n private _observeRenderChanges() {\n let dataStream: Observable<T[] | ReadonlyArray<T>> | undefined;\n\n // Cannot use `instanceof DataSource` since the data source could be a literal with\n // `connect` function and may not extends DataSource.\n if (typeof (this._dataSource as DataSource<T>).connect === 'function') {\n dataStream = (this._dataSource as DataSource<T>).connect(this);\n } else if (this._dataSource instanceof Observable) {\n dataStream = this._dataSource;\n } else if (Array.isArray(this._dataSource)) {\n dataStream = observableOf(this._dataSource);\n }\n\n if (dataStream) {\n this._dataSubscription = dataStream.pipe(takeUntil(this._onDestroy))\n .subscribe(data => this.renderNodeChanges(data));\n } else {\n throw getTreeNoValidDataSourceError();\n }\n }\n\n /** Check for changes made in the data and render each change (node added/removed/moved). */\n renderNodeChanges(data: T[] | ReadonlyArray<T>, dataDiffer: IterableDiffer<T> = this._dataDiffer,\n viewContainer: ViewContainerRef = this._nodeOutlet.viewContainer,\n parentData?: T) {\n const changes = dataDiffer.diff(data);\n if (!changes) { return; }\n\n changes.forEachOperation((item: IterableChangeRecord<T>,\n adjustedPreviousIndex: number | null,\n currentIndex: number | null) => {\n if (item.previousIndex == null) {\n this.insertNode(data[currentIndex!], currentIndex!, viewContainer, parentData);\n } else if (currentIndex == null) {\n viewContainer.remove(adjustedPreviousIndex!);\n this._levels.delete(item.item);\n } else {\n const view = viewContainer.get(adjustedPreviousIndex!);\n viewContainer.move(view!, currentIndex);\n }\n });\n\n this._changeDetectorRef.detectChanges();\n }\n\n /**\n * Finds the matching node definition that should be used for this node data. If there is only\n * one node definition, it is returned. Otherwise, find the node definition that has a when\n * predicate that returns true with the data. If none return true, return the default node\n * definition.\n */\n _getNodeDef(data: T, i: number): CdkTreeNodeDef<T> {\n if (this._nodeDefs.length === 1) { return this._nodeDefs.first; }\n\n const nodeDef =\n this._nodeDefs.find(def => def.when && def.when(i, data)) || this._defaultNodeDef;\n if (!nodeDef) { throw getTreeMissingMatchingNodeDefError(); }\n\n return nodeDef;\n }\n\n /**\n * Create the embedded view for the data node template and place it in the correct index location\n * within the data node view container.\n */\n insertNode(nodeData: T, index: number, viewContainer?: ViewContainerRef, parentData?: T) {\n const node = this._getNodeDef(nodeData, index);\n\n // Node context that will be provided to created embedded view\n const context = new CdkTreeNodeOutletContext<T>(nodeData);\n\n // If the tree is flat tree, then use the `getLevel` function in flat tree control\n // Otherwise, use the level of parent node.\n if (this.treeControl.getLevel) {\n context.level = this.treeControl.getLevel(nodeData);\n } else if (typeof parentData !== 'undefined' && this._levels.has(parentData)) {\n context.level = this._levels.get(parentData)! + 1;\n } else {\n context.level = 0;\n }\n this._levels.set(nodeData, context.level);\n\n // Use default tree nodeOutlet, or nested node's nodeOutlet\n const container = viewContainer ? viewContainer : this._nodeOutlet.viewContainer;\n container.createEmbeddedView(node.template, context, index);\n\n // Set the data to just created `CdkTreeNode`.\n // The `CdkTreeNode` created from `createEmbeddedView` will be saved in static variable\n // `mostRecentTreeNode`. We get it from static variable and pass the node data to it.\n if (CdkTreeNode.mostRecentTreeNode) {\n CdkTreeNode.mostRecentTreeNode.data = nodeData;\n }\n }\n}\n\n\n/**\n * Tree node for CdkTree. It contains the data in the tree node.\n */\n@Directive({\n selector: 'cdk-tree-node',\n exportAs: 'cdkTreeNode',\n host: {\n '[attr.aria-expanded]': 'isExpanded',\n '[attr.aria-level]': 'role === \"treeitem\" ? level : null',\n '[attr.role]': 'role',\n 'class': 'cdk-tree-node',\n },\n})\nexport class CdkTreeNode<T> implements FocusableOption, OnDestroy {\n /**\n * The most recently created `CdkTreeNode`. We save it in static variable so we can retrieve it\n * in `CdkTree` and set the data to it.\n */\n static mostRecentTreeNode: CdkTreeNode<any> | null = null;\n\n /** Subject that emits when the component has been destroyed. */\n protected _destroyed = new Subject<void>();\n\n /** The tree node's data. */\n get data(): T { return this._data; }\n set data(value: T) {\n this._data = value;\n this._setRoleFromData();\n }\n protected _data: T;\n\n get isExpanded(): boolean {\n return this._tree.treeControl.isExpanded(this._data);\n }\n\n get level(): number {\n return this._tree.treeControl.getLevel ? this._tree.treeControl.getLevel(this._data) : 0;\n }\n\n /**\n * The role of the node should be 'group' if it's an internal node,\n * and 'treeitem' if it's a leaf node.\n */\n @Input() role: 'treeitem' | 'group' = 'treeitem';\n\n constructor(protected _elementRef: ElementRef<HTMLElement>,\n protected _tree: CdkTree<T>) {\n CdkTreeNode.mostRecentTreeNode = this as CdkTreeNode<T>;\n }\n\n ngOnDestroy() {\n // If this is the last tree node being destroyed,\n // clear out the reference to avoid leaking memory.\n if (CdkTreeNode.mostRecentTreeNode === this) {\n CdkTreeNode.mostRecentTreeNode = null;\n }\n\n this._destroyed.next();\n this._destroyed.complete();\n }\n\n /** Focuses the menu item. Implements for FocusableOption. */\n focus(): void {\n this._elementRef.nativeElement.focus();\n }\n\n protected _setRoleFromData(): void {\n if (this._tree.treeControl.isExpandable) {\n this.role = this._tree.treeControl.isExpandable(this._data) ? 'group' : 'treeitem';\n } else {\n if (!this._tree.treeControl.getChildren) {\n throw getTreeControlFunctionsMissingError();\n }\n const childrenNodes = this._tree.treeControl.getChildren(this._data);\n if (Array.isArray(childrenNodes)) {\n this._setRoleFromChildren(childrenNodes as T[]);\n } else if (childrenNodes instanceof Observable) {\n childrenNodes.pipe(takeUntil(this._destroyed))\n .subscribe(children => this._setRoleFromChildren(children));\n }\n }\n }\n\n protected _setRoleFromChildren(children: T[]) {\n this.role = children && children.length ? 'group' : 'treeitem';\n }\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 */\nimport {\n AfterContentInit,\n ContentChildren,\n Directive,\n ElementRef,\n IterableDiffers,\n IterableDiffer,\n OnDestroy,\n QueryList,\n} from '@angular/core';\nimport {Observable} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\n\nimport {CdkTree, CdkTreeNode} from './tree';\nimport {CdkTreeNodeOutlet} from './outlet';\nimport {getTreeControlFunctionsMissingError} from './tree-errors';\n\n/**\n * Nested node is a child of `<cdk-tree>`. It works with nested tree.\n * By using `cdk-nested-tree-node` component in tree node template, children of the parent node will\n * be added in the `cdkTreeNodeOutlet` in tree node template.\n * For example:\n * ```html\n * <cdk-nested-tree-node>\n * {{node.name}}\n * <ng-template cdkTreeNodeOutlet></ng-template>\n * </cdk-nested-tree-node>\n * ```\n * The children of node will be automatically added to `cdkTreeNodeOutlet`, the result dom will be\n * like this:\n * ```html\n * <cdk-nested-tree-node>\n * {{node.name}}\n * <cdk-nested-tree-node>{{child1.name}}</cdk-nested-tree-node>\n * <cdk-nested-tree-node>{{child2.name}}</cdk-nested-tree-node>\n * </cdk-nested-tree-node>\n * ```\n */\n@Directive({\n selector: 'cdk-nested-tree-node',\n exportAs: 'cdkNestedTreeNode',\n host: {\n '[attr.aria-expanded]': 'isExpanded',\n '[attr.role]': 'role',\n 'class': 'cdk-tree-node cdk-nested-tree-node',\n },\n providers: [{provide: CdkTreeNode, useExisting: CdkNestedTreeNode}]\n})\nexport class CdkNestedTreeNode<T> extends CdkTreeNode<T> implements AfterContentInit, OnDestroy {\n /** Differ used to find the changes in the data provided by the data source. */\n private _dataDiffer: IterableDiffer<T>;\n\n /** The children data dataNodes of current node. They will be placed in `CdkTreeNodeOutlet`. */\n protected _children: T[];\n\n /** The children node placeholder. */\n @ContentChildren(CdkTreeNodeOutlet) nodeOutlet: QueryList<CdkTreeNodeOutlet>;\n\n constructor(protected _elementRef: ElementRef<HTMLElement>,\n protected _tree: CdkTree<T>,\n protected _differs: IterableDiffers) {\n super(_elementRef, _tree);\n }\n\n ngAfterContentInit() {\n this._dataDiffer = this._differs.find([]).create(this._tree.trackBy);\n if (!this._tree.treeControl.getChildren) {\n throw getTreeControlFunctionsMissingError();\n }\n const childrenNodes = this._tree.treeControl.getChildren(this.data);\n if (Array.isArray(childrenNodes)) {\n this.updateChildrenNodes(childrenNodes as T[]);\n } else if (childrenNodes instanceof Observable) {\n childrenNodes.pipe(takeUntil(this._destroyed))\n .subscribe(result => this.updateChildrenNodes(result));\n }\n this.nodeOutlet.changes.pipe(takeUntil(this._destroyed))\n .subscribe(() => this.updateChildrenNodes());\n }\n\n ngOnDestroy() {\n this._clear();\n super.ngOnDestroy();\n }\n\n /** Add children dataNodes to the NodeOutlet */\n protected updateChildrenNodes(children?: T[]): void {\n if (children) {\n this._children = children;\n }\n if (this.nodeOutlet.length && this._children) {\n const viewContainer = this.nodeOutlet.first.viewContainer;\n this._tree.renderNodeChanges(this._children, this._dataDiffer, viewContainer, this._data);\n } else {\n // Reset the data differ if there's no children nodes displayed\n this._dataDiffer.diff([]);\n }\n }\n\n /** Clear the children dataNodes. */\n protected _clear(): void {\n if (this.nodeOutlet && this.nodeOutlet.first) {\n this.nodeOutlet.first.viewContainer.clear();\n this._dataDiffer.diff([]);\n }\n }\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 {Directionality} from '@angular/cdk/bidi';\nimport {coerceNumberProperty} from '@angular/cdk/coercion';\nimport {Directive, ElementRef, Input, OnDestroy, Optional, Renderer2} from '@angular/core';\nimport {takeUntil} from 'rxjs/operators';\nimport {Subject} from 'rxjs';\nimport {CdkTree, CdkTreeNode} from './tree';\n\n/** Regex used to split a string on its CSS units. */\nconst cssUnitPattern = /([A-Za-z%]+)$/;\n\n/**\n * Indent for the children tree dataNodes.\n * This directive will add left-padding to the node to show hierarchy.\n */\n@Directive({\n selector: '[cdkTreeNodePadding]',\n})\nexport class CdkTreeNodePadding<T> implements OnDestroy {\n /** Subject that emits when the component has been destroyed. */\n private _destroyed = new Subject<void>();\n\n /** CSS units used for the indentation value. */\n indentUnits = 'px';\n\n /** The level of depth of the tree node. The padding will be `level * indent` pixels. */\n @Input('cdkTreeNodePadding')\n get level(): number { return this._level; }\n set level(value: number) {\n this._level = coerceNumberProperty(value);\n this._setPadding();\n }\n _level: number;\n\n /**\n * The indent for each level. Can be a number or a CSS string.\n * Default number 40px from material design menu sub-menu spec.\n */\n @Input('cdkTreeNodePaddingIndent')\n get indent(): number | string { return this._indent; }\n set indent(indent: number | string) {\n let value = indent;\n let units = 'px';\n\n if (typeof indent === 'string') {\n const parts = indent.split(cssUnitPattern);\n value = parts[0];\n units = parts[1] || units;\n }\n\n this.indentUnits = units;\n this._indent = coerceNumberProperty(value);\n this._setPadding();\n }\n _indent: number = 40;\n\n constructor(private _treeNode: CdkTreeNode<T>,\n private _tree: CdkTree<T>,\n private _renderer: Renderer2,\n private _element: ElementRef<HTMLElement>,\n @Optional() private _dir: Directionality) {\n this._setPadding();\n if (this._dir) {\n this._dir.change.pipe(takeUntil(this._destroyed)).subscribe(() => this._setPadding());\n }\n }\n\n ngOnDestroy() {\n this._destroyed.next();\n this._destroyed.complete();\n }\n\n /** The padding indent value for the tree node. Returns a string with px numbers if not null. */\n _paddingIndent(): string|null {\n const nodeLevel = (this._treeNode.data && this._tree.treeControl.getLevel)\n ? this._tree.treeControl.getLevel(this._treeNode.data)\n : null;\n const level = this._level || nodeLevel;\n return level ? `${level * this._indent}${this.indentUnits}` : null;\n }\n\n _setPadding() {\n const padding = this._paddingIndent();\n const paddingProp = this._dir && this._dir.value === 'rtl' ? 'paddingRight' : 'paddingLeft';\n\n this._renderer.setStyle(this._element.nativeElement, paddingProp, padding);\n }\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 {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {\n Directive,\n Input,\n} from '@angular/core';\nimport {CdkTree, CdkTreeNode} from './tree';\n\n/**\n * Node toggle to expand/collapse the node.\n */\n@Directive({\n selector: '[cdkTreeNodeToggle]',\n host: {\n '(click)': '_toggle($event)',\n }\n})\nexport class CdkTreeNodeToggle<T> {\n /** Whether expand/collapse the node recursively. */\n @Input('cdkTreeNodeToggleRecursive')\n get recursive(): boolean { return this._recursive; }\n set recursive(value: boolean) { this._recursive = coerceBooleanProperty(value); }\n protected _recursive = false;\n\n constructor(protected _tree: CdkTree<T>,\n protected _treeNode: CdkTreeNode<T>) {}\n\n _toggle(event: Event): void {\n this.recursive\n ? this._tree.treeControl.toggleDescendants(this._treeNode.data)\n : this._tree.treeControl.toggle(this._treeNode.data);\n\n event.stopPropagation();\n }\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 {FocusMonitor} from '@angular/cdk/a11y';\nimport {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {CdkTreeNodeOutlet} from './outlet';\nimport {CdkTreeNodePadding} from './padding';\nimport {CdkTreeNodeToggle} from './toggle';\nimport {CdkTree, CdkTreeNode} from './tree';\nimport {CdkTreeNodeDef} from './node';\nimport {CdkNestedTreeNode} from './nested-node';\n\nconst EXPORTED_DECLARATIONS = [\n CdkNestedTreeNode,\n CdkTreeNodeDef,\n CdkTreeNodePadding,\n CdkTreeNodeToggle,\n CdkTree,\n CdkTreeNode,\n CdkTreeNodeOutlet,\n];\n\n@NgModule({\n imports: [CommonModule],\n exports: EXPORTED_DECLARATIONS,\n declarations: EXPORTED_DECLARATIONS,\n providers: [FocusMonitor, CdkTreeNodeDef]\n})\nexport class CdkTreeModule {}\n"],"names":["__extends","d","b","__","this","constructor","extendStatics","prototype","Object","create","getTreeNoValidDataSourceError","Error","getTreeMultipleDefaultNodeDefsError","getTreeMissingMatchingNodeDefError","getTreeControlMissingError","getTreeControlFunctionsMissingError","setPrototypeOf","__proto__","Array","p","hasOwnProperty","BaseTreeControl","expansionModel","SelectionModel","toggle","dataNode","expand","select","collapse","deselect","isExpanded","isSelected","toggleDescendants","collapseDescendants","expandDescendants","collapseAll","clear","toBeProcessed","push","apply","getDescendants","_a","FlatTreeControl","getLevel","isExpandable","_this","_super","call","tslib_1.__extends","startIndex","dataNodes","indexOf","results","i","length","expandAll","NestedTreeControl","getChildren","allNodes","reduce","accumulator","concat","descendants","_getDescendants","splice","childrenNodes","isArray","forEach","child","Observable","pipe","take","filter","Boolean","subscribe","children","CdkTreeNodeOutletContext","data","$implicit","CdkTreeNodeDef","template","type","Directive","args","selector","inputs","TemplateRef","CdkTreeNodeOutlet","viewContainer","ViewContainerRef","CdkTree","_differs","_changeDetectorRef","_onDestroy","Subject","_levels","Map","viewChange","BehaviorSubject","start","end","Number","MAX_VALUE","defineProperty","_dataSource","dataSource","_switchDataSource","ngOnInit","_dataDiffer","find","trackBy","treeControl","ngOnDestroy","_nodeOutlet","next","complete","disconnect","_dataSubscription","unsubscribe","ngAfterContentChecked","defaultNodeDefs","_nodeDefs","def","when","_defaultNodeDef","_observeRenderChanges","dataStream","connect","observableOf","takeUntil","renderNodeChanges","dataDiffer","parentData","changes","diff","forEachOperation","item","adjustedPreviousIndex","currentIndex","previousIndex","insertNode","remove","delete","view","get","move","detectChanges","_getNodeDef","first","nodeDef","nodeData","index","node","context","level","has","set","createEmbeddedView","CdkTreeNode","mostRecentTreeNode","Component","exportAs","host","class","role","encapsulation","ViewEncapsulation","None","changeDetection","ChangeDetectionStrategy","OnPush","propDecorators","Input","ViewChild","ContentChildren","_elementRef","_tree","_setRoleFromData","enumerable","configurable","_destroyed","_data","_setRoleFromChildren","[attr.aria-expanded]","[attr.aria-level]","[attr.role]","CdkNestedTreeNode","ngAfterContentInit","updateChildrenNodes","result","nodeOutlet","_clear","_children","providers","provide","useExisting","ElementRef","IterableDiffers","cssUnitPattern","CdkTreeNodePadding","_treeNode","_renderer","_element","_dir","indentUnits","_indent","_setPadding","change","_level","value","coerceNumberProperty","indent","units","parts","split","_paddingIndent","nodeLevel","padding","paddingProp","setStyle","nativeElement","Renderer2","Directionality","decorators","Optional","CdkTreeNodeToggle","_recursive","coerceBooleanProperty","_toggle","event","recursive","stopPropagation","(click)","EXPORTED_DECLARATIONS","CdkTreeModule","NgModule","imports","CommonModule","exports","declarations","FocusMonitor"],"mappings":";;;;;;;0uBAuBA,SAAgBA,GAAUC,EAAGC,GAEzB,QAASC,KAAOC,KAAKC,YAAcJ,EADnCK,EAAcL,EAAGC,GAEjBD,EAAEM,UAAkB,OAANL,EAAaM,OAAOC,OAAOP,IAAMC,EAAGI,UAAYL,EAAEK,UAAW,GAAIJ,ICdnF,QAAgBO,KACd,MAAOC,OAAM,yCAOf,QAAgBC,KACd,MAAOD,OAAM,wEAOf,QAAgBE,KACd,MAAOF,OAAM,yEAOf,QAAgBG,KACd,MAAOH,OAAM,+CAOf,QAAgBI,KACd,MAAOJ,OAAM,kED7Bf,GAAIL,GAAgB,SAASL,EAAGC,GAI5B,OAHAI,EAAgBE,OAAOQ,iBAChBC,uBAA2BC,QAAS,SAAUjB,EAAGC,GAAKD,EAAEgB,UAAYf,IACvE,SAAUD,EAAGC,GAAK,IAAK,GAAIiB,KAAKjB,GAAOA,EAAEkB,eAAeD,KAAIlB,EAAEkB,GAAKjB,EAAEiB,MACpDlB,EAAGC,iBER5B,QAAAmB,KAYEjB,KAAFkB,eAAsC,GAAIC,GAAAA,gBAAkB,GA2D5D,MA5CEF,GAAFd,UAAAiB,OAAE,SAAOC,GACLrB,KAAKkB,eAA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eF,EAAaD,mBAtEtExI,KAACC,EAAAA,UAADC,OACEC,SAAU,+DAVZH,KAAiB6E,IAAjB7E,KAAQS,IAHRT,KAA2D4I,EAAAA,YAA3D5I,KAAmBmH,EAAAA,aAFnBnH,KAAQ6I,EAAAA,eAARC,aAAA9I,KA2De+I,EAAAA,gCAlCftE,QAAAzE,KAAG2F,EAAAA,MAAHzF,MAAS,wBAYTgI,SAAAlI,KAAG2F,EAAAA,MAAHzF,MAAS,+BAiDToH,KC5EA0B,EAAA,WAaE,QAAFA,GAAwBjD,EACAwB,GADApM,KAAxB4K,MAAwBA,EACA5K,KAAxBoM,UAAwBA,EAHZpM,KAAZ8N,YAAyB,EAYzB,MAfE1N,QAAF+F,eACM0H,EADN1N,UAAA,iBAAE,WAC2B,MAAOH,MAAK8N,gBACvC,SAAcjB,GAAkB7M,KAAK8N,WAAaC,EAAAA,sBAAsBlB,oCAMxEgB,EAAF1N,UAAA6N,QAAE,SAAQC,GACNjO,KAAKkO,UACDlO,KAAK4K,MAAMjE,YAAY/E,kBAAkB5B,KAAKoM,UAAU3H,MACxDzE,KAAK4K,MAAMjE,YAAYvF,OAAOpB,KAAKoM,UAAU3H,MAEjDwJ,EAAME,kCArBVtJ,KAACC,EAAAA,UAADC,OACEC,SAAU,sBACV8E,MACEsE,UAAW,2DARfvJ,KAAQS,IAART,KAAiB6E,uBAajBwE,YAAArJ,KAAG2F,EAAAA,MAAHzF,MAAS,iCAeT8I,KCvBMQ,GACJ/C,EACA3G,EACAwH,EACA0B,EACAvI,EACAoE,EACAvE,GAGFmJ,EAAA,WAAA,QAAAA,MAM4B,sBAN5BzJ,KAAC0J,EAAAA,SAADxJ,OACEyJ,SAAUC,EAAAA,cACVC,QAASL,EACTM,aAAcN,EACdxC,WAAY+C,EAAAA,aAAcjK,OAE5B2J"}
@@ -19,7 +19,7 @@
19
19
  * Current version of the Angular Component Development Kit.
20
20
  * @type {?}
21
21
  */
22
- var VERSION = new core.Version('7.1.1');
22
+ var VERSION = new core.Version('7.2.0');
23
23
 
24
24
  exports.VERSION = VERSION;
25
25
 
@@ -1 +1 @@
1
- {"version":3,"file":"cdk.umd.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.1.1');\n"],"names":["Version"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAWA,AAAA,IAAa,OAAO,GAAG,IAAIA,YAAO,CAAC,mBAAmB,CAAC;;;;;;;;;;;;"}
1
+ {"version":3,"file":"cdk.umd.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.0');\n"],"names":["Version"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAWA,AAAA,IAAa,OAAO,GAAG,IAAIA,YAAO,CAAC,mBAAmB,CAAC;;;;;;;;;;;;"}
@@ -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,require("@angular/core")):"function"==typeof define&&define.amd?define("@angular/cdk",["exports","@angular/core"],n):n((e.ng=e.ng||{},e.ng.cdk={}),e.ng.core)}(this,function(e,n){"use strict";var o=new n.Version("7.1.1");e.VERSION=o,Object.defineProperty(e,"__esModule",{value:!0})});
8
+ !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@angular/core")):"function"==typeof define&&define.amd?define("@angular/cdk",["exports","@angular/core"],n):n((e.ng=e.ng||{},e.ng.cdk={}),e.ng.core)}(this,function(e,n){"use strict";var o=new n.Version("7.2.0");e.VERSION=o,Object.defineProperty(e,"__esModule",{value:!0})});
9
9
  //# sourceMappingURL=cdk.umd.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cdk.umd.min.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.1.1');\n"],"names":["VERSION","Version"],"mappings":";;;;;;;4QAWA,IAAaA,GAAU,GAAIC,GAAAA,QAAQ"}
1
+ {"version":3,"file":"cdk.umd.min.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.0');\n"],"names":["VERSION","Version"],"mappings":";;;;;;;4QAWA,IAAaA,GAAU,GAAIC,GAAAA,QAAQ"}
@@ -0,0 +1,108 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ import { Directionality } from '@angular/cdk/bidi';
9
+ import { ViewportRuler } from '@angular/cdk/scrolling';
10
+ import { AfterViewInit, ElementRef, EventEmitter, InjectionToken, NgZone, OnDestroy, QueryList, ViewContainerRef } from '@angular/core';
11
+ import { Observable } from 'rxjs';
12
+ import { DragDropRegistry } from '../drag-drop-registry';
13
+ import { CdkDragDrop, CdkDragEnd, CdkDragEnter, CdkDragExit, CdkDragMove, CdkDragStart, CdkDragRelease } from '../drag-events';
14
+ import { CdkDragHandle } from './drag-handle';
15
+ import { CdkDragPlaceholder } from './drag-placeholder';
16
+ import { CdkDragPreview } from './drag-preview';
17
+ import { DragRef, DragRefConfig } from '../drag-ref';
18
+ import { DropListRef } from '../drop-list-ref';
19
+ import { CdkDropListInternal as CdkDropList } from './drop-list';
20
+ /** Injection token that can be used to configure the behavior of `CdkDrag`. */
21
+ export declare const CDK_DRAG_CONFIG: InjectionToken<DragRefConfig>;
22
+ /** @docs-private */
23
+ export declare function CDK_DRAG_CONFIG_FACTORY(): DragRefConfig;
24
+ /** Element that can be moved inside a CdkDropList container. */
25
+ export declare class CdkDrag<T = any> implements AfterViewInit, OnDestroy {
26
+ /** Element that the draggable is attached to. */
27
+ element: ElementRef<HTMLElement>;
28
+ /** Droppable container that the draggable is a part of. */
29
+ dropContainer: CdkDropList;
30
+ private _document;
31
+ private _ngZone;
32
+ private _viewContainerRef;
33
+ private _viewportRuler;
34
+ private _dragDropRegistry;
35
+ private _config;
36
+ private _dir;
37
+ /** Subscription to the stream that initializes the root element. */
38
+ private _rootElementInitSubscription;
39
+ /** Reference to the underlying drag instance. */
40
+ _dragRef: DragRef<CdkDrag<T>>;
41
+ /** Elements that can be used to drag the draggable item. */
42
+ _handles: QueryList<CdkDragHandle>;
43
+ /** Element that will be used as a template to create the draggable item's preview. */
44
+ _previewTemplate: CdkDragPreview;
45
+ /** Template for placeholder element rendered to show where a draggable would be dropped. */
46
+ _placeholderTemplate: CdkDragPlaceholder;
47
+ /** Arbitrary data to attach to this drag instance. */
48
+ data: T;
49
+ /** Locks the position of the dragged element along the specified axis. */
50
+ lockAxis: 'x' | 'y';
51
+ /**
52
+ * Selector that will be used to determine the root draggable element, starting from
53
+ * the `cdkDrag` element and going up the DOM. Passing an alternate root element is useful
54
+ * when trying to enable dragging on an element that you might not have access to.
55
+ */
56
+ rootElementSelector: string;
57
+ /**
58
+ * Selector that will be used to determine the element to which the draggable's position will
59
+ * be constrained. Matching starts from the element's parent and goes up the DOM until a matching
60
+ * element has been found.
61
+ */
62
+ boundaryElementSelector: string;
63
+ /** Whether starting to drag this element is disabled. */
64
+ disabled: boolean;
65
+ private _disabled;
66
+ /** Emits when the user starts dragging the item. */
67
+ started: EventEmitter<CdkDragStart>;
68
+ /** Emits when the user has released a drag item, before any animations have started. */
69
+ released: EventEmitter<CdkDragRelease>;
70
+ /** Emits when the user stops dragging an item in the container. */
71
+ ended: EventEmitter<CdkDragEnd>;
72
+ /** Emits when the user has moved the item into a new container. */
73
+ entered: EventEmitter<CdkDragEnter<any>>;
74
+ /** Emits when the user removes the item its container by dragging it into another container. */
75
+ exited: EventEmitter<CdkDragExit<any>>;
76
+ /** Emits when the user drops the item inside a container. */
77
+ dropped: EventEmitter<CdkDragDrop<any>>;
78
+ /**
79
+ * Emits as the user is dragging the item. Use with caution,
80
+ * because this event will fire for every pixel that the user has dragged.
81
+ */
82
+ moved: Observable<CdkDragMove<T>>;
83
+ constructor(
84
+ /** Element that the draggable is attached to. */
85
+ element: ElementRef<HTMLElement>,
86
+ /** Droppable container that the draggable is a part of. */
87
+ dropContainer: CdkDropList, _document: any, _ngZone: NgZone, _viewContainerRef: ViewContainerRef, _viewportRuler: ViewportRuler, _dragDropRegistry: DragDropRegistry<DragRef, DropListRef>, _config: DragRefConfig, _dir: Directionality);
88
+ /**
89
+ * Returns the element that is being used as a placeholder
90
+ * while the current element is being dragged.
91
+ */
92
+ getPlaceholderElement(): HTMLElement;
93
+ /** Returns the root draggable element. */
94
+ getRootElement(): HTMLElement;
95
+ /** Resets a standalone drag item to its initial position. */
96
+ reset(): void;
97
+ ngAfterViewInit(): void;
98
+ ngOnDestroy(): void;
99
+ /** Gets the root draggable element, based on the `rootElementSelector`. */
100
+ private _getRootElement;
101
+ /** Gets the boundary element, based on the `boundaryElementSelector`. */
102
+ private _getBoundaryElement;
103
+ /**
104
+ * Proxies the events from a DragRef to events that
105
+ * match the interfaces of the CdkDrag outputs.
106
+ */
107
+ private _proxyEvents;
108
+ }
@@ -15,5 +15,8 @@ import { OnDestroy } from '@angular/core';
15
15
  export declare class CdkDropListGroup<T> implements OnDestroy {
16
16
  /** Drop lists registered inside the group. */
17
17
  readonly _items: Set<T>;
18
+ /** Whether starting a dragging sequence from inside this group is disabled. */
19
+ disabled: boolean;
20
+ private _disabled;
18
21
  ngOnDestroy(): void;
19
22
  }
@@ -0,0 +1,135 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ import { ElementRef, EventEmitter, OnDestroy, QueryList, ChangeDetectorRef } from '@angular/core';
9
+ import { Directionality } from '@angular/cdk/bidi';
10
+ import { CdkDrag } from './drag';
11
+ import { DragDropRegistry } from '../drag-drop-registry';
12
+ import { CdkDragDrop, CdkDragEnter, CdkDragExit, CdkDragSortEvent } from '../drag-events';
13
+ import { CdkDropListContainer } from '../drop-list-container';
14
+ import { CdkDropListGroup } from './drop-list-group';
15
+ import { DropListRef } from '../drop-list-ref';
16
+ import { DragRef } from '../drag-ref';
17
+ /**
18
+ * Internal compile-time-only representation of a `CdkDropList`.
19
+ * Used to avoid circular import issues between the `CdkDropList` and the `CdkDrag`.
20
+ * @docs-private
21
+ */
22
+ export interface CdkDropListInternal extends CdkDropList {
23
+ }
24
+ /** Container that wraps a set of draggable items. */
25
+ export declare class CdkDropList<T = any> implements CdkDropListContainer, OnDestroy {
26
+ element: ElementRef<HTMLElement>;
27
+ private _changeDetectorRef;
28
+ private _group?;
29
+ /** Keeps track of the drop lists that are currently on the page. */
30
+ private static _dropLists;
31
+ /** Reference to the underlying drop list instance. */
32
+ _dropListRef: DropListRef<CdkDropList<T>>;
33
+ /** Draggable items in the container. */
34
+ _draggables: QueryList<CdkDrag>;
35
+ /**
36
+ * Other draggable containers that this container is connected to and into which the
37
+ * container's items can be transferred. Can either be references to other drop containers,
38
+ * or their unique IDs.
39
+ */
40
+ connectedTo: (CdkDropList | string)[] | CdkDropList | string;
41
+ /** Arbitrary data to attach to this container. */
42
+ data: T;
43
+ /** Direction in which the list is oriented. */
44
+ orientation: 'horizontal' | 'vertical';
45
+ /**
46
+ * Unique ID for the drop zone. Can be used as a reference
47
+ * in the `connectedTo` of another `CdkDropList`.
48
+ */
49
+ id: string;
50
+ /** Locks the position of the draggable elements inside the container along the specified axis. */
51
+ lockAxis: 'x' | 'y';
52
+ /** Whether starting a dragging sequence from this container is disabled. */
53
+ disabled: boolean;
54
+ private _disabled;
55
+ /**
56
+ * Function that is used to determine whether an item
57
+ * is allowed to be moved into a drop container.
58
+ */
59
+ enterPredicate: (drag: CdkDrag, drop: CdkDropList) => boolean;
60
+ /** Emits when the user drops an item inside the container. */
61
+ dropped: EventEmitter<CdkDragDrop<T, any>>;
62
+ /**
63
+ * Emits when the user has moved a new drag item into this container.
64
+ */
65
+ entered: EventEmitter<CdkDragEnter<T>>;
66
+ /**
67
+ * Emits when the user removes an item from the container
68
+ * by dragging it into another container.
69
+ */
70
+ exited: EventEmitter<CdkDragExit<T>>;
71
+ /** Emits as the user is swapping items while actively dragging. */
72
+ sorted: EventEmitter<CdkDragSortEvent<T>>;
73
+ constructor(element: ElementRef<HTMLElement>, dragDropRegistry: DragDropRegistry<DragRef, DropListRef>, _changeDetectorRef: ChangeDetectorRef, dir?: Directionality, _group?: CdkDropListGroup<CdkDropList<any>> | undefined, _document?: any);
74
+ ngOnDestroy(): void;
75
+ /** Starts dragging an item. */
76
+ start(): void;
77
+ /**
78
+ * Drops an item into this container.
79
+ * @param item Item being dropped into the container.
80
+ * @param currentIndex Index at which the item should be inserted.
81
+ * @param previousContainer Container from which the item got dragged in.
82
+ * @param isPointerOverContainer Whether the user's pointer was over the
83
+ * container when the item was dropped.
84
+ */
85
+ drop(item: CdkDrag, currentIndex: number, previousContainer: Partial<CdkDropListContainer>, isPointerOverContainer: boolean): void;
86
+ /**
87
+ * Emits an event to indicate that the user moved an item into the container.
88
+ * @param item Item that was moved into the container.
89
+ * @param pointerX Position of the item along the X axis.
90
+ * @param pointerY Position of the item along the Y axis.
91
+ */
92
+ enter(item: CdkDrag, pointerX: number, pointerY: number): void;
93
+ /**
94
+ * Removes an item from the container after it was dragged into another container by the user.
95
+ * @param item Item that was dragged out.
96
+ */
97
+ exit(item: CdkDrag): void;
98
+ /**
99
+ * Figures out the index of an item in the container.
100
+ * @param item Item whose index should be determined.
101
+ */
102
+ getItemIndex(item: CdkDrag): number;
103
+ /**
104
+ * Sorts an item inside the container based on its position.
105
+ * @param item Item to be sorted.
106
+ * @param pointerX Position of the item along the X axis.
107
+ * @param pointerY Position of the item along the Y axis.
108
+ * @param pointerDelta Direction in which the pointer is moving along each axis.
109
+ */
110
+ _sortItem(item: CdkDrag, pointerX: number, pointerY: number, pointerDelta: {
111
+ x: number;
112
+ y: number;
113
+ }): void;
114
+ /**
115
+ * Figures out whether an item should be moved into a sibling
116
+ * drop container, based on its current position.
117
+ * @param item Drag item that is being moved.
118
+ * @param x Position of the item along the X axis.
119
+ * @param y Position of the item along the Y axis.
120
+ */
121
+ _getSiblingContainerFromPosition(item: CdkDrag, x: number, y: number): CdkDropListContainer | null;
122
+ /**
123
+ * Checks whether the user's pointer is positioned over the container.
124
+ * @param x Pointer position along the X axis.
125
+ * @param y Pointer position along the Y axis.
126
+ */
127
+ _isOverContainer(x: number, y: number): boolean;
128
+ /** Syncs the inputs of the CdkDropList with the options of the underlying DropListRef. */
129
+ private _syncInputs;
130
+ /**
131
+ * Proxies the events from a DropListRef to events that
132
+ * match the interfaces of the CdkDropList outputs.
133
+ */
134
+ private _proxyEvents;
135
+ }
@@ -54,13 +54,18 @@ export declare class DragDropRegistry<I, C extends {
54
54
  stopDragging(drag: I): void;
55
55
  /** Gets whether a drag item instance is currently being dragged. */
56
56
  isDragging(drag: I): boolean;
57
- /** Gets a drop container by its id. */
57
+ /**
58
+ * Gets a drop container by its id.
59
+ * @deprecated No longer being used. To be removed.
60
+ * @breaking-change 8.0.0
61
+ */
58
62
  getDropContainer(id: string): C | undefined;
59
63
  ngOnDestroy(): void;
60
64
  /**
61
- * Listener used to prevent `touchmove` and `wheel` events while the element is being dragged.
65
+ * Event listener that will prevent the default browser action while the user is dragging.
66
+ * @param event Event whose default action should be prevented.
62
67
  */
63
- private _preventScrollListener;
68
+ private _preventDefaultWhileDragging;
64
69
  /** Clears out the global event listeners from the `document`. */
65
70
  private _clearGlobalListeners;
66
71
  }