@progress/kendo-react-grid 12.0.0-develop.9 → 12.0.1-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/index.d.mts +233 -7
- package/index.d.ts +233 -7
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +17 -17
- package/toolbar-tools/GridToolbarAIAssistant.js +2 -2
- package/toolbar-tools/GridToolbarAIAssistant.mjs +45 -43
- package/toolbar-tools/ai-tool/GridAIPrompt.js +2 -2
- package/toolbar-tools/ai-tool/GridAIPrompt.mjs +27 -25
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-grid",
|
|
3
|
-
"version": "12.0.
|
|
3
|
+
"version": "12.0.1-develop.1",
|
|
4
4
|
"description": "React Data Grid (Table) provides 100+ ready-to-use data grid features. KendoReact Grid package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -28,21 +28,21 @@
|
|
|
28
28
|
"@progress/kendo-data-query": "^1.0.0",
|
|
29
29
|
"@progress/kendo-drawing": "^1.21.2",
|
|
30
30
|
"@progress/kendo-licensing": "^1.7.0",
|
|
31
|
-
"@progress/kendo-react-animation": "12.0.
|
|
32
|
-
"@progress/kendo-react-buttons": "12.0.
|
|
33
|
-
"@progress/kendo-react-common": "12.0.
|
|
34
|
-
"@progress/kendo-react-data-tools": "12.0.
|
|
35
|
-
"@progress/kendo-react-dateinputs": "12.0.
|
|
36
|
-
"@progress/kendo-react-indicators": "12.0.
|
|
37
|
-
"@progress/kendo-react-form": "12.0.
|
|
38
|
-
"@progress/kendo-react-labels": "12.0.
|
|
39
|
-
"@progress/kendo-react-dialogs": "12.0.
|
|
40
|
-
"@progress/kendo-react-dropdowns": "12.0.
|
|
41
|
-
"@progress/kendo-react-inputs": "12.0.
|
|
42
|
-
"@progress/kendo-react-intl": "12.0.
|
|
43
|
-
"@progress/kendo-react-popup": "12.0.
|
|
44
|
-
"@progress/kendo-react-layout": "12.0.
|
|
45
|
-
"@progress/kendo-react-conversational-ui": "12.0.
|
|
31
|
+
"@progress/kendo-react-animation": "12.0.1-develop.1",
|
|
32
|
+
"@progress/kendo-react-buttons": "12.0.1-develop.1",
|
|
33
|
+
"@progress/kendo-react-common": "12.0.1-develop.1",
|
|
34
|
+
"@progress/kendo-react-data-tools": "12.0.1-develop.1",
|
|
35
|
+
"@progress/kendo-react-dateinputs": "12.0.1-develop.1",
|
|
36
|
+
"@progress/kendo-react-indicators": "12.0.1-develop.1",
|
|
37
|
+
"@progress/kendo-react-form": "12.0.1-develop.1",
|
|
38
|
+
"@progress/kendo-react-labels": "12.0.1-develop.1",
|
|
39
|
+
"@progress/kendo-react-dialogs": "12.0.1-develop.1",
|
|
40
|
+
"@progress/kendo-react-dropdowns": "12.0.1-develop.1",
|
|
41
|
+
"@progress/kendo-react-inputs": "12.0.1-develop.1",
|
|
42
|
+
"@progress/kendo-react-intl": "12.0.1-develop.1",
|
|
43
|
+
"@progress/kendo-react-popup": "12.0.1-develop.1",
|
|
44
|
+
"@progress/kendo-react-layout": "12.0.1-develop.1",
|
|
45
|
+
"@progress/kendo-react-conversational-ui": "12.0.1-develop.1",
|
|
46
46
|
"@progress/kendo-svg-icons": "^4.0.0",
|
|
47
47
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
|
48
48
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
"package": {
|
|
148
148
|
"productName": "KendoReact",
|
|
149
149
|
"productCode": "KENDOUIREACT",
|
|
150
|
-
"publishDate":
|
|
150
|
+
"publishDate": 1756393499,
|
|
151
151
|
"licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
152
152
|
}
|
|
153
153
|
},
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
9
|
-
`);
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ae=require("react"),ie=require("../utils/GridContext.js"),le=require("@progress/kendo-react-buttons"),ce=require("@progress/kendo-svg-icons"),G=require("axios"),ue=require("@progress/kendo-react-intl"),i=require("../messages/index.js"),D=require("@progress/kendo-react-common"),de=require("@progress/kendo-react-dialogs"),pe=require("./ai-tool/GridAIPrompt.js"),L=require("../filterCommon.js");function fe(s){const u=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const t in s)if(t!=="default"){const c=Object.getOwnPropertyDescriptor(s,t);Object.defineProperty(u,t,c.get?c:{enumerable:!0,get:()=>s[t]})}}return u.default=s,Object.freeze(u)}const o=fe(ae),ge=(s,u)=>s.map(c=>{let p=c;return u.forEach(d=>{d.field&&p.includes(d.field)&&(p=p.replace(new RegExp(d.field,"g"),d.title||d.field))}),p}),v=o.forwardRef((s,u)=>{const t=o.useContext(ie.GridContext),c=ue.useLocalization(),{requestUrl:p,requestOptions:d,onPromptRequest:O,onResponseSuccess:P,onResponseError:x,role:W="user",gridAIPrompt:B=pe.GridAIPrompt,icon:F,svgIcon:A,onCloseWindow:R,promptPlaceHolder:M,suggestionsList:z,streaming:H,loading:N,outputs:_,enableSpeechToText:$}=s,[w,E]=o.useState([]),K=o.useMemo(()=>t&&Array.isArray(t.columnsRef)?t.columnsRef.map(e=>({field:e.field})):[],[t]),[U,h]=o.useState(!1),[C,I]=o.useState(!1),[X,Y]=o.useState(),[J,Q]=o.useState(),f=o.useRef(null),k=o.useRef(null),V=e=>{e.preventDefault(),I(!C)},T=o.useMemo(()=>{var e;return(e=s.show)!=null?e:C},[s.show,C]),b=o.useCallback(()=>{var e;R&&R(),E([]),I(!1),f.current&&((e=f.current.element)==null||e.focus())},[R]),Z=(e,r,g)=>{var l,S;if(h(!1),e!=null&&e.data){if(t.sortable&&e.data.sort)if(e.data.sort.length===0)t.sortChange([],e);else{const a=(l=t.sort)!=null?l:[],n=[];a.forEach(m=>{e.data.sort.some(y=>y.field===m.field)||n.push(m)}),n.push(...e.data.sort),t.sortChange(n,e)}if(e.data.filter){const a=L.combineSmartFilters(e.data.filter,t.filter);t.filterChange(a,e)}if(e.data.highlight){let a=e.data.highlight;Array.isArray(a)&&(a=a.map(n=>(n!=null&&n.filters&&Array.isArray(n.filters)&&L.parseFilterDates(n),n))),t.applyHighlightDescriptor(a)}if(t&&e.data.group)if(e.data.group.length===0)t.groupChange([],e);else{const a=(S=t.group)!=null?S:[],n=[];a.forEach(m=>{e.data.group.some(y=>y.field===m.field)||n.push(m)}),n.push(...e.data.group),t.groupChange(n,e)}if(e.data.messages){const a=[c.toLanguageString(i.aIResponseData,i.messages[i.aIResponseData])],n=ge(e.data.messages,t.columnsRef).join(`
|
|
9
|
+
`);E([{id:w.length+1,title:c.toLanguageString(i.generatedWithAI,i.messages[i.generatedWithAI]),subTitle:r,prompt:r,responseContent:a.concat(n).join(""),isRetry:g},...w])}}P&&P(e,r,g)},q=e=>{x&&x(e),h(!1)},ee=(e,r)=>{const g=G.CancelToken.source(),l={role:"user",columns:K||[],headers:{Accept:"*/*","Content-Type":"application/json"},promptMessage:e,requestOptions:{url:p,method:"POST",withCredentials:!1,responseType:"json",cancelToken:g.token,...d}};O&&O(l,r),l.requestOptions.url!==void 0&&(h(!0),G({...l.requestOptions,headers:l.headers,data:{role:W||l.role,contents:[{$type:"text",text:l.promptMessage}],columns:l.columns||[]},...s.requestOptions}).then(S=>Z(S,l.promptMessage,r)).catch(q),k.current=g)},te=o.useCallback(()=>{k.current&&k.current.cancel("Request cancelled by user."),h(!1)},[]),[oe,j]=D.useCustomComponent(B),ne=Object.keys(j).length>0?j:{},se=o.createElement(oe,{onPromptRequest:ee,onCancel:te,onClose:b,streaming:H||U,loading:N,outputs:_||w,promptPlaceHolder:M,suggestionsList:z,enableSpeechToText:$,...ne}),re=o.createElement(le.Button,{ref:f,togglable:!0,themeColor:"primary",rounded:"full",selected:T,svgIcon:A!=null?A:ce.sparklesIcon,icon:F,size:t.mobileMode?"large":"medium",className:D.classNames("k-toolbar-button",{"k-icon-button":t.mobileMode}),title:c.toLanguageString(i.toolbarAI,i.messages[i.toolbarAI]),onClick:V});return o.useEffect(()=>{var e;if(f.current&&T){const r=(e=f.current.element)==null?void 0:e.getBoundingClientRect();r&&(Y(r.top+window.scrollY+r.height),Q(r.left+window.scrollX+r.width))}},[T]),o.useImperativeHandle(u,()=>({show:()=>I(!0),hide:()=>b()}),[b]),o.createElement(o.Fragment,null,re,C&&o.createElement(de.Window,{autoFocus:!1,title:c.toLanguageString(i.toolbarAI,i.messages[i.toolbarAI]),initialTop:X,initialLeft:J,initialWidth:520,initialHeight:500,onClose:b,resizable:!0,draggable:!0,className:"k-grid-assistant-window"},se))});v.displayName="KendoReactGridToolbarAIAssistant";exports.GridToolbarAIAssistant=v;
|
|
@@ -6,31 +6,31 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as e from "react";
|
|
9
|
-
import { GridContext as
|
|
10
|
-
import { Button as
|
|
11
|
-
import { sparklesIcon as
|
|
9
|
+
import { GridContext as at } from "../utils/GridContext.mjs";
|
|
10
|
+
import { Button as it } from "@progress/kendo-react-buttons";
|
|
11
|
+
import { sparklesIcon as lt } from "@progress/kendo-svg-icons";
|
|
12
12
|
import F from "axios";
|
|
13
|
-
import { useLocalization as
|
|
13
|
+
import { useLocalization as ut } from "@progress/kendo-react-intl";
|
|
14
14
|
import { toolbarAI as S, messages as w, aIResponseData as W, generatedWithAI as j } from "../messages/index.mjs";
|
|
15
|
-
import { useCustomComponent as
|
|
16
|
-
import { Window as
|
|
17
|
-
import { GridAIPrompt as
|
|
18
|
-
import { combineSmartFilters as
|
|
19
|
-
const
|
|
15
|
+
import { useCustomComponent as ct, classNames as pt } from "@progress/kendo-react-common";
|
|
16
|
+
import { Window as dt } from "@progress/kendo-react-dialogs";
|
|
17
|
+
import { GridAIPrompt as ft } from "./ai-tool/GridAIPrompt.mjs";
|
|
18
|
+
import { combineSmartFilters as mt, parseFilterDates as gt } from "../filterCommon.mjs";
|
|
19
|
+
const ht = (l, b) => l.map((u) => {
|
|
20
20
|
let c = u;
|
|
21
21
|
return b.forEach((i) => {
|
|
22
22
|
i.field && c.includes(i.field) && (c = c.replace(new RegExp(i.field, "g"), i.title || i.field));
|
|
23
23
|
}), c;
|
|
24
|
-
}),
|
|
24
|
+
}), Ct = e.forwardRef(
|
|
25
25
|
(l, b) => {
|
|
26
|
-
const o = e.useContext(
|
|
26
|
+
const o = e.useContext(at), u = ut(), {
|
|
27
27
|
requestUrl: c,
|
|
28
28
|
requestOptions: i,
|
|
29
29
|
onPromptRequest: E,
|
|
30
30
|
onResponseSuccess: O,
|
|
31
31
|
onResponseError: x,
|
|
32
32
|
role: B = "user",
|
|
33
|
-
gridAIPrompt: D =
|
|
33
|
+
gridAIPrompt: D = ft,
|
|
34
34
|
icon: H,
|
|
35
35
|
svgIcon: A,
|
|
36
36
|
onCloseWindow: R,
|
|
@@ -38,8 +38,9 @@ const gt = (l, b) => l.map((u) => {
|
|
|
38
38
|
suggestionsList: z,
|
|
39
39
|
streaming: M,
|
|
40
40
|
loading: N,
|
|
41
|
-
outputs:
|
|
42
|
-
|
|
41
|
+
outputs: $,
|
|
42
|
+
enableSpeechToText: K
|
|
43
|
+
} = l, [T, L] = e.useState([]), U = e.useMemo(() => o && Array.isArray(o.columnsRef) ? o.columnsRef.map((t) => ({ field: t.field })) : [], [o]), [X, m] = e.useState(!1), [g, k] = e.useState(!1), [Y, J] = e.useState(), [Q, V] = e.useState(), p = e.useRef(null), y = e.useRef(null), Z = (t) => {
|
|
43
44
|
t.preventDefault(), k(!g);
|
|
44
45
|
}, I = e.useMemo(() => {
|
|
45
46
|
var t;
|
|
@@ -47,7 +48,7 @@ const gt = (l, b) => l.map((u) => {
|
|
|
47
48
|
}, [l.show, g]), h = e.useCallback(() => {
|
|
48
49
|
var t;
|
|
49
50
|
R && R(), L([]), k(!1), p.current && ((t = p.current.element) == null || t.focus());
|
|
50
|
-
}, [R]),
|
|
51
|
+
}, [R]), _ = (t, n, d) => {
|
|
51
52
|
var a, C;
|
|
52
53
|
if (m(!1), t != null && t.data) {
|
|
53
54
|
if (o.sortable && t.data.sort)
|
|
@@ -60,12 +61,12 @@ const gt = (l, b) => l.map((u) => {
|
|
|
60
61
|
}), s.push(...t.data.sort), o.sortChange(s, t);
|
|
61
62
|
}
|
|
62
63
|
if (t.data.filter) {
|
|
63
|
-
const r =
|
|
64
|
+
const r = mt(t.data.filter, o.filter);
|
|
64
65
|
o.filterChange(r, t);
|
|
65
66
|
}
|
|
66
67
|
if (t.data.highlight) {
|
|
67
68
|
let r = t.data.highlight;
|
|
68
|
-
Array.isArray(r) && (r = r.map((s) => (s != null && s.filters && Array.isArray(s.filters) &&
|
|
69
|
+
Array.isArray(r) && (r = r.map((s) => (s != null && s.filters && Array.isArray(s.filters) && gt(s), s))), o.applyHighlightDescriptor(r);
|
|
69
70
|
}
|
|
70
71
|
if (o && t.data.group)
|
|
71
72
|
if (t.data.group.length === 0)
|
|
@@ -79,7 +80,7 @@ const gt = (l, b) => l.map((u) => {
|
|
|
79
80
|
if (t.data.messages) {
|
|
80
81
|
const r = [
|
|
81
82
|
u.toLanguageString(W, w[W])
|
|
82
|
-
], s =
|
|
83
|
+
], s = ht(t.data.messages, o.columnsRef).join(
|
|
83
84
|
`
|
|
84
85
|
`
|
|
85
86
|
);
|
|
@@ -97,12 +98,12 @@ const gt = (l, b) => l.map((u) => {
|
|
|
97
98
|
}
|
|
98
99
|
}
|
|
99
100
|
O && O(t, n, d);
|
|
100
|
-
},
|
|
101
|
+
}, q = (t) => {
|
|
101
102
|
x && x(t), m(!1);
|
|
102
|
-
},
|
|
103
|
+
}, tt = (t, n) => {
|
|
103
104
|
const d = F.CancelToken.source(), a = {
|
|
104
105
|
role: "user",
|
|
105
|
-
columns:
|
|
106
|
+
columns: U || [],
|
|
106
107
|
headers: {
|
|
107
108
|
Accept: "*/*",
|
|
108
109
|
"Content-Type": "application/json"
|
|
@@ -131,45 +132,46 @@ const gt = (l, b) => l.map((u) => {
|
|
|
131
132
|
columns: a.columns || []
|
|
132
133
|
},
|
|
133
134
|
...l.requestOptions
|
|
134
|
-
}).then((C) =>
|
|
135
|
-
},
|
|
135
|
+
}).then((C) => _(C, a.promptMessage, n)).catch(q), y.current = d);
|
|
136
|
+
}, et = e.useCallback(() => {
|
|
136
137
|
y.current && y.current.cancel("Request cancelled by user."), m(!1);
|
|
137
|
-
}, []), [
|
|
138
|
+
}, []), [ot, G] = ct(
|
|
138
139
|
D
|
|
139
|
-
),
|
|
140
|
-
|
|
140
|
+
), st = Object.keys(G).length > 0 ? G : {}, nt = /* @__PURE__ */ e.createElement(
|
|
141
|
+
ot,
|
|
141
142
|
{
|
|
142
|
-
onPromptRequest:
|
|
143
|
-
onCancel:
|
|
143
|
+
onPromptRequest: tt,
|
|
144
|
+
onCancel: et,
|
|
144
145
|
onClose: h,
|
|
145
|
-
streaming: M ||
|
|
146
|
+
streaming: M || X,
|
|
146
147
|
loading: N,
|
|
147
148
|
outputs: $ || T,
|
|
148
149
|
promptPlaceHolder: v,
|
|
149
150
|
suggestionsList: z,
|
|
150
|
-
|
|
151
|
+
enableSpeechToText: K,
|
|
152
|
+
...st
|
|
151
153
|
}
|
|
152
|
-
),
|
|
153
|
-
|
|
154
|
+
), rt = /* @__PURE__ */ e.createElement(
|
|
155
|
+
it,
|
|
154
156
|
{
|
|
155
157
|
ref: p,
|
|
156
158
|
togglable: !0,
|
|
157
159
|
themeColor: "primary",
|
|
158
160
|
rounded: "full",
|
|
159
161
|
selected: I,
|
|
160
|
-
svgIcon: A != null ? A :
|
|
162
|
+
svgIcon: A != null ? A : lt,
|
|
161
163
|
icon: H,
|
|
162
164
|
size: o.mobileMode ? "large" : "medium",
|
|
163
|
-
className:
|
|
165
|
+
className: pt("k-toolbar-button", { "k-icon-button": o.mobileMode }),
|
|
164
166
|
title: u.toLanguageString(S, w[S]),
|
|
165
|
-
onClick:
|
|
167
|
+
onClick: Z
|
|
166
168
|
}
|
|
167
169
|
);
|
|
168
170
|
return e.useEffect(() => {
|
|
169
171
|
var t;
|
|
170
172
|
if (p.current && I) {
|
|
171
173
|
const n = (t = p.current.element) == null ? void 0 : t.getBoundingClientRect();
|
|
172
|
-
n && (
|
|
174
|
+
n && (J(n.top + window.scrollY + n.height), V(n.left + window.scrollX + n.width));
|
|
173
175
|
}
|
|
174
176
|
}, [I]), e.useImperativeHandle(
|
|
175
177
|
b,
|
|
@@ -178,13 +180,13 @@ const gt = (l, b) => l.map((u) => {
|
|
|
178
180
|
hide: () => h()
|
|
179
181
|
}),
|
|
180
182
|
[h]
|
|
181
|
-
), /* @__PURE__ */ e.createElement(e.Fragment, null,
|
|
182
|
-
|
|
183
|
+
), /* @__PURE__ */ e.createElement(e.Fragment, null, rt, g && /* @__PURE__ */ e.createElement(
|
|
184
|
+
dt,
|
|
183
185
|
{
|
|
184
186
|
autoFocus: !1,
|
|
185
187
|
title: u.toLanguageString(S, w[S]),
|
|
186
|
-
initialTop:
|
|
187
|
-
initialLeft:
|
|
188
|
+
initialTop: Y,
|
|
189
|
+
initialLeft: Q,
|
|
188
190
|
initialWidth: 520,
|
|
189
191
|
initialHeight: 500,
|
|
190
192
|
onClose: h,
|
|
@@ -192,11 +194,11 @@ const gt = (l, b) => l.map((u) => {
|
|
|
192
194
|
draggable: !0,
|
|
193
195
|
className: "k-grid-assistant-window"
|
|
194
196
|
},
|
|
195
|
-
|
|
197
|
+
nt
|
|
196
198
|
));
|
|
197
199
|
}
|
|
198
200
|
);
|
|
199
|
-
|
|
201
|
+
Ct.displayName = "KendoReactGridToolbarAIAssistant";
|
|
200
202
|
export {
|
|
201
|
-
|
|
203
|
+
Ct as GridToolbarAIAssistant
|
|
202
204
|
};
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
9
|
-
`);return r.createElement("div",{className:"k-card-body"},n.map((a,c)=>r.createElement("div",{key:a.trim()+c,className:"k-card-text"},a)))},
|
|
8
|
+
"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(`
|
|
9
|
+
`);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;
|
|
@@ -6,17 +6,17 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as e from "react";
|
|
9
|
-
import { promptViewDefaults as l, AIPrompt as D, outputViewDefaults as g, AIPromptView as
|
|
10
|
-
import { Button as
|
|
11
|
-
import { TextArea as
|
|
12
|
-
import { tableWizardIcon as
|
|
9
|
+
import { promptViewDefaults as l, AIPrompt as D, outputViewDefaults as g, AIPromptView as q, AIPromptOutputView as z } from "@progress/kendo-react-conversational-ui";
|
|
10
|
+
import { Button as L } from "@progress/kendo-react-buttons";
|
|
11
|
+
import { TextArea as O } from "@progress/kendo-react-inputs";
|
|
12
|
+
import { tableWizardIcon as B } from "@progress/kendo-svg-icons";
|
|
13
13
|
import { toolbarAIApply as a, messages as d } from "../../messages/index.mjs";
|
|
14
|
-
import { useLocalization as
|
|
14
|
+
import { useLocalization as T } from "@progress/kendo-react-intl";
|
|
15
15
|
const H = (s) => {
|
|
16
16
|
const { responseContent: o } = s, r = o.split(`
|
|
17
17
|
`);
|
|
18
18
|
return /* @__PURE__ */ e.createElement("div", { className: "k-card-body" }, r.map((n, i) => /* @__PURE__ */ e.createElement("div", { key: n.trim() + i, className: "k-card-text" }, n)));
|
|
19
|
-
},
|
|
19
|
+
}, J = (s) => {
|
|
20
20
|
const {
|
|
21
21
|
activeView: o,
|
|
22
22
|
onActiveViewChange: r,
|
|
@@ -31,15 +31,16 @@ const H = (s) => {
|
|
|
31
31
|
suggestionsList: I,
|
|
32
32
|
outputCard: V,
|
|
33
33
|
promptPlaceHolder: h,
|
|
34
|
-
streaming:
|
|
35
|
-
loading:
|
|
34
|
+
streaming: b,
|
|
35
|
+
loading: E,
|
|
36
36
|
onCancel: v,
|
|
37
|
-
onClose: p
|
|
38
|
-
|
|
37
|
+
onClose: p,
|
|
38
|
+
enableSpeechToText: x
|
|
39
|
+
} = s, m = T(), [P, c] = e.useState(l.name), k = (t, K) => {
|
|
39
40
|
t && (u && u(t), c(g.name));
|
|
40
|
-
}, k = (t) => {
|
|
41
|
-
r && r(t), c(t);
|
|
42
41
|
}, R = (t) => {
|
|
42
|
+
r && r(t), c(t);
|
|
43
|
+
}, S = (t) => {
|
|
43
44
|
t.key === "Escape" && p && p();
|
|
44
45
|
};
|
|
45
46
|
return e.useEffect(() => {
|
|
@@ -49,36 +50,37 @@ const H = (s) => {
|
|
|
49
50
|
D,
|
|
50
51
|
{
|
|
51
52
|
style: { maxHeight: "100%" },
|
|
52
|
-
activeView: o != null ? o :
|
|
53
|
-
onActiveViewChange:
|
|
54
|
-
onPromptRequest:
|
|
53
|
+
activeView: o != null ? o : P,
|
|
54
|
+
onActiveViewChange: R,
|
|
55
|
+
onPromptRequest: k,
|
|
55
56
|
toolbarItems: n || [l, g],
|
|
56
|
-
streaming:
|
|
57
|
-
loading:
|
|
57
|
+
streaming: b,
|
|
58
|
+
loading: E,
|
|
58
59
|
suggestionsView: "modern",
|
|
59
60
|
onCancel: v,
|
|
60
|
-
onKeyDown:
|
|
61
|
+
onKeyDown: S
|
|
61
62
|
},
|
|
62
63
|
/* @__PURE__ */ e.createElement(
|
|
63
|
-
|
|
64
|
+
q,
|
|
64
65
|
{
|
|
65
66
|
promptSuggestions: I,
|
|
66
67
|
promptValue: f,
|
|
67
|
-
promptInput: w || /* @__PURE__ */ e.createElement(
|
|
68
|
+
promptInput: w || /* @__PURE__ */ e.createElement(O, { placeholder: h, rows: 2 }),
|
|
68
69
|
generateButton: A || /* @__PURE__ */ e.createElement(
|
|
69
|
-
|
|
70
|
+
L,
|
|
70
71
|
{
|
|
71
|
-
svgIcon:
|
|
72
|
+
svgIcon: B,
|
|
72
73
|
icon: "table-wizard",
|
|
73
74
|
type: "button",
|
|
74
75
|
title: m.toLanguageString(a, d[a])
|
|
75
76
|
},
|
|
76
77
|
m.toLanguageString(a, d[a])
|
|
77
|
-
)
|
|
78
|
+
),
|
|
79
|
+
enableSpeechToText: x
|
|
78
80
|
}
|
|
79
81
|
),
|
|
80
82
|
/* @__PURE__ */ e.createElement(
|
|
81
|
-
|
|
83
|
+
z,
|
|
82
84
|
{
|
|
83
85
|
outputs: i,
|
|
84
86
|
showOutputRating: !0,
|
|
@@ -90,5 +92,5 @@ const H = (s) => {
|
|
|
90
92
|
);
|
|
91
93
|
};
|
|
92
94
|
export {
|
|
93
|
-
|
|
95
|
+
J as GridAIPrompt
|
|
94
96
|
};
|