UNPKG

@progress/kendo-react-conversational-ui

Version:

React Chat component allows the user to participate in chat sessions with users or chat bots. KendoReact Conversational UI components

9 lines (8 loc) 1.91 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ "use strict";const n=require("react"),a=require("@progress/kendo-react-common"),o=require("./base/FocusableUponSelection.js");function l(t){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const r=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(s,i,r.get?r:{enumerable:!0,get:()=>t[i]})}}return s.default=t,Object.freeze(s)}const e=l(n);class c extends o.FocusableUponSelection{render(){return e.createElement("div",{className:this.getClassNames(),tabIndex:this.getTabIndexValue(),onClick:this.props.onClick,ref:s=>this.elementToFocus=s},this.props.template?e.createElement(this.props.template,{item:this.props.item}):e.createElement("div",{className:"k-card"},e.createElement("div",{className:"k-card-body"},this.getTitleView(),this.getSubtitleView(),this.getContentView())))}getTabIndexValue(){if(this.props.tabbable!==void 0)return this.props.tabbable?0:-1}getClassNames(){return a.classNames({"k-selected":this.props.selected},{"k-focus":this.props.selected},{"k-first":this.props.isFirstItemInGroup},{"k-last":this.props.isLastItemInGroup})}getTitleView(){return this.props.item.title?e.createElement("h5",{className:"k-card-title"},this.props.item.title):null}getSubtitleView(){return this.props.item.subtitle?e.createElement("h6",{className:"k-card-subtitle"},this.props.item.subtitle):null}getContentView(){return this.props.item.contentType.indexOf("image/")===0?e.createElement("img",{src:this.props.item.content}):this.props.item.content}}module.exports=c;