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/form-field";
import * as i4 from "@angular/material/input";
import * as i5 from "@angular/cdk/text-field";
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);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: TextareaEditComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", 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>{{ label }}</mat-label>\n  <textarea\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: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl],      input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i5.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { 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: "17.3.11", 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>{{ label }}</mat-label>\n  <textarea\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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGV4dGFyZWEtZWRpdC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvbXBvbmVudHMvdmFsdWUtZWRpdC92YWx1ZS1lZGl0cy90ZXh0YXJlYS1lZGl0L3RleHRhcmVhLWVkaXQuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb21wb25lbn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