@progress/kendo-angular-conversational-ui
Version:
Kendo UI for Angular Conversational UI components
106 lines (103 loc) • 3.9 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 { NgTemplateOutlet } from '@angular/common';
import { AttachmentTemplateDirective } from './templates/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: "18.2.14", ngImport: i0, type: AttachmentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: AttachmentComponent, isStandalone: true, selector: "kendo-chat-attachment", inputs: { attachment: "attachment", template: "template" }, ngImport: i0, template: `
(template) {
<ng-container *ngTemplateOutlet="template.templateRef; context: context;">
</ng-container>
}
(!template) {
<div class="k-card">
<div class="k-card-body">
(attachment.title) {
<h5 class="k-card-title">
{{ attachment.title }}
</h5>
}
(attachment.subtitle) {
<h6 class="k-card-subtitle">
{{ attachment.subtitle }}
</h6>
}
(image) {
<img [attr.src]="attachment.content" />
}
(unknown) {
{{ attachment.content }}
}
</div>
</div>
}
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AttachmentComponent, decorators: [{
type: Component,
args: [{
selector: 'kendo-chat-attachment',
template: `
(template) {
<ng-container *ngTemplateOutlet="template.templateRef; context: context;">
</ng-container>
}
(!template) {
<div class="k-card">
<div class="k-card-body">
(attachment.title) {
<h5 class="k-card-title">
{{ attachment.title }}
</h5>
}
(attachment.subtitle) {
<h6 class="k-card-subtitle">
{{ attachment.subtitle }}
</h6>
}
(image) {
<img [attr.src]="attachment.content" />
}
(unknown) {
{{ attachment.content }}
}
</div>
</div>
}
`,
standalone: true,
imports: [NgTemplateOutlet]
}]
}], propDecorators: { attachment: [{
type: Input
}], template: [{
type: Input
}] } });