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