@angular/cdk 9.1.1 → 9.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/a11y/focus-monitor/focus-monitor.d.ts +36 -2
- package/a11y/index.metadata.json +1 -1
- package/bundles/cdk-a11y.umd.js +241 -19
- package/bundles/cdk-a11y.umd.js.map +1 -1
- package/bundles/cdk-a11y.umd.min.js +25 -10
- package/bundles/cdk-a11y.umd.min.js.map +1 -1
- package/bundles/cdk-clipboard.umd.js +1 -1
- package/bundles/cdk-clipboard.umd.js.map +1 -1
- package/bundles/cdk-clipboard.umd.min.js +1 -1
- package/bundles/cdk-clipboard.umd.min.js.map +1 -1
- package/bundles/cdk-coercion.umd.js +0 -1
- package/bundles/cdk-coercion.umd.js.map +1 -1
- package/bundles/cdk-coercion.umd.min.js.map +1 -1
- package/bundles/cdk-collections.umd.js +203 -6
- package/bundles/cdk-collections.umd.js.map +1 -1
- package/bundles/cdk-collections.umd.min.js +17 -10
- package/bundles/cdk-collections.umd.min.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.js +217 -23
- package/bundles/cdk-drag-drop.umd.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.min.js +25 -10
- package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
- package/bundles/cdk-overlay.umd.js +210 -12
- package/bundles/cdk-overlay.umd.js.map +1 -1
- package/bundles/cdk-overlay.umd.min.js +27 -12
- package/bundles/cdk-overlay.umd.min.js.map +1 -1
- package/bundles/cdk-platform.umd.js +11 -0
- package/bundles/cdk-platform.umd.js.map +1 -1
- package/bundles/cdk-platform.umd.min.js +6 -6
- package/bundles/cdk-platform.umd.min.js.map +1 -1
- package/bundles/cdk-portal.umd.js +211 -14
- package/bundles/cdk-portal.umd.js.map +1 -1
- package/bundles/cdk-portal.umd.min.js +19 -4
- package/bundles/cdk-portal.umd.min.js.map +1 -1
- package/bundles/cdk-scrolling.umd.js +242 -14
- package/bundles/cdk-scrolling.umd.js.map +1 -1
- package/bundles/cdk-scrolling.umd.min.js +14 -6
- package/bundles/cdk-scrolling.umd.min.js.map +1 -1
- package/bundles/cdk-table.umd.js +278 -50
- package/bundles/cdk-table.umd.js.map +1 -1
- package/bundles/cdk-table.umd.min.js +29 -7
- package/bundles/cdk-table.umd.min.js.map +1 -1
- package/bundles/cdk-testing-protractor.umd.js +254 -49
- package/bundles/cdk-testing-protractor.umd.js.map +1 -1
- package/bundles/cdk-testing-protractor.umd.min.js +16 -9
- package/bundles/cdk-testing-protractor.umd.min.js.map +1 -1
- package/bundles/cdk-testing-testbed.umd.js +257 -54
- package/bundles/cdk-testing-testbed.umd.js.map +1 -1
- package/bundles/cdk-testing-testbed.umd.min.js +23 -8
- package/bundles/cdk-testing-testbed.umd.min.js.map +1 -1
- package/bundles/cdk-testing.umd.js +243 -46
- package/bundles/cdk-testing.umd.js.map +1 -1
- package/bundles/cdk-testing.umd.min.js +20 -5
- package/bundles/cdk-testing.umd.min.js.map +1 -1
- package/bundles/cdk-text-field.umd.js +21 -6
- package/bundles/cdk-text-field.umd.js.map +1 -1
- package/bundles/cdk-text-field.umd.min.js +3 -3
- package/bundles/cdk-text-field.umd.min.js.map +1 -1
- package/bundles/cdk-tree.umd.js +212 -15
- package/bundles/cdk-tree.umd.js.map +1 -1
- package/bundles/cdk-tree.umd.min.js +17 -3
- package/bundles/cdk-tree.umd.min.js.map +1 -1
- package/bundles/cdk.umd.js +1 -1
- package/bundles/cdk.umd.js.map +1 -1
- package/bundles/cdk.umd.min.js +1 -1
- package/bundles/cdk.umd.min.js.map +1 -1
- package/coercion/array.d.ts +1 -0
- package/esm2015/a11y/focus-monitor/focus-monitor.js +93 -12
- package/esm2015/a11y/focus-trap/configurable-focus-trap-factory.js +3 -3
- package/esm2015/a11y/focus-trap/focus-trap.js +1 -1
- package/esm2015/a11y/live-announcer/live-announcer.js +1 -1
- package/esm2015/a11y/public-api.js +2 -2
- package/esm2015/bidi/directionality.js +1 -1
- package/esm2015/clipboard/pending-copy.js +3 -3
- package/esm2015/coercion/array.js +1 -2
- package/esm2015/drag-drop/drag-drop.js +1 -1
- package/esm2015/drag-drop/drag-ref.js +7 -5
- package/esm2015/drag-drop/drop-list-ref.js +11 -19
- package/esm2015/layout/breakpoints-observer.js +1 -1
- package/esm2015/overlay/position/flexible-connected-position-strategy.js +3 -2
- package/esm2015/overlay/position/overlay-position-builder.js +1 -1
- package/esm2015/platform/features/shadow-dom.js +16 -1
- package/esm2015/platform/public-api.js +2 -2
- package/esm2015/scrolling/scroll-dispatcher.js +38 -5
- package/esm2015/scrolling/viewport-ruler.js +44 -5
- package/esm2015/table/cell.js +18 -8
- package/esm2015/table/public-api.js +3 -2
- package/esm2015/table/row.js +24 -8
- package/esm2015/table/table.js +26 -12
- package/esm2015/table/text-column.js +3 -26
- package/esm2015/table/tokens.js +44 -0
- package/esm2015/testing/protractor/protractor-element.js +4 -2
- package/esm2015/testing/protractor/protractor-harness-environment.js +13 -8
- package/esm2015/testing/testbed/testbed-harness-environment.js +16 -10
- package/esm2015/text-field/autosize.js +38 -4
- package/esm2015/version.js +1 -1
- package/esm5/a11y/focus-monitor/focus-monitor.js +39 -13
- package/esm5/a11y/focus-trap/configurable-focus-trap-factory.js +3 -3
- package/esm5/a11y/focus-trap/focus-trap.js +1 -1
- package/esm5/a11y/live-announcer/live-announcer.js +1 -1
- package/esm5/bidi/directionality.js +1 -1
- package/esm5/clipboard/pending-copy.js +2 -2
- package/esm5/coercion/array.js +1 -2
- package/esm5/drag-drop/drag-drop.js +1 -1
- package/esm5/drag-drop/drag-ref.js +7 -5
- package/esm5/drag-drop/drop-list-ref.js +9 -14
- package/esm5/layout/breakpoints-observer.js +1 -1
- package/esm5/overlay/position/flexible-connected-position-strategy.js +3 -2
- package/esm5/overlay/position/overlay-position-builder.js +1 -1
- package/esm5/platform/features/shadow-dom.js +11 -1
- package/esm5/scrolling/scroll-dispatcher.js +21 -5
- package/esm5/scrolling/viewport-ruler.js +24 -5
- package/esm5/table/cell.js +13 -8
- package/esm5/table/public-api.js +2 -1
- package/esm5/table/row.js +21 -11
- package/esm5/table/table.js +16 -11
- package/esm5/table/text-column.js +3 -4
- package/esm5/table/tokens.js +16 -0
- package/esm5/testing/protractor/protractor-element.js +4 -2
- package/esm5/testing/protractor/protractor-harness-environment.js +17 -11
- package/esm5/testing/testbed/testbed-harness-environment.js +17 -11
- package/esm5/text-field/autosize.js +20 -4
- package/esm5/version.js +1 -1
- package/fesm2015/a11y.js +89 -11
- package/fesm2015/a11y.js.map +1 -1
- package/fesm2015/cdk.js +1 -1
- package/fesm2015/cdk.js.map +1 -1
- package/fesm2015/clipboard.js +2 -2
- package/fesm2015/clipboard.js.map +1 -1
- package/fesm2015/coercion.js +0 -1
- package/fesm2015/coercion.js.map +1 -1
- package/fesm2015/drag-drop.js +16 -22
- package/fesm2015/drag-drop.js.map +1 -1
- package/fesm2015/overlay.js +2 -1
- package/fesm2015/overlay.js.map +1 -1
- package/fesm2015/platform.js +16 -1
- package/fesm2015/platform.js.map +1 -1
- package/fesm2015/scrolling.js +76 -7
- package/fesm2015/scrolling.js.map +1 -1
- package/fesm2015/table.js +98 -49
- package/fesm2015/table.js.map +1 -1
- package/fesm2015/testing/protractor.js +16 -9
- package/fesm2015/testing/protractor.js.map +1 -1
- package/fesm2015/testing/testbed.js +15 -9
- package/fesm2015/testing/testbed.js.map +1 -1
- package/fesm2015/text-field.js +37 -3
- package/fesm2015/text-field.js.map +1 -1
- package/fesm5/a11y.js +36 -12
- package/fesm5/a11y.js.map +1 -1
- package/fesm5/cdk.js +1 -1
- package/fesm5/cdk.js.map +1 -1
- package/fesm5/clipboard.js +1 -1
- package/fesm5/clipboard.js.map +1 -1
- package/fesm5/coercion.js +0 -1
- package/fesm5/coercion.js.map +1 -1
- package/fesm5/drag-drop.js +14 -17
- package/fesm5/drag-drop.js.map +1 -1
- package/fesm5/overlay.js +2 -1
- package/fesm5/overlay.js.map +1 -1
- package/fesm5/platform.js +11 -1
- package/fesm5/platform.js.map +1 -1
- package/fesm5/scrolling.js +39 -7
- package/fesm5/scrolling.js.map +1 -1
- package/fesm5/table.js +59 -29
- package/fesm5/table.js.map +1 -1
- package/fesm5/testing/protractor.js +20 -12
- package/fesm5/testing/protractor.js.map +1 -1
- package/fesm5/testing/testbed.js +16 -10
- package/fesm5/testing/testbed.js.map +1 -1
- package/fesm5/text-field.js +19 -3
- package/fesm5/text-field.js.map +1 -1
- package/package.json +1 -1
- package/platform/features/shadow-dom.d.ts +2 -0
- package/platform/index.metadata.json +1 -1
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-update/upgrade-rules/class-names-rule.js +3 -1
- package/schematics/utils/ast/ng-module-imports.js +3 -2
- package/scrolling/index.metadata.json +1 -1
- package/scrolling/scroll-dispatcher.d.ts +9 -1
- package/scrolling/viewport-ruler.d.ts +9 -1
- package/table/cell.d.ts +2 -0
- package/table/index.metadata.json +1 -1
- package/table/public-api.d.ts +1 -0
- package/table/row.d.ts +6 -3
- package/table/table.d.ts +2 -0
- package/table/text-column.d.ts +2 -13
- package/table/tokens.d.ts +25 -0
- package/testing/protractor/protractor-harness-environment.d.ts +10 -3
- package/testing/testbed/testbed-harness-environment.d.ts +12 -4
- package/text-field/autosize.d.ts +9 -1
- package/text-field/index.metadata.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["src/cdk/cdk-testing.umd.js"],"names":["global","factory","exports","module","require","define","amd","self","ng","cdk","testing","tslib","this","TestKey","ComponentHarness","locatorFactory","prototype","host","__awaiter","__generator","_a","rootElement","documentRootLocatorFactory","locatorFor","queries","_i","arguments","length","apply","__spread","locatorForOptional","locatorForAll","forceStabilize","waitForTasksOutsideAngular","HarnessPredicate","harnessType","options","_predicates","_descriptions","_addBaseOptions","stringMatches","value","pattern","label","sent","test","add","description","predicate","push","addOption","name","option","undefined","_valueAsString","JSON","stringify","_","v","RegExp","toString","replace","item","filter","harnesses","results","_this","Promise","all","map","h","evaluate","i","harness","p","reduce","combined","current","getDescription","join","getSelector","_ancestor","split","part","trim","hostSelector","ancestor","selector","matchesSelector","HarnessEnvironment","rawRootElement","createTestElement","createEnvironment","getDocumentRoot","_assertResultFound","_getAllHarnessesAndTestElements","_getDescriptionForLocatorForQueries","harnessLoaderFor","_b","getAllRawElements","_getDescriptionForHarnessLoaderQuery","harnessLoaderForOptional","elements","harnessLoaderForAll","element","getHarness","query","getAllHarnesses","getChildLoader","getAllChildLoaders","e","createComponentHarness","allQueries","harnessQueries","elementQueries","harnessTypes","rawElements","skipSelectorCheck","perElementMatches","_c","_parseQueries","e_1","Set","queries_1","__values","queries_1_1","next","done","e_1_1","error","return","call","size","rawElement","testElement","_getQueryResultForElement","_removeDuplicateQueryResults","concat","testElementMatched","matchedHarnessTypes","dedupedMatches","results_1","results_1_1","result","e_2","has","constructor","e_2_1","queryDescriptions","Error","desc","_getDescriptionForTestElementQuery","_getDescriptionForComponentHarnessQuery","harnessPredicate","Object","defineProperty"],"mappings":"CAAC,SAAUA,EAAQC,GACI,iBAAZC,SAA0C,oBAAXC,OAAyBF,EAAQC,QAASE,QAAQ,UACtE,mBAAXC,QAAyBA,OAAOC,IAAMD,OAAO,uBAAwB,CAAC,UAAW,SAAUJ,GACxEA,IAAzBD,EAASA,GAAUO,MAAsBC,GAAKR,EAAOQ,IAAM,GAAIR,EAAOQ,GAAGC,IAAMT,EAAOQ,GAAGC,KAAO,GAAIT,EAAOQ,GAAGC,IAAIC,QAAU,IAAKV,EAAOW,OAH7I,CAIEC,MAAM,SAAWV,EAASS,GAAS;;;;;;;OAcjC,IAqoBWE,EAroBPC,EAAkC,WAClC,SAASA,EAAiBC,GACtBH,KAAKG,eAAiBA,EA+I1B,OA5IAD,EAAiBE,UAAUC,KAAO,WAC9B,OAAON,EAAMO,UAAUN,UAAM,OAAQ,GAAQ,WACzC,OAAOD,EAAMQ,YAAYP,MAAM,SAAUQ,GACrC,MAAO,CAAC,EAAcR,KAAKG,eAAeM,oBAStDP,EAAiBE,UAAU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A,EAAe,MAAI,GAAK,QAChCA,EAAQA,EAAe,MAAI,GAAK,QAChCA,EAAQA,EAAiB,QAAI,GAAK,UAClCA,EAAQA,EAAa,IAAI,GAAK,MAC9BA,EAAQA,EAAgB,OAAI,GAAK,SACjCA,EAAQA,EAAiB,QAAI,GAAK,UAClCA,EAAQA,EAAmB,UAAI,GAAK,YACpCA,EAAQA,EAAa,IAAI,GAAK,MAC9BA,EAAQA,EAAc,KAAI,IAAM,OAChCA,EAAQA,EAAoB,WAAI,IAAM,aACtCA,EAAQA,EAAkB,SAAI,IAAM,WACpCA,EAAQA,EAAqB,YAAI,IAAM,cACvCA,EAAQA,EAAoB,WAAI,IAAM,aACtCA,EAAQA,EAAgB,OAAI,IAAM,SAClCA,EAAQA,EAAgB,OAAI,IAAM,SAClCA,EAAQA,EAAY,GAAI,IAAM,KAC9BA,EAAQA,EAAY,GAAI,IAAM,KAC9BA,EAAQA,EAAY,GAAI,IAAM,KAC9BA,EAAQA,EAAY,GAAI,IAAM,KAC9BA,EAAQA,EAAY,GAAI,IAAM,KAC9BA,EAAQA,EAAY,GAAI,IAAM,KAC9BA,EAAQA,EAAY,GAAI,IAAM,KAC9BA,EAAQA,EAAY,GAAI,IAAM,KAC9BA,EAAQA,EAAY,GAAI,IAAM,KAC9BA,EAAQA,EAAa,IAAI,IAAM,MAC/BA,EAAQA,EAAa,IAAI,IAAM,MAC/BA,EAAQA,EAAa,IAAI,IAAM,MAC/BA,EAAQA,EAAc,KAAI,IAAM;;;;;;;;;;;;;;;AAmBpCX,EAAQY,iBAAmBA,EAC3BZ,EAAQuF,mBAAqBA,EAC7BvF,EAAQgC,iBAAmBA,EAE3BwH,OAAOC,eAAezJ,EAAS,aAAc,CAAEuC,OAAO","sourcesContent":["(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('tslib')) :\n typeof define === 'function' && define.amd ? define('@angular/cdk/testing', ['exports', 'tslib'], factory) :\n (global = global || self, factory((global.ng = global.ng || {}, global.ng.cdk = global.ng.cdk || {}, global.ng.cdk.testing = {}), global.tslib));\n}(this, (function (exports, tslib) { 'use strict';\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 * 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 */\n var ComponentHarness = /** @class */ (function () {\n function ComponentHarness(locatorFactory) {\n this.locatorFactory = locatorFactory;\n }\n /** Gets a `Promise` for the `TestElement` representing the host element of the component. */\n ComponentHarness.prototype.host = function () {\n return tslib.__awaiter(this, void 0, void 0, function () {\n return tslib.__generator(this, function (_a) {\n return [2 /*return*/, this.locatorFactory.rootElement];\n });\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 ComponentHarness.prototype.documentRootLocatorFactory = function () {\n return this.locatorFactory.documentRootLocatorFactory();\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 ComponentHarness.prototype.locatorFor = function () {\n var _a;\n var queries = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n queries[_i] = arguments[_i];\n }\n return (_a = this.locatorFactory).locatorFor.apply(_a, tslib.__spread(queries));\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 ComponentHarness.prototype.locatorForOptional = function () {\n var _a;\n var queries = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n queries[_i] = arguments[_i];\n }\n return (_a = this.locatorFactory).locatorForOptional.apply(_a, tslib.__spread(queries));\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 ComponentHarness.prototype.locatorForAll = function () {\n var _a;\n var queries = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n queries[_i] = arguments[_i];\n }\n return (_a = this.locatorFactory).locatorForAll.apply(_a, tslib.__spread(queries));\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 ComponentHarness.prototype.forceStabilize = function () {\n return tslib.__awaiter(this, void 0, void 0, function () {\n return tslib.__generator(this, function (_a) {\n return [2 /*return*/, this.locatorFactory.forceStabilize()];\n });\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 ComponentHarness.prototype.waitForTasksOutsideAngular = function () {\n return tslib.__awaiter(this, void 0, void 0, function () {\n return tslib.__generator(this, function (_a) {\n return [2 /*return*/, this.locatorFactory.waitForTasksOutsideAngular()];\n });\n });\n };\n return ComponentHarness;\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 */\n var HarnessPredicate = /** @class */ (function () {\n function HarnessPredicate(harnessType, options) {\n this.harnessType = harnessType;\n this._predicates = [];\n this._descriptions = [];\n this._addBaseOptions(options);\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 HarnessPredicate.stringMatches = function (value, pattern) {\n return tslib.__awaiter(this, void 0, void 0, function () {\n return tslib.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, value];\n case 1:\n value = _a.sent();\n if (pattern === null) {\n return [2 /*return*/, value === null];\n }\n else if (value === null) {\n return [2 /*return*/, false];\n }\n return [2 /*return*/, typeof pattern === 'string' ? value === pattern : pattern.test(value)];\n }\n });\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 HarnessPredicate.prototype.add = function (description, predicate) {\n this._descriptions.push(description);\n this._predicates.push(predicate);\n return this;\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 HarnessPredicate.prototype.addOption = function (name, option, predicate) {\n if (option !== undefined) {\n this.add(name + \" = \" + _valueAsString(option), function (item) { return predicate(item, option); });\n }\n return this;\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 HarnessPredicate.prototype.filter = function (harnesses) {\n return tslib.__awaiter(this, void 0, void 0, function () {\n var results;\n var _this = this;\n return tslib.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, Promise.all(harnesses.map(function (h) { return _this.evaluate(h); }))];\n case 1:\n results = _a.sent();\n return [2 /*return*/, harnesses.filter(function (_, i) { return results[i]; })];\n }\n });\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 HarnessPredicate.prototype.evaluate = function (harness) {\n return tslib.__awaiter(this, void 0, void 0, function () {\n var results;\n return tslib.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, Promise.all(this._predicates.map(function (p) { return p(harness); }))];\n case 1:\n results = _a.sent();\n return [2 /*return*/, results.reduce(function (combined, current) { return combined && current; }, true)];\n }\n });\n });\n };\n /** Gets a description of this predicate for use in error messages. */\n HarnessPredicate.prototype.getDescription = function () {\n return this._descriptions.join(', ');\n };\n /** Gets the selector used to find candidate elements. */\n HarnessPredicate.prototype.getSelector = function () {\n var _this = this;\n return this._ancestor.split(',')\n .map(function (part) { return (part.trim() + \" \" + _this.harnessType.hostSelector).trim(); })\n .join(',');\n };\n /** Adds base options common to all harness types. */\n HarnessPredicate.prototype._addBaseOptions = function (options) {\n var _this = this;\n this._ancestor = options.ancestor || '';\n if (this._ancestor) {\n this._descriptions.push(\"has ancestor matching selector \\\"\" + this._ancestor + \"\\\"\");\n }\n var selector = options.selector;\n if (selector !== undefined) {\n this.add(\"host matches selector \\\"\" + selector + \"\\\"\", function (item) { return tslib.__awaiter(_this, void 0, void 0, function () {\n return tslib.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, item.host()];\n case 1: return [2 /*return*/, (_a.sent()).matchesSelector(selector)];\n }\n });\n }); });\n }\n };\n return HarnessPredicate;\n }());\n /** Represent a value as a string for the purpose of logging. */\n function _valueAsString(value) {\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, function (_, v) {\n if (v instanceof RegExp) {\n return \"/\" + v.toString() + \"/\";\n }\n return typeof v === 'string' ? v.replace('/\\//g', '\\\\/') : v;\n }).replace(/\"\\/\\//g, '\\\\/').replace(/\\/\\/\"/g, '\\\\/').replace(/\\\\\\//g, '/');\n }\n catch (_a) {\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 * @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 * 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 */\n var HarnessEnvironment = /** @class */ (function () {\n function HarnessEnvironment(rawRootElement) {\n this.rawRootElement = rawRootElement;\n this.rootElement = this.createTestElement(rawRootElement);\n }\n // Implemented as part of the `LocatorFactory` interface.\n HarnessEnvironment.prototype.documentRootLocatorFactory = function () {\n return this.createEnvironment(this.getDocumentRoot());\n };\n // Implemented as part of the `LocatorFactory` interface.\n HarnessEnvironment.prototype.locatorFor = function () {\n var _this = this;\n var queries = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n queries[_i] = arguments[_i];\n }\n return function () { return _assertResultFound(_this._getAllHarnessesAndTestElements(queries), _getDescriptionForLocatorForQueries(queries)); };\n };\n // Implemented as part of the `LocatorFactory` interface.\n HarnessEnvironment.prototype.locatorForOptional = function () {\n var _this = this;\n var queries = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n queries[_i] = arguments[_i];\n }\n return function () { return tslib.__awaiter(_this, void 0, void 0, function () { return tslib.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this._getAllHarnessesAndTestElements(queries)];\n case 1: return [2 /*return*/, (_a.sent())[0] || null];\n }\n }); }); };\n };\n // Implemented as part of the `LocatorFactory` interface.\n HarnessEnvironment.prototype.locatorForAll = function () {\n var _this = this;\n var queries = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n queries[_i] = arguments[_i];\n }\n return function () { return _this._getAllHarnessesAndTestElements(queries); };\n };\n // Implemented as part of the `LocatorFactory` interface.\n HarnessEnvironment.prototype.harnessLoaderFor = function (selector) {\n return tslib.__awaiter(this, void 0, void 0, function () {\n var _a;\n return tslib.__generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _a = this.createEnvironment;\n return [4 /*yield*/, _assertResultFound(this.getAllRawElements(selector), [_getDescriptionForHarnessLoaderQuery(selector)])];\n case 1: return [2 /*return*/, _a.apply(this, [_b.sent()])];\n }\n });\n });\n };\n // Implemented as part of the `LocatorFactory` interface.\n HarnessEnvironment.prototype.harnessLoaderForOptional = function (selector) {\n return tslib.__awaiter(this, void 0, void 0, function () {\n var elements;\n return tslib.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.getAllRawElements(selector)];\n case 1:\n elements = _a.sent();\n return [2 /*return*/, elements[0] ? this.createEnvironment(elements[0]) : null];\n }\n });\n });\n };\n // Implemented as part of the `LocatorFactory` interface.\n HarnessEnvironment.prototype.harnessLoaderForAll = function (selector) {\n return tslib.__awaiter(this, void 0, void 0, function () {\n var elements;\n var _this = this;\n return tslib.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.getAllRawElements(selector)];\n case 1:\n elements = _a.sent();\n return [2 /*return*/, elements.map(function (element) { return _this.createEnvironment(element); })];\n }\n });\n });\n };\n // Implemented as part of the `HarnessLoader` interface.\n HarnessEnvironment.prototype.getHarness = function (query) {\n return this.locatorFor(query)();\n };\n // Implemented as part of the `HarnessLoader` interface.\n HarnessEnvironment.prototype.getAllHarnesses = function (query) {\n return this.locatorForAll(query)();\n };\n // Implemented as part of the `HarnessLoader` interface.\n HarnessEnvironment.prototype.getChildLoader = function (selector) {\n return tslib.__awaiter(this, void 0, void 0, function () {\n var _a;\n return tslib.__generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _a = this.createEnvironment;\n return [4 /*yield*/, _assertResultFound(this.getAllRawElements(selector), [_getDescriptionForHarnessLoaderQuery(selector)])];\n case 1: return [2 /*return*/, _a.apply(this, [_b.sent()])];\n }\n });\n });\n };\n // Implemented as part of the `HarnessLoader` interface.\n HarnessEnvironment.prototype.getAllChildLoaders = function (selector) {\n return tslib.__awaiter(this, void 0, void 0, function () {\n var _this = this;\n return tslib.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.getAllRawElements(selector)];\n case 1: return [2 /*return*/, (_a.sent()).map(function (e) { return _this.createEnvironment(e); })];\n }\n });\n });\n };\n /** Creates a `ComponentHarness` for the given harness type with the given raw host element. */\n HarnessEnvironment.prototype.createComponentHarness = function (harnessType, element) {\n return new harnessType(this.createEnvironment(element));\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 HarnessEnvironment.prototype._getAllHarnessesAndTestElements = function (queries) {\n return tslib.__awaiter(this, void 0, void 0, function () {\n var _a, allQueries, harnessQueries, elementQueries, harnessTypes, rawElements, skipSelectorCheck, perElementMatches;\n var _b;\n var _this = this;\n return tslib.__generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n _a = _parseQueries(queries), allQueries = _a.allQueries, harnessQueries = _a.harnessQueries, elementQueries = _a.elementQueries, harnessTypes = _a.harnessTypes;\n return [4 /*yield*/, this.getAllRawElements(tslib.__spread(elementQueries, harnessQueries.map(function (predicate) { return predicate.getSelector(); })).join(','))];\n case 1:\n rawElements = _c.sent();\n skipSelectorCheck = (elementQueries.length === 0 && harnessTypes.size === 1) ||\n harnessQueries.length === 0;\n return [4 /*yield*/, Promise.all(rawElements.map(function (rawElement) { return tslib.__awaiter(_this, void 0, void 0, function () {\n var testElement, allResultsForElement;\n var _this = this;\n return tslib.__generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n testElement = this.createTestElement(rawElement);\n return [4 /*yield*/, Promise.all(\n // For each query, get `null` if it doesn't match, or a `TestElement` or\n // `ComponentHarness` as appropriate if it does match. This gives us everything that\n // matches the current raw element, but it may contain duplicate entries (e.g. multiple\n // `TestElement` or multiple `ComponentHarness` of the same type.\n allQueries.map(function (query) {\n return _this._getQueryResultForElement(query, rawElement, testElement, skipSelectorCheck);\n }))];\n case 1:\n allResultsForElement = _a.sent();\n return [2 /*return*/, _removeDuplicateQueryResults(allResultsForElement)];\n }\n });\n }); }))];\n case 2:\n perElementMatches = _c.sent();\n return [2 /*return*/, (_b = []).concat.apply(_b, tslib.__spread(perElementMatches))];\n }\n });\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 HarnessEnvironment.prototype._getQueryResultForElement = function (query, rawElement, testElement, skipSelectorCheck) {\n if (skipSelectorCheck === void 0) { skipSelectorCheck = false; }\n return tslib.__awaiter(this, void 0, void 0, function () {\n var _a, _b, harness;\n return tslib.__generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n if (!(typeof query === 'string')) return [3 /*break*/, 3];\n _a = skipSelectorCheck;\n if (_a) return [3 /*break*/, 2];\n return [4 /*yield*/, testElement.matchesSelector(query)];\n case 1:\n _a = (_c.sent());\n _c.label = 2;\n case 2: return [2 /*return*/, ((_a) ? testElement : null)];\n case 3:\n _b = skipSelectorCheck;\n if (_b) return [3 /*break*/, 5];\n return [4 /*yield*/, testElement.matchesSelector(query.getSelector())];\n case 4:\n _b = (_c.sent());\n _c.label = 5;\n case 5:\n if (!_b) return [3 /*break*/, 7];\n harness = this.createComponentHarness(query.harnessType, rawElement);\n return [4 /*yield*/, query.evaluate(harness)];\n case 6: return [2 /*return*/, (_c.sent()) ? harness : null];\n case 7: return [2 /*return*/, null];\n }\n });\n });\n };\n return HarnessEnvironment;\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 */\n function _parseQueries(queries) {\n var e_1, _a;\n var allQueries = [];\n var harnessQueries = [];\n var elementQueries = [];\n var harnessTypes = new Set();\n try {\n for (var queries_1 = tslib.__values(queries), queries_1_1 = queries_1.next(); !queries_1_1.done; queries_1_1 = queries_1.next()) {\n var query = queries_1_1.value;\n if (typeof query === 'string') {\n allQueries.push(query);\n elementQueries.push(query);\n }\n else {\n var 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 catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (queries_1_1 && !queries_1_1.done && (_a = queries_1.return)) _a.call(queries_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return { allQueries: allQueries, harnessQueries: harnessQueries, elementQueries: elementQueries, harnessTypes: harnessTypes };\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 */\n function _removeDuplicateQueryResults(results) {\n return tslib.__awaiter(this, void 0, void 0, function () {\n var testElementMatched, matchedHarnessTypes, dedupedMatches, results_1, results_1_1, result;\n var e_2, _a;\n return tslib.__generator(this, function (_b) {\n testElementMatched = false;\n matchedHarnessTypes = new Set();\n dedupedMatches = [];\n try {\n for (results_1 = tslib.__values(results), results_1_1 = results_1.next(); !results_1_1.done; results_1_1 = results_1.next()) {\n result = results_1_1.value;\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 }\n else if (!testElementMatched) {\n testElementMatched = true;\n dedupedMatches.push(result);\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (results_1_1 && !results_1_1.done && (_a = results_1.return)) _a.call(results_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n return [2 /*return*/, dedupedMatches];\n });\n });\n }\n /** Verifies that there is at least one result in an array. */\n function _assertResultFound(results, queryDescriptions) {\n return tslib.__awaiter(this, void 0, void 0, function () {\n var result;\n return tslib.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, results];\n case 1:\n result = (_a.sent())[0];\n if (result == undefined) {\n throw Error(\"Failed to find element matching one of the following queries:\\n\" +\n queryDescriptions.map(function (desc) { return \"(\" + desc + \")\"; }).join(',\\n'));\n }\n return [2 /*return*/, result];\n }\n });\n });\n }\n /** Gets a list of description strings from a list of queries. */\n function _getDescriptionForLocatorForQueries(queries) {\n return queries.map(function (query) { return typeof query === 'string' ?\n _getDescriptionForTestElementQuery(query) : _getDescriptionForComponentHarnessQuery(query); });\n }\n /** Gets a description string for a `ComponentHarness` query. */\n function _getDescriptionForComponentHarnessQuery(query) {\n var harnessPredicate = query instanceof HarnessPredicate ? query : new HarnessPredicate(query, {});\n var _a = harnessPredicate.harnessType, name = _a.name, hostSelector = _a.hostSelector;\n var description = name + \" with host element matching selector: \\\"\" + hostSelector + \"\\\"\";\n var constraints = harnessPredicate.getDescription();\n return description + (constraints ?\n \" satisfying the constraints: \" + harnessPredicate.getDescription() : '');\n }\n /** Gets a description string for a `TestElement` query. */\n function _getDescriptionForTestElementQuery(selector) {\n return \"TestElement for element matching selector: \\\"\" + selector + \"\\\"\";\n }\n /** Gets a description string for a `HarnessLoader` query. */\n function _getDescriptionForHarnessLoaderQuery(selector) {\n return \"HarnessLoader for element matching selector: \\\"\" + selector + \"\\\"\";\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 (function (TestKey) {\n TestKey[TestKey[\"BACKSPACE\"] = 0] = \"BACKSPACE\";\n TestKey[TestKey[\"TAB\"] = 1] = \"TAB\";\n TestKey[TestKey[\"ENTER\"] = 2] = \"ENTER\";\n TestKey[TestKey[\"SHIFT\"] = 3] = \"SHIFT\";\n TestKey[TestKey[\"CONTROL\"] = 4] = \"CONTROL\";\n TestKey[TestKey[\"ALT\"] = 5] = \"ALT\";\n TestKey[TestKey[\"ESCAPE\"] = 6] = \"ESCAPE\";\n TestKey[TestKey[\"PAGE_UP\"] = 7] = \"PAGE_UP\";\n TestKey[TestKey[\"PAGE_DOWN\"] = 8] = \"PAGE_DOWN\";\n TestKey[TestKey[\"END\"] = 9] = \"END\";\n TestKey[TestKey[\"HOME\"] = 10] = \"HOME\";\n TestKey[TestKey[\"LEFT_ARROW\"] = 11] = \"LEFT_ARROW\";\n TestKey[TestKey[\"UP_ARROW\"] = 12] = \"UP_ARROW\";\n TestKey[TestKey[\"RIGHT_ARROW\"] = 13] = \"RIGHT_ARROW\";\n TestKey[TestKey[\"DOWN_ARROW\"] = 14] = \"DOWN_ARROW\";\n TestKey[TestKey[\"INSERT\"] = 15] = \"INSERT\";\n TestKey[TestKey[\"DELETE\"] = 16] = \"DELETE\";\n TestKey[TestKey[\"F1\"] = 17] = \"F1\";\n TestKey[TestKey[\"F2\"] = 18] = \"F2\";\n TestKey[TestKey[\"F3\"] = 19] = \"F3\";\n TestKey[TestKey[\"F4\"] = 20] = \"F4\";\n TestKey[TestKey[\"F5\"] = 21] = \"F5\";\n TestKey[TestKey[\"F6\"] = 22] = \"F6\";\n TestKey[TestKey[\"F7\"] = 23] = \"F7\";\n TestKey[TestKey[\"F8\"] = 24] = \"F8\";\n TestKey[TestKey[\"F9\"] = 25] = \"F9\";\n TestKey[TestKey[\"F10\"] = 26] = \"F10\";\n TestKey[TestKey[\"F11\"] = 27] = \"F11\";\n TestKey[TestKey[\"F12\"] = 28] = \"F12\";\n TestKey[TestKey[\"META\"] = 29] = \"META\";\n })(exports.TestKey || (exports.TestKey = {}));\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 * @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 exports.ComponentHarness = ComponentHarness;\n exports.HarnessEnvironment = HarnessEnvironment;\n exports.HarnessPredicate = HarnessPredicate;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=cdk-testing.umd.js.map\n"]}
|
|
1
|
+
{"version":3,"sources":["src/cdk/cdk-testing.umd.js"],"names":["global","factory","exports","module","define","amd","self","ng","cdk","testing","this","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","apply","__generator","body","f","y","t","g","_","label","sent","trys","ops","verb","throw","return","Symbol","iterator","n","v","op","TypeError","call","pop","length","push","__values","o","m","i","__read","r","ar","error","__spread","arguments","concat","TestKey","ComponentHarness","locatorFactory","prototype","host","_a","rootElement","documentRootLocatorFactory","locatorFor","queries","_i","locatorForOptional","locatorForAll","forceStabilize","waitForTasksOutsideAngular","HarnessPredicate","harnessType","options","_predicates","_descriptions","_addBaseOptions","stringMatches","pattern","test","add","description","predicate","addOption","name","option","undefined","_valueAsString","JSON","stringify","RegExp","toString","replace","item","filter","harnesses","results","_this","all","map","h","evaluate","harness","p","reduce","combined","current","getDescription","join","getSelector","_ancestor","split","part","trim","hostSelector","ancestor","selector","matchesSelector","HarnessEnvironment","rawRootElement","createTestElement","createEnvironment","getDocumentRoot","_assertResultFound","_getAllHarnessesAndTestElements","_getDescriptionForLocatorForQueries","harnessLoaderFor","_b","getAllRawElements","_getDescriptionForHarnessLoaderQuery","harnessLoaderForOptional","elements","harnessLoaderForAll","element","getHarness","query","getAllHarnesses","getChildLoader","getAllChildLoaders","createComponentHarness","allQueries","harnessQueries","elementQueries","harnessTypes","rawElements","skipSelectorCheck","perElementMatches","_c","_parseQueries","e_1","Set","queries_1","queries_1_1","e_1_1","size","rawElement","testElement","_getQueryResultForElement","_removeDuplicateQueryResults","testElementMatched","matchedHarnessTypes","dedupedMatches","results_1","results_1_1","e_2","has","constructor","e_2_1","queryDescriptions","Error","desc","_getDescriptionForTestElementQuery","_getDescriptionForComponentHarnessQuery","harnessPredicate","Object","defineProperty"],"mappings":"CAAC,SAAUA,EAAQC,GACI,iBAAZC,SAA0C,oBAAXC,OAAyBF,EAAQC,SACrD,mBAAXE,QAAyBA,OAAOC,IAAMD,OAAO,uBAAwB,CAAC,WAAYH,GAC/DA,IAAzBD,EAASA,GAAUM,MAAsBC,GAAKP,EAAOO,IAAM,GAAIP,EAAOO,GAAGC,IAAMR,EAAOO,GAAGC,KAAO,GAAIR,EAAOO,GAAGC,IAAIC,QAAU,KAHjI,CAIEC,MAAM,SAAWR,GAAW;;;;;;;;;;;;;;oFAqE1B,SAASS,EAAUC,EAASC,EAAYC,EAAGC,GACvC,OAAO,IAAKD,IAAMA,EAAIE,WAAU,SAAUC,EAASC,GAC/C,SAASC,EAAUC,GAAS,IAAMC,EAAKN,EAAUO,KAAKF,IAAW,MAAOG,GAAKL,EAAOK,IACpF,SAASC,EAASJ,GAAS,IAAMC,EAAKN,EAAiB,MAAEK,IAAW,MAAOG,GAAKL,EAAOK,IACvF,SAASF,EAAKI,GAAUA,EAAOC,KAAOT,EAAQQ,EAAOL,OAAS,IAAIN,GAAE,SAAUG,GAAWA,EAAQQ,EAAOL,UAAWO,KAAKR,EAAWK,GACnIH,GAAMN,EAAYA,EAAUa,MAAMhB,EAASC,GAAc,KAAKS,WAItE,SAASO,EAAYjB,EAASkB,GAC1B,IAAsGC,EAAGC,EAAGC,EAAGC,EAA3GC,EAAI,CAAEC,MAAO,EAAGC,KAAM,WAAa,GAAW,EAAPJ,EAAE,GAAQ,MAAMA,EAAE,GAAI,OAAOA,EAAE,IAAOK,KAAM,GAAIC,IAAK,IAChG,OAAOL,EAAI,CAAEZ,KAAMkB,EAAK,GAAIC,MAASD,EAAK,GAAIE,OAAUF,EAAK,IAAwB,mBAAXG,SAA0BT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) :\n typeof define === 'function' && define.amd ? define('@angular/cdk/testing', ['exports'], factory) :\n (global = global || self, factory((global.ng = global.ng || {}, global.ng.cdk = global.ng.cdk || {}, global.ng.cdk.testing = {})));\n}(this, (function (exports) { 'use strict';\n\n /*! *****************************************************************************\r\n Copyright (c) Microsoft Corporation. All rights reserved.\r\n Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\n this file except in compliance with the License. You may obtain a copy of the\r\n License at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\n WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\n MERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\n See the Apache Version 2.0 License for specific language governing permissions\r\n and limitations under the License.\r\n ***************************************************************************** */\r\n /* global Reflect, Promise */\r\n\r\n var extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n };\r\n\r\n function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n }\r\n\r\n var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n };\r\n\r\n function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n }\r\n\r\n function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n }\r\n\r\n function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n }\r\n\r\n function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n }\r\n\r\n function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n }\r\n\r\n function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n }\r\n\r\n function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n }\r\n\r\n function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n }\r\n\r\n function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n }\r\n\r\n function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n }\r\n\r\n function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n };\r\n\r\n function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n }\r\n\r\n function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n }\r\n\r\n function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n }\r\n\r\n function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n }\r\n\r\n function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n };\r\n\r\n function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n }\r\n\r\n function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\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 /**\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 */\n var ComponentHarness = /** @class */ (function () {\n function ComponentHarness(locatorFactory) {\n this.locatorFactory = locatorFactory;\n }\n /** Gets a `Promise` for the `TestElement` representing the host element of the component. */\n ComponentHarness.prototype.host = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.locatorFactory.rootElement];\n });\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 ComponentHarness.prototype.documentRootLocatorFactory = function () {\n return this.locatorFactory.documentRootLocatorFactory();\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 ComponentHarness.prototype.locatorFor = function () {\n var _a;\n var queries = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n queries[_i] = arguments[_i];\n }\n return (_a = this.locatorFactory).locatorFor.apply(_a, __spread(queries));\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 ComponentHarness.prototype.locatorForOptional = function () {\n var _a;\n var queries = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n queries[_i] = arguments[_i];\n }\n return (_a = this.locatorFactory).locatorForOptional.apply(_a, __spread(queries));\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 ComponentHarness.prototype.locatorForAll = function () {\n var _a;\n var queries = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n queries[_i] = arguments[_i];\n }\n return (_a = this.locatorFactory).locatorForAll.apply(_a, __spread(queries));\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 ComponentHarness.prototype.forceStabilize = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.locatorFactory.forceStabilize()];\n });\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 ComponentHarness.prototype.waitForTasksOutsideAngular = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.locatorFactory.waitForTasksOutsideAngular()];\n });\n });\n };\n return ComponentHarness;\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 */\n var HarnessPredicate = /** @class */ (function () {\n function HarnessPredicate(harnessType, options) {\n this.harnessType = harnessType;\n this._predicates = [];\n this._descriptions = [];\n this._addBaseOptions(options);\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 HarnessPredicate.stringMatches = function (value, pattern) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, value];\n case 1:\n value = _a.sent();\n if (pattern === null) {\n return [2 /*return*/, value === null];\n }\n else if (value === null) {\n return [2 /*return*/, false];\n }\n return [2 /*return*/, typeof pattern === 'string' ? value === pattern : pattern.test(value)];\n }\n });\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 HarnessPredicate.prototype.add = function (description, predicate) {\n this._descriptions.push(description);\n this._predicates.push(predicate);\n return this;\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 HarnessPredicate.prototype.addOption = function (name, option, predicate) {\n if (option !== undefined) {\n this.add(name + \" = \" + _valueAsString(option), function (item) { return predicate(item, option); });\n }\n return this;\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 HarnessPredicate.prototype.filter = function (harnesses) {\n return __awaiter(this, void 0, void 0, function () {\n var results;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, Promise.all(harnesses.map(function (h) { return _this.evaluate(h); }))];\n case 1:\n results = _a.sent();\n return [2 /*return*/, harnesses.filter(function (_, i) { return results[i]; })];\n }\n });\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 HarnessPredicate.prototype.evaluate = function (harness) {\n return __awaiter(this, void 0, void 0, function () {\n var results;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, Promise.all(this._predicates.map(function (p) { return p(harness); }))];\n case 1:\n results = _a.sent();\n return [2 /*return*/, results.reduce(function (combined, current) { return combined && current; }, true)];\n }\n });\n });\n };\n /** Gets a description of this predicate for use in error messages. */\n HarnessPredicate.prototype.getDescription = function () {\n return this._descriptions.join(', ');\n };\n /** Gets the selector used to find candidate elements. */\n HarnessPredicate.prototype.getSelector = function () {\n var _this = this;\n return this._ancestor.split(',')\n .map(function (part) { return (part.trim() + \" \" + _this.harnessType.hostSelector).trim(); })\n .join(',');\n };\n /** Adds base options common to all harness types. */\n HarnessPredicate.prototype._addBaseOptions = function (options) {\n var _this = this;\n this._ancestor = options.ancestor || '';\n if (this._ancestor) {\n this._descriptions.push(\"has ancestor matching selector \\\"\" + this._ancestor + \"\\\"\");\n }\n var selector = options.selector;\n if (selector !== undefined) {\n this.add(\"host matches selector \\\"\" + selector + \"\\\"\", function (item) { return __awaiter(_this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, item.host()];\n case 1: return [2 /*return*/, (_a.sent()).matchesSelector(selector)];\n }\n });\n }); });\n }\n };\n return HarnessPredicate;\n }());\n /** Represent a value as a string for the purpose of logging. */\n function _valueAsString(value) {\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, function (_, v) {\n if (v instanceof RegExp) {\n return \"/\" + v.toString() + \"/\";\n }\n return typeof v === 'string' ? v.replace('/\\//g', '\\\\/') : v;\n }).replace(/\"\\/\\//g, '\\\\/').replace(/\\/\\/\"/g, '\\\\/').replace(/\\\\\\//g, '/');\n }\n catch (_a) {\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 * @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 * 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 */\n var HarnessEnvironment = /** @class */ (function () {\n function HarnessEnvironment(rawRootElement) {\n this.rawRootElement = rawRootElement;\n this.rootElement = this.createTestElement(rawRootElement);\n }\n // Implemented as part of the `LocatorFactory` interface.\n HarnessEnvironment.prototype.documentRootLocatorFactory = function () {\n return this.createEnvironment(this.getDocumentRoot());\n };\n // Implemented as part of the `LocatorFactory` interface.\n HarnessEnvironment.prototype.locatorFor = function () {\n var _this = this;\n var queries = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n queries[_i] = arguments[_i];\n }\n return function () { return _assertResultFound(_this._getAllHarnessesAndTestElements(queries), _getDescriptionForLocatorForQueries(queries)); };\n };\n // Implemented as part of the `LocatorFactory` interface.\n HarnessEnvironment.prototype.locatorForOptional = function () {\n var _this = this;\n var queries = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n queries[_i] = arguments[_i];\n }\n return function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this._getAllHarnessesAndTestElements(queries)];\n case 1: return [2 /*return*/, (_a.sent())[0] || null];\n }\n }); }); };\n };\n // Implemented as part of the `LocatorFactory` interface.\n HarnessEnvironment.prototype.locatorForAll = function () {\n var _this = this;\n var queries = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n queries[_i] = arguments[_i];\n }\n return function () { return _this._getAllHarnessesAndTestElements(queries); };\n };\n // Implemented as part of the `LocatorFactory` interface.\n HarnessEnvironment.prototype.harnessLoaderFor = function (selector) {\n return __awaiter(this, void 0, void 0, function () {\n var _a;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _a = this.createEnvironment;\n return [4 /*yield*/, _assertResultFound(this.getAllRawElements(selector), [_getDescriptionForHarnessLoaderQuery(selector)])];\n case 1: return [2 /*return*/, _a.apply(this, [_b.sent()])];\n }\n });\n });\n };\n // Implemented as part of the `LocatorFactory` interface.\n HarnessEnvironment.prototype.harnessLoaderForOptional = function (selector) {\n return __awaiter(this, void 0, void 0, function () {\n var elements;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.getAllRawElements(selector)];\n case 1:\n elements = _a.sent();\n return [2 /*return*/, elements[0] ? this.createEnvironment(elements[0]) : null];\n }\n });\n });\n };\n // Implemented as part of the `LocatorFactory` interface.\n HarnessEnvironment.prototype.harnessLoaderForAll = function (selector) {\n return __awaiter(this, void 0, void 0, function () {\n var elements;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.getAllRawElements(selector)];\n case 1:\n elements = _a.sent();\n return [2 /*return*/, elements.map(function (element) { return _this.createEnvironment(element); })];\n }\n });\n });\n };\n // Implemented as part of the `HarnessLoader` interface.\n HarnessEnvironment.prototype.getHarness = function (query) {\n return this.locatorFor(query)();\n };\n // Implemented as part of the `HarnessLoader` interface.\n HarnessEnvironment.prototype.getAllHarnesses = function (query) {\n return this.locatorForAll(query)();\n };\n // Implemented as part of the `HarnessLoader` interface.\n HarnessEnvironment.prototype.getChildLoader = function (selector) {\n return __awaiter(this, void 0, void 0, function () {\n var _a;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _a = this.createEnvironment;\n return [4 /*yield*/, _assertResultFound(this.getAllRawElements(selector), [_getDescriptionForHarnessLoaderQuery(selector)])];\n case 1: return [2 /*return*/, _a.apply(this, [_b.sent()])];\n }\n });\n });\n };\n // Implemented as part of the `HarnessLoader` interface.\n HarnessEnvironment.prototype.getAllChildLoaders = function (selector) {\n return __awaiter(this, void 0, void 0, function () {\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.getAllRawElements(selector)];\n case 1: return [2 /*return*/, (_a.sent()).map(function (e) { return _this.createEnvironment(e); })];\n }\n });\n });\n };\n /** Creates a `ComponentHarness` for the given harness type with the given raw host element. */\n HarnessEnvironment.prototype.createComponentHarness = function (harnessType, element) {\n return new harnessType(this.createEnvironment(element));\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 HarnessEnvironment.prototype._getAllHarnessesAndTestElements = function (queries) {\n return __awaiter(this, void 0, void 0, function () {\n var _a, allQueries, harnessQueries, elementQueries, harnessTypes, rawElements, skipSelectorCheck, perElementMatches;\n var _b;\n var _this = this;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n _a = _parseQueries(queries), allQueries = _a.allQueries, harnessQueries = _a.harnessQueries, elementQueries = _a.elementQueries, harnessTypes = _a.harnessTypes;\n return [4 /*yield*/, this.getAllRawElements(__spread(elementQueries, harnessQueries.map(function (predicate) { return predicate.getSelector(); })).join(','))];\n case 1:\n rawElements = _c.sent();\n skipSelectorCheck = (elementQueries.length === 0 && harnessTypes.size === 1) ||\n harnessQueries.length === 0;\n return [4 /*yield*/, Promise.all(rawElements.map(function (rawElement) { return __awaiter(_this, void 0, void 0, function () {\n var testElement, allResultsForElement;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n testElement = this.createTestElement(rawElement);\n return [4 /*yield*/, Promise.all(\n // For each query, get `null` if it doesn't match, or a `TestElement` or\n // `ComponentHarness` as appropriate if it does match. This gives us everything that\n // matches the current raw element, but it may contain duplicate entries (e.g. multiple\n // `TestElement` or multiple `ComponentHarness` of the same type.\n allQueries.map(function (query) {\n return _this._getQueryResultForElement(query, rawElement, testElement, skipSelectorCheck);\n }))];\n case 1:\n allResultsForElement = _a.sent();\n return [2 /*return*/, _removeDuplicateQueryResults(allResultsForElement)];\n }\n });\n }); }))];\n case 2:\n perElementMatches = _c.sent();\n return [2 /*return*/, (_b = []).concat.apply(_b, __spread(perElementMatches))];\n }\n });\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 HarnessEnvironment.prototype._getQueryResultForElement = function (query, rawElement, testElement, skipSelectorCheck) {\n if (skipSelectorCheck === void 0) { skipSelectorCheck = false; }\n return __awaiter(this, void 0, void 0, function () {\n var _a, _b, harness;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n if (!(typeof query === 'string')) return [3 /*break*/, 3];\n _a = skipSelectorCheck;\n if (_a) return [3 /*break*/, 2];\n return [4 /*yield*/, testElement.matchesSelector(query)];\n case 1:\n _a = (_c.sent());\n _c.label = 2;\n case 2: return [2 /*return*/, ((_a) ? testElement : null)];\n case 3:\n _b = skipSelectorCheck;\n if (_b) return [3 /*break*/, 5];\n return [4 /*yield*/, testElement.matchesSelector(query.getSelector())];\n case 4:\n _b = (_c.sent());\n _c.label = 5;\n case 5:\n if (!_b) return [3 /*break*/, 7];\n harness = this.createComponentHarness(query.harnessType, rawElement);\n return [4 /*yield*/, query.evaluate(harness)];\n case 6: return [2 /*return*/, (_c.sent()) ? harness : null];\n case 7: return [2 /*return*/, null];\n }\n });\n });\n };\n return HarnessEnvironment;\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 */\n function _parseQueries(queries) {\n var e_1, _a;\n var allQueries = [];\n var harnessQueries = [];\n var elementQueries = [];\n var harnessTypes = new Set();\n try {\n for (var queries_1 = __values(queries), queries_1_1 = queries_1.next(); !queries_1_1.done; queries_1_1 = queries_1.next()) {\n var query = queries_1_1.value;\n if (typeof query === 'string') {\n allQueries.push(query);\n elementQueries.push(query);\n }\n else {\n var 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 catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (queries_1_1 && !queries_1_1.done && (_a = queries_1.return)) _a.call(queries_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return { allQueries: allQueries, harnessQueries: harnessQueries, elementQueries: elementQueries, harnessTypes: harnessTypes };\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 */\n function _removeDuplicateQueryResults(results) {\n return __awaiter(this, void 0, void 0, function () {\n var testElementMatched, matchedHarnessTypes, dedupedMatches, results_1, results_1_1, result;\n var e_2, _a;\n return __generator(this, function (_b) {\n testElementMatched = false;\n matchedHarnessTypes = new Set();\n dedupedMatches = [];\n try {\n for (results_1 = __values(results), results_1_1 = results_1.next(); !results_1_1.done; results_1_1 = results_1.next()) {\n result = results_1_1.value;\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 }\n else if (!testElementMatched) {\n testElementMatched = true;\n dedupedMatches.push(result);\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (results_1_1 && !results_1_1.done && (_a = results_1.return)) _a.call(results_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n return [2 /*return*/, dedupedMatches];\n });\n });\n }\n /** Verifies that there is at least one result in an array. */\n function _assertResultFound(results, queryDescriptions) {\n return __awaiter(this, void 0, void 0, function () {\n var result;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, results];\n case 1:\n result = (_a.sent())[0];\n if (result == undefined) {\n throw Error(\"Failed to find element matching one of the following queries:\\n\" +\n queryDescriptions.map(function (desc) { return \"(\" + desc + \")\"; }).join(',\\n'));\n }\n return [2 /*return*/, result];\n }\n });\n });\n }\n /** Gets a list of description strings from a list of queries. */\n function _getDescriptionForLocatorForQueries(queries) {\n return queries.map(function (query) { return typeof query === 'string' ?\n _getDescriptionForTestElementQuery(query) : _getDescriptionForComponentHarnessQuery(query); });\n }\n /** Gets a description string for a `ComponentHarness` query. */\n function _getDescriptionForComponentHarnessQuery(query) {\n var harnessPredicate = query instanceof HarnessPredicate ? query : new HarnessPredicate(query, {});\n var _a = harnessPredicate.harnessType, name = _a.name, hostSelector = _a.hostSelector;\n var description = name + \" with host element matching selector: \\\"\" + hostSelector + \"\\\"\";\n var constraints = harnessPredicate.getDescription();\n return description + (constraints ?\n \" satisfying the constraints: \" + harnessPredicate.getDescription() : '');\n }\n /** Gets a description string for a `TestElement` query. */\n function _getDescriptionForTestElementQuery(selector) {\n return \"TestElement for element matching selector: \\\"\" + selector + \"\\\"\";\n }\n /** Gets a description string for a `HarnessLoader` query. */\n function _getDescriptionForHarnessLoaderQuery(selector) {\n return \"HarnessLoader for element matching selector: \\\"\" + selector + \"\\\"\";\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 (function (TestKey) {\n TestKey[TestKey[\"BACKSPACE\"] = 0] = \"BACKSPACE\";\n TestKey[TestKey[\"TAB\"] = 1] = \"TAB\";\n TestKey[TestKey[\"ENTER\"] = 2] = \"ENTER\";\n TestKey[TestKey[\"SHIFT\"] = 3] = \"SHIFT\";\n TestKey[TestKey[\"CONTROL\"] = 4] = \"CONTROL\";\n TestKey[TestKey[\"ALT\"] = 5] = \"ALT\";\n TestKey[TestKey[\"ESCAPE\"] = 6] = \"ESCAPE\";\n TestKey[TestKey[\"PAGE_UP\"] = 7] = \"PAGE_UP\";\n TestKey[TestKey[\"PAGE_DOWN\"] = 8] = \"PAGE_DOWN\";\n TestKey[TestKey[\"END\"] = 9] = \"END\";\n TestKey[TestKey[\"HOME\"] = 10] = \"HOME\";\n TestKey[TestKey[\"LEFT_ARROW\"] = 11] = \"LEFT_ARROW\";\n TestKey[TestKey[\"UP_ARROW\"] = 12] = \"UP_ARROW\";\n TestKey[TestKey[\"RIGHT_ARROW\"] = 13] = \"RIGHT_ARROW\";\n TestKey[TestKey[\"DOWN_ARROW\"] = 14] = \"DOWN_ARROW\";\n TestKey[TestKey[\"INSERT\"] = 15] = \"INSERT\";\n TestKey[TestKey[\"DELETE\"] = 16] = \"DELETE\";\n TestKey[TestKey[\"F1\"] = 17] = \"F1\";\n TestKey[TestKey[\"F2\"] = 18] = \"F2\";\n TestKey[TestKey[\"F3\"] = 19] = \"F3\";\n TestKey[TestKey[\"F4\"] = 20] = \"F4\";\n TestKey[TestKey[\"F5\"] = 21] = \"F5\";\n TestKey[TestKey[\"F6\"] = 22] = \"F6\";\n TestKey[TestKey[\"F7\"] = 23] = \"F7\";\n TestKey[TestKey[\"F8\"] = 24] = \"F8\";\n TestKey[TestKey[\"F9\"] = 25] = \"F9\";\n TestKey[TestKey[\"F10\"] = 26] = \"F10\";\n TestKey[TestKey[\"F11\"] = 27] = \"F11\";\n TestKey[TestKey[\"F12\"] = 28] = \"F12\";\n TestKey[TestKey[\"META\"] = 29] = \"META\";\n })(exports.TestKey || (exports.TestKey = {}));\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 * @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 exports.ComponentHarness = ComponentHarness;\n exports.HarnessEnvironment = HarnessEnvironment;\n exports.HarnessPredicate = HarnessPredicate;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=cdk-testing.umd.js.map\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/cdk/platform'), require('@angular/core'), require('@angular/cdk/coercion'), require('rxjs'), require('rxjs/operators')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@angular/cdk/text-field', ['exports', '@angular/cdk/platform', '@angular/core', '@angular/cdk/coercion', 'rxjs', 'rxjs/operators'], factory) :
|
|
4
|
-
(global = global || self, factory((global.ng = global.ng || {}, global.ng.cdk = global.ng.cdk || {}, global.ng.cdk.textField = {}), global.ng.cdk.platform, global.ng.core, global.ng.cdk.coercion, global.rxjs, global.rxjs.operators));
|
|
5
|
-
}(this, (function (exports, i1, i0, coercion, rxjs, operators) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/cdk/platform'), require('@angular/core'), require('@angular/cdk/coercion'), require('rxjs'), require('rxjs/operators'), require('@angular/common')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@angular/cdk/text-field', ['exports', '@angular/cdk/platform', '@angular/core', '@angular/cdk/coercion', 'rxjs', 'rxjs/operators', '@angular/common'], factory) :
|
|
4
|
+
(global = global || self, factory((global.ng = global.ng || {}, global.ng.cdk = global.ng.cdk || {}, global.ng.cdk.textField = {}), global.ng.cdk.platform, global.ng.core, global.ng.cdk.coercion, global.rxjs, global.rxjs.operators, global.ng.common));
|
|
5
|
+
}(this, (function (exports, i1, i0, coercion, rxjs, operators, common) { 'use strict';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* @license
|
|
@@ -131,7 +131,9 @@
|
|
|
131
131
|
*/
|
|
132
132
|
/** Directive to automatically resize a textarea to fit its content. */
|
|
133
133
|
var CdkTextareaAutosize = /** @class */ (function () {
|
|
134
|
-
function CdkTextareaAutosize(_elementRef, _platform, _ngZone
|
|
134
|
+
function CdkTextareaAutosize(_elementRef, _platform, _ngZone,
|
|
135
|
+
/** @breaking-change 11.0.0 make document required */
|
|
136
|
+
document) {
|
|
135
137
|
this._elementRef = _elementRef;
|
|
136
138
|
this._platform = _platform;
|
|
137
139
|
this._ngZone = _ngZone;
|
|
@@ -143,6 +145,7 @@
|
|
|
143
145
|
* does not have the same problem because it does not affect the textarea's scrollHeight.
|
|
144
146
|
*/
|
|
145
147
|
this._previousMinRows = -1;
|
|
148
|
+
this._document = document;
|
|
146
149
|
this._textareaElement = this._elementRef.nativeElement;
|
|
147
150
|
}
|
|
148
151
|
Object.defineProperty(CdkTextareaAutosize.prototype, "minRows", {
|
|
@@ -202,6 +205,7 @@
|
|
|
202
205
|
this._initialHeight = this._textareaElement.style.height;
|
|
203
206
|
this.resizeToFitContent();
|
|
204
207
|
this._ngZone.runOutsideAngular(function () {
|
|
208
|
+
var window = _this._getWindow();
|
|
205
209
|
rxjs.fromEvent(window, 'resize')
|
|
206
210
|
.pipe(operators.auditTime(16), operators.takeUntil(_this._destroyed))
|
|
207
211
|
.subscribe(function () { return _this.resizeToFitContent(true); });
|
|
@@ -321,6 +325,15 @@
|
|
|
321
325
|
CdkTextareaAutosize.prototype._noopInputHandler = function () {
|
|
322
326
|
// no-op handler that ensures we're running change detection on input events.
|
|
323
327
|
};
|
|
328
|
+
/** Access injected document if available or fallback to global document reference */
|
|
329
|
+
CdkTextareaAutosize.prototype._getDocument = function () {
|
|
330
|
+
return this._document || document;
|
|
331
|
+
};
|
|
332
|
+
/** Use defaultView of injected document if available or fallback to global window reference */
|
|
333
|
+
CdkTextareaAutosize.prototype._getWindow = function () {
|
|
334
|
+
var doc = this._getDocument();
|
|
335
|
+
return doc.defaultView || window;
|
|
336
|
+
};
|
|
324
337
|
/**
|
|
325
338
|
* Scrolls a textarea to the caret position. On Firefox resizing the textarea will
|
|
326
339
|
* prevent it from scrolling to the caret position. We need to re-set the selection
|
|
@@ -328,6 +341,7 @@
|
|
|
328
341
|
*/
|
|
329
342
|
CdkTextareaAutosize.prototype._scrollToCaretPosition = function (textarea) {
|
|
330
343
|
var selectionStart = textarea.selectionStart, selectionEnd = textarea.selectionEnd;
|
|
344
|
+
var document = this._getDocument();
|
|
331
345
|
// IE will throw an "Unspecified error" if we try to set the selection range after the
|
|
332
346
|
// element has been removed from the DOM. Assert that the directive hasn't been destroyed
|
|
333
347
|
// between the time we requested the animation frame and when it was executed.
|
|
@@ -354,7 +368,8 @@
|
|
|
354
368
|
CdkTextareaAutosize.ctorParameters = function () { return [
|
|
355
369
|
{ type: i0.ElementRef },
|
|
356
370
|
{ type: i1.Platform },
|
|
357
|
-
{ type: i0.NgZone }
|
|
371
|
+
{ type: i0.NgZone },
|
|
372
|
+
{ type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [common.DOCUMENT,] }] }
|
|
358
373
|
]; };
|
|
359
374
|
CdkTextareaAutosize.propDecorators = {
|
|
360
375
|
minRows: [{ type: i0.Input, args: ['cdkAutosizeMinRows',] }],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdk-text-field.umd.js","sources":["../../../../../../src/cdk/text-field/autofill.ts","../../../../../../src/cdk/text-field/autosize.ts","../../../../../../src/cdk/text-field/text-field-module.ts","../../../../../../src/cdk/text-field/public-api.ts","../../../../../../src/cdk/text-field/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 {Platform, normalizePassiveListenerOptions} from '@angular/cdk/platform';\nimport {\n Directive,\n ElementRef,\n EventEmitter,\n Injectable,\n NgZone,\n OnDestroy,\n OnInit,\n Output,\n} from '@angular/core';\nimport {coerceElement} from '@angular/cdk/coercion';\nimport {EMPTY, Observable, Subject} from 'rxjs';\n\n\n/** An event that is emitted when the autofill state of an input changes. */\nexport type AutofillEvent = {\n /** The element whose autofill state changes. */\n target: Element;\n /** Whether the element is currently autofilled. */\n isAutofilled: boolean;\n};\n\n\n/** Used to track info about currently monitored elements. */\ntype MonitoredElementInfo = {\n subject: Subject<AutofillEvent>;\n unlisten: () => void;\n};\n\n\n/** Options to pass to the animationstart listener. */\nconst listenerOptions = normalizePassiveListenerOptions({passive: true});\n\n\n/**\n * An injectable service that can be used to monitor the autofill state of an input.\n * Based on the following blog post:\n * https://medium.com/@brunn/detecting-autofilled-fields-in-javascript-aed598d25da7\n */\n@Injectable({providedIn: 'root'})\nexport class AutofillMonitor implements OnDestroy {\n private _monitoredElements = new Map<Element, MonitoredElementInfo>();\n\n constructor(private _platform: Platform, private _ngZone: NgZone) {}\n\n /**\n * Monitor for changes in the autofill state of the given input element.\n * @param element The element to monitor.\n * @return A stream of autofill state changes.\n */\n monitor(element: Element): Observable<AutofillEvent>;\n\n /**\n * Monitor for changes in the autofill state of the given input element.\n * @param element The element to monitor.\n * @return A stream of autofill state changes.\n */\n monitor(element: ElementRef<Element>): Observable<AutofillEvent>;\n\n monitor(elementOrRef: Element | ElementRef<Element>): Observable<AutofillEvent> {\n if (!this._platform.isBrowser) {\n return EMPTY;\n }\n\n const element = coerceElement(elementOrRef);\n const info = this._monitoredElements.get(element);\n\n if (info) {\n return info.subject.asObservable();\n }\n\n const result = new Subject<AutofillEvent>();\n const cssClass = 'cdk-text-field-autofilled';\n const listener = ((event: AnimationEvent) => {\n // Animation events fire on initial element render, we check for the presence of the autofill\n // CSS class to make sure this is a real change in state, not just the initial render before\n // we fire off events.\n if (event.animationName === 'cdk-text-field-autofill-start' &&\n !element.classList.contains(cssClass)) {\n element.classList.add(cssClass);\n this._ngZone.run(() => result.next({target: event.target as Element, isAutofilled: true}));\n } else if (event.animationName === 'cdk-text-field-autofill-end' &&\n element.classList.contains(cssClass)) {\n element.classList.remove(cssClass);\n this._ngZone.run(() => result.next({target: event.target as Element, isAutofilled: false}));\n }\n }) as EventListenerOrEventListenerObject;\n\n this._ngZone.runOutsideAngular(() => {\n element.addEventListener('animationstart', listener, listenerOptions);\n element.classList.add('cdk-text-field-autofill-monitored');\n });\n\n this._monitoredElements.set(element, {\n subject: result,\n unlisten: () => {\n element.removeEventListener('animationstart', listener, listenerOptions);\n }\n });\n\n return result.asObservable();\n }\n\n /**\n * Stop monitoring the autofill state of the given input element.\n * @param element The element to stop monitoring.\n */\n stopMonitoring(element: Element): void;\n\n /**\n * Stop monitoring the autofill state of the given input element.\n * @param element The element to stop monitoring.\n */\n stopMonitoring(element: ElementRef<Element>): void;\n\n stopMonitoring(elementOrRef: Element | ElementRef<Element>): void {\n const element = coerceElement(elementOrRef);\n const info = this._monitoredElements.get(element);\n\n if (info) {\n info.unlisten();\n info.subject.complete();\n element.classList.remove('cdk-text-field-autofill-monitored');\n element.classList.remove('cdk-text-field-autofilled');\n this._monitoredElements.delete(element);\n }\n }\n\n ngOnDestroy() {\n this._monitoredElements.forEach((_info, element) => this.stopMonitoring(element));\n }\n}\n\n\n/** A directive that can be used to monitor the autofill state of an input. */\n@Directive({\n selector: '[cdkAutofill]',\n})\nexport class CdkAutofill implements OnDestroy, OnInit {\n /** Emits when the autofill state of the element changes. */\n @Output() cdkAutofill: EventEmitter<AutofillEvent> = new EventEmitter<AutofillEvent>();\n\n constructor(private _elementRef: ElementRef<HTMLElement>,\n private _autofillMonitor: AutofillMonitor) {}\n\n ngOnInit() {\n this._autofillMonitor\n .monitor(this._elementRef)\n .subscribe(event => this.cdkAutofill.emit(event));\n }\n\n ngOnDestroy() {\n this._autofillMonitor.stopMonitoring(this._elementRef);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n BooleanInput,\n coerceBooleanProperty,\n coerceNumberProperty,\n NumberInput\n} from '@angular/cdk/coercion';\nimport {\n Directive,\n ElementRef,\n Input,\n AfterViewInit,\n DoCheck,\n OnDestroy,\n NgZone,\n HostListener,\n} from '@angular/core';\nimport {Platform} from '@angular/cdk/platform';\nimport {auditTime, takeUntil} from 'rxjs/operators';\nimport {fromEvent, Subject} from 'rxjs';\n\n\n/** Directive to automatically resize a textarea to fit its content. */\n@Directive({\n selector: 'textarea[cdkTextareaAutosize]',\n exportAs: 'cdkTextareaAutosize',\n host: {\n 'class': 'cdk-textarea-autosize',\n // Textarea elements that have the directive applied should have a single row by default.\n // Browsers normally show two rows by default and therefore this limits the minRows binding.\n 'rows': '1',\n },\n})\nexport class CdkTextareaAutosize implements AfterViewInit, DoCheck, OnDestroy {\n /** Keep track of the previous textarea value to avoid resizing when the value hasn't changed. */\n private _previousValue?: string;\n private _initialHeight: string | undefined;\n private readonly _destroyed = new Subject<void>();\n\n private _minRows: number;\n private _maxRows: number;\n private _enabled: boolean = true;\n\n /**\n * Value of minRows as of last resize. If the minRows has decreased, the\n * height of the textarea needs to be recomputed to reflect the new minimum. The maxHeight\n * does not have the same problem because it does not affect the textarea's scrollHeight.\n */\n private _previousMinRows: number = -1;\n\n private _textareaElement: HTMLTextAreaElement;\n\n /** Minimum amount of rows in the textarea. */\n @Input('cdkAutosizeMinRows')\n get minRows(): number { return this._minRows; }\n set minRows(value: number) {\n this._minRows = coerceNumberProperty(value);\n this._setMinHeight();\n }\n\n /** Maximum amount of rows in the textarea. */\n @Input('cdkAutosizeMaxRows')\n get maxRows(): number { return this._maxRows; }\n set maxRows(value: number) {\n this._maxRows = coerceNumberProperty(value);\n this._setMaxHeight();\n }\n\n /** Whether autosizing is enabled or not */\n @Input('cdkTextareaAutosize')\n get enabled(): boolean { return this._enabled; }\n set enabled(value: boolean) {\n value = coerceBooleanProperty(value);\n\n // Only act if the actual value changed. This specifically helps to not run\n // resizeToFitContent too early (i.e. before ngAfterViewInit)\n if (this._enabled !== value) {\n (this._enabled = value) ? this.resizeToFitContent(true) : this.reset();\n }\n }\n\n /** Cached height of a textarea with a single row. */\n private _cachedLineHeight: number;\n\n constructor(\n private _elementRef: ElementRef<HTMLElement>,\n private _platform: Platform,\n private _ngZone: NgZone) {\n this._textareaElement = this._elementRef.nativeElement as HTMLTextAreaElement;\n }\n\n /** Sets the minimum height of the textarea as determined by minRows. */\n _setMinHeight(): void {\n const minHeight = this.minRows && this._cachedLineHeight ?\n `${this.minRows * this._cachedLineHeight}px` : null;\n\n if (minHeight) {\n this._textareaElement.style.minHeight = minHeight;\n }\n }\n\n /** Sets the maximum height of the textarea as determined by maxRows. */\n _setMaxHeight(): void {\n const maxHeight = this.maxRows && this._cachedLineHeight ?\n `${this.maxRows * this._cachedLineHeight}px` : null;\n\n if (maxHeight) {\n this._textareaElement.style.maxHeight = maxHeight;\n }\n }\n\n ngAfterViewInit() {\n if (this._platform.isBrowser) {\n // Remember the height which we started with in case autosizing is disabled\n this._initialHeight = this._textareaElement.style.height;\n\n this.resizeToFitContent();\n\n this._ngZone.runOutsideAngular(() => {\n fromEvent(window, 'resize')\n .pipe(auditTime(16), takeUntil(this._destroyed))\n .subscribe(() => this.resizeToFitContent(true));\n });\n }\n }\n\n ngOnDestroy() {\n this._destroyed.next();\n this._destroyed.complete();\n }\n\n /**\n * Cache the height of a single-row textarea if it has not already been cached.\n *\n * We need to know how large a single \"row\" of a textarea is in order to apply minRows and\n * maxRows. For the initial version, we will assume that the height of a single line in the\n * textarea does not ever change.\n */\n private _cacheTextareaLineHeight(): void {\n if (this._cachedLineHeight) {\n return;\n }\n\n // Use a clone element because we have to override some styles.\n let textareaClone = this._textareaElement.cloneNode(false) as HTMLTextAreaElement;\n textareaClone.rows = 1;\n\n // Use `position: absolute` so that this doesn't cause a browser layout and use\n // `visibility: hidden` so that nothing is rendered. Clear any other styles that\n // would affect the height.\n textareaClone.style.position = 'absolute';\n textareaClone.style.visibility = 'hidden';\n textareaClone.style.border = 'none';\n textareaClone.style.padding = '0';\n textareaClone.style.height = '';\n textareaClone.style.minHeight = '';\n textareaClone.style.maxHeight = '';\n\n // In Firefox it happens that textarea elements are always bigger than the specified amount\n // of rows. This is because Firefox tries to add extra space for the horizontal scrollbar.\n // As a workaround that removes the extra space for the scrollbar, we can just set overflow\n // to hidden. This ensures that there is no invalid calculation of the line height.\n // See Firefox bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=33654\n textareaClone.style.overflow = 'hidden';\n\n this._textareaElement.parentNode!.appendChild(textareaClone);\n this._cachedLineHeight = textareaClone.clientHeight;\n this._textareaElement.parentNode!.removeChild(textareaClone);\n\n // Min and max heights have to be re-calculated if the cached line height changes\n this._setMinHeight();\n this._setMaxHeight();\n }\n\n ngDoCheck() {\n if (this._platform.isBrowser) {\n this.resizeToFitContent();\n }\n }\n\n /**\n * Resize the textarea to fit its content.\n * @param force Whether to force a height recalculation. By default the height will be\n * recalculated only if the value changed since the last call.\n */\n resizeToFitContent(force: boolean = false) {\n // If autosizing is disabled, just skip everything else\n if (!this._enabled) {\n return;\n }\n\n this._cacheTextareaLineHeight();\n\n // If we haven't determined the line-height yet, we know we're still hidden and there's no point\n // in checking the height of the textarea.\n if (!this._cachedLineHeight) {\n return;\n }\n\n const textarea = this._elementRef.nativeElement as HTMLTextAreaElement;\n const value = textarea.value;\n\n // Only resize if the value or minRows have changed since these calculations can be expensive.\n if (!force && this._minRows === this._previousMinRows && value === this._previousValue) {\n return;\n }\n\n const placeholderText = textarea.placeholder;\n\n // Reset the textarea height to auto in order to shrink back to its default size.\n // Also temporarily force overflow:hidden, so scroll bars do not interfere with calculations.\n // Long placeholders that are wider than the textarea width may lead to a bigger scrollHeight\n // value. To ensure that the scrollHeight is not bigger than the content, the placeholders\n // need to be removed temporarily.\n textarea.classList.add('cdk-textarea-autosize-measuring');\n textarea.placeholder = '';\n\n // The cdk-textarea-autosize-measuring class includes a 2px padding to workaround an issue with\n // Chrome, so we account for that extra space here by subtracting 4 (2px top + 2px bottom).\n const height = textarea.scrollHeight - 4;\n\n // Use the scrollHeight to know how large the textarea *would* be if fit its entire value.\n textarea.style.height = `${height}px`;\n textarea.classList.remove('cdk-textarea-autosize-measuring');\n textarea.placeholder = placeholderText;\n\n this._ngZone.runOutsideAngular(() => {\n if (typeof requestAnimationFrame !== 'undefined') {\n requestAnimationFrame(() => this._scrollToCaretPosition(textarea));\n } else {\n setTimeout(() => this._scrollToCaretPosition(textarea));\n }\n });\n\n this._previousValue = value;\n this._previousMinRows = this._minRows;\n }\n\n /**\n * Resets the textarea to its original size\n */\n reset() {\n // Do not try to change the textarea, if the initialHeight has not been determined yet\n // This might potentially remove styles when reset() is called before ngAfterViewInit\n if (this._initialHeight !== undefined) {\n this._textareaElement.style.height = this._initialHeight;\n }\n }\n\n // In Ivy the `host` metadata will be merged, whereas in ViewEngine it is overridden. In order\n // to avoid double event listeners, we need to use `HostListener`. Once Ivy is the default, we\n // can move this back into `host`.\n // tslint:disable:no-host-decorator-in-concrete\n @HostListener('input')\n _noopInputHandler() {\n // no-op handler that ensures we're running change detection on input events.\n }\n\n /**\n * Scrolls a textarea to the caret position. On Firefox resizing the textarea will\n * prevent it from scrolling to the caret position. We need to re-set the selection\n * in order for it to scroll to the proper position.\n */\n private _scrollToCaretPosition(textarea: HTMLTextAreaElement) {\n const {selectionStart, selectionEnd} = textarea;\n\n // IE will throw an \"Unspecified error\" if we try to set the selection range after the\n // element has been removed from the DOM. Assert that the directive hasn't been destroyed\n // between the time we requested the animation frame and when it was executed.\n // Also note that we have to assert that the textarea is focused before we set the\n // selection range. Setting the selection range on a non-focused textarea will cause\n // it to receive focus on IE and Edge.\n if (!this._destroyed.isStopped && document.activeElement === textarea) {\n textarea.setSelectionRange(selectionStart, selectionEnd);\n }\n }\n\n static ngAcceptInputType_minRows: NumberInput;\n static ngAcceptInputType_maxRows: NumberInput;\n static ngAcceptInputType_enabled: BooleanInput;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {PlatformModule} from '@angular/cdk/platform';\nimport {NgModule} from '@angular/core';\nimport {CdkAutofill} from './autofill';\nimport {CdkTextareaAutosize} from './autosize';\n\n\n@NgModule({\n declarations: [CdkAutofill, CdkTextareaAutosize],\n imports: [PlatformModule],\n exports: [CdkAutofill, CdkTextareaAutosize],\n})\nexport class TextFieldModule {}\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 './autofill';\nexport * from './autosize';\nexport * from './text-field-module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["normalizePassiveListenerOptions","EMPTY","coerceElement","Subject","Injectable","Platform","NgZone","EventEmitter","Directive","ElementRef","Output","coerceNumberProperty","coerceBooleanProperty","fromEvent","auditTime","takeUntil","Input","HostListener","NgModule","PlatformModule"],"mappings":";;;;;;IAAA;;;;;;;AAQA,IA+BA;IACA,IAAM,eAAe,GAAGA,kCAA+B,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC;IAGzE;;;;;AAKA;QAIE,yBAAoB,SAAmB,EAAU,OAAe;YAA5C,cAAS,GAAT,SAAS,CAAU;YAAU,YAAO,GAAP,OAAO,CA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C,eAAY,SAAC,OAAO;;QA2BvB,0BAAC;KAjQD;;IC9BA;;;;;;;AAQA;QAMA;SAK+B;;oBAL9BC,WAAQ,SAAC;wBACR,YAAY,EAAE,CAAC,WAAW,EAAE,mBAAmB,CAAC;wBAChD,OAAO,EAAE,CAACC,iBAAc,CAAC;wBACzB,OAAO,EAAE,CAAC,WAAW,EAAE,mBAAmB,CAAC;qBAC5C;;QAC6B,sBAAC;KAL/B;;ICdA;;;;;;OAMG;;ICNH;;OAEG;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"cdk-text-field.umd.js","sources":["../../../../../../src/cdk/text-field/autofill.ts","../../../../../../src/cdk/text-field/autosize.ts","../../../../../../src/cdk/text-field/text-field-module.ts","../../../../../../src/cdk/text-field/public-api.ts","../../../../../../src/cdk/text-field/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 {Platform, normalizePassiveListenerOptions} from '@angular/cdk/platform';\nimport {\n Directive,\n ElementRef,\n EventEmitter,\n Injectable,\n NgZone,\n OnDestroy,\n OnInit,\n Output,\n} from '@angular/core';\nimport {coerceElement} from '@angular/cdk/coercion';\nimport {EMPTY, Observable, Subject} from 'rxjs';\n\n\n/** An event that is emitted when the autofill state of an input changes. */\nexport type AutofillEvent = {\n /** The element whose autofill state changes. */\n target: Element;\n /** Whether the element is currently autofilled. */\n isAutofilled: boolean;\n};\n\n\n/** Used to track info about currently monitored elements. */\ntype MonitoredElementInfo = {\n subject: Subject<AutofillEvent>;\n unlisten: () => void;\n};\n\n\n/** Options to pass to the animationstart listener. */\nconst listenerOptions = normalizePassiveListenerOptions({passive: true});\n\n\n/**\n * An injectable service that can be used to monitor the autofill state of an input.\n * Based on the following blog post:\n * https://medium.com/@brunn/detecting-autofilled-fields-in-javascript-aed598d25da7\n */\n@Injectable({providedIn: 'root'})\nexport class AutofillMonitor implements OnDestroy {\n private _monitoredElements = new Map<Element, MonitoredElementInfo>();\n\n constructor(private _platform: Platform, private _ngZone: NgZone) {}\n\n /**\n * Monitor for changes in the autofill state of the given input element.\n * @param element The element to monitor.\n * @return A stream of autofill state changes.\n */\n monitor(element: Element): Observable<AutofillEvent>;\n\n /**\n * Monitor for changes in the autofill state of the given input element.\n * @param element The element to monitor.\n * @return A stream of autofill state changes.\n */\n monitor(element: ElementRef<Element>): Observable<AutofillEvent>;\n\n monitor(elementOrRef: Element | ElementRef<Element>): Observable<AutofillEvent> {\n if (!this._platform.isBrowser) {\n return EMPTY;\n }\n\n const element = coerceElement(elementOrRef);\n const info = this._monitoredElements.get(element);\n\n if (info) {\n return info.subject.asObservable();\n }\n\n const result = new Subject<AutofillEvent>();\n const cssClass = 'cdk-text-field-autofilled';\n const listener = ((event: AnimationEvent) => {\n // Animation events fire on initial element render, we check for the presence of the autofill\n // CSS class to make sure this is a real change in state, not just the initial render before\n // we fire off events.\n if (event.animationName === 'cdk-text-field-autofill-start' &&\n !element.classList.contains(cssClass)) {\n element.classList.add(cssClass);\n this._ngZone.run(() => result.next({target: event.target as Element, isAutofilled: true}));\n } else if (event.animationName === 'cdk-text-field-autofill-end' &&\n element.classList.contains(cssClass)) {\n element.classList.remove(cssClass);\n this._ngZone.run(() => result.next({target: event.target as Element, isAutofilled: false}));\n }\n }) as EventListenerOrEventListenerObject;\n\n this._ngZone.runOutsideAngular(() => {\n element.addEventListener('animationstart', listener, listenerOptions);\n element.classList.add('cdk-text-field-autofill-monitored');\n });\n\n this._monitoredElements.set(element, {\n subject: result,\n unlisten: () => {\n element.removeEventListener('animationstart', listener, listenerOptions);\n }\n });\n\n return result.asObservable();\n }\n\n /**\n * Stop monitoring the autofill state of the given input element.\n * @param element The element to stop monitoring.\n */\n stopMonitoring(element: Element): void;\n\n /**\n * Stop monitoring the autofill state of the given input element.\n * @param element The element to stop monitoring.\n */\n stopMonitoring(element: ElementRef<Element>): void;\n\n stopMonitoring(elementOrRef: Element | ElementRef<Element>): void {\n const element = coerceElement(elementOrRef);\n const info = this._monitoredElements.get(element);\n\n if (info) {\n info.unlisten();\n info.subject.complete();\n element.classList.remove('cdk-text-field-autofill-monitored');\n element.classList.remove('cdk-text-field-autofilled');\n this._monitoredElements.delete(element);\n }\n }\n\n ngOnDestroy() {\n this._monitoredElements.forEach((_info, element) => this.stopMonitoring(element));\n }\n}\n\n\n/** A directive that can be used to monitor the autofill state of an input. */\n@Directive({\n selector: '[cdkAutofill]',\n})\nexport class CdkAutofill implements OnDestroy, OnInit {\n /** Emits when the autofill state of the element changes. */\n @Output() cdkAutofill: EventEmitter<AutofillEvent> = new EventEmitter<AutofillEvent>();\n\n constructor(private _elementRef: ElementRef<HTMLElement>,\n private _autofillMonitor: AutofillMonitor) {}\n\n ngOnInit() {\n this._autofillMonitor\n .monitor(this._elementRef)\n .subscribe(event => this.cdkAutofill.emit(event));\n }\n\n ngOnDestroy() {\n this._autofillMonitor.stopMonitoring(this._elementRef);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n BooleanInput,\n coerceBooleanProperty,\n coerceNumberProperty,\n NumberInput\n} from '@angular/cdk/coercion';\nimport {\n Directive,\n ElementRef,\n Input,\n AfterViewInit,\n DoCheck,\n OnDestroy,\n NgZone,\n HostListener,\n Optional,\n Inject,\n} from '@angular/core';\nimport {Platform} from '@angular/cdk/platform';\nimport {auditTime, takeUntil} from 'rxjs/operators';\nimport {fromEvent, Subject} from 'rxjs';\nimport {DOCUMENT} from '@angular/common';\n\n/** Directive to automatically resize a textarea to fit its content. */\n@Directive({\n selector: 'textarea[cdkTextareaAutosize]',\n exportAs: 'cdkTextareaAutosize',\n host: {\n 'class': 'cdk-textarea-autosize',\n // Textarea elements that have the directive applied should have a single row by default.\n // Browsers normally show two rows by default and therefore this limits the minRows binding.\n 'rows': '1',\n },\n})\nexport class CdkTextareaAutosize implements AfterViewInit, DoCheck, OnDestroy {\n /** Keep track of the previous textarea value to avoid resizing when the value hasn't changed. */\n private _previousValue?: string;\n private _initialHeight: string | undefined;\n private readonly _destroyed = new Subject<void>();\n\n private _minRows: number;\n private _maxRows: number;\n private _enabled: boolean = true;\n\n /**\n * Value of minRows as of last resize. If the minRows has decreased, the\n * height of the textarea needs to be recomputed to reflect the new minimum. The maxHeight\n * does not have the same problem because it does not affect the textarea's scrollHeight.\n */\n private _previousMinRows: number = -1;\n\n private _textareaElement: HTMLTextAreaElement;\n\n /** Minimum amount of rows in the textarea. */\n @Input('cdkAutosizeMinRows')\n get minRows(): number { return this._minRows; }\n set minRows(value: number) {\n this._minRows = coerceNumberProperty(value);\n this._setMinHeight();\n }\n\n /** Maximum amount of rows in the textarea. */\n @Input('cdkAutosizeMaxRows')\n get maxRows(): number { return this._maxRows; }\n set maxRows(value: number) {\n this._maxRows = coerceNumberProperty(value);\n this._setMaxHeight();\n }\n\n /** Whether autosizing is enabled or not */\n @Input('cdkTextareaAutosize')\n get enabled(): boolean { return this._enabled; }\n set enabled(value: boolean) {\n value = coerceBooleanProperty(value);\n\n // Only act if the actual value changed. This specifically helps to not run\n // resizeToFitContent too early (i.e. before ngAfterViewInit)\n if (this._enabled !== value) {\n (this._enabled = value) ? this.resizeToFitContent(true) : this.reset();\n }\n }\n\n /** Cached height of a textarea with a single row. */\n private _cachedLineHeight: number;\n\n /** Used to reference correct document/window */\n protected _document?: Document;\n\n constructor(private _elementRef: ElementRef<HTMLElement>,\n private _platform: Platform,\n private _ngZone: NgZone,\n /** @breaking-change 11.0.0 make document required */\n @Optional() @Inject(DOCUMENT) document?: any) {\n this._document = document;\n\n this._textareaElement = this._elementRef.nativeElement as HTMLTextAreaElement;\n }\n\n /** Sets the minimum height of the textarea as determined by minRows. */\n _setMinHeight(): void {\n const minHeight = this.minRows && this._cachedLineHeight ?\n `${this.minRows * this._cachedLineHeight}px` : null;\n\n if (minHeight) {\n this._textareaElement.style.minHeight = minHeight;\n }\n }\n\n /** Sets the maximum height of the textarea as determined by maxRows. */\n _setMaxHeight(): void {\n const maxHeight = this.maxRows && this._cachedLineHeight ?\n `${this.maxRows * this._cachedLineHeight}px` : null;\n\n if (maxHeight) {\n this._textareaElement.style.maxHeight = maxHeight;\n }\n }\n\n ngAfterViewInit() {\n if (this._platform.isBrowser) {\n // Remember the height which we started with in case autosizing is disabled\n this._initialHeight = this._textareaElement.style.height;\n\n this.resizeToFitContent();\n\n this._ngZone.runOutsideAngular(() => {\n const window = this._getWindow();\n\n fromEvent(window, 'resize')\n .pipe(auditTime(16), takeUntil(this._destroyed))\n .subscribe(() => this.resizeToFitContent(true));\n });\n }\n }\n\n ngOnDestroy() {\n this._destroyed.next();\n this._destroyed.complete();\n }\n\n /**\n * Cache the height of a single-row textarea if it has not already been cached.\n *\n * We need to know how large a single \"row\" of a textarea is in order to apply minRows and\n * maxRows. For the initial version, we will assume that the height of a single line in the\n * textarea does not ever change.\n */\n private _cacheTextareaLineHeight(): void {\n if (this._cachedLineHeight) {\n return;\n }\n\n // Use a clone element because we have to override some styles.\n let textareaClone = this._textareaElement.cloneNode(false) as HTMLTextAreaElement;\n textareaClone.rows = 1;\n\n // Use `position: absolute` so that this doesn't cause a browser layout and use\n // `visibility: hidden` so that nothing is rendered. Clear any other styles that\n // would affect the height.\n textareaClone.style.position = 'absolute';\n textareaClone.style.visibility = 'hidden';\n textareaClone.style.border = 'none';\n textareaClone.style.padding = '0';\n textareaClone.style.height = '';\n textareaClone.style.minHeight = '';\n textareaClone.style.maxHeight = '';\n\n // In Firefox it happens that textarea elements are always bigger than the specified amount\n // of rows. This is because Firefox tries to add extra space for the horizontal scrollbar.\n // As a workaround that removes the extra space for the scrollbar, we can just set overflow\n // to hidden. This ensures that there is no invalid calculation of the line height.\n // See Firefox bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=33654\n textareaClone.style.overflow = 'hidden';\n\n this._textareaElement.parentNode!.appendChild(textareaClone);\n this._cachedLineHeight = textareaClone.clientHeight;\n this._textareaElement.parentNode!.removeChild(textareaClone);\n\n // Min and max heights have to be re-calculated if the cached line height changes\n this._setMinHeight();\n this._setMaxHeight();\n }\n\n ngDoCheck() {\n if (this._platform.isBrowser) {\n this.resizeToFitContent();\n }\n }\n\n /**\n * Resize the textarea to fit its content.\n * @param force Whether to force a height recalculation. By default the height will be\n * recalculated only if the value changed since the last call.\n */\n resizeToFitContent(force: boolean = false) {\n // If autosizing is disabled, just skip everything else\n if (!this._enabled) {\n return;\n }\n\n this._cacheTextareaLineHeight();\n\n // If we haven't determined the line-height yet, we know we're still hidden and there's no point\n // in checking the height of the textarea.\n if (!this._cachedLineHeight) {\n return;\n }\n\n const textarea = this._elementRef.nativeElement as HTMLTextAreaElement;\n const value = textarea.value;\n\n // Only resize if the value or minRows have changed since these calculations can be expensive.\n if (!force && this._minRows === this._previousMinRows && value === this._previousValue) {\n return;\n }\n\n const placeholderText = textarea.placeholder;\n\n // Reset the textarea height to auto in order to shrink back to its default size.\n // Also temporarily force overflow:hidden, so scroll bars do not interfere with calculations.\n // Long placeholders that are wider than the textarea width may lead to a bigger scrollHeight\n // value. To ensure that the scrollHeight is not bigger than the content, the placeholders\n // need to be removed temporarily.\n textarea.classList.add('cdk-textarea-autosize-measuring');\n textarea.placeholder = '';\n\n // The cdk-textarea-autosize-measuring class includes a 2px padding to workaround an issue with\n // Chrome, so we account for that extra space here by subtracting 4 (2px top + 2px bottom).\n const height = textarea.scrollHeight - 4;\n\n // Use the scrollHeight to know how large the textarea *would* be if fit its entire value.\n textarea.style.height = `${height}px`;\n textarea.classList.remove('cdk-textarea-autosize-measuring');\n textarea.placeholder = placeholderText;\n\n this._ngZone.runOutsideAngular(() => {\n if (typeof requestAnimationFrame !== 'undefined') {\n requestAnimationFrame(() => this._scrollToCaretPosition(textarea));\n } else {\n setTimeout(() => this._scrollToCaretPosition(textarea));\n }\n });\n\n this._previousValue = value;\n this._previousMinRows = this._minRows;\n }\n\n /**\n * Resets the textarea to its original size\n */\n reset() {\n // Do not try to change the textarea, if the initialHeight has not been determined yet\n // This might potentially remove styles when reset() is called before ngAfterViewInit\n if (this._initialHeight !== undefined) {\n this._textareaElement.style.height = this._initialHeight;\n }\n }\n\n // In Ivy the `host` metadata will be merged, whereas in ViewEngine it is overridden. In order\n // to avoid double event listeners, we need to use `HostListener`. Once Ivy is the default, we\n // can move this back into `host`.\n // tslint:disable:no-host-decorator-in-concrete\n @HostListener('input')\n _noopInputHandler() {\n // no-op handler that ensures we're running change detection on input events.\n }\n\n /** Access injected document if available or fallback to global document reference */\n private _getDocument(): Document {\n return this._document || document;\n }\n\n /** Use defaultView of injected document if available or fallback to global window reference */\n private _getWindow(): Window {\n const doc = this._getDocument();\n return doc.defaultView || window;\n }\n\n /**\n * Scrolls a textarea to the caret position. On Firefox resizing the textarea will\n * prevent it from scrolling to the caret position. We need to re-set the selection\n * in order for it to scroll to the proper position.\n */\n private _scrollToCaretPosition(textarea: HTMLTextAreaElement) {\n const {selectionStart, selectionEnd} = textarea;\n const document = this._getDocument();\n\n // IE will throw an \"Unspecified error\" if we try to set the selection range after the\n // element has been removed from the DOM. Assert that the directive hasn't been destroyed\n // between the time we requested the animation frame and when it was executed.\n // Also note that we have to assert that the textarea is focused before we set the\n // selection range. Setting the selection range on a non-focused textarea will cause\n // it to receive focus on IE and Edge.\n if (!this._destroyed.isStopped && document.activeElement === textarea) {\n textarea.setSelectionRange(selectionStart, selectionEnd);\n }\n }\n\n static ngAcceptInputType_minRows: NumberInput;\n static ngAcceptInputType_maxRows: NumberInput;\n static ngAcceptInputType_enabled: BooleanInput;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {PlatformModule} from '@angular/cdk/platform';\nimport {NgModule} from '@angular/core';\nimport {CdkAutofill} from './autofill';\nimport {CdkTextareaAutosize} from './autosize';\n\n\n@NgModule({\n declarations: [CdkAutofill, CdkTextareaAutosize],\n imports: [PlatformModule],\n exports: [CdkAutofill, CdkTextareaAutosize],\n})\nexport class TextFieldModule {}\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 './autofill';\nexport * from './autosize';\nexport * from './text-field-module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["normalizePassiveListenerOptions","EMPTY","coerceElement","Subject","Injectable","Platform","NgZone","EventEmitter","Directive","ElementRef","Output","coerceNumberProperty","coerceBooleanProperty","fromEvent","auditTime","takeUntil","Optional","Inject","DOCUMENT","Input","HostListener","NgModule","PlatformModule"],"mappings":";;;;;;IAAA;;;;;;;AAQA,IA+BA;IACA,IAAM,eAAe,GAAGA,kCAA+B,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC;IAGzE;;;;;AAKA;QAIE,yBAAoB,SAAmB,EAAU,OAAe;YAA5C,cAAS,GAAT,SAAS,CAAU;YAAU,YAAO,GAAP,OAAO,CAAQ;YAFxD,uBAAkB,GAAG,IAAI,GAAG,EAAiC,CAAC;SAEF;QAgBpE,iCAAO,GAAP,UAAQ,YAA2C;YAAnD,iBA0CC;YAzCC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE;gBAC7B,OAAOC,UAAK,CAAC;aACd;YAED,IAAM,OAAO,GAAGC,sBAAa,CAAC,YAAY,CAAC,CAAC;YAC5C,IAAM,IAAI,GAAG,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YAElD,IAAI,IAAI,EAAE;gBACR,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;aACpC;YAED,IAAM,MAAM,GAAG,IAAIC,YAAO,EAAiB,CAAC;YAC5C,IAAM,QAAQ,GAAG,2BAA2B,CAAC;YAC7C,IAAM,QAAQ,IAAI,UAAC,KAAqB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AAW,EAAE,mBAAmB,CAAC;wBAChD,OAAO,EAAE,CAACC,iBAAc,CAAC;wBACzB,OAAO,EAAE,CAAC,WAAW,EAAE,mBAAmB,CAAC;qBAC5C;;QAC6B,sBAAC;KAL/B;;ICdA;;;;;;OAMG;;ICNH;;OAEG;;;;;;;;;;;;;;;"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/cdk/platform"),require("@angular/core"),require("@angular/cdk/coercion"),require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("@angular/cdk/text-field",["exports","@angular/cdk/platform","@angular/core","@angular/cdk/coercion","rxjs","rxjs/operators"],t):t(((e=e||self).ng=e.ng||{},e.ng.cdk=e.ng.cdk||{},e.ng.cdk.textField={}),e.ng.cdk.platform,e.ng.core,e.ng.cdk.coercion,e.rxjs,e.rxjs.operators)}(this,(function(e,t,i,n,o,r){"use strict";
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/cdk/platform"),require("@angular/core"),require("@angular/cdk/coercion"),require("rxjs"),require("rxjs/operators"),require("@angular/common")):"function"==typeof define&&define.amd?define("@angular/cdk/text-field",["exports","@angular/cdk/platform","@angular/core","@angular/cdk/coercion","rxjs","rxjs/operators","@angular/common"],t):t(((e=e||self).ng=e.ng||{},e.ng.cdk=e.ng.cdk||{},e.ng.cdk.textField={}),e.ng.cdk.platform,e.ng.core,e.ng.cdk.coercion,e.rxjs,e.rxjs.operators,e.ng.common)}(this,(function(e,t,i,n,o,r,s){"use strict";
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
|
-
*/var
|
|
8
|
+
*/var a=t.normalizePassiveListenerOptions({passive:!0}),c=function(){function e(e,t){this._platform=e,this._ngZone=t,this._monitoredElements=new Map}return e.prototype.monitor=function(e){var t=this;if(!this._platform.isBrowser)return o.EMPTY;var i=n.coerceElement(e),r=this._monitoredElements.get(i);if(r)return r.subject.asObservable();var s=new o.Subject,c="cdk-text-field-autofilled",l=function(e){"cdk-text-field-autofill-start"!==e.animationName||i.classList.contains(c)?"cdk-text-field-autofill-end"===e.animationName&&i.classList.contains(c)&&(i.classList.remove(c),t._ngZone.run((function(){return s.next({target:e.target,isAutofilled:!1})}))):(i.classList.add(c),t._ngZone.run((function(){return s.next({target:e.target,isAutofilled:!0})})))};return this._ngZone.runOutsideAngular((function(){i.addEventListener("animationstart",l,a),i.classList.add("cdk-text-field-autofill-monitored")})),this._monitoredElements.set(i,{subject:s,unlisten:function(){i.removeEventListener("animationstart",l,a)}}),s.asObservable()},e.prototype.stopMonitoring=function(e){var t=n.coerceElement(e),i=this._monitoredElements.get(t);i&&(i.unlisten(),i.subject.complete(),t.classList.remove("cdk-text-field-autofill-monitored"),t.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(t))},e.prototype.ngOnDestroy=function(){var e=this;this._monitoredElements.forEach((function(t,i){return e.stopMonitoring(i)}))},e.decorators=[{type:i.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:t.Platform},{type:i.NgZone}]},e.ɵprov=i.ɵɵdefineInjectable({factory:function n(){return new e(i.ɵɵinject(t.Platform),i.ɵɵinject(i.NgZone))},token:e,providedIn:"root"}),e}(),l=function(){function e(e,t){this._elementRef=e,this._autofillMonitor=t,this.cdkAutofill=new i.EventEmitter}return e.prototype.ngOnInit=function(){var e=this;this._autofillMonitor.monitor(this._elementRef).subscribe((function(t){return e.cdkAutofill.emit(t)}))},e.prototype.ngOnDestroy=function(){this._autofillMonitor.stopMonitoring(this._elementRef)},e.decorators=[{type:i.Directive,args:[{selector:"[cdkAutofill]"}]}],e.ctorParameters=function(){return[{type:i.ElementRef},{type:c}]},e.propDecorators={cdkAutofill:[{type:i.Output}]},e}(),u=function(){function e(e,t,i,n){this._elementRef=e,this._platform=t,this._ngZone=i,this._destroyed=new o.Subject,this._enabled=!0,this._previousMinRows=-1,this._document=n,this._textareaElement=this._elementRef.nativeElement}return Object.defineProperty(e.prototype,"minRows",{get:function(){return this._minRows},set:function(e){this._minRows=n.coerceNumberProperty(e),this._setMinHeight()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxRows",{get:function(){return this._maxRows},set:function(e){this._maxRows=n.coerceNumberProperty(e),this._setMaxHeight()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enabled",{get:function(){return this._enabled},set:function(e){e=n.coerceBooleanProperty(e),this._enabled!==e&&((this._enabled=e)?this.resizeToFitContent(!0):this.reset())},enumerable:!0,configurable:!0}),e.prototype._setMinHeight=function(){var e=this.minRows&&this._cachedLineHeight?this.minRows*this._cachedLineHeight+"px":null;e&&(this._textareaElement.style.minHeight=e)},e.prototype._setMaxHeight=function(){var e=this.maxRows&&this._cachedLineHeight?this.maxRows*this._cachedLineHeight+"px":null;e&&(this._textareaElement.style.maxHeight=e)},e.prototype.ngAfterViewInit=function(){var e=this;this._platform.isBrowser&&(this._initialHeight=this._textareaElement.style.height,this.resizeToFitContent(),this._ngZone.runOutsideAngular((function(){var t=e._getWindow();o.fromEvent(t,"resize").pipe(r.auditTime(16),r.takeUntil(e._destroyed)).subscribe((function(){return e.resizeToFitContent(!0)}))})))},e.prototype.ngOnDestroy=function(){this._destroyed.next(),this._destroyed.complete()},e.prototype._cacheTextareaLineHeight=function(){if(!this._cachedLineHeight){var e=this._textareaElement.cloneNode(!1);e.rows=1,e.style.position="absolute",e.style.visibility="hidden",e.style.border="none",e.style.padding="0",e.style.height="",e.style.minHeight="",e.style.maxHeight="",e.style.overflow="hidden",this._textareaElement.parentNode.appendChild(e),this._cachedLineHeight=e.clientHeight,this._textareaElement.parentNode.removeChild(e),this._setMinHeight(),this._setMaxHeight()}},e.prototype.ngDoCheck=function(){this._platform.isBrowser&&this.resizeToFitContent()},e.prototype.resizeToFitContent=function(e){var t=this;if(void 0===e&&(e=!1),this._enabled&&(this._cacheTextareaLineHeight(),this._cachedLineHeight)){var i=this._elementRef.nativeElement,n=i.value;if(e||this._minRows!==this._previousMinRows||n!==this._previousValue){var o=i.placeholder;i.classList.add("cdk-textarea-autosize-measuring"),i.placeholder="",i.style.height=i.scrollHeight-4+"px",i.classList.remove("cdk-textarea-autosize-measuring"),i.placeholder=o,this._ngZone.runOutsideAngular((function(){"undefined"!=typeof requestAnimationFrame?requestAnimationFrame((function(){return t._scrollToCaretPosition(i)})):setTimeout((function(){return t._scrollToCaretPosition(i)}))})),this._previousValue=n,this._previousMinRows=this._minRows}}},e.prototype.reset=function(){void 0!==this._initialHeight&&(this._textareaElement.style.height=this._initialHeight)},e.prototype._noopInputHandler=function(){},e.prototype._getDocument=function(){return this._document||document},e.prototype._getWindow=function(){return this._getDocument().defaultView||window},e.prototype._scrollToCaretPosition=function(e){var t=e.selectionStart,i=e.selectionEnd,n=this._getDocument();this._destroyed.isStopped||n.activeElement!==e||e.setSelectionRange(t,i)},e.decorators=[{type:i.Directive,args:[{selector:"textarea[cdkTextareaAutosize]",exportAs:"cdkTextareaAutosize",host:{class:"cdk-textarea-autosize",rows:"1"}}]}],e.ctorParameters=function(){return[{type:i.ElementRef},{type:t.Platform},{type:i.NgZone},{type:void 0,decorators:[{type:i.Optional},{type:i.Inject,args:[s.DOCUMENT]}]}]},e.propDecorators={minRows:[{type:i.Input,args:["cdkAutosizeMinRows"]}],maxRows:[{type:i.Input,args:["cdkAutosizeMaxRows"]}],enabled:[{type:i.Input,args:["cdkTextareaAutosize"]}],_noopInputHandler:[{type:i.HostListener,args:["input"]}]},e}(),d=function(){function e(){}return e.decorators=[{type:i.NgModule,args:[{declarations:[l,u],imports:[t.PlatformModule],exports:[l,u]}]}],e}();
|
|
9
9
|
/**
|
|
10
10
|
* @license
|
|
11
11
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -13,4 +13,4 @@
|
|
|
13
13
|
* Use of this source code is governed by an MIT-style license that can be
|
|
14
14
|
* found in the LICENSE file at https://angular.io/license
|
|
15
15
|
*/
|
|
16
|
-
e.AutofillMonitor=
|
|
16
|
+
e.AutofillMonitor=c,e.CdkAutofill=l,e.CdkTextareaAutosize=u,e.TextFieldModule=d,Object.defineProperty(e,"__esModule",{value:!0})}));
|