@angular/cdk 12.0.0-rc.2 → 12.0.2

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 (107) hide show
  1. package/a11y/focus-trap/focus-trap.d.ts +6 -2
  2. package/a11y/index.metadata.json +1 -1
  3. package/bundles/cdk-a11y.umd.js +7 -3
  4. package/bundles/cdk-a11y.umd.js.map +1 -1
  5. package/bundles/cdk-overlay.umd.js +14 -12
  6. package/bundles/cdk-overlay.umd.js.map +1 -1
  7. package/bundles/cdk-platform.umd.js +19 -0
  8. package/bundles/cdk-platform.umd.js.map +1 -1
  9. package/bundles/cdk-testing.umd.js +48 -4
  10. package/bundles/cdk-testing.umd.js.map +1 -1
  11. package/bundles/cdk.umd.js +1 -1
  12. package/bundles/cdk.umd.js.map +1 -1
  13. package/esm2015/a11y/focus-trap/focus-trap.js +9 -4
  14. package/esm2015/overlay/dispatchers/overlay-outside-click-dispatcher.js +15 -13
  15. package/esm2015/platform/features/shadow-dom.js +19 -1
  16. package/esm2015/testing/change-detection.js +8 -1
  17. package/esm2015/testing/component-harness.js +42 -4
  18. package/esm2015/version.js +1 -1
  19. package/fesm2015/a11y.js +8 -4
  20. package/fesm2015/a11y.js.map +1 -1
  21. package/fesm2015/cdk.js +1 -1
  22. package/fesm2015/cdk.js.map +1 -1
  23. package/fesm2015/overlay.js +14 -12
  24. package/fesm2015/overlay.js.map +1 -1
  25. package/fesm2015/platform.js +19 -1
  26. package/fesm2015/platform.js.map +1 -1
  27. package/fesm2015/testing.js +48 -3
  28. package/fesm2015/testing.js.map +1 -1
  29. package/package.json +3 -3
  30. package/platform/features/shadow-dom.d.ts +5 -0
  31. package/platform/index.metadata.json +1 -1
  32. package/schematics/index.mjs +33 -0
  33. package/schematics/ng-add/index.js +1 -1
  34. package/schematics/ng-add/index.mjs +39 -0
  35. package/schematics/ng-add/package-config.mjs +47 -0
  36. package/schematics/ng-add/schema.mjs +10 -0
  37. package/schematics/ng-generate/drag-drop/index.mjs +39 -0
  38. package/schematics/ng-generate/drag-drop/schema.mjs +10 -0
  39. package/schematics/ng-update/data/attribute-selectors.mjs +21 -0
  40. package/schematics/ng-update/data/class-names.mjs +40 -0
  41. package/schematics/ng-update/data/constructor-checks.mjs +66 -0
  42. package/schematics/ng-update/data/css-selectors.mjs +15 -0
  43. package/schematics/ng-update/data/element-selectors.mjs +15 -0
  44. package/schematics/ng-update/data/index.mjs +29 -0
  45. package/schematics/ng-update/data/input-names.mjs +81 -0
  46. package/schematics/ng-update/data/method-call-checks.mjs +43 -0
  47. package/schematics/ng-update/data/output-names.mjs +27 -0
  48. package/schematics/ng-update/data/property-names.mjs +129 -0
  49. package/schematics/ng-update/devkit-file-system.mjs +81 -0
  50. package/schematics/ng-update/devkit-migration-rule.mjs +136 -0
  51. package/schematics/ng-update/devkit-migration.mjs +20 -0
  52. package/schematics/ng-update/find-stylesheets.d.ts +8 -2
  53. package/schematics/ng-update/find-stylesheets.js +16 -5
  54. package/schematics/ng-update/find-stylesheets.mjs +42 -0
  55. package/schematics/ng-update/html-parsing/angular.mjs +52 -0
  56. package/schematics/ng-update/html-parsing/elements.mjs +62 -0
  57. package/schematics/ng-update/index.mjs +59 -0
  58. package/schematics/ng-update/migrations/attribute-selectors.mjs +67 -0
  59. package/schematics/ng-update/migrations/class-inheritance.mjs +58 -0
  60. package/schematics/ng-update/migrations/class-names.mjs +90 -0
  61. package/schematics/ng-update/migrations/constructor-signature.mjs +135 -0
  62. package/schematics/ng-update/migrations/css-selectors.mjs +74 -0
  63. package/schematics/ng-update/migrations/element-selectors.mjs +65 -0
  64. package/schematics/ng-update/migrations/input-names.mjs +60 -0
  65. package/schematics/ng-update/migrations/method-call-arguments.mjs +61 -0
  66. package/schematics/ng-update/migrations/misc-template.mjs +38 -0
  67. package/schematics/ng-update/migrations/output-names.mjs +47 -0
  68. package/schematics/ng-update/migrations/property-names.mjs +59 -0
  69. package/schematics/ng-update/public-api.mjs +30 -0
  70. package/schematics/ng-update/typescript/base-types.mjs +24 -0
  71. package/schematics/ng-update/typescript/imports.mjs +54 -0
  72. package/schematics/ng-update/typescript/literal.mjs +33 -0
  73. package/schematics/ng-update/typescript/module-specifiers.mjs +35 -0
  74. package/schematics/ng-update/upgrade-data.mjs +35 -0
  75. package/schematics/paths.mjs +16 -0
  76. package/schematics/schematics.externs.js +0 -0
  77. package/schematics/update-tool/component-resource-collector.mjs +147 -0
  78. package/schematics/update-tool/file-system.mjs +18 -0
  79. package/schematics/update-tool/index.mjs +158 -0
  80. package/schematics/update-tool/logger.mjs +18 -0
  81. package/schematics/update-tool/migration.mjs +67 -0
  82. package/schematics/update-tool/public-api.mjs +28 -0
  83. package/schematics/update-tool/target-version.mjs +34 -0
  84. package/schematics/update-tool/update-recorder.mjs +10 -0
  85. package/schematics/update-tool/update-tool.externs.js +0 -0
  86. package/schematics/update-tool/utils/decorators.mjs +38 -0
  87. package/schematics/update-tool/utils/functions.mjs +21 -0
  88. package/schematics/update-tool/utils/imports.mjs +111 -0
  89. package/schematics/update-tool/utils/line-mappings.mjs +76 -0
  90. package/schematics/update-tool/utils/parse-tsconfig.mjs +19 -0
  91. package/schematics/update-tool/utils/property-name.mjs +28 -0
  92. package/schematics/update-tool/utils/virtual-host.mjs +62 -0
  93. package/schematics/update-tool/version-changes.mjs +39 -0
  94. package/schematics/utils/ast/ng-module-imports.mjs +81 -0
  95. package/schematics/utils/ast.mjs +79 -0
  96. package/schematics/utils/build-component.mjs +193 -0
  97. package/schematics/utils/get-project.mjs +24 -0
  98. package/schematics/utils/html-manipulation.mjs +89 -0
  99. package/schematics/utils/index.mjs +31 -0
  100. package/schematics/utils/parse5-element.mjs +32 -0
  101. package/schematics/utils/project-index-file.mjs +21 -0
  102. package/schematics/utils/project-main-file.mjs +23 -0
  103. package/schematics/utils/project-style-file.mjs +44 -0
  104. package/schematics/utils/project-targets.mjs +34 -0
  105. package/schematics/utils/project-tsconfig-paths.mjs +50 -0
  106. package/schematics/utils/schematic-options.mjs +55 -0
  107. package/schematics/utils/vendored-ast-utils/index.mjs +480 -0
@@ -297,6 +297,24 @@ function _getShadowRoot(element) {
297
297
  }
298
298
  return null;
299
299
  }
300
+ /**
301
+ * Gets the currently-focused element on the page while
302
+ * also piercing through Shadow DOM boundaries.
303
+ */
304
+ function _getFocusedElementPierceShadowDom() {
305
+ let activeElement = typeof document !== 'undefined' && document ?
306
+ document.activeElement : null;
307
+ while (activeElement && activeElement.shadowRoot) {
308
+ const newActiveElement = activeElement.shadowRoot.activeElement;
309
+ if (newActiveElement === activeElement) {
310
+ break;
311
+ }
312
+ else {
313
+ activeElement = newActiveElement;
314
+ }
315
+ }
316
+ return activeElement;
317
+ }
300
318
 
301
319
  /**
302
320
  * @license
@@ -310,5 +328,5 @@ function _getShadowRoot(element) {
310
328
  * Generated bundle index. Do not edit.
311
329
  */
312
330
 
313
- export { Platform, PlatformModule, _getShadowRoot, _supportsShadowDom, getRtlScrollAxisType, getSupportedInputTypes, normalizePassiveListenerOptions, supportsPassiveEventListeners, supportsScrollBehavior };
331
+ export { Platform, PlatformModule, _getFocusedElementPierceShadowDom, _getShadowRoot, _supportsShadowDom, getRtlScrollAxisType, getSupportedInputTypes, normalizePassiveListenerOptions, supportsPassiveEventListeners, supportsScrollBehavior };
314
332
  //# sourceMappingURL=platform.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"platform.js","sources":["../../../../../../src/cdk/platform/platform.ts","../../../../../../src/cdk/platform/platform-module.ts","../../../../../../src/cdk/platform/features/input-types.ts","../../../../../../src/cdk/platform/features/passive-listeners.ts","../../../../../../src/cdk/platform/features/scrolling.ts","../../../../../../src/cdk/platform/features/shadow-dom.ts","../../../../../../src/cdk/platform/public-api.ts","../../../../../../src/cdk/platform/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 {Inject, Injectable, PLATFORM_ID} from '@angular/core';\nimport {isPlatformBrowser} from '@angular/common';\n\n// Whether the current platform supports the V8 Break Iterator. The V8 check\n// is necessary to detect all Blink based browsers.\nlet hasV8BreakIterator: boolean;\n\n// We need a try/catch around the reference to `Intl`, because accessing it in some cases can\n// cause IE to throw. These cases are tied to particular versions of Windows and can happen if\n// the consumer is providing a polyfilled `Map`. See:\n// https://github.com/Microsoft/ChakraCore/issues/3189\n// https://github.com/angular/components/issues/15687\ntry {\n hasV8BreakIterator = (typeof Intl !== 'undefined' && (Intl as any).v8BreakIterator);\n} catch {\n hasV8BreakIterator = false;\n}\n\n/**\n * Service to detect the current platform by comparing the userAgent strings and\n * checking browser-specific global properties.\n */\n@Injectable({providedIn: 'root'})\nexport class Platform {\n // We want to use the Angular platform check because if the Document is shimmed\n // without the navigator, the following checks will fail. This is preferred because\n // sometimes the Document may be shimmed without the user's knowledge or intention\n /** Whether the Angular application is being rendered in the browser. */\n isBrowser: boolean = this._platformId ?\n isPlatformBrowser(this._platformId) : typeof document === 'object' && !!document;\n\n /** Whether the current browser is Microsoft Edge. */\n EDGE: boolean = this.isBrowser && /(edge)/i.test(navigator.userAgent);\n\n /** Whether the current rendering engine is Microsoft Trident. */\n TRIDENT: boolean = this.isBrowser && /(msie|trident)/i.test(navigator.userAgent);\n\n // EdgeHTML and Trident mock Blink specific things and need to be excluded from this check.\n /** Whether the current rendering engine is Blink. */\n BLINK: boolean = this.isBrowser && (!!((window as any).chrome || hasV8BreakIterator) &&\n typeof CSS !== 'undefined' && !this.EDGE && !this.TRIDENT);\n\n // Webkit is part of the userAgent in EdgeHTML, Blink and Trident. Therefore we need to\n // ensure that Webkit runs standalone and is not used as another engine's base.\n /** Whether the current rendering engine is WebKit. */\n WEBKIT: boolean = this.isBrowser &&\n /AppleWebKit/i.test(navigator.userAgent) && !this.BLINK && !this.EDGE && !this.TRIDENT;\n\n /** Whether the current platform is Apple iOS. */\n IOS: boolean = this.isBrowser && /iPad|iPhone|iPod/.test(navigator.userAgent) &&\n !('MSStream' in window);\n\n // It's difficult to detect the plain Gecko engine, because most of the browsers identify\n // them self as Gecko-like browsers and modify the userAgent's according to that.\n // Since we only cover one explicit Firefox case, we can simply check for Firefox\n // instead of having an unstable check for Gecko.\n /** Whether the current browser is Firefox. */\n FIREFOX: boolean = this.isBrowser && /(firefox|minefield)/i.test(navigator.userAgent);\n\n /** Whether the current platform is Android. */\n // Trident on mobile adds the android platform to the userAgent to trick detections.\n ANDROID: boolean = this.isBrowser && /android/i.test(navigator.userAgent) && !this.TRIDENT;\n\n // Safari browsers will include the Safari keyword in their userAgent. Some browsers may fake\n // this and just place the Safari keyword in the userAgent. To be more safe about Safari every\n // Safari browser should also use Webkit as its layout engine.\n /** Whether the current browser is Safari. */\n SAFARI: boolean = this.isBrowser && /safari/i.test(navigator.userAgent) && this.WEBKIT;\n\n constructor(@Inject(PLATFORM_ID) private _platformId: Object) {}\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 {NgModule} from '@angular/core';\n\n\n@NgModule({})\nexport class PlatformModule {}\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/** Cached result Set of input types support by the current browser. */\nlet supportedInputTypes: Set<string>;\n\n/** Types of `<input>` that *might* be supported. */\nconst candidateInputTypes = [\n // `color` must come first. Chrome 56 shows a warning if we change the type to `color` after\n // first changing it to something else:\n // The specified value \"\" does not conform to the required format.\n // The format is \"#rrggbb\" where rr, gg, bb are two-digit hexadecimal numbers.\n 'color',\n 'button',\n 'checkbox',\n 'date',\n 'datetime-local',\n 'email',\n 'file',\n 'hidden',\n 'image',\n 'month',\n 'number',\n 'password',\n 'radio',\n 'range',\n 'reset',\n 'search',\n 'submit',\n 'tel',\n 'text',\n 'time',\n 'url',\n 'week',\n];\n\n/** @returns The input types supported by this browser. */\nexport function getSupportedInputTypes(): Set<string> {\n // Result is cached.\n if (supportedInputTypes) {\n return supportedInputTypes;\n }\n\n // We can't check if an input type is not supported until we're on the browser, so say that\n // everything is supported when not on the browser. We don't use `Platform` here since it's\n // just a helper function and can't inject it.\n if (typeof document !== 'object' || !document) {\n supportedInputTypes = new Set(candidateInputTypes);\n return supportedInputTypes;\n }\n\n let featureTestInput = document.createElement('input');\n supportedInputTypes = new Set(candidateInputTypes.filter(value => {\n featureTestInput.setAttribute('type', value);\n return featureTestInput.type === value;\n }));\n\n return supportedInputTypes;\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/** Cached result of whether the user's browser supports passive event listeners. */\nlet supportsPassiveEvents: boolean;\n\n/**\n * Checks whether the user's browser supports passive event listeners.\n * See: https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md\n */\nexport function supportsPassiveEventListeners(): boolean {\n if (supportsPassiveEvents == null && typeof window !== 'undefined') {\n try {\n window.addEventListener('test', null!, Object.defineProperty({}, 'passive', {\n get: () => supportsPassiveEvents = true\n }));\n } finally {\n supportsPassiveEvents = supportsPassiveEvents || false;\n }\n }\n\n return supportsPassiveEvents;\n}\n\n/**\n * Normalizes an `AddEventListener` object to something that can be passed\n * to `addEventListener` on any browser, no matter whether it supports the\n * `options` parameter.\n * @param options Object to be normalized.\n */\nexport function normalizePassiveListenerOptions(options: AddEventListenerOptions):\n AddEventListenerOptions | boolean {\n return supportsPassiveEventListeners() ? options : !!options.capture;\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/** The possible ways the browser may handle the horizontal scroll axis in RTL languages. */\nexport const enum RtlScrollAxisType {\n /**\n * scrollLeft is 0 when scrolled all the way left and (scrollWidth - clientWidth) when scrolled\n * all the way right.\n */\n NORMAL,\n /**\n * scrollLeft is -(scrollWidth - clientWidth) when scrolled all the way left and 0 when scrolled\n * all the way right.\n */\n NEGATED,\n /**\n * scrollLeft is (scrollWidth - clientWidth) when scrolled all the way left and 0 when scrolled\n * all the way right.\n */\n INVERTED\n}\n\n/** Cached result of the way the browser handles the horizontal scroll axis in RTL mode. */\nlet rtlScrollAxisType: RtlScrollAxisType|undefined;\n\n/** Cached result of the check that indicates whether the browser supports scroll behaviors. */\nlet scrollBehaviorSupported: boolean|undefined;\n\n/** Check whether the browser supports scroll behaviors. */\nexport function supportsScrollBehavior(): boolean {\n if (scrollBehaviorSupported == null) {\n // If we're not in the browser, it can't be supported. Also check for `Element`, because\n // some projects stub out the global `document` during SSR which can throw us off.\n if (typeof document !== 'object' || !document || typeof Element !== 'function' || !Element) {\n scrollBehaviorSupported = false;\n return scrollBehaviorSupported;\n }\n\n // If the element can have a `scrollBehavior` style, we can be sure that it's supported.\n if ('scrollBehavior' in document.documentElement!.style) {\n scrollBehaviorSupported = true;\n } else {\n // At this point we have 3 possibilities: `scrollTo` isn't supported at all, it's\n // supported but it doesn't handle scroll behavior, or it has been polyfilled.\n const scrollToFunction: Function|undefined = Element.prototype.scrollTo;\n\n if (scrollToFunction) {\n // We can detect if the function has been polyfilled by calling `toString` on it. Native\n // functions are obfuscated using `[native code]`, whereas if it was overwritten we'd get\n // the actual function source. Via https://davidwalsh.name/detect-native-function. Consider\n // polyfilled functions as supporting scroll behavior.\n scrollBehaviorSupported = !/\\{\\s*\\[native code\\]\\s*\\}/.test(scrollToFunction.toString());\n } else {\n scrollBehaviorSupported = false;\n }\n }\n }\n\n return scrollBehaviorSupported;\n}\n\n/**\n * Checks the type of RTL scroll axis used by this browser. As of time of writing, Chrome is NORMAL,\n * Firefox & Safari are NEGATED, and IE & Edge are INVERTED.\n */\nexport function getRtlScrollAxisType(): RtlScrollAxisType {\n // We can't check unless we're on the browser. Just assume 'normal' if we're not.\n if (typeof document !== 'object' || !document) {\n return RtlScrollAxisType.NORMAL;\n }\n\n if (rtlScrollAxisType == null) {\n // Create a 1px wide scrolling container and a 2px wide content element.\n const scrollContainer = document.createElement('div');\n const containerStyle = scrollContainer.style;\n scrollContainer.dir = 'rtl';\n containerStyle.width = '1px';\n containerStyle.overflow = 'auto';\n containerStyle.visibility = 'hidden';\n containerStyle.pointerEvents = 'none';\n containerStyle.position = 'absolute';\n\n const content = document.createElement('div');\n const contentStyle = content.style;\n contentStyle.width = '2px';\n contentStyle.height = '1px';\n\n scrollContainer.appendChild(content);\n document.body.appendChild(scrollContainer);\n\n rtlScrollAxisType = RtlScrollAxisType.NORMAL;\n\n // The viewport starts scrolled all the way to the right in RTL mode. If we are in a NORMAL\n // browser this would mean that the scrollLeft should be 1. If it's zero instead we know we're\n // dealing with one of the other two types of browsers.\n if (scrollContainer.scrollLeft === 0) {\n // In a NEGATED browser the scrollLeft is always somewhere in [-maxScrollAmount, 0]. For an\n // INVERTED browser it is always somewhere in [0, maxScrollAmount]. We can determine which by\n // setting to the scrollLeft to 1. This is past the max for a NEGATED browser, so it will\n // return 0 when we read it again.\n scrollContainer.scrollLeft = 1;\n rtlScrollAxisType =\n scrollContainer.scrollLeft === 0 ? RtlScrollAxisType.NEGATED : RtlScrollAxisType.INVERTED;\n }\n\n scrollContainer.parentNode!.removeChild(scrollContainer);\n }\n return rtlScrollAxisType;\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\nlet shadowDomIsSupported: boolean;\n\n/** Checks whether the user's browser support Shadow DOM. */\nexport function _supportsShadowDom(): boolean {\n if (shadowDomIsSupported == null) {\n const head = typeof document !== 'undefined' ? document.head : null;\n shadowDomIsSupported = !!(head && ((head as any).createShadowRoot || head.attachShadow));\n }\n\n return shadowDomIsSupported;\n}\n\n/** Gets the shadow root of an element, if supported and the element is inside the Shadow DOM. */\nexport function _getShadowRoot(element: HTMLElement): ShadowRoot | null {\n if (_supportsShadowDom()) {\n const rootNode = element.getRootNode ? element.getRootNode() : null;\n\n // Note that this should be caught by `_supportsShadowDom`, but some\n // teams have been able to hit this code path on unsupported browsers.\n if (typeof ShadowRoot !== 'undefined' && ShadowRoot && rootNode instanceof ShadowRoot) {\n return rootNode;\n }\n }\n\n return null;\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 './platform';\nexport * from './platform-module';\nexport * from './features/input-types';\nexport * from './features/passive-listeners';\nexport * from './features/scrolling';\nexport * from './features/shadow-dom';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAAA;;;;;;;AAWA;AACA;AACA,IAAI,kBAA2B,CAAC;AAEhC;AACA;AACA;AACA;AACA;AACA,IAAI;IACF,kBAAkB,IAAI,OAAO,IAAI,KAAK,WAAW,IAAK,IAAY,CAAC,eAAe,CAAC,CAAC;CACrF;AAAC,WAAM;IACN,kBAAkB,GAAG,KAAK,CAAC;CAC5B;AAED;;;;MAKa,QAAQ;IA8CnB,YAAyC,WAAmB;QAAnB,gBAAW,GAAX,WAAW,CAAQ;;;;;QAzC5D,cAAS,GAAY,IAAI,CAAC,WAAW;YACjC,iBAAiB,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,OAAO,QAAQ,KAAK,QAAQ,IAAI,CAAC,CAAC,QAAQ,CAAC;;QAGrF,SAAI,GAAY,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;;QAGtE,YAAO,GAAY,IAAI,CAAC,SAAS,IAAI,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;;;QAIjF,UAAK,GAAY,IAAI,CAAC,SAAS,KAAK,CAAC,EAAG,MAAc,CAAC,MAAM,IAAI,kBAAkB,CAAC;YAChF,OAAO,GAAG,KAAK,WAAW,IAAI,CAAC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":3,"file":"platform.js","sources":["../../../../../../src/cdk/platform/platform.ts","../../../../../../src/cdk/platform/platform-module.ts","../../../../../../src/cdk/platform/features/input-types.ts","../../../../../../src/cdk/platform/features/passive-listeners.ts","../../../../../../src/cdk/platform/features/scrolling.ts","../../../../../../src/cdk/platform/features/shadow-dom.ts","../../../../../../src/cdk/platform/public-api.ts","../../../../../../src/cdk/platform/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 {Inject, Injectable, PLATFORM_ID} from '@angular/core';\nimport {isPlatformBrowser} from '@angular/common';\n\n// Whether the current platform supports the V8 Break Iterator. The V8 check\n// is necessary to detect all Blink based browsers.\nlet hasV8BreakIterator: boolean;\n\n// We need a try/catch around the reference to `Intl`, because accessing it in some cases can\n// cause IE to throw. These cases are tied to particular versions of Windows and can happen if\n// the consumer is providing a polyfilled `Map`. See:\n// https://github.com/Microsoft/ChakraCore/issues/3189\n// https://github.com/angular/components/issues/15687\ntry {\n hasV8BreakIterator = (typeof Intl !== 'undefined' && (Intl as any).v8BreakIterator);\n} catch {\n hasV8BreakIterator = false;\n}\n\n/**\n * Service to detect the current platform by comparing the userAgent strings and\n * checking browser-specific global properties.\n */\n@Injectable({providedIn: 'root'})\nexport class Platform {\n // We want to use the Angular platform check because if the Document is shimmed\n // without the navigator, the following checks will fail. This is preferred because\n // sometimes the Document may be shimmed without the user's knowledge or intention\n /** Whether the Angular application is being rendered in the browser. */\n isBrowser: boolean = this._platformId ?\n isPlatformBrowser(this._platformId) : typeof document === 'object' && !!document;\n\n /** Whether the current browser is Microsoft Edge. */\n EDGE: boolean = this.isBrowser && /(edge)/i.test(navigator.userAgent);\n\n /** Whether the current rendering engine is Microsoft Trident. */\n TRIDENT: boolean = this.isBrowser && /(msie|trident)/i.test(navigator.userAgent);\n\n // EdgeHTML and Trident mock Blink specific things and need to be excluded from this check.\n /** Whether the current rendering engine is Blink. */\n BLINK: boolean = this.isBrowser && (!!((window as any).chrome || hasV8BreakIterator) &&\n typeof CSS !== 'undefined' && !this.EDGE && !this.TRIDENT);\n\n // Webkit is part of the userAgent in EdgeHTML, Blink and Trident. Therefore we need to\n // ensure that Webkit runs standalone and is not used as another engine's base.\n /** Whether the current rendering engine is WebKit. */\n WEBKIT: boolean = this.isBrowser &&\n /AppleWebKit/i.test(navigator.userAgent) && !this.BLINK && !this.EDGE && !this.TRIDENT;\n\n /** Whether the current platform is Apple iOS. */\n IOS: boolean = this.isBrowser && /iPad|iPhone|iPod/.test(navigator.userAgent) &&\n !('MSStream' in window);\n\n // It's difficult to detect the plain Gecko engine, because most of the browsers identify\n // them self as Gecko-like browsers and modify the userAgent's according to that.\n // Since we only cover one explicit Firefox case, we can simply check for Firefox\n // instead of having an unstable check for Gecko.\n /** Whether the current browser is Firefox. */\n FIREFOX: boolean = this.isBrowser && /(firefox|minefield)/i.test(navigator.userAgent);\n\n /** Whether the current platform is Android. */\n // Trident on mobile adds the android platform to the userAgent to trick detections.\n ANDROID: boolean = this.isBrowser && /android/i.test(navigator.userAgent) && !this.TRIDENT;\n\n // Safari browsers will include the Safari keyword in their userAgent. Some browsers may fake\n // this and just place the Safari keyword in the userAgent. To be more safe about Safari every\n // Safari browser should also use Webkit as its layout engine.\n /** Whether the current browser is Safari. */\n SAFARI: boolean = this.isBrowser && /safari/i.test(navigator.userAgent) && this.WEBKIT;\n\n constructor(@Inject(PLATFORM_ID) private _platformId: Object) {}\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 {NgModule} from '@angular/core';\n\n\n@NgModule({})\nexport class PlatformModule {}\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/** Cached result Set of input types support by the current browser. */\nlet supportedInputTypes: Set<string>;\n\n/** Types of `<input>` that *might* be supported. */\nconst candidateInputTypes = [\n // `color` must come first. Chrome 56 shows a warning if we change the type to `color` after\n // first changing it to something else:\n // The specified value \"\" does not conform to the required format.\n // The format is \"#rrggbb\" where rr, gg, bb are two-digit hexadecimal numbers.\n 'color',\n 'button',\n 'checkbox',\n 'date',\n 'datetime-local',\n 'email',\n 'file',\n 'hidden',\n 'image',\n 'month',\n 'number',\n 'password',\n 'radio',\n 'range',\n 'reset',\n 'search',\n 'submit',\n 'tel',\n 'text',\n 'time',\n 'url',\n 'week',\n];\n\n/** @returns The input types supported by this browser. */\nexport function getSupportedInputTypes(): Set<string> {\n // Result is cached.\n if (supportedInputTypes) {\n return supportedInputTypes;\n }\n\n // We can't check if an input type is not supported until we're on the browser, so say that\n // everything is supported when not on the browser. We don't use `Platform` here since it's\n // just a helper function and can't inject it.\n if (typeof document !== 'object' || !document) {\n supportedInputTypes = new Set(candidateInputTypes);\n return supportedInputTypes;\n }\n\n let featureTestInput = document.createElement('input');\n supportedInputTypes = new Set(candidateInputTypes.filter(value => {\n featureTestInput.setAttribute('type', value);\n return featureTestInput.type === value;\n }));\n\n return supportedInputTypes;\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/** Cached result of whether the user's browser supports passive event listeners. */\nlet supportsPassiveEvents: boolean;\n\n/**\n * Checks whether the user's browser supports passive event listeners.\n * See: https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md\n */\nexport function supportsPassiveEventListeners(): boolean {\n if (supportsPassiveEvents == null && typeof window !== 'undefined') {\n try {\n window.addEventListener('test', null!, Object.defineProperty({}, 'passive', {\n get: () => supportsPassiveEvents = true\n }));\n } finally {\n supportsPassiveEvents = supportsPassiveEvents || false;\n }\n }\n\n return supportsPassiveEvents;\n}\n\n/**\n * Normalizes an `AddEventListener` object to something that can be passed\n * to `addEventListener` on any browser, no matter whether it supports the\n * `options` parameter.\n * @param options Object to be normalized.\n */\nexport function normalizePassiveListenerOptions(options: AddEventListenerOptions):\n AddEventListenerOptions | boolean {\n return supportsPassiveEventListeners() ? options : !!options.capture;\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/** The possible ways the browser may handle the horizontal scroll axis in RTL languages. */\nexport const enum RtlScrollAxisType {\n /**\n * scrollLeft is 0 when scrolled all the way left and (scrollWidth - clientWidth) when scrolled\n * all the way right.\n */\n NORMAL,\n /**\n * scrollLeft is -(scrollWidth - clientWidth) when scrolled all the way left and 0 when scrolled\n * all the way right.\n */\n NEGATED,\n /**\n * scrollLeft is (scrollWidth - clientWidth) when scrolled all the way left and 0 when scrolled\n * all the way right.\n */\n INVERTED\n}\n\n/** Cached result of the way the browser handles the horizontal scroll axis in RTL mode. */\nlet rtlScrollAxisType: RtlScrollAxisType|undefined;\n\n/** Cached result of the check that indicates whether the browser supports scroll behaviors. */\nlet scrollBehaviorSupported: boolean|undefined;\n\n/** Check whether the browser supports scroll behaviors. */\nexport function supportsScrollBehavior(): boolean {\n if (scrollBehaviorSupported == null) {\n // If we're not in the browser, it can't be supported. Also check for `Element`, because\n // some projects stub out the global `document` during SSR which can throw us off.\n if (typeof document !== 'object' || !document || typeof Element !== 'function' || !Element) {\n scrollBehaviorSupported = false;\n return scrollBehaviorSupported;\n }\n\n // If the element can have a `scrollBehavior` style, we can be sure that it's supported.\n if ('scrollBehavior' in document.documentElement!.style) {\n scrollBehaviorSupported = true;\n } else {\n // At this point we have 3 possibilities: `scrollTo` isn't supported at all, it's\n // supported but it doesn't handle scroll behavior, or it has been polyfilled.\n const scrollToFunction: Function|undefined = Element.prototype.scrollTo;\n\n if (scrollToFunction) {\n // We can detect if the function has been polyfilled by calling `toString` on it. Native\n // functions are obfuscated using `[native code]`, whereas if it was overwritten we'd get\n // the actual function source. Via https://davidwalsh.name/detect-native-function. Consider\n // polyfilled functions as supporting scroll behavior.\n scrollBehaviorSupported = !/\\{\\s*\\[native code\\]\\s*\\}/.test(scrollToFunction.toString());\n } else {\n scrollBehaviorSupported = false;\n }\n }\n }\n\n return scrollBehaviorSupported;\n}\n\n/**\n * Checks the type of RTL scroll axis used by this browser. As of time of writing, Chrome is NORMAL,\n * Firefox & Safari are NEGATED, and IE & Edge are INVERTED.\n */\nexport function getRtlScrollAxisType(): RtlScrollAxisType {\n // We can't check unless we're on the browser. Just assume 'normal' if we're not.\n if (typeof document !== 'object' || !document) {\n return RtlScrollAxisType.NORMAL;\n }\n\n if (rtlScrollAxisType == null) {\n // Create a 1px wide scrolling container and a 2px wide content element.\n const scrollContainer = document.createElement('div');\n const containerStyle = scrollContainer.style;\n scrollContainer.dir = 'rtl';\n containerStyle.width = '1px';\n containerStyle.overflow = 'auto';\n containerStyle.visibility = 'hidden';\n containerStyle.pointerEvents = 'none';\n containerStyle.position = 'absolute';\n\n const content = document.createElement('div');\n const contentStyle = content.style;\n contentStyle.width = '2px';\n contentStyle.height = '1px';\n\n scrollContainer.appendChild(content);\n document.body.appendChild(scrollContainer);\n\n rtlScrollAxisType = RtlScrollAxisType.NORMAL;\n\n // The viewport starts scrolled all the way to the right in RTL mode. If we are in a NORMAL\n // browser this would mean that the scrollLeft should be 1. If it's zero instead we know we're\n // dealing with one of the other two types of browsers.\n if (scrollContainer.scrollLeft === 0) {\n // In a NEGATED browser the scrollLeft is always somewhere in [-maxScrollAmount, 0]. For an\n // INVERTED browser it is always somewhere in [0, maxScrollAmount]. We can determine which by\n // setting to the scrollLeft to 1. This is past the max for a NEGATED browser, so it will\n // return 0 when we read it again.\n scrollContainer.scrollLeft = 1;\n rtlScrollAxisType =\n scrollContainer.scrollLeft === 0 ? RtlScrollAxisType.NEGATED : RtlScrollAxisType.INVERTED;\n }\n\n scrollContainer.parentNode!.removeChild(scrollContainer);\n }\n return rtlScrollAxisType;\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\nlet shadowDomIsSupported: boolean;\n\n/** Checks whether the user's browser support Shadow DOM. */\nexport function _supportsShadowDom(): boolean {\n if (shadowDomIsSupported == null) {\n const head = typeof document !== 'undefined' ? document.head : null;\n shadowDomIsSupported = !!(head && ((head as any).createShadowRoot || head.attachShadow));\n }\n\n return shadowDomIsSupported;\n}\n\n/** Gets the shadow root of an element, if supported and the element is inside the Shadow DOM. */\nexport function _getShadowRoot(element: HTMLElement): ShadowRoot | null {\n if (_supportsShadowDom()) {\n const rootNode = element.getRootNode ? element.getRootNode() : null;\n\n // Note that this should be caught by `_supportsShadowDom`, but some\n // teams have been able to hit this code path on unsupported browsers.\n if (typeof ShadowRoot !== 'undefined' && ShadowRoot && rootNode instanceof ShadowRoot) {\n return rootNode;\n }\n }\n\n return null;\n}\n\n/**\n * Gets the currently-focused element on the page while\n * also piercing through Shadow DOM boundaries.\n */\nexport function _getFocusedElementPierceShadowDom(): HTMLElement | null {\n let activeElement = typeof document !== 'undefined' && document ?\n document.activeElement as HTMLElement | null : null;\n\n while (activeElement && activeElement.shadowRoot) {\n const newActiveElement = activeElement.shadowRoot.activeElement as HTMLElement | null;\n if (newActiveElement === activeElement) {\n break;\n } else {\n activeElement = newActiveElement;\n }\n }\n\n return activeElement;\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 './platform';\nexport * from './platform-module';\nexport * from './features/input-types';\nexport * from './features/passive-listeners';\nexport * from './features/scrolling';\nexport * from './features/shadow-dom';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAAA;;;;;;;AAWA;AACA;AACA,IAAI,kBAA2B,CAAC;AAEhC;AACA;AACA;AACA;AACA;AACA,IAAI;IACF,kBAAkB,IAAI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jHA;;;;;;;AAQA,IAAI,oBAA6B,CAAC;AAElC;SACgB,kBAAkB;IAChC,IAAI,oBAAoB,IAAI,IAAI,EAAE;QAChC,MAAM,IAAI,GAAG,OAAO,QAAQ,KAAK,WAAW,GAAG,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;QACpE,oBAAoB,GAAG,CAAC,EAAE,IAAI,KAAM,IAAY,CAAC,gBAAgB,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;KAC1F;IAED,OAAO,oBAAoB,CAAC;AAC9B,CAAC;AAED;SACgB,cAAc,CAAC,OAAoB;IACjD,IAAI,kBAAkB,EAAE,EAAE;QACxB,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC;;;QAIpE,IAAI,OAAO,UAAU,KAAK,WAAW,IAAI,UAAU,IAAI,QAAQ,YAAY,UAAU,EAAE;YACrF,OAAO,QAAQ,CAAC;SACjB;KACF;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;SAIgB,iCAAiC;IAC/C,IAAI,aAAa,GAAG,OAAO,QAAQ,KAAK,WAAW,IAAI,QAAQ;QAC7D,QAAQ,CAAC,aAAmC,GAAG,IAAI,CAAC;IAEtD,OAAO,aAAa,IAAI,aAAa,CAAC,UAAU,EAAE;QAChD,MAAM,gBAAgB,GAAG,aAAa,CAAC,UAAU,CAAC,aAAmC,CAAC;QACtF,IAAI,gBAAgB,KAAK,aAAa,EAAE;YACtC,MAAM;SACP;aAAM;YACL,aAAa,GAAG,gBAAgB,CAAC;SAClC;KACF;IAED,OAAO,aAAa,CAAC;AACvB;;ACrDA;;;;;;;;ACAA;;;;;;"}
@@ -96,6 +96,13 @@ function manualChangeDetection(fn) {
96
96
  return batchChangeDetection(fn, false);
97
97
  });
98
98
  }
99
+ /**
100
+ * Resolves the given list of async values in parallel (i.e. via Promise.all) while batching change
101
+ * detection over the entire operation such that change detection occurs exactly once before
102
+ * resolving the values and once after.
103
+ * @param values A getter for the async values to resolve in parallel with batched change detection.
104
+ * @return The resolved values.
105
+ */
99
106
  function parallel(values) {
100
107
  return __awaiter(this, void 0, void 0, function* () {
101
108
  return batchChangeDetection(() => Promise.all(values()), true);
@@ -363,9 +370,20 @@ class HarnessPredicate {
363
370
  }
364
371
  /** Gets the selector used to find candidate elements. */
365
372
  getSelector() {
366
- return this._ancestor.split(',')
367
- .map(part => `${part.trim()} ${this.harnessType.hostSelector}`.trim())
368
- .join(',');
373
+ // We don't have to go through the extra trouble if there are no ancestors.
374
+ if (!this._ancestor) {
375
+ return (this.harnessType.hostSelector || '').trim();
376
+ }
377
+ const [ancestors, ancestorPlaceholders] = _splitAndEscapeSelector(this._ancestor);
378
+ const [selectors, selectorPlaceholders] = _splitAndEscapeSelector(this.harnessType.hostSelector || '');
379
+ const result = [];
380
+ // We have to add the ancestor to each part of the host compound selector, otherwise we can get
381
+ // incorrect results. E.g. `.ancestor .a, .ancestor .b` vs `.ancestor .a, .b`.
382
+ ancestors.forEach(escapedAncestor => {
383
+ const ancestor = _restoreSelector(escapedAncestor, ancestorPlaceholders);
384
+ return selectors.forEach(escapedSelector => result.push(`${ancestor} ${_restoreSelector(escapedSelector, selectorPlaceholders)}`));
385
+ });
386
+ return result.join(', ');
369
387
  }
370
388
  /** Adds base options common to all harness types. */
371
389
  _addBaseOptions(options) {
@@ -401,6 +419,33 @@ function _valueAsString(value) {
401
419
  return '{...}';
402
420
  }
403
421
  }
422
+ /**
423
+ * Splits up a compound selector into its parts and escapes any quoted content. The quoted content
424
+ * has to be escaped, because it can contain commas which will throw throw us off when trying to
425
+ * split it.
426
+ * @param selector Selector to be split.
427
+ * @returns The escaped string where any quoted content is replaced with a placeholder. E.g.
428
+ * `[foo="bar"]` turns into `[foo=__cdkPlaceholder-0__]`. Use `_restoreSelector` to restore
429
+ * the placeholders.
430
+ */
431
+ function _splitAndEscapeSelector(selector) {
432
+ const placeholders = [];
433
+ // Note that the regex doesn't account for nested quotes so something like `"ab'cd'e"` will be
434
+ // considered as two blocks. It's a bit of an edge case, but if we find that it's a problem,
435
+ // we can make it a bit smarter using a loop. Use this for now since it's more readable and
436
+ // compact. More complete implementation:
437
+ // https://github.com/angular/angular/blob/bd34bc9e89f18a/packages/compiler/src/shadow_css.ts#L655
438
+ const result = selector.replace(/(["'][^["']*["'])/g, (_, keep) => {
439
+ const replaceBy = `__cdkPlaceholder-${placeholders.length}__`;
440
+ placeholders.push(keep);
441
+ return replaceBy;
442
+ });
443
+ return [result.split(',').map(part => part.trim()), placeholders];
444
+ }
445
+ /** Restores a selector whose content was escaped in `_splitAndEscapeSelector`. */
446
+ function _restoreSelector(selector, placeholders) {
447
+ return selector.replace(/__cdkPlaceholder-(\d+)__/g, (_, index) => placeholders[+index]);
448
+ }
404
449
 
405
450
  /**
406
451
  * @license
@@ -1 +1 @@
1
- {"version":3,"file":"testing.js","sources":["../../../../../../src/cdk/testing/change-detection.ts","../../../../../../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/text-filtering.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 {BehaviorSubject, Subscription} from 'rxjs';\n\n/** Represents the status of auto change detection. */\nexport interface AutoChangeDetectionStatus {\n /** Whether auto change detection is disabled. */\n isDisabled: boolean;\n /**\n * An optional callback, if present it indicates that change detection should be run immediately,\n * while handling the status change. The callback should then be called as soon as change\n * detection is done.\n */\n onDetectChangesNow?: () => void;\n}\n\n/** Subject used to dispatch and listen for changes to the auto change detection status . */\nconst autoChangeDetectionSubject = new BehaviorSubject<AutoChangeDetectionStatus>({\n isDisabled: false\n});\n\n/** The current subscription to `autoChangeDetectionSubject`. */\nlet autoChangeDetectionSubscription: Subscription | null;\n\n/**\n * The default handler for auto change detection status changes. This handler will be used if the\n * specific environment does not install its own.\n * @param status The new auto change detection status.\n */\nfunction defaultAutoChangeDetectionHandler(status: AutoChangeDetectionStatus) {\n status.onDetectChangesNow?.();\n}\n\n/**\n * Allows a test `HarnessEnvironment` to install its own handler for auto change detection status\n * changes.\n * @param handler The handler for the auto change detection status.\n */\nexport function handleAutoChangeDetectionStatus(\n handler: (status: AutoChangeDetectionStatus) => void) {\n stopHandlingAutoChangeDetectionStatus();\n autoChangeDetectionSubscription = autoChangeDetectionSubject.subscribe(handler);\n}\n\n/** Allows a `HarnessEnvironment` to stop handling auto change detection status changes. */\nexport function stopHandlingAutoChangeDetectionStatus() {\n autoChangeDetectionSubscription?.unsubscribe();\n autoChangeDetectionSubscription = null;\n}\n\n/**\n * Batches together triggering of change detection over the duration of the given function.\n * @param fn The function to call with batched change detection.\n * @param triggerBeforeAndAfter Optionally trigger change detection once before and after the batch\n * operation. If false, change detection will not be triggered.\n * @return The result of the given function.\n */\nasync function batchChangeDetection<T>(fn: () => Promise<T>, triggerBeforeAndAfter: boolean) {\n // If change detection batching is already in progress, just run the function.\n if (autoChangeDetectionSubject.getValue().isDisabled) {\n return await fn();\n }\n\n // If nothing is handling change detection batching, install the default handler.\n if (!autoChangeDetectionSubscription) {\n handleAutoChangeDetectionStatus(defaultAutoChangeDetectionHandler);\n }\n\n if (triggerBeforeAndAfter) {\n await new Promise(resolve => autoChangeDetectionSubject.next({\n isDisabled: true,\n onDetectChangesNow: resolve as () => void,\n }));\n // The function passed in may throw (e.g. if the user wants to make an expectation of an error\n // being thrown. If this happens, we need to make sure we still re-enable change detection, so\n // we wrap it in a `finally` block.\n try {\n return await fn();\n } finally {\n await new Promise(resolve => autoChangeDetectionSubject.next({\n isDisabled: false,\n onDetectChangesNow: resolve as () => void,\n }));\n }\n } else {\n autoChangeDetectionSubject.next({isDisabled: true});\n // The function passed in may throw (e.g. if the user wants to make an expectation of an error\n // being thrown. If this happens, we need to make sure we still re-enable change detection, so\n // we wrap it in a `finally` block.\n try {\n return await fn();\n } finally {\n autoChangeDetectionSubject.next({isDisabled: false});\n }\n }\n}\n\n/**\n * Disables the harness system's auto change detection for the duration of the given function.\n * @param fn The function to disable auto change detection for.\n * @return The result of the given function.\n */\nexport async function manualChangeDetection<T>(fn: () => Promise<T>) {\n return batchChangeDetection(fn, false);\n}\n\n\n\n/**\n * Resolves the given list of async values in parallel (i.e. via Promise.all) while batching change\n * detection over the entire operation such that change detection occurs exactly once before\n * resolving the values and once after.\n * @param values A getter for the async values to resolve in parallel with batched change detection.\n * @return The resolved values.\n */\nexport function parallel<T1, T2, T3, T4, T5>(\n values: () =>\n [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike<T4>,\n T5 | PromiseLike<T5>\n ]): Promise<[T1, T2, T3, T4, T5]>;\n\n/**\n * Resolves the given list of async values in parallel (i.e. via Promise.all) while batching change\n * detection over the entire operation such that change detection occurs exactly once before\n * resolving the values and once after.\n * @param values A getter for the async values to resolve in parallel with batched change detection.\n * @return The resolved values.\n */\nexport function parallel<T1, T2, T3, T4>(\n values: () =>\n [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike<T4>]):\n Promise<[T1, T2, T3, T4]>;\n\n/**\n * Resolves the given list of async values in parallel (i.e. via Promise.all) while batching change\n * detection over the entire operation such that change detection occurs exactly once before\n * resolving the values and once after.\n * @param values A getter for the async values to resolve in parallel with batched change detection.\n * @return The resolved values.\n */\nexport function parallel<T1, T2, T3>(\n values: () => [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>]):\n Promise<[T1, T2, T3]>;\n\n/**\n * Resolves the given list of async values in parallel (i.e. via Promise.all) while batching change\n * detection over the entire operation such that change detection occurs exactly once before\n * resolving the values and once after.\n * @param values A getter for the async values to resolve in parallel with batched change detection.\n * @return The resolved values.\n */\nexport function parallel<T1, T2>(values: () => [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>]):\n Promise<[T1, T2]>;\n\n/**\n * Resolves the given list of async values in parallel (i.e. via Promise.all) while batching change\n * detection over the entire operation such that change detection occurs exactly once before\n * resolving the values and once after.\n * @param values A getter for the async values to resolve in parallel with batched change detection.\n * @return The resolved values.\n */\nexport function parallel<T>(values: () => (T | PromiseLike<T>)[]): Promise<T[]>;\n\nexport async function parallel<T>(values: () => Iterable<T | PromiseLike<T>>): Promise<T[]> {\n return batchChangeDetection(() => Promise.all(values()), true);\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 {parallel} from './change-detection';\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 async getChildLoader(selector: S): Promise<HarnessLoader> {\n return (await this.getRootHarnessLoader()).getChildLoader(selector);\n }\n\n async getAllChildLoaders(selector: S): Promise<HarnessLoader[]> {\n return (await this.getRootHarnessLoader()).getAllChildLoaders(selector);\n }\n\n async getHarness<T extends ComponentHarness>(query: HarnessQuery<T>): Promise<T> {\n return (await this.getRootHarnessLoader()).getHarness(query);\n }\n\n async getAllHarnesses<T extends ComponentHarness>(query: HarnessQuery<T>): Promise<T[]> {\n return (await this.getRootHarnessLoader()).getAllHarnesses(query);\n }\n\n /**\n * Gets the root harness loader from which to start\n * searching for content contained by this harness.\n */\n protected async getRootHarnessLoader(): Promise<HarnessLoader> {\n return this.locatorFactory.rootHarnessLoader();\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 if (harnesses.length === 0) {\n return [];\n }\n const results = await parallel(() => 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 parallel(() => 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 {parallel} from './change-detection';\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 parallel(() => rawElements.map(async rawElement => {\n const testElement = this.createTestElement(rawElement);\n const allResultsForElement = await parallel(\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.\n // multiple `TestElement` or multiple `ComponentHarness` of the same type).\n () => allQueries.map(query => this._getQueryResultForElement(\n 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/** Data that can be attached to a custom event dispatched from a `TestElement`. */\nexport type EventData =\n string | number | boolean | undefined | null | EventData[] | {[key: string]: EventData};\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 /**\n * Click the element at the default location for the current environment. If you need to guarantee\n * the element is clicked at a specific location, consider using `click('center')` or\n * `click(x, y)` instead.\n */\n click(modifiers?: ModifierKeys): Promise<void>;\n\n /** Click the element at the element's center. */\n click(location: 'center', modifiers?: ModifierKeys): 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 * @param modifiers Modifier keys held while clicking\n */\n click(relativeX: number, relativeY: number, modifiers?: ModifierKeys): Promise<void>;\n\n /**\n * Right clicks on the element at the specified coordinates relative to the top-left of it.\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 * @param modifiers Modifier keys held while clicking\n */\n rightClick(relativeX: number, relativeY: number, modifiers?: ModifierKeys): 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 /**\n * Gets the text from the element.\n * @param options Options that affect what text is included.\n */\n text(options?: TextOptions): 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 /** 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 /** Sets the value of a property of an input. */\n setInputValue(value: string): Promise<void>;\n\n // Note that ideally here we'd be selecting options based on their value, rather than their\n // index, but we're limited by `@angular/forms` which will modify the option value in some cases.\n // Since the value will be truncated, we can't rely on it to do the lookup in the DOM. See:\n // https://github.com/angular/angular/blob/master/packages/forms/src/directives/select_control_value_accessor.ts#L19\n /** Selects the options at the specified indexes inside of a native `select` element. */\n selectOptions(...optionIndexes: number[]): Promise<void>;\n\n /**\n * Dispatches an event with a particular name.\n * @param name Name of the event to be dispatched.\n */\n dispatchEvent(name: string, data?: Record<string, EventData>): Promise<void>;\n}\n\nexport interface TextOptions {\n /** Optional selector for elements to exclude. */\n exclude?: string;\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\n/**\n * Gets text of element excluding certain selectors within the element.\n * @param element Element to get text from,\n * @param excludeSelector Selector identifying which elements to exclude,\n */\nexport function _getTextWithExcludedElements(element: Element, excludeSelector: string) {\n const clone = element.cloneNode(true) as Element;\n const exclusions = clone.querySelectorAll(excludeSelector);\n for (let i = 0; i < exclusions.length; i++) {\n let child = exclusions[i];\n child.parentNode?.removeChild(child);\n }\n return (clone.textContent || '').trim();\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';\nexport * from './text-filtering';\nexport * from './change-detection';\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;;;;;;;AAsBA;AACA,MAAM,0BAA0B,GAAG,IAAI,eAAe,CAA4B;IAChF,UAAU,EAAE,KAAK;CAClB,CAAC,CAAC;AAEH;AACA,IAAI,+BAAoD,CAAC;AAEzD;;;;;AAKA,SAAS,iCAAiC,CAAC,MAAiC;;IAC1E,MAAA,MAAM,CAAC,kBAAkB,+CAAzB,MAAM,CAAuB,CAAC;AAChC,CAAC;AAED;;;;;SAKgB,+BAA+B,CAC3C,OAAoD;IACtD,qCAAqC,EAAE,CAAC;IACxC,+BAA+B,GAAG,0BAA0B,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AAClF,CAAC;AAED;SACgB,qCAAqC;IACnD,+BAA+B,aAA/B,+BAA+B,uBAA/B,+BAA+B,CAAE,WAAW,EAAE,CAAC;IAC/C,+BAA+B,GAAG,IAAI,CAAC;AACzC,CAAC;AAED;;;;;;;AAOA,SAAe,oBAAoB,CAAI,EAAoB,EAAE,qBAA8B;;;QAEzF,IAAI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AAA;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;AACN,CAAC,EA/BW,OAAO,KAAP,OAAO;;AC7BnB;;;;;;;;ACAA;;;;;;;AAQA;;;;;SAKgB,4BAA4B,CAAC,OAAgB,EAAE,eAAuB;;IACpF,MAAM,KAAK,GAAG,OAAO,CAAC,SAAS,CAAC,IAAI,CAAY,CAAC;IACjD,MAAM,UAAU,GAAG,KAAK,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC;IAC3D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAC1C,IAAI,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;QAC1B,MAAA,KAAK,CAAC,UAAU,0CAAE,WAAW,CAAC,KAAK,CAAC,CAAC;KACtC;IACD,OAAO,CAAC,KAAK,CAAC,WAAW,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC;AAC1C;;ACrBA;;;;;;;;ACAA;;;;;;;;;;"}
1
+ {"version":3,"file":"testing.js","sources":["../../../../../../src/cdk/testing/change-detection.ts","../../../../../../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/text-filtering.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 {BehaviorSubject, Subscription} from 'rxjs';\n\n/** Represents the status of auto change detection. */\nexport interface AutoChangeDetectionStatus {\n /** Whether auto change detection is disabled. */\n isDisabled: boolean;\n /**\n * An optional callback, if present it indicates that change detection should be run immediately,\n * while handling the status change. The callback should then be called as soon as change\n * detection is done.\n */\n onDetectChangesNow?: () => void;\n}\n\n/** Subject used to dispatch and listen for changes to the auto change detection status . */\nconst autoChangeDetectionSubject = new BehaviorSubject<AutoChangeDetectionStatus>({\n isDisabled: false\n});\n\n/** The current subscription to `autoChangeDetectionSubject`. */\nlet autoChangeDetectionSubscription: Subscription | null;\n\n/**\n * The default handler for auto change detection status changes. This handler will be used if the\n * specific environment does not install its own.\n * @param status The new auto change detection status.\n */\nfunction defaultAutoChangeDetectionHandler(status: AutoChangeDetectionStatus) {\n status.onDetectChangesNow?.();\n}\n\n/**\n * Allows a test `HarnessEnvironment` to install its own handler for auto change detection status\n * changes.\n * @param handler The handler for the auto change detection status.\n */\nexport function handleAutoChangeDetectionStatus(\n handler: (status: AutoChangeDetectionStatus) => void) {\n stopHandlingAutoChangeDetectionStatus();\n autoChangeDetectionSubscription = autoChangeDetectionSubject.subscribe(handler);\n}\n\n/** Allows a `HarnessEnvironment` to stop handling auto change detection status changes. */\nexport function stopHandlingAutoChangeDetectionStatus() {\n autoChangeDetectionSubscription?.unsubscribe();\n autoChangeDetectionSubscription = null;\n}\n\n/**\n * Batches together triggering of change detection over the duration of the given function.\n * @param fn The function to call with batched change detection.\n * @param triggerBeforeAndAfter Optionally trigger change detection once before and after the batch\n * operation. If false, change detection will not be triggered.\n * @return The result of the given function.\n */\nasync function batchChangeDetection<T>(fn: () => Promise<T>, triggerBeforeAndAfter: boolean) {\n // If change detection batching is already in progress, just run the function.\n if (autoChangeDetectionSubject.getValue().isDisabled) {\n return await fn();\n }\n\n // If nothing is handling change detection batching, install the default handler.\n if (!autoChangeDetectionSubscription) {\n handleAutoChangeDetectionStatus(defaultAutoChangeDetectionHandler);\n }\n\n if (triggerBeforeAndAfter) {\n await new Promise(resolve => autoChangeDetectionSubject.next({\n isDisabled: true,\n onDetectChangesNow: resolve as () => void,\n }));\n // The function passed in may throw (e.g. if the user wants to make an expectation of an error\n // being thrown. If this happens, we need to make sure we still re-enable change detection, so\n // we wrap it in a `finally` block.\n try {\n return await fn();\n } finally {\n await new Promise(resolve => autoChangeDetectionSubject.next({\n isDisabled: false,\n onDetectChangesNow: resolve as () => void,\n }));\n }\n } else {\n autoChangeDetectionSubject.next({isDisabled: true});\n // The function passed in may throw (e.g. if the user wants to make an expectation of an error\n // being thrown. If this happens, we need to make sure we still re-enable change detection, so\n // we wrap it in a `finally` block.\n try {\n return await fn();\n } finally {\n autoChangeDetectionSubject.next({isDisabled: false});\n }\n }\n}\n\n/**\n * Disables the harness system's auto change detection for the duration of the given function.\n * @param fn The function to disable auto change detection for.\n * @return The result of the given function.\n */\nexport async function manualChangeDetection<T>(fn: () => Promise<T>) {\n return batchChangeDetection(fn, false);\n}\n\n\n\n/**\n * Resolves the given list of async values in parallel (i.e. via Promise.all) while batching change\n * detection over the entire operation such that change detection occurs exactly once before\n * resolving the values and once after.\n * @param values A getter for the async values to resolve in parallel with batched change detection.\n * @return The resolved values.\n */\nexport function parallel<T1, T2, T3, T4, T5>(\n values: () =>\n [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike<T4>,\n T5 | PromiseLike<T5>\n ]): Promise<[T1, T2, T3, T4, T5]>;\n\n/**\n * Resolves the given list of async values in parallel (i.e. via Promise.all) while batching change\n * detection over the entire operation such that change detection occurs exactly once before\n * resolving the values and once after.\n * @param values A getter for the async values to resolve in parallel with batched change detection.\n * @return The resolved values.\n */\nexport function parallel<T1, T2, T3, T4>(\n values: () =>\n [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike<T4>]):\n Promise<[T1, T2, T3, T4]>;\n\n/**\n * Resolves the given list of async values in parallel (i.e. via Promise.all) while batching change\n * detection over the entire operation such that change detection occurs exactly once before\n * resolving the values and once after.\n * @param values A getter for the async values to resolve in parallel with batched change detection.\n * @return The resolved values.\n */\nexport function parallel<T1, T2, T3>(\n values: () => [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>]):\n Promise<[T1, T2, T3]>;\n\n/**\n * Resolves the given list of async values in parallel (i.e. via Promise.all) while batching change\n * detection over the entire operation such that change detection occurs exactly once before\n * resolving the values and once after.\n * @param values A getter for the async values to resolve in parallel with batched change detection.\n * @return The resolved values.\n */\nexport function parallel<T1, T2>(values: () => [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>]):\n Promise<[T1, T2]>;\n\n/**\n * Resolves the given list of async values in parallel (i.e. via Promise.all) while batching change\n * detection over the entire operation such that change detection occurs exactly once before\n * resolving the values and once after.\n * @param values A getter for the async values to resolve in parallel with batched change detection.\n * @return The resolved values.\n */\nexport function parallel<T>(values: () => (T | PromiseLike<T>)[]): Promise<T[]>;\n\n/**\n * Resolves the given list of async values in parallel (i.e. via Promise.all) while batching change\n * detection over the entire operation such that change detection occurs exactly once before\n * resolving the values and once after.\n * @param values A getter for the async values to resolve in parallel with batched change detection.\n * @return The resolved values.\n */\nexport async function parallel<T>(values: () => Iterable<T | PromiseLike<T>>): Promise<T[]> {\n return batchChangeDetection(() => Promise.all(values()), true);\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 {parallel} from './change-detection';\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 async getChildLoader(selector: S): Promise<HarnessLoader> {\n return (await this.getRootHarnessLoader()).getChildLoader(selector);\n }\n\n async getAllChildLoaders(selector: S): Promise<HarnessLoader[]> {\n return (await this.getRootHarnessLoader()).getAllChildLoaders(selector);\n }\n\n async getHarness<T extends ComponentHarness>(query: HarnessQuery<T>): Promise<T> {\n return (await this.getRootHarnessLoader()).getHarness(query);\n }\n\n async getAllHarnesses<T extends ComponentHarness>(query: HarnessQuery<T>): Promise<T[]> {\n return (await this.getRootHarnessLoader()).getAllHarnesses(query);\n }\n\n /**\n * Gets the root harness loader from which to start\n * searching for content contained by this harness.\n */\n protected async getRootHarnessLoader(): Promise<HarnessLoader> {\n return this.locatorFactory.rootHarnessLoader();\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 if (harnesses.length === 0) {\n return [];\n }\n const results = await parallel(() => 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 parallel(() => 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 // We don't have to go through the extra trouble if there are no ancestors.\n if (!this._ancestor) {\n return (this.harnessType.hostSelector || '').trim();\n }\n\n const [ancestors, ancestorPlaceholders] = _splitAndEscapeSelector(this._ancestor);\n const [selectors, selectorPlaceholders] =\n _splitAndEscapeSelector(this.harnessType.hostSelector || '');\n const result: string[] = [];\n\n // We have to add the ancestor to each part of the host compound selector, otherwise we can get\n // incorrect results. E.g. `.ancestor .a, .ancestor .b` vs `.ancestor .a, .b`.\n ancestors.forEach(escapedAncestor => {\n const ancestor = _restoreSelector(escapedAncestor, ancestorPlaceholders);\n return selectors.forEach(escapedSelector =>\n result.push(`${ancestor} ${_restoreSelector(escapedSelector, selectorPlaceholders)}`));\n });\n\n return result.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/**\n * Splits up a compound selector into its parts and escapes any quoted content. The quoted content\n * has to be escaped, because it can contain commas which will throw throw us off when trying to\n * split it.\n * @param selector Selector to be split.\n * @returns The escaped string where any quoted content is replaced with a placeholder. E.g.\n * `[foo=\"bar\"]` turns into `[foo=__cdkPlaceholder-0__]`. Use `_restoreSelector` to restore\n * the placeholders.\n */\nfunction _splitAndEscapeSelector(selector: string): [parts: string[], placeholders: string[]] {\n const placeholders: string[] = [];\n\n // Note that the regex doesn't account for nested quotes so something like `\"ab'cd'e\"` will be\n // considered as two blocks. It's a bit of an edge case, but if we find that it's a problem,\n // we can make it a bit smarter using a loop. Use this for now since it's more readable and\n // compact. More complete implementation:\n // https://github.com/angular/angular/blob/bd34bc9e89f18a/packages/compiler/src/shadow_css.ts#L655\n const result = selector.replace(/([\"'][^[\"']*[\"'])/g, (_, keep) => {\n const replaceBy = `__cdkPlaceholder-${placeholders.length}__`;\n placeholders.push(keep);\n return replaceBy;\n });\n\n return [result.split(',').map(part => part.trim()), placeholders];\n}\n\n/** Restores a selector whose content was escaped in `_splitAndEscapeSelector`. */\nfunction _restoreSelector(selector: string, placeholders: string[]): string {\n return selector.replace(/__cdkPlaceholder-(\\d+)__/g, (_, index) => placeholders[+index]);\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 {parallel} from './change-detection';\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 parallel(() => rawElements.map(async rawElement => {\n const testElement = this.createTestElement(rawElement);\n const allResultsForElement = await parallel(\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.\n // multiple `TestElement` or multiple `ComponentHarness` of the same type).\n () => allQueries.map(query => this._getQueryResultForElement(\n 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/** Data that can be attached to a custom event dispatched from a `TestElement`. */\nexport type EventData =\n string | number | boolean | undefined | null | EventData[] | {[key: string]: EventData};\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 /**\n * Click the element at the default location for the current environment. If you need to guarantee\n * the element is clicked at a specific location, consider using `click('center')` or\n * `click(x, y)` instead.\n */\n click(modifiers?: ModifierKeys): Promise<void>;\n\n /** Click the element at the element's center. */\n click(location: 'center', modifiers?: ModifierKeys): 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 * @param modifiers Modifier keys held while clicking\n */\n click(relativeX: number, relativeY: number, modifiers?: ModifierKeys): Promise<void>;\n\n /**\n * Right clicks on the element at the specified coordinates relative to the top-left of it.\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 * @param modifiers Modifier keys held while clicking\n */\n rightClick(relativeX: number, relativeY: number, modifiers?: ModifierKeys): 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 /**\n * Gets the text from the element.\n * @param options Options that affect what text is included.\n */\n text(options?: TextOptions): 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 /** 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 /** Sets the value of a property of an input. */\n setInputValue(value: string): Promise<void>;\n\n // Note that ideally here we'd be selecting options based on their value, rather than their\n // index, but we're limited by `@angular/forms` which will modify the option value in some cases.\n // Since the value will be truncated, we can't rely on it to do the lookup in the DOM. See:\n // https://github.com/angular/angular/blob/master/packages/forms/src/directives/select_control_value_accessor.ts#L19\n /** Selects the options at the specified indexes inside of a native `select` element. */\n selectOptions(...optionIndexes: number[]): Promise<void>;\n\n /**\n * Dispatches an event with a particular name.\n * @param name Name of the event to be dispatched.\n */\n dispatchEvent(name: string, data?: Record<string, EventData>): Promise<void>;\n}\n\nexport interface TextOptions {\n /** Optional selector for elements to exclude. */\n exclude?: string;\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\n/**\n * Gets text of element excluding certain selectors within the element.\n * @param element Element to get text from,\n * @param excludeSelector Selector identifying which elements to exclude,\n */\nexport function _getTextWithExcludedElements(element: Element, excludeSelector: string) {\n const clone = element.cloneNode(true) as Element;\n const exclusions = clone.querySelectorAll(excludeSelector);\n for (let i = 0; i < exclusions.length; i++) {\n let child = exclusions[i];\n child.parentNode?.removeChild(child);\n }\n return (clone.textContent || '').trim();\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';\nexport * from './text-filtering';\nexport * from './change-detection';\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;;;;;;;AAsBA;AACA,MAAM,0BAA0B,GAAG,IAAI,eAAe,CAA4B;IAChF,UAAU,EAAE,KAAK;CAClB,CAAC,CAAC;AAEH;AACA,IAAI,+BAAoD,CAAC;AAEzD;;;;;AAKA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OAAO,CAAC,KAAK,CAAC,WAAW,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC;AAC1C;;ACrBA;;;;;;;;ACAA;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/cdk",
3
- "version": "12.0.0-rc.2",
3
+ "version": "12.0.2",
4
4
  "description": "Angular Material Component Development Kit",
5
5
  "repository": {
6
6
  "type": "git",
@@ -19,8 +19,8 @@
19
19
  },
20
20
  "homepage": "https://github.com/angular/components#readme",
21
21
  "peerDependencies": {
22
- "@angular/core": "^12.0.0-0 || ^13.0.0-0",
23
- "@angular/common": "^12.0.0-0 || ^13.0.0-0",
22
+ "@angular/core": "^12.0.0 || ^13.0.0-0",
23
+ "@angular/common": "^12.0.0 || ^13.0.0-0",
24
24
  "rxjs": "^6.5.3"
25
25
  },
26
26
  "dependencies": {
@@ -9,3 +9,8 @@
9
9
  export declare function _supportsShadowDom(): boolean;
10
10
  /** Gets the shadow root of an element, if supported and the element is inside the Shadow DOM. */
11
11
  export declare function _getShadowRoot(element: HTMLElement): ShadowRoot | null;
12
+ /**
13
+ * Gets the currently-focused element on the page while
14
+ * also piercing through Shadow DOM boundaries.
15
+ */
16
+ export declare function _getFocusedElementPierceShadowDom(): HTMLElement | null;
@@ -1 +1 @@
1
- {"__symbolic":"module","version":4,"metadata":{"Platform":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":30,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":77,"character":15},"arguments":[{"__symbolic":"reference","module":"@angular/core","name":"PLATFORM_ID","line":77,"character":22}]}]],"parameters":[{"__symbolic":"reference","name":"Object"}]}]},"statics":{"ɵprov":{}}},"PlatformModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":11,"character":1},"arguments":[{}]}],"members":{}},"getSupportedInputTypes":{"__symbolic":"function"},"supportsPassiveEventListeners":{"__symbolic":"function"},"normalizePassiveListenerOptions":{"__symbolic":"function","parameters":["options"],"value":{"__symbolic":"if","condition":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"supportsPassiveEventListeners"}},"thenExpression":{"__symbolic":"reference","name":"options"},"elseExpression":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"options"},"member":"capture"}}}}},"RtlScrollAxisType":{"NORMAL":0,"NEGATED":1,"INVERTED":2},"supportsScrollBehavior":{"__symbolic":"function"},"getRtlScrollAxisType":{"__symbolic":"function"},"_supportsShadowDom":{"__symbolic":"function"},"_getShadowRoot":{"__symbolic":"function"}},"origins":{"Platform":"./platform","PlatformModule":"./platform-module","getSupportedInputTypes":"./features/input-types","supportsPassiveEventListeners":"./features/passive-listeners","normalizePassiveListenerOptions":"./features/passive-listeners","RtlScrollAxisType":"./features/scrolling","supportsScrollBehavior":"./features/scrolling","getRtlScrollAxisType":"./features/scrolling","_supportsShadowDom":"./features/shadow-dom","_getShadowRoot":"./features/shadow-dom"},"importAs":"@angular/cdk/platform"}
1
+ {"__symbolic":"module","version":4,"metadata":{"Platform":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":30,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":77,"character":15},"arguments":[{"__symbolic":"reference","module":"@angular/core","name":"PLATFORM_ID","line":77,"character":22}]}]],"parameters":[{"__symbolic":"reference","name":"Object"}]}]},"statics":{"ɵprov":{}}},"PlatformModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":11,"character":1},"arguments":[{}]}],"members":{}},"getSupportedInputTypes":{"__symbolic":"function"},"supportsPassiveEventListeners":{"__symbolic":"function"},"normalizePassiveListenerOptions":{"__symbolic":"function","parameters":["options"],"value":{"__symbolic":"if","condition":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"supportsPassiveEventListeners"}},"thenExpression":{"__symbolic":"reference","name":"options"},"elseExpression":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"options"},"member":"capture"}}}}},"RtlScrollAxisType":{"NORMAL":0,"NEGATED":1,"INVERTED":2},"supportsScrollBehavior":{"__symbolic":"function"},"getRtlScrollAxisType":{"__symbolic":"function"},"_supportsShadowDom":{"__symbolic":"function"},"_getShadowRoot":{"__symbolic":"function"},"_getFocusedElementPierceShadowDom":{"__symbolic":"function"}},"origins":{"Platform":"./platform","PlatformModule":"./platform-module","getSupportedInputTypes":"./features/input-types","supportsPassiveEventListeners":"./features/passive-listeners","normalizePassiveListenerOptions":"./features/passive-listeners","RtlScrollAxisType":"./features/scrolling","supportsScrollBehavior":"./features/scrolling","getRtlScrollAxisType":"./features/scrolling","_supportsShadowDom":"./features/shadow-dom","_getShadowRoot":"./features/shadow-dom","_getFocusedElementPierceShadowDom":"./features/shadow-dom"},"importAs":"@angular/cdk/platform"}