@progress/kendo-react-grid 14.5.0-develop.4 → 14.5.0-develop.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/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 +18 -19
- 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/interfaces/SmartBoxTypes.d.ts +12 -4
- package/utils/handleAIResponse.d.ts +2 -2
|
@@ -7,20 +7,20 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as e from "react";
|
|
9
9
|
import { SpeechToTextButton as et, Button as tt, SegmentedControl as nt } from "@progress/kendo-react-buttons";
|
|
10
|
-
import { xIcon as rt, stopSmIcon as
|
|
10
|
+
import { xIcon as rt, stopSmIcon as at, arrowUpOutlineIcon as st } from "@progress/kendo-svg-icons";
|
|
11
11
|
import { guid as ot, kendoThemeMaps as it, classNames as B, IconWrap as ce } from "@progress/kendo-react-common";
|
|
12
12
|
import { useLocalization as lt } from "@progress/kendo-react-intl";
|
|
13
13
|
import { List as $ } from "@progress/kendo-react-dropdowns";
|
|
14
14
|
import { Popup as ct } from "@progress/kendo-react-popup";
|
|
15
15
|
import { createListItemRender as ut, searchModeItemRender as pt, listGroupHeaderRender as ue, NoDataRender as mt } from "./listItemRenders.mjs";
|
|
16
|
-
import { smartBoxClearTitle as pe, messages as
|
|
16
|
+
import { smartBoxClearTitle as pe, messages as C, smartBoxSpeechToTextButton as P, smartBoxSubmitPromptButton as L } from "../../messages/index.mjs";
|
|
17
17
|
import { useGridAIRequest as dt } from "../../hooks/useGridAIRequest.mjs";
|
|
18
|
-
import { GridContext as
|
|
19
|
-
import { useSmartBoxModes as
|
|
18
|
+
import { GridContext as ht } from "../../utils/GridContext.mjs";
|
|
19
|
+
import { useSmartBoxModes as ft } from "./hooks/useSmartBoxModes.mjs";
|
|
20
20
|
import { useSmartBoxHistory as gt } from "./hooks/useSmartBoxHistory.mjs";
|
|
21
21
|
import { useSmartBoxPopup as St } from "./hooks/useSmartBoxPopup.mjs";
|
|
22
|
-
import { useSmartBoxGridState as
|
|
23
|
-
import { useSmartBoxLabels as
|
|
22
|
+
import { useSmartBoxGridState as Ct } from "./hooks/useSmartBoxGridState.mjs";
|
|
23
|
+
import { useSmartBoxLabels as kt } from "./hooks/useSmartBoxLabels.mjs";
|
|
24
24
|
import { useSmartBoxListData as bt } from "./hooks/useSmartBoxListData.mjs";
|
|
25
25
|
import { useSmartBoxSegmentedControl as xt } from "./hooks/useSmartBoxSegmentedControl.mjs";
|
|
26
26
|
import { useSmartBoxSearch as Rt } from "./hooks/useSmartBoxSearch.mjs";
|
|
@@ -28,20 +28,20 @@ import { useDebounce as vt } from "./hooks/useDebounce.mjs";
|
|
|
28
28
|
const It = e.forwardRef((me, de) => {
|
|
29
29
|
var ie;
|
|
30
30
|
const {
|
|
31
|
-
searchConfig:
|
|
32
|
-
semanticSearchConfig:
|
|
31
|
+
searchConfig: he,
|
|
32
|
+
semanticSearchConfig: fe,
|
|
33
33
|
aiAssistantConfig: ge,
|
|
34
34
|
activeMode: Se,
|
|
35
|
-
dir:
|
|
35
|
+
dir: Ce = "ltr",
|
|
36
36
|
size: K = "medium",
|
|
37
|
-
placeholder:
|
|
37
|
+
placeholder: ke,
|
|
38
38
|
history: be,
|
|
39
39
|
loading: xe = !1,
|
|
40
40
|
promptSuggestionRender: j,
|
|
41
41
|
historyItemRender: J,
|
|
42
42
|
onOpen: Re,
|
|
43
43
|
onClose: ve,
|
|
44
|
-
onFocus:
|
|
44
|
+
onFocus: k,
|
|
45
45
|
onBlur: b,
|
|
46
46
|
onSearch: Ie,
|
|
47
47
|
onSemanticSearch: we,
|
|
@@ -49,39 +49,39 @@ const It = e.forwardRef((me, de) => {
|
|
|
49
49
|
onAIResponseSuccess: H,
|
|
50
50
|
onAIResponseError: z,
|
|
51
51
|
onAICancelRequest: x
|
|
52
|
-
} = me,
|
|
52
|
+
} = me, f = lt(), g = e.useContext(ht), Ee = e.useRef(`k-${ot()}`), d = e.useRef(null), S = e.useRef(null), Q = e.useRef(null), [o, p] = e.useState(""), [De, R] = e.useState(!1), [ye, X] = e.useState(void 0), [Be, Y] = e.useState(null), {
|
|
53
53
|
searchMode: i,
|
|
54
54
|
semanticSearchMode: c,
|
|
55
|
-
aiAssistantMode:
|
|
55
|
+
aiAssistantMode: a,
|
|
56
56
|
selectedView: n,
|
|
57
57
|
setSelectedViewState: N,
|
|
58
58
|
lastSearchMode: Pe,
|
|
59
|
-
searchHistorySettings:
|
|
60
|
-
semanticSearchHistorySettings:
|
|
59
|
+
searchHistorySettings: Z,
|
|
60
|
+
semanticSearchHistorySettings: _,
|
|
61
61
|
aiAssistantHistorySettings: T,
|
|
62
|
-
speechToTextButtonSettings:
|
|
62
|
+
speechToTextButtonSettings: M,
|
|
63
63
|
currentSearchDelay: Le
|
|
64
|
-
} =
|
|
65
|
-
searchConfigProp:
|
|
66
|
-
semanticSearchConfigProp:
|
|
64
|
+
} = ft({
|
|
65
|
+
searchConfigProp: he,
|
|
66
|
+
semanticSearchConfigProp: fe,
|
|
67
67
|
aiAssistantConfigProp: ge,
|
|
68
68
|
activeModeProp: Se,
|
|
69
69
|
sharedHistory: be
|
|
70
70
|
}), { currentHistory: v, currentHistorySettings: Fe, addToHistory: q } = gt({
|
|
71
71
|
selectedView: n,
|
|
72
|
-
searchHistorySettings:
|
|
73
|
-
semanticSearchHistorySettings:
|
|
72
|
+
searchHistorySettings: Z,
|
|
73
|
+
semanticSearchHistorySettings: _,
|
|
74
74
|
aiAssistantHistorySettings: T
|
|
75
|
-
}), { isOpen: O, togglePopup:
|
|
76
|
-
() => (
|
|
77
|
-
[
|
|
78
|
-
), { inputPlaceholder: Te, prefixIcon: qe } =
|
|
75
|
+
}), { isOpen: O, togglePopup: s } = St({ onOpen: Re, onClose: ve }), { columns: A, gridState: He, gridRef: ze, handleStateChange: Ne } = Ct(g), V = e.useMemo(
|
|
76
|
+
() => (a == null ? void 0 : a.promptSuggestions) || [],
|
|
77
|
+
[a == null ? void 0 : a.promptSuggestions]
|
|
78
|
+
), { inputPlaceholder: Te, prefixIcon: qe } = kt({
|
|
79
79
|
selectedView: n,
|
|
80
80
|
searchMode: i,
|
|
81
81
|
semanticSearchMode: c,
|
|
82
|
-
aiAssistantMode:
|
|
83
|
-
sharedPlaceholder:
|
|
84
|
-
}), { searchListData:
|
|
82
|
+
aiAssistantMode: a,
|
|
83
|
+
sharedPlaceholder: ke
|
|
84
|
+
}), { searchListData: h, aiAssistantListData: I, searchHistoryListData: w } = bt({
|
|
85
85
|
selectedView: n,
|
|
86
86
|
searchModeEnabled: i == null ? void 0 : i.enabled,
|
|
87
87
|
semanticSearchModeEnabled: c == null ? void 0 : c.enabled,
|
|
@@ -91,7 +91,7 @@ const It = e.forwardRef((me, de) => {
|
|
|
91
91
|
}), E = xt({
|
|
92
92
|
searchMode: i,
|
|
93
93
|
semanticSearchMode: c,
|
|
94
|
-
aiAssistantMode:
|
|
94
|
+
aiAssistantMode: a,
|
|
95
95
|
selectedView: n,
|
|
96
96
|
lastSearchMode: Pe,
|
|
97
97
|
setSelectedViewState: N,
|
|
@@ -101,27 +101,28 @@ const It = e.forwardRef((me, de) => {
|
|
|
101
101
|
const t = d.current;
|
|
102
102
|
if (!t)
|
|
103
103
|
return;
|
|
104
|
-
|
|
104
|
+
X(t.offsetWidth);
|
|
105
105
|
const r = new ResizeObserver(() => {
|
|
106
|
-
t &&
|
|
106
|
+
t && X(t.offsetWidth);
|
|
107
107
|
});
|
|
108
108
|
return r.observe(t), () => {
|
|
109
109
|
r.disconnect();
|
|
110
110
|
};
|
|
111
111
|
}, []);
|
|
112
|
-
const m = xe || De, W = !n, Oe = !(i != null && i.enabled) && !(c != null && c.enabled) && !(
|
|
112
|
+
const m = xe || De, W = !n, Oe = !(i != null && i.enabled) && !(c != null && c.enabled) && !(a != null && a.enabled), Ve = it.sizeMap[K] || "md", { emitSearchEvent: u } = Rt({
|
|
113
113
|
selectedView: n,
|
|
114
114
|
searchMode: i,
|
|
115
115
|
columns: A,
|
|
116
116
|
gridContext: g,
|
|
117
|
-
searchHistorySettings:
|
|
118
|
-
semanticSearchHistorySettings:
|
|
117
|
+
searchHistorySettings: Z,
|
|
118
|
+
semanticSearchHistorySettings: _,
|
|
119
119
|
addToHistory: q,
|
|
120
120
|
onSearch: Ie,
|
|
121
121
|
onSemanticSearch: we
|
|
122
122
|
}), { sendRequest: ee, cancelRequest: te } = dt({
|
|
123
|
-
requestUrl:
|
|
124
|
-
requestOptions:
|
|
123
|
+
requestUrl: a == null ? void 0 : a.requestUrl,
|
|
124
|
+
requestOptions: a == null ? void 0 : a.requestOptions,
|
|
125
|
+
httpClient: a == null ? void 0 : a.httpClient,
|
|
125
126
|
columns: A,
|
|
126
127
|
gridState: He,
|
|
127
128
|
gridRef: ze,
|
|
@@ -140,10 +141,10 @@ const It = e.forwardRef((me, de) => {
|
|
|
140
141
|
e.useImperativeHandle(
|
|
141
142
|
de,
|
|
142
143
|
() => ({
|
|
143
|
-
show: () =>
|
|
144
|
-
hide: () =>
|
|
144
|
+
show: () => s(!0),
|
|
145
|
+
hide: () => s(!1)
|
|
145
146
|
}),
|
|
146
|
-
[
|
|
147
|
+
[s]
|
|
147
148
|
);
|
|
148
149
|
const G = vt(Be, Le), ne = e.useRef(u);
|
|
149
150
|
ne.current = u, e.useEffect(() => {
|
|
@@ -152,31 +153,31 @@ const It = e.forwardRef((me, de) => {
|
|
|
152
153
|
const We = e.useCallback(
|
|
153
154
|
(t) => {
|
|
154
155
|
const r = t.target.value;
|
|
155
|
-
p(r),
|
|
156
|
+
p(r), s(!r), (n === "search" || n === "semanticSearch") && Y(r);
|
|
156
157
|
},
|
|
157
|
-
[
|
|
158
|
+
[s, n]
|
|
158
159
|
), Ge = e.useCallback(() => {
|
|
159
|
-
|
|
160
|
-
}, [
|
|
160
|
+
k == null || k(), o || s(!0);
|
|
161
|
+
}, [k, s, o]), Ue = e.useCallback(
|
|
161
162
|
(t) => {
|
|
162
163
|
var le;
|
|
163
|
-
const r = d.current, l = (le =
|
|
164
|
-
!
|
|
164
|
+
const r = d.current, l = (le = Q.current) == null ? void 0 : le.element, y = t.relatedTarget, Me = y && (r == null ? void 0 : r.contains(y)), Ae = y && (l == null ? void 0 : l.contains(y));
|
|
165
|
+
!Me && !Ae && (b == null || b(), s(!1));
|
|
165
166
|
},
|
|
166
|
-
[b,
|
|
167
|
+
[b, s]
|
|
167
168
|
), $e = e.useCallback(() => {
|
|
168
|
-
o ||
|
|
169
|
-
}, [
|
|
169
|
+
o || s(!0);
|
|
170
|
+
}, [s, o]), re = !!((ie = a == null ? void 0 : a.requestOptions) != null && ie.url || a != null && a.requestUrl), U = e.useCallback(() => {
|
|
170
171
|
if (m) {
|
|
171
172
|
x == null || x(), te(), R(!1);
|
|
172
173
|
return;
|
|
173
174
|
}
|
|
174
|
-
o.trim() && (re && R(!0), q("aiAssistant", o, T),
|
|
175
|
+
o.trim() && (re && R(!0), q("aiAssistant", o, T), s(!1), ee(o.trim()), p(""));
|
|
175
176
|
}, [
|
|
176
177
|
m,
|
|
177
178
|
o,
|
|
178
179
|
T,
|
|
179
|
-
|
|
180
|
+
s,
|
|
180
181
|
q,
|
|
181
182
|
ee,
|
|
182
183
|
te,
|
|
@@ -189,42 +190,42 @@ const It = e.forwardRef((me, de) => {
|
|
|
189
190
|
[n, o, u, U]
|
|
190
191
|
), je = e.useCallback(() => {
|
|
191
192
|
var t;
|
|
192
|
-
|
|
193
|
-
}, [O,
|
|
193
|
+
s(!O), (t = S.current) == null || t.focus();
|
|
194
|
+
}, [O, s]), Je = e.useCallback(
|
|
194
195
|
(t) => {
|
|
195
196
|
var r;
|
|
196
|
-
t.stopPropagation(), t.preventDefault(), p(""), (r = S.current) == null || r.focus(),
|
|
197
|
+
t.stopPropagation(), t.preventDefault(), p(""), (r = S.current) == null || r.focus(), s(!0), u("");
|
|
197
198
|
},
|
|
198
|
-
[
|
|
199
|
-
),
|
|
199
|
+
[s, u]
|
|
200
|
+
), ae = e.useCallback(
|
|
200
201
|
(t) => {
|
|
201
202
|
var r;
|
|
202
|
-
N(t), p(""),
|
|
203
|
+
N(t), p(""), Y(null), (r = S.current) == null || r.focus();
|
|
203
204
|
},
|
|
204
205
|
[N]
|
|
205
206
|
), D = e.useCallback(
|
|
206
207
|
(t) => {
|
|
207
208
|
var r;
|
|
208
|
-
p(t),
|
|
209
|
+
p(t), s(!1), (r = S.current) == null || r.focus(), n !== "aiAssistant" && u(t);
|
|
209
210
|
},
|
|
210
|
-
[n,
|
|
211
|
-
),
|
|
211
|
+
[n, s, u]
|
|
212
|
+
), Qe = e.useCallback((t) => {
|
|
212
213
|
if (t.isFinal && t.alternatives.length > 0) {
|
|
213
214
|
const r = t.alternatives[0].transcript;
|
|
214
215
|
p((l) => l ? `${l} ${r}` : r);
|
|
215
216
|
}
|
|
216
|
-
}, []),
|
|
217
|
+
}, []), Xe = e.useMemo(() => n === "aiAssistant" ? v.length === 0 && V.length === 0 : n === "search" || n === "semanticSearch" ? v.length === 0 && h.length === 0 : !1, [n, v.length, V.length, h.length]), se = e.useCallback(
|
|
217
218
|
(t) => {
|
|
218
219
|
const l = (n === "aiAssistant" ? I : w)[t];
|
|
219
220
|
l && D(l.text);
|
|
220
221
|
},
|
|
221
222
|
[n, I, w, D]
|
|
222
|
-
),
|
|
223
|
+
), Ye = e.useCallback(
|
|
223
224
|
(t) => {
|
|
224
|
-
const r =
|
|
225
|
-
r &&
|
|
225
|
+
const r = h[t];
|
|
226
|
+
r && ae(r.mode);
|
|
226
227
|
},
|
|
227
|
-
[
|
|
228
|
+
[h, ae]
|
|
228
229
|
), oe = e.useMemo(
|
|
229
230
|
() => ut({
|
|
230
231
|
historyItemRender: J,
|
|
@@ -232,7 +233,7 @@ const It = e.forwardRef((me, de) => {
|
|
|
232
233
|
handleListItemClick: D
|
|
233
234
|
}),
|
|
234
235
|
[J, j, D]
|
|
235
|
-
),
|
|
236
|
+
), Ze = O && !Oe, _e = () => /* @__PURE__ */ e.createElement(e.Fragment, null, E.items.length > 0 && /* @__PURE__ */ e.createElement(
|
|
236
237
|
nt,
|
|
237
238
|
{
|
|
238
239
|
items: E.items,
|
|
@@ -241,13 +242,13 @@ const It = e.forwardRef((me, de) => {
|
|
|
241
242
|
size: K,
|
|
242
243
|
layoutMode: "stretch"
|
|
243
244
|
}
|
|
244
|
-
), (n === "search" || n === "semanticSearch") &&
|
|
245
|
+
), (n === "search" || n === "semanticSearch") && h.length > 0 && /* @__PURE__ */ e.createElement(
|
|
245
246
|
$,
|
|
246
247
|
{
|
|
247
|
-
data:
|
|
248
|
+
data: h,
|
|
248
249
|
textField: "text",
|
|
249
250
|
descriptionField: "description",
|
|
250
|
-
onClick:
|
|
251
|
+
onClick: Ye,
|
|
251
252
|
itemRender: pt,
|
|
252
253
|
show: !0,
|
|
253
254
|
wrapperCssClass: "k-list k-list-md"
|
|
@@ -260,7 +261,7 @@ const It = e.forwardRef((me, de) => {
|
|
|
260
261
|
groupField: "group",
|
|
261
262
|
svgIconField: "groupSvgIcon",
|
|
262
263
|
descriptionField: "description",
|
|
263
|
-
onClick:
|
|
264
|
+
onClick: se,
|
|
264
265
|
itemRender: oe,
|
|
265
266
|
groupHeaderItemRender: ue,
|
|
266
267
|
showFirstGroupHeader: !0,
|
|
@@ -275,15 +276,15 @@ const It = e.forwardRef((me, de) => {
|
|
|
275
276
|
groupField: "group",
|
|
276
277
|
svgIconField: "groupSvgIcon",
|
|
277
278
|
descriptionField: "description",
|
|
278
|
-
onClick:
|
|
279
|
+
onClick: se,
|
|
279
280
|
itemRender: oe,
|
|
280
281
|
groupHeaderItemRender: ue,
|
|
281
282
|
showFirstGroupHeader: !0,
|
|
282
283
|
show: !0,
|
|
283
284
|
wrapperCssClass: "k-list k-list-md"
|
|
284
285
|
}
|
|
285
|
-
),
|
|
286
|
-
return /* @__PURE__ */ e.createElement("div", { ref: d, className: "k-smart-box-wrapper", dir:
|
|
286
|
+
), Xe && /* @__PURE__ */ e.createElement(mt, { selectedView: n }));
|
|
287
|
+
return /* @__PURE__ */ e.createElement("div", { ref: d, className: "k-smart-box-wrapper", dir: Ce, onBlur: Ue }, /* @__PURE__ */ e.createElement(
|
|
287
288
|
"span",
|
|
288
289
|
{
|
|
289
290
|
className: B("k-smart-box", "k-input", `k-input-${Ve}`, {
|
|
@@ -323,9 +324,9 @@ const It = e.forwardRef((me, de) => {
|
|
|
323
324
|
"span",
|
|
324
325
|
{
|
|
325
326
|
className: "k-clear-value",
|
|
326
|
-
title:
|
|
327
|
+
title: f.toLanguageString(
|
|
327
328
|
pe,
|
|
328
|
-
|
|
329
|
+
C[pe]
|
|
329
330
|
),
|
|
330
331
|
role: "button",
|
|
331
332
|
tabIndex: -1,
|
|
@@ -334,19 +335,19 @@ const It = e.forwardRef((me, de) => {
|
|
|
334
335
|
},
|
|
335
336
|
/* @__PURE__ */ e.createElement(ce, { className: "k-icon", icon: rt })
|
|
336
337
|
),
|
|
337
|
-
n === "aiAssistant" && /* @__PURE__ */ e.createElement("span", { className: "k-input-suffix k-input-suffix-horizontal" },
|
|
338
|
+
n === "aiAssistant" && /* @__PURE__ */ e.createElement("span", { className: "k-input-suffix k-input-suffix-horizontal" }, M && /* @__PURE__ */ e.createElement(
|
|
338
339
|
et,
|
|
339
340
|
{
|
|
340
|
-
...
|
|
341
|
-
"aria-label":
|
|
341
|
+
...M,
|
|
342
|
+
"aria-label": f.toLanguageString(
|
|
342
343
|
P,
|
|
343
|
-
|
|
344
|
+
C[P]
|
|
344
345
|
),
|
|
345
|
-
title:
|
|
346
|
+
title: f.toLanguageString(
|
|
346
347
|
P,
|
|
347
|
-
|
|
348
|
+
C[P]
|
|
348
349
|
),
|
|
349
|
-
onResult:
|
|
350
|
+
onResult: Qe
|
|
350
351
|
}
|
|
351
352
|
), /* @__PURE__ */ e.createElement(
|
|
352
353
|
tt,
|
|
@@ -358,16 +359,16 @@ const It = e.forwardRef((me, de) => {
|
|
|
358
359
|
type: "button",
|
|
359
360
|
rounded: "full",
|
|
360
361
|
size: "small",
|
|
361
|
-
title:
|
|
362
|
+
title: f.toLanguageString(
|
|
362
363
|
L,
|
|
363
|
-
|
|
364
|
+
C[L]
|
|
364
365
|
),
|
|
365
|
-
"aria-label":
|
|
366
|
+
"aria-label": f.toLanguageString(
|
|
366
367
|
L,
|
|
367
|
-
|
|
368
|
+
C[L]
|
|
368
369
|
),
|
|
369
370
|
"aria-disabled": o.length === 0,
|
|
370
|
-
svgIcon: m ?
|
|
371
|
+
svgIcon: m ? at : st,
|
|
371
372
|
disabled: o.length === 0 && !m,
|
|
372
373
|
onClick: U
|
|
373
374
|
}
|
|
@@ -375,9 +376,9 @@ const It = e.forwardRef((me, de) => {
|
|
|
375
376
|
), /* @__PURE__ */ e.createElement(
|
|
376
377
|
ct,
|
|
377
378
|
{
|
|
378
|
-
ref:
|
|
379
|
+
ref: Q,
|
|
379
380
|
anchor: d.current,
|
|
380
|
-
show:
|
|
381
|
+
show: Ze,
|
|
381
382
|
popupClass: "k-smart-box-popup",
|
|
382
383
|
style: { width: ye },
|
|
383
384
|
anchorAlign: { horizontal: "left", vertical: "bottom" },
|
|
@@ -385,10 +386,10 @@ const It = e.forwardRef((me, de) => {
|
|
|
385
386
|
margin: { horizontal: 0, vertical: 2 },
|
|
386
387
|
onMouseDownOutside: (t) => {
|
|
387
388
|
const r = t.event.target;
|
|
388
|
-
d.current && !d.current.contains(r) &&
|
|
389
|
+
d.current && !d.current.contains(r) && s(!1);
|
|
389
390
|
}
|
|
390
391
|
},
|
|
391
|
-
|
|
392
|
+
_e()
|
|
392
393
|
));
|
|
393
394
|
});
|
|
394
395
|
It.displayName = "KendoReactSmartBox";
|
|
@@ -11,7 +11,7 @@ import { GridToolbarAIAssistantRequestData } from '../../../index.js';
|
|
|
11
11
|
import { GridSmartBoxAIAssistantSearchProps, GridSmartBoxSearchProps } from './SearchTypes';
|
|
12
12
|
import { TextBoxProps } from '@progress/kendo-react-inputs';
|
|
13
13
|
import { GridSmartBoxHistoryProps } from './utilTypes';
|
|
14
|
-
import {
|
|
14
|
+
import { GridAIRequestConfig, GridAIHttpClient } from '../../../hooks/useGridAIRequest.js';
|
|
15
15
|
/**
|
|
16
16
|
* Represents the available modes for the SmartBox component.
|
|
17
17
|
*
|
|
@@ -142,8 +142,11 @@ export interface GridSmartBoxAIAssistantConfigProps {
|
|
|
142
142
|
*/
|
|
143
143
|
requestUrl?: string;
|
|
144
144
|
/**
|
|
145
|
-
* Defines the options for the
|
|
146
|
-
*
|
|
145
|
+
* Defines the options for the HTTP request.
|
|
146
|
+
* Accepts both `GridAIRequestConfig` (recommended) and `AxiosRequestConfig` (legacy).
|
|
147
|
+
*
|
|
148
|
+
* @remarks
|
|
149
|
+
* `GridAIRequestConfig` is recommended — no external dependency.
|
|
147
150
|
*
|
|
148
151
|
* @example
|
|
149
152
|
* ```tsx
|
|
@@ -157,7 +160,12 @@ export interface GridSmartBoxAIAssistantConfigProps {
|
|
|
157
160
|
* }} />
|
|
158
161
|
* ```
|
|
159
162
|
*/
|
|
160
|
-
requestOptions?:
|
|
163
|
+
requestOptions?: GridAIRequestConfig;
|
|
164
|
+
/**
|
|
165
|
+
* Optional custom HTTP client for the AI assistant.
|
|
166
|
+
* When provided, overrides the built-in fetch-based transport.
|
|
167
|
+
*/
|
|
168
|
+
httpClient?: GridAIHttpClient;
|
|
161
169
|
/**
|
|
162
170
|
* List of suggested prompts to display in the popup.
|
|
163
171
|
*
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
8
|
+
import { GridAIResponse } from '../hooks/useGridAIRequest.js';
|
|
9
9
|
import { CompositeFilterDescriptor, GroupDescriptor, SortDescriptor } from '@progress/kendo-data-query';
|
|
10
10
|
import { GridColumnState, GridHandle } from '../interfaces/index.js';
|
|
11
11
|
/**
|
|
@@ -157,7 +157,7 @@ export interface GridAIResponseResult {
|
|
|
157
157
|
* };
|
|
158
158
|
* ```
|
|
159
159
|
*/
|
|
160
|
-
export declare function handleAIResponse(response:
|
|
160
|
+
export declare function handleAIResponse(response: GridAIResponse<any>, currentState: GridAIState, gridRef: Pick<GridHandle, 'getLeafDataItems' | 'getTotal' | 'exportAsPdf' | 'props'> | null): GridAIResponseResult;
|
|
161
161
|
/**
|
|
162
162
|
* Handles sort command by merging new sort with existing sorts.
|
|
163
163
|
*
|