@progress/kendo-react-grid 11.3.1 → 11.4.0-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.
@@ -5,39 +5,44 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- const e = "grid.noRecords", r = "grid.pagerInfo", t = "grid.pagerFirstPage", o = "grid.pagerPreviousPage", l = "grid.pagerNextPage", i = "grid.pagerLastPage", a = "grid.pagerItemsPerPage", n = "grid.pagerPage", s = "grid.pagerPageSizeAriaLabel", g = "grid.pagerOf", d = "grid.pagerTotalPages", p = "grid.groupPanelEmpty", u = "grid.groupColumn", c = "grid.ungroupColumn", C = "grid.columnMenu", f = "grid.filterApplyButton", m = "grid.filterClearButton", h = "grid.filterClearAllButton", b = "grid.filterResetButton", A = "grid.filterSubmitButton", P = "grid.filterTitle", S = "grid.sortAscending", I = "grid.sortDescending", T = "grid.sortClearButton", B = "grid.sortApplyButton", O = "grid.searchPlaceholder", y = "grid.searchboxPlaceholder", F = "grid.exportPDF", v = "grid.filterCheckAll", x = "grid.filterChooseOperator", D = "grid.filterSelectAll", E = "grid.filterSelectedItems", L = "grid.sortAriaLabel", G = "grid.editDialogTitle", R = "grid.editDialogSaveButtonTitle", M = "grid.editDialogCancelButtonTitle", q = "grid.filterAriaLabel", w = "grid.groupPanelAriaLabel", N = "grid.groupExpand", k = "grid.groupCollapse", z = "grid.groupClearButton", W = "grid.groupApplyButton", U = "grid.detailExpand", j = "grid.detailCollapse", H = "grid.selectRow", J = "grid.gridAriaLabel", K = "grid.gridRowReorderAriaLabel", Q = "grid.gridAdaptiveColumnMenuFilterTitle", V = "grid.columnMenuColumnChooserTitle", X = "grid.columnMenuColumnChooserSelectedItems", Y = "grid.adaptiveColumnMenuChooserTitle", Z = "grid.adaptiveColumnMenuChooserSubTitle", _ = "grid.columnChooserApplyButton", $ = "grid.columnChooserResetButton", ee = "grid.adaptiveColumnMenuCheckboxFilterTitle", re = "grid.adaptiveToolbarSortTitle", te = "grid.adaptiveToolbarGroupTitle", oe = "grid.toolbarSort", le = "grid.toolbarGroup", ie = "grid.toolbarFilter", ae = "grid.toolbarColumnsChooser", ne = "grid.toolbarCheckboxFilter", se = {
8
+ const e = "grid.noRecords", t = "grid.pagerInfo", r = "grid.pagerFirstPage", o = "grid.pagerPreviousPage", l = "grid.pagerNextPage", i = "grid.pagerLastPage", a = "grid.pagerItemsPerPage", n = "grid.pagerPage", s = "grid.pagerPageSizeAriaLabel", g = "grid.pagerOf", d = "grid.pagerTotalPages", p = "grid.groupPanelEmpty", u = "grid.groupColumn", c = "grid.ungroupColumn", C = "grid.columnMenu", f = "grid.filterApplyButton", m = "grid.filterClearButton", h = "grid.filterClearAllButton", A = "grid.filterResetButton", b = "grid.filterSubmitButton", I = "grid.filterTitle", P = "grid.sortAscending", S = "grid.sortDescending", T = "grid.sortClearButton", B = "grid.sortApplyButton", O = "grid.searchPlaceholder", y = "grid.searchboxPlaceholder", D = "grid.exportPDF", F = "grid.filterCheckAll", v = "grid.filterChooseOperator", x = "grid.filterSelectAll", E = "grid.filterSelectedItems", L = "grid.sortAriaLabel", R = "grid.editDialogTitle", G = "grid.editDialogSaveButtonTitle", M = "grid.editDialogCancelButtonTitle", w = "grid.filterAriaLabel", q = "grid.groupPanelAriaLabel", N = "grid.groupExpand", k = "grid.groupCollapse", W = "grid.groupClearButton", z = "grid.groupApplyButton", U = "grid.detailExpand", j = "grid.detailCollapse", H = "grid.selectRow", J = "grid.gridAriaLabel", K = "grid.gridRowReorderAriaLabel", Q = "grid.gridAdaptiveColumnMenuFilterTitle", V = "grid.columnMenuColumnChooserTitle", X = "grid.columnMenuColumnChooserSelectedItems", Y = "grid.adaptiveColumnMenuChooserTitle", Z = "grid.adaptiveColumnMenuChooserSubTitle", _ = "grid.columnChooserApplyButton", $ = "grid.columnChooserResetButton", ee = "grid.adaptiveColumnMenuCheckboxFilterTitle", te = "grid.adaptiveToolbarSortTitle", re = "grid.adaptiveToolbarGroupTitle", oe = "grid.toolbarSort", le = "grid.toolbarAI", ie = "grid.aIResponseData", ae = "grid.generatedWithAI", ne = "grid.toolbarAIApply", se = "grid.toolbarGroup", ge = "grid.toolbarFilter", de = "grid.toolbarColumnsChooser", pe = "grid.toolbarCheckboxFilter", ue = {
9
9
  [U]: "Expand detail row",
10
10
  [j]: "Collapse detail row",
11
11
  [N]: "Expand group",
12
12
  [k]: "Collapse Group",
13
- [z]: "Clear grouping",
14
- [W]: "Done",
13
+ [W]: "Clear grouping",
14
+ [z]: "Done",
15
15
  [e]: "No records available",
16
16
  [p]: "Drag a column header and drop it here to group by that column",
17
17
  [f]: "Apply",
18
18
  [m]: "Clear",
19
19
  [h]: "Clear all filters",
20
- [b]: "Reset",
21
- [A]: "Filter",
22
- [P]: "Filter",
23
- [S]: "Sort Ascending",
24
- [I]: "Sort Descending",
20
+ [A]: "Reset",
21
+ [b]: "Filter",
22
+ [I]: "Filter",
23
+ [P]: "Sort Ascending",
24
+ [S]: "Sort Descending",
25
25
  [T]: "Clear sorting",
26
26
  [B]: "Done",
27
27
  [L]: "Sortable",
28
- [re]: "Sort by",
29
- [te]: "Group by",
28
+ [te]: "Sort by",
29
+ [re]: "Group by",
30
30
  [oe]: "Sort",
31
- [le]: "Group",
32
- [ie]: "Filter",
33
- [ae]: "Columns",
34
- [ne]: "Filter",
31
+ [le]: "AI Assistant",
32
+ [ne]: "Apply",
33
+ [ie]: `Operation is successful. Data is:
34
+ `,
35
+ [ae]: "Generated with AI",
36
+ [se]: "Group",
37
+ [ge]: "Filter",
38
+ [de]: "Columns",
39
+ [pe]: "Filter",
35
40
  [u]: "Group Column",
36
41
  [c]: "Ungroup Column",
37
42
  [C]: "Column menu",
38
43
  [a]: "items per page",
39
- [r]: "{0} - {1} of {2} items",
40
- [t]: "Go to the first page",
44
+ [t]: "{0} - {1} of {2} items",
45
+ [r]: "Go to the first page",
41
46
  [o]: "Go to the previous page",
42
47
  [l]: "Go to the next page",
43
48
  [i]: "Go to the last page",
@@ -47,16 +52,16 @@ const e = "grid.noRecords", r = "grid.pagerInfo", t = "grid.pagerFirstPage", o =
47
52
  [d]: "{0}",
48
53
  [O]: "Search",
49
54
  [y]: "Search...",
50
- [F]: "Export PDF",
51
- [v]: "Check All",
52
- [G]: "Edit Dialog",
53
- [R]: "Save",
55
+ [D]: "Export PDF",
56
+ [F]: "Check All",
57
+ [R]: "Edit Dialog",
58
+ [G]: "Save",
54
59
  [M]: "Cancel",
55
- [x]: "Choose Operator",
60
+ [v]: "Choose Operator",
56
61
  [E]: "selected items",
57
- [D]: "Select All",
58
- [q]: "Filter",
59
- [w]: "Group panel",
62
+ [x]: "Select All",
63
+ [w]: "Filter",
64
+ [q]: "Group panel",
60
65
  [J]: "Table",
61
66
  [K]: "Drag row",
62
67
  [H]: "Select Row",
@@ -93,12 +98,13 @@ const e = "grid.noRecords", r = "grid.pagerInfo", t = "grid.pagerFirstPage", o =
93
98
  "grid.filterOrLogic": "Or"
94
99
  };
95
100
  export {
101
+ ie as aIResponseData,
96
102
  ee as adaptiveColumnMenuCheckboxFilterTitle,
97
103
  Z as adaptiveColumnMenuChooserSubTitle,
98
104
  Y as adaptiveColumnMenuChooserTitle,
99
105
  Q as adaptiveColumnMenuFilterTitle,
100
- te as adaptiveToolbarGroupTitle,
101
- re as adaptiveToolbarSortTitle,
106
+ re as adaptiveToolbarGroupTitle,
107
+ te as adaptiveToolbarSortTitle,
102
108
  _ as columnChooserApplyButton,
103
109
  $ as columnChooserResetButton,
104
110
  C as columnMenu,
@@ -107,33 +113,34 @@ export {
107
113
  j as detailCollapse,
108
114
  U as detailExpand,
109
115
  M as editDialogCancelButtonTitle,
110
- R as editDialogSaveButtonTitle,
111
- G as editDialogTitle,
112
- F as exportPDF,
116
+ G as editDialogSaveButtonTitle,
117
+ R as editDialogTitle,
118
+ D as exportPDF,
113
119
  f as filterApplyButton,
114
- q as filterAriaLabel,
115
- v as filterCheckAll,
116
- x as filterChooseOperator,
120
+ w as filterAriaLabel,
121
+ F as filterCheckAll,
122
+ v as filterChooseOperator,
117
123
  h as filterClearAllButton,
118
124
  m as filterClearButton,
119
- b as filterResetButton,
120
- D as filterSelectAll,
125
+ A as filterResetButton,
126
+ x as filterSelectAll,
121
127
  E as filterSelectedItems,
122
- A as filterSubmitButton,
123
- P as filterTitle,
128
+ b as filterSubmitButton,
129
+ I as filterTitle,
130
+ ae as generatedWithAI,
124
131
  J as gridAriaLabel,
125
132
  K as gridRowReorderAriaLabel,
126
- W as groupApplyButton,
127
- z as groupClearButton,
133
+ z as groupApplyButton,
134
+ W as groupClearButton,
128
135
  k as groupCollapse,
129
136
  u as groupColumn,
130
137
  N as groupExpand,
131
- w as groupPanelAriaLabel,
138
+ q as groupPanelAriaLabel,
132
139
  p as groupPanelEmpty,
133
- se as messages,
140
+ ue as messages,
134
141
  e as noRecords,
135
- t as pagerFirstPage,
136
- r as pagerInfo,
142
+ r as pagerFirstPage,
143
+ t as pagerInfo,
137
144
  a as pagerItemPerPage,
138
145
  i as pagerLastPage,
139
146
  l as pagerNextPage,
@@ -147,13 +154,15 @@ export {
147
154
  H as selectRow,
148
155
  B as sortApplyButton,
149
156
  L as sortAriaLabel,
150
- S as sortAscending,
157
+ P as sortAscending,
151
158
  T as sortClearButton,
152
- I as sortDescending,
153
- ne as toolbarCheckboxFilter,
154
- ae as toolbarColumnsChooser,
155
- ie as toolbarFilter,
156
- le as toolbarGroup,
159
+ S as sortDescending,
160
+ le as toolbarAI,
161
+ ne as toolbarAIApply,
162
+ pe as toolbarCheckboxFilter,
163
+ de as toolbarColumnsChooser,
164
+ ge as toolbarFilter,
165
+ se as toolbarGroup,
157
166
  oe as toolbarSort,
158
167
  c as ungroupColumn
159
168
  };
@@ -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: 1753442180,version:"11.3.1",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={name:"@progress/kendo-react-grid",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1753686722,version:"11.4.0-develop.1",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};exports.packageMetadata=e;
@@ -10,8 +10,8 @@ const e = {
10
10
  productName: "KendoReact",
11
11
  productCode: "KENDOUIREACT",
12
12
  productCodes: ["KENDOUIREACT"],
13
- publishDate: 1753442180,
14
- version: "11.3.1",
13
+ publishDate: 1753686722,
14
+ version: "11.4.0-develop.1",
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.3.1",
3
+ "version": "11.4.0-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,20 +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.6.0",
31
- "@progress/kendo-react-animation": "11.3.1",
32
- "@progress/kendo-react-buttons": "11.3.1",
33
- "@progress/kendo-react-common": "11.3.1",
34
- "@progress/kendo-react-data-tools": "11.3.1",
35
- "@progress/kendo-react-dateinputs": "11.3.1",
36
- "@progress/kendo-react-indicators": "11.3.1",
37
- "@progress/kendo-react-form": "11.3.1",
38
- "@progress/kendo-react-labels": "11.3.1",
39
- "@progress/kendo-react-dialogs": "11.3.1",
40
- "@progress/kendo-react-dropdowns": "11.3.1",
41
- "@progress/kendo-react-inputs": "11.3.1",
42
- "@progress/kendo-react-intl": "11.3.1",
43
- "@progress/kendo-react-popup": "11.3.1",
44
- "@progress/kendo-react-layout": "11.3.1",
31
+ "@progress/kendo-react-animation": "11.4.0-develop.1",
32
+ "@progress/kendo-react-buttons": "11.4.0-develop.1",
33
+ "@progress/kendo-react-common": "11.4.0-develop.1",
34
+ "@progress/kendo-react-data-tools": "11.4.0-develop.1",
35
+ "@progress/kendo-react-dateinputs": "11.4.0-develop.1",
36
+ "@progress/kendo-react-indicators": "11.4.0-develop.1",
37
+ "@progress/kendo-react-form": "11.4.0-develop.1",
38
+ "@progress/kendo-react-labels": "11.4.0-develop.1",
39
+ "@progress/kendo-react-dialogs": "11.4.0-develop.1",
40
+ "@progress/kendo-react-dropdowns": "11.4.0-develop.1",
41
+ "@progress/kendo-react-inputs": "11.4.0-develop.1",
42
+ "@progress/kendo-react-intl": "11.4.0-develop.1",
43
+ "@progress/kendo-react-popup": "11.4.0-develop.1",
44
+ "@progress/kendo-react-layout": "11.4.0-develop.1",
45
+ "@progress/kendo-react-conversational-ui": "11.4.0-develop.1",
45
46
  "@progress/kendo-svg-icons": "^4.0.0",
46
47
  "react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
47
48
  "react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
@@ -145,7 +146,7 @@
145
146
  "package": {
146
147
  "productName": "KendoReact",
147
148
  "productCode": "KENDOUIREACT",
148
- "publishDate": 1753442180,
149
+ "publishDate": 1753686722,
149
150
  "licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
150
151
  }
151
152
  },
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Z=require("react"),ee=require("../utils/GridContext.js"),te=require("@progress/kendo-react-buttons"),oe=require("@progress/kendo-svg-icons"),j=require("axios"),x=require("@progress/kendo-react-intl"),l=require("../messages/index.js"),v=require("@progress/kendo-react-common"),ne=require("@progress/kendo-react-dialogs"),se=require("./ai-tool/GridAIPrompt.js");function re(a){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const c in a)if(c!=="default"){const i=Object.getOwnPropertyDescriptor(a,c);Object.defineProperty(o,c,i.get?i:{enumerable:!0,get:()=>a[c]})}}return o.default=a,Object.freeze(o)}const s=re(Z),ae=(a,o)=>a.map(i=>{let f=i;return o.forEach(u=>{u.field&&f.includes(u.field)&&(f=f.replace(new RegExp(u.field,"g"),u.title||u.field))}),f}),D=a=>{const o=s.useContext(ee.GridContext),c=x.useInternationalization(),i=x.useLocalization(),{requestUrl:f,requestOptions:u,onPromptRequest:A,onResponseSuccess:R,onResponseError:I,role:E="user",gridAIPrompt:G=se.GridAIPrompt,icon:W,svgIcon:h,onCloseWindow:y}=a,[b,k]=s.useState([]),z=s.useMemo(()=>o&&Array.isArray(o.columnsRef)?o.columnsRef.map(e=>({field:e.field})):[],[o]),[B,p]=s.useState(!1),[m,w]=s.useState(!1),[L,M]=s.useState(),[F,N]=s.useState(),g=s.useRef(null),C=s.useRef(null),q=e=>{e.preventDefault(),w(!m)},S=s.useMemo(()=>{var e;return(e=a.show)!=null?e:m},[a.show,m]),O=()=>{var e;y&&y(),k([]),w(!1),g.current&&((e=g.current.element)==null||e.focus())},T=e=>{e.filters=e.filters.map(n=>{if(n.value){const d=c.parseDate(n.value);d&&(n.value=d)}return n})},_=(e,n,d)=>{if(p(!1),e!=null&&e.data){if(e.data.sort&&o.sortChange(e.data.sort,e),e.data.filter){let t=e.data.filter;if(t&&Object.keys(t).length===0&&(t=null),t!=null&&t.filters&&Array.isArray(t.filters)){T(t);const r=o.filter||{filters:[],logic:"or"},J=t.filters.map(Q=>({logic:"and",filters:[Q]}));t={...r,filters:[...r.filters,...J]}}o.filterChange(t,e)}if(e.data.highlight){let t=e.data.highlight;Array.isArray(t)&&(t=t.map(r=>(r!=null&&r.filters&&Array.isArray(r.filters)&&T(r),r))),o.highlightChange(t)}if(e.data.group&&o.groupChange(e.data.group,e),e.data.messages){const t=[i.toLanguageString(l.aIResponseData,l.messages[l.aIResponseData])],r=ae(e.data.messages,o.columnsRef).join(`
9
+ `);k([...b,{id:b.length+1,title:i.toLanguageString(l.generatedWithAI,l.messages[l.generatedWithAI]),subTitle:n,prompt:n,responseContent:t.concat(r).join(""),isRetry:d}])}}R&&R(e)},H=e=>{I&&I(e),p(!1)},$=(e,n)=>{const d=j.CancelToken.source();console.log("Prompt requested:",e,n);const t={role:"user",columns:z||[],headers:{Accept:"*/*","Content-Type":"application/json"},promptMessage:e,requestOptions:{url:f,method:"POST",withCredentials:!1,responseType:"json",cancelToken:d.token,...u}};A&&A(t,n),t.requestOptions.url!==void 0&&(p(!0),j({...t.requestOptions,headers:t.headers,data:{role:E||t.role,contents:[{$type:"text",text:t.promptMessage}],columns:t.columns||[]},...a.requestOptions}).then(r=>_(r,t.promptMessage,n)).catch(H),C.current=d)},K=()=>{C.current&&C.current.cancel("Request cancelled by user."),p(!1)},[U,P]=v.useCustomComponent(G),V=Object.keys(P).length>0?P:{},X=s.createElement(U,{onPromptRequest:$,onCancel:K,onClose:O,streaming:B,outputs:b,...V}),Y=s.createElement(te.Button,{ref:g,togglable:!0,themeColor:"primary",rounded:"full",selected:S,svgIcon:h!=null?h:oe.sparklesIcon,icon:W,size:o.mobileMode?"large":"medium",className:v.classNames("k-toolbar-button",{"k-icon-button":o.mobileMode}),title:i.toLanguageString(l.toolbarAI,l.messages[l.toolbarAI]),onClick:q});return s.useEffect(()=>{var e;if(g.current&&S){const n=(e=g.current.element)==null?void 0:e.getBoundingClientRect();n&&(M(n.top+window.scrollY+n.height),N(n.left+window.scrollX+n.width))}},[S]),s.createElement(s.Fragment,null,Y,m&&s.createElement(ne.Window,{autoFocus:!1,title:i.toLanguageString(l.toolbarAI,l.messages[l.toolbarAI]),top:L,left:F,onClose:O,resizable:!0,draggable:!0,initialWidth:437,initialHeight:460,className:"k-grid-assistant-window"},X))};D.displayName="KendoReactGridToolbarAI";exports.GridToolbarAI=D;
@@ -0,0 +1,187 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import * as n from "react";
9
+ import { GridContext as q } from "../utils/GridContext.mjs";
10
+ import { Button as ee } from "@progress/kendo-react-buttons";
11
+ import { sparklesIcon as te } from "@progress/kendo-svg-icons";
12
+ import E from "axios";
13
+ import { useInternationalization as oe, useLocalization as ne } from "@progress/kendo-react-intl";
14
+ import { toolbarAI as m, messages as g, aIResponseData as j, generatedWithAI as v } from "../messages/index.mjs";
15
+ import { useCustomComponent as se, classNames as re } from "@progress/kendo-react-common";
16
+ import { Window as ae } from "@progress/kendo-react-dialogs";
17
+ import { GridAIPrompt as le } from "./ai-tool/GridAIPrompt.mjs";
18
+ const ie = (i, s) => i.map((c) => {
19
+ let u = c;
20
+ return s.forEach((a) => {
21
+ a.field && u.includes(a.field) && (u = u.replace(new RegExp(a.field, "g"), a.title || a.field));
22
+ }), u;
23
+ }), ce = (i) => {
24
+ const s = n.useContext(q), w = oe(), c = ne(), {
25
+ requestUrl: u,
26
+ requestOptions: a,
27
+ onPromptRequest: R,
28
+ onResponseSuccess: b,
29
+ onResponseError: y,
30
+ role: L = "user",
31
+ gridAIPrompt: W = le,
32
+ icon: z,
33
+ svgIcon: h,
34
+ onCloseWindow: T
35
+ } = i, [C, k] = n.useState([]), B = n.useMemo(() => s && Array.isArray(s.columnsRef) ? s.columnsRef.map((e) => ({ field: e.field })) : [], [s]), [D, d] = n.useState(!1), [p, I] = n.useState(!1), [F, G] = n.useState(), [M, N] = n.useState(), f = n.useRef(null), S = n.useRef(null), H = (e) => {
36
+ e.preventDefault(), I(!p);
37
+ }, A = n.useMemo(() => {
38
+ var e;
39
+ return (e = i.show) != null ? e : p;
40
+ }, [i.show, p]), P = () => {
41
+ var e;
42
+ T && T(), k([]), I(!1), f.current && ((e = f.current.element) == null || e.focus());
43
+ }, O = (e) => {
44
+ e.filters = e.filters.map((o) => {
45
+ if (o.value) {
46
+ const l = w.parseDate(o.value);
47
+ l && (o.value = l);
48
+ }
49
+ return o;
50
+ });
51
+ }, $ = (e, o, l) => {
52
+ if (d(!1), e != null && e.data) {
53
+ if (e.data.sort && s.sortChange(e.data.sort, e), e.data.filter) {
54
+ let t = e.data.filter;
55
+ if (t && Object.keys(t).length === 0 && (t = null), t != null && t.filters && Array.isArray(t.filters)) {
56
+ O(t);
57
+ const r = s.filter || { filters: [], logic: "or" }, Z = t.filters.map((_) => ({
58
+ logic: "and",
59
+ filters: [_]
60
+ }));
61
+ t = {
62
+ ...r,
63
+ filters: [
64
+ ...r.filters,
65
+ ...Z
66
+ ]
67
+ };
68
+ }
69
+ s.filterChange(t, e);
70
+ }
71
+ if (e.data.highlight) {
72
+ let t = e.data.highlight;
73
+ Array.isArray(t) && (t = t.map((r) => (r != null && r.filters && Array.isArray(r.filters) && O(r), r))), s.highlightChange(t);
74
+ }
75
+ if (e.data.group && s.groupChange(e.data.group, e), e.data.messages) {
76
+ const t = [c.toLanguageString(j, g[j])], r = ie(e.data.messages, s.columnsRef).join(
77
+ `
78
+ `
79
+ );
80
+ k([
81
+ ...C,
82
+ {
83
+ id: C.length + 1,
84
+ title: c.toLanguageString(v, g[v]),
85
+ subTitle: o,
86
+ prompt: o,
87
+ responseContent: t.concat(r).join(""),
88
+ isRetry: l
89
+ }
90
+ ]);
91
+ }
92
+ }
93
+ b && b(e);
94
+ }, K = (e) => {
95
+ y && y(e), d(!1);
96
+ }, U = (e, o) => {
97
+ const l = E.CancelToken.source();
98
+ console.log("Prompt requested:", e, o);
99
+ const t = {
100
+ role: "user",
101
+ columns: B || [],
102
+ headers: {
103
+ Accept: "*/*",
104
+ "Content-Type": "application/json"
105
+ },
106
+ promptMessage: e,
107
+ requestOptions: {
108
+ url: u,
109
+ method: "POST",
110
+ withCredentials: !1,
111
+ responseType: "json",
112
+ cancelToken: l.token,
113
+ ...a
114
+ }
115
+ };
116
+ R && R(t, o), t.requestOptions.url !== void 0 && (d(!0), E({
117
+ ...t.requestOptions,
118
+ headers: t.headers,
119
+ data: {
120
+ role: L || t.role,
121
+ contents: [
122
+ {
123
+ $type: "text",
124
+ text: t.promptMessage
125
+ }
126
+ ],
127
+ columns: t.columns || []
128
+ },
129
+ ...i.requestOptions
130
+ }).then((r) => $(r, t.promptMessage, o)).catch(K), S.current = l);
131
+ }, V = () => {
132
+ S.current && S.current.cancel("Request cancelled by user."), d(!1);
133
+ }, [X, x] = se(
134
+ W
135
+ ), Y = Object.keys(x).length > 0 ? x : {}, J = /* @__PURE__ */ n.createElement(
136
+ X,
137
+ {
138
+ onPromptRequest: U,
139
+ onCancel: V,
140
+ onClose: P,
141
+ streaming: D,
142
+ outputs: C,
143
+ ...Y
144
+ }
145
+ ), Q = /* @__PURE__ */ n.createElement(
146
+ ee,
147
+ {
148
+ ref: f,
149
+ togglable: !0,
150
+ themeColor: "primary",
151
+ rounded: "full",
152
+ selected: A,
153
+ svgIcon: h != null ? h : te,
154
+ icon: z,
155
+ size: s.mobileMode ? "large" : "medium",
156
+ className: re("k-toolbar-button", { "k-icon-button": s.mobileMode }),
157
+ title: c.toLanguageString(m, g[m]),
158
+ onClick: H
159
+ }
160
+ );
161
+ return n.useEffect(() => {
162
+ var e;
163
+ if (f.current && A) {
164
+ const o = (e = f.current.element) == null ? void 0 : e.getBoundingClientRect();
165
+ o && (G(o.top + window.scrollY + o.height), N(o.left + window.scrollX + o.width));
166
+ }
167
+ }, [A]), /* @__PURE__ */ n.createElement(n.Fragment, null, Q, p && /* @__PURE__ */ n.createElement(
168
+ ae,
169
+ {
170
+ autoFocus: !1,
171
+ title: c.toLanguageString(m, g[m]),
172
+ top: F,
173
+ left: M,
174
+ onClose: P,
175
+ resizable: !0,
176
+ draggable: !0,
177
+ initialWidth: 437,
178
+ initialHeight: 460,
179
+ className: "k-grid-assistant-window"
180
+ },
181
+ J
182
+ ));
183
+ };
184
+ ce.displayName = "KendoReactGridToolbarAI";
185
+ export {
186
+ ce as GridToolbarAI
187
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("react"),u=require("@progress/kendo-react-conversational-ui"),O=require("@progress/kendo-react-buttons"),S=require("@progress/kendo-react-inputs"),D=require("@progress/kendo-svg-icons"),s=require("../../messages/index.js"),E=require("@progress/kendo-react-intl");function h(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=h(R),x=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)))},j=t=>{const{activeView:o,onActiveViewChange:n,toolbarItems:a,outputs:c,promptValue:d,promptInput:g,generateButton:f,onCopy:b,onOutputRating:A,onPromptRequest:i,suggestionsList:y,outputCard:I,promptPlaceHolder:w,streaming:k,onCancel:v,onClose:p}=t,l=E.useLocalization(),[C,m]=r.useState(u.promptViewDefaults.name),V=(e,z)=>{e&&(i&&i(e),m(u.outputViewDefaults.name))},q=e=>{n&&n(e),m(e)},P=e=>{e.key==="Escape"&&p&&p()};return r.useEffect(()=>{const e=document.querySelector(".k-prompt-view .k-textarea textarea");e&&e.focus()},[]),r.createElement(u.AIPrompt,{activeView:o!=null?o:C,onActiveViewChange:q,onPromptRequest:V,toolbarItems:a||[u.promptViewDefaults,u.outputViewDefaults],streaming:k,onCancel:v,onKeyDown:P},r.createElement(u.AIPromptView,{promptSuggestions:y,promptValue:d,promptInput:g||r.createElement(S.TextArea,{placeholder:w,rows:2}),generateButton:f||r.createElement(O.Button,{svgIcon:D.tableWizardIcon,icon:"table-wizard",type:"button",title:l.toLanguageString(s.toolbarAIApply,s.messages[s.toolbarAIApply])},l.toLanguageString(s.toolbarAIApply,s.messages[s.toolbarAIApply]))}),r.createElement(u.AIPromptOutputView,{outputs:c,showOutputRating:!0,onCopy:b,onOutputRating:A,outputCard:I||{body:x}}))};exports.GridAIPrompt=j;
@@ -0,0 +1,90 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import * as e from "react";
9
+ import { promptViewDefaults as l, AIPrompt as R, outputViewDefaults as g, AIPromptView as D, AIPromptOutputView as S } from "@progress/kendo-react-conversational-ui";
10
+ import { Button as q } from "@progress/kendo-react-buttons";
11
+ import { TextArea as z } from "@progress/kendo-react-inputs";
12
+ import { tableWizardIcon as L } from "@progress/kendo-svg-icons";
13
+ import { toolbarAIApply as a, messages as f } from "../../messages/index.mjs";
14
+ import { useLocalization as O } from "@progress/kendo-react-intl";
15
+ const B = (s) => {
16
+ const { responseContent: o } = s, r = o.split(`
17
+ `);
18
+ return /* @__PURE__ */ e.createElement("div", { className: "k-card-body" }, r.map((n, u) => /* @__PURE__ */ e.createElement("div", { key: n.trim() + u, className: "k-card-text" }, n)));
19
+ }, j = (s) => {
20
+ const {
21
+ activeView: o,
22
+ onActiveViewChange: r,
23
+ toolbarItems: n,
24
+ outputs: u,
25
+ promptValue: d,
26
+ promptInput: w,
27
+ generateButton: A,
28
+ onCopy: C,
29
+ onOutputRating: I,
30
+ onPromptRequest: i,
31
+ suggestionsList: y,
32
+ outputCard: V,
33
+ promptPlaceHolder: E,
34
+ streaming: b,
35
+ onCancel: h,
36
+ onClose: p
37
+ } = s, m = O(), [v, c] = e.useState(l.name), P = (t, K) => {
38
+ t && (i && i(t), c(g.name));
39
+ }, k = (t) => {
40
+ r && r(t), c(t);
41
+ }, x = (t) => {
42
+ t.key === "Escape" && p && p();
43
+ };
44
+ return e.useEffect(() => {
45
+ const t = document.querySelector(".k-prompt-view .k-textarea textarea");
46
+ t && t.focus();
47
+ }, []), /* @__PURE__ */ e.createElement(
48
+ R,
49
+ {
50
+ activeView: o != null ? o : v,
51
+ onActiveViewChange: k,
52
+ onPromptRequest: P,
53
+ toolbarItems: n || [l, g],
54
+ streaming: b,
55
+ onCancel: h,
56
+ onKeyDown: x
57
+ },
58
+ /* @__PURE__ */ e.createElement(
59
+ D,
60
+ {
61
+ promptSuggestions: y,
62
+ promptValue: d,
63
+ promptInput: w || /* @__PURE__ */ e.createElement(z, { placeholder: E, rows: 2 }),
64
+ generateButton: A || /* @__PURE__ */ e.createElement(
65
+ q,
66
+ {
67
+ svgIcon: L,
68
+ icon: "table-wizard",
69
+ type: "button",
70
+ title: m.toLanguageString(a, f[a])
71
+ },
72
+ m.toLanguageString(a, f[a])
73
+ )
74
+ }
75
+ ),
76
+ /* @__PURE__ */ e.createElement(
77
+ S,
78
+ {
79
+ outputs: u,
80
+ showOutputRating: !0,
81
+ onCopy: C,
82
+ onOutputRating: I,
83
+ outputCard: V || { body: B }
84
+ }
85
+ )
86
+ );
87
+ };
88
+ export {
89
+ j as GridAIPrompt
90
+ };
package/utils/premium.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 d=require("react"),a=require("@progress/kendo-react-data-tools"),c=require("../sortCommon.js"),m=require("../paging/GridPagerSettings.js");function b(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const l=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,l.get?l:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const o=b(d),y=e=>({lockedColumn:e.some(r=>r.locked)}),g=e=>({multiColumn:e.some(r=>r.children&&r.children.length>0)}),C=e=>({columnCellTemplate:e.some(r=>r.columnType!=="data"?!1:r.cells)}),p=e=>({columnMenu:e.some(r=>r.columnMenu)}),f=e=>o.Children.toArray(e.children).some(t=>t&&t.type&&t.type.displayName==="KendoReactGridColumn"?t.props.hidden:!1),h=e=>o.Children.toArray(e.children).some(t=>t&&t.type&&t.type.displayName==="KendoReactGridToolbar"&&t.props&&t.props.children?o.Children.toArray(t.props.children).some(n=>n.type&&(n.type.displayName==="KendoReactGridToolbarSort"||n.type.displayName==="KendoReactGridToolbarFilter"||n.type.displayName==="KendoReactGridToolbarCheckboxFilter"||n.type.displayName==="KendoReactGridToolbarColumnsChooser"||n.type.displayName==="KendoReactGridToolbarGroup")):!1),i=e=>{const r=a.getSelectionOptions(e.selectable),t=a.getEditableOptions(e.editable),l=e.sortable&&c.normalizeSortable(e.sortable),n=e.pageable&&m.normalize(e.pageable);return{cells:!!e.cells,pdf:!!e.pdf,detail:!!e.detail,rows:!!e.rows,editableInline:t.mode==="inline",selectionMultiple:r.enabled&&r.mode==="multiple",selectionDrag:r.enabled&&r.drag,columnMenu:!!e.columnMenu,filterOperators:!!e.filterOperators,groupable:!!e.groupable,group:!!e.group,groupExpand:!!e.groupExpand,customPager:!!e.pager,clipboard:!!e.clipboard,contextMenu:!!e.contextMenu,serverGrid:!e.isClient,scrollableVirtual:e.scrollable==="virtual",pageableInput:!!(e.pageable&&n.type==="input"),sortableMultiple:!!(e.sortable&&l.mode==="multiple"),hiddenColumns:f(e)}},s=e=>({...y(e),...g(e),...C(e),...p(e)}),u=e=>({toolbarTools:h(e)}),G=(e,r)=>{const t={...i(e),...s(r),...u(e)};return Object.keys(t).filter(l=>t[l]===!0)};exports.gridPremiumFeatures=G;exports.isPremiumGridByColumns=s;exports.isPremiumGridByComponents=u;exports.isPremiumGridByProps=i;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react"),a=require("@progress/kendo-react-data-tools"),c=require("../sortCommon.js"),m=require("../paging/GridPagerSettings.js");function b(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const l=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,l.get?l:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const o=b(d),y=e=>({lockedColumn:e.some(r=>r.locked)}),g=e=>({multiColumn:e.some(r=>r.children&&r.children.length>0)}),C=e=>({columnCellTemplate:e.some(r=>r.columnType!=="data"?!1:r.cells)}),h=e=>({columnMenu:e.some(r=>r.columnMenu)}),p=e=>o.Children.toArray(e.children).some(t=>t&&t.type&&t.type.displayName==="KendoReactGridColumn"?t.props.hidden:!1),f=e=>o.Children.toArray(e.children).some(t=>t&&t.type&&t.type.displayName==="KendoReactGridToolbar"&&t.props&&t.props.children?o.Children.toArray(t.props.children).some(n=>n.type&&(n.type.displayName==="KendoReactGridToolbarSort"||n.type.displayName==="KendoReactGridToolbarFilter"||n.type.displayName==="KendoReactGridToolbarCheckboxFilter"||n.type.displayName==="KendoReactGridToolbarColumnsChooser"||n.type.displayName==="KendoReactGridToolbarGroup")):!1),i=e=>{const r=a.getSelectionOptions(e.selectable),t=a.getEditableOptions(e.editable),l=e.sortable&&c.normalizeSortable(e.sortable),n=e.pageable&&m.normalize(e.pageable);return{cells:!!e.cells,pdf:!!e.pdf,detail:!!e.detail,rows:!!e.rows,highlight:!!e.highlight,editableInline:t.mode==="inline",selectionMultiple:r.enabled&&r.mode==="multiple",selectionDrag:r.enabled&&r.drag,columnMenu:!!e.columnMenu,filterOperators:!!e.filterOperators,groupable:!!e.groupable,group:!!e.group,groupExpand:!!e.groupExpand,customPager:!!e.pager,clipboard:!!e.clipboard,contextMenu:!!e.contextMenu,serverGrid:!e.isClient,scrollableVirtual:e.scrollable==="virtual",pageableInput:!!(e.pageable&&n.type==="input"),sortableMultiple:!!(e.sortable&&l.mode==="multiple"),hiddenColumns:p(e)}},s=e=>({...y(e),...g(e),...C(e),...h(e)}),u=e=>({toolbarTools:f(e)}),G=(e,r)=>{const t={...i(e),...s(r),...u(e)};return Object.keys(t).filter(l=>t[l]===!0)};exports.gridPremiumFeatures=G;exports.isPremiumGridByColumns=s;exports.isPremiumGridByComponents=u;exports.isPremiumGridByProps=i;
package/utils/premium.mjs CHANGED
@@ -17,13 +17,14 @@ const u = (e) => ({
17
17
  columnCellTemplate: e.some((r) => r.columnType !== "data" ? !1 : r.cells)
18
18
  }), b = (e) => ({
19
19
  columnMenu: e.some((r) => r.columnMenu)
20
- }), y = (e) => a.Children.toArray(e.children).some((t) => t && t.type && t.type.displayName === "KendoReactGridColumn" ? t.props.hidden : !1), C = (e) => a.Children.toArray(e.children).some((t) => t && t.type && t.type.displayName === "KendoReactGridToolbar" && t.props && t.props.children ? a.Children.toArray(t.props.children).some((l) => l.type && (l.type.displayName === "KendoReactGridToolbarSort" || l.type.displayName === "KendoReactGridToolbarFilter" || l.type.displayName === "KendoReactGridToolbarCheckboxFilter" || l.type.displayName === "KendoReactGridToolbarColumnsChooser" || l.type.displayName === "KendoReactGridToolbarGroup")) : !1), p = (e) => {
20
+ }), y = (e) => a.Children.toArray(e.children).some((t) => t && t.type && t.type.displayName === "KendoReactGridColumn" ? t.props.hidden : !1), h = (e) => a.Children.toArray(e.children).some((t) => t && t.type && t.type.displayName === "KendoReactGridToolbar" && t.props && t.props.children ? a.Children.toArray(t.props.children).some((l) => l.type && (l.type.displayName === "KendoReactGridToolbarSort" || l.type.displayName === "KendoReactGridToolbarFilter" || l.type.displayName === "KendoReactGridToolbarCheckboxFilter" || l.type.displayName === "KendoReactGridToolbarColumnsChooser" || l.type.displayName === "KendoReactGridToolbarGroup")) : !1), g = (e) => {
21
21
  const r = o(e.selectable), t = i(e.editable), n = e.sortable && s(e.sortable), l = e.pageable && d(e.pageable);
22
22
  return {
23
23
  cells: !!e.cells,
24
24
  pdf: !!e.pdf,
25
25
  detail: !!e.detail,
26
26
  rows: !!e.rows,
27
+ highlight: !!e.highlight,
27
28
  editableInline: t.mode === "inline",
28
29
  selectionMultiple: r.enabled && r.mode === "multiple",
29
30
  selectionDrag: r.enabled && r.drag,
@@ -41,24 +42,24 @@ const u = (e) => ({
41
42
  sortableMultiple: !!(e.sortable && n.mode === "multiple"),
42
43
  hiddenColumns: y(e)
43
44
  };
44
- }, g = (e) => ({
45
+ }, C = (e) => ({
45
46
  ...u(e),
46
47
  ...m(e),
47
48
  ...c(e),
48
49
  ...b(e)
49
- }), h = (e) => ({
50
- toolbarTools: C(e)
50
+ }), p = (e) => ({
51
+ toolbarTools: h(e)
51
52
  }), A = (e, r) => {
52
53
  const t = {
53
- ...p(e),
54
- ...g(r),
55
- ...h(e)
54
+ ...g(e),
55
+ ...C(r),
56
+ ...p(e)
56
57
  };
57
58
  return Object.keys(t).filter((n) => t[n] === !0);
58
59
  };
59
60
  export {
60
61
  A as gridPremiumFeatures,
61
- g as isPremiumGridByColumns,
62
- h as isPremiumGridByComponents,
63
- p as isPremiumGridByProps
62
+ C as isPremiumGridByColumns,
63
+ p as isPremiumGridByComponents,
64
+ g as isPremiumGridByProps
64
65
  };