UNPKG

@progress/kendo-angular-conversational-ui

Version:

Kendo UI for Angular Conversational UI components

160 lines (159 loc) 6.71 kB
/**----------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the project root for more information *-------------------------------------------------------------------------------------------*/ import { AfterViewInit, ElementRef, EventEmitter, NgZone, OnDestroy, ViewContainerRef } from '@angular/core'; import { InlineAIPromptRequestEvent, InlineAIPromptOutputAction, InlineAIPromptOutputActionClickEvent, InlineAIPromptOutput, InlineAIPromptCommand } from './models'; import { InlineAIPromptContentComponent } from './inlineaiprompt-content.component'; import { SpeechToTextButtonSettings } from '@progress/kendo-angular-buttons'; import { InlineAIPromptPopupSettings } from './models/inlineaiprompt-popupsettings'; import { InlineAIPromptOutputTemplateDirective } from './output-template.directive'; import * as i0 from "@angular/core"; /** * Represents the Kendo UI InlineAIPrompt component for Angular. * * @remarks * Supported children components are: {@link InlineAIPromptCustomMessagesComponent} * * @example * ```html * <kendo-inlineaiprompt * placeholder="Enter your prompt..." * [promptOutput]="promptOutput" * (promptRequest)="onPromptRequest($event)"> * </kendo-inlineaiprompt> * ``` */ export declare class InlineAIPromptComponent implements AfterViewInit, OnDestroy { private ngZone; element: ElementRef; /** * Sets the TextArea value. * * @default "" */ promptValue: string; /** * Sets the placeholder text that appears in the text area when it is empty. */ placeholder: string; /** * Sets the output data for the prompt. * The output displays as a card above the text area. */ promptOutput: InlineAIPromptOutput; /** * Controls the visibility and settings of the Speech to Text button. * * @default true */ enableSpeechToText: boolean | SpeechToTextButtonSettings; /** * When set to `true`, the **Send** button displays a generating state and the component emits a `promptRequestCancel` event when you click it. * * @default false */ streaming: boolean; /** * Sets the width of the component. * Accepts a number for pixels or a string for other units. * * @default 550 */ width: number | string; /** * Sets the maximum height of the component. * Accepts a number for pixels or a string for other units. */ maxHeight: number | string; /** * Represents the configuration of the default output actions. * The default actions are `copy`, `retry`, and `discard`. */ defaultOutputActions: InlineAIPromptOutputAction[]; /** * Sets the output actions that display in the output card. * The default actions are `copy`, `retry`, and `discard`. * To customize the appearance and order of the default actions, define them with the same `name`. * * @default [{ name: 'copy', type: 'button', icon: 'copy', svgIcon: copyIcon, text: 'Copy', fillMode: 'flat', themeColor: 'primary', rounded: 'medium'}, { name: 'retry', type: 'button', icon: 'arrow-rotate-cw', svgIcon: arrowRotateCwIcon, text: 'Retry', fillMode: 'flat', themeColor: 'primary', rounded: 'medium'}, { name: 'discard', type: 'button', icon: 'cancel-outline', svgIcon: cancelOutlineIcon, text: 'Discard', fillMode: 'flat', themeColor: 'base', rounded: 'medium'}] */ outputActions: InlineAIPromptOutputAction[]; /** * Sets the available prompt commands. */ promptCommands: InlineAIPromptCommand[]; /** * Sets the Popup settings. * */ set popupSettings(settings: InlineAIPromptPopupSettings); get popupSettings(): InlineAIPromptPopupSettings; /** * Fires when the send button is clicked. */ promptRequest: EventEmitter<InlineAIPromptRequestEvent>; /** * Fires when a command is executed. */ commandExecute: EventEmitter<InlineAIPromptCommand>; /** * Fires when an output action button is clicked. */ outputActionClick: EventEmitter<InlineAIPromptOutputActionClickEvent>; /** * Fires when the stop button is clicked during streaming. */ promptRequestCancel: EventEmitter<void>; /** * Fires when the component closes (Escape key, Discard action or outside click). */ close: EventEmitter<void>; /** * Fires when the TextArea value changes. */ promptValueChange: EventEmitter<string>; popupElement: ElementRef; popupViewContainer: ViewContainerRef; contentComponent: InlineAIPromptContentComponent; outputTemplate: InlineAIPromptOutputTemplateDirective; /** * @hidden */ calculateMeasurement: (value: string | number) => string; private _popupSettings; private subs; constructor(ngZone: NgZone, element: ElementRef); ngAfterViewInit(): void; ngOnDestroy(): void; /** * Focus the TextArea. */ focus(): void; /** * @hidden */ onPromptRequest(event: InlineAIPromptRequestEvent): void; /** * @hidden */ onCommandExecute(event: InlineAIPromptCommand): void; /** * @hidden */ onOutputActionClick(event: InlineAIPromptOutputActionClickEvent): void; /** * @hidden */ onPromptRequestCancel(): void; /** * @hidden */ onClose(): void; /** * @hidden */ onPromptValueChange(value: string): void; static ɵfac: i0.ɵɵFactoryDeclaration<InlineAIPromptComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<InlineAIPromptComponent, "kendo-inlineaiprompt", ["kendoInlineAIPrompt"], { "promptValue": { "alias": "promptValue"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "promptOutput": { "alias": "promptOutput"; "required": false; }; "enableSpeechToText": { "alias": "enableSpeechToText"; "required": false; }; "streaming": { "alias": "streaming"; "required": false; }; "width": { "alias": "width"; "required": false; }; "maxHeight": { "alias": "maxHeight"; "required": false; }; "outputActions": { "alias": "outputActions"; "required": false; }; "promptCommands": { "alias": "promptCommands"; "required": false; }; "popupSettings": { "alias": "popupSettings"; "required": false; }; }, { "promptRequest": "promptRequest"; "commandExecute": "commandExecute"; "outputActionClick": "outputActionClick"; "promptRequestCancel": "promptRequestCancel"; "close": "close"; "promptValueChange": "promptValueChange"; }, ["outputTemplate"], never, true, never>; }