@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.24 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
*-------------------------------------------------------------------------------------------
*/
;const i=require("react"),a=require("@progress/kendo-react-common");function f(c){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const t in c)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(c,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>c[t]})}}return e.default=c,Object.freeze(e)}const o=f(i),m=c=>{const{item:e,onActionExecute:t,selected:n}=c,r=o.useRef(null);o.useEffect(()=>{n&&r.current&&r.current.focus()},[n]);const l=o.useCallback(s=>{(s.keyCode===a.Keys.enter||s.key===" ")&&(s.preventDefault(),t(e,s))},[t,e]),u=o.useCallback(()=>a.classNames("k-suggestion k-suggestion-primary",{"k-selected":n},{"k-focus":n}),[n]);return o.createElement("span",{role:"button",className:u(),onClick:s=>t(e,s),ref:r,onKeyDown:l,tabIndex:0,"aria-label":e.title||e.value},e.title||e.value)};module.exports=m;