@progress/kendo-react-grid 15.1.1-develop.3 → 15.2.0-develop.2
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/interfaces/GridCellsSettings.d.ts +7 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +17 -17
- package/toolbar-tools/smartbox/SmartBox.js +1 -1
- package/toolbar-tools/smartbox/SmartBox.mjs +209 -193
- package/toolbar-tools/smartbox/interfaces/SmartBoxTypes.d.ts +21 -0
|
@@ -6,299 +6,310 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as e from "react";
|
|
9
|
-
import { SpeechToTextButton as
|
|
10
|
-
import { xIcon as
|
|
11
|
-
import { guid as
|
|
12
|
-
import { useLocalization as
|
|
13
|
-
import { List as
|
|
14
|
-
import { Popup as
|
|
15
|
-
import { createListItemRender as
|
|
16
|
-
import { smartBoxClearTitle as
|
|
17
|
-
import { useGridAIRequest as
|
|
18
|
-
import { GridContext as
|
|
19
|
-
import { useSmartBoxModes as
|
|
20
|
-
import { useSmartBoxHistory as
|
|
21
|
-
import { useSmartBoxPopup as
|
|
22
|
-
import { useSmartBoxGridState as
|
|
23
|
-
import { useSmartBoxLabels as
|
|
24
|
-
import { useSmartBoxListData as
|
|
25
|
-
import { useSmartBoxSegmentedControl as
|
|
26
|
-
import { useSmartBoxSearch as
|
|
27
|
-
import { useDebounce as
|
|
28
|
-
const
|
|
9
|
+
import { SpeechToTextButton as ot, Button as it, SegmentedControl as lt } from "@progress/kendo-react-buttons";
|
|
10
|
+
import { xIcon as ct, stopIcon as ut, arrowUpIcon as pt } from "@progress/kendo-svg-icons";
|
|
11
|
+
import { guid as mt, kendoThemeMaps as ce, classNames as L, IconWrap as ue } from "@progress/kendo-react-common";
|
|
12
|
+
import { useLocalization as dt } from "@progress/kendo-react-intl";
|
|
13
|
+
import { List as U } from "@progress/kendo-react-dropdowns";
|
|
14
|
+
import { Popup as ft } from "@progress/kendo-react-popup";
|
|
15
|
+
import { createListItemRender as ht, searchModeItemRender as gt, listGroupHeaderRender as pe, NoDataRender as St } from "./listItemRenders.mjs";
|
|
16
|
+
import { smartBoxClearTitle as me, messages as C, smartBoxSpeechToTextButton as P, smartBoxSubmitPromptButton as F } from "../../messages/index.mjs";
|
|
17
|
+
import { useGridAIRequest as Ct } from "../../hooks/useGridAIRequest.mjs";
|
|
18
|
+
import { GridContext as kt } from "../../utils/GridContext.mjs";
|
|
19
|
+
import { useSmartBoxModes as bt } from "./hooks/useSmartBoxModes.mjs";
|
|
20
|
+
import { useSmartBoxHistory as xt } from "./hooks/useSmartBoxHistory.mjs";
|
|
21
|
+
import { useSmartBoxPopup as vt } from "./hooks/useSmartBoxPopup.mjs";
|
|
22
|
+
import { useSmartBoxGridState as Rt } from "./hooks/useSmartBoxGridState.mjs";
|
|
23
|
+
import { useSmartBoxLabels as It } from "./hooks/useSmartBoxLabels.mjs";
|
|
24
|
+
import { useSmartBoxListData as wt } from "./hooks/useSmartBoxListData.mjs";
|
|
25
|
+
import { useSmartBoxSegmentedControl as Et } from "./hooks/useSmartBoxSegmentedControl.mjs";
|
|
26
|
+
import { useSmartBoxSearch as Dt } from "./hooks/useSmartBoxSearch.mjs";
|
|
27
|
+
import { useDebounce as yt } from "./hooks/useDebounce.mjs";
|
|
28
|
+
const Bt = e.forwardRef((de, fe) => {
|
|
29
29
|
var ie;
|
|
30
30
|
const {
|
|
31
31
|
searchConfig: he,
|
|
32
|
-
semanticSearchConfig:
|
|
33
|
-
aiAssistantConfig:
|
|
34
|
-
activeMode:
|
|
35
|
-
dir:
|
|
32
|
+
semanticSearchConfig: ge,
|
|
33
|
+
aiAssistantConfig: Se,
|
|
34
|
+
activeMode: Ce,
|
|
35
|
+
dir: ke = "ltr",
|
|
36
36
|
size: K = "medium",
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
rounded: be = "medium",
|
|
38
|
+
fillMode: xe = "solid",
|
|
39
|
+
placeholder: ve,
|
|
40
|
+
history: Re,
|
|
41
|
+
loading: Ie = !1,
|
|
42
|
+
promptSuggestionRender: M,
|
|
43
|
+
historyItemRender: j,
|
|
44
|
+
onOpen: we,
|
|
45
|
+
onClose: Ee,
|
|
44
46
|
onFocus: k,
|
|
45
47
|
onBlur: b,
|
|
46
|
-
onSearch:
|
|
47
|
-
onSemanticSearch:
|
|
48
|
-
onAIPromptRequest:
|
|
49
|
-
onAIResponseSuccess:
|
|
50
|
-
onAIResponseError:
|
|
51
|
-
onAICancelRequest: x
|
|
52
|
-
|
|
48
|
+
onSearch: De,
|
|
49
|
+
onSemanticSearch: ye,
|
|
50
|
+
onAIPromptRequest: H,
|
|
51
|
+
onAIResponseSuccess: z,
|
|
52
|
+
onAIResponseError: N,
|
|
53
|
+
onAICancelRequest: x,
|
|
54
|
+
ariaLabel: Be
|
|
55
|
+
} = de, h = dt(), g = e.useContext(kt), Le = e.useRef(`k-${mt()}`), d = e.useRef(null), S = e.useRef(null), J = e.useRef(null), [o, m] = e.useState(""), [Pe, v] = e.useState(!1), [Fe, Q] = e.useState(void 0), [He, X] = e.useState(null), {
|
|
53
56
|
searchMode: i,
|
|
54
|
-
semanticSearchMode:
|
|
57
|
+
semanticSearchMode: u,
|
|
55
58
|
aiAssistantMode: a,
|
|
56
59
|
selectedView: n,
|
|
57
|
-
setSelectedViewState:
|
|
58
|
-
lastSearchMode:
|
|
59
|
-
searchHistorySettings:
|
|
60
|
-
semanticSearchHistorySettings:
|
|
61
|
-
aiAssistantHistorySettings:
|
|
62
|
-
speechToTextButtonSettings:
|
|
63
|
-
currentSearchDelay:
|
|
64
|
-
} =
|
|
60
|
+
setSelectedViewState: T,
|
|
61
|
+
lastSearchMode: ze,
|
|
62
|
+
searchHistorySettings: Y,
|
|
63
|
+
semanticSearchHistorySettings: Z,
|
|
64
|
+
aiAssistantHistorySettings: q,
|
|
65
|
+
speechToTextButtonSettings: _,
|
|
66
|
+
currentSearchDelay: Ne
|
|
67
|
+
} = bt({
|
|
65
68
|
searchConfigProp: he,
|
|
66
|
-
semanticSearchConfigProp:
|
|
67
|
-
aiAssistantConfigProp:
|
|
68
|
-
activeModeProp:
|
|
69
|
-
sharedHistory:
|
|
70
|
-
}), { currentHistory:
|
|
69
|
+
semanticSearchConfigProp: ge,
|
|
70
|
+
aiAssistantConfigProp: Se,
|
|
71
|
+
activeModeProp: Ce,
|
|
72
|
+
sharedHistory: Re
|
|
73
|
+
}), { currentHistory: R, currentHistorySettings: Te, addToHistory: O } = xt({
|
|
71
74
|
selectedView: n,
|
|
72
|
-
searchHistorySettings:
|
|
73
|
-
semanticSearchHistorySettings:
|
|
74
|
-
aiAssistantHistorySettings:
|
|
75
|
-
}), { isOpen:
|
|
75
|
+
searchHistorySettings: Y,
|
|
76
|
+
semanticSearchHistorySettings: Z,
|
|
77
|
+
aiAssistantHistorySettings: q
|
|
78
|
+
}), { isOpen: I, togglePopup: s } = vt({ onOpen: we, onClose: Ee }), { columns: A, gridState: qe, gridRef: Oe, handleStateChange: Ve } = Rt(g), V = e.useMemo(
|
|
76
79
|
() => (a == null ? void 0 : a.promptSuggestions) || [],
|
|
77
80
|
[a == null ? void 0 : a.promptSuggestions]
|
|
78
|
-
), { inputPlaceholder:
|
|
81
|
+
), { inputPlaceholder: We, prefixIcon: Ge } = It({
|
|
79
82
|
selectedView: n,
|
|
80
83
|
searchMode: i,
|
|
81
|
-
semanticSearchMode:
|
|
84
|
+
semanticSearchMode: u,
|
|
82
85
|
aiAssistantMode: a,
|
|
83
|
-
sharedPlaceholder:
|
|
84
|
-
}), { searchListData:
|
|
86
|
+
sharedPlaceholder: ve
|
|
87
|
+
}), { searchListData: f, aiAssistantListData: w, searchHistoryListData: E } = wt({
|
|
85
88
|
selectedView: n,
|
|
86
89
|
searchModeEnabled: i == null ? void 0 : i.enabled,
|
|
87
|
-
semanticSearchModeEnabled:
|
|
90
|
+
semanticSearchModeEnabled: u == null ? void 0 : u.enabled,
|
|
88
91
|
promptSuggestions: V,
|
|
89
|
-
currentHistory:
|
|
90
|
-
currentHistorySettings:
|
|
91
|
-
}),
|
|
92
|
+
currentHistory: R,
|
|
93
|
+
currentHistorySettings: Te
|
|
94
|
+
}), D = Et({
|
|
92
95
|
searchMode: i,
|
|
93
|
-
semanticSearchMode:
|
|
96
|
+
semanticSearchMode: u,
|
|
94
97
|
aiAssistantMode: a,
|
|
95
98
|
selectedView: n,
|
|
96
|
-
lastSearchMode:
|
|
97
|
-
setSelectedViewState:
|
|
98
|
-
setInputValue:
|
|
99
|
+
lastSearchMode: ze,
|
|
100
|
+
setSelectedViewState: T,
|
|
101
|
+
setInputValue: m
|
|
99
102
|
});
|
|
100
103
|
e.useEffect(() => {
|
|
101
104
|
const t = d.current;
|
|
102
105
|
if (!t)
|
|
103
106
|
return;
|
|
104
|
-
|
|
107
|
+
Q(t.offsetWidth);
|
|
105
108
|
const r = new ResizeObserver(() => {
|
|
106
|
-
t &&
|
|
109
|
+
t && Q(t.offsetWidth);
|
|
107
110
|
});
|
|
108
111
|
return r.observe(t), () => {
|
|
109
112
|
r.disconnect();
|
|
110
113
|
};
|
|
111
114
|
}, []);
|
|
112
|
-
const
|
|
115
|
+
const l = Ie || Pe, W = !n, $e = !(i != null && i.enabled) && !(u != null && u.enabled) && !(a != null && a.enabled), Ue = ce.sizeMap[K] || "md", Ke = ce.roundedMap[be] || "md", Me = xe || "solid", { emitSearchEvent: p } = Dt({
|
|
113
116
|
selectedView: n,
|
|
114
117
|
searchMode: i,
|
|
115
118
|
columns: A,
|
|
116
119
|
gridContext: g,
|
|
117
|
-
searchHistorySettings:
|
|
118
|
-
semanticSearchHistorySettings:
|
|
119
|
-
addToHistory:
|
|
120
|
-
onSearch:
|
|
121
|
-
onSemanticSearch:
|
|
122
|
-
}), { sendRequest: ee, cancelRequest: te } =
|
|
120
|
+
searchHistorySettings: Y,
|
|
121
|
+
semanticSearchHistorySettings: Z,
|
|
122
|
+
addToHistory: O,
|
|
123
|
+
onSearch: De,
|
|
124
|
+
onSemanticSearch: ye
|
|
125
|
+
}), { sendRequest: ee, cancelRequest: te } = Ct({
|
|
123
126
|
requestUrl: a == null ? void 0 : a.requestUrl,
|
|
124
127
|
requestOptions: a == null ? void 0 : a.requestOptions,
|
|
125
128
|
httpClient: a == null ? void 0 : a.httpClient,
|
|
126
129
|
columns: A,
|
|
127
|
-
gridState:
|
|
128
|
-
gridRef:
|
|
130
|
+
gridState: qe,
|
|
131
|
+
gridRef: Oe,
|
|
129
132
|
onPromptRequest: (t) => {
|
|
130
|
-
|
|
133
|
+
H == null || H({ requestData: t });
|
|
131
134
|
},
|
|
132
135
|
onResponseSuccess: (t) => {
|
|
133
|
-
|
|
136
|
+
v(!1), z == null || z({ response: t });
|
|
134
137
|
},
|
|
135
138
|
onResponseError: (t) => {
|
|
136
|
-
|
|
139
|
+
v(!1), N == null || N({ error: t });
|
|
137
140
|
},
|
|
138
|
-
onStateChange:
|
|
141
|
+
onStateChange: Ve,
|
|
139
142
|
onExportPdf: () => g == null ? void 0 : g.exportAsPdf()
|
|
140
143
|
});
|
|
141
144
|
e.useImperativeHandle(
|
|
142
|
-
|
|
145
|
+
fe,
|
|
143
146
|
() => ({
|
|
144
147
|
show: () => s(!0),
|
|
145
148
|
hide: () => s(!1)
|
|
146
149
|
}),
|
|
147
150
|
[s]
|
|
148
151
|
);
|
|
149
|
-
const G =
|
|
150
|
-
ne.current =
|
|
152
|
+
const G = yt(He, Ne), ne = e.useRef(p);
|
|
153
|
+
ne.current = p, e.useEffect(() => {
|
|
151
154
|
G !== null && ne.current(G);
|
|
152
155
|
}, [G]);
|
|
153
|
-
const
|
|
156
|
+
const je = e.useCallback(
|
|
154
157
|
(t) => {
|
|
155
158
|
const r = t.target.value;
|
|
156
|
-
|
|
159
|
+
m(r), s(!r), (n === "search" || n === "semanticSearch") && X(r);
|
|
157
160
|
},
|
|
158
161
|
[s, n]
|
|
159
|
-
),
|
|
162
|
+
), Je = e.useCallback(() => {
|
|
160
163
|
k == null || k(), o || s(!0);
|
|
161
|
-
}, [k, s, o]),
|
|
164
|
+
}, [k, s, o]), Qe = e.useCallback(
|
|
162
165
|
(t) => {
|
|
163
166
|
var le;
|
|
164
|
-
const r = d.current,
|
|
165
|
-
!
|
|
167
|
+
const r = d.current, c = (le = J.current) == null ? void 0 : le.element, B = t.relatedTarget, at = B && (r == null ? void 0 : r.contains(B)), st = B && (c == null ? void 0 : c.contains(B));
|
|
168
|
+
!at && !st && (b == null || b(), s(!1));
|
|
166
169
|
},
|
|
167
170
|
[b, s]
|
|
168
|
-
),
|
|
171
|
+
), Xe = e.useCallback(() => {
|
|
169
172
|
o || s(!0);
|
|
170
|
-
}, [s, o]), re = !!((ie = a == null ? void 0 : a.requestOptions) != null && ie.url || a != null && a.requestUrl),
|
|
171
|
-
if (
|
|
172
|
-
x == null || x(), te(),
|
|
173
|
+
}, [s, o]), re = !!((ie = a == null ? void 0 : a.requestOptions) != null && ie.url || a != null && a.requestUrl), $ = e.useCallback(() => {
|
|
174
|
+
if (l) {
|
|
175
|
+
x == null || x(), te(), v(!1);
|
|
173
176
|
return;
|
|
174
177
|
}
|
|
175
|
-
o.trim() && (re &&
|
|
178
|
+
o.trim() && (re && v(!0), O("aiAssistant", o, q), s(!1), ee(o.trim()), m(""));
|
|
176
179
|
}, [
|
|
177
|
-
|
|
180
|
+
l,
|
|
178
181
|
o,
|
|
179
|
-
T,
|
|
180
|
-
s,
|
|
181
182
|
q,
|
|
183
|
+
s,
|
|
184
|
+
O,
|
|
182
185
|
ee,
|
|
183
186
|
te,
|
|
184
187
|
re,
|
|
185
188
|
x
|
|
186
|
-
]),
|
|
189
|
+
]), Ye = e.useCallback(
|
|
187
190
|
(t) => {
|
|
188
|
-
t.key === "Enter" && (n === "aiAssistant" ?
|
|
191
|
+
t.key === "Enter" && (n === "aiAssistant" ? $() : n === "semanticSearch" && p(o));
|
|
189
192
|
},
|
|
190
|
-
[n, o,
|
|
191
|
-
),
|
|
193
|
+
[n, o, p, $]
|
|
194
|
+
), Ze = e.useCallback(() => {
|
|
192
195
|
var t;
|
|
193
|
-
s(!
|
|
194
|
-
}, [
|
|
196
|
+
s(!I), (t = S.current) == null || t.focus();
|
|
197
|
+
}, [I, s]), _e = e.useCallback(
|
|
195
198
|
(t) => {
|
|
196
199
|
var r;
|
|
197
|
-
t.stopPropagation(), t.preventDefault(),
|
|
200
|
+
t.stopPropagation(), t.preventDefault(), m(""), (r = S.current) == null || r.focus(), s(!0), p("");
|
|
198
201
|
},
|
|
199
|
-
[s,
|
|
202
|
+
[s, p]
|
|
200
203
|
), ae = e.useCallback(
|
|
201
204
|
(t) => {
|
|
202
205
|
var r;
|
|
203
|
-
|
|
206
|
+
T(t), m(""), X(null), (r = S.current) == null || r.focus();
|
|
204
207
|
},
|
|
205
|
-
[
|
|
206
|
-
),
|
|
208
|
+
[T]
|
|
209
|
+
), y = e.useCallback(
|
|
207
210
|
(t) => {
|
|
208
211
|
var r;
|
|
209
|
-
|
|
212
|
+
m(t), s(!1), (r = S.current) == null || r.focus(), n !== "aiAssistant" && p(t);
|
|
210
213
|
},
|
|
211
|
-
[n, s,
|
|
212
|
-
),
|
|
214
|
+
[n, s, p]
|
|
215
|
+
), Ae = e.useCallback((t) => {
|
|
213
216
|
if (t.isFinal && t.alternatives.length > 0) {
|
|
214
217
|
const r = t.alternatives[0].transcript;
|
|
215
|
-
|
|
218
|
+
m((c) => c ? `${c} ${r}` : r);
|
|
216
219
|
}
|
|
217
|
-
}, []),
|
|
220
|
+
}, []), et = e.useMemo(() => n === "aiAssistant" ? R.length === 0 && V.length === 0 : n === "search" || n === "semanticSearch" ? R.length === 0 && f.length === 0 : !1, [n, R.length, V.length, f.length]), se = e.useCallback(
|
|
218
221
|
(t) => {
|
|
219
|
-
const
|
|
220
|
-
|
|
222
|
+
const c = (n === "aiAssistant" ? w : E)[t];
|
|
223
|
+
c && y(c.text);
|
|
221
224
|
},
|
|
222
|
-
[n,
|
|
223
|
-
),
|
|
225
|
+
[n, w, E, y]
|
|
226
|
+
), tt = e.useCallback(
|
|
224
227
|
(t) => {
|
|
225
|
-
const r =
|
|
228
|
+
const r = f[t];
|
|
226
229
|
r && ae(r.mode);
|
|
227
230
|
},
|
|
228
|
-
[
|
|
231
|
+
[f, ae]
|
|
229
232
|
), oe = e.useMemo(
|
|
230
|
-
() =>
|
|
231
|
-
historyItemRender:
|
|
232
|
-
promptSuggestionRender:
|
|
233
|
-
handleListItemClick:
|
|
233
|
+
() => ht({
|
|
234
|
+
historyItemRender: j,
|
|
235
|
+
promptSuggestionRender: M,
|
|
236
|
+
handleListItemClick: y
|
|
234
237
|
}),
|
|
235
|
-
[
|
|
236
|
-
),
|
|
237
|
-
|
|
238
|
+
[j, M, y]
|
|
239
|
+
), nt = I && !$e, rt = () => /* @__PURE__ */ e.createElement(e.Fragment, null, D.items.length > 0 && /* @__PURE__ */ e.createElement(
|
|
240
|
+
lt,
|
|
238
241
|
{
|
|
239
|
-
items:
|
|
240
|
-
value:
|
|
241
|
-
onChange:
|
|
242
|
+
items: D.items,
|
|
243
|
+
value: D.value,
|
|
244
|
+
onChange: D.onChange,
|
|
242
245
|
size: K,
|
|
243
246
|
layoutMode: "stretch"
|
|
244
247
|
}
|
|
245
|
-
), (n === "search" || n === "semanticSearch") &&
|
|
246
|
-
|
|
248
|
+
), (n === "search" || n === "semanticSearch") && f.length > 0 && /* @__PURE__ */ e.createElement(
|
|
249
|
+
U,
|
|
247
250
|
{
|
|
248
|
-
data:
|
|
251
|
+
data: f,
|
|
249
252
|
textField: "text",
|
|
250
253
|
descriptionField: "description",
|
|
251
|
-
onClick:
|
|
252
|
-
itemRender:
|
|
254
|
+
onClick: tt,
|
|
255
|
+
itemRender: gt,
|
|
253
256
|
show: !0,
|
|
254
257
|
wrapperCssClass: "k-list k-list-md"
|
|
255
258
|
}
|
|
256
|
-
), n === "aiAssistant" &&
|
|
257
|
-
|
|
259
|
+
), n === "aiAssistant" && w.length > 0 && /* @__PURE__ */ e.createElement(
|
|
260
|
+
U,
|
|
258
261
|
{
|
|
259
|
-
data:
|
|
262
|
+
data: w,
|
|
260
263
|
textField: "text",
|
|
261
264
|
groupField: "group",
|
|
262
265
|
svgIconField: "groupSvgIcon",
|
|
263
266
|
descriptionField: "description",
|
|
264
267
|
onClick: se,
|
|
265
268
|
itemRender: oe,
|
|
266
|
-
groupHeaderItemRender:
|
|
269
|
+
groupHeaderItemRender: pe,
|
|
267
270
|
showFirstGroupHeader: !0,
|
|
268
271
|
show: !0,
|
|
269
272
|
wrapperCssClass: "k-list k-list-md"
|
|
270
273
|
}
|
|
271
|
-
), (n === "search" || n === "semanticSearch") &&
|
|
272
|
-
|
|
274
|
+
), (n === "search" || n === "semanticSearch") && E.length > 0 && /* @__PURE__ */ e.createElement(
|
|
275
|
+
U,
|
|
273
276
|
{
|
|
274
|
-
data:
|
|
277
|
+
data: E,
|
|
275
278
|
textField: "text",
|
|
276
279
|
groupField: "group",
|
|
277
280
|
svgIconField: "groupSvgIcon",
|
|
278
281
|
descriptionField: "description",
|
|
279
282
|
onClick: se,
|
|
280
283
|
itemRender: oe,
|
|
281
|
-
groupHeaderItemRender:
|
|
284
|
+
groupHeaderItemRender: pe,
|
|
282
285
|
showFirstGroupHeader: !0,
|
|
283
286
|
show: !0,
|
|
284
287
|
wrapperCssClass: "k-list k-list-md"
|
|
285
288
|
}
|
|
286
|
-
),
|
|
287
|
-
return /* @__PURE__ */ e.createElement("div", { ref: d, className: "k-smart-box-wrapper", dir:
|
|
289
|
+
), et && /* @__PURE__ */ e.createElement(St, { selectedView: n }));
|
|
290
|
+
return /* @__PURE__ */ e.createElement("div", { ref: d, className: "k-smart-box-wrapper", dir: ke, onBlur: Qe }, /* @__PURE__ */ e.createElement(
|
|
288
291
|
"span",
|
|
289
292
|
{
|
|
290
|
-
className:
|
|
291
|
-
"k-
|
|
292
|
-
|
|
293
|
+
className: L(
|
|
294
|
+
"k-smart-box",
|
|
295
|
+
"k-input",
|
|
296
|
+
`k-input-${Ue}`,
|
|
297
|
+
`k-rounded-${Ke}`,
|
|
298
|
+
`k-input-${Me}`,
|
|
299
|
+
{
|
|
300
|
+
"k-loading": l
|
|
301
|
+
}
|
|
302
|
+
)
|
|
293
303
|
},
|
|
294
304
|
!W && /* @__PURE__ */ e.createElement("span", { className: "k-input-prefix k-input-prefix-horizontal" }, /* @__PURE__ */ e.createElement(
|
|
295
|
-
|
|
305
|
+
ue,
|
|
296
306
|
{
|
|
297
|
-
className:
|
|
307
|
+
className: L({
|
|
298
308
|
"k-accent-icon": n === "aiAssistant" || n === "semanticSearch"
|
|
299
309
|
}),
|
|
300
|
-
icon:
|
|
301
|
-
|
|
310
|
+
icon: Ge.svgIcon,
|
|
311
|
+
"aria-hidden": !0,
|
|
312
|
+
onClick: Ze,
|
|
302
313
|
onMouseDown: (t) => {
|
|
303
314
|
"preventDefault" in t && t.preventDefault();
|
|
304
315
|
}
|
|
@@ -309,78 +320,83 @@ const It = e.forwardRef((me, de) => {
|
|
|
309
320
|
{
|
|
310
321
|
ref: S,
|
|
311
322
|
type: "text",
|
|
312
|
-
className:
|
|
313
|
-
id:
|
|
314
|
-
placeholder:
|
|
323
|
+
className: L("k-input-inner", { "k-disabled": W }),
|
|
324
|
+
id: Le.current,
|
|
325
|
+
placeholder: We,
|
|
315
326
|
value: o,
|
|
316
327
|
disabled: W,
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
328
|
+
role: "combobox",
|
|
329
|
+
"aria-haspopup": "listbox",
|
|
330
|
+
"aria-expanded": I ? "true" : "false",
|
|
331
|
+
"aria-label": Be,
|
|
332
|
+
onChange: je,
|
|
333
|
+
onFocus: Je,
|
|
334
|
+
onClick: Xe,
|
|
335
|
+
onKeyDown: Ye
|
|
321
336
|
}
|
|
322
337
|
),
|
|
323
338
|
o.length > 0 && (n === "search" || n === "semanticSearch") && /* @__PURE__ */ e.createElement(
|
|
324
339
|
"span",
|
|
325
340
|
{
|
|
326
341
|
className: "k-clear-value",
|
|
327
|
-
title:
|
|
328
|
-
|
|
329
|
-
C[
|
|
342
|
+
title: h.toLanguageString(
|
|
343
|
+
me,
|
|
344
|
+
C[me]
|
|
330
345
|
),
|
|
331
346
|
role: "button",
|
|
332
347
|
tabIndex: -1,
|
|
333
|
-
onClick:
|
|
348
|
+
onClick: _e,
|
|
334
349
|
onMouseDown: (t) => t.preventDefault()
|
|
335
350
|
},
|
|
336
|
-
/* @__PURE__ */ e.createElement(
|
|
351
|
+
/* @__PURE__ */ e.createElement(ue, { className: "k-icon", icon: ct })
|
|
337
352
|
),
|
|
338
|
-
n === "aiAssistant" && /* @__PURE__ */ e.createElement("span", { className: "k-input-suffix k-input-suffix-horizontal" },
|
|
339
|
-
|
|
353
|
+
n === "aiAssistant" && /* @__PURE__ */ e.createElement("span", { className: "k-input-suffix k-input-suffix-horizontal" }, _ && /* @__PURE__ */ e.createElement(
|
|
354
|
+
ot,
|
|
340
355
|
{
|
|
341
|
-
...
|
|
342
|
-
"aria-label":
|
|
356
|
+
..._,
|
|
357
|
+
"aria-label": h.toLanguageString(
|
|
343
358
|
P,
|
|
344
359
|
C[P]
|
|
345
360
|
),
|
|
346
|
-
title:
|
|
361
|
+
title: h.toLanguageString(
|
|
347
362
|
P,
|
|
348
363
|
C[P]
|
|
349
364
|
),
|
|
350
|
-
onResult:
|
|
365
|
+
onResult: Ae
|
|
351
366
|
}
|
|
352
367
|
), /* @__PURE__ */ e.createElement(
|
|
353
|
-
|
|
368
|
+
it,
|
|
354
369
|
{
|
|
355
|
-
className:
|
|
356
|
-
"k-processing":
|
|
357
|
-
"k-active":
|
|
370
|
+
className: L("k-smart-box-send", {
|
|
371
|
+
"k-processing": l,
|
|
372
|
+
"k-active": l
|
|
358
373
|
}),
|
|
359
374
|
type: "button",
|
|
360
375
|
rounded: "full",
|
|
361
376
|
size: "small",
|
|
362
|
-
title:
|
|
363
|
-
|
|
364
|
-
C[
|
|
377
|
+
title: h.toLanguageString(
|
|
378
|
+
F,
|
|
379
|
+
C[F]
|
|
365
380
|
),
|
|
366
|
-
"aria-label":
|
|
367
|
-
|
|
368
|
-
C[
|
|
381
|
+
"aria-label": h.toLanguageString(
|
|
382
|
+
F,
|
|
383
|
+
C[F]
|
|
369
384
|
),
|
|
370
|
-
"aria-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
385
|
+
"aria-pressed": l ? "true" : void 0,
|
|
386
|
+
"aria-disabled": !l && o.length === 0 || void 0,
|
|
387
|
+
svgIcon: l ? ut : pt,
|
|
388
|
+
disabled: o.length === 0 && !l,
|
|
389
|
+
onClick: $
|
|
374
390
|
}
|
|
375
391
|
))
|
|
376
392
|
), /* @__PURE__ */ e.createElement(
|
|
377
|
-
|
|
393
|
+
ft,
|
|
378
394
|
{
|
|
379
|
-
ref:
|
|
395
|
+
ref: J,
|
|
380
396
|
anchor: d.current,
|
|
381
|
-
show:
|
|
397
|
+
show: nt,
|
|
382
398
|
popupClass: "k-smart-box-popup",
|
|
383
|
-
style: { width:
|
|
399
|
+
style: { width: Fe },
|
|
384
400
|
anchorAlign: { horizontal: "left", vertical: "bottom" },
|
|
385
401
|
popupAlign: { horizontal: "left", vertical: "top" },
|
|
386
402
|
margin: { horizontal: 0, vertical: 2 },
|
|
@@ -389,10 +405,10 @@ const It = e.forwardRef((me, de) => {
|
|
|
389
405
|
d.current && !d.current.contains(r) && s(!1);
|
|
390
406
|
}
|
|
391
407
|
},
|
|
392
|
-
|
|
408
|
+
rt()
|
|
393
409
|
));
|
|
394
410
|
});
|
|
395
|
-
|
|
411
|
+
Bt.displayName = "KendoReactSmartBox";
|
|
396
412
|
export {
|
|
397
|
-
|
|
413
|
+
Bt as SmartBox
|
|
398
414
|
};
|
|
@@ -296,6 +296,18 @@ export interface GridSmartBoxAIAssistantProps extends Omit<GridSmartBoxAIAssista
|
|
|
296
296
|
* ```
|
|
297
297
|
*/
|
|
298
298
|
size?: 'small' | 'medium' | 'large';
|
|
299
|
+
/**
|
|
300
|
+
* Sets the border radius of the SmartBox.
|
|
301
|
+
*
|
|
302
|
+
* @default 'medium'
|
|
303
|
+
*/
|
|
304
|
+
rounded?: 'none' | 'small' | 'medium' | 'large' | 'full';
|
|
305
|
+
/**
|
|
306
|
+
* Sets the fill mode of the SmartBox.
|
|
307
|
+
*
|
|
308
|
+
* @default 'solid'
|
|
309
|
+
*/
|
|
310
|
+
fillMode?: 'solid' | 'flat' | 'outline';
|
|
299
311
|
/**
|
|
300
312
|
* Sets whether the SmartBox is in loading state.
|
|
301
313
|
* Use this for controlled mode to manage loading state externally.
|
|
@@ -465,5 +477,14 @@ export interface GridSmartBoxAIAssistantProps extends Omit<GridSmartBoxAIAssista
|
|
|
465
477
|
* ```
|
|
466
478
|
*/
|
|
467
479
|
onAICancelRequest?: () => void;
|
|
480
|
+
/**
|
|
481
|
+
* Sets the accessible label (`aria-label`) for the SmartBox input element.
|
|
482
|
+
*
|
|
483
|
+
* @example
|
|
484
|
+
* ```tsx
|
|
485
|
+
* <SmartBox ariaLabel="AI-powered search" />
|
|
486
|
+
* ```
|
|
487
|
+
*/
|
|
488
|
+
ariaLabel?: string;
|
|
468
489
|
}
|
|
469
490
|
export {};
|