import { EventEmitter } from '@angular/core';
import { ChangeDetectionStrategy, Component, ContentChild, Directive, Input, Output, TemplateRef, } from '@angular/core';
export class RelationCardPreviewDirective {
}
RelationCardPreviewDirective.decorators = [
    { type: Directive, args: [{
                selector: '[vdrRelationCardPreview]',
            },] }
];
export class RelationCardDetailDirective {
}
RelationCardDetailDirective.decorators = [
    { type: Directive, args: [{
                selector: '[vdrRelationCardDetail]',
            },] }
];
export class RelationCardComponent {
    constructor() {
        this.removable = true;
        this.select = new EventEmitter();
        this.remove = new EventEmitter();
    }
}
RelationCardComponent.decorators = [
    { type: Component, args: [{
                selector: 'vdr-relation-card',
                template: "<div class=\"flex\">\r\n    <ng-container *ngIf=\"entity; else placeholder\">\r\n        <div class=\"preview\">\r\n            <ng-container *ngTemplateOutlet=\"previewTemplate; context: { entity: entity }\"></ng-container>\r\n        </div>\r\n        <div class=\"detail\">\r\n            <div class=\"pl3\">\r\n                <ng-container *ngTemplateOutlet=\"detailTemplate; context: { entity: entity }\"></ng-container>\r\n            </div>\r\n            <button *ngIf=\"!readonly\" class=\"btn btn-sm btn-link\" (click)=\"select.emit()\">\r\n                <clr-icon shape=\"link\"></clr-icon> {{ 'common.change-selection' | translate }}\r\n            </button>\r\n            <button *ngIf=\"!readonly && removable\" class=\"btn btn-sm btn-link\" (click)=\"remove.emit()\">\r\n                <clr-icon shape=\"times\"></clr-icon> {{ 'common.remove' | translate }}\r\n            </button>\r\n        </div>\r\n    </ng-container>\r\n    <ng-template #placeholder>\r\n        <div class=\"preview\">\r\n            <div class=\"placeholder\" (click)=\"!readonly && select.emit()\">\r\n                <clr-icon [attr.shape]=\"placeholderIcon\" size=\"50\"></clr-icon>\r\n            </div>\r\n        </div>\r\n        <div class=\"detail\">\r\n            <div class=\"pl3 not-set\">{{ 'common.not-set' | translate }}</div>\r\n            <button *ngIf=\"!readonly\" class=\"btn btn-sm btn-link\" (click)=\"select.emit()\">\r\n                <clr-icon shape=\"link\"></clr-icon> {{ selectLabel }}\r\n            </button>\r\n        </div>\r\n    </ng-template>\r\n</div>\r\n",
                changeDetection: ChangeDetectionStrategy.OnPush,
                styles: [":host{display:block;min-width:300px}.not-set,.placeholder{color:var(--color-grey-300)}.detail{flex:1}.detail,.name{overflow:hidden}.name{white-space:nowrap;text-overflow:ellipsis}"]
            },] }
];
RelationCardComponent.propDecorators = {
    entity: [{ type: Input }],
    placeholderIcon: [{ type: Input }],
    selectLabel: [{ type: Input }],
    readonly: [{ type: Input }],
    removable: [{ type: Input }],
    select: [{ type: Output }],
    remove: [{ type: Output }],
    previewTemplate: [{ type: ContentChild, args: [RelationCardPreviewDirective, { read: TemplateRef },] }],
    detailTemplate: [{ type: ContentChild, args: [RelationCardDetailDirective, { read: TemplateRef },] }]
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVsYXRpb24tY2FyZC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9zcmMvbGliL2NvcmUvc3JjL3NoYXJlZC9keW5hbWljLWZvcm0taW5wdXRzL3JlbGF0aW9uLWZvcm0taW5wdXQvcmVsYXRpb24tY2FyZC9yZWxhdGlvbi1jYXJkLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQzdDLE9BQU8sRUFDSCx1QkFBdUIsRUFDdkIsU0FBUyxFQUNULFlBQVksRUFDWixTQUFTLEVBQ1QsS0FBSyxFQUNMLE1BQU0sRUFDTixXQUFXLEdBQ2QsTUFBTSxlQUFlLENBQUM7QUFLdkIsTUFBTSxPQUFPLDRCQUE0Qjs7O1lBSHhDLFNBQVMsU0FBQztnQkFDUCxRQUFRLEVBQUUsMEJBQTBCO2FBQ3ZDOztBQUtELE1BQU0sT0FBTywyQkFBMkI7OztZQUh2QyxTQUFTLFNBQUM7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