UNPKG

@progress/kendo-angular-conversational-ui

Version:

Kendo UI for Angular Conversational UI components

132 lines (131 loc) 4.76 kB
/**----------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the project root for more information *-------------------------------------------------------------------------------------------*/ import { Component, EventEmitter, HostBinding, Input, Output } from '@angular/core'; import { ButtonComponent } from '@progress/kendo-angular-buttons'; import * as i0 from "@angular/core"; /** * Represents a Hero Card component. * Hero cards display a single large image and action buttons with text content. * * @example * ```html * <kendo-chat-hero-card * title="Card Title" * subtitle="Card Subtitle" * [actions]="actions"> * </kendo-chat-hero-card> * ``` */ export class HeroCardComponent { /** * Sets the URL of the hero card image. */ imageUrl; /** * Sets the title of the hero card. */ title; /** * Sets the subtitle of the hero card. */ subtitle; /** * Sets the array of quick actions for this hero card. */ actions; cssClass = true; /** * Fires when the user clicks a button. */ executeAction = new EventEmitter(); /** * Emits the `executeAction` event when the user clicks an action button. */ onClick(action) { this.executeAction.next(action); } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: HeroCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: HeroCardComponent, isStandalone: true, selector: "kendo-chat-hero-card", inputs: { imageUrl: "imageUrl", title: "title", subtitle: "subtitle", actions: "actions" }, outputs: { executeAction: "executeAction" }, host: { properties: { "class.k-card": "this.cssClass" } }, ngImport: i0, template: ` @if (imageUrl) { <img class="k-card-image" [src]="imageUrl" /> } <div class="k-card-body"> @if (title) { <h5 class="k-card-title"> {{ title }} </h5> } @if (subtitle) { <h6 class="k-card-subtitle"> {{ subtitle }} </h6> } </div> <div class="k-card-actions k-card-actions-vertical"> @for (act of actions; track act) { <span class="k-card-action" > <button kendoButton fillMode="flat" (click)="onClick(act)" > {{ act.title }} </button> </span> } </div> `, isInline: true, dependencies: [{ kind: "component", type: ButtonComponent, selector: "button[kendoButton]", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }] }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: HeroCardComponent, decorators: [{ type: Component, args: [{ selector: 'kendo-chat-hero-card', template: ` @if (imageUrl) { <img class="k-card-image" [src]="imageUrl" /> } <div class="k-card-body"> @if (title) { <h5 class="k-card-title"> {{ title }} </h5> } @if (subtitle) { <h6 class="k-card-subtitle"> {{ subtitle }} </h6> } </div> <div class="k-card-actions k-card-actions-vertical"> @for (act of actions; track act) { <span class="k-card-action" > <button kendoButton fillMode="flat" (click)="onClick(act)" > {{ act.title }} </button> </span> } </div> `, standalone: true, imports: [ButtonComponent] }] }], propDecorators: { imageUrl: [{ type: Input }], title: [{ type: Input }], subtitle: [{ type: Input }], actions: [{ type: Input }], cssClass: [{ type: HostBinding, args: ['class.k-card'] }], executeAction: [{ type: Output }] } });