@angular/cdk 12.0.0-rc.2 → 12.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/a11y/focus-trap/focus-trap.d.ts +6 -2
- package/a11y/index.metadata.json +1 -1
- package/bundles/cdk-a11y.umd.js +7 -3
- package/bundles/cdk-a11y.umd.js.map +1 -1
- package/bundles/cdk-overlay.umd.js +14 -12
- package/bundles/cdk-overlay.umd.js.map +1 -1
- package/bundles/cdk-platform.umd.js +19 -0
- package/bundles/cdk-platform.umd.js.map +1 -1
- package/bundles/cdk-testing.umd.js +48 -4
- package/bundles/cdk-testing.umd.js.map +1 -1
- package/bundles/cdk.umd.js +1 -1
- package/bundles/cdk.umd.js.map +1 -1
- package/esm2015/a11y/focus-trap/focus-trap.js +9 -4
- package/esm2015/overlay/dispatchers/overlay-outside-click-dispatcher.js +15 -13
- package/esm2015/platform/features/shadow-dom.js +19 -1
- package/esm2015/testing/change-detection.js +8 -1
- package/esm2015/testing/component-harness.js +42 -4
- package/esm2015/version.js +1 -1
- package/fesm2015/a11y.js +8 -4
- package/fesm2015/a11y.js.map +1 -1
- package/fesm2015/cdk.js +1 -1
- package/fesm2015/cdk.js.map +1 -1
- package/fesm2015/overlay.js +14 -12
- package/fesm2015/overlay.js.map +1 -1
- package/fesm2015/platform.js +19 -1
- package/fesm2015/platform.js.map +1 -1
- package/fesm2015/testing.js +48 -3
- package/fesm2015/testing.js.map +1 -1
- package/package.json +3 -3
- package/platform/features/shadow-dom.d.ts +5 -0
- package/platform/index.metadata.json +1 -1
- package/schematics/index.mjs +33 -0
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +39 -0
- package/schematics/ng-add/package-config.mjs +47 -0
- package/schematics/ng-add/schema.mjs +10 -0
- package/schematics/ng-generate/drag-drop/index.mjs +39 -0
- package/schematics/ng-generate/drag-drop/schema.mjs +10 -0
- package/schematics/ng-update/data/attribute-selectors.mjs +21 -0
- package/schematics/ng-update/data/class-names.mjs +40 -0
- package/schematics/ng-update/data/constructor-checks.mjs +66 -0
- package/schematics/ng-update/data/css-selectors.mjs +15 -0
- package/schematics/ng-update/data/element-selectors.mjs +15 -0
- package/schematics/ng-update/data/index.mjs +29 -0
- package/schematics/ng-update/data/input-names.mjs +81 -0
- package/schematics/ng-update/data/method-call-checks.mjs +43 -0
- package/schematics/ng-update/data/output-names.mjs +27 -0
- package/schematics/ng-update/data/property-names.mjs +129 -0
- package/schematics/ng-update/devkit-file-system.mjs +81 -0
- package/schematics/ng-update/devkit-migration-rule.mjs +136 -0
- package/schematics/ng-update/devkit-migration.mjs +20 -0
- package/schematics/ng-update/find-stylesheets.d.ts +8 -2
- package/schematics/ng-update/find-stylesheets.js +16 -5
- package/schematics/ng-update/find-stylesheets.mjs +42 -0
- package/schematics/ng-update/html-parsing/angular.mjs +52 -0
- package/schematics/ng-update/html-parsing/elements.mjs +62 -0
- package/schematics/ng-update/index.mjs +59 -0
- package/schematics/ng-update/migrations/attribute-selectors.mjs +67 -0
- package/schematics/ng-update/migrations/class-inheritance.mjs +58 -0
- package/schematics/ng-update/migrations/class-names.mjs +90 -0
- package/schematics/ng-update/migrations/constructor-signature.mjs +135 -0
- package/schematics/ng-update/migrations/css-selectors.mjs +74 -0
- package/schematics/ng-update/migrations/element-selectors.mjs +65 -0
- package/schematics/ng-update/migrations/input-names.mjs +60 -0
- package/schematics/ng-update/migrations/method-call-arguments.mjs +61 -0
- package/schematics/ng-update/migrations/misc-template.mjs +38 -0
- package/schematics/ng-update/migrations/output-names.mjs +47 -0
- package/schematics/ng-update/migrations/property-names.mjs +59 -0
- package/schematics/ng-update/public-api.mjs +30 -0
- package/schematics/ng-update/typescript/base-types.mjs +24 -0
- package/schematics/ng-update/typescript/imports.mjs +54 -0
- package/schematics/ng-update/typescript/literal.mjs +33 -0
- package/schematics/ng-update/typescript/module-specifiers.mjs +35 -0
- package/schematics/ng-update/upgrade-data.mjs +35 -0
- package/schematics/paths.mjs +16 -0
- package/schematics/schematics.externs.js +0 -0
- package/schematics/update-tool/component-resource-collector.mjs +147 -0
- package/schematics/update-tool/file-system.mjs +18 -0
- package/schematics/update-tool/index.mjs +158 -0
- package/schematics/update-tool/logger.mjs +18 -0
- package/schematics/update-tool/migration.mjs +67 -0
- package/schematics/update-tool/public-api.mjs +28 -0
- package/schematics/update-tool/target-version.mjs +34 -0
- package/schematics/update-tool/update-recorder.mjs +10 -0
- package/schematics/update-tool/update-tool.externs.js +0 -0
- package/schematics/update-tool/utils/decorators.mjs +38 -0
- package/schematics/update-tool/utils/functions.mjs +21 -0
- package/schematics/update-tool/utils/imports.mjs +111 -0
- package/schematics/update-tool/utils/line-mappings.mjs +76 -0
- package/schematics/update-tool/utils/parse-tsconfig.mjs +19 -0
- package/schematics/update-tool/utils/property-name.mjs +28 -0
- package/schematics/update-tool/utils/virtual-host.mjs +62 -0
- package/schematics/update-tool/version-changes.mjs +39 -0
- package/schematics/utils/ast/ng-module-imports.mjs +81 -0
- package/schematics/utils/ast.mjs +79 -0
- package/schematics/utils/build-component.mjs +193 -0
- package/schematics/utils/get-project.mjs +24 -0
- package/schematics/utils/html-manipulation.mjs +89 -0
- package/schematics/utils/index.mjs +31 -0
- package/schematics/utils/parse5-element.mjs +32 -0
- package/schematics/utils/project-index-file.mjs +21 -0
- package/schematics/utils/project-main-file.mjs +23 -0
- package/schematics/utils/project-style-file.mjs +44 -0
- package/schematics/utils/project-targets.mjs +34 -0
- package/schematics/utils/project-tsconfig-paths.mjs +50 -0
- package/schematics/utils/schematic-options.mjs +55 -0
- package/schematics/utils/vendored-ast-utils/index.mjs +480 -0
|
@@ -325,6 +325,24 @@
|
|
|
325
325
|
}
|
|
326
326
|
return null;
|
|
327
327
|
}
|
|
328
|
+
/**
|
|
329
|
+
* Gets the currently-focused element on the page while
|
|
330
|
+
* also piercing through Shadow DOM boundaries.
|
|
331
|
+
*/
|
|
332
|
+
function _getFocusedElementPierceShadowDom() {
|
|
333
|
+
var activeElement = typeof document !== 'undefined' && document ?
|
|
334
|
+
document.activeElement : null;
|
|
335
|
+
while (activeElement && activeElement.shadowRoot) {
|
|
336
|
+
var newActiveElement = activeElement.shadowRoot.activeElement;
|
|
337
|
+
if (newActiveElement === activeElement) {
|
|
338
|
+
break;
|
|
339
|
+
}
|
|
340
|
+
else {
|
|
341
|
+
activeElement = newActiveElement;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
return activeElement;
|
|
345
|
+
}
|
|
328
346
|
|
|
329
347
|
/**
|
|
330
348
|
* @license
|
|
@@ -340,6 +358,7 @@
|
|
|
340
358
|
|
|
341
359
|
exports.Platform = Platform;
|
|
342
360
|
exports.PlatformModule = PlatformModule;
|
|
361
|
+
exports._getFocusedElementPierceShadowDom = _getFocusedElementPierceShadowDom;
|
|
343
362
|
exports._getShadowRoot = _getShadowRoot;
|
|
344
363
|
exports._supportsShadowDom = _supportsShadowDom;
|
|
345
364
|
exports.getRtlScrollAxisType = getRtlScrollAxisType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdk-platform.umd.js","sources":["../../../../../src/cdk/platform/platform.ts","../../../../../src/cdk/platform/platform-module.ts","../../../../../src/cdk/platform/features/input-types.ts","../../../../../src/cdk/platform/features/passive-listeners.ts","../../../../../src/cdk/platform/features/scrolling.ts","../../../../../src/cdk/platform/features/shadow-dom.ts","../../../../../src/cdk/platform/public-api.ts","../../../../../src/cdk/platform/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Inject, Injectable, PLATFORM_ID} from '@angular/core';\nimport {isPlatformBrowser} from '@angular/common';\n\n// Whether the current platform supports the V8 Break Iterator. The V8 check\n// is necessary to detect all Blink based browsers.\nlet hasV8BreakIterator: boolean;\n\n// We need a try/catch around the reference to `Intl`, because accessing it in some cases can\n// cause IE to throw. These cases are tied to particular versions of Windows and can happen if\n// the consumer is providing a polyfilled `Map`. See:\n// https://github.com/Microsoft/ChakraCore/issues/3189\n// https://github.com/angular/components/issues/15687\ntry {\n hasV8BreakIterator = (typeof Intl !== 'undefined' && (Intl as any).v8BreakIterator);\n} catch {\n hasV8BreakIterator = false;\n}\n\n/**\n * Service to detect the current platform by comparing the userAgent strings and\n * checking browser-specific global properties.\n */\n@Injectable({providedIn: 'root'})\nexport class Platform {\n // We want to use the Angular platform check because if the Document is shimmed\n // without the navigator, the following checks will fail. This is preferred because\n // sometimes the Document may be shimmed without the user's knowledge or intention\n /** Whether the Angular application is being rendered in the browser. */\n isBrowser: boolean = this._platformId ?\n isPlatformBrowser(this._platformId) : typeof document === 'object' && !!document;\n\n /** Whether the current browser is Microsoft Edge. */\n EDGE: boolean = this.isBrowser && /(edge)/i.test(navigator.userAgent);\n\n /** Whether the current rendering engine is Microsoft Trident. */\n TRIDENT: boolean = this.isBrowser && /(msie|trident)/i.test(navigator.userAgent);\n\n // EdgeHTML and Trident mock Blink specific things and need to be excluded from this check.\n /** Whether the current rendering engine is Blink. */\n BLINK: boolean = this.isBrowser && (!!((window as any).chrome || hasV8BreakIterator) &&\n typeof CSS !== 'undefined' && !this.EDGE && !this.TRIDENT);\n\n // Webkit is part of the userAgent in EdgeHTML, Blink and Trident. Therefore we need to\n // ensure that Webkit runs standalone and is not used as another engine's base.\n /** Whether the current rendering engine is WebKit. */\n WEBKIT: boolean = this.isBrowser &&\n /AppleWebKit/i.test(navigator.userAgent) && !this.BLINK && !this.EDGE && !this.TRIDENT;\n\n /** Whether the current platform is Apple iOS. */\n IOS: boolean = this.isBrowser && /iPad|iPhone|iPod/.test(navigator.userAgent) &&\n !('MSStream' in window);\n\n // It's difficult to detect the plain Gecko engine, because most of the browsers identify\n // them self as Gecko-like browsers and modify the userAgent's according to that.\n // Since we only cover one explicit Firefox case, we can simply check for Firefox\n // instead of having an unstable check for Gecko.\n /** Whether the current browser is Firefox. */\n FIREFOX: boolean = this.isBrowser && /(firefox|minefield)/i.test(navigator.userAgent);\n\n /** Whether the current platform is Android. */\n // Trident on mobile adds the android platform to the userAgent to trick detections.\n ANDROID: boolean = this.isBrowser && /android/i.test(navigator.userAgent) && !this.TRIDENT;\n\n // Safari browsers will include the Safari keyword in their userAgent. Some browsers may fake\n // this and just place the Safari keyword in the userAgent. To be more safe about Safari every\n // Safari browser should also use Webkit as its layout engine.\n /** Whether the current browser is Safari. */\n SAFARI: boolean = this.isBrowser && /safari/i.test(navigator.userAgent) && this.WEBKIT;\n\n constructor(@Inject(PLATFORM_ID) private _platformId: Object) {}\n}\n\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\n\n\n@NgModule({})\nexport class PlatformModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/** Cached result Set of input types support by the current browser. */\nlet supportedInputTypes: Set<string>;\n\n/** Types of `<input>` that *might* be supported. */\nconst candidateInputTypes = [\n // `color` must come first. Chrome 56 shows a warning if we change the type to `color` after\n // first changing it to something else:\n // The specified value \"\" does not conform to the required format.\n // The format is \"#rrggbb\" where rr, gg, bb are two-digit hexadecimal numbers.\n 'color',\n 'button',\n 'checkbox',\n 'date',\n 'datetime-local',\n 'email',\n 'file',\n 'hidden',\n 'image',\n 'month',\n 'number',\n 'password',\n 'radio',\n 'range',\n 'reset',\n 'search',\n 'submit',\n 'tel',\n 'text',\n 'time',\n 'url',\n 'week',\n];\n\n/** @returns The input types supported by this browser. */\nexport function getSupportedInputTypes(): Set<string> {\n // Result is cached.\n if (supportedInputTypes) {\n return supportedInputTypes;\n }\n\n // We can't check if an input type is not supported until we're on the browser, so say that\n // everything is supported when not on the browser. We don't use `Platform` here since it's\n // just a helper function and can't inject it.\n if (typeof document !== 'object' || !document) {\n supportedInputTypes = new Set(candidateInputTypes);\n return supportedInputTypes;\n }\n\n let featureTestInput = document.createElement('input');\n supportedInputTypes = new Set(candidateInputTypes.filter(value => {\n featureTestInput.setAttribute('type', value);\n return featureTestInput.type === value;\n }));\n\n return supportedInputTypes;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/** Cached result of whether the user's browser supports passive event listeners. */\nlet supportsPassiveEvents: boolean;\n\n/**\n * Checks whether the user's browser supports passive event listeners.\n * See: https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md\n */\nexport function supportsPassiveEventListeners(): boolean {\n if (supportsPassiveEvents == null && typeof window !== 'undefined') {\n try {\n window.addEventListener('test', null!, Object.defineProperty({}, 'passive', {\n get: () => supportsPassiveEvents = true\n }));\n } finally {\n supportsPassiveEvents = supportsPassiveEvents || false;\n }\n }\n\n return supportsPassiveEvents;\n}\n\n/**\n * Normalizes an `AddEventListener` object to something that can be passed\n * to `addEventListener` on any browser, no matter whether it supports the\n * `options` parameter.\n * @param options Object to be normalized.\n */\nexport function normalizePassiveListenerOptions(options: AddEventListenerOptions):\n AddEventListenerOptions | boolean {\n return supportsPassiveEventListeners() ? options : !!options.capture;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/** The possible ways the browser may handle the horizontal scroll axis in RTL languages. */\nexport const enum RtlScrollAxisType {\n /**\n * scrollLeft is 0 when scrolled all the way left and (scrollWidth - clientWidth) when scrolled\n * all the way right.\n */\n NORMAL,\n /**\n * scrollLeft is -(scrollWidth - clientWidth) when scrolled all the way left and 0 when scrolled\n * all the way right.\n */\n NEGATED,\n /**\n * scrollLeft is (scrollWidth - clientWidth) when scrolled all the way left and 0 when scrolled\n * all the way right.\n */\n INVERTED\n}\n\n/** Cached result of the way the browser handles the horizontal scroll axis in RTL mode. */\nlet rtlScrollAxisType: RtlScrollAxisType|undefined;\n\n/** Cached result of the check that indicates whether the browser supports scroll behaviors. */\nlet scrollBehaviorSupported: boolean|undefined;\n\n/** Check whether the browser supports scroll behaviors. */\nexport function supportsScrollBehavior(): boolean {\n if (scrollBehaviorSupported == null) {\n // If we're not in the browser, it can't be supported. Also check for `Element`, because\n // some projects stub out the global `document` during SSR which can throw us off.\n if (typeof document !== 'object' || !document || typeof Element !== 'function' || !Element) {\n scrollBehaviorSupported = false;\n return scrollBehaviorSupported;\n }\n\n // If the element can have a `scrollBehavior` style, we can be sure that it's supported.\n if ('scrollBehavior' in document.documentElement!.style) {\n scrollBehaviorSupported = true;\n } else {\n // At this point we have 3 possibilities: `scrollTo` isn't supported at all, it's\n // supported but it doesn't handle scroll behavior, or it has been polyfilled.\n const scrollToFunction: Function|undefined = Element.prototype.scrollTo;\n\n if (scrollToFunction) {\n // We can detect if the function has been polyfilled by calling `toString` on it. Native\n // functions are obfuscated using `[native code]`, whereas if it was overwritten we'd get\n // the actual function source. Via https://davidwalsh.name/detect-native-function. Consider\n // polyfilled functions as supporting scroll behavior.\n scrollBehaviorSupported = !/\\{\\s*\\[native code\\]\\s*\\}/.test(scrollToFunction.toString());\n } else {\n scrollBehaviorSupported = false;\n }\n }\n }\n\n return scrollBehaviorSupported;\n}\n\n/**\n * Checks the type of RTL scroll axis used by this browser. As of time of writing, Chrome is NORMAL,\n * Firefox & Safari are NEGATED, and IE & Edge are INVERTED.\n */\nexport function getRtlScrollAxisType(): RtlScrollAxisType {\n // We can't check unless we're on the browser. Just assume 'normal' if we're not.\n if (typeof document !== 'object' || !document) {\n return RtlScrollAxisType.NORMAL;\n }\n\n if (rtlScrollAxisType == null) {\n // Create a 1px wide scrolling container and a 2px wide content element.\n const scrollContainer = document.createElement('div');\n const containerStyle = scrollContainer.style;\n scrollContainer.dir = 'rtl';\n containerStyle.width = '1px';\n containerStyle.overflow = 'auto';\n containerStyle.visibility = 'hidden';\n containerStyle.pointerEvents = 'none';\n containerStyle.position = 'absolute';\n\n const content = document.createElement('div');\n const contentStyle = content.style;\n contentStyle.width = '2px';\n contentStyle.height = '1px';\n\n scrollContainer.appendChild(content);\n document.body.appendChild(scrollContainer);\n\n rtlScrollAxisType = RtlScrollAxisType.NORMAL;\n\n // The viewport starts scrolled all the way to the right in RTL mode. If we are in a NORMAL\n // browser this would mean that the scrollLeft should be 1. If it's zero instead we know we're\n // dealing with one of the other two types of browsers.\n if (scrollContainer.scrollLeft === 0) {\n // In a NEGATED browser the scrollLeft is always somewhere in [-maxScrollAmount, 0]. For an\n // INVERTED browser it is always somewhere in [0, maxScrollAmount]. We can determine which by\n // setting to the scrollLeft to 1. This is past the max for a NEGATED browser, so it will\n // return 0 when we read it again.\n scrollContainer.scrollLeft = 1;\n rtlScrollAxisType =\n scrollContainer.scrollLeft === 0 ? RtlScrollAxisType.NEGATED : RtlScrollAxisType.INVERTED;\n }\n\n scrollContainer.parentNode!.removeChild(scrollContainer);\n }\n return rtlScrollAxisType;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nlet shadowDomIsSupported: boolean;\n\n/** Checks whether the user's browser support Shadow DOM. */\nexport function _supportsShadowDom(): boolean {\n if (shadowDomIsSupported == null) {\n const head = typeof document !== 'undefined' ? document.head : null;\n shadowDomIsSupported = !!(head && ((head as any).createShadowRoot || head.attachShadow));\n }\n\n return shadowDomIsSupported;\n}\n\n/** Gets the shadow root of an element, if supported and the element is inside the Shadow DOM. */\nexport function _getShadowRoot(element: HTMLElement): ShadowRoot | null {\n if (_supportsShadowDom()) {\n const rootNode = element.getRootNode ? element.getRootNode() : null;\n\n // Note that this should be caught by `_supportsShadowDom`, but some\n // teams have been able to hit this code path on unsupported browsers.\n if (typeof ShadowRoot !== 'undefined' && ShadowRoot && rootNode instanceof ShadowRoot) {\n return rootNode;\n }\n }\n\n return null;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './platform';\nexport * from './platform-module';\nexport * from './features/input-types';\nexport * from './features/passive-listeners';\nexport * from './features/scrolling';\nexport * from './features/shadow-dom';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["isPlatformBrowser","Injectable","Inject","PLATFORM_ID","NgModule"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA;;;;;;;IAWA;IACA;IACA,IAAI,kBAA2B,CAAC;IAEhC;IACA;IACA;IACA;IACA;IACA,IAAI;QACF,kBAAkB,IAAI,OAAO,IAAI,KAAK,WAAW,IAAK,IAAY,CAAC,eAAe,CAAC,CAAC;KACrF;IAAC,WAAM;QACN,kBAAkB,GAAG,KAAK,CAAC;KAC5B;IAED;;;;;QAmDE,kBAAyC,WAAmB;YAAnB,gBAAW,GAAX,WAAW,CAAQ;;;;;YAzC5D,cAAS,GAAY,IAAI,CAAC,WAAW;gBACjCA,wBAAiB,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,OAAO,QAAQ,KAAK,QAAQ,IAAI,CAAC,CAAC,QAAQ,CAAC;;YAGrF,SAAI,GAAY,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;;YAGtE,YAAO,GAAY,IAAI,CAAC,SAAS,IAAI,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;;;YAIjF,UAAK,GAAY,IAAI,CAAC,SAAS,KAAK,CAAC,EAAG,MAAc,CAAC,MAAM,IAAI,kBAAkB,CAAC;gBAChF,OAAO,GAAG,KAAK,WAAW,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;;;;YAK/D,WAAM,GAAY,IAAI,CAAC,SAAS;gBAC5B,cAAc,CAAC,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src/cdk/platform/platform-module.ts","../../../../../src/cdk/platform/features/input-types.ts","../../../../../src/cdk/platform/features/passive-listeners.ts","../../../../../src/cdk/platform/features/scrolling.ts","../../../../../src/cdk/platform/features/shadow-dom.ts","../../../../../src/cdk/platform/public-api.ts","../../../../../src/cdk/platform/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Inject, Injectable, PLATFORM_ID} from '@angular/core';\nimport {isPlatformBrowser} from '@angular/common';\n\n// Whether the current platform supports the V8 Break Iterator. The V8 check\n// is necessary to detect all Blink based browsers.\nlet hasV8BreakIterator: boolean;\n\n// We need a try/catch around the reference to `Intl`, because accessing it in some cases can\n// cause IE to throw. These cases are tied to particular versions of Windows and can happen if\n// the consumer is providing a polyfilled `Map`. See:\n// https://github.com/Microsoft/ChakraCore/issues/3189\n// https://github.com/angular/components/issues/15687\ntry {\n hasV8BreakIterator = (typeof Intl !== 'undefined' && (Intl as any).v8BreakIterator);\n} catch {\n hasV8BreakIterator = false;\n}\n\n/**\n * Service to detect the current platform by comparing the userAgent strings and\n * checking browser-specific global properties.\n */\n@Injectable({providedIn: 'root'})\nexport class Platform {\n // We want to use the Angular platform check because if the Document is shimmed\n // without the navigator, the following checks will fail. This is preferred because\n // sometimes the Document may be shimmed without the user's knowledge or intention\n /** Whether the Angular application is being rendered in the browser. */\n isBrowser: boolean = this._platformId ?\n isPlatformBrowser(this._platformId) : typeof document === 'object' && !!document;\n\n /** Whether the current browser is Microsoft Edge. */\n EDGE: boolean = this.isBrowser && /(edge)/i.test(navigator.userAgent);\n\n /** Whether the current rendering engine is Microsoft Trident. */\n TRIDENT: boolean = this.isBrowser && /(msie|trident)/i.test(navigator.userAgent);\n\n // EdgeHTML and Trident mock Blink specific things and need to be excluded from this check.\n /** Whether the current rendering engine is Blink. */\n BLINK: boolean = this.isBrowser && (!!((window as any).chrome || hasV8BreakIterator) &&\n typeof CSS !== 'undefined' && !this.EDGE && !this.TRIDENT);\n\n // Webkit is part of the userAgent in EdgeHTML, Blink and Trident. Therefore we need to\n // ensure that Webkit runs standalone and is not used as another engine's base.\n /** Whether the current rendering engine is WebKit. */\n WEBKIT: boolean = this.isBrowser &&\n /AppleWebKit/i.test(navigator.userAgent) && !this.BLINK && !this.EDGE && !this.TRIDENT;\n\n /** Whether the current platform is Apple iOS. */\n IOS: boolean = this.isBrowser && /iPad|iPhone|iPod/.test(navigator.userAgent) &&\n !('MSStream' in window);\n\n // It's difficult to detect the plain Gecko engine, because most of the browsers identify\n // them self as Gecko-like browsers and modify the userAgent's according to that.\n // Since we only cover one explicit Firefox case, we can simply check for Firefox\n // instead of having an unstable check for Gecko.\n /** Whether the current browser is Firefox. */\n FIREFOX: boolean = this.isBrowser && /(firefox|minefield)/i.test(navigator.userAgent);\n\n /** Whether the current platform is Android. */\n // Trident on mobile adds the android platform to the userAgent to trick detections.\n ANDROID: boolean = this.isBrowser && /android/i.test(navigator.userAgent) && !this.TRIDENT;\n\n // Safari browsers will include the Safari keyword in their userAgent. Some browsers may fake\n // this and just place the Safari keyword in the userAgent. To be more safe about Safari every\n // Safari browser should also use Webkit as its layout engine.\n /** Whether the current browser is Safari. */\n SAFARI: boolean = this.isBrowser && /safari/i.test(navigator.userAgent) && this.WEBKIT;\n\n constructor(@Inject(PLATFORM_ID) private _platformId: Object) {}\n}\n\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\n\n\n@NgModule({})\nexport class PlatformModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/** Cached result Set of input types support by the current browser. */\nlet supportedInputTypes: Set<string>;\n\n/** Types of `<input>` that *might* be supported. */\nconst candidateInputTypes = [\n // `color` must come first. Chrome 56 shows a warning if we change the type to `color` after\n // first changing it to something else:\n // The specified value \"\" does not conform to the required format.\n // The format is \"#rrggbb\" where rr, gg, bb are two-digit hexadecimal numbers.\n 'color',\n 'button',\n 'checkbox',\n 'date',\n 'datetime-local',\n 'email',\n 'file',\n 'hidden',\n 'image',\n 'month',\n 'number',\n 'password',\n 'radio',\n 'range',\n 'reset',\n 'search',\n 'submit',\n 'tel',\n 'text',\n 'time',\n 'url',\n 'week',\n];\n\n/** @returns The input types supported by this browser. */\nexport function getSupportedInputTypes(): Set<string> {\n // Result is cached.\n if (supportedInputTypes) {\n return supportedInputTypes;\n }\n\n // We can't check if an input type is not supported until we're on the browser, so say that\n // everything is supported when not on the browser. We don't use `Platform` here since it's\n // just a helper function and can't inject it.\n if (typeof document !== 'object' || !document) {\n supportedInputTypes = new Set(candidateInputTypes);\n return supportedInputTypes;\n }\n\n let featureTestInput = document.createElement('input');\n supportedInputTypes = new Set(candidateInputTypes.filter(value => {\n featureTestInput.setAttribute('type', value);\n return featureTestInput.type === value;\n }));\n\n return supportedInputTypes;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/** Cached result of whether the user's browser supports passive event listeners. */\nlet supportsPassiveEvents: boolean;\n\n/**\n * Checks whether the user's browser supports passive event listeners.\n * See: https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md\n */\nexport function supportsPassiveEventListeners(): boolean {\n if (supportsPassiveEvents == null && typeof window !== 'undefined') {\n try {\n window.addEventListener('test', null!, Object.defineProperty({}, 'passive', {\n get: () => supportsPassiveEvents = true\n }));\n } finally {\n supportsPassiveEvents = supportsPassiveEvents || false;\n }\n }\n\n return supportsPassiveEvents;\n}\n\n/**\n * Normalizes an `AddEventListener` object to something that can be passed\n * to `addEventListener` on any browser, no matter whether it supports the\n * `options` parameter.\n * @param options Object to be normalized.\n */\nexport function normalizePassiveListenerOptions(options: AddEventListenerOptions):\n AddEventListenerOptions | boolean {\n return supportsPassiveEventListeners() ? options : !!options.capture;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/** The possible ways the browser may handle the horizontal scroll axis in RTL languages. */\nexport const enum RtlScrollAxisType {\n /**\n * scrollLeft is 0 when scrolled all the way left and (scrollWidth - clientWidth) when scrolled\n * all the way right.\n */\n NORMAL,\n /**\n * scrollLeft is -(scrollWidth - clientWidth) when scrolled all the way left and 0 when scrolled\n * all the way right.\n */\n NEGATED,\n /**\n * scrollLeft is (scrollWidth - clientWidth) when scrolled all the way left and 0 when scrolled\n * all the way right.\n */\n INVERTED\n}\n\n/** Cached result of the way the browser handles the horizontal scroll axis in RTL mode. */\nlet rtlScrollAxisType: RtlScrollAxisType|undefined;\n\n/** Cached result of the check that indicates whether the browser supports scroll behaviors. */\nlet scrollBehaviorSupported: boolean|undefined;\n\n/** Check whether the browser supports scroll behaviors. */\nexport function supportsScrollBehavior(): boolean {\n if (scrollBehaviorSupported == null) {\n // If we're not in the browser, it can't be supported. Also check for `Element`, because\n // some projects stub out the global `document` during SSR which can throw us off.\n if (typeof document !== 'object' || !document || typeof Element !== 'function' || !Element) {\n scrollBehaviorSupported = false;\n return scrollBehaviorSupported;\n }\n\n // If the element can have a `scrollBehavior` style, we can be sure that it's supported.\n if ('scrollBehavior' in document.documentElement!.style) {\n scrollBehaviorSupported = true;\n } else {\n // At this point we have 3 possibilities: `scrollTo` isn't supported at all, it's\n // supported but it doesn't handle scroll behavior, or it has been polyfilled.\n const scrollToFunction: Function|undefined = Element.prototype.scrollTo;\n\n if (scrollToFunction) {\n // We can detect if the function has been polyfilled by calling `toString` on it. Native\n // functions are obfuscated using `[native code]`, whereas if it was overwritten we'd get\n // the actual function source. Via https://davidwalsh.name/detect-native-function. Consider\n // polyfilled functions as supporting scroll behavior.\n scrollBehaviorSupported = !/\\{\\s*\\[native code\\]\\s*\\}/.test(scrollToFunction.toString());\n } else {\n scrollBehaviorSupported = false;\n }\n }\n }\n\n return scrollBehaviorSupported;\n}\n\n/**\n * Checks the type of RTL scroll axis used by this browser. As of time of writing, Chrome is NORMAL,\n * Firefox & Safari are NEGATED, and IE & Edge are INVERTED.\n */\nexport function getRtlScrollAxisType(): RtlScrollAxisType {\n // We can't check unless we're on the browser. Just assume 'normal' if we're not.\n if (typeof document !== 'object' || !document) {\n return RtlScrollAxisType.NORMAL;\n }\n\n if (rtlScrollAxisType == null) {\n // Create a 1px wide scrolling container and a 2px wide content element.\n const scrollContainer = document.createElement('div');\n const containerStyle = scrollContainer.style;\n scrollContainer.dir = 'rtl';\n containerStyle.width = '1px';\n containerStyle.overflow = 'auto';\n containerStyle.visibility = 'hidden';\n containerStyle.pointerEvents = 'none';\n containerStyle.position = 'absolute';\n\n const content = document.createElement('div');\n const contentStyle = content.style;\n contentStyle.width = '2px';\n contentStyle.height = '1px';\n\n scrollContainer.appendChild(content);\n document.body.appendChild(scrollContainer);\n\n rtlScrollAxisType = RtlScrollAxisType.NORMAL;\n\n // The viewport starts scrolled all the way to the right in RTL mode. If we are in a NORMAL\n // browser this would mean that the scrollLeft should be 1. If it's zero instead we know we're\n // dealing with one of the other two types of browsers.\n if (scrollContainer.scrollLeft === 0) {\n // In a NEGATED browser the scrollLeft is always somewhere in [-maxScrollAmount, 0]. For an\n // INVERTED browser it is always somewhere in [0, maxScrollAmount]. We can determine which by\n // setting to the scrollLeft to 1. This is past the max for a NEGATED browser, so it will\n // return 0 when we read it again.\n scrollContainer.scrollLeft = 1;\n rtlScrollAxisType =\n scrollContainer.scrollLeft === 0 ? RtlScrollAxisType.NEGATED : RtlScrollAxisType.INVERTED;\n }\n\n scrollContainer.parentNode!.removeChild(scrollContainer);\n }\n return rtlScrollAxisType;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nlet shadowDomIsSupported: boolean;\n\n/** Checks whether the user's browser support Shadow DOM. */\nexport function _supportsShadowDom(): boolean {\n if (shadowDomIsSupported == null) {\n const head = typeof document !== 'undefined' ? document.head : null;\n shadowDomIsSupported = !!(head && ((head as any).createShadowRoot || head.attachShadow));\n }\n\n return shadowDomIsSupported;\n}\n\n/** Gets the shadow root of an element, if supported and the element is inside the Shadow DOM. */\nexport function _getShadowRoot(element: HTMLElement): ShadowRoot | null {\n if (_supportsShadowDom()) {\n const rootNode = element.getRootNode ? element.getRootNode() : null;\n\n // Note that this should be caught by `_supportsShadowDom`, but some\n // teams have been able to hit this code path on unsupported browsers.\n if (typeof ShadowRoot !== 'undefined' && ShadowRoot && rootNode instanceof ShadowRoot) {\n return rootNode;\n }\n }\n\n return null;\n}\n\n/**\n * Gets the currently-focused element on the page while\n * also piercing through Shadow DOM boundaries.\n */\nexport function _getFocusedElementPierceShadowDom(): HTMLElement | null {\n let activeElement = typeof document !== 'undefined' && document ?\n document.activeElement as HTMLElement | null : null;\n\n while (activeElement && activeElement.shadowRoot) {\n const newActiveElement = activeElement.shadowRoot.activeElement as HTMLElement | null;\n if (newActiveElement === activeElement) {\n break;\n } else {\n activeElement = newActiveElement;\n }\n }\n\n return activeElement;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './platform';\nexport * from './platform-module';\nexport * from './features/input-types';\nexport * from './features/passive-listeners';\nexport * from './features/scrolling';\nexport * from './features/shadow-dom';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["isPlatformBrowser","Injectable","Inject","PLATFORM_ID","NgModule"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA;;;;;;;IAWA;IACA;IACA,IAAI,kBAA2B,CAAC;IAEhC;IACA;IACA;IACA;IACA;IACA,IAAI;QACF,kB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list of async values in parallel (i.e. via Promise.all) while batching change
|
|
414
|
+
* detection over the entire operation such that change detection occurs exactly once before
|
|
415
|
+
* resolving the values and once after.
|
|
416
|
+
* @param values A getter for the async values to resolve in parallel with batched change detection.
|
|
417
|
+
* @return The resolved values.
|
|
418
|
+
*/
|
|
412
419
|
function parallel(values) {
|
|
413
420
|
return __awaiter(this, void 0, void 0, function () {
|
|
414
421
|
return __generator(this, function (_b) {
|
|
@@ -743,10 +750,20 @@
|
|
|
743
750
|
};
|
|
744
751
|
/** Gets the selector used to find candidate elements. */
|
|
745
752
|
HarnessPredicate.prototype.getSelector = function () {
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
753
|
+
// We don't have to go through the extra trouble if there are no ancestors.
|
|
754
|
+
if (!this._ancestor) {
|
|
755
|
+
return (this.harnessType.hostSelector || '').trim();
|
|
756
|
+
}
|
|
757
|
+
var _b = __read(_splitAndEscapeSelector(this._ancestor), 2), ancestors = _b[0], ancestorPlaceholders = _b[1];
|
|
758
|
+
var _c = __read(_splitAndEscapeSelector(this.harnessType.hostSelector || ''), 2), selectors = _c[0], selectorPlaceholders = _c[1];
|
|
759
|
+
var result = [];
|
|
760
|
+
// We have to add the ancestor to each part of the host compound selector, otherwise we can get
|
|
761
|
+
// incorrect results. E.g. `.ancestor .a, .ancestor .b` vs `.ancestor .a, .b`.
|
|
762
|
+
ancestors.forEach(function (escapedAncestor) {
|
|
763
|
+
var ancestor = _restoreSelector(escapedAncestor, ancestorPlaceholders);
|
|
764
|
+
return selectors.forEach(function (escapedSelector) { return result.push(ancestor + " " + _restoreSelector(escapedSelector, selectorPlaceholders)); });
|
|
765
|
+
});
|
|
766
|
+
return result.join(', ');
|
|
750
767
|
};
|
|
751
768
|
/** Adds base options common to all harness types. */
|
|
752
769
|
HarnessPredicate.prototype._addBaseOptions = function (options) {
|
|
@@ -789,6 +806,33 @@
|
|
|
789
806
|
return '{...}';
|
|
790
807
|
}
|
|
791
808
|
}
|
|
809
|
+
/**
|
|
810
|
+
* Splits up a compound selector into its parts and escapes any quoted content. The quoted content
|
|
811
|
+
* has to be escaped, because it can contain commas which will throw throw us off when trying to
|
|
812
|
+
* split it.
|
|
813
|
+
* @param selector Selector to be split.
|
|
814
|
+
* @returns The escaped string where any quoted content is replaced with a placeholder. E.g.
|
|
815
|
+
* `[foo="bar"]` turns into `[foo=__cdkPlaceholder-0__]`. Use `_restoreSelector` to restore
|
|
816
|
+
* the placeholders.
|
|
817
|
+
*/
|
|
818
|
+
function _splitAndEscapeSelector(selector) {
|
|
819
|
+
var placeholders = [];
|
|
820
|
+
// Note that the regex doesn't account for nested quotes so something like `"ab'cd'e"` will be
|
|
821
|
+
// considered as two blocks. It's a bit of an edge case, but if we find that it's a problem,
|
|
822
|
+
// we can make it a bit smarter using a loop. Use this for now since it's more readable and
|
|
823
|
+
// compact. More complete implementation:
|
|
824
|
+
// https://github.com/angular/angular/blob/bd34bc9e89f18a/packages/compiler/src/shadow_css.ts#L655
|
|
825
|
+
var result = selector.replace(/(["'][^["']*["'])/g, function (_, keep) {
|
|
826
|
+
var replaceBy = "__cdkPlaceholder-" + placeholders.length + "__";
|
|
827
|
+
placeholders.push(keep);
|
|
828
|
+
return replaceBy;
|
|
829
|
+
});
|
|
830
|
+
return [result.split(',').map(function (part) { return part.trim(); }), placeholders];
|
|
831
|
+
}
|
|
832
|
+
/** Restores a selector whose content was escaped in `_splitAndEscapeSelector`. */
|
|
833
|
+
function _restoreSelector(selector, placeholders) {
|
|
834
|
+
return selector.replace(/__cdkPlaceholder-(\d+)__/g, function (_, index) { return placeholders[+index]; });
|
|
835
|
+
}
|
|
792
836
|
|
|
793
837
|
/**
|
|
794
838
|
* Base harness environment class that can be extended to allow `ComponentHarness`es to be used in
|