@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
46 lines (45 loc) • 1.44 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
import * as s from "react";
import { Keys as t, classNames as o } from "@progress/kendo-react-common";
import { FocusableUponSelection as r } from "./base/FocusableUponSelection.mjs";
class a extends r {
constructor() {
super(...arguments), this.onKeyDown = (e) => {
e.keyCode === t.enter && this.props.onActionExecute(this.props.item, e);
};
}
render() {
return /* @__PURE__ */ s.createElement(
"span",
{
role: "button",
className: this.getClassNames(),
onClick: (e) => this.props.onActionExecute(this.props.item, e),
ref: (e) => {
this.elementToFocus = e;
},
onKeyDown: this.onKeyDown,
tabIndex: 0
},
this.props.item.title || this.props.item.value
);
}
getClassNames() {
return o(
"k-quick-reply",
{ "k-first": this.props.isFirstItemInGroup },
{ "k-last": this.props.isLastItemInGroup },
{ "k-selected": this.props.selected },
{ "k-focus": this.props.selected }
);
}
}
export {
a as default
};