@angular/cdk 10.0.2 → 10.1.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 (128) hide show
  1. package/a11y/aria-describer/aria-describer.d.ts +10 -1
  2. package/a11y/index.metadata.json +1 -1
  3. package/a11y/interactivity-checker/interactivity-checker.d.ts +11 -1
  4. package/a11y/key-manager/list-key-manager.d.ts +6 -0
  5. package/accordion/accordion.d.ts +7 -1
  6. package/accordion/index.d.ts +1 -0
  7. package/accordion/index.metadata.json +1 -1
  8. package/bundles/cdk-a11y.umd.js +63 -11
  9. package/bundles/cdk-a11y.umd.js.map +1 -1
  10. package/bundles/cdk-a11y.umd.min.js +11 -11
  11. package/bundles/cdk-a11y.umd.min.js.map +1 -1
  12. package/bundles/cdk-accordion.umd.js +12 -4
  13. package/bundles/cdk-accordion.umd.js.map +1 -1
  14. package/bundles/cdk-accordion.umd.min.js +2 -2
  15. package/bundles/cdk-accordion.umd.min.js.map +1 -1
  16. package/bundles/cdk-drag-drop.umd.js +640 -599
  17. package/bundles/cdk-drag-drop.umd.js.map +1 -1
  18. package/bundles/cdk-drag-drop.umd.min.js +8 -16
  19. package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
  20. package/bundles/cdk-overlay.umd.js +199 -42
  21. package/bundles/cdk-overlay.umd.js.map +1 -1
  22. package/bundles/cdk-overlay.umd.min.js +11 -18
  23. package/bundles/cdk-overlay.umd.min.js.map +1 -1
  24. package/bundles/cdk-platform.umd.min.js +1 -1
  25. package/bundles/cdk-platform.umd.min.js.map +1 -1
  26. package/bundles/cdk-scrolling.umd.js +9 -1
  27. package/bundles/cdk-scrolling.umd.js.map +1 -1
  28. package/bundles/cdk-scrolling.umd.min.js +7 -0
  29. package/bundles/cdk-scrolling.umd.min.js.map +1 -1
  30. package/bundles/cdk-testing-protractor.umd.min.js +1 -1
  31. package/bundles/cdk-testing-protractor.umd.min.js.map +1 -1
  32. package/bundles/cdk-testing-testbed.umd.min.js +8 -8
  33. package/bundles/cdk-testing-testbed.umd.min.js.map +1 -1
  34. package/bundles/cdk-testing.umd.js +32 -0
  35. package/bundles/cdk-testing.umd.js.map +1 -1
  36. package/bundles/cdk-testing.umd.min.js +5 -5
  37. package/bundles/cdk-testing.umd.min.js.map +1 -1
  38. package/bundles/cdk-tree.umd.js +6 -2
  39. package/bundles/cdk-tree.umd.js.map +1 -1
  40. package/bundles/cdk-tree.umd.min.js +3 -3
  41. package/bundles/cdk-tree.umd.min.js.map +1 -1
  42. package/bundles/cdk.umd.js +1 -1
  43. package/bundles/cdk.umd.js.map +1 -1
  44. package/bundles/cdk.umd.min.js +1 -1
  45. package/bundles/cdk.umd.min.js.map +1 -1
  46. package/drag-drop/directives/drag-handle.d.ts +7 -1
  47. package/drag-drop/directives/drag-placeholder.d.ts +7 -1
  48. package/drag-drop/directives/drag-preview.d.ts +7 -1
  49. package/drag-drop/directives/drag.d.ts +3 -7
  50. package/drag-drop/directives/drop-list-group.d.ts +7 -1
  51. package/drag-drop/directives/drop-list.d.ts +7 -1
  52. package/drag-drop/index.d.ts +2 -2
  53. package/drag-drop/index.metadata.json +1 -1
  54. package/esm2015/a11y/aria-describer/aria-describer.js +20 -6
  55. package/esm2015/a11y/interactivity-checker/interactivity-checker.js +16 -3
  56. package/esm2015/a11y/key-manager/list-key-manager.js +27 -2
  57. package/esm2015/accordion/accordion-item.js +7 -7
  58. package/esm2015/accordion/accordion.js +9 -2
  59. package/esm2015/accordion/index.js +2 -1
  60. package/esm2015/drag-drop/directives/drag-handle.js +11 -4
  61. package/esm2015/drag-drop/directives/drag-placeholder.js +10 -3
  62. package/esm2015/drag-drop/directives/drag-preview.js +10 -3
  63. package/esm2015/drag-drop/directives/drag.js +19 -15
  64. package/esm2015/drag-drop/directives/drop-list-group.js +9 -2
  65. package/esm2015/drag-drop/directives/drop-list.js +11 -6
  66. package/esm2015/drag-drop/index.js +3 -2
  67. package/esm2015/layout/breakpoints-observer.js +1 -1
  68. package/esm2015/overlay/dispatchers/base-overlay-dispatcher.js +51 -0
  69. package/esm2015/overlay/dispatchers/index.js +10 -0
  70. package/esm2015/overlay/dispatchers/overlay-keyboard-dispatcher.js +79 -0
  71. package/esm2015/overlay/dispatchers/overlay-outside-click-dispatcher.js +94 -0
  72. package/esm2015/overlay/index.js +5 -4
  73. package/esm2015/overlay/overlay-config.js +5 -1
  74. package/esm2015/overlay/overlay-directives.js +17 -7
  75. package/esm2015/overlay/overlay-module.js +2 -2
  76. package/esm2015/overlay/overlay-ref.js +24 -2
  77. package/esm2015/overlay/overlay-reference.js +1 -1
  78. package/esm2015/overlay/overlay.js +10 -5
  79. package/esm2015/overlay/position/overlay-position-builder.js +1 -1
  80. package/esm2015/overlay/public-api.js +2 -2
  81. package/esm2015/scrolling/public-api.js +2 -1
  82. package/esm2015/scrolling/virtual-for-of.js +1 -1
  83. package/esm2015/scrolling/virtual-scroll-repeater.js +8 -0
  84. package/esm2015/scrolling/virtual-scroll-viewport.js +2 -2
  85. package/esm2015/testing/component-harness.js +19 -1
  86. package/esm2015/testing/harness-environment.js +7 -1
  87. package/esm2015/tree/control/nested-tree-control.js +7 -3
  88. package/esm2015/version.js +1 -1
  89. package/fesm2015/a11y.js +60 -10
  90. package/fesm2015/a11y.js.map +1 -1
  91. package/fesm2015/accordion.js +13 -6
  92. package/fesm2015/accordion.js.map +1 -1
  93. package/fesm2015/cdk.js +1 -1
  94. package/fesm2015/cdk.js.map +1 -1
  95. package/fesm2015/drag-drop.js +607 -570
  96. package/fesm2015/drag-drop.js.map +1 -1
  97. package/fesm2015/overlay.js +196 -32
  98. package/fesm2015/overlay.js.map +1 -1
  99. package/fesm2015/scrolling.js +9 -1
  100. package/fesm2015/scrolling.js.map +1 -1
  101. package/fesm2015/testing.js +25 -1
  102. package/fesm2015/testing.js.map +1 -1
  103. package/fesm2015/tree.js +6 -2
  104. package/fesm2015/tree.js.map +1 -1
  105. package/overlay/dispatchers/base-overlay-dispatcher.d.ts +28 -0
  106. package/overlay/dispatchers/index.d.ts +9 -0
  107. package/overlay/{keyboard → dispatchers}/overlay-keyboard-dispatcher.d.ts +4 -10
  108. package/overlay/dispatchers/overlay-outside-click-dispatcher.d.ts +27 -0
  109. package/overlay/index.d.ts +4 -3
  110. package/overlay/index.metadata.json +1 -1
  111. package/overlay/overlay-config.d.ts +4 -0
  112. package/overlay/overlay-directives.d.ts +4 -0
  113. package/overlay/overlay-ref.d.ts +8 -2
  114. package/overlay/overlay-reference.d.ts +1 -0
  115. package/overlay/overlay.d.ts +4 -2
  116. package/overlay/public-api.d.ts +1 -1
  117. package/package.json +1 -1
  118. package/schematics/ng-add/index.js +1 -1
  119. package/scrolling/index.metadata.json +1 -1
  120. package/scrolling/public-api.d.ts +1 -0
  121. package/scrolling/virtual-for-of.d.ts +2 -1
  122. package/scrolling/virtual-scroll-repeater.d.ts +16 -0
  123. package/scrolling/virtual-scroll-viewport.d.ts +4 -4
  124. package/testing/component-harness.d.ts +12 -0
  125. package/testing/harness-environment.d.ts +1 -0
  126. package/tree/control/nested-tree-control.d.ts +7 -2
  127. package/tree/index.metadata.json +1 -1
  128. package/esm2015/overlay/keyboard/overlay-keyboard-dispatcher.js +0 -96
@@ -1 +1 @@
1
- {"version":3,"file":"testing.js","sources":["../../../../../../src/cdk/testing/component-harness.ts","../../../../../../src/cdk/testing/harness-environment.ts","../../../../../../src/cdk/testing/test-element.ts","../../../../../../src/cdk/testing/element-dimensions.ts","../../../../../../src/cdk/testing/public-api.ts","../../../../../../src/cdk/testing/index.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 {TestElement} from './test-element';\n\n/** An async function that returns a promise when called. */\nexport type AsyncFactoryFn<T> = () => Promise<T>;\n\n/** An async function that takes an item and returns a boolean promise */\nexport type AsyncPredicate<T> = (item: T) => Promise<boolean>;\n\n/** An async function that takes an item and an option value and returns a boolean promise. */\nexport type AsyncOptionPredicate<T, O> = (item: T, option: O) => Promise<boolean>;\n\n/**\n * A query for a `ComponentHarness`, which is expressed as either a `ComponentHarnessConstructor` or\n * a `HarnessPredicate`.\n */\nexport type HarnessQuery<T extends ComponentHarness> =\n ComponentHarnessConstructor<T> | HarnessPredicate<T>;\n\n/**\n * The result type obtained when searching using a particular list of queries. This type depends on\n * the particular items being queried.\n * - If one of the queries is for a `ComponentHarnessConstructor<C1>`, it means that the result\n * might be a harness of type `C1`\n * - If one of the queries is for a `HarnessPredicate<C2>`, it means that the result might be a\n * harness of type `C2`\n * - If one of the queries is for a `string`, it means that the result might be a `TestElement`.\n *\n * Since we don't know for sure which query will match, the result type if the union of the types\n * for all possible results.\n *\n * e.g.\n * The type:\n * `LocatorFnResult&lt;[\n * ComponentHarnessConstructor&lt;MyHarness&gt;,\n * HarnessPredicate&lt;MyOtherHarness&gt;,\n * string\n * ]&gt;`\n * is equivalent to:\n * `MyHarness | MyOtherHarness | TestElement`.\n */\nexport type LocatorFnResult<T extends (HarnessQuery<any> | string)[]> = {\n [I in keyof T]:\n // Map `ComponentHarnessConstructor<C>` to `C`.\n T[I] extends new (...args: any[]) => infer C ? C :\n // Map `HarnessPredicate<C>` to `C`.\n T[I] extends { harnessType: new (...args: any[]) => infer C } ? C :\n // Map `string` to `TestElement`.\n T[I] extends string ? TestElement :\n // Map everything else to `never` (should not happen due to the type constraint on `T`).\n never;\n}[number];\n\n\n/**\n * Interface used to load ComponentHarness objects. This interface is used by test authors to\n * instantiate `ComponentHarness`es.\n */\nexport interface HarnessLoader {\n /**\n * Searches for an element with the given selector under the current instances's root element,\n * and returns a `HarnessLoader` rooted at the matching element. If multiple elements match the\n * selector, the first is used. If no elements match, an error is thrown.\n * @param selector The selector for the root element of the new `HarnessLoader`\n * @return A `HarnessLoader` rooted at the element matching the given selector.\n * @throws If a matching element can't be found.\n */\n getChildLoader(selector: string): Promise<HarnessLoader>;\n\n /**\n * Searches for all elements with the given selector under the current instances's root element,\n * and returns an array of `HarnessLoader`s, one for each matching element, rooted at that\n * element.\n * @param selector The selector for the root element of the new `HarnessLoader`\n * @return A list of `HarnessLoader`s, one for each matching element, rooted at that element.\n */\n getAllChildLoaders(selector: string): Promise<HarnessLoader[]>;\n\n /**\n * Searches for an instance of the component corresponding to the given harness type under the\n * `HarnessLoader`'s root element, and returns a `ComponentHarness` for that instance. If multiple\n * matching components are found, a harness for the first one is returned. If no matching\n * component is found, an error is thrown.\n * @param query A query for a harness to create\n * @return An instance of the given harness type\n * @throws If a matching component instance can't be found.\n */\n getHarness<T extends ComponentHarness>(query: HarnessQuery<T>): Promise<T>;\n\n /**\n * Searches for all instances of the component corresponding to the given harness type under the\n * `HarnessLoader`'s root element, and returns a list `ComponentHarness` for each instance.\n * @param query A query for a harness to create\n * @return A list instances of the given harness type.\n */\n getAllHarnesses<T extends ComponentHarness>(query: HarnessQuery<T>): Promise<T[]>;\n}\n\n/**\n * Interface used to create asynchronous locator functions used find elements and component\n * harnesses. This interface is used by `ComponentHarness` authors to create locator functions for\n * their `ComponentHarness` subclass.\n */\nexport interface LocatorFactory {\n /** Gets a locator factory rooted at the document root. */\n documentRootLocatorFactory(): LocatorFactory;\n\n /** The root element of this `LocatorFactory` as a `TestElement`. */\n rootElement: TestElement;\n\n /**\n * Creates an asynchronous locator function that can be used to find a `ComponentHarness` instance\n * or element under the root element of this `LocatorFactory`.\n * @param queries A list of queries specifying which harnesses and elements to search for:\n * - A `string` searches for elements matching the CSS selector specified by the string.\n * - A `ComponentHarness` constructor searches for `ComponentHarness` instances matching the\n * given class.\n * - A `HarnessPredicate` searches for `ComponentHarness` instances matching the given\n * predicate.\n * @return An asynchronous locator function that searches for and returns a `Promise` for the\n * first element or harness matching the given search criteria. Matches are ordered first by\n * order in the DOM, and second by order in the queries list. If no matches are found, the\n * `Promise` rejects. The type that the `Promise` resolves to is a union of all result types for\n * each query.\n *\n * e.g. Given the following DOM: `<div id=\"d1\" /><div id=\"d2\" />`, and assuming\n * `DivHarness.hostSelector === 'div'`:\n * - `await lf.locatorFor(DivHarness, 'div')()` gets a `DivHarness` instance for `#d1`\n * - `await lf.locatorFor('div', DivHarness)()` gets a `TestElement` instance for `#d1`\n * - `await lf.locatorFor('span')()` throws because the `Promise` rejects.\n */\n locatorFor<T extends (HarnessQuery<any> | string)[]>(...queries: T):\n AsyncFactoryFn<LocatorFnResult<T>>;\n\n /**\n * Creates an asynchronous locator function that can be used to find a `ComponentHarness` instance\n * or element under the root element of this `LocatorFactory`.\n * @param queries A list of queries specifying which harnesses and elements to search for:\n * - A `string` searches for elements matching the CSS selector specified by the string.\n * - A `ComponentHarness` constructor searches for `ComponentHarness` instances matching the\n * given class.\n * - A `HarnessPredicate` searches for `ComponentHarness` instances matching the given\n * predicate.\n * @return An asynchronous locator function that searches for and returns a `Promise` for the\n * first element or harness matching the given search criteria. Matches are ordered first by\n * order in the DOM, and second by order in the queries list. If no matches are found, the\n * `Promise` is resolved with `null`. The type that the `Promise` resolves to is a union of all\n * result types for each query or null.\n *\n * e.g. Given the following DOM: `<div id=\"d1\" /><div id=\"d2\" />`, and assuming\n * `DivHarness.hostSelector === 'div'`:\n * - `await lf.locatorForOptional(DivHarness, 'div')()` gets a `DivHarness` instance for `#d1`\n * - `await lf.locatorForOptional('div', DivHarness)()` gets a `TestElement` instance for `#d1`\n * - `await lf.locatorForOptional('span')()` gets `null`.\n */\n locatorForOptional<T extends (HarnessQuery<any> | string)[]>(...queries: T):\n AsyncFactoryFn<LocatorFnResult<T> | null>;\n\n /**\n * Creates an asynchronous locator function that can be used to find `ComponentHarness` instances\n * or elements under the root element of this `LocatorFactory`.\n * @param queries A list of queries specifying which harnesses and elements to search for:\n * - A `string` searches for elements matching the CSS selector specified by the string.\n * - A `ComponentHarness` constructor searches for `ComponentHarness` instances matching the\n * given class.\n * - A `HarnessPredicate` searches for `ComponentHarness` instances matching the given\n * predicate.\n * @return An asynchronous locator function that searches for and returns a `Promise` for all\n * elements and harnesses matching the given search criteria. Matches are ordered first by\n * order in the DOM, and second by order in the queries list. If an element matches more than\n * one `ComponentHarness` class, the locator gets an instance of each for the same element. If\n * an element matches multiple `string` selectors, only one `TestElement` instance is returned\n * for that element. The type that the `Promise` resolves to is an array where each element is\n * the union of all result types for each query.\n *\n * e.g. Given the following DOM: `<div id=\"d1\" /><div id=\"d2\" />`, and assuming\n * `DivHarness.hostSelector === 'div'` and `IdIsD1Harness.hostSelector === '#d1'`:\n * - `await lf.locatorForAll(DivHarness, 'div')()` gets `[\n * DivHarness, // for #d1\n * TestElement, // for #d1\n * DivHarness, // for #d2\n * TestElement // for #d2\n * ]`\n * - `await lf.locatorForAll('div', '#d1')()` gets `[\n * TestElement, // for #d1\n * TestElement // for #d2\n * ]`\n * - `await lf.locatorForAll(DivHarness, IdIsD1Harness)()` gets `[\n * DivHarness, // for #d1\n * IdIsD1Harness, // for #d1\n * DivHarness // for #d2\n * ]`\n * - `await lf.locatorForAll('span')()` gets `[]`.\n */\n locatorForAll<T extends (HarnessQuery<any> | string)[]>(...queries: T):\n AsyncFactoryFn<LocatorFnResult<T>[]>;\n\n /**\n * Gets a `HarnessLoader` instance for an element under the root of this `LocatorFactory`.\n * @param selector The selector for the root element.\n * @return A `HarnessLoader` rooted at the first element matching the given selector.\n * @throws If no matching element is found for the given selector.\n */\n harnessLoaderFor(selector: string): Promise<HarnessLoader>;\n\n /**\n * Gets a `HarnessLoader` instance for an element under the root of this `LocatorFactory`\n * @param selector The selector for the root element.\n * @return A `HarnessLoader` rooted at the first element matching the given selector, or null if\n * no matching element is found.\n */\n harnessLoaderForOptional(selector: string): Promise<HarnessLoader | null>;\n\n /**\n * Gets a list of `HarnessLoader` instances, one for each matching element.\n * @param selector The selector for the root element.\n * @return A list of `HarnessLoader`, one rooted at each element matching the given selector.\n */\n harnessLoaderForAll(selector: string): Promise<HarnessLoader[]>;\n\n /**\n * Flushes change detection and async tasks captured in the Angular zone.\n * In most cases it should not be necessary to call this manually. However, there may be some edge\n * cases where it is needed to fully flush animation events.\n */\n forceStabilize(): Promise<void>;\n\n /**\n * Waits for all scheduled or running async tasks to complete. This allows harness\n * authors to wait for async tasks outside of the Angular zone.\n */\n waitForTasksOutsideAngular(): Promise<void>;\n}\n\n/**\n * Base class for component harnesses that all component harness authors should extend. This base\n * component harness provides the basic ability to locate element and sub-component harness. It\n * should be inherited when defining user's own harness.\n */\nexport abstract class ComponentHarness {\n constructor(protected readonly locatorFactory: LocatorFactory) {}\n\n /** Gets a `Promise` for the `TestElement` representing the host element of the component. */\n async host(): Promise<TestElement> {\n return this.locatorFactory.rootElement;\n }\n\n /**\n * Gets a `LocatorFactory` for the document root element. This factory can be used to create\n * locators for elements that a component creates outside of its own root element. (e.g. by\n * appending to document.body).\n */\n protected documentRootLocatorFactory(): LocatorFactory {\n return this.locatorFactory.documentRootLocatorFactory();\n }\n\n /**\n * Creates an asynchronous locator function that can be used to find a `ComponentHarness` instance\n * or element under the host element of this `ComponentHarness`.\n * @param queries A list of queries specifying which harnesses and elements to search for:\n * - A `string` searches for elements matching the CSS selector specified by the string.\n * - A `ComponentHarness` constructor searches for `ComponentHarness` instances matching the\n * given class.\n * - A `HarnessPredicate` searches for `ComponentHarness` instances matching the given\n * predicate.\n * @return An asynchronous locator function that searches for and returns a `Promise` for the\n * first element or harness matching the given search criteria. Matches are ordered first by\n * order in the DOM, and second by order in the queries list. If no matches are found, the\n * `Promise` rejects. The type that the `Promise` resolves to is a union of all result types for\n * each query.\n *\n * e.g. Given the following DOM: `<div id=\"d1\" /><div id=\"d2\" />`, and assuming\n * `DivHarness.hostSelector === 'div'`:\n * - `await ch.locatorFor(DivHarness, 'div')()` gets a `DivHarness` instance for `#d1`\n * - `await ch.locatorFor('div', DivHarness)()` gets a `TestElement` instance for `#d1`\n * - `await ch.locatorFor('span')()` throws because the `Promise` rejects.\n */\n protected locatorFor<T extends (HarnessQuery<any> | string)[]>(...queries: T):\n AsyncFactoryFn<LocatorFnResult<T>> {\n return this.locatorFactory.locatorFor(...queries);\n }\n\n /**\n * Creates an asynchronous locator function that can be used to find a `ComponentHarness` instance\n * or element under the host element of this `ComponentHarness`.\n * @param queries A list of queries specifying which harnesses and elements to search for:\n * - A `string` searches for elements matching the CSS selector specified by the string.\n * - A `ComponentHarness` constructor searches for `ComponentHarness` instances matching the\n * given class.\n * - A `HarnessPredicate` searches for `ComponentHarness` instances matching the given\n * predicate.\n * @return An asynchronous locator function that searches for and returns a `Promise` for the\n * first element or harness matching the given search criteria. Matches are ordered first by\n * order in the DOM, and second by order in the queries list. If no matches are found, the\n * `Promise` is resolved with `null`. The type that the `Promise` resolves to is a union of all\n * result types for each query or null.\n *\n * e.g. Given the following DOM: `<div id=\"d1\" /><div id=\"d2\" />`, and assuming\n * `DivHarness.hostSelector === 'div'`:\n * - `await ch.locatorForOptional(DivHarness, 'div')()` gets a `DivHarness` instance for `#d1`\n * - `await ch.locatorForOptional('div', DivHarness)()` gets a `TestElement` instance for `#d1`\n * - `await ch.locatorForOptional('span')()` gets `null`.\n */\n protected locatorForOptional<T extends (HarnessQuery<any> | string)[]>(...queries: T):\n AsyncFactoryFn<LocatorFnResult<T> | null> {\n return this.locatorFactory.locatorForOptional(...queries);\n }\n\n /**\n * Creates an asynchronous locator function that can be used to find `ComponentHarness` instances\n * or elements under the host element of this `ComponentHarness`.\n * @param queries A list of queries specifying which harnesses and elements to search for:\n * - A `string` searches for elements matching the CSS selector specified by the string.\n * - A `ComponentHarness` constructor searches for `ComponentHarness` instances matching the\n * given class.\n * - A `HarnessPredicate` searches for `ComponentHarness` instances matching the given\n * predicate.\n * @return An asynchronous locator function that searches for and returns a `Promise` for all\n * elements and harnesses matching the given search criteria. Matches are ordered first by\n * order in the DOM, and second by order in the queries list. If an element matches more than\n * one `ComponentHarness` class, the locator gets an instance of each for the same element. If\n * an element matches multiple `string` selectors, only one `TestElement` instance is returned\n * for that element. The type that the `Promise` resolves to is an array where each element is\n * the union of all result types for each query.\n *\n * e.g. Given the following DOM: `<div id=\"d1\" /><div id=\"d2\" />`, and assuming\n * `DivHarness.hostSelector === 'div'` and `IdIsD1Harness.hostSelector === '#d1'`:\n * - `await ch.locatorForAll(DivHarness, 'div')()` gets `[\n * DivHarness, // for #d1\n * TestElement, // for #d1\n * DivHarness, // for #d2\n * TestElement // for #d2\n * ]`\n * - `await ch.locatorForAll('div', '#d1')()` gets `[\n * TestElement, // for #d1\n * TestElement // for #d2\n * ]`\n * - `await ch.locatorForAll(DivHarness, IdIsD1Harness)()` gets `[\n * DivHarness, // for #d1\n * IdIsD1Harness, // for #d1\n * DivHarness // for #d2\n * ]`\n * - `await ch.locatorForAll('span')()` gets `[]`.\n */\n protected locatorForAll<T extends (HarnessQuery<any> | string)[]>(...queries: T):\n AsyncFactoryFn<LocatorFnResult<T>[]> {\n return this.locatorFactory.locatorForAll(...queries);\n }\n\n /**\n * Flushes change detection and async tasks in the Angular zone.\n * In most cases it should not be necessary to call this manually. However, there may be some edge\n * cases where it is needed to fully flush animation events.\n */\n protected async forceStabilize() {\n return this.locatorFactory.forceStabilize();\n }\n\n /**\n * Waits for all scheduled or running async tasks to complete. This allows harness\n * authors to wait for async tasks outside of the Angular zone.\n */\n protected async waitForTasksOutsideAngular() {\n return this.locatorFactory.waitForTasksOutsideAngular();\n }\n}\n\n/** Constructor for a ComponentHarness subclass. */\nexport interface ComponentHarnessConstructor<T extends ComponentHarness> {\n new(locatorFactory: LocatorFactory): T;\n\n /**\n * `ComponentHarness` subclasses must specify a static `hostSelector` property that is used to\n * find the host element for the corresponding component. This property should match the selector\n * for the Angular component.\n */\n hostSelector: string;\n}\n\n/** A set of criteria that can be used to filter a list of `ComponentHarness` instances. */\nexport interface BaseHarnessFilters {\n /** Only find instances whose host element matches the given selector. */\n selector?: string;\n /** Only find instances that are nested under an element with the given selector. */\n ancestor?: string;\n}\n\n/**\n * A class used to associate a ComponentHarness class with predicates functions that can be used to\n * filter instances of the class.\n */\nexport class HarnessPredicate<T extends ComponentHarness> {\n private _predicates: AsyncPredicate<T>[] = [];\n private _descriptions: string[] = [];\n private _ancestor: string;\n\n constructor(public harnessType: ComponentHarnessConstructor<T>, options: BaseHarnessFilters) {\n this._addBaseOptions(options);\n }\n\n /**\n * Checks if the specified nullable string value matches the given pattern.\n * @param value The nullable string value to check, or a Promise resolving to the\n * nullable string value.\n * @param pattern The pattern the value is expected to match. If `pattern` is a string,\n * `value` is expected to match exactly. If `pattern` is a regex, a partial match is\n * allowed. If `pattern` is `null`, the value is expected to be `null`.\n * @return Whether the value matches the pattern.\n */\n static async stringMatches(value: string | null | Promise<string | null>,\n pattern: string | RegExp | null): Promise<boolean> {\n value = await value;\n if (pattern === null) {\n return value === null;\n } else if (value === null) {\n return false;\n }\n return typeof pattern === 'string' ? value === pattern : pattern.test(value);\n }\n\n /**\n * Adds a predicate function to be run against candidate harnesses.\n * @param description A description of this predicate that may be used in error messages.\n * @param predicate An async predicate function.\n * @return this (for method chaining).\n */\n add(description: string, predicate: AsyncPredicate<T>) {\n this._descriptions.push(description);\n this._predicates.push(predicate);\n return this;\n }\n\n /**\n * Adds a predicate function that depends on an option value to be run against candidate\n * harnesses. If the option value is undefined, the predicate will be ignored.\n * @param name The name of the option (may be used in error messages).\n * @param option The option value.\n * @param predicate The predicate function to run if the option value is not undefined.\n * @return this (for method chaining).\n */\n addOption<O>(name: string, option: O | undefined, predicate: AsyncOptionPredicate<T, O>) {\n if (option !== undefined) {\n this.add(`${name} = ${_valueAsString(option)}`, item => predicate(item, option));\n }\n return this;\n }\n\n /**\n * Filters a list of harnesses on this predicate.\n * @param harnesses The list of harnesses to filter.\n * @return A list of harnesses that satisfy this predicate.\n */\n async filter(harnesses: T[]): Promise<T[]> {\n const results = await Promise.all(harnesses.map(h => this.evaluate(h)));\n return harnesses.filter((_, i) => results[i]);\n }\n\n /**\n * Evaluates whether the given harness satisfies this predicate.\n * @param harness The harness to check\n * @return A promise that resolves to true if the harness satisfies this predicate,\n * and resolves to false otherwise.\n */\n async evaluate(harness: T): Promise<boolean> {\n const results = await Promise.all(this._predicates.map(p => p(harness)));\n return results.reduce((combined, current) => combined && current, true);\n }\n\n /** Gets a description of this predicate for use in error messages. */\n getDescription() {\n return this._descriptions.join(', ');\n }\n\n /** Gets the selector used to find candidate elements. */\n getSelector() {\n return this._ancestor.split(',')\n .map(part => `${part.trim()} ${this.harnessType.hostSelector}`.trim())\n .join(',');\n }\n\n /** Adds base options common to all harness types. */\n private _addBaseOptions(options: BaseHarnessFilters) {\n this._ancestor = options.ancestor || '';\n if (this._ancestor) {\n this._descriptions.push(`has ancestor matching selector \"${this._ancestor}\"`);\n }\n const selector = options.selector;\n if (selector !== undefined) {\n this.add(`host matches selector \"${selector}\"`, async item => {\n return (await item.host()).matchesSelector(selector);\n });\n }\n }\n}\n\n/** Represent a value as a string for the purpose of logging. */\nfunction _valueAsString(value: unknown) {\n if (value === undefined) {\n return 'undefined';\n }\n // `JSON.stringify` doesn't handle RegExp properly, so we need a custom replacer.\n try {\n return JSON.stringify(value, (_, v) => {\n if (v instanceof RegExp) {\n return `/${v.toString()}/`;\n }\n\n return typeof v === 'string' ? v.replace('/\\//g', '\\\\/') : v;\n }).replace(/\"\\/\\//g, '\\\\/').replace(/\\/\\/\"/g, '\\\\/').replace(/\\\\\\//g, '/');\n } catch {\n // `JSON.stringify` will throw if the object is cyclical,\n // in this case the best we can do is report the value as `{...}`.\n return '{...}';\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 {\n AsyncFactoryFn,\n ComponentHarness,\n ComponentHarnessConstructor,\n HarnessLoader,\n HarnessPredicate,\n HarnessQuery,\n LocatorFactory,\n LocatorFnResult,\n} from './component-harness';\nimport {TestElement} from './test-element';\n\n/** Parsed form of the queries passed to the `locatorFor*` methods. */\ntype ParsedQueries<T extends ComponentHarness> = {\n /** The full list of queries, in their original order. */\n allQueries: (string | HarnessPredicate<T>)[],\n /**\n * A filtered view of `allQueries` containing only the queries that are looking for a\n * `ComponentHarness`\n */\n harnessQueries: HarnessPredicate<T>[],\n /**\n * A filtered view of `allQueries` containing only the queries that are looking for a\n * `TestElement`\n */\n elementQueries: string[],\n /** The set of all `ComponentHarness` subclasses represented in the original query list. */\n harnessTypes: Set<ComponentHarnessConstructor<T>>,\n};\n\n/**\n * Base harness environment class that can be extended to allow `ComponentHarness`es to be used in\n * different test environments (e.g. testbed, protractor, etc.). This class implements the\n * functionality of both a `HarnessLoader` and `LocatorFactory`. This class is generic on the raw\n * element type, `E`, used by the particular test environment.\n */\nexport abstract class HarnessEnvironment<E> implements HarnessLoader, LocatorFactory {\n // Implemented as part of the `LocatorFactory` interface.\n rootElement: TestElement;\n\n protected constructor(protected rawRootElement: E) {\n this.rootElement = this.createTestElement(rawRootElement);\n }\n\n // Implemented as part of the `LocatorFactory` interface.\n documentRootLocatorFactory(): LocatorFactory {\n return this.createEnvironment(this.getDocumentRoot());\n }\n\n // Implemented as part of the `LocatorFactory` interface.\n locatorFor<T extends (HarnessQuery<any> | string)[]>(...queries: T):\n AsyncFactoryFn<LocatorFnResult<T>> {\n return () => _assertResultFound(\n this._getAllHarnessesAndTestElements(queries),\n _getDescriptionForLocatorForQueries(queries));\n }\n\n // Implemented as part of the `LocatorFactory` interface.\n locatorForOptional<T extends (HarnessQuery<any> | string)[]>(...queries: T):\n AsyncFactoryFn<LocatorFnResult<T> | null> {\n return async () => (await this._getAllHarnessesAndTestElements(queries))[0] || null;\n }\n\n // Implemented as part of the `LocatorFactory` interface.\n locatorForAll<T extends (HarnessQuery<any> | string)[]>(...queries: T):\n AsyncFactoryFn<LocatorFnResult<T>[]> {\n return () => this._getAllHarnessesAndTestElements(queries);\n }\n\n // Implemented as part of the `LocatorFactory` interface.\n async harnessLoaderFor(selector: string): Promise<HarnessLoader> {\n return this.createEnvironment(await _assertResultFound(this.getAllRawElements(selector),\n [_getDescriptionForHarnessLoaderQuery(selector)]));\n }\n\n // Implemented as part of the `LocatorFactory` interface.\n async harnessLoaderForOptional(selector: string): Promise<HarnessLoader | null> {\n const elements = await this.getAllRawElements(selector);\n return elements[0] ? this.createEnvironment(elements[0]) : null;\n }\n\n // Implemented as part of the `LocatorFactory` interface.\n async harnessLoaderForAll(selector: string): Promise<HarnessLoader[]> {\n const elements = await this.getAllRawElements(selector);\n return elements.map(element => this.createEnvironment(element));\n }\n\n // Implemented as part of the `HarnessLoader` interface.\n getHarness<T extends ComponentHarness>(query: HarnessQuery<T>): Promise<T> {\n return this.locatorFor(query)();\n }\n\n // Implemented as part of the `HarnessLoader` interface.\n getAllHarnesses<T extends ComponentHarness>(query: HarnessQuery<T>): Promise<T[]> {\n return this.locatorForAll(query)();\n }\n\n // Implemented as part of the `HarnessLoader` interface.\n async getChildLoader(selector: string): Promise<HarnessLoader> {\n return this.createEnvironment(await _assertResultFound(this.getAllRawElements(selector),\n [_getDescriptionForHarnessLoaderQuery(selector)]));\n }\n\n // Implemented as part of the `HarnessLoader` interface.\n async getAllChildLoaders(selector: string): Promise<HarnessLoader[]> {\n return (await this.getAllRawElements(selector)).map(e => this.createEnvironment(e));\n }\n\n /** Creates a `ComponentHarness` for the given harness type with the given raw host element. */\n protected createComponentHarness<T extends ComponentHarness>(\n harnessType: ComponentHarnessConstructor<T>, element: E): T {\n return new harnessType(this.createEnvironment(element));\n }\n\n // Part of LocatorFactory interface, subclasses will implement.\n abstract forceStabilize(): Promise<void>;\n\n // Part of LocatorFactory interface, subclasses will implement.\n abstract waitForTasksOutsideAngular(): Promise<void>;\n\n /** Gets the root element for the document. */\n protected abstract getDocumentRoot(): E;\n\n /** Creates a `TestElement` from a raw element. */\n protected abstract createTestElement(element: E): TestElement;\n\n /** Creates a `HarnessLoader` rooted at the given raw element. */\n protected abstract createEnvironment(element: E): HarnessEnvironment<E>;\n\n /**\n * Gets a list of all elements matching the given selector under this environment's root element.\n */\n protected abstract getAllRawElements(selector: string): Promise<E[]>;\n\n /**\n * Matches the given raw elements with the given list of element and harness queries to produce a\n * list of matched harnesses and test elements.\n */\n private async _getAllHarnessesAndTestElements<T extends (HarnessQuery<any> | string)[]>(\n queries: T): Promise<LocatorFnResult<T>[]> {\n const {allQueries, harnessQueries, elementQueries, harnessTypes} = _parseQueries(queries);\n\n // Combine all of the queries into one large comma-delimited selector and use it to get all raw\n // elements matching any of the individual queries.\n const rawElements = await this.getAllRawElements(\n [...elementQueries, ...harnessQueries.map(predicate => predicate.getSelector())].join(','));\n\n // If every query is searching for the same harness subclass, we know every result corresponds\n // to an instance of that subclass. Likewise, if every query is for a `TestElement`, we know\n // every result corresponds to a `TestElement`. Otherwise we need to verify which result was\n // found by which selector so it can be matched to the appropriate instance.\n const skipSelectorCheck = (elementQueries.length === 0 && harnessTypes.size === 1) ||\n harnessQueries.length === 0;\n\n const perElementMatches = await Promise.all(rawElements.map(async rawElement => {\n const testElement = this.createTestElement(rawElement);\n const allResultsForElement = await Promise.all(\n // For each query, get `null` if it doesn't match, or a `TestElement` or\n // `ComponentHarness` as appropriate if it does match. This gives us everything that\n // matches the current raw element, but it may contain duplicate entries (e.g. multiple\n // `TestElement` or multiple `ComponentHarness` of the same type.\n allQueries.map(query =>\n this._getQueryResultForElement(query, rawElement, testElement, skipSelectorCheck)));\n return _removeDuplicateQueryResults(allResultsForElement);\n }));\n return ([] as any).concat(...perElementMatches);\n }\n\n /**\n * Check whether the given query matches the given element, if it does return the matched\n * `TestElement` or `ComponentHarness`, if it does not, return null. In cases where the caller\n * knows for sure that the query matches the element's selector, `skipSelectorCheck` can be used\n * to skip verification and optimize performance.\n */\n private async _getQueryResultForElement<T extends ComponentHarness>(\n query: string | HarnessPredicate<T>, rawElement: E, testElement: TestElement,\n skipSelectorCheck: boolean = false): Promise<T | TestElement | null> {\n if (typeof query === 'string') {\n return ((skipSelectorCheck || await testElement.matchesSelector(query)) ? testElement : null);\n }\n if (skipSelectorCheck || await testElement.matchesSelector(query.getSelector())) {\n const harness = this.createComponentHarness(query.harnessType, rawElement);\n return (await query.evaluate(harness)) ? harness : null;\n }\n return null;\n }\n}\n\n/**\n * Parses a list of queries in the format accepted by the `locatorFor*` methods into an easier to\n * work with format.\n */\nfunction _parseQueries<T extends (HarnessQuery<any> | string)[]>(queries: T):\n ParsedQueries<LocatorFnResult<T> & ComponentHarness> {\n const allQueries = [];\n const harnessQueries = [];\n const elementQueries = [];\n const harnessTypes =\n new Set<ComponentHarnessConstructor<LocatorFnResult<T> & ComponentHarness>>();\n\n for (const query of queries) {\n if (typeof query === 'string') {\n allQueries.push(query);\n elementQueries.push(query);\n } else {\n const predicate = query instanceof HarnessPredicate ? query : new HarnessPredicate(query, {});\n allQueries.push(predicate);\n harnessQueries.push(predicate);\n harnessTypes.add(predicate.harnessType);\n }\n }\n\n return {allQueries, harnessQueries, elementQueries, harnessTypes};\n}\n\n/**\n * Removes duplicate query results for a particular element. (e.g. multiple `TestElement`\n * instances or multiple instances of the same `ComponentHarness` class.\n */\nasync function _removeDuplicateQueryResults<T extends (ComponentHarness | TestElement | null)[]>(\n results: T): Promise<T> {\n let testElementMatched = false;\n let matchedHarnessTypes = new Set();\n const dedupedMatches = [];\n for (const result of results) {\n if (!result) {\n continue;\n }\n if (result instanceof ComponentHarness) {\n if (!matchedHarnessTypes.has(result.constructor)) {\n matchedHarnessTypes.add(result.constructor);\n dedupedMatches.push(result);\n }\n } else if (!testElementMatched) {\n testElementMatched = true;\n dedupedMatches.push(result);\n }\n }\n return dedupedMatches as T;\n}\n\n/** Verifies that there is at least one result in an array. */\nasync function _assertResultFound<T>(results: Promise<T[]>, queryDescriptions: string[]):\n Promise<T> {\n const result = (await results)[0];\n if (result == undefined) {\n throw Error(`Failed to find element matching one of the following queries:\\n` +\n queryDescriptions.map(desc => `(${desc})`).join(',\\n'));\n }\n return result;\n}\n\n/** Gets a list of description strings from a list of queries. */\nfunction _getDescriptionForLocatorForQueries(queries: (string | HarnessQuery<any>)[]) {\n return queries.map(query => typeof query === 'string' ?\n _getDescriptionForTestElementQuery(query) : _getDescriptionForComponentHarnessQuery(query));\n}\n\n/** Gets a description string for a `ComponentHarness` query. */\nfunction _getDescriptionForComponentHarnessQuery(query: HarnessQuery<any>) {\n const harnessPredicate =\n query instanceof HarnessPredicate ? query : new HarnessPredicate(query, {});\n const {name, hostSelector} = harnessPredicate.harnessType;\n const description = `${name} with host element matching selector: \"${hostSelector}\"`;\n const constraints = harnessPredicate.getDescription();\n return description + (constraints ?\n ` satisfying the constraints: ${harnessPredicate.getDescription()}` : '');\n}\n\n/** Gets a description string for a `TestElement` query. */\nfunction _getDescriptionForTestElementQuery(selector: string) {\n return `TestElement for element matching selector: \"${selector}\"`;\n}\n\n/** Gets a description string for a `HarnessLoader` query. */\nfunction _getDescriptionForHarnessLoaderQuery(selector: string) {\n return `HarnessLoader for element matching selector: \"${selector}\"`;\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 {ElementDimensions} from './element-dimensions';\n\n/** Modifier keys that may be held while typing. */\nexport interface ModifierKeys {\n control?: boolean;\n alt?: boolean;\n shift?: boolean;\n meta?: boolean;\n}\n\n/** An enum of non-text keys that can be used with the `sendKeys` method. */\n// NOTE: This is a separate enum from `@angular/cdk/keycodes` because we don't necessarily want to\n// support every possible keyCode. We also can't rely on Protractor's `Key` because we don't want a\n// dependency on any particular testing framework here. Instead we'll just maintain this supported\n// list of keys and let individual concrete `HarnessEnvironment` classes map them to whatever key\n// representation is used in its respective testing framework.\n// tslint:disable-next-line:prefer-const-enum Seems like this causes some issues with System.js\nexport enum TestKey {\n BACKSPACE,\n TAB,\n ENTER,\n SHIFT,\n CONTROL,\n ALT,\n ESCAPE,\n PAGE_UP,\n PAGE_DOWN,\n END,\n HOME,\n LEFT_ARROW,\n UP_ARROW,\n RIGHT_ARROW,\n DOWN_ARROW,\n INSERT,\n DELETE,\n F1,\n F2,\n F3,\n F4,\n F5,\n F6,\n F7,\n F8,\n F9,\n F10,\n F11,\n F12,\n META\n}\n\n/**\n * This acts as a common interface for DOM elements across both unit and e2e tests. It is the\n * interface through which the ComponentHarness interacts with the component's DOM.\n */\nexport interface TestElement {\n /** Blur the element. */\n blur(): Promise<void>;\n\n /** Clear the element's input (for input and textarea elements only). */\n clear(): Promise<void>;\n\n /** Click the element at the element's center. */\n click(): Promise<void>;\n\n /**\n * Click the element at the specified coordinates relative to the top-left of the element.\n * @param relativeX Coordinate within the element, along the X-axis at which to click.\n * @param relativeY Coordinate within the element, along the Y-axis at which to click.\n */\n click(relativeX: number, relativeY: number): Promise<void>;\n\n /** Focus the element. */\n focus(): Promise<void>;\n\n /** Get the computed value of the given CSS property for the element. */\n getCssValue(property: string): Promise<string>;\n\n /** Hovers the mouse over the element. */\n hover(): Promise<void>;\n\n /** Moves the mouse away from the element. */\n mouseAway(): Promise<void>;\n\n /**\n * Sends the given string to the input as a series of key presses. Also fires input events\n * and attempts to add the string to the Element's value.\n */\n sendKeys(...keys: (string | TestKey)[]): Promise<void>;\n\n /**\n * Sends the given string to the input as a series of key presses. Also fires input events\n * and attempts to add the string to the Element's value.\n */\n sendKeys(modifiers: ModifierKeys, ...keys: (string | TestKey)[]): Promise<void>;\n\n /** Gets the text from the element. */\n text(): Promise<string>;\n\n /** Gets the value for the given attribute from the element. */\n getAttribute(name: string): Promise<string | null>;\n\n /** Checks whether the element has the given class. */\n hasClass(name: string): Promise<boolean>;\n\n /** Gets the dimensions of the element. */\n getDimensions(): Promise<ElementDimensions>;\n\n /** Gets the value of a property of an element. */\n getProperty(name: string): Promise<any>;\n\n /**\n * Sets the value of a property of an input.\n * @breaking-change 11.0.0 To become a required method.\n */\n setInputValue?(value: string): Promise<void>;\n\n /** Checks whether this element matches the given selector. */\n matchesSelector(selector: string): Promise<boolean>;\n\n /** Checks whether the element is focused. */\n isFocused(): Promise<boolean>;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n /**\n * Dimensions for element size and its position relative to the viewport.\n */\nexport interface ElementDimensions {\n top: number;\n left: number;\n width: number;\n height: number;\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\nexport * from './component-harness';\nexport * from './harness-environment';\nexport * from './test-element';\nexport * from './element-dimensions';\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\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;;;AAiPA;;;;;AAKA,MAAsB,gBAAgB;IACpC,YAA+B,cAA8B;QAA9B,mBAAc,GAAd,cAAc,CAAgB;KAAI;;IAG3D,IAAI;;YACR,OAAO,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC;SACxC;KAAA;;;;;;IAOS,0BAA0B;QAClC,OAAO,IAAI,CAAC,cAAc,CAAC,0BAA0B,EAAE,CAAC;KACzD;;;;;;;;;;;;;;;;;;;;;;IAuBS,UAAU,CAA2C,GAAG,OAAU;QAE1E,OAAO,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,CAAC;KACnD;;;;;;;;;;;;;;;;;;;;;;IAuBS,kBAAkB,CAA2C,GAAG,OAAU;QAElF,OAAO,IAAI,CAAC,cAAc,CAAC,kBAAkB,CAAC,GAAG,OAAO,CAAC,CAAC;KAC3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAsCS,aAAa,CAA2C,GAAG,OAAU;QAE7E,OAAO,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC,CAAC;KACtD;;;;;;IAOe,cAAc;;YAC5B,OAAO,IAAI,CAAC,cAAc,CAAC,cAAc,EAAE,CAAC;SAC7C;KAAA;;;;;IAMe,0BAA0B;;YACxC,OAAO,IAAI,CAAC,cAAc,CAAC,0BAA0B,EAAE,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AAA;IACF,oCAAG,CAAA;IACH,oCAAG,CAAA;IACH,oCAAG,CAAA;IACH,sCAAI,CAAA;CACL,EA/BW,OAAO,KAAP,OAAO,QA+BlB;;ACxDD;;;;;;GAMG;;ACNH;;;;;;GAMG;;ACNH;;;;;;GAMG;;;;"}
1
+ {"version":3,"file":"testing.js","sources":["../../../../../../src/cdk/testing/component-harness.ts","../../../../../../src/cdk/testing/harness-environment.ts","../../../../../../src/cdk/testing/test-element.ts","../../../../../../src/cdk/testing/element-dimensions.ts","../../../../../../src/cdk/testing/public-api.ts","../../../../../../src/cdk/testing/index.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 {TestElement} from './test-element';\n\n/** An async function that returns a promise when called. */\nexport type AsyncFactoryFn<T> = () => Promise<T>;\n\n/** An async function that takes an item and returns a boolean promise */\nexport type AsyncPredicate<T> = (item: T) => Promise<boolean>;\n\n/** An async function that takes an item and an option value and returns a boolean promise. */\nexport type AsyncOptionPredicate<T, O> = (item: T, option: O) => Promise<boolean>;\n\n/**\n * A query for a `ComponentHarness`, which is expressed as either a `ComponentHarnessConstructor` or\n * a `HarnessPredicate`.\n */\nexport type HarnessQuery<T extends ComponentHarness> =\n ComponentHarnessConstructor<T> | HarnessPredicate<T>;\n\n/**\n * The result type obtained when searching using a particular list of queries. This type depends on\n * the particular items being queried.\n * - If one of the queries is for a `ComponentHarnessConstructor<C1>`, it means that the result\n * might be a harness of type `C1`\n * - If one of the queries is for a `HarnessPredicate<C2>`, it means that the result might be a\n * harness of type `C2`\n * - If one of the queries is for a `string`, it means that the result might be a `TestElement`.\n *\n * Since we don't know for sure which query will match, the result type if the union of the types\n * for all possible results.\n *\n * e.g.\n * The type:\n * `LocatorFnResult&lt;[\n * ComponentHarnessConstructor&lt;MyHarness&gt;,\n * HarnessPredicate&lt;MyOtherHarness&gt;,\n * string\n * ]&gt;`\n * is equivalent to:\n * `MyHarness | MyOtherHarness | TestElement`.\n */\nexport type LocatorFnResult<T extends (HarnessQuery<any> | string)[]> = {\n [I in keyof T]:\n // Map `ComponentHarnessConstructor<C>` to `C`.\n T[I] extends new (...args: any[]) => infer C ? C :\n // Map `HarnessPredicate<C>` to `C`.\n T[I] extends { harnessType: new (...args: any[]) => infer C } ? C :\n // Map `string` to `TestElement`.\n T[I] extends string ? TestElement :\n // Map everything else to `never` (should not happen due to the type constraint on `T`).\n never;\n}[number];\n\n\n/**\n * Interface used to load ComponentHarness objects. This interface is used by test authors to\n * instantiate `ComponentHarness`es.\n */\nexport interface HarnessLoader {\n /**\n * Searches for an element with the given selector under the current instances's root element,\n * and returns a `HarnessLoader` rooted at the matching element. If multiple elements match the\n * selector, the first is used. If no elements match, an error is thrown.\n * @param selector The selector for the root element of the new `HarnessLoader`\n * @return A `HarnessLoader` rooted at the element matching the given selector.\n * @throws If a matching element can't be found.\n */\n getChildLoader(selector: string): Promise<HarnessLoader>;\n\n /**\n * Searches for all elements with the given selector under the current instances's root element,\n * and returns an array of `HarnessLoader`s, one for each matching element, rooted at that\n * element.\n * @param selector The selector for the root element of the new `HarnessLoader`\n * @return A list of `HarnessLoader`s, one for each matching element, rooted at that element.\n */\n getAllChildLoaders(selector: string): Promise<HarnessLoader[]>;\n\n /**\n * Searches for an instance of the component corresponding to the given harness type under the\n * `HarnessLoader`'s root element, and returns a `ComponentHarness` for that instance. If multiple\n * matching components are found, a harness for the first one is returned. If no matching\n * component is found, an error is thrown.\n * @param query A query for a harness to create\n * @return An instance of the given harness type\n * @throws If a matching component instance can't be found.\n */\n getHarness<T extends ComponentHarness>(query: HarnessQuery<T>): Promise<T>;\n\n /**\n * Searches for all instances of the component corresponding to the given harness type under the\n * `HarnessLoader`'s root element, and returns a list `ComponentHarness` for each instance.\n * @param query A query for a harness to create\n * @return A list instances of the given harness type.\n */\n getAllHarnesses<T extends ComponentHarness>(query: HarnessQuery<T>): Promise<T[]>;\n}\n\n/**\n * Interface used to create asynchronous locator functions used find elements and component\n * harnesses. This interface is used by `ComponentHarness` authors to create locator functions for\n * their `ComponentHarness` subclass.\n */\nexport interface LocatorFactory {\n /** Gets a locator factory rooted at the document root. */\n documentRootLocatorFactory(): LocatorFactory;\n\n /** The root element of this `LocatorFactory` as a `TestElement`. */\n rootElement: TestElement;\n\n /**\n * Creates an asynchronous locator function that can be used to find a `ComponentHarness` instance\n * or element under the root element of this `LocatorFactory`.\n * @param queries A list of queries specifying which harnesses and elements to search for:\n * - A `string` searches for elements matching the CSS selector specified by the string.\n * - A `ComponentHarness` constructor searches for `ComponentHarness` instances matching the\n * given class.\n * - A `HarnessPredicate` searches for `ComponentHarness` instances matching the given\n * predicate.\n * @return An asynchronous locator function that searches for and returns a `Promise` for the\n * first element or harness matching the given search criteria. Matches are ordered first by\n * order in the DOM, and second by order in the queries list. If no matches are found, the\n * `Promise` rejects. The type that the `Promise` resolves to is a union of all result types for\n * each query.\n *\n * e.g. Given the following DOM: `<div id=\"d1\" /><div id=\"d2\" />`, and assuming\n * `DivHarness.hostSelector === 'div'`:\n * - `await lf.locatorFor(DivHarness, 'div')()` gets a `DivHarness` instance for `#d1`\n * - `await lf.locatorFor('div', DivHarness)()` gets a `TestElement` instance for `#d1`\n * - `await lf.locatorFor('span')()` throws because the `Promise` rejects.\n */\n locatorFor<T extends (HarnessQuery<any> | string)[]>(...queries: T):\n AsyncFactoryFn<LocatorFnResult<T>>;\n\n /**\n * Creates an asynchronous locator function that can be used to find a `ComponentHarness` instance\n * or element under the root element of this `LocatorFactory`.\n * @param queries A list of queries specifying which harnesses and elements to search for:\n * - A `string` searches for elements matching the CSS selector specified by the string.\n * - A `ComponentHarness` constructor searches for `ComponentHarness` instances matching the\n * given class.\n * - A `HarnessPredicate` searches for `ComponentHarness` instances matching the given\n * predicate.\n * @return An asynchronous locator function that searches for and returns a `Promise` for the\n * first element or harness matching the given search criteria. Matches are ordered first by\n * order in the DOM, and second by order in the queries list. If no matches are found, the\n * `Promise` is resolved with `null`. The type that the `Promise` resolves to is a union of all\n * result types for each query or null.\n *\n * e.g. Given the following DOM: `<div id=\"d1\" /><div id=\"d2\" />`, and assuming\n * `DivHarness.hostSelector === 'div'`:\n * - `await lf.locatorForOptional(DivHarness, 'div')()` gets a `DivHarness` instance for `#d1`\n * - `await lf.locatorForOptional('div', DivHarness)()` gets a `TestElement` instance for `#d1`\n * - `await lf.locatorForOptional('span')()` gets `null`.\n */\n locatorForOptional<T extends (HarnessQuery<any> | string)[]>(...queries: T):\n AsyncFactoryFn<LocatorFnResult<T> | null>;\n\n /**\n * Creates an asynchronous locator function that can be used to find `ComponentHarness` instances\n * or elements under the root element of this `LocatorFactory`.\n * @param queries A list of queries specifying which harnesses and elements to search for:\n * - A `string` searches for elements matching the CSS selector specified by the string.\n * - A `ComponentHarness` constructor searches for `ComponentHarness` instances matching the\n * given class.\n * - A `HarnessPredicate` searches for `ComponentHarness` instances matching the given\n * predicate.\n * @return An asynchronous locator function that searches for and returns a `Promise` for all\n * elements and harnesses matching the given search criteria. Matches are ordered first by\n * order in the DOM, and second by order in the queries list. If an element matches more than\n * one `ComponentHarness` class, the locator gets an instance of each for the same element. If\n * an element matches multiple `string` selectors, only one `TestElement` instance is returned\n * for that element. The type that the `Promise` resolves to is an array where each element is\n * the union of all result types for each query.\n *\n * e.g. Given the following DOM: `<div id=\"d1\" /><div id=\"d2\" />`, and assuming\n * `DivHarness.hostSelector === 'div'` and `IdIsD1Harness.hostSelector === '#d1'`:\n * - `await lf.locatorForAll(DivHarness, 'div')()` gets `[\n * DivHarness, // for #d1\n * TestElement, // for #d1\n * DivHarness, // for #d2\n * TestElement // for #d2\n * ]`\n * - `await lf.locatorForAll('div', '#d1')()` gets `[\n * TestElement, // for #d1\n * TestElement // for #d2\n * ]`\n * - `await lf.locatorForAll(DivHarness, IdIsD1Harness)()` gets `[\n * DivHarness, // for #d1\n * IdIsD1Harness, // for #d1\n * DivHarness // for #d2\n * ]`\n * - `await lf.locatorForAll('span')()` gets `[]`.\n */\n locatorForAll<T extends (HarnessQuery<any> | string)[]>(...queries: T):\n AsyncFactoryFn<LocatorFnResult<T>[]>;\n\n /** @return A `HarnessLoader` rooted at the root element of this `LocatorFactory`. */\n rootHarnessLoader(): Promise<HarnessLoader>;\n\n /**\n * Gets a `HarnessLoader` instance for an element under the root of this `LocatorFactory`.\n * @param selector The selector for the root element.\n * @return A `HarnessLoader` rooted at the first element matching the given selector.\n * @throws If no matching element is found for the given selector.\n */\n harnessLoaderFor(selector: string): Promise<HarnessLoader>;\n\n /**\n * Gets a `HarnessLoader` instance for an element under the root of this `LocatorFactory`\n * @param selector The selector for the root element.\n * @return A `HarnessLoader` rooted at the first element matching the given selector, or null if\n * no matching element is found.\n */\n harnessLoaderForOptional(selector: string): Promise<HarnessLoader | null>;\n\n /**\n * Gets a list of `HarnessLoader` instances, one for each matching element.\n * @param selector The selector for the root element.\n * @return A list of `HarnessLoader`, one rooted at each element matching the given selector.\n */\n harnessLoaderForAll(selector: string): Promise<HarnessLoader[]>;\n\n /**\n * Flushes change detection and async tasks captured in the Angular zone.\n * In most cases it should not be necessary to call this manually. However, there may be some edge\n * cases where it is needed to fully flush animation events.\n */\n forceStabilize(): Promise<void>;\n\n /**\n * Waits for all scheduled or running async tasks to complete. This allows harness\n * authors to wait for async tasks outside of the Angular zone.\n */\n waitForTasksOutsideAngular(): Promise<void>;\n}\n\n/**\n * Base class for component harnesses that all component harness authors should extend. This base\n * component harness provides the basic ability to locate element and sub-component harness. It\n * should be inherited when defining user's own harness.\n */\nexport abstract class ComponentHarness {\n constructor(protected readonly locatorFactory: LocatorFactory) {}\n\n /** Gets a `Promise` for the `TestElement` representing the host element of the component. */\n async host(): Promise<TestElement> {\n return this.locatorFactory.rootElement;\n }\n\n /**\n * Gets a `LocatorFactory` for the document root element. This factory can be used to create\n * locators for elements that a component creates outside of its own root element. (e.g. by\n * appending to document.body).\n */\n protected documentRootLocatorFactory(): LocatorFactory {\n return this.locatorFactory.documentRootLocatorFactory();\n }\n\n /**\n * Creates an asynchronous locator function that can be used to find a `ComponentHarness` instance\n * or element under the host element of this `ComponentHarness`.\n * @param queries A list of queries specifying which harnesses and elements to search for:\n * - A `string` searches for elements matching the CSS selector specified by the string.\n * - A `ComponentHarness` constructor searches for `ComponentHarness` instances matching the\n * given class.\n * - A `HarnessPredicate` searches for `ComponentHarness` instances matching the given\n * predicate.\n * @return An asynchronous locator function that searches for and returns a `Promise` for the\n * first element or harness matching the given search criteria. Matches are ordered first by\n * order in the DOM, and second by order in the queries list. If no matches are found, the\n * `Promise` rejects. The type that the `Promise` resolves to is a union of all result types for\n * each query.\n *\n * e.g. Given the following DOM: `<div id=\"d1\" /><div id=\"d2\" />`, and assuming\n * `DivHarness.hostSelector === 'div'`:\n * - `await ch.locatorFor(DivHarness, 'div')()` gets a `DivHarness` instance for `#d1`\n * - `await ch.locatorFor('div', DivHarness)()` gets a `TestElement` instance for `#d1`\n * - `await ch.locatorFor('span')()` throws because the `Promise` rejects.\n */\n protected locatorFor<T extends (HarnessQuery<any> | string)[]>(...queries: T):\n AsyncFactoryFn<LocatorFnResult<T>> {\n return this.locatorFactory.locatorFor(...queries);\n }\n\n /**\n * Creates an asynchronous locator function that can be used to find a `ComponentHarness` instance\n * or element under the host element of this `ComponentHarness`.\n * @param queries A list of queries specifying which harnesses and elements to search for:\n * - A `string` searches for elements matching the CSS selector specified by the string.\n * - A `ComponentHarness` constructor searches for `ComponentHarness` instances matching the\n * given class.\n * - A `HarnessPredicate` searches for `ComponentHarness` instances matching the given\n * predicate.\n * @return An asynchronous locator function that searches for and returns a `Promise` for the\n * first element or harness matching the given search criteria. Matches are ordered first by\n * order in the DOM, and second by order in the queries list. If no matches are found, the\n * `Promise` is resolved with `null`. The type that the `Promise` resolves to is a union of all\n * result types for each query or null.\n *\n * e.g. Given the following DOM: `<div id=\"d1\" /><div id=\"d2\" />`, and assuming\n * `DivHarness.hostSelector === 'div'`:\n * - `await ch.locatorForOptional(DivHarness, 'div')()` gets a `DivHarness` instance for `#d1`\n * - `await ch.locatorForOptional('div', DivHarness)()` gets a `TestElement` instance for `#d1`\n * - `await ch.locatorForOptional('span')()` gets `null`.\n */\n protected locatorForOptional<T extends (HarnessQuery<any> | string)[]>(...queries: T):\n AsyncFactoryFn<LocatorFnResult<T> | null> {\n return this.locatorFactory.locatorForOptional(...queries);\n }\n\n /**\n * Creates an asynchronous locator function that can be used to find `ComponentHarness` instances\n * or elements under the host element of this `ComponentHarness`.\n * @param queries A list of queries specifying which harnesses and elements to search for:\n * - A `string` searches for elements matching the CSS selector specified by the string.\n * - A `ComponentHarness` constructor searches for `ComponentHarness` instances matching the\n * given class.\n * - A `HarnessPredicate` searches for `ComponentHarness` instances matching the given\n * predicate.\n * @return An asynchronous locator function that searches for and returns a `Promise` for all\n * elements and harnesses matching the given search criteria. Matches are ordered first by\n * order in the DOM, and second by order in the queries list. If an element matches more than\n * one `ComponentHarness` class, the locator gets an instance of each for the same element. If\n * an element matches multiple `string` selectors, only one `TestElement` instance is returned\n * for that element. The type that the `Promise` resolves to is an array where each element is\n * the union of all result types for each query.\n *\n * e.g. Given the following DOM: `<div id=\"d1\" /><div id=\"d2\" />`, and assuming\n * `DivHarness.hostSelector === 'div'` and `IdIsD1Harness.hostSelector === '#d1'`:\n * - `await ch.locatorForAll(DivHarness, 'div')()` gets `[\n * DivHarness, // for #d1\n * TestElement, // for #d1\n * DivHarness, // for #d2\n * TestElement // for #d2\n * ]`\n * - `await ch.locatorForAll('div', '#d1')()` gets `[\n * TestElement, // for #d1\n * TestElement // for #d2\n * ]`\n * - `await ch.locatorForAll(DivHarness, IdIsD1Harness)()` gets `[\n * DivHarness, // for #d1\n * IdIsD1Harness, // for #d1\n * DivHarness // for #d2\n * ]`\n * - `await ch.locatorForAll('span')()` gets `[]`.\n */\n protected locatorForAll<T extends (HarnessQuery<any> | string)[]>(...queries: T):\n AsyncFactoryFn<LocatorFnResult<T>[]> {\n return this.locatorFactory.locatorForAll(...queries);\n }\n\n /**\n * Flushes change detection and async tasks in the Angular zone.\n * In most cases it should not be necessary to call this manually. However, there may be some edge\n * cases where it is needed to fully flush animation events.\n */\n protected async forceStabilize() {\n return this.locatorFactory.forceStabilize();\n }\n\n /**\n * Waits for all scheduled or running async tasks to complete. This allows harness\n * authors to wait for async tasks outside of the Angular zone.\n */\n protected async waitForTasksOutsideAngular() {\n return this.locatorFactory.waitForTasksOutsideAngular();\n }\n}\n\n\n/**\n * Base class for component harnesses that authors should extend if they anticipate that consumers\n * of the harness may want to access other harnesses within the `<ng-content>` of the component.\n */\nexport abstract class ContentContainerComponentHarness<S extends string = string>\n extends ComponentHarness implements HarnessLoader {\n\n getChildLoader(selector: S): Promise<HarnessLoader> {\n return this.locatorFactory.harnessLoaderFor(selector);\n }\n\n getAllChildLoaders(selector: S): Promise<HarnessLoader[]> {\n return this.locatorFactory.harnessLoaderForAll(selector);\n }\n\n getHarness<T extends ComponentHarness>(query: HarnessQuery<T>): Promise<T> {\n return this.locatorFor(query)();\n }\n\n getAllHarnesses<T extends ComponentHarness>(query: HarnessQuery<T>): Promise<T[]> {\n return this.locatorForAll(query)();\n }\n}\n\n/** Constructor for a ComponentHarness subclass. */\nexport interface ComponentHarnessConstructor<T extends ComponentHarness> {\n new(locatorFactory: LocatorFactory): T;\n\n /**\n * `ComponentHarness` subclasses must specify a static `hostSelector` property that is used to\n * find the host element for the corresponding component. This property should match the selector\n * for the Angular component.\n */\n hostSelector: string;\n}\n\n/** A set of criteria that can be used to filter a list of `ComponentHarness` instances. */\nexport interface BaseHarnessFilters {\n /** Only find instances whose host element matches the given selector. */\n selector?: string;\n /** Only find instances that are nested under an element with the given selector. */\n ancestor?: string;\n}\n\n/**\n * A class used to associate a ComponentHarness class with predicates functions that can be used to\n * filter instances of the class.\n */\nexport class HarnessPredicate<T extends ComponentHarness> {\n private _predicates: AsyncPredicate<T>[] = [];\n private _descriptions: string[] = [];\n private _ancestor: string;\n\n constructor(public harnessType: ComponentHarnessConstructor<T>, options: BaseHarnessFilters) {\n this._addBaseOptions(options);\n }\n\n /**\n * Checks if the specified nullable string value matches the given pattern.\n * @param value The nullable string value to check, or a Promise resolving to the\n * nullable string value.\n * @param pattern The pattern the value is expected to match. If `pattern` is a string,\n * `value` is expected to match exactly. If `pattern` is a regex, a partial match is\n * allowed. If `pattern` is `null`, the value is expected to be `null`.\n * @return Whether the value matches the pattern.\n */\n static async stringMatches(value: string | null | Promise<string | null>,\n pattern: string | RegExp | null): Promise<boolean> {\n value = await value;\n if (pattern === null) {\n return value === null;\n } else if (value === null) {\n return false;\n }\n return typeof pattern === 'string' ? value === pattern : pattern.test(value);\n }\n\n /**\n * Adds a predicate function to be run against candidate harnesses.\n * @param description A description of this predicate that may be used in error messages.\n * @param predicate An async predicate function.\n * @return this (for method chaining).\n */\n add(description: string, predicate: AsyncPredicate<T>) {\n this._descriptions.push(description);\n this._predicates.push(predicate);\n return this;\n }\n\n /**\n * Adds a predicate function that depends on an option value to be run against candidate\n * harnesses. If the option value is undefined, the predicate will be ignored.\n * @param name The name of the option (may be used in error messages).\n * @param option The option value.\n * @param predicate The predicate function to run if the option value is not undefined.\n * @return this (for method chaining).\n */\n addOption<O>(name: string, option: O | undefined, predicate: AsyncOptionPredicate<T, O>) {\n if (option !== undefined) {\n this.add(`${name} = ${_valueAsString(option)}`, item => predicate(item, option));\n }\n return this;\n }\n\n /**\n * Filters a list of harnesses on this predicate.\n * @param harnesses The list of harnesses to filter.\n * @return A list of harnesses that satisfy this predicate.\n */\n async filter(harnesses: T[]): Promise<T[]> {\n const results = await Promise.all(harnesses.map(h => this.evaluate(h)));\n return harnesses.filter((_, i) => results[i]);\n }\n\n /**\n * Evaluates whether the given harness satisfies this predicate.\n * @param harness The harness to check\n * @return A promise that resolves to true if the harness satisfies this predicate,\n * and resolves to false otherwise.\n */\n async evaluate(harness: T): Promise<boolean> {\n const results = await Promise.all(this._predicates.map(p => p(harness)));\n return results.reduce((combined, current) => combined && current, true);\n }\n\n /** Gets a description of this predicate for use in error messages. */\n getDescription() {\n return this._descriptions.join(', ');\n }\n\n /** Gets the selector used to find candidate elements. */\n getSelector() {\n return this._ancestor.split(',')\n .map(part => `${part.trim()} ${this.harnessType.hostSelector}`.trim())\n .join(',');\n }\n\n /** Adds base options common to all harness types. */\n private _addBaseOptions(options: BaseHarnessFilters) {\n this._ancestor = options.ancestor || '';\n if (this._ancestor) {\n this._descriptions.push(`has ancestor matching selector \"${this._ancestor}\"`);\n }\n const selector = options.selector;\n if (selector !== undefined) {\n this.add(`host matches selector \"${selector}\"`, async item => {\n return (await item.host()).matchesSelector(selector);\n });\n }\n }\n}\n\n/** Represent a value as a string for the purpose of logging. */\nfunction _valueAsString(value: unknown) {\n if (value === undefined) {\n return 'undefined';\n }\n // `JSON.stringify` doesn't handle RegExp properly, so we need a custom replacer.\n try {\n return JSON.stringify(value, (_, v) => {\n if (v instanceof RegExp) {\n return `/${v.toString()}/`;\n }\n\n return typeof v === 'string' ? v.replace('/\\//g', '\\\\/') : v;\n }).replace(/\"\\/\\//g, '\\\\/').replace(/\\/\\/\"/g, '\\\\/').replace(/\\\\\\//g, '/');\n } catch {\n // `JSON.stringify` will throw if the object is cyclical,\n // in this case the best we can do is report the value as `{...}`.\n return '{...}';\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 {\n AsyncFactoryFn,\n ComponentHarness,\n ComponentHarnessConstructor,\n HarnessLoader,\n HarnessPredicate,\n HarnessQuery,\n LocatorFactory,\n LocatorFnResult,\n} from './component-harness';\nimport {TestElement} from './test-element';\n\n/** Parsed form of the queries passed to the `locatorFor*` methods. */\ntype ParsedQueries<T extends ComponentHarness> = {\n /** The full list of queries, in their original order. */\n allQueries: (string | HarnessPredicate<T>)[],\n /**\n * A filtered view of `allQueries` containing only the queries that are looking for a\n * `ComponentHarness`\n */\n harnessQueries: HarnessPredicate<T>[],\n /**\n * A filtered view of `allQueries` containing only the queries that are looking for a\n * `TestElement`\n */\n elementQueries: string[],\n /** The set of all `ComponentHarness` subclasses represented in the original query list. */\n harnessTypes: Set<ComponentHarnessConstructor<T>>,\n};\n\n/**\n * Base harness environment class that can be extended to allow `ComponentHarness`es to be used in\n * different test environments (e.g. testbed, protractor, etc.). This class implements the\n * functionality of both a `HarnessLoader` and `LocatorFactory`. This class is generic on the raw\n * element type, `E`, used by the particular test environment.\n */\nexport abstract class HarnessEnvironment<E> implements HarnessLoader, LocatorFactory {\n // Implemented as part of the `LocatorFactory` interface.\n rootElement: TestElement;\n\n protected constructor(protected rawRootElement: E) {\n this.rootElement = this.createTestElement(rawRootElement);\n }\n\n // Implemented as part of the `LocatorFactory` interface.\n documentRootLocatorFactory(): LocatorFactory {\n return this.createEnvironment(this.getDocumentRoot());\n }\n\n // Implemented as part of the `LocatorFactory` interface.\n locatorFor<T extends (HarnessQuery<any> | string)[]>(...queries: T):\n AsyncFactoryFn<LocatorFnResult<T>> {\n return () => _assertResultFound(\n this._getAllHarnessesAndTestElements(queries),\n _getDescriptionForLocatorForQueries(queries));\n }\n\n // Implemented as part of the `LocatorFactory` interface.\n locatorForOptional<T extends (HarnessQuery<any> | string)[]>(...queries: T):\n AsyncFactoryFn<LocatorFnResult<T> | null> {\n return async () => (await this._getAllHarnessesAndTestElements(queries))[0] || null;\n }\n\n // Implemented as part of the `LocatorFactory` interface.\n locatorForAll<T extends (HarnessQuery<any> | string)[]>(...queries: T):\n AsyncFactoryFn<LocatorFnResult<T>[]> {\n return () => this._getAllHarnessesAndTestElements(queries);\n }\n\n // Implemented as part of the `LocatorFactory` interface.\n async rootHarnessLoader(): Promise<HarnessLoader> {\n return this;\n }\n\n // Implemented as part of the `LocatorFactory` interface.\n async harnessLoaderFor(selector: string): Promise<HarnessLoader> {\n return this.createEnvironment(await _assertResultFound(this.getAllRawElements(selector),\n [_getDescriptionForHarnessLoaderQuery(selector)]));\n }\n\n // Implemented as part of the `LocatorFactory` interface.\n async harnessLoaderForOptional(selector: string): Promise<HarnessLoader | null> {\n const elements = await this.getAllRawElements(selector);\n return elements[0] ? this.createEnvironment(elements[0]) : null;\n }\n\n // Implemented as part of the `LocatorFactory` interface.\n async harnessLoaderForAll(selector: string): Promise<HarnessLoader[]> {\n const elements = await this.getAllRawElements(selector);\n return elements.map(element => this.createEnvironment(element));\n }\n\n // Implemented as part of the `HarnessLoader` interface.\n getHarness<T extends ComponentHarness>(query: HarnessQuery<T>): Promise<T> {\n return this.locatorFor(query)();\n }\n\n // Implemented as part of the `HarnessLoader` interface.\n getAllHarnesses<T extends ComponentHarness>(query: HarnessQuery<T>): Promise<T[]> {\n return this.locatorForAll(query)();\n }\n\n // Implemented as part of the `HarnessLoader` interface.\n async getChildLoader(selector: string): Promise<HarnessLoader> {\n return this.createEnvironment(await _assertResultFound(this.getAllRawElements(selector),\n [_getDescriptionForHarnessLoaderQuery(selector)]));\n }\n\n // Implemented as part of the `HarnessLoader` interface.\n async getAllChildLoaders(selector: string): Promise<HarnessLoader[]> {\n return (await this.getAllRawElements(selector)).map(e => this.createEnvironment(e));\n }\n\n /** Creates a `ComponentHarness` for the given harness type with the given raw host element. */\n protected createComponentHarness<T extends ComponentHarness>(\n harnessType: ComponentHarnessConstructor<T>, element: E): T {\n return new harnessType(this.createEnvironment(element));\n }\n\n // Part of LocatorFactory interface, subclasses will implement.\n abstract forceStabilize(): Promise<void>;\n\n // Part of LocatorFactory interface, subclasses will implement.\n abstract waitForTasksOutsideAngular(): Promise<void>;\n\n /** Gets the root element for the document. */\n protected abstract getDocumentRoot(): E;\n\n /** Creates a `TestElement` from a raw element. */\n protected abstract createTestElement(element: E): TestElement;\n\n /** Creates a `HarnessLoader` rooted at the given raw element. */\n protected abstract createEnvironment(element: E): HarnessEnvironment<E>;\n\n /**\n * Gets a list of all elements matching the given selector under this environment's root element.\n */\n protected abstract getAllRawElements(selector: string): Promise<E[]>;\n\n /**\n * Matches the given raw elements with the given list of element and harness queries to produce a\n * list of matched harnesses and test elements.\n */\n private async _getAllHarnessesAndTestElements<T extends (HarnessQuery<any> | string)[]>(\n queries: T): Promise<LocatorFnResult<T>[]> {\n const {allQueries, harnessQueries, elementQueries, harnessTypes} = _parseQueries(queries);\n\n // Combine all of the queries into one large comma-delimited selector and use it to get all raw\n // elements matching any of the individual queries.\n const rawElements = await this.getAllRawElements(\n [...elementQueries, ...harnessQueries.map(predicate => predicate.getSelector())].join(','));\n\n // If every query is searching for the same harness subclass, we know every result corresponds\n // to an instance of that subclass. Likewise, if every query is for a `TestElement`, we know\n // every result corresponds to a `TestElement`. Otherwise we need to verify which result was\n // found by which selector so it can be matched to the appropriate instance.\n const skipSelectorCheck = (elementQueries.length === 0 && harnessTypes.size === 1) ||\n harnessQueries.length === 0;\n\n const perElementMatches = await Promise.all(rawElements.map(async rawElement => {\n const testElement = this.createTestElement(rawElement);\n const allResultsForElement = await Promise.all(\n // For each query, get `null` if it doesn't match, or a `TestElement` or\n // `ComponentHarness` as appropriate if it does match. This gives us everything that\n // matches the current raw element, but it may contain duplicate entries (e.g. multiple\n // `TestElement` or multiple `ComponentHarness` of the same type.\n allQueries.map(query =>\n this._getQueryResultForElement(query, rawElement, testElement, skipSelectorCheck)));\n return _removeDuplicateQueryResults(allResultsForElement);\n }));\n return ([] as any).concat(...perElementMatches);\n }\n\n /**\n * Check whether the given query matches the given element, if it does return the matched\n * `TestElement` or `ComponentHarness`, if it does not, return null. In cases where the caller\n * knows for sure that the query matches the element's selector, `skipSelectorCheck` can be used\n * to skip verification and optimize performance.\n */\n private async _getQueryResultForElement<T extends ComponentHarness>(\n query: string | HarnessPredicate<T>, rawElement: E, testElement: TestElement,\n skipSelectorCheck: boolean = false): Promise<T | TestElement | null> {\n if (typeof query === 'string') {\n return ((skipSelectorCheck || await testElement.matchesSelector(query)) ? testElement : null);\n }\n if (skipSelectorCheck || await testElement.matchesSelector(query.getSelector())) {\n const harness = this.createComponentHarness(query.harnessType, rawElement);\n return (await query.evaluate(harness)) ? harness : null;\n }\n return null;\n }\n}\n\n/**\n * Parses a list of queries in the format accepted by the `locatorFor*` methods into an easier to\n * work with format.\n */\nfunction _parseQueries<T extends (HarnessQuery<any> | string)[]>(queries: T):\n ParsedQueries<LocatorFnResult<T> & ComponentHarness> {\n const allQueries = [];\n const harnessQueries = [];\n const elementQueries = [];\n const harnessTypes =\n new Set<ComponentHarnessConstructor<LocatorFnResult<T> & ComponentHarness>>();\n\n for (const query of queries) {\n if (typeof query === 'string') {\n allQueries.push(query);\n elementQueries.push(query);\n } else {\n const predicate = query instanceof HarnessPredicate ? query : new HarnessPredicate(query, {});\n allQueries.push(predicate);\n harnessQueries.push(predicate);\n harnessTypes.add(predicate.harnessType);\n }\n }\n\n return {allQueries, harnessQueries, elementQueries, harnessTypes};\n}\n\n/**\n * Removes duplicate query results for a particular element. (e.g. multiple `TestElement`\n * instances or multiple instances of the same `ComponentHarness` class.\n */\nasync function _removeDuplicateQueryResults<T extends (ComponentHarness | TestElement | null)[]>(\n results: T): Promise<T> {\n let testElementMatched = false;\n let matchedHarnessTypes = new Set();\n const dedupedMatches = [];\n for (const result of results) {\n if (!result) {\n continue;\n }\n if (result instanceof ComponentHarness) {\n if (!matchedHarnessTypes.has(result.constructor)) {\n matchedHarnessTypes.add(result.constructor);\n dedupedMatches.push(result);\n }\n } else if (!testElementMatched) {\n testElementMatched = true;\n dedupedMatches.push(result);\n }\n }\n return dedupedMatches as T;\n}\n\n/** Verifies that there is at least one result in an array. */\nasync function _assertResultFound<T>(results: Promise<T[]>, queryDescriptions: string[]):\n Promise<T> {\n const result = (await results)[0];\n if (result == undefined) {\n throw Error(`Failed to find element matching one of the following queries:\\n` +\n queryDescriptions.map(desc => `(${desc})`).join(',\\n'));\n }\n return result;\n}\n\n/** Gets a list of description strings from a list of queries. */\nfunction _getDescriptionForLocatorForQueries(queries: (string | HarnessQuery<any>)[]) {\n return queries.map(query => typeof query === 'string' ?\n _getDescriptionForTestElementQuery(query) : _getDescriptionForComponentHarnessQuery(query));\n}\n\n/** Gets a description string for a `ComponentHarness` query. */\nfunction _getDescriptionForComponentHarnessQuery(query: HarnessQuery<any>) {\n const harnessPredicate =\n query instanceof HarnessPredicate ? query : new HarnessPredicate(query, {});\n const {name, hostSelector} = harnessPredicate.harnessType;\n const description = `${name} with host element matching selector: \"${hostSelector}\"`;\n const constraints = harnessPredicate.getDescription();\n return description + (constraints ?\n ` satisfying the constraints: ${harnessPredicate.getDescription()}` : '');\n}\n\n/** Gets a description string for a `TestElement` query. */\nfunction _getDescriptionForTestElementQuery(selector: string) {\n return `TestElement for element matching selector: \"${selector}\"`;\n}\n\n/** Gets a description string for a `HarnessLoader` query. */\nfunction _getDescriptionForHarnessLoaderQuery(selector: string) {\n return `HarnessLoader for element matching selector: \"${selector}\"`;\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 {ElementDimensions} from './element-dimensions';\n\n/** Modifier keys that may be held while typing. */\nexport interface ModifierKeys {\n control?: boolean;\n alt?: boolean;\n shift?: boolean;\n meta?: boolean;\n}\n\n/** An enum of non-text keys that can be used with the `sendKeys` method. */\n// NOTE: This is a separate enum from `@angular/cdk/keycodes` because we don't necessarily want to\n// support every possible keyCode. We also can't rely on Protractor's `Key` because we don't want a\n// dependency on any particular testing framework here. Instead we'll just maintain this supported\n// list of keys and let individual concrete `HarnessEnvironment` classes map them to whatever key\n// representation is used in its respective testing framework.\n// tslint:disable-next-line:prefer-const-enum Seems like this causes some issues with System.js\nexport enum TestKey {\n BACKSPACE,\n TAB,\n ENTER,\n SHIFT,\n CONTROL,\n ALT,\n ESCAPE,\n PAGE_UP,\n PAGE_DOWN,\n END,\n HOME,\n LEFT_ARROW,\n UP_ARROW,\n RIGHT_ARROW,\n DOWN_ARROW,\n INSERT,\n DELETE,\n F1,\n F2,\n F3,\n F4,\n F5,\n F6,\n F7,\n F8,\n F9,\n F10,\n F11,\n F12,\n META\n}\n\n/**\n * This acts as a common interface for DOM elements across both unit and e2e tests. It is the\n * interface through which the ComponentHarness interacts with the component's DOM.\n */\nexport interface TestElement {\n /** Blur the element. */\n blur(): Promise<void>;\n\n /** Clear the element's input (for input and textarea elements only). */\n clear(): Promise<void>;\n\n /** Click the element at the element's center. */\n click(): Promise<void>;\n\n /**\n * Click the element at the specified coordinates relative to the top-left of the element.\n * @param relativeX Coordinate within the element, along the X-axis at which to click.\n * @param relativeY Coordinate within the element, along the Y-axis at which to click.\n */\n click(relativeX: number, relativeY: number): Promise<void>;\n\n /** Focus the element. */\n focus(): Promise<void>;\n\n /** Get the computed value of the given CSS property for the element. */\n getCssValue(property: string): Promise<string>;\n\n /** Hovers the mouse over the element. */\n hover(): Promise<void>;\n\n /** Moves the mouse away from the element. */\n mouseAway(): Promise<void>;\n\n /**\n * Sends the given string to the input as a series of key presses. Also fires input events\n * and attempts to add the string to the Element's value.\n */\n sendKeys(...keys: (string | TestKey)[]): Promise<void>;\n\n /**\n * Sends the given string to the input as a series of key presses. Also fires input events\n * and attempts to add the string to the Element's value.\n */\n sendKeys(modifiers: ModifierKeys, ...keys: (string | TestKey)[]): Promise<void>;\n\n /** Gets the text from the element. */\n text(): Promise<string>;\n\n /** Gets the value for the given attribute from the element. */\n getAttribute(name: string): Promise<string | null>;\n\n /** Checks whether the element has the given class. */\n hasClass(name: string): Promise<boolean>;\n\n /** Gets the dimensions of the element. */\n getDimensions(): Promise<ElementDimensions>;\n\n /** Gets the value of a property of an element. */\n getProperty(name: string): Promise<any>;\n\n /**\n * Sets the value of a property of an input.\n * @breaking-change 11.0.0 To become a required method.\n */\n setInputValue?(value: string): Promise<void>;\n\n /** Checks whether this element matches the given selector. */\n matchesSelector(selector: string): Promise<boolean>;\n\n /** Checks whether the element is focused. */\n isFocused(): Promise<boolean>;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n /**\n * Dimensions for element size and its position relative to the viewport.\n */\nexport interface ElementDimensions {\n top: number;\n left: number;\n width: number;\n height: number;\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\nexport * from './component-harness';\nexport * from './harness-environment';\nexport * from './test-element';\nexport * from './element-dimensions';\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\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;;;AAoPA;;;;;AAKA,MAAsB,gBAAgB;IACpC,YAA+B,cAA8B;QAA9B,mBAAc,GAAd,cAAc,CAAgB;KAAI;;IAG3D,IAAI;;YACR,OAAO,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC;SACxC;KAAA;;;;;;IAOS,0BAA0B;QAClC,OAAO,IAAI,CAAC,cAAc,CAAC,0BAA0B,EAAE,CAAC;KACzD;;;;;;;;;;;;;;;;;;;;;;IAuBS,UAAU,CAA2C,GAAG,OAAU;QAE1E,OAAO,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,CAAC;KACnD;;;;;;;;;;;;;;;;;;;;;;IAuBS,kBAAkB,CAA2C,GAAG,OAAU;QAElF,OAAO,IAAI,CAAC,cAAc,CAAC,kBAAkB,CAAC,GAAG,OAAO,CAAC,CAAC;KAC3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAsCS,aAAa,CAA2C,GAAG,OAAU;QAE7E,OAAO,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC,CAAC;KACtD;;;;;;IAOe,cAAc;;YAC5B,OAAO,IAAI,CAAC,cAAc,CAAC,cAAc,EAAE,CAAC;SAC7C;KAAA;;;;;IAMe,0BAA0B;;YACxC,OAAO,IAAI,CAAC,cAAc,CAAC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AY,OA+BX;AA/BD,WAAY,OAAO;IACjB,+CAAS,CAAA;IACT,mCAAG,CAAA;IACH,uCAAK,CAAA;IACL,uCAAK,CAAA;IACL,2CAAO,CAAA;IACP,mCAAG,CAAA;IACH,yCAAM,CAAA;IACN,2CAAO,CAAA;IACP,+CAAS,CAAA;IACT,mCAAG,CAAA;IACH,sCAAI,CAAA;IACJ,kDAAU,CAAA;IACV,8CAAQ,CAAA;IACR,oDAAW,CAAA;IACX,kDAAU,CAAA;IACV,0CAAM,CAAA;IACN,0CAAM,CAAA;IACN,kCAAE,CAAA;IACF,kCAAE,CAAA;IACF,kCAAE,CAAA;IACF,kCAAE,CAAA;IACF,kCAAE,CAAA;IACF,kCAAE,CAAA;IACF,kCAAE,CAAA;IACF,kCAAE,CAAA;IACF,kCAAE,CAAA;IACF,oCAAG,CAAA;IACH,oCAAG,CAAA;IACH,oCAAG,CAAA;IACH,sCAAI,CAAA;CACL,EA/BW,OAAO,KAAP,OAAO,QA+BlB;;ACxDD;;;;;;GAMG;;ACNH;;;;;;GAMG;;ACNH;;;;;;GAMG;;;;"}
package/fesm2015/tree.js CHANGED
@@ -122,9 +122,13 @@ class FlatTreeControl extends BaseTreeControl {
122
122
  /** Nested tree control. Able to expand/collapse a subtree recursively for NestedNode type. */
123
123
  class NestedTreeControl extends BaseTreeControl {
124
124
  /** Construct with nested tree function getChildren. */
125
- constructor(getChildren) {
125
+ constructor(getChildren, options) {
126
126
  super();
127
127
  this.getChildren = getChildren;
128
+ this.options = options;
129
+ if (this.options) {
130
+ this.trackBy = this.options.trackBy;
131
+ }
128
132
  }
129
133
  /**
130
134
  * Expands all dataNodes in the tree.
@@ -135,7 +139,7 @@ class NestedTreeControl extends BaseTreeControl {
135
139
  expandAll() {
136
140
  this.expansionModel.clear();
137
141
  const allNodes = this.dataNodes.reduce((accumulator, dataNode) => [...accumulator, ...this.getDescendants(dataNode), dataNode], []);
138
- this.expansionModel.select(...allNodes);
142
+ this.expansionModel.select(...allNodes.map(node => this._trackByValue(node)));
139
143
  }
140
144
  /** Gets a list of descendant dataNodes of a subtree rooted at given data node recursively. */
141
145
  getDescendants(dataNode) {
@@ -1 +1 @@
1
- {"version":3,"file":"tree.js","sources":["../../../../../../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/outlet.ts","../../../../../../src/cdk/tree/node.ts","../../../../../../src/cdk/tree/tree-errors.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","../../../../../../src/cdk/tree/public-api.ts","../../../../../../src/cdk/tree/index.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 */\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, K = T> implements TreeControl<T, K> {\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<K> = new SelectionModel<K>(true);\n\n /**\n * Returns the identifier by which a dataNode should be tracked, should its\n * reference change.\n *\n * Similar to trackBy for *ngFor\n */\n trackBy?: (dataNode: T) => K;\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[] | undefined | null);\n\n /** Toggles one single data node's expanded/collapsed state. */\n toggle(dataNode: T): void {\n this.expansionModel.toggle(this._trackByValue(dataNode));\n }\n\n /** Expands one single data node. */\n expand(dataNode: T): void {\n this.expansionModel.select(this._trackByValue(dataNode));\n }\n\n /** Collapses one single data node. */\n collapse(dataNode: T): void {\n this.expansionModel.deselect(this._trackByValue(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(this._trackByValue(dataNode));\n }\n\n /** Toggles a subtree rooted at `node` recursively. */\n toggleDescendants(dataNode: T): void {\n this.expansionModel.isSelected(this._trackByValue(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.map(value => this._trackByValue(value)));\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.map(value => this._trackByValue(value)));\n }\n\n protected _trackByValue(value: T|K): K {\n return this.trackBy ? this.trackBy(value as T) : value as K;\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/** Optional set of configuration that can be provided to the FlatTreeControl. */\nexport interface FlatTreeControlOptions<T, K> {\n trackBy?: (dataNode: T) => K;\n}\n\n/** Flat tree control. Able to expand/collapse a subtree recursively for flattened tree. */\nexport class FlatTreeControl<T, K = T> extends BaseTreeControl<T, K> {\n\n /** Construct with flat tree data node functions getLevel and isExpandable. */\n constructor(\n public getLevel: (dataNode: T) => number, public isExpandable: (dataNode: T) => boolean,\n public options?: FlatTreeControlOptions<T, K>) {\n super();\n\n if (this.options) {\n this.trackBy = this.options.trackBy;\n }\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.map(node => this._trackByValue(node)));\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, isObservable} 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[] | undefined | null)) {\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 (isObservable(childrenNodes)) {\n // TypeScript as of version 3.5 doesn't seem to treat `Boolean` like a function that\n // returns a `boolean` specifically in the context of `filter`, so we manually clarify that.\n childrenNodes.pipe(take(1), filter(Boolean as () => boolean))\n .subscribe(children => {\n for (const child of children) {\n this._getDescendants(descendants, child);\n }\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 */\nimport {\n Directive,\n Inject,\n InjectionToken,\n Optional,\n ViewContainerRef,\n} from '@angular/core';\n\n/**\n * Injection token used to provide a `CdkTreeNode` to its outlet.\n * Used primarily to avoid circular imports.\n * @docs-private\n */\nexport const CDK_TREE_NODE_OUTLET_NODE = new InjectionToken<{}>('CDK_TREE_NODE_OUTLET_NODE');\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(\n public viewContainer: ViewContainerRef,\n @Inject(CDK_TREE_NODE_OUTLET_NODE) @Optional() public _node?: 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 */\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 */\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 {FocusableOption} from '@angular/cdk/a11y';\nimport {CollectionViewer, DataSource, isDataSource} 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 {\n BehaviorSubject,\n Observable,\n of as observableOf,\n Subject,\n Subscription,\n isObservable,\n} 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 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\n // The \"OnPush\" status for the `CdkTree` component is effectively a noop, so we are removing it.\n // The view for `CdkTree` consists entirely of templates declared in other views. As they are\n // declared elsewhere, they are checked when their declaration points are checked.\n // tslint:disable-next-line:validate-decorators\n changeDetection: ChangeDetectionStrategy.Default\n})\nexport class CdkTree<T> 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, {static: true}) _nodeOutlet: CdkTreeNodeOutlet;\n\n /** The tree node template for the tree */\n @ContentChildren(CdkTreeNodeDef, {\n // We need to use `descendants: true`, because Ivy will no longer match\n // indirect descendants if it's left as false.\n descendants: true\n }) _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.viewChange.complete();\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 if (isDataSource(this._dataSource)) {\n dataStream = this._dataSource.connect(this);\n } else if (isObservable(this._dataSource)) {\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 /** Emits when the node's data has changed. */\n _dataChanges = new Subject<void>();\n\n /** The tree node's data. */\n get data(): T { return this._data; }\n set data(value: T) {\n if (value !== this._data) {\n this._data = value;\n this._setRoleFromData();\n this._dataChanges.next();\n }\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._dataChanges.complete();\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 (isObservable(childrenNodes)) {\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 IterableDiffer,\n IterableDiffers,\n OnDestroy,\n QueryList,\n} from '@angular/core';\nimport {isObservable} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\n\nimport {CDK_TREE_NODE_OUTLET_NODE, CdkTreeNodeOutlet} from './outlet';\nimport {CdkTree, CdkTreeNode} from './tree';\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 * The children of node will be automatically added to `cdkTreeNodeOutlet`.\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: [\n {provide: CdkTreeNode, useExisting: CdkNestedTreeNode},\n {provide: CDK_TREE_NODE_OUTLET_NODE, useExisting: CdkNestedTreeNode}\n ]\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, {\n // We need to use `descendants: true`, because Ivy will no longer match\n // indirect descendants if it's left as false.\n descendants: true\n })\n 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 (isObservable(childrenNodes)) {\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 const outlet = this._getNodeOutlet();\n if (children) {\n this._children = children;\n }\n if (outlet && this._children) {\n const viewContainer = outlet.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 const outlet = this._getNodeOutlet();\n if (outlet) {\n outlet.viewContainer.clear();\n this._dataDiffer.diff([]);\n }\n }\n\n /** Gets the outlet for the current node. */\n private _getNodeOutlet() {\n const outlets = this.nodeOutlet;\n\n // Note that since we use `descendants: true` on the query, we have to ensure\n // that we don't pick up the outlet of a child node by accident.\n return outlets && outlets.find(outlet => !outlet._node || outlet._node === this);\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, NumberInput} 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 /** Current padding value applied to the element. Used to avoid unnecessarily hitting the DOM. */\n private _currentPadding: string|null;\n\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 // Set to null as the fallback value so that _setPadding can fall back to the node level if the\n // consumer set the directive as `cdkTreeNodePadding=\"\"`. We still want to take this value if\n // they set 0 explicitly.\n this._level = coerceNumberProperty(value, null)!;\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 /**\n * @deprecated _renderer parameter no longer being used. To be removed.\n * @breaking-change 11.0.0\n */\n _renderer: Renderer2,\n private _element: ElementRef<HTMLElement>,\n @Optional() private _dir: Directionality) {\n this._setPadding();\n if (_dir) {\n _dir.change.pipe(takeUntil(this._destroyed)).subscribe(() => this._setPadding(true));\n }\n\n // In Ivy the indentation binding might be set before the tree node's data has been added,\n // which means that we'll miss the first render. We have to subscribe to changes in the\n // data to ensure that everything is up to date.\n _treeNode._dataChanges.subscribe(() => this._setPadding());\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 == null ? nodeLevel : this._level;\n return typeof level === 'number' ? `${level * this._indent}${this.indentUnits}` : null;\n }\n\n _setPadding(forceChange = false) {\n const padding = this._paddingIndent();\n\n if (padding !== this._currentPadding || forceChange) {\n const element = this._element.nativeElement;\n const paddingProp = this._dir && this._dir.value === 'rtl' ? 'paddingRight' : 'paddingLeft';\n const resetProp = paddingProp === 'paddingLeft' ? 'paddingRight' : 'paddingLeft';\n element.style[paddingProp] = padding || '';\n element.style[resetProp] = '';\n this._currentPadding = padding;\n }\n }\n\n static ngAcceptInputType_level: NumberInput;\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 {BooleanInput, coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {Directive, HostListener, Input} from '@angular/core';\n\nimport {CdkTree, CdkTreeNode} from './tree';\n\n/**\n * Node toggle to expand/collapse the node.\n */\n@Directive({selector: '[cdkTreeNodeToggle]'})\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 // We have to use a `HostListener` here in order to support both Ivy and ViewEngine.\n // In Ivy the `host` bindings will be merged when this class is extended, whereas in\n // ViewEngine they're overwritten.\n // TODO(crisbeto): we move this back into `host` once Ivy is turned on by default.\n // tslint:disable-next-line:no-host-decorator-in-concrete\n @HostListener('click', ['$event'])\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 static ngAcceptInputType_recursive: BooleanInput;\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 {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 exports: EXPORTED_DECLARATIONS,\n declarations: EXPORTED_DECLARATIONS,\n providers: [FocusMonitor, CdkTreeNodeDef]\n})\nexport class CdkTreeModule {}\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\nexport * from './control/base-tree-control';\nexport * from './control/flat-tree-control';\nexport * from './control/nested-tree-control';\nexport * from './control/tree-control';\nexport * from './nested-node';\nexport * from './node';\nexport * from './padding';\nexport * from './outlet';\nexport * from './tree';\nexport * from './tree-errors';\nexport * from './tree-module';\nexport * from './toggle';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["observableOf"],"mappings":";;;;;;;;AAAA;;;;;;;AAOA,AAIA;AACA,MAAsB,eAAe;IAArC;;QAYE,mBAAc,GAAsB,IAAI,cAAc,CAAI,IAAI,CAAC,CAAC;KAuEjE;;IAhDC,MAAM,CAAC,QAAW;QAChB,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;KAC1D;;IAGD,MAAM,CAAC,QAAW;QAChB,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;KAC1D;;IAGD,QAAQ,CAAC,QAAW;QAClB,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;KAC5D;;IAGD,UAAU,CAAC,QAAW;QACpB,OAAO,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;KACrE;;IAGD,iBAAiB,CAAC,QAAW;QAC3B,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;YACxD,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC;YAClC,IAAI,CAAC,iBAAiB,CA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BAAqB,EAAC;;;YALpC,OAAO;YAAE,WAAW;;;wBAQzB,KAAK,SAAC,4BAA4B;sBAalC,YAAY,SAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;;;AChCnC;;;;;;;AAQA,AASA,MAAM,qBAAqB,GAAG;IAC5B,iBAAiB;IACjB,cAAc;IACd,kBAAkB;IAClB,iBAAiB;IACjB,OAAO;IACP,WAAW;IACX,iBAAiB;CAClB,CAAC;AAOF,MAAa,aAAa;;;YALzB,QAAQ,SAAC;gBACR,OAAO,EAAE,qBAAqB;gBAC9B,YAAY,EAAE,qBAAqB;gBACnC,SAAS,EAAE,CAAC,YAAY,EAAE,cAAc,CAAC;aAC1C;;;AC/BD;;;;;;GAMG;;ACNH;;GAEG;;;;"}
1
+ {"version":3,"file":"tree.js","sources":["../../../../../../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/outlet.ts","../../../../../../src/cdk/tree/node.ts","../../../../../../src/cdk/tree/tree-errors.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","../../../../../../src/cdk/tree/public-api.ts","../../../../../../src/cdk/tree/index.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 */\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, K = T> implements TreeControl<T, K> {\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<K> = new SelectionModel<K>(true);\n\n /**\n * Returns the identifier by which a dataNode should be tracked, should its\n * reference change.\n *\n * Similar to trackBy for *ngFor\n */\n trackBy?: (dataNode: T) => K;\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[] | undefined | null);\n\n /** Toggles one single data node's expanded/collapsed state. */\n toggle(dataNode: T): void {\n this.expansionModel.toggle(this._trackByValue(dataNode));\n }\n\n /** Expands one single data node. */\n expand(dataNode: T): void {\n this.expansionModel.select(this._trackByValue(dataNode));\n }\n\n /** Collapses one single data node. */\n collapse(dataNode: T): void {\n this.expansionModel.deselect(this._trackByValue(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(this._trackByValue(dataNode));\n }\n\n /** Toggles a subtree rooted at `node` recursively. */\n toggleDescendants(dataNode: T): void {\n this.expansionModel.isSelected(this._trackByValue(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.map(value => this._trackByValue(value)));\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.map(value => this._trackByValue(value)));\n }\n\n protected _trackByValue(value: T|K): K {\n return this.trackBy ? this.trackBy(value as T) : value as K;\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/** Optional set of configuration that can be provided to the FlatTreeControl. */\nexport interface FlatTreeControlOptions<T, K> {\n trackBy?: (dataNode: T) => K;\n}\n\n/** Flat tree control. Able to expand/collapse a subtree recursively for flattened tree. */\nexport class FlatTreeControl<T, K = T> extends BaseTreeControl<T, K> {\n\n /** Construct with flat tree data node functions getLevel and isExpandable. */\n constructor(\n public getLevel: (dataNode: T) => number, public isExpandable: (dataNode: T) => boolean,\n public options?: FlatTreeControlOptions<T, K>) {\n super();\n\n if (this.options) {\n this.trackBy = this.options.trackBy;\n }\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.map(node => this._trackByValue(node)));\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, isObservable} from 'rxjs';\nimport {take, filter} from 'rxjs/operators';\nimport {BaseTreeControl} from './base-tree-control';\n\n/** Optional set of configuration that can be provided to the NestedTreeControl. */\nexport interface NestedTreeControlOptions<T, K> {\n trackBy?: (dataNode: T) => K;\n}\n\n/** Nested tree control. Able to expand/collapse a subtree recursively for NestedNode type. */\nexport class NestedTreeControl<T, K = T> extends BaseTreeControl<T, K> {\n /** Construct with nested tree function getChildren. */\n constructor(\n public getChildren: (dataNode: T) => (Observable<T[]>| T[] | undefined | null),\n public options?: NestedTreeControlOptions<T, K>) {\n super();\n\n if (this.options) {\n this.trackBy = this.options.trackBy;\n }\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.map(node => this._trackByValue(node)));\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 (isObservable(childrenNodes)) {\n // TypeScript as of version 3.5 doesn't seem to treat `Boolean` like a function that\n // returns a `boolean` specifically in the context of `filter`, so we manually clarify that.\n childrenNodes.pipe(take(1), filter(Boolean as () => boolean))\n .subscribe(children => {\n for (const child of children) {\n this._getDescendants(descendants, child);\n }\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 */\nimport {\n Directive,\n Inject,\n InjectionToken,\n Optional,\n ViewContainerRef,\n} from '@angular/core';\n\n/**\n * Injection token used to provide a `CdkTreeNode` to its outlet.\n * Used primarily to avoid circular imports.\n * @docs-private\n */\nexport const CDK_TREE_NODE_OUTLET_NODE = new InjectionToken<{}>('CDK_TREE_NODE_OUTLET_NODE');\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(\n public viewContainer: ViewContainerRef,\n @Inject(CDK_TREE_NODE_OUTLET_NODE) @Optional() public _node?: 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 */\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 */\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 {FocusableOption} from '@angular/cdk/a11y';\nimport {CollectionViewer, DataSource, isDataSource} 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 {\n BehaviorSubject,\n Observable,\n of as observableOf,\n Subject,\n Subscription,\n isObservable,\n} 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 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\n // The \"OnPush\" status for the `CdkTree` component is effectively a noop, so we are removing it.\n // The view for `CdkTree` consists entirely of templates declared in other views. As they are\n // declared elsewhere, they are checked when their declaration points are checked.\n // tslint:disable-next-line:validate-decorators\n changeDetection: ChangeDetectionStrategy.Default\n})\nexport class CdkTree<T> 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, {static: true}) _nodeOutlet: CdkTreeNodeOutlet;\n\n /** The tree node template for the tree */\n @ContentChildren(CdkTreeNodeDef, {\n // We need to use `descendants: true`, because Ivy will no longer match\n // indirect descendants if it's left as false.\n descendants: true\n }) _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.viewChange.complete();\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 if (isDataSource(this._dataSource)) {\n dataStream = this._dataSource.connect(this);\n } else if (isObservable(this._dataSource)) {\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 /** Emits when the node's data has changed. */\n _dataChanges = new Subject<void>();\n\n /** The tree node's data. */\n get data(): T { return this._data; }\n set data(value: T) {\n if (value !== this._data) {\n this._data = value;\n this._setRoleFromData();\n this._dataChanges.next();\n }\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._dataChanges.complete();\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 (isObservable(childrenNodes)) {\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 IterableDiffer,\n IterableDiffers,\n OnDestroy,\n QueryList,\n} from '@angular/core';\nimport {isObservable} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\n\nimport {CDK_TREE_NODE_OUTLET_NODE, CdkTreeNodeOutlet} from './outlet';\nimport {CdkTree, CdkTreeNode} from './tree';\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 * The children of node will be automatically added to `cdkTreeNodeOutlet`.\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: [\n {provide: CdkTreeNode, useExisting: CdkNestedTreeNode},\n {provide: CDK_TREE_NODE_OUTLET_NODE, useExisting: CdkNestedTreeNode}\n ]\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, {\n // We need to use `descendants: true`, because Ivy will no longer match\n // indirect descendants if it's left as false.\n descendants: true\n })\n 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 (isObservable(childrenNodes)) {\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 const outlet = this._getNodeOutlet();\n if (children) {\n this._children = children;\n }\n if (outlet && this._children) {\n const viewContainer = outlet.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 const outlet = this._getNodeOutlet();\n if (outlet) {\n outlet.viewContainer.clear();\n this._dataDiffer.diff([]);\n }\n }\n\n /** Gets the outlet for the current node. */\n private _getNodeOutlet() {\n const outlets = this.nodeOutlet;\n\n // Note that since we use `descendants: true` on the query, we have to ensure\n // that we don't pick up the outlet of a child node by accident.\n return outlets && outlets.find(outlet => !outlet._node || outlet._node === this);\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, NumberInput} 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 /** Current padding value applied to the element. Used to avoid unnecessarily hitting the DOM. */\n private _currentPadding: string|null;\n\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 // Set to null as the fallback value so that _setPadding can fall back to the node level if the\n // consumer set the directive as `cdkTreeNodePadding=\"\"`. We still want to take this value if\n // they set 0 explicitly.\n this._level = coerceNumberProperty(value, null)!;\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 /**\n * @deprecated _renderer parameter no longer being used. To be removed.\n * @breaking-change 11.0.0\n */\n _renderer: Renderer2,\n private _element: ElementRef<HTMLElement>,\n @Optional() private _dir: Directionality) {\n this._setPadding();\n if (_dir) {\n _dir.change.pipe(takeUntil(this._destroyed)).subscribe(() => this._setPadding(true));\n }\n\n // In Ivy the indentation binding might be set before the tree node's data has been added,\n // which means that we'll miss the first render. We have to subscribe to changes in the\n // data to ensure that everything is up to date.\n _treeNode._dataChanges.subscribe(() => this._setPadding());\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 == null ? nodeLevel : this._level;\n return typeof level === 'number' ? `${level * this._indent}${this.indentUnits}` : null;\n }\n\n _setPadding(forceChange = false) {\n const padding = this._paddingIndent();\n\n if (padding !== this._currentPadding || forceChange) {\n const element = this._element.nativeElement;\n const paddingProp = this._dir && this._dir.value === 'rtl' ? 'paddingRight' : 'paddingLeft';\n const resetProp = paddingProp === 'paddingLeft' ? 'paddingRight' : 'paddingLeft';\n element.style[paddingProp] = padding || '';\n element.style[resetProp] = '';\n this._currentPadding = padding;\n }\n }\n\n static ngAcceptInputType_level: NumberInput;\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 {BooleanInput, coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {Directive, HostListener, Input} from '@angular/core';\n\nimport {CdkTree, CdkTreeNode} from './tree';\n\n/**\n * Node toggle to expand/collapse the node.\n */\n@Directive({selector: '[cdkTreeNodeToggle]'})\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 // We have to use a `HostListener` here in order to support both Ivy and ViewEngine.\n // In Ivy the `host` bindings will be merged when this class is extended, whereas in\n // ViewEngine they're overwritten.\n // TODO(crisbeto): we move this back into `host` once Ivy is turned on by default.\n // tslint:disable-next-line:no-host-decorator-in-concrete\n @HostListener('click', ['$event'])\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 static ngAcceptInputType_recursive: BooleanInput;\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 {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 exports: EXPORTED_DECLARATIONS,\n declarations: EXPORTED_DECLARATIONS,\n providers: [FocusMonitor, CdkTreeNodeDef]\n})\nexport class CdkTreeModule {}\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\nexport * from './control/base-tree-control';\nexport * from './control/flat-tree-control';\nexport * from './control/nested-tree-control';\nexport * from './control/tree-control';\nexport * from './nested-node';\nexport * from './node';\nexport * from './padding';\nexport * from './outlet';\nexport * from './tree';\nexport * from './tree-errors';\nexport * from './tree-module';\nexport * from './toggle';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["observableOf"],"mappings":";;;;;;;;AAAA;;;;;;;AAOA,AAIA;AACA,MAAsB,eAAe;IAArC;;QAYE,mBAAc,GAAsB,IAAI,cAAc,CAAI,IAAI,CAAC,CAAC;KAuEjE;;IAhDC,MAAM,CAAC,QAAW;QAChB,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;KAC1D;;IAGD,MAAM,CAAC,QAAW;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@@ -0,0 +1,28 @@
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 { OnDestroy } from '@angular/core';
9
+ import { OverlayReference } from '../overlay-reference';
10
+ /**
11
+ * Service for dispatching events that land on the body to appropriate overlay ref,
12
+ * if any. It maintains a list of attached overlays to determine best suited overlay based
13
+ * on event target and order of overlay opens.
14
+ */
15
+ export declare abstract class BaseOverlayDispatcher implements OnDestroy {
16
+ /** Currently attached overlays in the order they were attached. */
17
+ _attachedOverlays: OverlayReference[];
18
+ protected _document: Document;
19
+ protected _isAttached: boolean;
20
+ constructor(document: any);
21
+ ngOnDestroy(): void;
22
+ /** Add a new overlay to the list of attached overlay refs. */
23
+ add(overlayRef: OverlayReference): void;
24
+ /** Remove an overlay from the list of attached overlay refs. */
25
+ remove(overlayRef: OverlayReference): void;
26
+ /** Detaches the global event listener. */
27
+ protected abstract detach(): void;
28
+ }