import { Component, ChangeDetectionStrategy } 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 InputEditorComponent extends DefaultEditorDirective {
    constructor() {
        super();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: InputEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: InputEditorComponent, isStandalone: true, selector: "input-editor", usesInheritance: true, ngImport: i0, template: `
        <div class="form-cell form-editor-input" [formGroup]="editingFormGroup">
          <input
            class="form-control slds-input"
            [placeholder]="!cell.column.isEditable ? '-' : cell.column.title | translate"
        
            [formControlName]="cell.column.id"
            [readonly]="!cell.column.isEditable"
            (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'">
          </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" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: InputEditorComponent, decorators: [{
            type: Component,
            args: [{ selector: 'input-editor', template: `
        <div class="form-cell form-editor-input" [formGroup]="editingFormGroup">
          <input
            class="form-control slds-input"
            [placeholder]="!cell.column.isEditable ? '-' : cell.column.title | translate"
        
            [formControlName]="cell.column.id"
            [readonly]="!cell.column.isEditable"
            (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'">
          </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>
        `, changeDetection: ChangeDetectionStrategy.OnPush, 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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5wdXQtZWRpdG9yLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3Vuby11aS1saWIvc3JjL2xpYi90YWJsZS9jb21wb25lbnRzL2NlbGwvY2VsbC1lZGl0b3JzL2lucHV0LWVkaXR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ICAgICAgICAgW25hbWVdPVwiY2VsbC5jb2x1bW4uaWRcIlxuICAgICAgICBcbiAgICAgICAgICAgIChjbGljayk9XCJvbkNsaWNrLmVtaXQoJGV2ZW50KVwiXG4gICAgICAgICAgICAoa2V5ZG93bi5lbnRlcik9XCJvbkVkaXRlZC5lbWl0KCRldmVudClcIlxuICAgICAgICAgICAgKGtleWRvd24uZXNjKT1cIm9uU3RvcEVkaXRpbmcuZW1pdCgpXCJcbiAgICAgICAgXG4gICAgICAgICAgICB1bm8tcG9wb3Zlci10cmlnZ2VyXG4gICAgICAgICAgICBbdW5vUG9wb3Zlcl09XCJmb3JtRXJyb3JzQ29udGVudFwiXG4gICAgICAgICAgICBbdW5vUG9wb3Zlck9wZW5dPVwib3BlblZhbGlkYXRvclBvcG92ZXJcIlxuICAgICAgICAgICAgdW5vUG9wb3ZlclNpemU9XCJzbWFsbFwiXG4gICAgICAgICAgICB1bm9Qb3BvdmVyVG9vbHRpcD1cInRydWVcIlxuICAgICAgICAgICAgW3Vub1BvcG92ZXJUaGVtZV09XCJjZWxsLmNvbHVtbi5lZGl0b3I/LmlucHV0UG9wb3ZlclRoZW1lIHx8ICdpbmZvJ1wiPlxuICAgICAgICAgIDwvZGl2PlxuICAgICAgICBcbiAgICAgICAgICA8IS0tIFRoaXMgQ29udHJvbGxlcidzIElucHV0IFZhbGlkYXRvciBlcnJvcnM6IC0tPlxuICAgICAgICAgIDxuZy10ZW1wbGF0ZSAjZm9ybUVycm9yc0NvbnRlbnQ+XG4gICAgICAgICAgICBAZm9yIChlcnJvcnMgb2YgZXJyb3JzRGF0YTsgdHJhY2sgZXJyb3JzKSB7XG4gICAgICAgICAgICAgIEBpZiAoZXJyb3JzLmlucHV0ID09PSBjZWxsLmNvbHVtbi5pZCkge1xuICAgICAgICAgICAgICAgIEBmb3IgKHN0ckVycm9yIG9mIGVycm9ycy50cmFuc2xhdGVkOyB0cmFjayBzdHJFcnJvcikge1xuICAgICAgICAgICAgICAgICAgPGRpdj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