import { Component, Inject, ViewEncapsulation } from "@angular/core";
import { MAT_DIALOG_DATA } from "@angular/material/dialog";
import { Subject } from "rxjs";
import { takeUntil } from "rxjs/operators";
import * as i0 from "@angular/core";
import * as i1 from "@angular/material/dialog";
import * as i2 from "../../services/translation-registry.service";
import * as i3 from "@angular/material/icon";
import * as i4 from "@angular/material/form-field";
import * as i5 from "@angular/material/input";
import * as i6 from "@angular/forms";
import * as i7 from "../button/button";
export class QMSEditFileNameDialog {
    constructor(dialogRef, trans, data) {
        this.dialogRef = dialogRef;
        this.trans = trans;
        this.data = data;
        this.ngUnsubscribe = new Subject();
        this.fileName = this.data;
        this.trans.getLanguageSubject$.pipe(takeUntil(this.ngUnsubscribe)).subscribe((res) => {
            if (res) {
                this.LANG = this.trans.getObjectLang(res);
            }
        });
    }
    cancel() {
        this.dialogRef.close(null);
    }
    saveChanges() {
        this.dialogRef.close(this.fileName);
    }
    clearInput() {
        this.fileName = '';
    }
    ngOnDestroy() {
        this.ngUnsubscribe.next();
        this.ngUnsubscribe.complete();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: QMSEditFileNameDialog, deps: [{ token: i1.MatDialogRef }, { token: i2.TranslateLibraryService }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: QMSEditFileNameDialog, selector: "qms-edit-file-name-dialog", ngImport: i0, template: "<div>\n    <div class=\"qms-edit-file-name-dialog__header\">\n      <span class=\"qms-edit-file-name-dialog__header-title\">\n        {{ LANG.EDIT_FILE_NAME }}\n      </span>\n      <button qms-btn-text class=\"qms-edit-file-name-dialog__header-exit\" (click)=\"cancel()\">\n        <mat-icon>clear</mat-icon>\n      </button>\n    </div>\n    <mat-dialog-content>\n    <div class='qms-edit-file-name-dialog'>\n        <mat-form-field appearance=\"fill\" class=\"qms-form qms-search-field qms-edit-file-name-dialog__form-input\">\n            <input matInput [(ngModel)]=\"fileName\" type=\"text\" placeholder=\"{{ LANG.FILE_NAME }}\">\n        </mat-form-field>\n    </div>\n    </mat-dialog-content>\n    <mat-dialog-actions align=\"end\">\n        <button qms-btn-text (click)=\"cancel()\" class=\"qms-edit-file-name-dialog__form-action-exit-btn\">\n          <span>{{ LANG.CANCEL_BUTTON }}</span>\n        </button>\n        <button  qms-btn color=\"primary\" (click)=\"saveChanges()\">\n          <span>{{ LANG.SAVE_BUTTON }}</span>\n        </button>\n      </mat-dialog-actions>\n</div>", styles: [".qms-edit-file-name-dialog__form-input{width:100%}.qms-edit-file-name-dialog__form-action-exit-btn{margin-right:.5rem}.qms-edit-file-name-dialog__header{display:flex;align-items:center;margin-bottom:1rem;color:#323232}.qms-edit-file-name-dialog__header .qms-edit-file-name-dialog__header-title{font-weight:600;font-family:Raleway}.qms-edit-file-name-dialog__header .qms-edit-file-name-dialog__header-exit{color:#0009;margin-left:auto}.qms-edit-file-name-dialog__warning{margin-bottom:.5rem}\n"], dependencies: [{ kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.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: i6.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: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i7.QMSButton, selector: "button[qms-btn], button[qms-btn-lg], button[qms-btn-outlined],\n               button[qms-btn-outlined-lg], button[qms-btn-text], button[qms-btn-text-lg],\n               button[qms-btn-fab],button[qms-btn-fab-sm],button[qms-btn-fab-ext],\n               button[qms-btn-fab-outlined],button[qms-btn-fab-outlined-sm],button[qms-btn-fab-outlined-ext]", inputs: ["disabled", "color"], exportAs: ["qmsButton"] }], encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: QMSEditFileNameDialog, decorators: [{
            type: Component,
            args: [{ selector: 'qms-edit-file-name-dialog', encapsulation: ViewEncapsulation.None, template: "<div>\n    <div class=\"qms-edit-file-name-dialog__header\">\n      <span class=\"qms-edit-file-name-dialog__header-title\">\n        {{ LANG.EDIT_FILE_NAME }}\n      </span>\n      <button qms-btn-text class=\"qms-edit-file-name-dialog__header-exit\" (click)=\"cancel()\">\n        <mat-icon>clear</mat-icon>\n      </button>\n    </div>\n    <mat-dialog-content>\n    <div class='qms-edit-file-name-dialog'>\n        <mat-form-field appearance=\"fill\" class=\"qms-form qms-search-field qms-edit-file-name-dialog__form-input\">\n            <input matInput [(ngModel)]=\"fileName\" type=\"text\" placeholder=\"{{ LANG.FILE_NAME }}\">\n        </mat-form-field>\n    </div>\n    </mat-dialog-content>\n    <mat-dialog-actions align=\"end\">\n        <button qms-btn-text (click)=\"cancel()\" class=\"qms-edit-file-name-dialog__form-action-exit-btn\">\n          <span>{{ LANG.CANCEL_BUTTON }}</span>\n        </button>\n        <button  qms-btn color=\"primary\" (click)=\"saveChanges()\">\n          <span>{{ LANG.SAVE_BUTTON }}</span>\n        </button>\n      </mat-dialog-actions>\n</div>", styles: [".qms-edit-file-name-dialog__form-input{width:100%}.qms-edit-file-name-dialog__form-action-exit-btn{margin-right:.5rem}.qms-edit-file-name-dialog__header{display:flex;align-items:center;margin-bottom:1rem;color:#323232}.qms-edit-file-name-dialog__header .qms-edit-file-name-dialog__header-title{font-weight:600;font-family:Raleway}.qms-edit-file-name-dialog__header .qms-edit-file-name-dialog__header-exit{color:#0009;margin-left:auto}.qms-edit-file-name-dialog__warning{margin-bottom:.5rem}\n"] }]
        }], ctorParameters: () => [{ type: i1.MatDialogRef }, { type: i2.TranslateLibraryService }, { type: undefined, decorators: [{
                    type: Inject,
                    args: [MAT_DIALOG_DATA]
                }] }] });
//# sourceMappingURL=data:application/json;base64, 