import { Component, Inject } from '@angular/core';
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
import { QMSCKEditorBaseComponent } from '../../../qms-ckeditor-base.component';
import { takeUntil } from 'rxjs/operators';
import * as i0 from "@angular/core";
import * as i1 from "../../../../services/translation-registry.service";
import * as i2 from "@angular/material/dialog";
import * as i3 from "@angular/material/input";
import * as i4 from "@angular/material/form-field";
import * as i5 from "@angular/forms";
import * as i6 from "../../../../components/button/button";
import * as i7 from "../../../../directives/form.directive";
import * as i8 from "../../../../directives/dialog/dialog.content.directive";
import * as i9 from "@angular/common";
import * as i10 from "../../../../components/qms-bpmn/models/flow-chart-shape/shape-link";
export class BPMNLinkComponent extends QMSCKEditorBaseComponent {
    constructor(translate, dialogRef, data) {
        super();
        this.translate = translate;
        this.dialogRef = dialogRef;
        this.data = data;
        this.canSave = true;
        this.link = '';
        this.newShapeLink = {
            shapeId: this.data.shapeId,
            flowChartId: this.data.flowChartId,
            link: '',
            id: this.data.id
        };
    }
    ngOnInit() {
        this.translate.getLanguageSubject$.pipe(takeUntil(this.ngUnsubcribe)).subscribe((res) => {
            if (res) {
                this.LANG = this.translate.getObjectLang(res);
            }
        });
    }
    save() {
        this.newShapeLink.link = this.link;
        this.dialogRef.close(this.newShapeLink);
    }
    cancel() {
        this.dialogRef.close();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: BPMNLinkComponent, deps: [{ token: i1.TranslateLibraryService }, { token: i2.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: BPMNLinkComponent, selector: "app-link", usesInheritance: true, ngImport: i0, template: "<div qms-dialog-container>\n    <div qms-dialog-header>\n        <span class=\"title\"> {{ LANG.BPMN.CONNECTION_TYPE.CONNECTED_LINK | uppercase }}</span>\n    </div>\n    <div qms-dialog-content>\n        <div class=\"row\">\n            <div class=\"col-12\">\n                <mat-form-field class=\"full-width\" qms-form>\n                    <mat-label>{{ LANG.QMSCKEDITOR.LINK_URL }}</mat-label>\n                    <input matInput [(ngModel)]=\"link\" placeholder=\"https://www.url.no\" type=\"search\"\n                        autocomplete=\"off\" />\n                </mat-form-field>\n            </div>\n        </div>\n    </div>\n    <div qms-dialog-footer>\n        <button type=\"button\" qms-btn-text class=\"mr10\" (click)=\"cancel()\">\n            <span>{{ LANG.CANCEL }}</span>\n        </button>\n        <button type=\"button\" qms-btn [disabled]=\"!link\" class=\"save\" (click)=\"save()\">\n            <span>{{ LANG.SAVE }}</span>\n        </button>\n    </div>\n</div>", styles: ["::ng-deep .qms-dialog-container{font-family:Open Sans;display:flex;flex-flow:column;min-height:150px;max-height:80vh}::ng-deep .qms-dialog-container .close-icon{width:40px;height:40px;line-height:40px}::ng-deep .qms-dialog-container .qms-dialog-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;flex:0 1 auto;height:50px}::ng-deep .qms-dialog-container .qms-dialog-content{flex:1 1 auto;overflow-y:auto;overflow-x:hidden;margin:0}::ng-deep .qms-dialog-container .qms-dialog-footer{display:flex;flex-wrap:wrap;min-height:50px;align-items:center;box-sizing:content-box;justify-content:end;margin-top:10px;flex:0 1 auto;height:50px}::ng-deep .qms-dialog-container .qms-dialog-footer.qms-dialog-footer-align-center{justify-content:center}::ng-deep .qms-dialog-container .qms-dialog-footer.qms-dialog-footer-align-start{justify-content:start}::ng-deep .qms-dialog-container .title{font-family:Open Sans;font-style:normal;font-weight:600;font-size:22px;color:#323232;margin:0}::ng-deep .qms-dialog-container .full-width{width:100%;padding-left:0;padding-right:0}\n"], dependencies: [{ kind: "directive", type: i3.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: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "directive", type: i5.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: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6.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"] }, { kind: "directive", type: i7.QMSFormFieldDirective, selector: "[qms-form]" }, { kind: "directive", type: i8.QMSDialogContainer, selector: "[qms-dialog-container], qms-dialog-container, [qmsDialogContainer]", inputs: ["min", "max"] }, { kind: "directive", type: i8.QMSDialogHeader, selector: "[qms-dialog-header], qms-dialog-header, [qmsDialogHeader]", inputs: ["height"], exportAs: ["qmsDialogHeader"] }, { kind: "directive", type: i8.QMSDialogContent, selector: "[qms-dialog-content], qms-dialog-content, [qmsDialogContent]" }, { kind: "directive", type: i8.QMSDialogFooter, selector: "[qms-dialog-footer], qms-dialog-footer, [qmsDialogFooter]", inputs: ["align", "height"] }, { kind: "pipe", type: i9.UpperCasePipe, name: "uppercase" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: BPMNLinkComponent, decorators: [{
            type: Component,
            args: [{ selector: 'app-link', template: "<div qms-dialog-container>\n    <div qms-dialog-header>\n        <span class=\"title\"> {{ LANG.BPMN.CONNECTION_TYPE.CONNECTED_LINK | uppercase }}</span>\n    </div>\n    <div qms-dialog-content>\n        <div class=\"row\">\n            <div class=\"col-12\">\n                <mat-form-field class=\"full-width\" qms-form>\n                    <mat-label>{{ LANG.QMSCKEDITOR.LINK_URL }}</mat-label>\n                    <input matInput [(ngModel)]=\"link\" placeholder=\"https://www.url.no\" type=\"search\"\n                        autocomplete=\"off\" />\n                </mat-form-field>\n            </div>\n        </div>\n    </div>\n    <div qms-dialog-footer>\n        <button type=\"button\" qms-btn-text class=\"mr10\" (click)=\"cancel()\">\n            <span>{{ LANG.CANCEL }}</span>\n        </button>\n        <button type=\"button\" qms-btn [disabled]=\"!link\" class=\"save\" (click)=\"save()\">\n            <span>{{ LANG.SAVE }}</span>\n        </button>\n    </div>\n</div>", styles: ["::ng-deep .qms-dialog-container{font-family:Open Sans;display:flex;flex-flow:column;min-height:150px;max-height:80vh}::ng-deep .qms-dialog-container .close-icon{width:40px;height:40px;line-height:40px}::ng-deep .qms-dialog-container .qms-dialog-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;flex:0 1 auto;height:50px}::ng-deep .qms-dialog-container .qms-dialog-content{flex:1 1 auto;overflow-y:auto;overflow-x:hidden;margin:0}::ng-deep .qms-dialog-container .qms-dialog-footer{display:flex;flex-wrap:wrap;min-height:50px;align-items:center;box-sizing:content-box;justify-content:end;margin-top:10px;flex:0 1 auto;height:50px}::ng-deep .qms-dialog-container .qms-dialog-footer.qms-dialog-footer-align-center{justify-content:center}::ng-deep .qms-dialog-container .qms-dialog-footer.qms-dialog-footer-align-start{justify-content:start}::ng-deep .qms-dialog-container .title{font-family:Open Sans;font-style:normal;font-weight:600;font-size:22px;color:#323232;margin:0}::ng-deep .qms-dialog-container .full-width{width:100%;padding-left:0;padding-right:0}\n"] }]
        }], ctorParameters: () => [{ type: i1.TranslateLibraryService }, { type: i2.MatDialogRef }, { type: i10.ShapeLink, decorators: [{
                    type: Inject,
                    args: [MAT_DIALOG_DATA]
                }] }] });
//# sourceMappingURL=data:application/json;base64, 