@angular/cdk 7.0.0-rc.1 → 7.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.scss +32 -0
- package/_overlay.scss +141 -0
- package/_text-field.scss +63 -0
- package/a11y/typings/aria-describer/aria-describer.d.ts +2 -2
- package/a11y/typings/focus-monitor/focus-monitor.d.ts +2 -2
- package/a11y/typings/index.metadata.json +1 -1
- package/a11y/typings/key-manager/list-key-manager.d.ts +1 -1
- package/a11y/typings/live-announcer/live-announcer.d.ts +2 -2
- package/bundles/cdk-a11y.umd.js +26 -21
- package/bundles/cdk-a11y.umd.js.map +1 -1
- package/bundles/cdk-a11y.umd.min.js +1 -1
- package/bundles/cdk-a11y.umd.min.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.js +126 -81
- package/bundles/cdk-drag-drop.umd.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.min.js +1 -1
- package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
- package/bundles/cdk-overlay.umd.js +22 -22
- package/bundles/cdk-overlay.umd.js.map +1 -1
- package/bundles/cdk-overlay.umd.min.js.map +1 -1
- package/bundles/cdk-platform.umd.js +13 -2
- package/bundles/cdk-platform.umd.js.map +1 -1
- package/bundles/cdk-platform.umd.min.js +1 -1
- package/bundles/cdk-platform.umd.min.js.map +1 -1
- package/bundles/cdk-scrolling.umd.js +10 -6
- package/bundles/cdk-scrolling.umd.js.map +1 -1
- package/bundles/cdk-scrolling.umd.min.js +1 -1
- package/bundles/cdk-scrolling.umd.min.js.map +1 -1
- package/bundles/cdk-stepper.umd.js +1 -1
- package/bundles/cdk-stepper.umd.js.map +1 -1
- package/bundles/cdk-stepper.umd.min.js.map +1 -1
- package/bundles/cdk-table.umd.js +5 -1
- package/bundles/cdk-table.umd.js.map +1 -1
- package/bundles/cdk-table.umd.min.js +1 -1
- package/bundles/cdk-table.umd.min.js.map +1 -1
- package/bundles/cdk-text-field.umd.js +10 -3
- package/bundles/cdk-text-field.umd.js.map +1 -1
- package/bundles/cdk-text-field.umd.min.js +1 -1
- package/bundles/cdk-text-field.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/drag-drop/typings/drag-events.d.ts +5 -5
- package/drag-drop/typings/drag-handle.d.ts +3 -1
- package/drag-drop/typings/drag-parent.d.ts +15 -0
- package/drag-drop/typings/drag-utils.d.ts +10 -0
- package/drag-drop/typings/drag.d.ts +6 -11
- package/drag-drop/typings/{drop-container.d.ts → drop-list-container.d.ts} +5 -5
- package/{typings/drag-drop/drop.d.ts → drag-drop/typings/drop-list.d.ts} +7 -7
- package/drag-drop/typings/index.d.ts +1 -0
- package/drag-drop/typings/index.metadata.json +1 -1
- package/drag-drop/typings/public-api.d.ts +2 -2
- package/esm2015/a11y.js +25 -20
- package/esm2015/a11y.js.map +1 -1
- package/esm2015/cdk.js +1 -1
- package/esm2015/cdk.js.map +1 -1
- package/esm2015/drag-drop.js +108 -57
- package/esm2015/drag-drop.js.map +1 -1
- package/esm2015/overlay.js +12 -12
- package/esm2015/overlay.js.map +1 -1
- package/esm2015/platform.js +13 -3
- package/esm2015/platform.js.map +1 -1
- package/esm2015/scrolling.js +10 -6
- package/esm2015/scrolling.js.map +1 -1
- package/esm2015/stepper.js +1 -1
- package/esm2015/stepper.js.map +1 -1
- package/esm2015/table.js +5 -1
- package/esm2015/table.js.map +1 -1
- package/esm2015/text-field.js +11 -4
- package/esm2015/text-field.js.map +1 -1
- package/esm5/a11y.es5.js +27 -22
- package/esm5/a11y.es5.js.map +1 -1
- package/esm5/cdk.es5.js +1 -1
- package/esm5/cdk.es5.js.map +1 -1
- package/esm5/drag-drop.es5.js +124 -81
- package/esm5/drag-drop.es5.js.map +1 -1
- package/esm5/overlay.es5.js +22 -22
- package/esm5/overlay.es5.js.map +1 -1
- package/esm5/platform.es5.js +13 -3
- package/esm5/platform.es5.js.map +1 -1
- package/esm5/scrolling.es5.js +10 -6
- package/esm5/scrolling.es5.js.map +1 -1
- package/esm5/stepper.es5.js +1 -1
- package/esm5/stepper.es5.js.map +1 -1
- package/esm5/table.es5.js +5 -1
- package/esm5/table.es5.js.map +1 -1
- package/esm5/text-field.es5.js +11 -4
- package/esm5/text-field.es5.js.map +1 -1
- package/overlay/typings/keyboard/overlay-keyboard-dispatcher.d.ts +2 -2
- package/overlay/typings/overlay-container.d.ts +2 -2
- package/overlay/typings/overlay-directives.d.ts +1 -1
- package/overlay/typings/overlay-module.d.ts +1 -1
- package/overlay/typings/position/connected-position-strategy.d.ts +1 -1
- package/overlay/typings/position/global-position-strategy.d.ts +2 -2
- package/overlay/typings/position/overlay-position-builder.d.ts +1 -1
- package/package.json +6 -6
- package/platform/typings/features/passive-listeners.d.ts +7 -0
- package/platform/typings/index.metadata.json +1 -1
- package/platform/typings/platform.d.ts +1 -1
- package/schematics/index.d.ts +0 -1
- package/schematics/index.js +0 -1
- package/schematics/index.js.map +1 -1
- package/schematics/ng-add/index.d.ts +4 -0
- package/schematics/ng-add/index.js +7 -3
- package/schematics/ng-add/index.js.map +1 -1
- package/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html +4 -4
- package/schematics/ng-generate/drag-drop/schema.json +2 -1
- package/schematics/ng-update/index.js +8 -2
- package/schematics/ng-update/index.js.map +1 -1
- package/schematics/utils/build-component.d.ts +7 -0
- package/schematics/utils/build-component.js +4 -5
- package/schematics/utils/build-component.js.map +1 -1
- package/schematics/utils/html-head-element.d.ts +13 -0
- package/schematics/utils/html-head-element.js +54 -0
- package/schematics/utils/html-head-element.js.map +1 -0
- package/schematics/utils/index.d.ts +1 -0
- package/schematics/utils/index.js +1 -0
- package/schematics/utils/index.js.map +1 -1
- package/scrolling/typings/index.metadata.json +1 -1
- package/scrolling/typings/scroll-dispatcher.d.ts +2 -2
- package/scrolling/typings/viewport-ruler.d.ts +2 -2
- package/table/typings/index.metadata.json +1 -1
- package/text-field/typings/autosize.d.ts +7 -1
- package/text-field/typings/index.metadata.json +1 -1
- package/typings/a11y/aria-describer/aria-describer.d.ts +2 -2
- package/typings/a11y/focus-monitor/focus-monitor.d.ts +2 -2
- package/typings/a11y/index.metadata.json +1 -1
- package/typings/a11y/key-manager/list-key-manager.d.ts +1 -1
- package/typings/a11y/live-announcer/live-announcer.d.ts +2 -2
- package/typings/drag-drop/drag-events.d.ts +5 -5
- package/typings/drag-drop/drag-handle.d.ts +3 -1
- package/typings/drag-drop/drag-parent.d.ts +15 -0
- package/typings/drag-drop/drag-utils.d.ts +10 -0
- package/typings/drag-drop/drag.d.ts +6 -11
- package/typings/drag-drop/{drop-container.d.ts → drop-list-container.d.ts} +5 -5
- package/{drag-drop/typings/drop.d.ts → typings/drag-drop/drop-list.d.ts} +7 -7
- package/typings/drag-drop/index.d.ts +1 -0
- package/typings/drag-drop/index.metadata.json +1 -1
- package/typings/drag-drop/public-api.d.ts +2 -2
- package/typings/esm5/a11y/aria-describer/aria-describer.d.ts +2 -2
- package/typings/esm5/a11y/focus-monitor/focus-monitor.d.ts +2 -2
- package/typings/esm5/a11y/index.metadata.json +1 -1
- package/typings/esm5/a11y/key-manager/list-key-manager.d.ts +1 -1
- package/typings/esm5/a11y/live-announcer/live-announcer.d.ts +2 -2
- package/typings/esm5/drag-drop/drag-events.d.ts +5 -5
- package/typings/esm5/drag-drop/drag-handle.d.ts +3 -1
- package/typings/esm5/drag-drop/drag-parent.d.ts +15 -0
- package/typings/esm5/drag-drop/drag-utils.d.ts +10 -0
- package/typings/esm5/drag-drop/drag.d.ts +6 -11
- package/typings/esm5/drag-drop/{drop-container.d.ts → drop-list-container.d.ts} +5 -5
- package/typings/esm5/drag-drop/{drop.d.ts → drop-list.d.ts} +7 -7
- package/typings/esm5/drag-drop/index.d.ts +1 -0
- package/typings/esm5/drag-drop/index.metadata.json +1 -1
- package/typings/esm5/drag-drop/public-api.d.ts +2 -2
- package/typings/esm5/index.metadata.json +1 -1
- package/typings/esm5/overlay/keyboard/overlay-keyboard-dispatcher.d.ts +2 -2
- package/typings/esm5/overlay/overlay-container.d.ts +2 -2
- package/typings/esm5/overlay/overlay-directives.d.ts +1 -1
- package/typings/esm5/overlay/overlay-module.d.ts +1 -1
- package/typings/esm5/overlay/position/connected-position-strategy.d.ts +1 -1
- package/typings/esm5/overlay/position/global-position-strategy.d.ts +2 -2
- package/typings/esm5/overlay/position/overlay-position-builder.d.ts +1 -1
- package/typings/esm5/platform/features/passive-listeners.d.ts +7 -0
- package/typings/esm5/platform/index.metadata.json +1 -1
- package/typings/esm5/platform/platform.d.ts +1 -1
- package/typings/esm5/scrolling/index.metadata.json +1 -1
- package/typings/esm5/scrolling/scroll-dispatcher.d.ts +2 -2
- package/typings/esm5/scrolling/viewport-ruler.d.ts +2 -2
- package/typings/esm5/table/index.metadata.json +1 -1
- package/typings/esm5/text-field/autosize.d.ts +7 -1
- package/typings/esm5/text-field/index.metadata.json +1 -1
- package/typings/index.metadata.json +1 -1
- package/typings/overlay/keyboard/overlay-keyboard-dispatcher.d.ts +2 -2
- package/typings/overlay/overlay-container.d.ts +2 -2
- package/typings/overlay/overlay-directives.d.ts +1 -1
- package/typings/overlay/overlay-module.d.ts +1 -1
- package/typings/overlay/position/connected-position-strategy.d.ts +1 -1
- package/typings/overlay/position/global-position-strategy.d.ts +2 -2
- package/typings/overlay/position/overlay-position-builder.d.ts +1 -1
- package/typings/platform/features/passive-listeners.d.ts +7 -0
- package/typings/platform/index.metadata.json +1 -1
- package/typings/platform/platform.d.ts +1 -1
- package/typings/schematics/index.d.ts +0 -1
- package/typings/schematics/ng-add/index.d.ts +4 -0
- package/typings/schematics/utils/build-component.d.ts +7 -0
- package/typings/schematics/utils/html-head-element.d.ts +13 -0
- package/typings/schematics/utils/index.d.ts +1 -0
- package/typings/scrolling/index.metadata.json +1 -1
- package/typings/scrolling/scroll-dispatcher.d.ts +2 -2
- package/typings/scrolling/viewport-ruler.d.ts +2 -2
- package/typings/table/index.metadata.json +1 -1
- package/typings/text-field/autosize.d.ts +7 -1
- package/typings/text-field/index.metadata.json +1 -1
- package/schematics/testing/index.d.ts +0 -9
- package/schematics/testing/index.js +0 -15
- package/schematics/testing/index.js.map +0 -1
- package/schematics/testing/post-scheduled-tasks.d.ts +0 -18
- package/schematics/testing/post-scheduled-tasks.js +0 -35
- package/schematics/testing/post-scheduled-tasks.js.map +0 -1
- package/schematics/testing/test-app.d.ts +0 -10
- package/schematics/testing/test-app.js +0 -20
- package/schematics/testing/test-app.js.map +0 -1
- package/typings/schematics/testing/index.d.ts +0 -9
- package/typings/schematics/testing/post-scheduled-tasks.d.ts +0 -18
- package/typings/schematics/testing/test-app.d.ts +0 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-field.js","sources":["../../../src/cdk/text-field/text-field-module.ts","../../../src/cdk/text-field/autosize.ts","../../../src/cdk/text-field/autofill.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 {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\nimport {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {\n Directive,\n ElementRef,\n Input,\n AfterViewInit,\n DoCheck,\n OnDestroy,\n NgZone,\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 '(input)': '_noopInputHandler()',\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 | null;\n private readonly _destroyed = new Subject<void>();\n\n private _minRows: number;\n private _maxRows: number;\n private _enabled: boolean = true;\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 = 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 = 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 of the value changed since these calculations can be expensive.\n if (value === this._previousValue && !force) {\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 // On Firefox resizing the textarea will prevent it from scrolling to the caret position.\n // We need to re-set the selection in order for it to scroll to the proper position.\n if (typeof requestAnimationFrame !== 'undefined') {\n this._ngZone.runOutsideAngular(() => requestAnimationFrame(() => {\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\n this._previousValue = value;\n }\n\n /**\n * Resets the textarea to it's 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 return;\n }\n this._textareaElement.style.height = this._initialHeight;\n }\n\n _noopInputHandler() {\n // no-op handler that ensures we're running change detection on input events.\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 {Platform, supportsPassiveEventListeners} 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 {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: any = supportsPassiveEventListeners() ? {passive: true} : false;\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 = elementOrRef instanceof ElementRef ? elementOrRef.nativeElement : 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 = elementOrRef instanceof ElementRef ? elementOrRef.nativeElement : 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"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AEuCA,MAAM,eAAe,GAAQ,6BAA6B,EAAE,GAAG,EAAC,OAAO,EAAE,IAAI,EAAC,GAAG,KAAK,CAAC;;;;;;AASvF,AAAA,MAAa,eAAe,CAA5B;;;;;IAGE,WAAF,CAAsB,SAAmB,EAAU,OAAe,EAAlE;QAAsB,IAAtB,CAAA,SAA+B,GAAT,SAAS,CAAU;QAAU,IAAnD,CAAA,OAA0D,GAAP,OAAO,CAAQ;QAFlE,IAAA,CAAA,kBAAA,GAA+B,IAAI,GAAG,EAAiC,CAAvE;KAEsE;;;;;IAgBpE,OAAO,CAAC,YAA2C,EAArD;QACI,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE;YAC7B,OAAO,KAAK,CAAC;SACd;;QAED,MAAM,OAAO,GAAG,YAAY,YAAY,UAAU,GAAG,YAAY,CAAC,aAAa,GAAG,YAAY,CAAC;;QAC/F,MAAM,IAAI,GAAG,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAElD,IA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AA,CAAS,qBAAqB,EAA9B,EAAA,CAAA;;;;;;;AD7CA,MAAa,eAAe,CAA5B;;;IALA,EAAA,IAAA,EAAC,QAAQ,EAAT,IAAA,EAAA,CAAU;gBACR,YAAY,EAAE,CAAC,WAAW,EAAE,mBAAmB,CAAC;gBAChD,OAAO,EAAE,CAAC,cAAc,CAAC;gBACzB,OAAO,EAAE,CAAC,WAAW,EAAE,mBAAmB,CAAC;aAC5C,EAAD,EAAA;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"text-field.js","sources":["../../../src/cdk/text-field/text-field-module.ts","../../../src/cdk/text-field/autosize.ts","../../../src/cdk/text-field/autofill.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 {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\nimport {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {\n Directive,\n ElementRef,\n Input,\n AfterViewInit,\n DoCheck,\n OnDestroy,\n NgZone,\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 '(input)': '_noopInputHandler()',\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 | null;\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 = 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 = 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 // On Firefox resizing the textarea will prevent it from scrolling to the caret position.\n // We need to re-set the selection in order for it to scroll to the proper position.\n if (typeof requestAnimationFrame !== 'undefined') {\n this._ngZone.runOutsideAngular(() => requestAnimationFrame(() => {\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\n this._previousValue = value;\n this._previousMinRows = this._minRows;\n }\n\n /**\n * Resets the textarea to it's 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 return;\n }\n this._textareaElement.style.height = this._initialHeight;\n }\n\n _noopInputHandler() {\n // no-op handler that ensures we're running change detection on input events.\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 {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 {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 = elementOrRef instanceof ElementRef ? elementOrRef.nativeElement : 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 = elementOrRef instanceof ElementRef ? elementOrRef.nativeElement : 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"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AEuCA,MAAM,eAAe,GAAG,+BAA+B,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC;;;;;;AASzE,AAAA,MAAa,eAAe,CAA5B;;;;;IAGE,WAAF,CAAsB,SAAmB,EAAU,OAAe,EAAlE;QAAsB,IAAtB,CAAA,SAA+B,GAAT,SAAS,CAAU;QAAU,IAAnD,CAAA,OAA0D,GAAP,OAAO,CAAQ;QAFlE,IAAA,CAAA,kBAAA,GAA+B,IAAI,GAAG,EAAiC,CAAvE;KAEsE;;;;;IAgBpE,OAAO,CAAC,YAA2C,EAArD;QACI,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE;YAC7B,OAAO,KAAK,CAAC;SACd;;QAED,MAAM,OAAO,GAAG,YAAY,YAAY,UAAU,GAAG,YAAY,CAAC,aAAa,GAAG,YAAY,CAAC;;QAC/F,MAAM,IAAI,GAAG,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAElD,IAAI,IAAI,EAAE;YACR,OAAO,IAAI,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,IAAA,EAAG,KAAK,EAAR,IAAA,EAAA,CAAS,oBAAoB,EAA7B,EAAA,CAAA;IAQA,OAAA,EAAA,CAAA,EAAA,IAAA,EAAG,KAAK,EAAR,IAAA,EAAA,CAAS,qBAAqB,EAA9B,EAAA,CAAA;;;;;;;ADpDA,MAAa,eAAe,CAA5B;;;IALA,EAAA,IAAA,EAAC,QAAQ,EAAT,IAAA,EAAA,CAAU;gBACR,YAAY,EAAE,CAAC,WAAW,EAAE,mBAAmB,CAAC;gBAChD,OAAO,EAAE,CAAC,cAAc,CAAC;gBACzB,OAAO,EAAE,CAAC,WAAW,EAAE,mBAAmB,CAAC;aAC5C,EAAD,EAAA;;;;;;;;;;;;;;;"}
|
package/esm5/a11y.es5.js
CHANGED
|
@@ -11,7 +11,7 @@ import { Subject, Subscription, of } from 'rxjs';
|
|
|
11
11
|
import { UP_ARROW, DOWN_ARROW, LEFT_ARROW, RIGHT_ARROW, TAB, A, Z, ZERO, NINE } from '@angular/cdk/keycodes';
|
|
12
12
|
import { debounceTime, filter, map, tap, take } from 'rxjs/operators';
|
|
13
13
|
import { __extends } from 'tslib';
|
|
14
|
-
import { Platform,
|
|
14
|
+
import { Platform, normalizePassiveListenerOptions, PlatformModule } from '@angular/cdk/platform';
|
|
15
15
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
16
16
|
import { ContentObserver, ObserversModule } from '@angular/cdk/observers';
|
|
17
17
|
|
|
@@ -377,7 +377,7 @@ var AriaDescriber = /** @class */ (function () {
|
|
|
377
377
|
return AriaDescriber;
|
|
378
378
|
}());
|
|
379
379
|
/**
|
|
380
|
-
* \@docs-private \@deprecated \@breaking-change
|
|
380
|
+
* \@docs-private \@deprecated \@breaking-change 8.0.0
|
|
381
381
|
* @param {?} parentDispatcher
|
|
382
382
|
* @param {?} _document
|
|
383
383
|
* @return {?}
|
|
@@ -386,7 +386,7 @@ function ARIA_DESCRIBER_PROVIDER_FACTORY(parentDispatcher, _document) {
|
|
|
386
386
|
return parentDispatcher || new AriaDescriber(_document);
|
|
387
387
|
}
|
|
388
388
|
/** *
|
|
389
|
-
* \@docs-private \@deprecated \@breaking-change
|
|
389
|
+
* \@docs-private \@deprecated \@breaking-change 8.0.0
|
|
390
390
|
@type {?} */
|
|
391
391
|
var ARIA_DESCRIBER_PROVIDER = {
|
|
392
392
|
// If there is already an AriaDescriber available, use that. Otherwise, provide a new one.
|
|
@@ -768,19 +768,19 @@ ListKeyManager = /** @class */ (function () {
|
|
|
768
768
|
* Allows setting of the activeItemIndex without any other effects.
|
|
769
769
|
* @param index The new activeItemIndex.
|
|
770
770
|
* @deprecated Use `updateActiveItem` instead.
|
|
771
|
-
* @breaking-change
|
|
771
|
+
* @breaking-change 8.0.0
|
|
772
772
|
*/
|
|
773
773
|
/**
|
|
774
774
|
* Allows setting of the activeItemIndex without any other effects.
|
|
775
775
|
* @deprecated Use `updateActiveItem` instead.
|
|
776
|
-
* \@breaking-change
|
|
776
|
+
* \@breaking-change 8.0.0
|
|
777
777
|
* @param {?} index The new activeItemIndex.
|
|
778
778
|
* @return {?}
|
|
779
779
|
*/
|
|
780
780
|
ListKeyManager.prototype.updateActiveItemIndex = /**
|
|
781
781
|
* Allows setting of the activeItemIndex without any other effects.
|
|
782
782
|
* @deprecated Use `updateActiveItem` instead.
|
|
783
|
-
* \@breaking-change
|
|
783
|
+
* \@breaking-change 8.0.0
|
|
784
784
|
* @param {?} index The new activeItemIndex.
|
|
785
785
|
* @return {?}
|
|
786
786
|
*/
|
|
@@ -1174,7 +1174,7 @@ function getFrameElement(window) {
|
|
|
1174
1174
|
try {
|
|
1175
1175
|
return /** @type {?} */ (window.frameElement);
|
|
1176
1176
|
}
|
|
1177
|
-
catch (
|
|
1177
|
+
catch (_a) {
|
|
1178
1178
|
return null;
|
|
1179
1179
|
}
|
|
1180
1180
|
}
|
|
@@ -1505,16 +1505,16 @@ FocusTrap = /** @class */ (function () {
|
|
|
1505
1505
|
("[cdkFocusRegion" + bound + "], ") +
|
|
1506
1506
|
("[cdk-focus-" + bound + "]")));
|
|
1507
1507
|
for (var i = 0; i < markers.length; i++) {
|
|
1508
|
-
// @breaking-change
|
|
1508
|
+
// @breaking-change 8.0.0
|
|
1509
1509
|
if (markers[i].hasAttribute("cdk-focus-" + bound)) {
|
|
1510
1510
|
console.warn("Found use of deprecated attribute 'cdk-focus-" + bound + "', " +
|
|
1511
1511
|
("use 'cdkFocusRegion" + bound + "' instead. The deprecated ") +
|
|
1512
|
-
"attribute will be removed in
|
|
1512
|
+
"attribute will be removed in 8.0.0.", markers[i]);
|
|
1513
1513
|
}
|
|
1514
1514
|
else if (markers[i].hasAttribute("cdk-focus-region-" + bound)) {
|
|
1515
1515
|
console.warn("Found use of deprecated attribute 'cdk-focus-region-" + bound + "', " +
|
|
1516
1516
|
("use 'cdkFocusRegion" + bound + "' instead. The deprecated attribute ") +
|
|
1517
|
-
"will be removed in
|
|
1517
|
+
"will be removed in 8.0.0.", markers[i]);
|
|
1518
1518
|
}
|
|
1519
1519
|
}
|
|
1520
1520
|
if (bound == 'start') {
|
|
@@ -1540,11 +1540,11 @@ FocusTrap = /** @class */ (function () {
|
|
|
1540
1540
|
var redirectToElement = /** @type {?} */ (this._element.querySelector("[cdk-focus-initial], " +
|
|
1541
1541
|
"[cdkFocusInitial]"));
|
|
1542
1542
|
if (redirectToElement) {
|
|
1543
|
-
// @breaking-change
|
|
1543
|
+
// @breaking-change 8.0.0
|
|
1544
1544
|
if (redirectToElement.hasAttribute("cdk-focus-initial")) {
|
|
1545
1545
|
console.warn("Found use of deprecated attribute 'cdk-focus-initial', " +
|
|
1546
1546
|
"use 'cdkFocusInitial' instead. The deprecated attribute " +
|
|
1547
|
-
"will be removed in
|
|
1547
|
+
"will be removed in 8.0.0", redirectToElement);
|
|
1548
1548
|
}
|
|
1549
1549
|
redirectToElement.focus();
|
|
1550
1550
|
return true;
|
|
@@ -2056,7 +2056,7 @@ var CdkAriaLive = /** @class */ (function () {
|
|
|
2056
2056
|
return CdkAriaLive;
|
|
2057
2057
|
}());
|
|
2058
2058
|
/**
|
|
2059
|
-
* \@docs-private \@deprecated \@breaking-change
|
|
2059
|
+
* \@docs-private \@deprecated \@breaking-change 8.0.0
|
|
2060
2060
|
* @param {?} parentDispatcher
|
|
2061
2061
|
* @param {?} liveElement
|
|
2062
2062
|
* @param {?} _document
|
|
@@ -2067,7 +2067,7 @@ function LIVE_ANNOUNCER_PROVIDER_FACTORY(parentDispatcher, liveElement, _documen
|
|
|
2067
2067
|
return parentDispatcher || new LiveAnnouncer(liveElement, _document, ngZone);
|
|
2068
2068
|
}
|
|
2069
2069
|
/** *
|
|
2070
|
-
* \@docs-private \@deprecated \@breaking-change
|
|
2070
|
+
* \@docs-private \@deprecated \@breaking-change 8.0.0
|
|
2071
2071
|
@type {?} */
|
|
2072
2072
|
var LIVE_ANNOUNCER_PROVIDER = {
|
|
2073
2073
|
// If there is already a LiveAnnouncer available, use that. Otherwise, provide a new one.
|
|
@@ -2255,18 +2255,23 @@ var FocusMonitor = /** @class */ (function () {
|
|
|
2255
2255
|
_this._windowFocused = true;
|
|
2256
2256
|
_this._windowFocusTimeoutId = setTimeout(function () { return _this._windowFocused = false; });
|
|
2257
2257
|
};
|
|
2258
|
+
/** @type {?} */
|
|
2259
|
+
var captureEventListenerOptions = normalizePassiveListenerOptions({
|
|
2260
|
+
passive: true,
|
|
2261
|
+
capture: true
|
|
2262
|
+
});
|
|
2258
2263
|
// Note: we listen to events in the capture phase so we can detect them even if the user stops
|
|
2259
2264
|
// propagation.
|
|
2260
2265
|
this._ngZone.runOutsideAngular(function () {
|
|
2261
|
-
document.addEventListener('keydown', documentKeydownListener,
|
|
2262
|
-
document.addEventListener('mousedown', documentMousedownListener,
|
|
2263
|
-
document.addEventListener('touchstart', documentTouchstartListener,
|
|
2266
|
+
document.addEventListener('keydown', documentKeydownListener, captureEventListenerOptions);
|
|
2267
|
+
document.addEventListener('mousedown', documentMousedownListener, captureEventListenerOptions);
|
|
2268
|
+
document.addEventListener('touchstart', documentTouchstartListener, captureEventListenerOptions);
|
|
2264
2269
|
window.addEventListener('focus', windowFocusListener);
|
|
2265
2270
|
});
|
|
2266
2271
|
this._unregisterGlobalListeners = function () {
|
|
2267
|
-
document.removeEventListener('keydown', documentKeydownListener,
|
|
2268
|
-
document.removeEventListener('mousedown', documentMousedownListener,
|
|
2269
|
-
document.removeEventListener('touchstart', documentTouchstartListener,
|
|
2272
|
+
document.removeEventListener('keydown', documentKeydownListener, captureEventListenerOptions);
|
|
2273
|
+
document.removeEventListener('mousedown', documentMousedownListener, captureEventListenerOptions);
|
|
2274
|
+
document.removeEventListener('touchstart', documentTouchstartListener, captureEventListenerOptions);
|
|
2270
2275
|
window.removeEventListener('focus', windowFocusListener);
|
|
2271
2276
|
// Clear timeouts for all potentially pending timeouts to prevent the leaks.
|
|
2272
2277
|
clearTimeout(_this._windowFocusTimeoutId);
|
|
@@ -2519,7 +2524,7 @@ var CdkMonitorFocus = /** @class */ (function () {
|
|
|
2519
2524
|
return CdkMonitorFocus;
|
|
2520
2525
|
}());
|
|
2521
2526
|
/**
|
|
2522
|
-
* \@docs-private \@deprecated \@breaking-change
|
|
2527
|
+
* \@docs-private \@deprecated \@breaking-change 8.0.0
|
|
2523
2528
|
* @param {?} parentDispatcher
|
|
2524
2529
|
* @param {?} ngZone
|
|
2525
2530
|
* @param {?} platform
|
|
@@ -2529,7 +2534,7 @@ function FOCUS_MONITOR_PROVIDER_FACTORY(parentDispatcher, ngZone, platform) {
|
|
|
2529
2534
|
return parentDispatcher || new FocusMonitor(ngZone, platform);
|
|
2530
2535
|
}
|
|
2531
2536
|
/** *
|
|
2532
|
-
* \@docs-private \@deprecated \@breaking-change
|
|
2537
|
+
* \@docs-private \@deprecated \@breaking-change 8.0.0
|
|
2533
2538
|
@type {?} */
|
|
2534
2539
|
var FOCUS_MONITOR_PROVIDER = {
|
|
2535
2540
|
// If there is already a FocusMonitor available, use that. Otherwise, provide a new one.
|