@progress/kendo-react-grid
Version:
React Data Grid (Table) provides 100+ ready-to-use data grid features. KendoReact Grid package
10 lines (9 loc) • 2.55 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
*-------------------------------------------------------------------------------------------
*/
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react"),s=require("@progress/kendo-react-conversational-ui"),O=require("@progress/kendo-react-buttons"),D=require("@progress/kendo-react-inputs"),E=require("@progress/kendo-svg-icons"),u=require("../../messages/index.js"),x=require("@progress/kendo-react-intl");function j(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const a=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(o,n,a.get?a:{enumerable:!0,get:()=>t[n]})}}return o.default=t,Object.freeze(o)}const r=j(h),z=t=>{const{responseContent:o}=t,n=o.split(`
`);return r.createElement("div",{className:"k-card-body"},n.map((a,c)=>r.createElement("div",{key:a.trim()+c,className:"k-card-text"},a)))},T=t=>{const{activeView:o,onActiveViewChange:n,toolbarItems:a,outputs:c,promptValue:d,promptInput:g,generateButton:f,onCopy:b,onOutputRating:y,onPromptRequest:i,suggestionsList:A,outputCard:w,promptPlaceHolder:I,streaming:V,loading:k,onCancel:v,onClose:l,enableSpeechToText:C}=t,p=x.useLocalization(),[q,m]=r.useState(s.promptViewDefaults.name),P=(e,B)=>{e&&(i&&i(e),m(s.outputViewDefaults.name))},R=e=>{n&&n(e),m(e)},S=e=>{e.key==="Escape"&&l&&l()};return r.useEffect(()=>{const e=document.querySelector(".k-prompt-view .k-textarea textarea");e&&e.focus()},[]),r.createElement(s.AIPrompt,{style:{maxHeight:"100%"},activeView:o!=null?o:q,onActiveViewChange:R,onPromptRequest:P,toolbarItems:a||[s.promptViewDefaults,s.outputViewDefaults],streaming:V,loading:k,suggestionsView:"modern",onCancel:v,onKeyDown:S},r.createElement(s.AIPromptView,{promptSuggestions:A,promptValue:d,promptInput:g||r.createElement(D.TextArea,{placeholder:I,rows:2}),generateButton:f||r.createElement(O.Button,{svgIcon:E.tableWizardIcon,icon:"table-wizard",type:"button",title:p.toLanguageString(u.toolbarAIApply,u.messages[u.toolbarAIApply])},p.toLanguageString(u.toolbarAIApply,u.messages[u.toolbarAIApply])),enableSpeechToText:C}),r.createElement(s.AIPromptOutputView,{outputs:c,showOutputRating:!0,onCopy:b,onOutputRating:y,outputCard:w||{body:z}}))};exports.GridAIPrompt=T;