import { CdkTextareaAutosize } from '@angular/cdk/text-field';
import { Component, ViewChild } from '@angular/core';
import { ValueEdit } from '../../value-edit';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@angular/forms";
import * as i3 from "@angular/material/legacy-form-field";
import * as i4 from "@angular/cdk/text-field";
import * as i5 from "@angular/material/legacy-input";
import * as i6 from "@aztrix/icons";
import * as i7 from "@aztrix/components/clear-button";
import * as i8 from "@aztrix/components/autofocus";
import * as i9 from "@aztrix/components/property-published-button";
export class TextareaEditComponent extends ValueEdit {
    ngOnInit() {
        setTimeout(() => {
            this.autoSizer.resizeToFitContent(true);
        }, 500);
    }
}
TextareaEditComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: TextareaEditComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
TextareaEditComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: TextareaEditComponent, selector: "ax-textarea-edit", viewQueries: [{ propertyName: "autoSizer", first: true, predicate: ["autoSizer"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<ax-icon *ngIf=\"icon\" class=\"icon type-icon\" [name]=\"icon\"></ax-icon>\n\n<mat-form-field\n  class=\"c-input\"\n  [ngClass]=\"{'remove-subtext': !errorsTemplate && !hint, readonly: readonly}\"\n  appearance=\"outline\"\n  [floatLabel]=\"floatLabel\"\n>\n  <mat-label\n    ><span *ngIf=\"label\">{{ label }}</span></mat-label\n  >\n  <textarea\n    type=\"text\"\n    matInput\n    axAutofocus\n    #autoSizer=\"cdkTextareaAutosize\"\n    cdkTextareaAutosize\n    cdkAutosizeMinRows=\"1\"\n    cdkAutosizeMaxRows=\"10\"\n    autocomplete=\"off\"\n    [formControl]=\"form\"\n    [placeholder]=\"placeholder\"\n    [autofocus]=\"autofocus\"\n    [required]=\"required\"\n    [readonly]=\"readonly\"\n    (change)=\"$event.preventDefault()\"\n    (focus)=\"focused.emit()\"\n  ></textarea>\n  <mat-hint\n    [ngClass]=\"{collapsed}\"\n    (click)=\"collapsed = !collapsed\"\n    class=\"hint collapsible\"\n    align=\"end\"\n    #hintElement\n  >\n    <div><ax-icon *ngIf=\"isOverflowing()\" class=\"icon\" name=\"chevron-down\"></ax-icon></div>\n    <span [ngClass]=\"{overflowing: isOverflowing()}\">{{ hint }}</span>\n  </mat-hint>\n  <ax-clear-button matSuffix [form]=\"form\" *ngIf=\"hasValue && !form.disabled\"></ax-clear-button>\n  <ng-content matSuffix></ng-content>\n  <mat-error *ngIf=\"errorsTemplate\">\n    <ng-template [ngTemplateOutlet]=\"errorsTemplate\"></ng-template>\n  </mat-error>\n</mat-form-field>\n<ax-property-published-button *ngIf=\"published\"></ax-property-published-button>\n", styles: [":host{display:block;position:relative}.type-icon{margin-top:20px}\n", ":host .type-icon{display:none}:host.showIcon{display:grid;grid-template-columns:38px 1fr}:host.showIcon .type-icon{display:inline}\n", "input::placeholder,area::placeholder{color:#0006}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.MatLegacyError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i3.MatLegacyFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLegacyHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatLegacyLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatLegacySuffix, selector: "[matSuffix]" }, { kind: "directive", type: i4.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { kind: "directive", type: i5.MatLegacyInput, selector: "input[matInput], textarea[matInput], select[matNativeControl],      input[matNativeControl], textarea[matNativeControl]", exportAs: ["matInput"] }, { kind: "component", type: i6.IconComponent, selector: "ax-icon", inputs: ["name", "inline"] }, { kind: "component", type: i7.ClearButtonComponent, selector: "ax-clear-button", inputs: ["form"] }, { kind: "directive", type: i8.AutofocusDirective, selector: "[axAutofocus]", inputs: ["autofocus"] }, { kind: "component", type: i9.PropertyPublishedButtonComponent, selector: "ax-property-published-button" }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: TextareaEditComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-textarea-edit', template: "<ax-icon *ngIf=\"icon\" class=\"icon type-icon\" [name]=\"icon\"></ax-icon>\n\n<mat-form-field\n  class=\"c-input\"\n  [ngClass]=\"{'remove-subtext': !errorsTemplate && !hint, readonly: readonly}\"\n  appearance=\"outline\"\n  [floatLabel]=\"floatLabel\"\n>\n  <mat-label\n    ><span *ngIf=\"label\">{{ label }}</span></mat-label\n  >\n  <textarea\n    type=\"text\"\n    matInput\n    axAutofocus\n    #autoSizer=\"cdkTextareaAutosize\"\n    cdkTextareaAutosize\n    cdkAutosizeMinRows=\"1\"\n    cdkAutosizeMaxRows=\"10\"\n    autocomplete=\"off\"\n    [formControl]=\"form\"\n    [placeholder]=\"placeholder\"\n    [autofocus]=\"autofocus\"\n    [required]=\"required\"\n    [readonly]=\"readonly\"\n    (change)=\"$event.preventDefault()\"\n    (focus)=\"focused.emit()\"\n  ></textarea>\n  <mat-hint\n    [ngClass]=\"{collapsed}\"\n    (click)=\"collapsed = !collapsed\"\n    class=\"hint collapsible\"\n    align=\"end\"\n    #hintElement\n  >\n    <div><ax-icon *ngIf=\"isOverflowing()\" class=\"icon\" name=\"chevron-down\"></ax-icon></div>\n    <span [ngClass]=\"{overflowing: isOverflowing()}\">{{ hint }}</span>\n  </mat-hint>\n  <ax-clear-button matSuffix [form]=\"form\" *ngIf=\"hasValue && !form.disabled\"></ax-clear-button>\n  <ng-content matSuffix></ng-content>\n  <mat-error *ngIf=\"errorsTemplate\">\n    <ng-template [ngTemplateOutlet]=\"errorsTemplate\"></ng-template>\n  </mat-error>\n</mat-form-field>\n<ax-property-published-button *ngIf=\"published\"></ax-property-published-button>\n", styles: [":host{display:block;position:relative}.type-icon{margin-top:20px}\n", ":host .type-icon{display:none}:host.showIcon{display:grid;grid-template-columns:38px 1fr}:host.showIcon .type-icon{display:inline}\n", "input::placeholder,area::placeholder{color:#0006}\n"] }]
        }], propDecorators: { autoSizer: [{
                type: ViewChild,
                args: ['autoSizer']
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGV4dGFyZWEtZWRpdC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvbXBvbmVudHMvdmFsdWUtZWRpdC92YWx1ZS1lZGl0cy90ZXh0YXJlYS1lZGl0L3RleHRhcmVhLWVkaXQuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb21wb25lbnRzL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