import { Component } from '@angular/core';
import { DefaultEditorDirective } from '../../../lib/editor-cell-default';
import { TranslatePipe } from '@ngx-translate/core';
import { PopoverTriggerDirective } from '../../../../popover/popover.component';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import * as i0 from "@angular/core";
import * as i1 from "@angular/forms";
export class TextareaEditorComponent extends DefaultEditorDirective {
    constructor() {
        super();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TextareaEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: TextareaEditorComponent, isStandalone: true, selector: "textarea-editor", usesInheritance: true, ngImport: i0, template: `
        <div class="form-cell form-editor-textarea" [formGroup]="editingFormGroup">
          <textarea
            class="form-control slds-input"
            [placeholder]="cell.column.title | translate"
        
            [formControlName]="cell.column.id"
            (input)="cell.newValue = $event.target.value;"
            [name]="cell.column.id"
        
            (click)="onClick.emit($event)"
            (keydown.enter)="onEdited.emit($event)"
            (keydown.esc)="onStopEditing.emit()"
        
            uno-popover-trigger
            [unoPopover]="formErrorsContent"
            [unoPopoverOpen]="openValidatorPopover"
            unoPopoverSize="small"
            unoPopoverTooltip="true"
            [unoPopoverTheme]="cell.column.editor?.inputPopoverTheme || 'info'">
          </textarea>
        </div>
        
        <!-- This Controller's Input Validator errors: -->
        <ng-template #formErrorsContent>
          @for (errors of errorsData; track errors) {
            @if (errors.input === cell.column.id) {
              @for (strError of errors.translated; track strError) {
                <div>
                  {{ strError }}
                </div>
              }
            }
          }
        </ng-template>
        `, isInline: true, styles: [":host input,:host textarea{width:100%;line-height:normal;padding:.375em .75em}:host input.form-control.ng-invalid.ng-touched,:host textarea.form-control.ng-invalid.ng-touched{border:1px solid var(--special-red-2)}:host input.form-control.ng-valid.ng-touched:not(.no-validator),:host textarea.form-control.ng-valid.ng-touched:not(.no-validator){border:none}.line-clamp{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;word-break:normal;overflow:hidden}.view-default-expanded{text-align:justify;word-wrap:break-word}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: PopoverTriggerDirective, selector: "[uno-popover-trigger]", inputs: ["unoPopover", "unoPopoverHeader", "unoPopoverFooter", "unoPopoverTemplate", "unoPopoverTemplateData", "hasEdit", "hasDelete", "infoTitle", "infoCreatedBy", "infoModifiedBy", "infoDate", "unoPopoverPlacement", "unoPopoverTheme", "unoPopoverNubbin", "unoPopoverSize", "unoPopoverTooltip", "unoPopoverDelay", "unoPopoverInteractive", "unoPopoverOpen"], outputs: ["unoPopoverToggled", "unoPopoverTemplateEvent"], exportAs: ["unoPopoverTrigger"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TextareaEditorComponent, decorators: [{
            type: Component,
            args: [{ selector: 'textarea-editor', template: `
        <div class="form-cell form-editor-textarea" [formGroup]="editingFormGroup">
          <textarea
            class="form-control slds-input"
            [placeholder]="cell.column.title | translate"
        
            [formControlName]="cell.column.id"
            (input)="cell.newValue = $event.target.value;"
            [name]="cell.column.id"
        
            (click)="onClick.emit($event)"
            (keydown.enter)="onEdited.emit($event)"
            (keydown.esc)="onStopEditing.emit()"
        
            uno-popover-trigger
            [unoPopover]="formErrorsContent"
            [unoPopoverOpen]="openValidatorPopover"
            unoPopoverSize="small"
            unoPopoverTooltip="true"
            [unoPopoverTheme]="cell.column.editor?.inputPopoverTheme || 'info'">
          </textarea>
        </div>
        
        <!-- This Controller's Input Validator errors: -->
        <ng-template #formErrorsContent>
          @for (errors of errorsData; track errors) {
            @if (errors.input === cell.column.id) {
              @for (strError of errors.translated; track strError) {
                <div>
                  {{ strError }}
                </div>
              }
            }
          }
        </ng-template>
        `, standalone: true, imports: [
                        FormsModule,
                        ReactiveFormsModule,
                        PopoverTriggerDirective,
                        TranslatePipe
                    ], styles: [":host input,:host textarea{width:100%;line-height:normal;padding:.375em .75em}:host input.form-control.ng-invalid.ng-touched,:host textarea.form-control.ng-invalid.ng-touched{border:1px solid var(--special-red-2)}:host input.form-control.ng-valid.ng-touched:not(.no-validator),:host textarea.form-control.ng-valid.ng-touched:not(.no-validator){border:none}.line-clamp{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;word-break:normal;overflow:hidden}.view-default-expanded{text-align:justify;word-wrap:break-word}\n"] }]
        }], ctorParameters: () => [] });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGV4dGFyZWEtZWRpdG9yLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3Vuby11aS1saWIvc3JjL2xpYi90YWJsZS9jb21wb25lbnRzL2NlbGwvY2VsbC1lZGl0b3JzL3RleHRhcmVhLWVkaXRvci5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQ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