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