@progress/kendo-angular-conversational-ui
Version:
Kendo UI for Angular Conversational UI components
90 lines (87 loc) • 3.82 kB
JavaScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
import { Component, Input } from '@angular/core';
import { NgIf, NgTemplateOutlet } from '@angular/common';
import { AttachmentTemplateDirective } from './attachment-template.directive';
import * as i0 from "@angular/core";
/**
* @hidden
*/
export class AttachmentComponent {
set attachment(value) {
this._attachment = value;
this.context = {
$implicit: this.attachment
};
}
get attachment() {
return this._attachment;
}
template;
get image() {
return this.contentType.startsWith('image/');
}
get unknown() {
return !this.image;
}
context;
get contentType() {
return this.attachment.contentType || '';
}
_attachment;
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AttachmentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: AttachmentComponent, isStandalone: true, selector: "kendo-chat-attachment", inputs: { attachment: "attachment", template: "template" }, ngImport: i0, template: `
<ng-container *ngIf="template">
<ng-container *ngTemplateOutlet="template.templateRef; context: context;">
</ng-container>
</ng-container>
<div *ngIf="!template" class="k-card">
<div class="k-card-body">
<h5 class="k-card-title" *ngIf="attachment.title">
{{ attachment.title }}
</h5>
<h6 class="k-card-subtitle" *ngIf="attachment.subtitle">
{{ attachment.subtitle }}
</h6>
<img *ngIf="image" [attr.src]="attachment.content" />
<ng-container *ngIf="unknown">
{{ attachment.content }}
</ng-container>
</div>
</div>
`, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AttachmentComponent, decorators: [{
type: Component,
args: [{
selector: 'kendo-chat-attachment',
template: `
<ng-container *ngIf="template">
<ng-container *ngTemplateOutlet="template.templateRef; context: context;">
</ng-container>
</ng-container>
<div *ngIf="!template" class="k-card">
<div class="k-card-body">
<h5 class="k-card-title" *ngIf="attachment.title">
{{ attachment.title }}
</h5>
<h6 class="k-card-subtitle" *ngIf="attachment.subtitle">
{{ attachment.subtitle }}
</h6>
<img *ngIf="image" [attr.src]="attachment.content" />
<ng-container *ngIf="unknown">
{{ attachment.content }}
</ng-container>
</div>
</div>
`,
standalone: true,
imports: [NgIf, NgTemplateOutlet]
}]
}], propDecorators: { attachment: [{
type: Input
}], template: [{
type: Input
}] } });