@progress/kendo-react-grid 14.5.0-develop.1 → 14.5.0-develop.11
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/GridClientWrapper.js +1 -1
- package/GridClientWrapper.mjs +288 -283
- package/GridComponent.js +1 -1
- package/GridComponent.mjs +271 -260
- package/cells/groupcell/GridGroupCellToggle.js +1 -1
- package/cells/groupcell/GridGroupCellToggle.mjs +23 -23
- package/cells/pincell/GridPinDropdownButton.js +1 -1
- package/cells/pincell/GridPinDropdownButton.mjs +14 -14
- package/columnMenu/GridColumnMenuFilter.js +1 -1
- package/columnMenu/GridColumnMenuFilter.mjs +43 -38
- package/contextMenu/GridContextMenu.js +1 -1
- package/contextMenu/GridContextMenu.mjs +44 -44
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/filterCommon.js +1 -1
- package/filterCommon.mjs +40 -40
- package/hooks/useGridAIRequest.d.ts +76 -10
- package/hooks/useGridAIRequest.js +1 -1
- package/hooks/useGridAIRequest.mjs +126 -62
- package/index.d.mts +2 -2
- package/index.d.ts +2 -2
- package/index.js +1 -1
- package/index.mjs +45 -44
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +24 -20
- package/toolbar-tools/GridToolbarAIAssistant.d.ts +27 -5
- package/toolbar-tools/GridToolbarAIAssistant.js +2 -2
- package/toolbar-tools/GridToolbarAIAssistant.mjs +11 -10
- package/toolbar-tools/smartbox/SmartBox.js +1 -1
- package/toolbar-tools/smartbox/SmartBox.mjs +91 -90
- package/toolbar-tools/smartbox/hooks/useSmartBoxListData.js +1 -1
- package/toolbar-tools/smartbox/hooks/useSmartBoxListData.mjs +7 -7
- package/toolbar-tools/smartbox/interfaces/SmartBoxTypes.d.ts +12 -4
- package/toolbar-tools/smartbox/listItemRenders.js +1 -1
- package/toolbar-tools/smartbox/listItemRenders.mjs +1 -1
- package/utils/handleAIResponse.d.ts +2 -2
package/index.mjs
CHANGED
|
@@ -12,12 +12,12 @@ import { GridColumnMenuGroup as n } from "./columnMenu/GridColumnMenuGroup.mjs";
|
|
|
12
12
|
import { GridColumnMenuSort as x, isColumnMenuSortActive as d } from "./columnMenu/GridColumnMenuSort.mjs";
|
|
13
13
|
import { GridColumnMenuFilter as G, filterGroupByField as u, isColumnMenuFilterActive as C, rootFilterOrDefault as s } from "./columnMenu/GridColumnMenuFilter.mjs";
|
|
14
14
|
import { GridColumnMenuFilterUI as I } from "./columnMenu/GridColumnMenuFilterUI.mjs";
|
|
15
|
-
import { GridColumnMenuFilterCell as
|
|
15
|
+
import { GridColumnMenuFilterCell as M } from "./columnMenu/GridColumnMenuFilterCell.mjs";
|
|
16
16
|
import { GridColumnMenuCheckboxFilter as T } from "./columnMenu/GridColumnMenuCheckboxFilter.mjs";
|
|
17
17
|
import { GridColumnMenuColumnsList as E } from "./columnMenu/GridColumnMenuColumnsList.mjs";
|
|
18
|
-
import { GridColumnMenuColumnsChooser as
|
|
19
|
-
import { GridCell as
|
|
20
|
-
import { GridEditCell as
|
|
18
|
+
import { GridColumnMenuColumnsChooser as A } from "./columnMenu/GridColumnMenuColumnsChooser.mjs";
|
|
19
|
+
import { GridCell as P } from "./cells/datacell/GridCell.mjs";
|
|
20
|
+
import { GridEditCell as h } from "./cells/editcell/GridEditCell.mjs";
|
|
21
21
|
import { GridGroupCell as _ } from "./cells/groupcell/GridGroupCell.mjs";
|
|
22
22
|
import { GridHierarchyCell as L } from "./cells/hierarchycell/GridHierarchyCell.mjs";
|
|
23
23
|
import { GridFilterCell as v } from "./cells/GridFilterCell.mjs";
|
|
@@ -39,61 +39,61 @@ import { GridToolbarAIAssistant as fr } from "./toolbar-tools/GridToolbarAIAssis
|
|
|
39
39
|
import { GridAIPrompt as ur } from "./toolbar-tools/ai-tool/GridAIPrompt.mjs";
|
|
40
40
|
import { GridNoRecords as sr } from "./components/noRecords/GridNoRecords.mjs";
|
|
41
41
|
import { GridColumnMenuItem as Ir } from "./columnMenu/GridColumnMenuItem.mjs";
|
|
42
|
-
import { GridColumnMenuItemContent as
|
|
42
|
+
import { GridColumnMenuItemContent as Mr } from "./columnMenu/GridColumnMenuItemContent.mjs";
|
|
43
43
|
import { GridColumnMenuItemGroup as Tr } from "./columnMenu/GridColumnMenuItemGroup.mjs";
|
|
44
|
-
import { GRID_COL_INDEX_ATTRIBUTE as Er, GRID_PREVENT_SELECTION_ELEMENT as br, GRID_ROW_INDEX_ATTRIBUTE as
|
|
45
|
-
import { getSelectedState as
|
|
44
|
+
import { GRID_COL_INDEX_ATTRIBUTE as Er, GRID_PREVENT_SELECTION_ELEMENT as br, GRID_ROW_INDEX_ATTRIBUTE as Ar } from "./constants/index.mjs";
|
|
45
|
+
import { getSelectedState as Pr, getSelectedStateFromKeyDown as Rr, setSelectedState as hr } from "@progress/kendo-react-data-tools";
|
|
46
46
|
import { CommonDragLogic as _r } from "./drag/CommonDragLogic.mjs";
|
|
47
47
|
import { booleanFilterValues as Lr, cellBoolDropdownChange as Or, cellInputChange as vr, cellOperatorChange as wr, combineSmartFilters as yr, operators as Hr, parseFilterDates as Ur } from "./filterCommon.mjs";
|
|
48
48
|
import { handleAIResponse as Vr } from "./utils/handleAIResponse.mjs";
|
|
49
|
-
import {
|
|
50
|
-
import { GridAICommands as
|
|
51
|
-
import { messages as
|
|
52
|
-
import { StatusBar as
|
|
53
|
-
import { GridContextMenu as
|
|
54
|
-
import { GridContextMenuAnchorPart as
|
|
55
|
-
import { GridSearchBox as
|
|
56
|
-
import { GridPdfExportButton as
|
|
57
|
-
import { GridCsvExportButton as
|
|
49
|
+
import { createAxiosAIClient as Xr, useGridAIRequest as qr } from "./hooks/useGridAIRequest.mjs";
|
|
50
|
+
import { GridAICommands as jr } from "./interfaces/GridAICommands.mjs";
|
|
51
|
+
import { messages as Jr, pagerFirstPage as Qr, pagerInfo as Yr, pagerItemPerPage as Zr, pagerLastPage as $r, pagerNextPage as ro, pagerPreviousPage as oo } from "./messages/index.mjs";
|
|
52
|
+
import { StatusBar as to, getStatusData as mo, leafColumns as lo } from "./StatusBar.mjs";
|
|
53
|
+
import { GridContextMenu as po, contextMenuItemsMap as no } from "./contextMenu/GridContextMenu.mjs";
|
|
54
|
+
import { GridContextMenuAnchorPart as xo, GridContextMenuItemNames as fo } from "./contextMenu/enums.mjs";
|
|
55
|
+
import { GridSearchBox as uo } from "./GridSearchBox.mjs";
|
|
56
|
+
import { GridPdfExportButton as so } from "./GridPdfExportButton.mjs";
|
|
57
|
+
import { GridCsvExportButton as Io } from "./GridCsvExportButton.mjs";
|
|
58
58
|
import { SmartBox as Mo } from "./toolbar-tools/smartbox/SmartBox.mjs";
|
|
59
59
|
export {
|
|
60
60
|
Er as GRID_COL_INDEX_ATTRIBUTE,
|
|
61
61
|
br as GRID_PREVENT_SELECTION_ELEMENT,
|
|
62
|
-
|
|
62
|
+
Ar as GRID_ROW_INDEX_ATTRIBUTE,
|
|
63
63
|
e as Grid,
|
|
64
|
-
|
|
64
|
+
jr as GridAICommands,
|
|
65
65
|
ur as GridAIPrompt,
|
|
66
|
-
|
|
66
|
+
P as GridCell,
|
|
67
67
|
m as GridColumn,
|
|
68
68
|
T as GridColumnMenuCheckboxFilter,
|
|
69
|
-
|
|
69
|
+
A as GridColumnMenuColumnsChooser,
|
|
70
70
|
E as GridColumnMenuColumnsList,
|
|
71
71
|
G as GridColumnMenuFilter,
|
|
72
|
-
|
|
72
|
+
M as GridColumnMenuFilterCell,
|
|
73
73
|
I as GridColumnMenuFilterUI,
|
|
74
74
|
n as GridColumnMenuGroup,
|
|
75
75
|
Ir as GridColumnMenuItem,
|
|
76
|
-
|
|
76
|
+
Mr as GridColumnMenuItemContent,
|
|
77
77
|
Tr as GridColumnMenuItemGroup,
|
|
78
78
|
x as GridColumnMenuSort,
|
|
79
79
|
i as GridColumnMenuWrapper,
|
|
80
80
|
_r as GridCommonDragLogic,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
po as GridContextMenu,
|
|
82
|
+
xo as GridContextMenuAnchorPart,
|
|
83
|
+
fo as GridContextMenuItemNames,
|
|
84
|
+
Io as GridCsvExportButton,
|
|
85
85
|
K as GridDetailRow,
|
|
86
|
-
|
|
86
|
+
h as GridEditCell,
|
|
87
87
|
v as GridFilterCell,
|
|
88
88
|
_ as GridGroupCell,
|
|
89
89
|
y as GridHeaderCell,
|
|
90
90
|
X as GridHeaderPinCell,
|
|
91
91
|
L as GridHierarchyCell,
|
|
92
92
|
sr as GridNoRecords,
|
|
93
|
-
|
|
93
|
+
so as GridPdfExportButton,
|
|
94
94
|
V as GridPinCell,
|
|
95
95
|
z as GridRow,
|
|
96
|
-
|
|
96
|
+
uo as GridSearchBox,
|
|
97
97
|
U as GridSelectionCell,
|
|
98
98
|
Q as GridToolbar,
|
|
99
99
|
fr as GridToolbarAIAssistant,
|
|
@@ -105,31 +105,32 @@ export {
|
|
|
105
105
|
nr as GridToolbarSort,
|
|
106
106
|
Z as GridToolbarSpacer,
|
|
107
107
|
Mo as SmartBox,
|
|
108
|
-
|
|
108
|
+
to as StatusBar,
|
|
109
109
|
Lr as booleanFilterValues,
|
|
110
110
|
Or as cellBoolDropdownChange,
|
|
111
111
|
vr as cellInputChange,
|
|
112
112
|
wr as cellOperatorChange,
|
|
113
113
|
yr as combineSmartFilters,
|
|
114
|
-
|
|
114
|
+
no as contextMenuItemsMap,
|
|
115
|
+
Xr as createAxiosAIClient,
|
|
115
116
|
u as filterGroupByField,
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
117
|
+
Pr as getSelectedState,
|
|
118
|
+
Rr as getSelectedStateFromKeyDown,
|
|
119
|
+
mo as getStatusData,
|
|
120
|
+
Jr as gridMessages,
|
|
120
121
|
Vr as handleAIResponse,
|
|
121
122
|
C as isColumnMenuFilterActive,
|
|
122
123
|
d as isColumnMenuSortActive,
|
|
123
|
-
|
|
124
|
+
lo as leafColumns,
|
|
124
125
|
Hr as operators,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
126
|
+
Qr as pagerFirstPage,
|
|
127
|
+
Yr as pagerInfo,
|
|
128
|
+
Zr as pagerItemPerPage,
|
|
129
|
+
$r as pagerLastPage,
|
|
130
|
+
ro as pagerNextPage,
|
|
131
|
+
oo as pagerPreviousPage,
|
|
131
132
|
Ur as parseFilterDates,
|
|
132
133
|
s as rootFilterOrDefault,
|
|
133
|
-
|
|
134
|
-
|
|
134
|
+
hr as setSelectedState,
|
|
135
|
+
qr as useGridAIRequest
|
|
135
136
|
};
|
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=Object.freeze({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: 1778667275,version:"14.5.0-develop.11",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"});exports.packageMetadata=e;
|
package/package-metadata.mjs
CHANGED
|
@@ -7,7 +7,7 @@ export const packageMetadata = Object.freeze({
|
|
|
7
7
|
productName: 'KendoReact',
|
|
8
8
|
productCode: 'KENDOUIREACT',
|
|
9
9
|
productCodes: ['KENDOUIREACT'],
|
|
10
|
-
publishDate:
|
|
11
|
-
version: '14.5.0-develop.
|
|
10
|
+
publishDate: 1778667275,
|
|
11
|
+
version: '14.5.0-develop.11',
|
|
12
12
|
licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/components/my-license/'
|
|
13
13
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-grid",
|
|
3
|
-
"version": "14.5.0-develop.
|
|
3
|
+
"version": "14.5.0-develop.11",
|
|
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",
|
|
@@ -30,25 +30,24 @@
|
|
|
30
30
|
"@progress/kendo-drawing": "^1.21.2",
|
|
31
31
|
"@progress/kendo-file-saver": "^1.1.1",
|
|
32
32
|
"@progress/kendo-licensing": "^1.7.2",
|
|
33
|
-
"@progress/kendo-react-animation": "14.5.0-develop.
|
|
34
|
-
"@progress/kendo-react-buttons": "14.5.0-develop.
|
|
35
|
-
"@progress/kendo-react-common": "14.5.0-develop.
|
|
36
|
-
"@progress/kendo-react-data-tools": "14.5.0-develop.
|
|
37
|
-
"@progress/kendo-react-dateinputs": "14.5.0-develop.
|
|
38
|
-
"@progress/kendo-react-indicators": "14.5.0-develop.
|
|
39
|
-
"@progress/kendo-react-form": "14.5.0-develop.
|
|
40
|
-
"@progress/kendo-react-labels": "14.5.0-develop.
|
|
41
|
-
"@progress/kendo-react-dialogs": "14.5.0-develop.
|
|
42
|
-
"@progress/kendo-react-dropdowns": "14.5.0-develop.
|
|
43
|
-
"@progress/kendo-react-inputs": "14.5.0-develop.
|
|
44
|
-
"@progress/kendo-react-intl": "14.5.0-develop.
|
|
45
|
-
"@progress/kendo-react-popup": "14.5.0-develop.
|
|
46
|
-
"@progress/kendo-react-layout": "14.5.0-develop.
|
|
47
|
-
"@progress/kendo-react-conversational-ui": "14.5.0-develop.
|
|
48
|
-
"@progress/kendo-svg-icons": "^4.0.0",
|
|
33
|
+
"@progress/kendo-react-animation": "14.5.0-develop.11",
|
|
34
|
+
"@progress/kendo-react-buttons": "14.5.0-develop.11",
|
|
35
|
+
"@progress/kendo-react-common": "14.5.0-develop.11",
|
|
36
|
+
"@progress/kendo-react-data-tools": "14.5.0-develop.11",
|
|
37
|
+
"@progress/kendo-react-dateinputs": "14.5.0-develop.11",
|
|
38
|
+
"@progress/kendo-react-indicators": "14.5.0-develop.11",
|
|
39
|
+
"@progress/kendo-react-form": "14.5.0-develop.11",
|
|
40
|
+
"@progress/kendo-react-labels": "14.5.0-develop.11",
|
|
41
|
+
"@progress/kendo-react-dialogs": "14.5.0-develop.11",
|
|
42
|
+
"@progress/kendo-react-dropdowns": "14.5.0-develop.11",
|
|
43
|
+
"@progress/kendo-react-inputs": "14.5.0-develop.11",
|
|
44
|
+
"@progress/kendo-react-intl": "14.5.0-develop.11",
|
|
45
|
+
"@progress/kendo-react-popup": "14.5.0-develop.11",
|
|
46
|
+
"@progress/kendo-react-layout": "14.5.0-develop.11",
|
|
47
|
+
"@progress/kendo-react-conversational-ui": "14.5.0-develop.11",
|
|
48
|
+
"@progress/kendo-svg-icons": "^4.9.0 || ^5.0.0",
|
|
49
49
|
"react": "^18.0.0 || ^19.0.0",
|
|
50
|
-
"react-dom": "^18.0.0 || ^19.0.0"
|
|
51
|
-
"axios": "^1.15.0"
|
|
50
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
52
51
|
},
|
|
53
52
|
"dependencies": {
|
|
54
53
|
"prop-types": "^15.6.0"
|
|
@@ -149,7 +148,7 @@
|
|
|
149
148
|
"package": {
|
|
150
149
|
"productName": "KendoReact",
|
|
151
150
|
"productCode": "KENDOUIREACT",
|
|
152
|
-
"publishDate":
|
|
151
|
+
"publishDate": 1778667275,
|
|
153
152
|
"licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
154
153
|
}
|
|
155
154
|
},
|
|
@@ -159,5 +158,10 @@
|
|
|
159
158
|
"repository": {
|
|
160
159
|
"type": "git",
|
|
161
160
|
"url": "git+https://github.com/telerik/kendo-react.git"
|
|
161
|
+
},
|
|
162
|
+
"peerDependenciesMeta": {
|
|
163
|
+
"@progress/kendo-svg-icons": {
|
|
164
|
+
"optional": true
|
|
165
|
+
}
|
|
162
166
|
}
|
|
163
167
|
}
|
|
@@ -7,11 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { SpeechToTextButtonProps } from '@progress/kendo-react-buttons';
|
|
9
9
|
import { SVGIcon } from '@progress/kendo-svg-icons';
|
|
10
|
-
import {
|
|
10
|
+
import { GridAIRequestConfig, GridAIResponse, GridAIHttpClient, GridAIRequestData } from '../hooks/useGridAIRequest.js';
|
|
11
11
|
import { CustomComponent } from '@progress/kendo-react-common';
|
|
12
12
|
import { AIPromptOutputInterface } from '@progress/kendo-react-conversational-ui';
|
|
13
13
|
import { GridAIPromptProps } from './ai-tool/GridAIPrompt.js';
|
|
14
|
-
import { GridAIRequestData } from '../hooks/useGridAIRequest.js';
|
|
15
14
|
import * as React from 'react';
|
|
16
15
|
/**
|
|
17
16
|
* Represents the handle interface for the GridToolbarAIAssistant component.
|
|
@@ -118,14 +117,19 @@ export interface GridToolbarAIAssistantProps {
|
|
|
118
117
|
*/
|
|
119
118
|
outputs?: AIPromptOutputInterface[];
|
|
120
119
|
/**
|
|
121
|
-
* Defines the options for the
|
|
120
|
+
* Defines the options for the HTTP request.
|
|
121
|
+
* Accepts both the new `GridAIRequestConfig` and the legacy `AxiosRequestConfig`.
|
|
122
|
+
*
|
|
123
|
+
* @remarks
|
|
124
|
+
* `GridAIRequestConfig` is the recommended type — it has no external dependency.
|
|
125
|
+
* `AxiosRequestConfig` continues to work for backward compatibility.
|
|
122
126
|
*
|
|
123
127
|
* @example
|
|
124
128
|
* ```jsx
|
|
125
129
|
* <GridToolbarAIAssistant requestOptions={{ timeout: 5000 }} />
|
|
126
130
|
* ```
|
|
127
131
|
*/
|
|
128
|
-
requestOptions?:
|
|
132
|
+
requestOptions?: GridAIRequestConfig;
|
|
129
133
|
/**
|
|
130
134
|
* Called before the request is sent.
|
|
131
135
|
*
|
|
@@ -138,12 +142,17 @@ export interface GridToolbarAIAssistantProps {
|
|
|
138
142
|
/**
|
|
139
143
|
* Called when the response is received.
|
|
140
144
|
*
|
|
145
|
+
* @remarks
|
|
146
|
+
* The response object provides `data`, `status`, and `statusText` —
|
|
147
|
+
* the same properties available on both `GridAIResponse` and `AxiosResponse`.
|
|
148
|
+
* Use `GridAIResponse` as the recommended type annotation.
|
|
149
|
+
*
|
|
141
150
|
* @example
|
|
142
151
|
* ```jsx
|
|
143
152
|
* <GridToolbarAIAssistant onResponseSuccess={(response) => console.log(response)} />
|
|
144
153
|
* ```
|
|
145
154
|
*/
|
|
146
|
-
onResponseSuccess?: (response:
|
|
155
|
+
onResponseSuccess?: (response: GridAIResponse<any>, promptMessage?: string, isRetry?: boolean) => void;
|
|
147
156
|
/**
|
|
148
157
|
* Called when the response returns an error.
|
|
149
158
|
*
|
|
@@ -212,6 +221,19 @@ export interface GridToolbarAIAssistantProps {
|
|
|
212
221
|
* ```
|
|
213
222
|
*/
|
|
214
223
|
onCloseWindow?: () => void;
|
|
224
|
+
/**
|
|
225
|
+
* Optional custom HTTP client for the AI assistant.
|
|
226
|
+
* When not provided, the component uses the built-in fetch-based transport.
|
|
227
|
+
*
|
|
228
|
+
* @example
|
|
229
|
+
* ```tsx
|
|
230
|
+
* import axios from 'axios';
|
|
231
|
+
* import { createAxiosAIClient } from '@progress/kendo-react-grid';
|
|
232
|
+
*
|
|
233
|
+
* <GridToolbarAIAssistant httpClient={createAxiosAIClient(axios)} />
|
|
234
|
+
* ```
|
|
235
|
+
*/
|
|
236
|
+
httpClient?: GridAIHttpClient;
|
|
215
237
|
}
|
|
216
238
|
declare const GridToolbarAIAssistant: React.ForwardRefExoticComponent<GridToolbarAIAssistantProps & React.RefAttributes<GridToolbarAIAssistantHandle>>;
|
|
217
239
|
export { GridToolbarAIAssistant };
|
|
@@ -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 ae=require("react"),le=require("../utils/GridContext.js"),ue=require("@progress/kendo-react-buttons"),ce=require("@progress/kendo-svg-icons"),de=require("@progress/kendo-react-intl"),
|
|
9
|
-
`);I(A=>[{id:A.length+1,title:i.toLanguageString(
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ae=require("react"),le=require("../utils/GridContext.js"),ue=require("@progress/kendo-react-buttons"),ce=require("@progress/kendo-svg-icons"),de=require("@progress/kendo-react-intl"),r=require("../messages/index.js"),y=require("@progress/kendo-react-common"),ge=require("@progress/kendo-react-dialogs"),pe=require("./ai-tool/GridAIPrompt.js"),me=require("../hooks/useGridAIRequest.js");function fe(n){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const e in n)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(a,e,i.get?i:{enumerable:!0,get:()=>n[e]})}}return a.default=n,Object.freeze(a)}const o=fe(ae),P=768,he=(n,a)=>n.map(i=>{let c=i;return a.forEach(l=>{l.field&&c.includes(l.field)&&(c=c.replace(new RegExp(l.field,"g"),l.title||l.field))}),c}),Ce=()=>null,q=o.forwardRef((n,a)=>{const e=o.useContext(le.GridContext),i=de.useLocalization(),{requestUrl:c,requestOptions:l,onPromptRequest:v,onResponseSuccess:x,onResponseError:T,role:E="user",gridAIPrompt:W=pe.GridAIPrompt,icon:k,svgIcon:O,onCloseWindow:m,promptPlaceHolder:L,suggestionsList:M,streaming:B,loading:D,outputs:G,enableSpeechToText:S}=n,[j,I]=o.useState([]),z=o.useMemo(()=>e&&Array.isArray(e.columnsRef)&&Array.isArray(e.hiddenColumnsRef)?[...e.columnsRef,...e.hiddenColumnsRef].map(t=>{var s;return{id:t.id,field:t.field,values:(s=t.values)!=null?s:[]}}):[],[e]),N=o.useMemo(()=>({sort:e.sort,filter:e.filter,group:e.group,highlight:e.highlight,select:e.select,columnsState:e.columnsState,skip:e.skip,take:e.take}),[e]),H=o.useMemo(()=>({getTotal:()=>e.getTotal(),getLeafDataItems:()=>e.getLeafDataItems(),exportAsPdf:()=>e.exportAsPdf(),props:{dataItemKey:e.dataItemKey}}),[e]),[f,h]=o.useState(!1),[K,_]=o.useState(),[F,w]=o.useState(),[b,U]=o.useState(()=>{const t=window.innerWidth;return t<P?t*.8:560}),d=o.useRef(null),X=o.useCallback(t=>{var s,u;t.sort!==void 0&&t.sort!==e.sort&&e.sortChange(t.sort,{}),t.filter!==e.filter&&e.filterChange(t.filter,{}),t.group!==void 0&&t.group!==e.group&&e.groupChange(t.group,{}),t.highlight!==void 0&&t.highlight!==e.highlight&&e.applyHighlightDescriptor(t.highlight),t.select!==void 0&&t.select!==e.select&&e.applySelectionDescriptor(t.select),t.columnsState!==void 0&&t.columnsState!==e.columnsState&&e.onColumnsStateChange(t.columnsState),(t.skip!==void 0&&t.skip!==e.skip||t.take!==void 0&&t.take!==e.take)&&e.pagerPageChange({skip:(s=t.skip)!=null?s:0,take:(u=t.take)!=null?u:0,syntheticEvent:{}})},[e]),Y=o.useCallback((t,s,u)=>{const C=[i.toLanguageString(r.aIResponseData,r.messages[r.aIResponseData])];t.forEach(re=>{const ie=he([re],e.columnsRef).join(`
|
|
9
|
+
`);I(A=>[{id:A.length+1,title:i.toLanguageString(r.generatedWithAI,r.messages[r.generatedWithAI]),subTitle:s,prompt:s,responseContent:C.concat(ie).join(""),isRetry:u},...A])})},[i,e.columnsRef]),$=o.useCallback(()=>{e.exportAsPdf()},[e]),{loading:J,streaming:Q,sendRequest:V,cancelRequest:Z}=me.useGridAIRequest({requestUrl:c,requestOptions:l,httpClient:n.httpClient,role:E,columns:z,gridState:N,gridRef:H,onPromptRequest:v,onResponseSuccess:x,onResponseError:T,onStateChange:X,onMessages:Y,onExportPdf:$}),ee=t=>{t.preventDefault(),h(!f)},g=o.useMemo(()=>{var t;return(t=n.show)!=null?t:f},[n.show,f]),p=o.useCallback(()=>{var t;m&&m(),I([]),h(!1),d.current&&((t=d.current.element)==null||t.focus())},[m]),[te,R]=y.useCustomComponent(W),oe=Object.keys(R).length>0?R:{},se=o.createElement(te,{onPromptRequest:V,onCancel:Z,onClose:p,streaming:B||Q,loading:D||J,outputs:G||j,promptPlaceHolder:L,suggestionsList:M,enableSpeechToText:S,...oe}),ne=o.createElement(ue.Button,{ref:d,togglable:!0,themeColor:"primary",rounded:"full",selected:g,svgIcon:O||(k?void 0:ce.sparklesIcon),icon:k,size:e.mobileMode?"large":"medium",className:y.classNames("k-toolbar-button",{"k-icon-button":e.mobileMode}),title:i.toLanguageString(r.toolbarAI,r.messages[r.toolbarAI]),onClick:ee});return o.useEffect(()=>{var t;if(d.current&&g){const s=(t=d.current.element)==null?void 0:t.getBoundingClientRect();if(s){_(s.top+window.scrollY+s.height),w(s.left+window.scrollX+s.width);const u=window.innerWidth,C=u<P?u*.75:560;U(C)}}},[g]),o.useImperativeHandle(a,()=>({show:()=>h(!0),hide:()=>p()}),[p]),o.createElement(o.Fragment,null,ne,g&&o.createElement(ge.Window,{key:b,autoFocus:!1,title:i.toLanguageString(r.toolbarAI,r.messages[r.toolbarAI]),initialTop:K,initialLeft:F,initialWidth:b,style:{height:"auto",minWidth:"90px",minHeight:"50px"},onClose:p,resizable:!0,draggable:!0,className:"k-grid-assistant-window",maximizeButton:Ce},se))});q.displayName="KendoReactGridToolbarAIAssistant";exports.GridToolbarAIAssistant=q;
|
|
@@ -15,15 +15,15 @@ import { useCustomComponent as mt, classNames as gt } from "@progress/kendo-reac
|
|
|
15
15
|
import { Window as pt } from "@progress/kendo-react-dialogs";
|
|
16
16
|
import { GridAIPrompt as ft } from "./ai-tool/GridAIPrompt.mjs";
|
|
17
17
|
import { useGridAIRequest as ht } from "../hooks/useGridAIRequest.mjs";
|
|
18
|
-
const E = 768, Ct = (
|
|
19
|
-
let
|
|
18
|
+
const E = 768, Ct = (l, p) => l.map((i) => {
|
|
19
|
+
let a = i;
|
|
20
20
|
return p.forEach((n) => {
|
|
21
|
-
n.field &&
|
|
22
|
-
}),
|
|
21
|
+
n.field && a.includes(n.field) && (a = a.replace(new RegExp(n.field, "g"), n.title || n.field));
|
|
22
|
+
}), a;
|
|
23
23
|
}), kt = () => null, It = o.forwardRef(
|
|
24
|
-
(
|
|
24
|
+
(l, p) => {
|
|
25
25
|
const t = o.useContext(at), i = dt(), {
|
|
26
|
-
requestUrl:
|
|
26
|
+
requestUrl: a,
|
|
27
27
|
requestOptions: n,
|
|
28
28
|
onPromptRequest: v,
|
|
29
29
|
onResponseSuccess: T,
|
|
@@ -39,7 +39,7 @@ const E = 768, Ct = (a, p) => a.map((i) => {
|
|
|
39
39
|
loading: D,
|
|
40
40
|
outputs: G,
|
|
41
41
|
enableSpeechToText: N
|
|
42
|
-
} =
|
|
42
|
+
} = l, [S, R] = o.useState([]), H = o.useMemo(() => t && Array.isArray(t.columnsRef) && Array.isArray(t.hiddenColumnsRef) ? [...t.columnsRef, ...t.hiddenColumnsRef].map((e) => {
|
|
43
43
|
var s;
|
|
44
44
|
return {
|
|
45
45
|
id: e.id,
|
|
@@ -109,8 +109,9 @@ const E = 768, Ct = (a, p) => a.map((i) => {
|
|
|
109
109
|
sendRequest: Z,
|
|
110
110
|
cancelRequest: tt
|
|
111
111
|
} = ht({
|
|
112
|
-
requestUrl:
|
|
112
|
+
requestUrl: a,
|
|
113
113
|
requestOptions: n,
|
|
114
|
+
httpClient: l.httpClient,
|
|
114
115
|
role: L,
|
|
115
116
|
columns: H,
|
|
116
117
|
gridState: K,
|
|
@@ -125,8 +126,8 @@ const E = 768, Ct = (a, p) => a.map((i) => {
|
|
|
125
126
|
e.preventDefault(), C(!h);
|
|
126
127
|
}, c = o.useMemo(() => {
|
|
127
128
|
var e;
|
|
128
|
-
return (e =
|
|
129
|
-
}, [
|
|
129
|
+
return (e = l.show) != null ? e : h;
|
|
130
|
+
}, [l.show, h]), d = o.useCallback(() => {
|
|
130
131
|
var e;
|
|
131
132
|
f && f(), R([]), C(!1), u.current && ((e = u.current.element) == null || e.focus());
|
|
132
133
|
}, [f]), [ot, b] = mt(
|
|
@@ -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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ae=require("react"),_=require("@progress/kendo-react-buttons"),M=require("@progress/kendo-svg-icons"),d=require("@progress/kendo-react-common"),et=require("@progress/kendo-react-intl"),J=require("@progress/kendo-react-dropdowns"),tt=require("@progress/kendo-react-popup"),R=require("./listItemRenders.js"),o=require("../../messages/index.js"),nt=require("../../hooks/useGridAIRequest.js"),st=require("../../utils/GridContext.js"),rt=require("./hooks/useSmartBoxModes.js"),at=require("./hooks/useSmartBoxHistory.js"),ot=require("./hooks/useSmartBoxPopup.js"),ct=require("./hooks/useSmartBoxGridState.js"),it=require("./hooks/useSmartBoxLabels.js"),lt=require("./hooks/useSmartBoxListData.js"),ut=require("./hooks/useSmartBoxSegmentedControl.js"),pt=require("./hooks/useSmartBoxSearch.js"),dt=require("./hooks/useDebounce.js");function mt(m){const x=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(m){for(const f in m)if(f!=="default"){const I=Object.getOwnPropertyDescriptor(m,f);Object.defineProperty(x,f,I.get?I:{enumerable:!0,get:()=>m[f]})}}return x.default=m,Object.freeze(x)}const e=mt(Ae),ge=e.forwardRef((m,x)=>{var de;const{searchConfig:f,semanticSearchConfig:I,aiAssistantConfig:he,activeMode:fe,dir:Se="ltr",size:Q="medium",placeholder:ke,history:xe,loading:Ce=!1,promptSuggestionRender:X,historyItemRender:Y,onOpen:be,onClose:Be,onFocus:v,onBlur:q,onSearch:Re,onSemanticSearch:Ie,onAIPromptRequest:N,onAIResponseSuccess:F,onAIResponseError:z,onAICancelRequest:w}=m,C=et.useLocalization(),b=e.useContext(st.GridContext),ve=e.useRef(`k-${d.guid()}`),S=e.useRef(null),B=e.useRef(null),Z=e.useRef(null),[c,g]=e.useState(""),[qe,D]=e.useState(!1),[we,A]=e.useState(void 0),[De,ee]=e.useState(null),{searchMode:i,semanticSearchMode:u,aiAssistantMode:r,selectedView:n,setSelectedViewState:O,lastSearchMode:Pe,searchHistorySettings:te,semanticSearchHistorySettings:ne,aiAssistantHistorySettings:G,speechToTextButtonSettings:se,currentSearchDelay:ye}=rt.useSmartBoxModes({searchConfigProp:f,semanticSearchConfigProp:I,aiAssistantConfigProp:he,activeModeProp:fe,sharedHistory:xe}),{currentHistory:P,currentHistorySettings:Ee,addToHistory:V}=at.useSmartBoxHistory({selectedView:n,searchHistorySettings:te,semanticSearchHistorySettings:ne,aiAssistantHistorySettings:G}),{isOpen:W,togglePopup:a}=ot.useSmartBoxPopup({onOpen:be,onClose:Be}),{columns:re,gridState:Le,gridRef:Te,handleStateChange:He}=ct.useSmartBoxGridState(b),j=e.useMemo(()=>(r==null?void 0:r.promptSuggestions)||[],[r==null?void 0:r.promptSuggestions]),{inputPlaceholder:Ne,prefixIcon:Fe}=it.useSmartBoxLabels({selectedView:n,searchMode:i,semanticSearchMode:u,aiAssistantMode:r,sharedPlaceholder:ke}),{searchListData:k,aiAssistantListData:y,searchHistoryListData:E}=lt.useSmartBoxListData({selectedView:n,searchModeEnabled:i==null?void 0:i.enabled,semanticSearchModeEnabled:u==null?void 0:u.enabled,promptSuggestions:j,currentHistory:P,currentHistorySettings:Ee}),L=ut.useSmartBoxSegmentedControl({searchMode:i,semanticSearchMode:u,aiAssistantMode:r,selectedView:n,lastSearchMode:Pe,setSelectedViewState:O,setInputValue:g});e.useEffect(()=>{const t=S.current;if(!t)return;A(t.offsetWidth);const s=new ResizeObserver(()=>{t&&A(t.offsetWidth)});return s.observe(t),()=>{s.disconnect()}},[]);const h=Ce||qe,U=!n,ze=!(i!=null&&i.enabled)&&!(u!=null&&u.enabled)&&!(r!=null&&r.enabled),Oe=d.kendoThemeMaps.sizeMap[Q]||"md",{emitSearchEvent:p}=pt.useSmartBoxSearch({selectedView:n,searchMode:i,columns:re,gridContext:b,searchHistorySettings:te,semanticSearchHistorySettings:ne,addToHistory:V,onSearch:Re,onSemanticSearch:Ie}),{sendRequest:ae,cancelRequest:oe}=nt.useGridAIRequest({requestUrl:r==null?void 0:r.requestUrl,requestOptions:r==null?void 0:r.requestOptions,httpClient:r==null?void 0:r.httpClient,columns:re,gridState:Le,gridRef:Te,onPromptRequest:t=>{N==null||N({requestData:t})},onResponseSuccess:t=>{D(!1),F==null||F({response:t})},onResponseError:t=>{D(!1),z==null||z({error:t})},onStateChange:He,onExportPdf:()=>b==null?void 0:b.exportAsPdf()});e.useImperativeHandle(x,()=>({show:()=>a(!0),hide:()=>a(!1)}),[a]);const $=dt.useDebounce(De,ye),ce=e.useRef(p);ce.current=p,e.useEffect(()=>{$!==null&&ce.current($)},[$]);const Ge=e.useCallback(t=>{const s=t.target.value;g(s),a(!s),(n==="search"||n==="semanticSearch")&&ee(s)},[a,n]),Ve=e.useCallback(()=>{v==null||v(),c||a(!0)},[v,a,c]),We=e.useCallback(t=>{var me;const s=S.current,l=(me=Z.current)==null?void 0:me.element,H=t.relatedTarget,Ye=H&&(s==null?void 0:s.contains(H)),Ze=H&&(l==null?void 0:l.contains(H));!Ye&&!Ze&&(q==null||q(),a(!1))},[q,a]),je=e.useCallback(()=>{c||a(!0)},[a,c]),ie=!!((de=r==null?void 0:r.requestOptions)!=null&&de.url||r!=null&&r.requestUrl),K=e.useCallback(()=>{if(h){w==null||w(),oe(),D(!1);return}c.trim()&&(ie&&D(!0),V("aiAssistant",c,G),a(!1),ae(c.trim()),g(""))},[h,c,G,a,V,ae,oe,ie,w]),Ue=e.useCallback(t=>{t.key==="Enter"&&(n==="aiAssistant"?K():n==="semanticSearch"&&p(c))},[n,c,p,K]),$e=e.useCallback(()=>{var t;a(!W),(t=B.current)==null||t.focus()},[W,a]),Ke=e.useCallback(t=>{var s;t.stopPropagation(),t.preventDefault(),g(""),(s=B.current)==null||s.focus(),a(!0),p("")},[a,p]),le=e.useCallback(t=>{var s;O(t),g(""),ee(null),(s=B.current)==null||s.focus()},[O]),T=e.useCallback(t=>{var s;g(t),a(!1),(s=B.current)==null||s.focus(),n!=="aiAssistant"&&p(t)},[n,a,p]),_e=e.useCallback(t=>{if(t.isFinal&&t.alternatives.length>0){const s=t.alternatives[0].transcript;g(l=>l?`${l} ${s}`:s)}},[]),Me=e.useMemo(()=>n==="aiAssistant"?P.length===0&&j.length===0:n==="search"||n==="semanticSearch"?P.length===0&&k.length===0:!1,[n,P.length,j.length,k.length]),ue=e.useCallback(t=>{const l=(n==="aiAssistant"?y:E)[t];l&&T(l.text)},[n,y,E,T]),Je=e.useCallback(t=>{const s=k[t];s&&le(s.mode)},[k,le]),pe=e.useMemo(()=>R.createListItemRender({historyItemRender:Y,promptSuggestionRender:X,handleListItemClick:T}),[Y,X,T]),Qe=W&&!ze,Xe=()=>e.createElement(e.Fragment,null,L.items.length>0&&e.createElement(_.SegmentedControl,{items:L.items,value:L.value,onChange:L.onChange,size:Q,layoutMode:"stretch"}),(n==="search"||n==="semanticSearch")&&k.length>0&&e.createElement(J.List,{data:k,textField:"text",descriptionField:"description",onClick:Je,itemRender:R.searchModeItemRender,show:!0,wrapperCssClass:"k-list k-list-md"}),n==="aiAssistant"&&y.length>0&&e.createElement(J.List,{data:y,textField:"text",groupField:"group",svgIconField:"groupSvgIcon",descriptionField:"description",onClick:ue,itemRender:pe,groupHeaderItemRender:R.listGroupHeaderRender,showFirstGroupHeader:!0,show:!0,wrapperCssClass:"k-list k-list-md"}),(n==="search"||n==="semanticSearch")&&E.length>0&&e.createElement(J.List,{data:E,textField:"text",groupField:"group",svgIconField:"groupSvgIcon",descriptionField:"description",onClick:ue,itemRender:pe,groupHeaderItemRender:R.listGroupHeaderRender,showFirstGroupHeader:!0,show:!0,wrapperCssClass:"k-list k-list-md"}),Me&&e.createElement(R.NoDataRender,{selectedView:n}));return e.createElement("div",{ref:S,className:"k-smart-box-wrapper",dir:Se,onBlur:We},e.createElement("span",{className:d.classNames("k-smart-box","k-input",`k-input-${Oe}`,{"k-loading":h})},!U&&e.createElement("span",{className:"k-input-prefix k-input-prefix-horizontal"},e.createElement(d.IconWrap,{className:d.classNames("k-icon",{"k-accent-icon":n==="aiAssistant"||n==="semanticSearch"}),icon:Fe.svgIcon,onClick:$e,onMouseDown:t=>{"preventDefault"in t&&t.preventDefault()}})),e.createElement("input",{ref:B,type:"text",className:d.classNames("k-input-inner",{"k-disabled":U}),id:ve.current,placeholder:Ne,value:c,disabled:U,onChange:Ge,onFocus:Ve,onClick:je,onKeyDown:Ue}),c.length>0&&(n==="search"||n==="semanticSearch")&&e.createElement("span",{className:"k-clear-value",title:C.toLanguageString(o.smartBoxClearTitle,o.messages[o.smartBoxClearTitle]),role:"button",tabIndex:-1,onClick:Ke,onMouseDown:t=>t.preventDefault()},e.createElement(d.IconWrap,{className:"k-icon",icon:M.xIcon})),n==="aiAssistant"&&e.createElement("span",{className:"k-input-suffix k-input-suffix-horizontal"},se&&e.createElement(_.SpeechToTextButton,{...se,"aria-label":C.toLanguageString(o.smartBoxSpeechToTextButton,o.messages[o.smartBoxSpeechToTextButton]),title:C.toLanguageString(o.smartBoxSpeechToTextButton,o.messages[o.smartBoxSpeechToTextButton]),onResult:_e}),e.createElement(_.Button,{className:d.classNames("k-smart-box-send",{"k-processing":h,"k-active":h}),type:"button",rounded:"full",size:"small",title:C.toLanguageString(o.smartBoxSubmitPromptButton,o.messages[o.smartBoxSubmitPromptButton]),"aria-label":C.toLanguageString(o.smartBoxSubmitPromptButton,o.messages[o.smartBoxSubmitPromptButton]),"aria-disabled":c.length===0,svgIcon:h?M.stopIcon:M.arrowUpIcon,disabled:c.length===0&&!h,onClick:K}))),e.createElement(tt.Popup,{ref:Z,anchor:S.current,show:Qe,popupClass:"k-smart-box-popup",style:{width:we},anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},margin:{horizontal:0,vertical:2},onMouseDownOutside:t=>{const s=t.event.target;S.current&&!S.current.contains(s)&&a(!1)}},Xe()))});ge.displayName="KendoReactSmartBox";exports.SmartBox=ge;
|