import { Component, Input } from "@angular/core";
import { DataType } from "../common/data-type.enum";
export class RelatedContentComponent {
    constructor() {
        this.contents = [];
        this.dataType = DataType;
        this.imageProcess = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTkiIHZpZXdCb3g9IjAgMCAxOCAxOSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMCAwLjVWNi41SDJWMTYuNUgxMlYxOC41SDE4VjEyLjVIMTJWMTQuNUg0VjYuNUg2VjQuNUgxMlY2LjVIMThWMC41SDEyVjIuNUg2VjAuNUgwWk00IDIuNVY0LjVIMlYyLjVINFpNMTYgMi41VjQuNUgxNFYyLjVIMTZaTTE2IDE2LjVWMTQuNUgxNFYxNi41SDE2WiIgZmlsbD0iYmxhY2siIGZpbGwtb3BhY2l0eT0iMC42Ii8+DQo8L3N2Zz4NCg==';
    }
    ngOnInit() {
        this.LANG = '';
    }
    removeContent(content) {
        const index = this.contents.findIndex(x => {
            return x.id === content.id;
        });
        if (index >= 0) {
            this.contents.splice(index, 1);
        }
    }
}
RelatedContentComponent.decorators = [
    { type: Component, args: [{
                selector: 'qms-related-content',
                template: "<div\r\n  id=\"qmslib_related_content\"\r\n  class=\"related__content_container\"\r\n  *ngIf=\"contents.length > 0\"\r\n>\r\n  <div *ngIf=\"header\" id=\"qmslib_related_content_header\">\r\n    <span>{{ header }}</span>\r\n  </div>\r\n  <div id=\"qmslib_related_content_body\" class=\"\">\r\n    <div id=\"qmslib_related_content_body_001\" class=\"mt-1 pl-2 pr-2 ps-2 pe-2\">\r\n      <mat-card class=\"card col-12\" *ngFor=\"let content of contents\">\r\n        <div class=\"row\">\r\n          <div class=\"col-2\" *ngIf=\"content.itemType === dataType.folder\">\r\n            <mat-icon style=\"color: #4acaff\">folder_filled</mat-icon>\r\n          </div>\r\n          <div class=\"col-2\" *ngIf=\"content.itemType === dataType.document\">\r\n            <mat-icon>insert_drive_file</mat-icon>\r\n          </div>\r\n          <div class=\"col-2\" *ngIf=\"content.itemType === dataType.area\">\r\n            <mat-icon style=\"color: #a4b0de\">folder_filled</mat-icon>\r\n          </div>\r\n          <div class=\"col-2\" *ngIf=\"content.itemType === dataType.process\">\r\n            <img src=\"{{ imageProcess }}\" />\r\n          </div>\r\n          <div class=\"col-2\" *ngIf=\"content.itemType === dataType.deviation\">\r\n            <mat-icon class=\"material-icons-outlined\">report_problem</mat-icon>\r\n          </div>\r\n          <div class=\"col-2\" *ngIf=\"content.itemType === dataType.checklist\">\r\n            <mat-icon class=\"material-icons-outlined\"\r\n              >format_list_bulleted</mat-icon\r\n            >\r\n          </div>\r\n          <div class=\"col-2\" *ngIf=\"content.itemType === dataType.risk\">\r\n            <mat-icon class=\"material-icons-outlined\">border_all</mat-icon>\r\n          </div>\r\n          <div class=\"col-8\">\r\n            <div class=\"col-12 content\">\r\n              <span>{{ content.itemName }}</span>\r\n            </div>\r\n          </div>\r\n          <div class=\"col-2\">\r\n            <mat-icon class=\"cursor\" (click)=\"removeContent(content)\"\r\n              >close</mat-icon\r\n            >\r\n          </div>\r\n        </div>\r\n      </mat-card>\r\n    </div>\r\n  </div>\r\n</div>\r\n",
                styles: [".related__content_container .card{min-height:60px;box-shadow:none;border-color:#818181;border-top:none;border-right:none;border-left:none;border-radius:0}.related__content_container .card .content{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.related__content_container .card .cursor{cursor:pointer}.related__content_container .mat-card{padding:16px 0}.related__content_container .align-icon{margin-top:5px}"]
            },] }
];
RelatedContentComponent.propDecorators = {
    header: [{ type: Input }],
    contents: [{ type: Input }]
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVsYXRlZC1jb250ZW50LmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2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