1 | /**
|
---|
2 | * @license
|
---|
3 | * Copyright Google LLC All Rights Reserved.
|
---|
4 | *
|
---|
5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
6 | * found in the LICENSE file at https://angular.io/license
|
---|
7 | */
|
---|
8 | import { CdkTextareaAutosize } from '@angular/cdk/text-field';
|
---|
9 | import { Directive, Input } from '@angular/core';
|
---|
10 | /**
|
---|
11 | * Directive to automatically resize a textarea to fit its content.
|
---|
12 | * @deprecated Use `cdkTextareaAutosize` from `@angular/cdk/text-field` instead.
|
---|
13 | * @breaking-change 8.0.0
|
---|
14 | */
|
---|
15 | export class MatTextareaAutosize extends CdkTextareaAutosize {
|
---|
16 | get matAutosizeMinRows() { return this.minRows; }
|
---|
17 | set matAutosizeMinRows(value) { this.minRows = value; }
|
---|
18 | get matAutosizeMaxRows() { return this.maxRows; }
|
---|
19 | set matAutosizeMaxRows(value) { this.maxRows = value; }
|
---|
20 | get matAutosize() { return this.enabled; }
|
---|
21 | set matAutosize(value) { this.enabled = value; }
|
---|
22 | get matTextareaAutosize() { return this.enabled; }
|
---|
23 | set matTextareaAutosize(value) { this.enabled = value; }
|
---|
24 | }
|
---|
25 | MatTextareaAutosize.decorators = [
|
---|
26 | { type: Directive, args: [{
|
---|
27 | selector: 'textarea[mat-autosize], textarea[matTextareaAutosize]',
|
---|
28 | exportAs: 'matTextareaAutosize',
|
---|
29 | inputs: ['cdkAutosizeMinRows', 'cdkAutosizeMaxRows'],
|
---|
30 | host: {
|
---|
31 | 'class': 'cdk-textarea-autosize mat-autosize',
|
---|
32 | // Textarea elements that have the directive applied should have a single row by default.
|
---|
33 | // Browsers normally show two rows by default and therefore this limits the minRows binding.
|
---|
34 | 'rows': '1',
|
---|
35 | },
|
---|
36 | },] }
|
---|
37 | ];
|
---|
38 | MatTextareaAutosize.propDecorators = {
|
---|
39 | matAutosizeMinRows: [{ type: Input }],
|
---|
40 | matAutosizeMaxRows: [{ type: Input }],
|
---|
41 | matAutosize: [{ type: Input, args: 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