@progress/kendo-react-grid 11.4.0-develop.9 → 11.4.0

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