@angular/cdk 10.1.2 → 10.1.3
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/bundles/cdk-a11y.umd.js +425 -373
- package/bundles/cdk-a11y.umd.js.map +1 -1
- package/bundles/cdk-a11y.umd.min.js +34 -10
- package/bundles/cdk-a11y.umd.min.js.map +1 -1
- package/bundles/cdk-accordion.umd.js +40 -40
- package/bundles/cdk-accordion.umd.js.map +1 -1
- package/bundles/cdk-accordion.umd.min.js +10 -2
- package/bundles/cdk-accordion.umd.min.js.map +1 -1
- package/bundles/cdk-bidi.umd.js +25 -25
- package/bundles/cdk-bidi.umd.js.map +1 -1
- package/bundles/cdk-bidi.umd.min.js +5 -4
- package/bundles/cdk-bidi.umd.min.js.map +1 -1
- package/bundles/cdk-clipboard.umd.js +31 -31
- package/bundles/cdk-clipboard.umd.js.map +1 -1
- package/bundles/cdk-clipboard.umd.min.js +10 -2
- package/bundles/cdk-clipboard.umd.min.js.map +1 -1
- package/bundles/cdk-coercion.umd.js.map +1 -1
- package/bundles/cdk-collections.umd.js +303 -237
- package/bundles/cdk-collections.umd.js.map +1 -1
- package/bundles/cdk-collections.umd.min.js +3 -9
- package/bundles/cdk-collections.umd.min.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.js +484 -425
- package/bundles/cdk-drag-drop.umd.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.min.js +68 -5
- package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
- package/bundles/cdk-keycodes.umd.js.map +1 -1
- package/bundles/cdk-layout.umd.js +18 -18
- package/bundles/cdk-layout.umd.js.map +1 -1
- package/bundles/cdk-layout.umd.min.js +6 -5
- package/bundles/cdk-layout.umd.min.js.map +1 -1
- package/bundles/cdk-observers.umd.js +34 -34
- package/bundles/cdk-observers.umd.js.map +1 -1
- package/bundles/cdk-observers.umd.min.js +2 -2
- package/bundles/cdk-observers.umd.min.js.map +1 -1
- package/bundles/cdk-overlay.umd.js +442 -383
- package/bundles/cdk-overlay.umd.js.map +1 -1
- package/bundles/cdk-overlay.umd.min.js +57 -11
- package/bundles/cdk-overlay.umd.min.js.map +1 -1
- package/bundles/cdk-platform.umd.js +10 -10
- package/bundles/cdk-platform.umd.js.map +1 -1
- package/bundles/cdk-platform.umd.min.js +3 -10
- package/bundles/cdk-platform.umd.min.js.map +1 -1
- package/bundles/cdk-portal.umd.js +351 -299
- package/bundles/cdk-portal.umd.js.map +1 -1
- package/bundles/cdk-portal.umd.min.js +4 -5
- package/bundles/cdk-portal.umd.min.js.map +1 -1
- package/bundles/cdk-scrolling.umd.js +432 -378
- package/bundles/cdk-scrolling.umd.js.map +1 -1
- package/bundles/cdk-scrolling.umd.min.js +20 -19
- package/bundles/cdk-scrolling.umd.min.js.map +1 -1
- package/bundles/cdk-stepper.umd.js +117 -117
- package/bundles/cdk-stepper.umd.js.map +1 -1
- package/bundles/cdk-stepper.umd.min.js +11 -2
- package/bundles/cdk-stepper.umd.min.js.map +1 -1
- package/bundles/cdk-table.umd.js +684 -588
- package/bundles/cdk-table.umd.js.map +1 -1
- package/bundles/cdk-table.umd.min.js +7 -14
- package/bundles/cdk-table.umd.min.js.map +1 -1
- package/bundles/cdk-testing-protractor.umd.js +300 -241
- package/bundles/cdk-testing-protractor.umd.js.map +1 -1
- package/bundles/cdk-testing-protractor.umd.min.js +2 -9
- package/bundles/cdk-testing-protractor.umd.min.js.map +1 -1
- package/bundles/cdk-testing-testbed.umd.js +301 -256
- package/bundles/cdk-testing-testbed.umd.js.map +1 -1
- package/bundles/cdk-testing-testbed.umd.min.js +7 -30
- package/bundles/cdk-testing-testbed.umd.min.js.map +1 -1
- package/bundles/cdk-testing.umd.js +326 -270
- package/bundles/cdk-testing.umd.js.map +1 -1
- package/bundles/cdk-testing.umd.min.js +1 -16
- package/bundles/cdk-testing.umd.min.js.map +1 -1
- package/bundles/cdk-text-field.umd.js +51 -51
- package/bundles/cdk-text-field.umd.js.map +1 -1
- package/bundles/cdk-text-field.umd.min.js +10 -2
- package/bundles/cdk-text-field.umd.min.js.map +1 -1
- package/bundles/cdk-tree.umd.js +443 -394
- package/bundles/cdk-tree.umd.js.map +1 -1
- package/bundles/cdk-tree.umd.min.js +28 -3
- package/bundles/cdk-tree.umd.min.js.map +1 -1
- package/bundles/cdk.umd.js +1 -1
- package/bundles/cdk.umd.js.map +1 -1
- package/bundles/cdk.umd.min.js +1 -1
- package/bundles/cdk.umd.min.js.map +1 -1
- package/esm2015/a11y/focus-trap/configurable-focus-trap-factory.js +3 -3
- package/esm2015/a11y/focus-trap/focus-trap.js +1 -1
- package/esm2015/a11y/live-announcer/live-announcer.js +1 -1
- package/esm2015/bidi/directionality.js +1 -1
- package/esm2015/overlay/position/flexible-connected-position-strategy.js +3 -3
- package/esm2015/scrolling/scrolling-module.js +4 -1
- package/esm2015/table/cell.js +18 -3
- package/esm2015/table/coalesced-style-scheduler.js +21 -10
- package/esm2015/table/sticky-styler.js +21 -7
- package/esm2015/table/table.js +8 -2
- package/esm2015/tree/tree.js +9 -23
- package/esm2015/version.js +1 -1
- package/fesm2015/cdk.js +1 -1
- package/fesm2015/cdk.js.map +1 -1
- package/fesm2015/overlay.js +2 -2
- package/fesm2015/overlay.js.map +1 -1
- package/fesm2015/scrolling.js +3 -0
- package/fesm2015/scrolling.js.map +1 -1
- package/fesm2015/table.js +65 -19
- package/fesm2015/table.js.map +1 -1
- package/fesm2015/tree.js +7 -21
- package/fesm2015/tree.js.map +1 -1
- package/package.json +1 -1
- package/schematics/ng-add/index.js +1 -1
- package/scrolling/index.metadata.json +1 -1
- package/scrolling/scrolling-module.d.ts +3 -0
- package/table/cell.d.ts +13 -0
- package/table/coalesced-style-scheduler.d.ts +1 -0
- package/table/index.metadata.json +1 -1
- package/table/sticky-styler.d.ts +5 -1
- package/table/table.d.ts +6 -0
- package/tree/index.metadata.json +1 -1
- package/tree/tree.d.ts +2 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdk-text-field.umd.js","sources":["../../../../../../src/cdk/text-field/autofill.ts","../../../../../../src/cdk/text-field/autosize.ts","../../../../../../src/cdk/text-field/text-field-module.ts","../../../../../../src/cdk/text-field/public-api.ts","../../../../../../src/cdk/text-field/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Platform, normalizePassiveListenerOptions} from '@angular/cdk/platform';\nimport {\n Directive,\n ElementRef,\n EventEmitter,\n Injectable,\n NgZone,\n OnDestroy,\n OnInit,\n Output,\n} from '@angular/core';\nimport {coerceElement} from '@angular/cdk/coercion';\nimport {EMPTY, Observable, Subject} from 'rxjs';\n\n\n/** An event that is emitted when the autofill state of an input changes. */\nexport type AutofillEvent = {\n /** The element whose autofill state changes. */\n target: Element;\n /** Whether the element is currently autofilled. */\n isAutofilled: boolean;\n};\n\n\n/** Used to track info about currently monitored elements. */\ntype MonitoredElementInfo = {\n subject: Subject<AutofillEvent>;\n unlisten: () => void;\n};\n\n\n/** Options to pass to the animationstart listener. */\nconst listenerOptions = normalizePassiveListenerOptions({passive: true});\n\n\n/**\n * An injectable service that can be used to monitor the autofill state of an input.\n * Based on the following blog post:\n * https://medium.com/@brunn/detecting-autofilled-fields-in-javascript-aed598d25da7\n */\n@Injectable({providedIn: 'root'})\nexport class AutofillMonitor implements OnDestroy {\n private _monitoredElements = new Map<Element, MonitoredElementInfo>();\n\n constructor(private _platform: Platform, private _ngZone: NgZone) {}\n\n /**\n * Monitor for changes in the autofill state of the given input element.\n * @param element The element to monitor.\n * @return A stream of autofill state changes.\n */\n monitor(element: Element): Observable<AutofillEvent>;\n\n /**\n * Monitor for changes in the autofill state of the given input element.\n * @param element The element to monitor.\n * @return A stream of autofill state changes.\n */\n monitor(element: ElementRef<Element>): Observable<AutofillEvent>;\n\n monitor(elementOrRef: Element | ElementRef<Element>): Observable<AutofillEvent> {\n if (!this._platform.isBrowser) {\n return EMPTY;\n }\n\n const element = coerceElement(elementOrRef);\n const info = this._monitoredElements.get(element);\n\n if (info) {\n return info.subject.asObservable();\n }\n\n const result = new Subject<AutofillEvent>();\n const cssClass = 'cdk-text-field-autofilled';\n const listener = ((event: AnimationEvent) => {\n // Animation events fire on initial element render, we check for the presence of the autofill\n // CSS class to make sure this is a real change in state, not just the initial render before\n // we fire off events.\n if (event.animationName === 'cdk-text-field-autofill-start' &&\n !element.classList.contains(cssClass)) {\n element.classList.add(cssClass);\n this._ngZone.run(() => result.next({target: event.target as Element, isAutofilled: true}));\n } else if (event.animationName === 'cdk-text-field-autofill-end' &&\n element.classList.contains(cssClass)) {\n element.classList.remove(cssClass);\n this._ngZone.run(() => result.next({target: event.target as Element, isAutofilled: false}));\n }\n }) as EventListenerOrEventListenerObject;\n\n this._ngZone.runOutsideAngular(() => {\n element.addEventListener('animationstart', listener, listenerOptions);\n element.classList.add('cdk-text-field-autofill-monitored');\n });\n\n this._monitoredElements.set(element, {\n subject: result,\n unlisten: () => {\n element.removeEventListener('animationstart', listener, listenerOptions);\n }\n });\n\n return result.asObservable();\n }\n\n /**\n * Stop monitoring the autofill state of the given input element.\n * @param element The element to stop monitoring.\n */\n stopMonitoring(element: Element): void;\n\n /**\n * Stop monitoring the autofill state of the given input element.\n * @param element The element to stop monitoring.\n */\n stopMonitoring(element: ElementRef<Element>): void;\n\n stopMonitoring(elementOrRef: Element | ElementRef<Element>): void {\n const element = coerceElement(elementOrRef);\n const info = this._monitoredElements.get(element);\n\n if (info) {\n info.unlisten();\n info.subject.complete();\n element.classList.remove('cdk-text-field-autofill-monitored');\n element.classList.remove('cdk-text-field-autofilled');\n this._monitoredElements.delete(element);\n }\n }\n\n ngOnDestroy() {\n this._monitoredElements.forEach((_info, element) => this.stopMonitoring(element));\n }\n}\n\n\n/** A directive that can be used to monitor the autofill state of an input. */\n@Directive({\n selector: '[cdkAutofill]',\n})\nexport class CdkAutofill implements OnDestroy, OnInit {\n /** Emits when the autofill state of the element changes. */\n @Output() cdkAutofill: EventEmitter<AutofillEvent> = new EventEmitter<AutofillEvent>();\n\n constructor(private _elementRef: ElementRef<HTMLElement>,\n private _autofillMonitor: AutofillMonitor) {}\n\n ngOnInit() {\n this._autofillMonitor\n .monitor(this._elementRef)\n .subscribe(event => this.cdkAutofill.emit(event));\n }\n\n ngOnDestroy() {\n this._autofillMonitor.stopMonitoring(this._elementRef);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n BooleanInput,\n coerceBooleanProperty,\n coerceNumberProperty,\n NumberInput\n} from '@angular/cdk/coercion';\nimport {\n Directive,\n ElementRef,\n Input,\n AfterViewInit,\n DoCheck,\n OnDestroy,\n NgZone,\n HostListener,\n Optional,\n Inject,\n} from '@angular/core';\nimport {Platform} from '@angular/cdk/platform';\nimport {auditTime, takeUntil} from 'rxjs/operators';\nimport {fromEvent, Subject} from 'rxjs';\nimport {DOCUMENT} from '@angular/common';\n\n/** Directive to automatically resize a textarea to fit its content. */\n@Directive({\n selector: 'textarea[cdkTextareaAutosize]',\n exportAs: 'cdkTextareaAutosize',\n host: {\n 'class': 'cdk-textarea-autosize',\n // Textarea elements that have the directive applied should have a single row by default.\n // Browsers normally show two rows by default and therefore this limits the minRows binding.\n 'rows': '1',\n },\n})\nexport class CdkTextareaAutosize implements AfterViewInit, DoCheck, OnDestroy {\n /** Keep track of the previous textarea value to avoid resizing when the value hasn't changed. */\n private _previousValue?: string;\n private _initialHeight: string | undefined;\n private readonly _destroyed = new Subject<void>();\n\n private _minRows: number;\n private _maxRows: number;\n private _enabled: boolean = true;\n\n /**\n * Value of minRows as of last resize. If the minRows has decreased, the\n * height of the textarea needs to be recomputed to reflect the new minimum. The maxHeight\n * does not have the same problem because it does not affect the textarea's scrollHeight.\n */\n private _previousMinRows: number = -1;\n\n private _textareaElement: HTMLTextAreaElement;\n\n /** Minimum amount of rows in the textarea. */\n @Input('cdkAutosizeMinRows')\n get minRows(): number { return this._minRows; }\n set minRows(value: number) {\n this._minRows = coerceNumberProperty(value);\n this._setMinHeight();\n }\n\n /** Maximum amount of rows in the textarea. */\n @Input('cdkAutosizeMaxRows')\n get maxRows(): number { return this._maxRows; }\n set maxRows(value: number) {\n this._maxRows = coerceNumberProperty(value);\n this._setMaxHeight();\n }\n\n /** Whether autosizing is enabled or not */\n @Input('cdkTextareaAutosize')\n get enabled(): boolean { return this._enabled; }\n set enabled(value: boolean) {\n value = coerceBooleanProperty(value);\n\n // Only act if the actual value changed. This specifically helps to not run\n // resizeToFitContent too early (i.e. before ngAfterViewInit)\n if (this._enabled !== value) {\n (this._enabled = value) ? this.resizeToFitContent(true) : this.reset();\n }\n }\n\n /** Cached height of a textarea with a single row. */\n private _cachedLineHeight: number;\n\n /** Used to reference correct document/window */\n protected _document?: Document;\n\n /** Class that should be applied to the textarea while it's being measured. */\n private _measuringClass: string;\n\n constructor(private _elementRef: ElementRef<HTMLElement>,\n private _platform: Platform,\n private _ngZone: NgZone,\n /** @breaking-change 11.0.0 make document required */\n @Optional() @Inject(DOCUMENT) document?: any) {\n this._document = document;\n\n this._textareaElement = this._elementRef.nativeElement as HTMLTextAreaElement;\n this._measuringClass = _platform.FIREFOX ?\n 'cdk-textarea-autosize-measuring-firefox' :\n 'cdk-textarea-autosize-measuring';\n }\n\n /** Sets the minimum height of the textarea as determined by minRows. */\n _setMinHeight(): void {\n const minHeight = this.minRows && this._cachedLineHeight ?\n `${this.minRows * this._cachedLineHeight}px` : null;\n\n if (minHeight) {\n this._textareaElement.style.minHeight = minHeight;\n }\n }\n\n /** Sets the maximum height of the textarea as determined by maxRows. */\n _setMaxHeight(): void {\n const maxHeight = this.maxRows && this._cachedLineHeight ?\n `${this.maxRows * this._cachedLineHeight}px` : null;\n\n if (maxHeight) {\n this._textareaElement.style.maxHeight = maxHeight;\n }\n }\n\n ngAfterViewInit() {\n if (this._platform.isBrowser) {\n // Remember the height which we started with in case autosizing is disabled\n this._initialHeight = this._textareaElement.style.height;\n\n this.resizeToFitContent();\n\n this._ngZone.runOutsideAngular(() => {\n const window = this._getWindow();\n\n fromEvent(window, 'resize')\n .pipe(auditTime(16), takeUntil(this._destroyed))\n .subscribe(() => this.resizeToFitContent(true));\n });\n }\n }\n\n ngOnDestroy() {\n this._destroyed.next();\n this._destroyed.complete();\n }\n\n /**\n * Cache the height of a single-row textarea if it has not already been cached.\n *\n * We need to know how large a single \"row\" of a textarea is in order to apply minRows and\n * maxRows. For the initial version, we will assume that the height of a single line in the\n * textarea does not ever change.\n */\n private _cacheTextareaLineHeight(): void {\n if (this._cachedLineHeight) {\n return;\n }\n\n // Use a clone element because we have to override some styles.\n let textareaClone = this._textareaElement.cloneNode(false) as HTMLTextAreaElement;\n textareaClone.rows = 1;\n\n // Use `position: absolute` so that this doesn't cause a browser layout and use\n // `visibility: hidden` so that nothing is rendered. Clear any other styles that\n // would affect the height.\n textareaClone.style.position = 'absolute';\n textareaClone.style.visibility = 'hidden';\n textareaClone.style.border = 'none';\n textareaClone.style.padding = '0';\n textareaClone.style.height = '';\n textareaClone.style.minHeight = '';\n textareaClone.style.maxHeight = '';\n\n // In Firefox it happens that textarea elements are always bigger than the specified amount\n // of rows. This is because Firefox tries to add extra space for the horizontal scrollbar.\n // As a workaround that removes the extra space for the scrollbar, we can just set overflow\n // to hidden. This ensures that there is no invalid calculation of the line height.\n // See Firefox bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=33654\n textareaClone.style.overflow = 'hidden';\n\n this._textareaElement.parentNode!.appendChild(textareaClone);\n this._cachedLineHeight = textareaClone.clientHeight;\n this._textareaElement.parentNode!.removeChild(textareaClone);\n\n // Min and max heights have to be re-calculated if the cached line height changes\n this._setMinHeight();\n this._setMaxHeight();\n }\n\n ngDoCheck() {\n if (this._platform.isBrowser) {\n this.resizeToFitContent();\n }\n }\n\n /**\n * Resize the textarea to fit its content.\n * @param force Whether to force a height recalculation. By default the height will be\n * recalculated only if the value changed since the last call.\n */\n resizeToFitContent(force: boolean = false) {\n // If autosizing is disabled, just skip everything else\n if (!this._enabled) {\n return;\n }\n\n this._cacheTextareaLineHeight();\n\n // If we haven't determined the line-height yet, we know we're still hidden and there's no point\n // in checking the height of the textarea.\n if (!this._cachedLineHeight) {\n return;\n }\n\n const textarea = this._elementRef.nativeElement as HTMLTextAreaElement;\n const value = textarea.value;\n\n // Only resize if the value or minRows have changed since these calculations can be expensive.\n if (!force && this._minRows === this._previousMinRows && value === this._previousValue) {\n return;\n }\n\n const placeholderText = textarea.placeholder;\n\n // Reset the textarea height to auto in order to shrink back to its default size.\n // Also temporarily force overflow:hidden, so scroll bars do not interfere with calculations.\n // Long placeholders that are wider than the textarea width may lead to a bigger scrollHeight\n // value. To ensure that the scrollHeight is not bigger than the content, the placeholders\n // need to be removed temporarily.\n textarea.classList.add(this._measuringClass);\n textarea.placeholder = '';\n\n // The measuring class includes a 2px padding to workaround an issue with Chrome,\n // 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(this._measuringClass);\n textarea.placeholder = placeholderText;\n\n this._ngZone.runOutsideAngular(() => {\n if (typeof requestAnimationFrame !== 'undefined') {\n requestAnimationFrame(() => this._scrollToCaretPosition(textarea));\n } else {\n setTimeout(() => this._scrollToCaretPosition(textarea));\n }\n });\n\n this._previousValue = value;\n this._previousMinRows = this._minRows;\n }\n\n /**\n * Resets the textarea to its original size\n */\n reset() {\n // Do not try to change the textarea, if the initialHeight has not been determined yet\n // This might potentially remove styles when reset() is called before ngAfterViewInit\n if (this._initialHeight !== undefined) {\n this._textareaElement.style.height = this._initialHeight;\n }\n }\n\n // In Ivy the `host` metadata will be merged, whereas in ViewEngine it is overridden. In order\n // to avoid double event listeners, we need to use `HostListener`. Once Ivy is the default, we\n // can move this back into `host`.\n // tslint:disable:no-host-decorator-in-concrete\n @HostListener('input')\n _noopInputHandler() {\n // no-op handler that ensures we're running change detection on input events.\n }\n\n /** Access injected document if available or fallback to global document reference */\n private _getDocument(): Document {\n return this._document || document;\n }\n\n /** Use defaultView of injected document if available or fallback to global window reference */\n private _getWindow(): Window {\n const doc = this._getDocument();\n return doc.defaultView || window;\n }\n\n /**\n * Scrolls a textarea to the caret position. On Firefox resizing the textarea will\n * prevent it from scrolling to the caret position. We need to re-set the selection\n * in order for it to scroll to the proper position.\n */\n private _scrollToCaretPosition(textarea: HTMLTextAreaElement) {\n const {selectionStart, selectionEnd} = textarea;\n const document = this._getDocument();\n\n // IE will throw an \"Unspecified error\" if we try to set the selection range after the\n // element has been removed from the DOM. Assert that the directive hasn't been destroyed\n // between the time we requested the animation frame and when it was executed.\n // Also note that we have to assert that the textarea is focused before we set the\n // selection range. Setting the selection range on a non-focused textarea will cause\n // it to receive focus on IE and Edge.\n if (!this._destroyed.isStopped && document.activeElement === textarea) {\n textarea.setSelectionRange(selectionStart, selectionEnd);\n }\n }\n\n static ngAcceptInputType_minRows: NumberInput;\n static ngAcceptInputType_maxRows: NumberInput;\n static ngAcceptInputType_enabled: BooleanInput;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {PlatformModule} from '@angular/cdk/platform';\nimport {NgModule} from '@angular/core';\nimport {CdkAutofill} from './autofill';\nimport {CdkTextareaAutosize} from './autosize';\n\n\n@NgModule({\n declarations: [CdkAutofill, CdkTextareaAutosize],\n imports: [PlatformModule],\n exports: [CdkAutofill, CdkTextareaAutosize],\n})\nexport class TextFieldModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './autofill';\nexport * from './autosize';\nexport * from './text-field-module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["normalizePassiveListenerOptions","EMPTY","coerceElement","Subject","Injectable","Platform","NgZone","EventEmitter","Directive","ElementRef","Output","coerceNumberProperty","coerceBooleanProperty","fromEvent","auditTime","takeUntil","Optional","Inject","DOCUMENT","Input","HostListener","NgModule","PlatformModule"],"mappings":";;;;;;IAAA;;;;;;;AAQA,IA+BA;IACA,IAAM,eAAe,GAAGA,kCAA+B,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC;IAGzE;;;;;AAKA;QAIE,yBAAoB,SAAmB,EAAU,OAAe;YAA5C,cAAS,GAAT,SAAS,CAAU;YAAU,YAAO,GAAP,OAAO,CAAQ;YAFxD,uBAAkB,GAAG,IAAI,GAAG,EAAiC,CAAC;SAEF;QAgBpE,iCAAO,GAAP,UAAQ,YAA2C;YAAnD,iBA0CC;YAzCC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE;gBAC7B,OAAOC,UAAK,CAAC;aACd;YAED,IAAM,OAAO,GAAGC,sBAAa,CAAC,YAAY,CAAC,CAAC;YAC5C,IAAM,IAAI,GAAG,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YAElD,IAAI,IAAI,EAAE;gBACR,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;aACpC;YAED,IAAM,MAAM,GAAG,IAAIC,YAAO,EAAiB,CAAC;YAC5C,IAAM,QAAQ,GAAG,2BAA2B,CAAC;YAC7C,IAAM,QAAQ,IAAI,UAAC,KAAqB;;;;gBAItC,IAAI,KAAK,CAAC,aAAa,KAAK,+BAA+B;oBACvD,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;oBACzC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;oBAChC,KAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAM,OAAA,MAAM,CAAC,IAAI,CAAC,EA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;QAC6B,sBAAC;KAL/B;;ICdA;;;;;;OAMG;;ICNH;;OAEG;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"cdk-text-field.umd.js","sources":["../../../../../src/cdk/text-field/autofill.ts","../../../../../src/cdk/text-field/autosize.ts","../../../../../src/cdk/text-field/text-field-module.ts","../../../../../src/cdk/text-field/public-api.ts","../../../../../src/cdk/text-field/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Platform, normalizePassiveListenerOptions} from '@angular/cdk/platform';\nimport {\n Directive,\n ElementRef,\n EventEmitter,\n Injectable,\n NgZone,\n OnDestroy,\n OnInit,\n Output,\n} from '@angular/core';\nimport {coerceElement} from '@angular/cdk/coercion';\nimport {EMPTY, Observable, Subject} from 'rxjs';\n\n\n/** An event that is emitted when the autofill state of an input changes. */\nexport type AutofillEvent = {\n /** The element whose autofill state changes. */\n target: Element;\n /** Whether the element is currently autofilled. */\n isAutofilled: boolean;\n};\n\n\n/** Used to track info about currently monitored elements. */\ntype MonitoredElementInfo = {\n subject: Subject<AutofillEvent>;\n unlisten: () => void;\n};\n\n\n/** Options to pass to the animationstart listener. */\nconst listenerOptions = normalizePassiveListenerOptions({passive: true});\n\n\n/**\n * An injectable service that can be used to monitor the autofill state of an input.\n * Based on the following blog post:\n * https://medium.com/@brunn/detecting-autofilled-fields-in-javascript-aed598d25da7\n */\n@Injectable({providedIn: 'root'})\nexport class AutofillMonitor implements OnDestroy {\n private _monitoredElements = new Map<Element, MonitoredElementInfo>();\n\n constructor(private _platform: Platform, private _ngZone: NgZone) {}\n\n /**\n * Monitor for changes in the autofill state of the given input element.\n * @param element The element to monitor.\n * @return A stream of autofill state changes.\n */\n monitor(element: Element): Observable<AutofillEvent>;\n\n /**\n * Monitor for changes in the autofill state of the given input element.\n * @param element The element to monitor.\n * @return A stream of autofill state changes.\n */\n monitor(element: ElementRef<Element>): Observable<AutofillEvent>;\n\n monitor(elementOrRef: Element | ElementRef<Element>): Observable<AutofillEvent> {\n if (!this._platform.isBrowser) {\n return EMPTY;\n }\n\n const element = coerceElement(elementOrRef);\n const info = this._monitoredElements.get(element);\n\n if (info) {\n return info.subject.asObservable();\n }\n\n const result = new Subject<AutofillEvent>();\n const cssClass = 'cdk-text-field-autofilled';\n const listener = ((event: AnimationEvent) => {\n // Animation events fire on initial element render, we check for the presence of the autofill\n // CSS class to make sure this is a real change in state, not just the initial render before\n // we fire off events.\n if (event.animationName === 'cdk-text-field-autofill-start' &&\n !element.classList.contains(cssClass)) {\n element.classList.add(cssClass);\n this._ngZone.run(() => result.next({target: event.target as Element, isAutofilled: true}));\n } else if (event.animationName === 'cdk-text-field-autofill-end' &&\n element.classList.contains(cssClass)) {\n element.classList.remove(cssClass);\n this._ngZone.run(() => result.next({target: event.target as Element, isAutofilled: false}));\n }\n }) as EventListenerOrEventListenerObject;\n\n this._ngZone.runOutsideAngular(() => {\n element.addEventListener('animationstart', listener, listenerOptions);\n element.classList.add('cdk-text-field-autofill-monitored');\n });\n\n this._monitoredElements.set(element, {\n subject: result,\n unlisten: () => {\n element.removeEventListener('animationstart', listener, listenerOptions);\n }\n });\n\n return result.asObservable();\n }\n\n /**\n * Stop monitoring the autofill state of the given input element.\n * @param element The element to stop monitoring.\n */\n stopMonitoring(element: Element): void;\n\n /**\n * Stop monitoring the autofill state of the given input element.\n * @param element The element to stop monitoring.\n */\n stopMonitoring(element: ElementRef<Element>): void;\n\n stopMonitoring(elementOrRef: Element | ElementRef<Element>): void {\n const element = coerceElement(elementOrRef);\n const info = this._monitoredElements.get(element);\n\n if (info) {\n info.unlisten();\n info.subject.complete();\n element.classList.remove('cdk-text-field-autofill-monitored');\n element.classList.remove('cdk-text-field-autofilled');\n this._monitoredElements.delete(element);\n }\n }\n\n ngOnDestroy() {\n this._monitoredElements.forEach((_info, element) => this.stopMonitoring(element));\n }\n}\n\n\n/** A directive that can be used to monitor the autofill state of an input. */\n@Directive({\n selector: '[cdkAutofill]',\n})\nexport class CdkAutofill implements OnDestroy, OnInit {\n /** Emits when the autofill state of the element changes. */\n @Output() cdkAutofill: EventEmitter<AutofillEvent> = new EventEmitter<AutofillEvent>();\n\n constructor(private _elementRef: ElementRef<HTMLElement>,\n private _autofillMonitor: AutofillMonitor) {}\n\n ngOnInit() {\n this._autofillMonitor\n .monitor(this._elementRef)\n .subscribe(event => this.cdkAutofill.emit(event));\n }\n\n ngOnDestroy() {\n this._autofillMonitor.stopMonitoring(this._elementRef);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n BooleanInput,\n coerceBooleanProperty,\n coerceNumberProperty,\n NumberInput\n} from '@angular/cdk/coercion';\nimport {\n Directive,\n ElementRef,\n Input,\n AfterViewInit,\n DoCheck,\n OnDestroy,\n NgZone,\n HostListener,\n Optional,\n Inject,\n} from '@angular/core';\nimport {Platform} from '@angular/cdk/platform';\nimport {auditTime, takeUntil} from 'rxjs/operators';\nimport {fromEvent, Subject} from 'rxjs';\nimport {DOCUMENT} from '@angular/common';\n\n/** Directive to automatically resize a textarea to fit its content. */\n@Directive({\n selector: 'textarea[cdkTextareaAutosize]',\n exportAs: 'cdkTextareaAutosize',\n host: {\n 'class': 'cdk-textarea-autosize',\n // Textarea elements that have the directive applied should have a single row by default.\n // Browsers normally show two rows by default and therefore this limits the minRows binding.\n 'rows': '1',\n },\n})\nexport class CdkTextareaAutosize implements AfterViewInit, DoCheck, OnDestroy {\n /** Keep track of the previous textarea value to avoid resizing when the value hasn't changed. */\n private _previousValue?: string;\n private _initialHeight: string | undefined;\n private readonly _destroyed = new Subject<void>();\n\n private _minRows: number;\n private _maxRows: number;\n private _enabled: boolean = true;\n\n /**\n * Value of minRows as of last resize. If the minRows has decreased, the\n * height of the textarea needs to be recomputed to reflect the new minimum. The maxHeight\n * does not have the same problem because it does not affect the textarea's scrollHeight.\n */\n private _previousMinRows: number = -1;\n\n private _textareaElement: HTMLTextAreaElement;\n\n /** Minimum amount of rows in the textarea. */\n @Input('cdkAutosizeMinRows')\n get minRows(): number { return this._minRows; }\n set minRows(value: number) {\n this._minRows = coerceNumberProperty(value);\n this._setMinHeight();\n }\n\n /** Maximum amount of rows in the textarea. */\n @Input('cdkAutosizeMaxRows')\n get maxRows(): number { return this._maxRows; }\n set maxRows(value: number) {\n this._maxRows = coerceNumberProperty(value);\n this._setMaxHeight();\n }\n\n /** Whether autosizing is enabled or not */\n @Input('cdkTextareaAutosize')\n get enabled(): boolean { return this._enabled; }\n set enabled(value: boolean) {\n value = coerceBooleanProperty(value);\n\n // Only act if the actual value changed. This specifically helps to not run\n // resizeToFitContent too early (i.e. before ngAfterViewInit)\n if (this._enabled !== value) {\n (this._enabled = value) ? this.resizeToFitContent(true) : this.reset();\n }\n }\n\n /** Cached height of a textarea with a single row. */\n private _cachedLineHeight: number;\n\n /** Used to reference correct document/window */\n protected _document?: Document;\n\n /** Class that should be applied to the textarea while it's being measured. */\n private _measuringClass: string;\n\n constructor(private _elementRef: ElementRef<HTMLElement>,\n private _platform: Platform,\n private _ngZone: NgZone,\n /** @breaking-change 11.0.0 make document required */\n @Optional() @Inject(DOCUMENT) document?: any) {\n this._document = document;\n\n this._textareaElement = this._elementRef.nativeElement as HTMLTextAreaElement;\n this._measuringClass = _platform.FIREFOX ?\n 'cdk-textarea-autosize-measuring-firefox' :\n 'cdk-textarea-autosize-measuring';\n }\n\n /** Sets the minimum height of the textarea as determined by minRows. */\n _setMinHeight(): void {\n const minHeight = this.minRows && this._cachedLineHeight ?\n `${this.minRows * this._cachedLineHeight}px` : null;\n\n if (minHeight) {\n this._textareaElement.style.minHeight = minHeight;\n }\n }\n\n /** Sets the maximum height of the textarea as determined by maxRows. */\n _setMaxHeight(): void {\n const maxHeight = this.maxRows && this._cachedLineHeight ?\n `${this.maxRows * this._cachedLineHeight}px` : null;\n\n if (maxHeight) {\n this._textareaElement.style.maxHeight = maxHeight;\n }\n }\n\n ngAfterViewInit() {\n if (this._platform.isBrowser) {\n // Remember the height which we started with in case autosizing is disabled\n this._initialHeight = this._textareaElement.style.height;\n\n this.resizeToFitContent();\n\n this._ngZone.runOutsideAngular(() => {\n const window = this._getWindow();\n\n fromEvent(window, 'resize')\n .pipe(auditTime(16), takeUntil(this._destroyed))\n .subscribe(() => this.resizeToFitContent(true));\n });\n }\n }\n\n ngOnDestroy() {\n this._destroyed.next();\n this._destroyed.complete();\n }\n\n /**\n * Cache the height of a single-row textarea if it has not already been cached.\n *\n * We need to know how large a single \"row\" of a textarea is in order to apply minRows and\n * maxRows. For the initial version, we will assume that the height of a single line in the\n * textarea does not ever change.\n */\n private _cacheTextareaLineHeight(): void {\n if (this._cachedLineHeight) {\n return;\n }\n\n // Use a clone element because we have to override some styles.\n let textareaClone = this._textareaElement.cloneNode(false) as HTMLTextAreaElement;\n textareaClone.rows = 1;\n\n // Use `position: absolute` so that this doesn't cause a browser layout and use\n // `visibility: hidden` so that nothing is rendered. Clear any other styles that\n // would affect the height.\n textareaClone.style.position = 'absolute';\n textareaClone.style.visibility = 'hidden';\n textareaClone.style.border = 'none';\n textareaClone.style.padding = '0';\n textareaClone.style.height = '';\n textareaClone.style.minHeight = '';\n textareaClone.style.maxHeight = '';\n\n // In Firefox it happens that textarea elements are always bigger than the specified amount\n // of rows. This is because Firefox tries to add extra space for the horizontal scrollbar.\n // As a workaround that removes the extra space for the scrollbar, we can just set overflow\n // to hidden. This ensures that there is no invalid calculation of the line height.\n // See Firefox bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=33654\n textareaClone.style.overflow = 'hidden';\n\n this._textareaElement.parentNode!.appendChild(textareaClone);\n this._cachedLineHeight = textareaClone.clientHeight;\n this._textareaElement.parentNode!.removeChild(textareaClone);\n\n // Min and max heights have to be re-calculated if the cached line height changes\n this._setMinHeight();\n this._setMaxHeight();\n }\n\n ngDoCheck() {\n if (this._platform.isBrowser) {\n this.resizeToFitContent();\n }\n }\n\n /**\n * Resize the textarea to fit its content.\n * @param force Whether to force a height recalculation. By default the height will be\n * recalculated only if the value changed since the last call.\n */\n resizeToFitContent(force: boolean = false) {\n // If autosizing is disabled, just skip everything else\n if (!this._enabled) {\n return;\n }\n\n this._cacheTextareaLineHeight();\n\n // If we haven't determined the line-height yet, we know we're still hidden and there's no point\n // in checking the height of the textarea.\n if (!this._cachedLineHeight) {\n return;\n }\n\n const textarea = this._elementRef.nativeElement as HTMLTextAreaElement;\n const value = textarea.value;\n\n // Only resize if the value or minRows have changed since these calculations can be expensive.\n if (!force && this._minRows === this._previousMinRows && value === this._previousValue) {\n return;\n }\n\n const placeholderText = textarea.placeholder;\n\n // Reset the textarea height to auto in order to shrink back to its default size.\n // Also temporarily force overflow:hidden, so scroll bars do not interfere with calculations.\n // Long placeholders that are wider than the textarea width may lead to a bigger scrollHeight\n // value. To ensure that the scrollHeight is not bigger than the content, the placeholders\n // need to be removed temporarily.\n textarea.classList.add(this._measuringClass);\n textarea.placeholder = '';\n\n // The measuring class includes a 2px padding to workaround an issue with Chrome,\n // 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(this._measuringClass);\n textarea.placeholder = placeholderText;\n\n this._ngZone.runOutsideAngular(() => {\n if (typeof requestAnimationFrame !== 'undefined') {\n requestAnimationFrame(() => this._scrollToCaretPosition(textarea));\n } else {\n setTimeout(() => this._scrollToCaretPosition(textarea));\n }\n });\n\n this._previousValue = value;\n this._previousMinRows = this._minRows;\n }\n\n /**\n * Resets the textarea to its original size\n */\n reset() {\n // Do not try to change the textarea, if the initialHeight has not been determined yet\n // This might potentially remove styles when reset() is called before ngAfterViewInit\n if (this._initialHeight !== undefined) {\n this._textareaElement.style.height = this._initialHeight;\n }\n }\n\n // In Ivy the `host` metadata will be merged, whereas in ViewEngine it is overridden. In order\n // to avoid double event listeners, we need to use `HostListener`. Once Ivy is the default, we\n // can move this back into `host`.\n // tslint:disable:no-host-decorator-in-concrete\n @HostListener('input')\n _noopInputHandler() {\n // no-op handler that ensures we're running change detection on input events.\n }\n\n /** Access injected document if available or fallback to global document reference */\n private _getDocument(): Document {\n return this._document || document;\n }\n\n /** Use defaultView of injected document if available or fallback to global window reference */\n private _getWindow(): Window {\n const doc = this._getDocument();\n return doc.defaultView || window;\n }\n\n /**\n * Scrolls a textarea to the caret position. On Firefox resizing the textarea will\n * prevent it from scrolling to the caret position. We need to re-set the selection\n * in order for it to scroll to the proper position.\n */\n private _scrollToCaretPosition(textarea: HTMLTextAreaElement) {\n const {selectionStart, selectionEnd} = textarea;\n const document = this._getDocument();\n\n // IE will throw an \"Unspecified error\" if we try to set the selection range after the\n // element has been removed from the DOM. Assert that the directive hasn't been destroyed\n // between the time we requested the animation frame and when it was executed.\n // Also note that we have to assert that the textarea is focused before we set the\n // selection range. Setting the selection range on a non-focused textarea will cause\n // it to receive focus on IE and Edge.\n if (!this._destroyed.isStopped && document.activeElement === textarea) {\n textarea.setSelectionRange(selectionStart, selectionEnd);\n }\n }\n\n static ngAcceptInputType_minRows: NumberInput;\n static ngAcceptInputType_maxRows: NumberInput;\n static ngAcceptInputType_enabled: BooleanInput;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {PlatformModule} from '@angular/cdk/platform';\nimport {NgModule} from '@angular/core';\nimport {CdkAutofill} from './autofill';\nimport {CdkTextareaAutosize} from './autosize';\n\n\n@NgModule({\n declarations: [CdkAutofill, CdkTextareaAutosize],\n imports: [PlatformModule],\n exports: [CdkAutofill, CdkTextareaAutosize],\n})\nexport class TextFieldModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './autofill';\nexport * from './autosize';\nexport * from './text-field-module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["normalizePassiveListenerOptions","EMPTY","coerceElement","Subject","Injectable","Platform","NgZone","EventEmitter","Directive","ElementRef","Output","coerceNumberProperty","coerceBooleanProperty","fromEvent","auditTime","takeUntil","Optional","Inject","DOCUMENT","Input","HostListener","NgModule","PlatformModule"],"mappings":";;;;;;IAAA;;;;;;;AAQA,IA+BA;IACA,IAAM,eAAe,GAAGA,kCAA+B,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC;IAGzE;;;;;AAMA;QAGE,yBAAoB,SAAmB,EAAU,OAAe;YAA5C,cAAS,GAAT,SAAS,CAAU;YAAU,YAAO,GAAP,OAAO,CAAQ;YAFxD,uBAAkB,GAAG,IAAI,GAAG,EAAiC,CAAC;SAEF;QAgBpE,iCAAO,GAAP,UAAQ,YAA2C;YAAnD,iBA0CC;YAzCC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE;gBAC7B,OAAOC,UAAK,CAAC;aACd;YAED,IAAM,OAAO,GAAGC,sBAAa,CAAC,YAAY,CAAC,CAAC;YAC5C,IAAM,IAAI,GAAG,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YAElD,IAAI,IAAI,EAAE;gBACR,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;aACpC;YAED,IAAM,MAAM,GAAG,IAAIC,YAAO,EAAiB,CAAC;YAC5C,IAAM,QAAQ,GAAG,2BAA2B,CAAC;YAC7C,IAAM,QAAQ,IAAI,UAAC,KAAqB;;;;gBAItC,IAAI,KAAK,CAAC,aAAa,KAAK,+BAA+B;oBACvD,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;oBACzC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,QA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E,CAAC,WAAW,EAAE,mBAAmB,CAAC;iBAC5C;;;IClBD;;;;;;OAMG;;ICNH;;OAEG;;;;;;;;;;;;;;;"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
|
-
*/var a=t.normalizePassiveListenerOptions({passive:!0}),l=function(){function e(e,t){this._platform=e,this._ngZone=t,this._monitoredElements=new Map}return e.prototype.monitor=function(e){var t=this;if(!this._platform.isBrowser)return o.EMPTY;var i=n.coerceElement(e),r=this._monitoredElements.get(i);if(r)return r.subject.asObservable();var s=new o.Subject,l="cdk-text-field-autofilled",c=function(e){"cdk-text-field-autofill-start"!==e.animationName||i.classList.contains(l)?"cdk-text-field-autofill-end"===e.animationName&&i.classList.contains(l)&&(i.classList.remove(l),t._ngZone.run((function(){return s.next({target:e.target,isAutofilled:!1})}))):(i.classList.add(l),t._ngZone.run((function(){return s.next({target:e.target,isAutofilled:!0})})))};return this._ngZone.runOutsideAngular((function(){i.addEventListener("animationstart",c,a),i.classList.add("cdk-text-field-autofill-monitored")})),this._monitoredElements.set(i,{subject:s,unlisten:function(){i.removeEventListener("animationstart",c,a)}}),s.asObservable()},e.prototype.stopMonitoring=function(e){var t=n.coerceElement(e),i=this._monitoredElements.get(t);i&&(i.unlisten(),i.subject.complete(),t.classList.remove("cdk-text-field-autofill-monitored"),t.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(t))},e.prototype.ngOnDestroy=function(){var e=this;this._monitoredElements.forEach((function(t,i){return e.stopMonitoring(i)}))},e.ɵprov=i.ɵɵdefineInjectable({factory:function
|
|
8
|
+
*/var a=t.normalizePassiveListenerOptions({passive:!0}),l=function(){function e(e,t){this._platform=e,this._ngZone=t,this._monitoredElements=new Map}return e.prototype.monitor=function(e){var t=this;if(!this._platform.isBrowser)return o.EMPTY;var i=n.coerceElement(e),r=this._monitoredElements.get(i);if(r)return r.subject.asObservable();var s=new o.Subject,l="cdk-text-field-autofilled",c=function(e){"cdk-text-field-autofill-start"!==e.animationName||i.classList.contains(l)?"cdk-text-field-autofill-end"===e.animationName&&i.classList.contains(l)&&(i.classList.remove(l),t._ngZone.run((function(){return s.next({target:e.target,isAutofilled:!1})}))):(i.classList.add(l),t._ngZone.run((function(){return s.next({target:e.target,isAutofilled:!0})})))};return this._ngZone.runOutsideAngular((function(){i.addEventListener("animationstart",c,a),i.classList.add("cdk-text-field-autofill-monitored")})),this._monitoredElements.set(i,{subject:s,unlisten:function(){i.removeEventListener("animationstart",c,a)}}),s.asObservable()},e.prototype.stopMonitoring=function(e){var t=n.coerceElement(e),i=this._monitoredElements.get(t);i&&(i.unlisten(),i.subject.complete(),t.classList.remove("cdk-text-field-autofill-monitored"),t.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(t))},e.prototype.ngOnDestroy=function(){var e=this;this._monitoredElements.forEach((function(t,i){return e.stopMonitoring(i)}))},e}();l.ɵprov=i.ɵɵdefineInjectable({factory:function e(){return new l(i.ɵɵinject(t.Platform),i.ɵɵinject(i.NgZone))},token:l,providedIn:"root"}),l.decorators=[{type:i.Injectable,args:[{providedIn:"root"}]}],l.ctorParameters=function(){return[{type:t.Platform},{type:i.NgZone}]};var c=function(){function e(e,t){this._elementRef=e,this._autofillMonitor=t,this.cdkAutofill=new i.EventEmitter}return e.prototype.ngOnInit=function(){var e=this;this._autofillMonitor.monitor(this._elementRef).subscribe((function(t){return e.cdkAutofill.emit(t)}))},e.prototype.ngOnDestroy=function(){this._autofillMonitor.stopMonitoring(this._elementRef)},e}();c.decorators=[{type:i.Directive,args:[{selector:"[cdkAutofill]"}]}],c.ctorParameters=function(){return[{type:i.ElementRef},{type:l}]},c.propDecorators={cdkAutofill:[{type:i.Output}]};
|
|
9
9
|
/**
|
|
10
10
|
* @license
|
|
11
11
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -13,4 +13,12 @@
|
|
|
13
13
|
* Use of this source code is governed by an MIT-style license that can be
|
|
14
14
|
* found in the LICENSE file at https://angular.io/license
|
|
15
15
|
*/
|
|
16
|
-
e.
|
|
16
|
+
var u,d=function(){function e(e,t,i,n){this._elementRef=e,this._platform=t,this._ngZone=i,this._destroyed=new o.Subject,this._enabled=!0,this._previousMinRows=-1,this._document=n,this._textareaElement=this._elementRef.nativeElement,this._measuringClass=t.FIREFOX?"cdk-textarea-autosize-measuring-firefox":"cdk-textarea-autosize-measuring"}return Object.defineProperty(e.prototype,"minRows",{get:function(){return this._minRows},set:function(e){this._minRows=n.coerceNumberProperty(e),this._setMinHeight()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxRows",{get:function(){return this._maxRows},set:function(e){this._maxRows=n.coerceNumberProperty(e),this._setMaxHeight()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"enabled",{get:function(){return this._enabled},set:function(e){e=n.coerceBooleanProperty(e),this._enabled!==e&&((this._enabled=e)?this.resizeToFitContent(!0):this.reset())},enumerable:!1,configurable:!0}),e.prototype._setMinHeight=function(){var e=this.minRows&&this._cachedLineHeight?this.minRows*this._cachedLineHeight+"px":null;e&&(this._textareaElement.style.minHeight=e)},e.prototype._setMaxHeight=function(){var e=this.maxRows&&this._cachedLineHeight?this.maxRows*this._cachedLineHeight+"px":null;e&&(this._textareaElement.style.maxHeight=e)},e.prototype.ngAfterViewInit=function(){var e=this;this._platform.isBrowser&&(this._initialHeight=this._textareaElement.style.height,this.resizeToFitContent(),this._ngZone.runOutsideAngular((function(){var t=e._getWindow();o.fromEvent(t,"resize").pipe(r.auditTime(16),r.takeUntil(e._destroyed)).subscribe((function(){return e.resizeToFitContent(!0)}))})))},e.prototype.ngOnDestroy=function(){this._destroyed.next(),this._destroyed.complete()},e.prototype._cacheTextareaLineHeight=function(){if(!this._cachedLineHeight){var e=this._textareaElement.cloneNode(!1);e.rows=1,e.style.position="absolute",e.style.visibility="hidden",e.style.border="none",e.style.padding="0",e.style.height="",e.style.minHeight="",e.style.maxHeight="",e.style.overflow="hidden",this._textareaElement.parentNode.appendChild(e),this._cachedLineHeight=e.clientHeight,this._textareaElement.parentNode.removeChild(e),this._setMinHeight(),this._setMaxHeight()}},e.prototype.ngDoCheck=function(){this._platform.isBrowser&&this.resizeToFitContent()},e.prototype.resizeToFitContent=function(e){var t=this;if(void 0===e&&(e=!1),this._enabled&&(this._cacheTextareaLineHeight(),this._cachedLineHeight)){var i=this._elementRef.nativeElement,n=i.value;if(e||this._minRows!==this._previousMinRows||n!==this._previousValue){var o=i.placeholder;i.classList.add(this._measuringClass),i.placeholder="",i.style.height=i.scrollHeight-4+"px",i.classList.remove(this._measuringClass),i.placeholder=o,this._ngZone.runOutsideAngular((function(){"undefined"!=typeof requestAnimationFrame?requestAnimationFrame((function(){return t._scrollToCaretPosition(i)})):setTimeout((function(){return t._scrollToCaretPosition(i)}))})),this._previousValue=n,this._previousMinRows=this._minRows}}},e.prototype.reset=function(){void 0!==this._initialHeight&&(this._textareaElement.style.height=this._initialHeight)},e.prototype._noopInputHandler=function(){},e.prototype._getDocument=function(){return this._document||document},e.prototype._getWindow=function(){return this._getDocument().defaultView||window},e.prototype._scrollToCaretPosition=function(e){var t=e.selectionStart,i=e.selectionEnd,n=this._getDocument();this._destroyed.isStopped||n.activeElement!==e||e.setSelectionRange(t,i)},e}();d.decorators=[{type:i.Directive,args:[{selector:"textarea[cdkTextareaAutosize]",exportAs:"cdkTextareaAutosize",host:{class:"cdk-textarea-autosize",rows:"1"}}]}],d.ctorParameters=function(){return[{type:i.ElementRef},{type:t.Platform},{type:i.NgZone},{type:void 0,decorators:[{type:i.Optional},{type:i.Inject,args:[s.DOCUMENT]}]}]},d.propDecorators={minRows:[{type:i.Input,args:["cdkAutosizeMinRows"]}],maxRows:[{type:i.Input,args:["cdkAutosizeMaxRows"]}],enabled:[{type:i.Input,args:["cdkTextareaAutosize"]}],_noopInputHandler:[{type:i.HostListener,args:["input"]}]},(u=function u(){}).decorators=[{type:i.NgModule,args:[{declarations:[c,d],imports:[t.PlatformModule],exports:[c,d]}]}],
|
|
17
|
+
/**
|
|
18
|
+
* @license
|
|
19
|
+
* Copyright Google LLC All Rights Reserved.
|
|
20
|
+
*
|
|
21
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
22
|
+
* found in the LICENSE file at https://angular.io/license
|
|
23
|
+
*/
|
|
24
|
+
e.AutofillMonitor=l,e.CdkAutofill=c,e.CdkTextareaAutosize=d,e.TextFieldModule=u,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["src/cdk/cdk-text-field.umd.js"],"names":["global","factory","exports","module","require","define","amd","self","ng","cdk","textField","platform","core","coercion","rxjs","operators","common","this","i1","i0","listenerOptions","normalizePassiveListenerOptions","passive","AutofillMonitor","_platform","_ngZone","_monitoredElements","Map","prototype","monitor","elementOrRef","_this","isBrowser","EMPTY","element","coerceElement","info","get","subject","asObservable","result","Subject","cssClass","listener","event","animationName","classList","contains","remove","run","next","target","isAutofilled","add","runOutsideAngular","addEventListener","set","unlisten","removeEventListener","stopMonitoring","complete","delete","ngOnDestroy","forEach","_info","ɵprov","ɵɵdefineInjectable","AutofillMonitor_Factory","ɵɵinject","Platform","NgZone","token","providedIn","decorators","type","Injectable","args","ctorParameters","CdkAutofill","_elementRef","_autofillMonitor","cdkAutofill","EventEmitter","ngOnInit","subscribe","emit","Directive","selector","ElementRef","propDecorators","Output","CdkTextareaAutosize","document","_destroyed","_enabled","_previousMinRows","_document","_textareaElement","nativeElement","_measuringClass","FIREFOX","Object","defineProperty","_minRows","value","coerceNumberProperty","_setMinHeight","enumerable","configurable","_maxRows","_setMaxHeight","coerceBooleanProperty","resizeToFitContent","reset","minHeight","minRows","_cachedLineHeight","style","maxHeight","maxRows","ngAfterViewInit","_initialHeight","height","window","_getWindow","fromEvent","pipe","auditTime","takeUntil","_cacheTextareaLineHeight","textareaClone","cloneNode","rows","position","visibility","border","padding","overflow","parentNode","appendChild","clientHeight","removeChild","ngDoCheck","force","textarea","_previousValue","placeholderText","placeholder","scrollHeight","requestAnimationFrame","_scrollToCaretPosition","setTimeout","undefined","_noopInputHandler","_getDocument","defaultView","selectionStart","selectionEnd","isStopped","activeElement","setSelectionRange","exportAs","host","class","Optional","Inject","DOCUMENT","Input","enabled","HostListener","TextFieldModule","NgModule","declarations","imports","PlatformModule"],"mappings":"CAAC,SAAUA,EAAQC,GACI,iBAAZC,SAA0C,oBAAXC,OAAyBF,EAAQC,QAASE,QAAQ,yBAA0BA,QAAQ,iBAAkBA,QAAQ,yBAA0BA,QAAQ,QAASA,QAAQ,kBAAmBA,QAAQ,oBAChN,mBAAXC,QAAyBA,OAAOC,IAAMD,OAAO,0BAA2B,CAAC,UAAW,wBAAyB,gBAAiB,wBAAyB,OAAQ,iBAAkB,mBAAoBJ,GAClLA,IAAzBD,EAASA,GAAUO,MAAsBC,GAAKR,EAAOQ,IAAM,GAAIR,EAAOQ,GAAGC,IAAMT,EAAOQ,GAAGC,KAAO,GAAIT,EAAOQ,GAAGC,IAAIC,UAAY,IAAKV,EAAOQ,GAAGC,IAAIE,SAAUX,EAAOQ,GAAGI,KAAMZ,EAAOQ,GAAGC,IAAII,SAAUb,EAAOc,KAAMd,EAAOc,KAAKC,UAAWf,EAAOQ,GAAGQ,QAHtP,CAIEC,MAAM,SAAWf,EAASgB,EAAIC,EAAIN,EAAUC,EAAMC,EAAWC,GAAU;;;;;;;OAUrE,IAAII,EAAkBF,EAAGG,gCAAgC,CAAEC,SAAS,IAMhEC,EAAiC,WACjC,SAASA,EAAgBC,EAAWC,GAChCR,KAAKO,UAAYA,EACjBP,KAAKQ,QAAUA,EACfR,KAAKS,mBAAqB,IAAIC,IAgElC,OA9DAJ,EAAgBK,UAAUC,QAAU,SAAUC,GAC1C,IAAIC,EAAQd,KACZ,IAAKA,KAAKO,UAAUQ,UAChB,OAAOlB,EAAKmB,MAEhB,IAAIC,EAAUrB,EAASsB,cAAcL,GACjCM,EAAO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C,KAAMvD,EAAGoJ,MAAO3F,KAAM,CAAC,wBACnC2C,QAAS,CAAC,CAAE7C,KAAMvD,EAAGoJ,MAAO3F,KAAM,CAAC,wBACnC4F,QAAS,CAAC,CAAE9F,KAAMvD,EAAGoJ,MAAO3F,KAAM,CAAC,yBACnC6E,kBAAmB,CAAC,CAAE/E,KAAMvD,EAAGsJ,aAAc7F,KAAM,CAAC,YAEjDe,EAzP6B,GAmQpC+E,EAAiC,WACjC,SAASA,KAST,OAPAA,EAAgBjG,WAAa,CACzB,CAAEC,KAAMvD,EAAGwJ,SAAU/F,KAAM,CAAC,CAChBgG,aAAc,CAAC9F,EAAaa,GAC5BkF,QAAS,CAAC3J,EAAG4J,gBACb5K,QAAS,CAAC4E,EAAaa,OAGhC+E,EAVyB;;;;;;;;AAyBpCxK,EAAQqB,gBAAkBA,EAC1BrB,EAAQ4E,YAAcA,EACtB5E,EAAQyF,oBAAsBA,EAC9BzF,EAAQwK,gBAAkBA,EAE1BrE,OAAOC,eAAepG,EAAS,aAAc,CAAEsG,OAAO","sourcesContent":["(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/cdk/platform'), require('@angular/core'), require('@angular/cdk/coercion'), require('rxjs'), require('rxjs/operators'), require('@angular/common')) :\n typeof define === 'function' && define.amd ? define('@angular/cdk/text-field', ['exports', '@angular/cdk/platform', '@angular/core', '@angular/cdk/coercion', 'rxjs', 'rxjs/operators', '@angular/common'], factory) :\n (global = global || self, factory((global.ng = global.ng || {}, global.ng.cdk = global.ng.cdk || {}, global.ng.cdk.textField = {}), global.ng.cdk.platform, global.ng.core, global.ng.cdk.coercion, global.rxjs, global.rxjs.operators, global.ng.common));\n}(this, (function (exports, i1, i0, coercion, rxjs, operators, common) { 'use strict';\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n /** Options to pass to the animationstart listener. */\n var listenerOptions = i1.normalizePassiveListenerOptions({ passive: true });\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 var AutofillMonitor = /** @class */ (function () {\n function AutofillMonitor(_platform, _ngZone) {\n this._platform = _platform;\n this._ngZone = _ngZone;\n this._monitoredElements = new Map();\n }\n AutofillMonitor.prototype.monitor = function (elementOrRef) {\n var _this = this;\n if (!this._platform.isBrowser) {\n return rxjs.EMPTY;\n }\n var element = coercion.coerceElement(elementOrRef);\n var info = this._monitoredElements.get(element);\n if (info) {\n return info.subject.asObservable();\n }\n var result = new rxjs.Subject();\n var cssClass = 'cdk-text-field-autofilled';\n var listener = (function (event) {\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(function () { return result.next({ target: event.target, isAutofilled: true }); });\n }\n else if (event.animationName === 'cdk-text-field-autofill-end' &&\n element.classList.contains(cssClass)) {\n element.classList.remove(cssClass);\n _this._ngZone.run(function () { return result.next({ target: event.target, isAutofilled: false }); });\n }\n });\n this._ngZone.runOutsideAngular(function () {\n element.addEventListener('animationstart', listener, listenerOptions);\n element.classList.add('cdk-text-field-autofill-monitored');\n });\n this._monitoredElements.set(element, {\n subject: result,\n unlisten: function () {\n element.removeEventListener('animationstart', listener, listenerOptions);\n }\n });\n return result.asObservable();\n };\n AutofillMonitor.prototype.stopMonitoring = function (elementOrRef) {\n var element = coercion.coerceElement(elementOrRef);\n var info = this._monitoredElements.get(element);\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 AutofillMonitor.prototype.ngOnDestroy = function () {\n var _this = this;\n this._monitoredElements.forEach(function (_info, element) { return _this.stopMonitoring(element); });\n };\n AutofillMonitor.ɵprov = i0.ɵɵdefineInjectable({ factory: function AutofillMonitor_Factory() { return new AutofillMonitor(i0.ɵɵinject(i1.Platform), i0.ɵɵinject(i0.NgZone)); }, token: AutofillMonitor, providedIn: \"root\" });\n AutofillMonitor.decorators = [\n { type: i0.Injectable, args: [{ providedIn: 'root' },] }\n ];\n AutofillMonitor.ctorParameters = function () { return [\n { type: i1.Platform },\n { type: i0.NgZone }\n ]; };\n return AutofillMonitor;\n }());\n /** A directive that can be used to monitor the autofill state of an input. */\n var CdkAutofill = /** @class */ (function () {\n function CdkAutofill(_elementRef, _autofillMonitor) {\n this._elementRef = _elementRef;\n this._autofillMonitor = _autofillMonitor;\n /** Emits when the autofill state of the element changes. */\n this.cdkAutofill = new i0.EventEmitter();\n }\n CdkAutofill.prototype.ngOnInit = function () {\n var _this = this;\n this._autofillMonitor\n .monitor(this._elementRef)\n .subscribe(function (event) { return _this.cdkAutofill.emit(event); });\n };\n CdkAutofill.prototype.ngOnDestroy = function () {\n this._autofillMonitor.stopMonitoring(this._elementRef);\n };\n CdkAutofill.decorators = [\n { type: i0.Directive, args: [{\n selector: '[cdkAutofill]',\n },] }\n ];\n CdkAutofill.ctorParameters = function () { return [\n { type: i0.ElementRef },\n { type: AutofillMonitor }\n ]; };\n CdkAutofill.propDecorators = {\n cdkAutofill: [{ type: i0.Output }]\n };\n return CdkAutofill;\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 /** Directive to automatically resize a textarea to fit its content. */\n var CdkTextareaAutosize = /** @class */ (function () {\n function CdkTextareaAutosize(_elementRef, _platform, _ngZone, \n /** @breaking-change 11.0.0 make document required */\n document) {\n this._elementRef = _elementRef;\n this._platform = _platform;\n this._ngZone = _ngZone;\n this._destroyed = new rxjs.Subject();\n this._enabled = true;\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 this._previousMinRows = -1;\n this._document = document;\n this._textareaElement = this._elementRef.nativeElement;\n this._measuringClass = _platform.FIREFOX ?\n 'cdk-textarea-autosize-measuring-firefox' :\n 'cdk-textarea-autosize-measuring';\n }\n Object.defineProperty(CdkTextareaAutosize.prototype, \"minRows\", {\n /** Minimum amount of rows in the textarea. */\n get: function () { return this._minRows; },\n set: function (value) {\n this._minRows = coercion.coerceNumberProperty(value);\n this._setMinHeight();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CdkTextareaAutosize.prototype, \"maxRows\", {\n /** Maximum amount of rows in the textarea. */\n get: function () { return this._maxRows; },\n set: function (value) {\n this._maxRows = coercion.coerceNumberProperty(value);\n this._setMaxHeight();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CdkTextareaAutosize.prototype, \"enabled\", {\n /** Whether autosizing is enabled or not */\n get: function () { return this._enabled; },\n set: function (value) {\n value = coercion.coerceBooleanProperty(value);\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 enumerable: false,\n configurable: true\n });\n /** Sets the minimum height of the textarea as determined by minRows. */\n CdkTextareaAutosize.prototype._setMinHeight = function () {\n var minHeight = this.minRows && this._cachedLineHeight ?\n this.minRows * this._cachedLineHeight + \"px\" : null;\n if (minHeight) {\n this._textareaElement.style.minHeight = minHeight;\n }\n };\n /** Sets the maximum height of the textarea as determined by maxRows. */\n CdkTextareaAutosize.prototype._setMaxHeight = function () {\n var maxHeight = this.maxRows && this._cachedLineHeight ?\n this.maxRows * this._cachedLineHeight + \"px\" : null;\n if (maxHeight) {\n this._textareaElement.style.maxHeight = maxHeight;\n }\n };\n CdkTextareaAutosize.prototype.ngAfterViewInit = function () {\n var _this = this;\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 this.resizeToFitContent();\n this._ngZone.runOutsideAngular(function () {\n var window = _this._getWindow();\n rxjs.fromEvent(window, 'resize')\n .pipe(operators.auditTime(16), operators.takeUntil(_this._destroyed))\n .subscribe(function () { return _this.resizeToFitContent(true); });\n });\n }\n };\n CdkTextareaAutosize.prototype.ngOnDestroy = function () {\n this._destroyed.next();\n this._destroyed.complete();\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 CdkTextareaAutosize.prototype._cacheTextareaLineHeight = function () {\n if (this._cachedLineHeight) {\n return;\n }\n // Use a clone element because we have to override some styles.\n var textareaClone = this._textareaElement.cloneNode(false);\n textareaClone.rows = 1;\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 // 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 this._textareaElement.parentNode.appendChild(textareaClone);\n this._cachedLineHeight = textareaClone.clientHeight;\n this._textareaElement.parentNode.removeChild(textareaClone);\n // Min and max heights have to be re-calculated if the cached line height changes\n this._setMinHeight();\n this._setMaxHeight();\n };\n CdkTextareaAutosize.prototype.ngDoCheck = function () {\n if (this._platform.isBrowser) {\n this.resizeToFitContent();\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 CdkTextareaAutosize.prototype.resizeToFitContent = function (force) {\n var _this = this;\n if (force === void 0) { force = false; }\n // If autosizing is disabled, just skip everything else\n if (!this._enabled) {\n return;\n }\n this._cacheTextareaLineHeight();\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 var textarea = this._elementRef.nativeElement;\n var value = textarea.value;\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 var placeholderText = textarea.placeholder;\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(this._measuringClass);\n textarea.placeholder = '';\n // The measuring class includes a 2px padding to workaround an issue with Chrome,\n // so we account for that extra space here by subtracting 4 (2px top + 2px bottom).\n var height = textarea.scrollHeight - 4;\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(this._measuringClass);\n textarea.placeholder = placeholderText;\n this._ngZone.runOutsideAngular(function () {\n if (typeof requestAnimationFrame !== 'undefined') {\n requestAnimationFrame(function () { return _this._scrollToCaretPosition(textarea); });\n }\n else {\n setTimeout(function () { return _this._scrollToCaretPosition(textarea); });\n }\n });\n this._previousValue = value;\n this._previousMinRows = this._minRows;\n };\n /**\n * Resets the textarea to its original size\n */\n CdkTextareaAutosize.prototype.reset = function () {\n // Do not try to change the textarea, if the initialHeight has not been determined yet\n // This might potentially remove styles when reset() is called before ngAfterViewInit\n if (this._initialHeight !== undefined) {\n this._textareaElement.style.height = this._initialHeight;\n }\n };\n // In Ivy the `host` metadata will be merged, whereas in ViewEngine it is overridden. In order\n // to avoid double event listeners, we need to use `HostListener`. Once Ivy is the default, we\n // can move this back into `host`.\n // tslint:disable:no-host-decorator-in-concrete\n CdkTextareaAutosize.prototype._noopInputHandler = function () {\n // no-op handler that ensures we're running change detection on input events.\n };\n /** Access injected document if available or fallback to global document reference */\n CdkTextareaAutosize.prototype._getDocument = function () {\n return this._document || document;\n };\n /** Use defaultView of injected document if available or fallback to global window reference */\n CdkTextareaAutosize.prototype._getWindow = function () {\n var doc = this._getDocument();\n return doc.defaultView || window;\n };\n /**\n * Scrolls a textarea to the caret position. On Firefox resizing the textarea will\n * prevent it from scrolling to the caret position. We need to re-set the selection\n * in order for it to scroll to the proper position.\n */\n CdkTextareaAutosize.prototype._scrollToCaretPosition = function (textarea) {\n var selectionStart = textarea.selectionStart, selectionEnd = textarea.selectionEnd;\n var document = this._getDocument();\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 CdkTextareaAutosize.decorators = [\n { type: i0.Directive, args: [{\n selector: 'textarea[cdkTextareaAutosize]',\n exportAs: 'cdkTextareaAutosize',\n host: {\n 'class': 'cdk-textarea-autosize',\n // Textarea elements that have the directive applied should have a single row by default.\n // Browsers normally show two rows by default and therefore this limits the minRows binding.\n 'rows': '1',\n },\n },] }\n ];\n CdkTextareaAutosize.ctorParameters = function () { return [\n { type: i0.ElementRef },\n { type: i1.Platform },\n { type: i0.NgZone },\n { type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [common.DOCUMENT,] }] }\n ]; };\n CdkTextareaAutosize.propDecorators = {\n minRows: [{ type: i0.Input, args: ['cdkAutosizeMinRows',] }],\n maxRows: [{ type: i0.Input, args: ['cdkAutosizeMaxRows',] }],\n enabled: [{ type: i0.Input, args: ['cdkTextareaAutosize',] }],\n _noopInputHandler: [{ type: i0.HostListener, args: ['input',] }]\n };\n return CdkTextareaAutosize;\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 var TextFieldModule = /** @class */ (function () {\n function TextFieldModule() {\n }\n TextFieldModule.decorators = [\n { type: i0.NgModule, args: [{\n declarations: [CdkAutofill, CdkTextareaAutosize],\n imports: [i1.PlatformModule],\n exports: [CdkAutofill, CdkTextareaAutosize],\n },] }\n ];\n return TextFieldModule;\n }());\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n /**\n * Generated bundle index. Do not edit.\n */\n\n exports.AutofillMonitor = AutofillMonitor;\n exports.CdkAutofill = CdkAutofill;\n exports.CdkTextareaAutosize = CdkTextareaAutosize;\n exports.TextFieldModule = TextFieldModule;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=cdk-text-field.umd.js.map\n"]}
|
|
1
|
+
{"version":3,"sources":["src/cdk/cdk-text-field.umd.js"],"names":["global","factory","exports","module","require","define","amd","self","ng","cdk","textField","platform","core","coercion","rxjs","operators","common","this","i1","i0","listenerOptions","normalizePassiveListenerOptions","passive","AutofillMonitor","_platform","_ngZone","_monitoredElements","Map","prototype","monitor","elementOrRef","_this","isBrowser","EMPTY","element","coerceElement","info","get","subject","asObservable","result","Subject","cssClass","listener","event","animationName","classList","contains","remove","run","next","target","isAutofilled","add","runOutsideAngular","addEventListener","set","unlisten","removeEventListener","stopMonitoring","complete","delete","ngOnDestroy","forEach","_info","ɵprov","ɵɵdefineInjectable","AutofillMonitor_Factory","ɵɵinject","Platform","NgZone","token","providedIn","decorators","type","Injectable","args","ctorParameters","CdkAutofill","_elementRef","_autofillMonitor","cdkAutofill","EventEmitter","ngOnInit","subscribe","emit","Directive","selector","ElementRef","propDecorators","Output","TextFieldModule","CdkTextareaAutosize","document","_destroyed","_enabled","_previousMinRows","_document","_textareaElement","nativeElement","_measuringClass","FIREFOX","Object","defineProperty","_minRows","value","coerceNumberProperty","_setMinHeight","enumerable","configurable","_maxRows","_setMaxHeight","coerceBooleanProperty","resizeToFitContent","reset","minHeight","minRows","_cachedLineHeight","style","maxHeight","maxRows","ngAfterViewInit","_initialHeight","height","window","_getWindow","fromEvent","pipe","auditTime","takeUntil","_cacheTextareaLineHeight","textareaClone","cloneNode","rows","position","visibility","border","padding","overflow","parentNode","appendChild","clientHeight","removeChild","ngDoCheck","force","textarea","_previousValue","placeholderText","placeholder","scrollHeight","requestAnimationFrame","_scrollToCaretPosition","setTimeout","undefined","_noopInputHandler","_getDocument","defaultView","selectionStart","selectionEnd","isStopped","activeElement","setSelectionRange","exportAs","host","class","Optional","Inject","DOCUMENT","Input","enabled","HostListener","NgModule","declarations","imports","PlatformModule"],"mappings":"CAAC,SAAUA,EAAQC,GACI,iBAAZC,SAA0C,oBAAXC,OAAyBF,EAAQC,QAASE,QAAQ,yBAA0BA,QAAQ,iBAAkBA,QAAQ,yBAA0BA,QAAQ,QAASA,QAAQ,kBAAmBA,QAAQ,oBAChN,mBAAXC,QAAyBA,OAAOC,IAAMD,OAAO,0BAA2B,CAAC,UAAW,wBAAyB,gBAAiB,wBAAyB,OAAQ,iBAAkB,mBAAoBJ,GAClLA,IAAzBD,EAASA,GAAUO,MAAsBC,GAAKR,EAAOQ,IAAM,GAAIR,EAAOQ,GAAGC,IAAMT,EAAOQ,GAAGC,KAAO,GAAIT,EAAOQ,GAAGC,IAAIC,UAAY,IAAKV,EAAOQ,GAAGC,IAAIE,SAAUX,EAAOQ,GAAGI,KAAMZ,EAAOQ,GAAGC,IAAII,SAAUb,EAAOc,KAAMd,EAAOc,KAAKC,UAAWf,EAAOQ,GAAGQ,QAHtP,CAI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GAmOxCA,EAAoBnB,WAAa,CAC7B,CAAEC,KAAMvD,EAAGmE,UAAWV,KAAM,CAAC,CACjBW,SAAU,gCACV2E,SAAU,sBACVC,KAAM,CACFC,MAAS,wBAGT/B,KAAQ,SAI5BzC,EAAoBf,eAAiB,WAAc,MAAO,CACtD,CAAEH,KAAMvD,EAAGqE,YACX,CAAEd,KAAMxD,EAAGmD,UACX,CAAEK,KAAMvD,EAAGmD,QACX,CAAEI,UAAM+E,EAAWhF,WAAY,CAAC,CAAEC,KAAMvD,EAAGkJ,UAAY,CAAE3F,KAAMvD,EAAGmJ,OAAQ1F,KAAM,CAAC5D,EAAOuJ,eAE5F3E,EAAoBH,eAAiB,CACjC2B,QAAS,CAAC,CAAE1C,KAAMvD,EAAGqJ,MAAO5F,KAAM,CAAC,wBACnC4C,QAAS,CAAC,CAAE9C,KAAMvD,EAAGqJ,MAAO5F,KAAM,CAAC,wBACnC6F,QAAS,CAAC,CAAE/F,KAAMvD,EAAGqJ,MAAO5F,KAAM,CAAC,yBACnC8E,kBAAmB,CAAC,CAAEhF,KAAMvD,EAAGuJ,aAAc9F,KAAM,CAAC,aAUpDe,EACA,SAASA,OAIGlB,WAAa,CACzB,CAAEC,KAAMvD,EAAGwJ,SAAU/F,KAAM,CAAC,CAChBgG,aAAc,CAAC9F,EAAac,GAC5BiF,QAAS,CAAC3J,EAAG4J,gBACb5K,QAAS,CAAC4E,EAAac;;;;;;;;AAgBvC1F,EAAQqB,gBAAkBA,EAC1BrB,EAAQ4E,YAAcA,EACtB5E,EAAQ0F,oBAAsBA,EAC9B1F,EAAQyF,gBAAkBA,EAE1BW,OAAOC,eAAerG,EAAS,aAAc,CAAEuG,OAAO","sourcesContent":["(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/cdk/platform'), require('@angular/core'), require('@angular/cdk/coercion'), require('rxjs'), require('rxjs/operators'), require('@angular/common')) :\n typeof define === 'function' && define.amd ? define('@angular/cdk/text-field', ['exports', '@angular/cdk/platform', '@angular/core', '@angular/cdk/coercion', 'rxjs', 'rxjs/operators', '@angular/common'], factory) :\n (global = global || self, factory((global.ng = global.ng || {}, global.ng.cdk = global.ng.cdk || {}, global.ng.cdk.textField = {}), global.ng.cdk.platform, global.ng.core, global.ng.cdk.coercion, global.rxjs, global.rxjs.operators, global.ng.common));\n}(this, (function (exports, i1, i0, coercion, rxjs, operators, common) { 'use strict';\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n /** Options to pass to the animationstart listener. */\n var listenerOptions = i1.normalizePassiveListenerOptions({ passive: true });\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 var AutofillMonitor = /** @class */ (function () {\n function AutofillMonitor(_platform, _ngZone) {\n this._platform = _platform;\n this._ngZone = _ngZone;\n this._monitoredElements = new Map();\n }\n AutofillMonitor.prototype.monitor = function (elementOrRef) {\n var _this = this;\n if (!this._platform.isBrowser) {\n return rxjs.EMPTY;\n }\n var element = coercion.coerceElement(elementOrRef);\n var info = this._monitoredElements.get(element);\n if (info) {\n return info.subject.asObservable();\n }\n var result = new rxjs.Subject();\n var cssClass = 'cdk-text-field-autofilled';\n var listener = (function (event) {\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(function () { return result.next({ target: event.target, isAutofilled: true }); });\n }\n else if (event.animationName === 'cdk-text-field-autofill-end' &&\n element.classList.contains(cssClass)) {\n element.classList.remove(cssClass);\n _this._ngZone.run(function () { return result.next({ target: event.target, isAutofilled: false }); });\n }\n });\n this._ngZone.runOutsideAngular(function () {\n element.addEventListener('animationstart', listener, listenerOptions);\n element.classList.add('cdk-text-field-autofill-monitored');\n });\n this._monitoredElements.set(element, {\n subject: result,\n unlisten: function () {\n element.removeEventListener('animationstart', listener, listenerOptions);\n }\n });\n return result.asObservable();\n };\n AutofillMonitor.prototype.stopMonitoring = function (elementOrRef) {\n var element = coercion.coerceElement(elementOrRef);\n var info = this._monitoredElements.get(element);\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 AutofillMonitor.prototype.ngOnDestroy = function () {\n var _this = this;\n this._monitoredElements.forEach(function (_info, element) { return _this.stopMonitoring(element); });\n };\n return AutofillMonitor;\n }());\n AutofillMonitor.ɵprov = i0.ɵɵdefineInjectable({ factory: function AutofillMonitor_Factory() { return new AutofillMonitor(i0.ɵɵinject(i1.Platform), i0.ɵɵinject(i0.NgZone)); }, token: AutofillMonitor, providedIn: \"root\" });\n AutofillMonitor.decorators = [\n { type: i0.Injectable, args: [{ providedIn: 'root' },] }\n ];\n AutofillMonitor.ctorParameters = function () { return [\n { type: i1.Platform },\n { type: i0.NgZone }\n ]; };\n /** A directive that can be used to monitor the autofill state of an input. */\n var CdkAutofill = /** @class */ (function () {\n function CdkAutofill(_elementRef, _autofillMonitor) {\n this._elementRef = _elementRef;\n this._autofillMonitor = _autofillMonitor;\n /** Emits when the autofill state of the element changes. */\n this.cdkAutofill = new i0.EventEmitter();\n }\n CdkAutofill.prototype.ngOnInit = function () {\n var _this = this;\n this._autofillMonitor\n .monitor(this._elementRef)\n .subscribe(function (event) { return _this.cdkAutofill.emit(event); });\n };\n CdkAutofill.prototype.ngOnDestroy = function () {\n this._autofillMonitor.stopMonitoring(this._elementRef);\n };\n return CdkAutofill;\n }());\n CdkAutofill.decorators = [\n { type: i0.Directive, args: [{\n selector: '[cdkAutofill]',\n },] }\n ];\n CdkAutofill.ctorParameters = function () { return [\n { type: i0.ElementRef },\n { type: AutofillMonitor }\n ]; };\n CdkAutofill.propDecorators = {\n cdkAutofill: [{ type: i0.Output }]\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 /** Directive to automatically resize a textarea to fit its content. */\n var CdkTextareaAutosize = /** @class */ (function () {\n function CdkTextareaAutosize(_elementRef, _platform, _ngZone, \n /** @breaking-change 11.0.0 make document required */\n document) {\n this._elementRef = _elementRef;\n this._platform = _platform;\n this._ngZone = _ngZone;\n this._destroyed = new rxjs.Subject();\n this._enabled = true;\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 this._previousMinRows = -1;\n this._document = document;\n this._textareaElement = this._elementRef.nativeElement;\n this._measuringClass = _platform.FIREFOX ?\n 'cdk-textarea-autosize-measuring-firefox' :\n 'cdk-textarea-autosize-measuring';\n }\n Object.defineProperty(CdkTextareaAutosize.prototype, \"minRows\", {\n /** Minimum amount of rows in the textarea. */\n get: function () { return this._minRows; },\n set: function (value) {\n this._minRows = coercion.coerceNumberProperty(value);\n this._setMinHeight();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CdkTextareaAutosize.prototype, \"maxRows\", {\n /** Maximum amount of rows in the textarea. */\n get: function () { return this._maxRows; },\n set: function (value) {\n this._maxRows = coercion.coerceNumberProperty(value);\n this._setMaxHeight();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CdkTextareaAutosize.prototype, \"enabled\", {\n /** Whether autosizing is enabled or not */\n get: function () { return this._enabled; },\n set: function (value) {\n value = coercion.coerceBooleanProperty(value);\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 enumerable: false,\n configurable: true\n });\n /** Sets the minimum height of the textarea as determined by minRows. */\n CdkTextareaAutosize.prototype._setMinHeight = function () {\n var minHeight = this.minRows && this._cachedLineHeight ?\n this.minRows * this._cachedLineHeight + \"px\" : null;\n if (minHeight) {\n this._textareaElement.style.minHeight = minHeight;\n }\n };\n /** Sets the maximum height of the textarea as determined by maxRows. */\n CdkTextareaAutosize.prototype._setMaxHeight = function () {\n var maxHeight = this.maxRows && this._cachedLineHeight ?\n this.maxRows * this._cachedLineHeight + \"px\" : null;\n if (maxHeight) {\n this._textareaElement.style.maxHeight = maxHeight;\n }\n };\n CdkTextareaAutosize.prototype.ngAfterViewInit = function () {\n var _this = this;\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 this.resizeToFitContent();\n this._ngZone.runOutsideAngular(function () {\n var window = _this._getWindow();\n rxjs.fromEvent(window, 'resize')\n .pipe(operators.auditTime(16), operators.takeUntil(_this._destroyed))\n .subscribe(function () { return _this.resizeToFitContent(true); });\n });\n }\n };\n CdkTextareaAutosize.prototype.ngOnDestroy = function () {\n this._destroyed.next();\n this._destroyed.complete();\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 CdkTextareaAutosize.prototype._cacheTextareaLineHeight = function () {\n if (this._cachedLineHeight) {\n return;\n }\n // Use a clone element because we have to override some styles.\n var textareaClone = this._textareaElement.cloneNode(false);\n textareaClone.rows = 1;\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 // 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 this._textareaElement.parentNode.appendChild(textareaClone);\n this._cachedLineHeight = textareaClone.clientHeight;\n this._textareaElement.parentNode.removeChild(textareaClone);\n // Min and max heights have to be re-calculated if the cached line height changes\n this._setMinHeight();\n this._setMaxHeight();\n };\n CdkTextareaAutosize.prototype.ngDoCheck = function () {\n if (this._platform.isBrowser) {\n this.resizeToFitContent();\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 CdkTextareaAutosize.prototype.resizeToFitContent = function (force) {\n var _this = this;\n if (force === void 0) { force = false; }\n // If autosizing is disabled, just skip everything else\n if (!this._enabled) {\n return;\n }\n this._cacheTextareaLineHeight();\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 var textarea = this._elementRef.nativeElement;\n var value = textarea.value;\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 var placeholderText = textarea.placeholder;\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(this._measuringClass);\n textarea.placeholder = '';\n // The measuring class includes a 2px padding to workaround an issue with Chrome,\n // so we account for that extra space here by subtracting 4 (2px top + 2px bottom).\n var height = textarea.scrollHeight - 4;\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(this._measuringClass);\n textarea.placeholder = placeholderText;\n this._ngZone.runOutsideAngular(function () {\n if (typeof requestAnimationFrame !== 'undefined') {\n requestAnimationFrame(function () { return _this._scrollToCaretPosition(textarea); });\n }\n else {\n setTimeout(function () { return _this._scrollToCaretPosition(textarea); });\n }\n });\n this._previousValue = value;\n this._previousMinRows = this._minRows;\n };\n /**\n * Resets the textarea to its original size\n */\n CdkTextareaAutosize.prototype.reset = function () {\n // Do not try to change the textarea, if the initialHeight has not been determined yet\n // This might potentially remove styles when reset() is called before ngAfterViewInit\n if (this._initialHeight !== undefined) {\n this._textareaElement.style.height = this._initialHeight;\n }\n };\n // In Ivy the `host` metadata will be merged, whereas in ViewEngine it is overridden. In order\n // to avoid double event listeners, we need to use `HostListener`. Once Ivy is the default, we\n // can move this back into `host`.\n // tslint:disable:no-host-decorator-in-concrete\n CdkTextareaAutosize.prototype._noopInputHandler = function () {\n // no-op handler that ensures we're running change detection on input events.\n };\n /** Access injected document if available or fallback to global document reference */\n CdkTextareaAutosize.prototype._getDocument = function () {\n return this._document || document;\n };\n /** Use defaultView of injected document if available or fallback to global window reference */\n CdkTextareaAutosize.prototype._getWindow = function () {\n var doc = this._getDocument();\n return doc.defaultView || window;\n };\n /**\n * Scrolls a textarea to the caret position. On Firefox resizing the textarea will\n * prevent it from scrolling to the caret position. We need to re-set the selection\n * in order for it to scroll to the proper position.\n */\n CdkTextareaAutosize.prototype._scrollToCaretPosition = function (textarea) {\n var selectionStart = textarea.selectionStart, selectionEnd = textarea.selectionEnd;\n var document = this._getDocument();\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 return CdkTextareaAutosize;\n }());\n CdkTextareaAutosize.decorators = [\n { type: i0.Directive, args: [{\n selector: 'textarea[cdkTextareaAutosize]',\n exportAs: 'cdkTextareaAutosize',\n host: {\n 'class': 'cdk-textarea-autosize',\n // Textarea elements that have the directive applied should have a single row by default.\n // Browsers normally show two rows by default and therefore this limits the minRows binding.\n 'rows': '1',\n },\n },] }\n ];\n CdkTextareaAutosize.ctorParameters = function () { return [\n { type: i0.ElementRef },\n { type: i1.Platform },\n { type: i0.NgZone },\n { type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [common.DOCUMENT,] }] }\n ]; };\n CdkTextareaAutosize.propDecorators = {\n minRows: [{ type: i0.Input, args: ['cdkAutosizeMinRows',] }],\n maxRows: [{ type: i0.Input, args: ['cdkAutosizeMaxRows',] }],\n enabled: [{ type: i0.Input, args: ['cdkTextareaAutosize',] }],\n _noopInputHandler: [{ type: i0.HostListener, args: ['input',] }]\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 var TextFieldModule = /** @class */ (function () {\n function TextFieldModule() {\n }\n return TextFieldModule;\n }());\n TextFieldModule.decorators = [\n { type: i0.NgModule, args: [{\n declarations: [CdkAutofill, CdkTextareaAutosize],\n imports: [i1.PlatformModule],\n exports: [CdkAutofill, CdkTextareaAutosize],\n },] }\n ];\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n /**\n * Generated bundle index. Do not edit.\n */\n\n exports.AutofillMonitor = AutofillMonitor;\n exports.CdkAutofill = CdkAutofill;\n exports.CdkTextareaAutosize = CdkTextareaAutosize;\n exports.TextFieldModule = TextFieldModule;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=cdk-text-field.umd.js.map\n"]}
|