@progress/kendo-react-grid 14.1.2-develop.1 → 14.2.0-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/GridComponent.js +1 -1
- package/GridComponent.mjs +1 -1
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/interfaces/GridCellsSettings.d.ts +4 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +1 -1
- package/package.json +17 -17
- package/toolbar-tools/smartbox/SmartBox.js +1 -1
- package/toolbar-tools/smartbox/SmartBox.mjs +166 -157
- package/utils/index.js +1 -1
- package/utils/index.mjs +1 -1
|
@@ -8,15 +8,15 @@
|
|
|
8
8
|
import * as e from "react";
|
|
9
9
|
import { SegmentedControl as et } from "./SegmentedControl.mjs";
|
|
10
10
|
import { SpeechToTextButton as tt, Button as nt } from "@progress/kendo-react-buttons";
|
|
11
|
-
import { xIcon as rt, stopSmIcon as
|
|
12
|
-
import { guid as ot, kendoThemeMaps as it, classNames as
|
|
11
|
+
import { xIcon as rt, stopSmIcon as st, arrowUpOutlineIcon as at } from "@progress/kendo-svg-icons";
|
|
12
|
+
import { guid as ot, kendoThemeMaps as it, classNames as B, IconWrap as ce } from "@progress/kendo-react-common";
|
|
13
13
|
import { useLocalization as lt } from "@progress/kendo-react-intl";
|
|
14
14
|
import { useGridAIRequest as ct } from "../../hooks/useGridAIRequest.mjs";
|
|
15
15
|
import { GridContext as ut } from "../../utils/GridContext.mjs";
|
|
16
16
|
import { List as U } from "@progress/kendo-react-dropdowns";
|
|
17
17
|
import { Popup as pt } from "@progress/kendo-react-popup";
|
|
18
|
-
import { createListItemRender as mt, searchModeItemRender as dt, listGroupHeaderRender as
|
|
19
|
-
import { smartBoxClearTitle as
|
|
18
|
+
import { createListItemRender as mt, searchModeItemRender as dt, listGroupHeaderRender as ue, NoDataRender as ft } from "./listItemRenders.mjs";
|
|
19
|
+
import { smartBoxClearTitle as pe, messages as k, smartBoxSpeechToTextButton as y, smartBoxSubmitPromptButton as P } from "../../messages/index.mjs";
|
|
20
20
|
import { useSmartBoxModes as ht } from "./hooks/useSmartBoxModes.mjs";
|
|
21
21
|
import { useSmartBoxHistory as gt } from "./hooks/useSmartBoxHistory.mjs";
|
|
22
22
|
import { useSmartBoxPopup as St } from "./hooks/useSmartBoxPopup.mjs";
|
|
@@ -26,205 +26,214 @@ import { useSmartBoxListData as bt } from "./hooks/useSmartBoxListData.mjs";
|
|
|
26
26
|
import { useSmartBoxSegmentedControl as xt } from "./hooks/useSmartBoxSegmentedControl.mjs";
|
|
27
27
|
import { useSmartBoxSearch as Rt } from "./hooks/useSmartBoxSearch.mjs";
|
|
28
28
|
import { useDebounce as It } from "./hooks/useDebounce.mjs";
|
|
29
|
-
const vt = e.forwardRef((
|
|
30
|
-
var
|
|
29
|
+
const vt = e.forwardRef((me, de) => {
|
|
30
|
+
var ie;
|
|
31
31
|
const {
|
|
32
|
-
searchConfig:
|
|
33
|
-
semanticSearchConfig:
|
|
34
|
-
aiAssistantConfig:
|
|
35
|
-
activeMode:
|
|
36
|
-
dir:
|
|
32
|
+
searchConfig: fe,
|
|
33
|
+
semanticSearchConfig: he,
|
|
34
|
+
aiAssistantConfig: ge,
|
|
35
|
+
activeMode: Se,
|
|
36
|
+
dir: ke = "ltr",
|
|
37
37
|
size: $ = "medium",
|
|
38
|
-
placeholder:
|
|
39
|
-
history:
|
|
40
|
-
loading:
|
|
38
|
+
placeholder: Ce,
|
|
39
|
+
history: be,
|
|
40
|
+
loading: xe = !1,
|
|
41
41
|
promptSuggestionRender: K,
|
|
42
42
|
historyItemRender: j,
|
|
43
|
-
onOpen:
|
|
44
|
-
onClose:
|
|
45
|
-
onFocus:
|
|
46
|
-
onBlur:
|
|
47
|
-
onSearch:
|
|
48
|
-
onSemanticSearch:
|
|
49
|
-
onAIPromptRequest:
|
|
50
|
-
onAIResponseSuccess:
|
|
51
|
-
onAIResponseError:
|
|
52
|
-
onAICancelRequest:
|
|
53
|
-
} =
|
|
43
|
+
onOpen: Re,
|
|
44
|
+
onClose: Ie,
|
|
45
|
+
onFocus: C,
|
|
46
|
+
onBlur: b,
|
|
47
|
+
onSearch: ve,
|
|
48
|
+
onSemanticSearch: we,
|
|
49
|
+
onAIPromptRequest: L,
|
|
50
|
+
onAIResponseSuccess: F,
|
|
51
|
+
onAIResponseError: H,
|
|
52
|
+
onAICancelRequest: x
|
|
53
|
+
} = me, h = lt(), g = e.useContext(ut), Ee = e.useRef(`k-${ot()}`), d = e.useRef(null), S = e.useRef(null), J = e.useRef(null), [o, p] = e.useState(""), [De, R] = e.useState(!1), [Be, Q] = e.useState(void 0), [ye, X] = e.useState(null), {
|
|
54
54
|
searchMode: i,
|
|
55
55
|
semanticSearchMode: c,
|
|
56
|
-
aiAssistantMode:
|
|
56
|
+
aiAssistantMode: s,
|
|
57
57
|
selectedView: n,
|
|
58
58
|
setSelectedViewState: z,
|
|
59
59
|
lastSearchMode: Pe,
|
|
60
|
-
searchHistorySettings:
|
|
61
|
-
semanticSearchHistorySettings:
|
|
62
|
-
aiAssistantHistorySettings:
|
|
63
|
-
speechToTextButtonSettings:
|
|
60
|
+
searchHistorySettings: Y,
|
|
61
|
+
semanticSearchHistorySettings: Z,
|
|
62
|
+
aiAssistantHistorySettings: N,
|
|
63
|
+
speechToTextButtonSettings: _,
|
|
64
64
|
currentSearchDelay: Le
|
|
65
65
|
} = ht({
|
|
66
|
-
searchConfigProp:
|
|
67
|
-
semanticSearchConfigProp:
|
|
68
|
-
aiAssistantConfigProp:
|
|
69
|
-
activeModeProp:
|
|
70
|
-
sharedHistory:
|
|
71
|
-
}), { currentHistory:
|
|
66
|
+
searchConfigProp: fe,
|
|
67
|
+
semanticSearchConfigProp: he,
|
|
68
|
+
aiAssistantConfigProp: ge,
|
|
69
|
+
activeModeProp: Se,
|
|
70
|
+
sharedHistory: be
|
|
71
|
+
}), { currentHistory: I, currentHistorySettings: Fe, addToHistory: T } = gt({
|
|
72
72
|
selectedView: n,
|
|
73
|
-
searchHistorySettings:
|
|
74
|
-
semanticSearchHistorySettings:
|
|
75
|
-
aiAssistantHistorySettings:
|
|
76
|
-
}), { isOpen:
|
|
77
|
-
() => (
|
|
78
|
-
[
|
|
73
|
+
searchHistorySettings: Y,
|
|
74
|
+
semanticSearchHistorySettings: Z,
|
|
75
|
+
aiAssistantHistorySettings: N
|
|
76
|
+
}), { isOpen: q, togglePopup: a } = St({ onOpen: Re, onClose: Ie }), { columns: A, gridState: He, gridRef: ze, handleStateChange: Ne } = kt(g), O = e.useMemo(
|
|
77
|
+
() => (s == null ? void 0 : s.promptSuggestions) || [],
|
|
78
|
+
[s == null ? void 0 : s.promptSuggestions]
|
|
79
79
|
), { inputPlaceholder: Te, prefixIcon: qe } = Ct({
|
|
80
80
|
selectedView: n,
|
|
81
81
|
searchMode: i,
|
|
82
82
|
semanticSearchMode: c,
|
|
83
|
-
aiAssistantMode:
|
|
84
|
-
sharedPlaceholder:
|
|
85
|
-
}), { searchListData: f, aiAssistantListData:
|
|
83
|
+
aiAssistantMode: s,
|
|
84
|
+
sharedPlaceholder: Ce
|
|
85
|
+
}), { searchListData: f, aiAssistantListData: v, searchHistoryListData: w } = bt({
|
|
86
86
|
selectedView: n,
|
|
87
87
|
searchModeEnabled: i == null ? void 0 : i.enabled,
|
|
88
88
|
semanticSearchModeEnabled: c == null ? void 0 : c.enabled,
|
|
89
|
-
promptSuggestions:
|
|
90
|
-
currentHistory:
|
|
89
|
+
promptSuggestions: O,
|
|
90
|
+
currentHistory: I,
|
|
91
91
|
currentHistorySettings: Fe
|
|
92
|
-
}),
|
|
92
|
+
}), M = xt({
|
|
93
93
|
searchMode: i,
|
|
94
94
|
semanticSearchMode: c,
|
|
95
|
-
aiAssistantMode:
|
|
95
|
+
aiAssistantMode: s,
|
|
96
96
|
selectedView: n,
|
|
97
97
|
lastSearchMode: Pe,
|
|
98
98
|
setSelectedViewState: z,
|
|
99
|
-
setInputValue:
|
|
99
|
+
setInputValue: p
|
|
100
100
|
});
|
|
101
101
|
e.useEffect(() => {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
const t = d.current;
|
|
103
|
+
if (!t)
|
|
104
|
+
return;
|
|
105
|
+
Q(t.offsetWidth);
|
|
106
|
+
const r = new ResizeObserver(() => {
|
|
107
|
+
t && Q(t.offsetWidth);
|
|
108
|
+
});
|
|
109
|
+
return r.observe(t), () => {
|
|
110
|
+
r.disconnect();
|
|
111
|
+
};
|
|
112
|
+
}, []);
|
|
113
|
+
const m = xe || De, V = !n, Oe = !(i != null && i.enabled) && !(c != null && c.enabled) && !(s != null && s.enabled), Ve = it.sizeMap[$] || "md", { emitSearchEvent: u } = Rt({
|
|
105
114
|
selectedView: n,
|
|
106
115
|
searchMode: i,
|
|
107
|
-
columns:
|
|
116
|
+
columns: A,
|
|
108
117
|
gridContext: g,
|
|
109
|
-
searchHistorySettings:
|
|
110
|
-
semanticSearchHistorySettings:
|
|
111
|
-
addToHistory:
|
|
112
|
-
onSearch:
|
|
113
|
-
onSemanticSearch:
|
|
114
|
-
}), { sendRequest:
|
|
115
|
-
requestUrl:
|
|
116
|
-
requestOptions:
|
|
117
|
-
columns:
|
|
118
|
+
searchHistorySettings: Y,
|
|
119
|
+
semanticSearchHistorySettings: Z,
|
|
120
|
+
addToHistory: T,
|
|
121
|
+
onSearch: ve,
|
|
122
|
+
onSemanticSearch: we
|
|
123
|
+
}), { sendRequest: ee, cancelRequest: te } = ct({
|
|
124
|
+
requestUrl: s == null ? void 0 : s.requestUrl,
|
|
125
|
+
requestOptions: s == null ? void 0 : s.requestOptions,
|
|
126
|
+
columns: A,
|
|
118
127
|
gridState: He,
|
|
119
|
-
gridRef:
|
|
128
|
+
gridRef: ze,
|
|
120
129
|
onPromptRequest: (t) => {
|
|
121
|
-
|
|
130
|
+
L == null || L({ requestData: t });
|
|
122
131
|
},
|
|
123
132
|
onResponseSuccess: (t) => {
|
|
124
|
-
|
|
133
|
+
R(!1), F == null || F({ response: t });
|
|
125
134
|
},
|
|
126
135
|
onResponseError: (t) => {
|
|
127
|
-
|
|
136
|
+
R(!1), H == null || H({ error: t });
|
|
128
137
|
},
|
|
129
|
-
onStateChange:
|
|
138
|
+
onStateChange: Ne,
|
|
130
139
|
onExportPdf: () => g == null ? void 0 : g.exportAsPdf()
|
|
131
140
|
});
|
|
132
141
|
e.useImperativeHandle(
|
|
133
|
-
|
|
142
|
+
de,
|
|
134
143
|
() => ({
|
|
135
|
-
show: () =>
|
|
136
|
-
hide: () =>
|
|
144
|
+
show: () => a(!0),
|
|
145
|
+
hide: () => a(!1)
|
|
137
146
|
}),
|
|
138
|
-
[
|
|
147
|
+
[a]
|
|
139
148
|
);
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}, [
|
|
144
|
-
const
|
|
149
|
+
const W = It(ye, Le), ne = e.useRef(u);
|
|
150
|
+
ne.current = u, e.useEffect(() => {
|
|
151
|
+
W !== null && ne.current(W);
|
|
152
|
+
}, [W]);
|
|
153
|
+
const We = e.useCallback(
|
|
145
154
|
(t) => {
|
|
146
155
|
const r = t.target.value;
|
|
147
|
-
|
|
156
|
+
p(r), a(!r), (n === "search" || n === "semanticSearch") && X(r);
|
|
148
157
|
},
|
|
149
|
-
[
|
|
150
|
-
),
|
|
151
|
-
|
|
152
|
-
}, [
|
|
158
|
+
[a, n]
|
|
159
|
+
), Ge = e.useCallback(() => {
|
|
160
|
+
C == null || C(), o || a(!0);
|
|
161
|
+
}, [C, a, o]), Ue = e.useCallback(
|
|
153
162
|
(t) => {
|
|
154
|
-
var
|
|
155
|
-
const r =
|
|
156
|
-
!Ae && !Me && (
|
|
163
|
+
var le;
|
|
164
|
+
const r = d.current, l = (le = J.current) == null ? void 0 : le.element, D = t.relatedTarget, Ae = D && (r == null ? void 0 : r.contains(D)), Me = D && (l == null ? void 0 : l.contains(D));
|
|
165
|
+
!Ae && !Me && (b == null || b(), a(!1));
|
|
157
166
|
},
|
|
158
|
-
[
|
|
167
|
+
[b, a]
|
|
159
168
|
), $e = e.useCallback(() => {
|
|
160
|
-
o ||
|
|
161
|
-
}, [
|
|
162
|
-
if (
|
|
163
|
-
|
|
169
|
+
o || a(!0);
|
|
170
|
+
}, [a, o]), re = !!((ie = s == null ? void 0 : s.requestOptions) != null && ie.url || s != null && s.requestUrl), G = e.useCallback(() => {
|
|
171
|
+
if (m) {
|
|
172
|
+
x == null || x(), te(), R(!1);
|
|
164
173
|
return;
|
|
165
174
|
}
|
|
166
|
-
o.trim() && (
|
|
175
|
+
o.trim() && (re && R(!0), T("aiAssistant", o, N), a(!1), ee(o.trim()), p(""));
|
|
167
176
|
}, [
|
|
168
|
-
|
|
177
|
+
m,
|
|
169
178
|
o,
|
|
179
|
+
N,
|
|
180
|
+
a,
|
|
170
181
|
T,
|
|
171
|
-
s,
|
|
172
|
-
q,
|
|
173
|
-
M,
|
|
174
182
|
ee,
|
|
175
|
-
|
|
176
|
-
|
|
183
|
+
te,
|
|
184
|
+
re,
|
|
185
|
+
x
|
|
177
186
|
]), Ke = e.useCallback(
|
|
178
187
|
(t) => {
|
|
179
|
-
t.key === "Enter" && (n === "aiAssistant" ?
|
|
188
|
+
t.key === "Enter" && (n === "aiAssistant" ? G() : n === "semanticSearch" && u(o));
|
|
180
189
|
},
|
|
181
|
-
[n, o, u,
|
|
190
|
+
[n, o, u, G]
|
|
182
191
|
), je = e.useCallback(() => {
|
|
183
192
|
var t;
|
|
184
|
-
|
|
185
|
-
}, [
|
|
193
|
+
a(!q), (t = S.current) == null || t.focus();
|
|
194
|
+
}, [q, a]), Je = e.useCallback(
|
|
186
195
|
(t) => {
|
|
187
196
|
var r;
|
|
188
|
-
t.stopPropagation(), t.preventDefault(),
|
|
197
|
+
t.stopPropagation(), t.preventDefault(), p(""), (r = S.current) == null || r.focus(), a(!0), u("");
|
|
189
198
|
},
|
|
190
|
-
[
|
|
191
|
-
),
|
|
199
|
+
[a, u]
|
|
200
|
+
), se = e.useCallback(
|
|
192
201
|
(t) => {
|
|
193
202
|
var r;
|
|
194
|
-
z(t),
|
|
203
|
+
z(t), p(""), X(null), (r = S.current) == null || r.focus();
|
|
195
204
|
},
|
|
196
205
|
[z]
|
|
197
|
-
),
|
|
206
|
+
), E = e.useCallback(
|
|
198
207
|
(t) => {
|
|
199
208
|
var r;
|
|
200
|
-
|
|
209
|
+
p(t), a(!1), (r = S.current) == null || r.focus(), n !== "aiAssistant" && u(t);
|
|
201
210
|
},
|
|
202
|
-
[n,
|
|
211
|
+
[n, a, u]
|
|
203
212
|
), Qe = e.useCallback((t) => {
|
|
204
213
|
if (t.isFinal && t.alternatives.length > 0) {
|
|
205
214
|
const r = t.alternatives[0].transcript;
|
|
206
|
-
|
|
215
|
+
p((l) => l ? `${l} ${r}` : r);
|
|
207
216
|
}
|
|
208
|
-
}, []), Xe = e.useMemo(() => n === "aiAssistant" ?
|
|
217
|
+
}, []), Xe = e.useMemo(() => n === "aiAssistant" ? I.length === 0 && O.length === 0 : n === "search" || n === "semanticSearch" ? I.length === 0 && f.length === 0 : !1, [n, I.length, O.length, f.length]), ae = e.useCallback(
|
|
209
218
|
(t) => {
|
|
210
|
-
const l = (n === "aiAssistant" ?
|
|
211
|
-
l &&
|
|
219
|
+
const l = (n === "aiAssistant" ? v : w)[t];
|
|
220
|
+
l && E(l.text);
|
|
212
221
|
},
|
|
213
|
-
[n,
|
|
222
|
+
[n, v, w, E]
|
|
214
223
|
), Ye = e.useCallback(
|
|
215
224
|
(t) => {
|
|
216
225
|
const r = f[t];
|
|
217
|
-
r &&
|
|
226
|
+
r && se(r.mode);
|
|
218
227
|
},
|
|
219
|
-
[f,
|
|
220
|
-
),
|
|
228
|
+
[f, se]
|
|
229
|
+
), oe = e.useMemo(
|
|
221
230
|
() => mt({
|
|
222
231
|
historyItemRender: j,
|
|
223
232
|
promptSuggestionRender: K,
|
|
224
|
-
handleListItemClick:
|
|
233
|
+
handleListItemClick: E
|
|
225
234
|
}),
|
|
226
|
-
[j, K,
|
|
227
|
-
), Ze =
|
|
235
|
+
[j, K, E]
|
|
236
|
+
), Ze = q && !Oe, _e = () => /* @__PURE__ */ e.createElement(e.Fragment, null, M.length > 0 && /* @__PURE__ */ e.createElement(et, { buttons: M, size: $, stretched: !0 }), (n === "search" || n === "semanticSearch") && f.length > 0 && /* @__PURE__ */ e.createElement(
|
|
228
237
|
U,
|
|
229
238
|
{
|
|
230
239
|
data: f,
|
|
@@ -235,17 +244,17 @@ const vt = e.forwardRef((pe, me) => {
|
|
|
235
244
|
show: !0,
|
|
236
245
|
wrapperCssClass: "k-list k-list-md"
|
|
237
246
|
}
|
|
238
|
-
), n === "aiAssistant" &&
|
|
247
|
+
), n === "aiAssistant" && v.length > 0 && /* @__PURE__ */ e.createElement(
|
|
239
248
|
U,
|
|
240
249
|
{
|
|
241
|
-
data:
|
|
250
|
+
data: v,
|
|
242
251
|
textField: "text",
|
|
243
252
|
groupField: "group",
|
|
244
253
|
svgIconField: "groupSvgIcon",
|
|
245
254
|
descriptionField: "description",
|
|
246
255
|
onClick: ae,
|
|
247
|
-
itemRender:
|
|
248
|
-
groupHeaderItemRender:
|
|
256
|
+
itemRender: oe,
|
|
257
|
+
groupHeaderItemRender: ue,
|
|
249
258
|
showFirstGroupHeader: !0,
|
|
250
259
|
show: !0,
|
|
251
260
|
wrapperCssClass: "k-list k-list-md"
|
|
@@ -259,24 +268,24 @@ const vt = e.forwardRef((pe, me) => {
|
|
|
259
268
|
svgIconField: "groupSvgIcon",
|
|
260
269
|
descriptionField: "description",
|
|
261
270
|
onClick: ae,
|
|
262
|
-
itemRender:
|
|
263
|
-
groupHeaderItemRender:
|
|
271
|
+
itemRender: oe,
|
|
272
|
+
groupHeaderItemRender: ue,
|
|
264
273
|
showFirstGroupHeader: !0,
|
|
265
274
|
show: !0,
|
|
266
275
|
wrapperCssClass: "k-list k-list-md"
|
|
267
276
|
}
|
|
268
277
|
), Xe && /* @__PURE__ */ e.createElement(ft, { selectedView: n }));
|
|
269
|
-
return /* @__PURE__ */ e.createElement("div", { ref:
|
|
278
|
+
return /* @__PURE__ */ e.createElement("div", { ref: d, className: "k-smart-box-wrapper", dir: ke, onBlur: Ue }, /* @__PURE__ */ e.createElement(
|
|
270
279
|
"span",
|
|
271
280
|
{
|
|
272
|
-
className:
|
|
273
|
-
"k-loading":
|
|
281
|
+
className: B("k-smart-box", "k-input", `k-input-${Ve}`, {
|
|
282
|
+
"k-loading": m
|
|
274
283
|
})
|
|
275
284
|
},
|
|
276
|
-
!
|
|
277
|
-
|
|
285
|
+
!V && /* @__PURE__ */ e.createElement("span", { className: "k-input-prefix k-input-prefix-horizontal" }, /* @__PURE__ */ e.createElement(
|
|
286
|
+
ce,
|
|
278
287
|
{
|
|
279
|
-
className:
|
|
288
|
+
className: B("k-icon", {
|
|
280
289
|
"k-accent-icon": n === "aiAssistant" || n === "semanticSearch"
|
|
281
290
|
}),
|
|
282
291
|
icon: qe.svgIcon,
|
|
@@ -291,13 +300,13 @@ const vt = e.forwardRef((pe, me) => {
|
|
|
291
300
|
{
|
|
292
301
|
ref: S,
|
|
293
302
|
type: "text",
|
|
294
|
-
className:
|
|
303
|
+
className: B("k-input-inner", { "k-disabled": V }),
|
|
295
304
|
id: Ee.current,
|
|
296
305
|
placeholder: Te,
|
|
297
306
|
value: o,
|
|
298
|
-
disabled:
|
|
299
|
-
onChange:
|
|
300
|
-
onFocus:
|
|
307
|
+
disabled: V,
|
|
308
|
+
onChange: We,
|
|
309
|
+
onFocus: Ge,
|
|
301
310
|
onClick: $e,
|
|
302
311
|
onKeyDown: Ke
|
|
303
312
|
}
|
|
@@ -307,68 +316,68 @@ const vt = e.forwardRef((pe, me) => {
|
|
|
307
316
|
{
|
|
308
317
|
className: "k-clear-value",
|
|
309
318
|
title: h.toLanguageString(
|
|
310
|
-
|
|
311
|
-
|
|
319
|
+
pe,
|
|
320
|
+
k[pe]
|
|
312
321
|
),
|
|
313
322
|
role: "button",
|
|
314
323
|
tabIndex: -1,
|
|
315
324
|
onClick: Je,
|
|
316
325
|
onMouseDown: (t) => t.preventDefault()
|
|
317
326
|
},
|
|
318
|
-
/* @__PURE__ */ e.createElement(
|
|
327
|
+
/* @__PURE__ */ e.createElement(ce, { className: "k-icon", icon: rt })
|
|
319
328
|
),
|
|
320
|
-
n === "aiAssistant" && /* @__PURE__ */ e.createElement("span", { className: "k-input-suffix k-input-suffix-horizontal" },
|
|
329
|
+
n === "aiAssistant" && /* @__PURE__ */ e.createElement("span", { className: "k-input-suffix k-input-suffix-horizontal" }, _ && /* @__PURE__ */ e.createElement(
|
|
321
330
|
tt,
|
|
322
331
|
{
|
|
323
|
-
...
|
|
332
|
+
..._,
|
|
324
333
|
"aria-label": h.toLanguageString(
|
|
325
|
-
|
|
326
|
-
|
|
334
|
+
y,
|
|
335
|
+
k[y]
|
|
327
336
|
),
|
|
328
337
|
title: h.toLanguageString(
|
|
329
|
-
|
|
330
|
-
|
|
338
|
+
y,
|
|
339
|
+
k[y]
|
|
331
340
|
),
|
|
332
341
|
onResult: Qe
|
|
333
342
|
}
|
|
334
343
|
), /* @__PURE__ */ e.createElement(
|
|
335
344
|
nt,
|
|
336
345
|
{
|
|
337
|
-
className:
|
|
338
|
-
"k-processing":
|
|
339
|
-
"k-active":
|
|
346
|
+
className: B("k-smart-box-send", {
|
|
347
|
+
"k-processing": m,
|
|
348
|
+
"k-active": m
|
|
340
349
|
}),
|
|
341
350
|
type: "button",
|
|
342
351
|
rounded: "full",
|
|
343
352
|
size: "small",
|
|
344
353
|
title: h.toLanguageString(
|
|
345
|
-
|
|
346
|
-
|
|
354
|
+
P,
|
|
355
|
+
k[P]
|
|
347
356
|
),
|
|
348
357
|
"aria-label": h.toLanguageString(
|
|
349
|
-
|
|
350
|
-
|
|
358
|
+
P,
|
|
359
|
+
k[P]
|
|
351
360
|
),
|
|
352
361
|
"aria-disabled": o.length === 0,
|
|
353
|
-
svgIcon:
|
|
354
|
-
disabled: o.length === 0 && !
|
|
355
|
-
onClick:
|
|
362
|
+
svgIcon: m ? st : at,
|
|
363
|
+
disabled: o.length === 0 && !m,
|
|
364
|
+
onClick: G
|
|
356
365
|
}
|
|
357
366
|
))
|
|
358
367
|
), /* @__PURE__ */ e.createElement(
|
|
359
368
|
pt,
|
|
360
369
|
{
|
|
361
370
|
ref: J,
|
|
362
|
-
anchor:
|
|
371
|
+
anchor: d.current,
|
|
363
372
|
show: Ze,
|
|
364
373
|
popupClass: "k-smart-box-popup",
|
|
365
|
-
style: { width:
|
|
374
|
+
style: { width: Be },
|
|
366
375
|
anchorAlign: { horizontal: "left", vertical: "bottom" },
|
|
367
376
|
popupAlign: { horizontal: "left", vertical: "top" },
|
|
368
377
|
margin: { horizontal: 0, vertical: 2 },
|
|
369
378
|
onMouseDownOutside: (t) => {
|
|
370
379
|
const r = t.event.target;
|
|
371
|
-
|
|
380
|
+
d.current && !d.current.contains(r) && a(!1);
|
|
372
381
|
}
|
|
373
382
|
},
|
|
374
383
|
_e()
|
package/utils/index.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 G=require("react"),v=require("../GridColumn.js"),w=require("@progress/kendo-data-query"),y=require("@progress/kendo-react-data-tools"),O=require("./_serverModule.js"),T=require("./_clientModule.js"),l=require("../contextMenu/enums.js"),H=require("@progress/kendo-react-common");function j(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,r.get?r:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const M=j(G);function q(e,t){const a=(e!=null?e:"").split(".");let r=t;return a.forEach(n=>{r=r?r[n]:void 0}),r}function N(e,t,a,r,n,d,h,i,s,f=0,o){var c;let x=f;for(let g=0;g<t.length;g++){let C;if(!n||t[g].value===void 0||t[g].items===void 0){e[e.length]={dataIndex:r.index,dataItem:t[g],rowType:"data",level:f,group:o,expanded:(c=s?!!(d!=null&&d[w.getter(s)(t[g])]):!1)!=null?c:!1},r.index++;continue}else{let S;o!=null&&o.parents?S=[{field:o.field,value:o.value},...o.parents]:o?S=[o]:S=[],C={field:t[g].field,value:t[g].value,parents:S}}x=Math.max(x,f+1);let I=!1;const b=y.findGroupExpand(h||[],C);b?I=b.expanded!==!1:I=i!==!1,e[e.length]={dataIndex:-1,dataItem:t[g],level:f,group:C,rowType:"groupHeader",expanded:I},I&&(C.expanded=I,x=Math.max(N(e,t[g].items,a,r,n,d,h,i,s,f+1,C),x)),(a==="always"||I&&a==="visible")&&(e[e.length]={dataIndex:-1,dataItem:t[g],rowType:"groupFooter",level:f,expanded:I})}return x}function R(e,t){for(let a=0;a<e.length;a++){const r=e[a];if(
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=require("react"),v=require("../GridColumn.js"),w=require("@progress/kendo-data-query"),y=require("@progress/kendo-react-data-tools"),O=require("./_serverModule.js"),T=require("./_clientModule.js"),l=require("../contextMenu/enums.js"),H=require("@progress/kendo-react-common");function j(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,r.get?r:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const M=j(G);function q(e,t){const a=(e!=null?e:"").split(".");let r=t;return a.forEach(n=>{r=r?r[n]:void 0}),r}function N(e,t,a,r,n,d,h,i,s,f=0,o){var c;let x=f;for(let g=0;g<t.length;g++){let C;if(!n||t[g].value===void 0||t[g].items===void 0){e[e.length]={dataIndex:r.index,dataItem:t[g],rowType:"data",level:f,group:o,expanded:(c=s?!!(d!=null&&d[w.getter(s)(t[g])]):!1)!=null?c:!1},r.index++;continue}else{let S;o!=null&&o.parents?S=[{field:o.field,value:o.value},...o.parents]:o?S=[o]:S=[],C={field:t[g].field,value:t[g].value,parents:S}}x=Math.max(x,f+1);let I=!1;const b=y.findGroupExpand(h||[],C);b?I=b.expanded!==!1:I=i!==!1,e[e.length]={dataIndex:-1,dataItem:t[g],level:f,group:C,rowType:"groupHeader",expanded:I},I&&(C.expanded=I,x=Math.max(N(e,t[g].items,a,r,n,d,h,i,s,f+1,C),x)),(a==="always"||I&&a==="visible")&&(e[e.length]={dataIndex:-1,dataItem:t[g],rowType:"groupFooter",level:f,expanded:I})}return x}function R(e,t){for(let a=0;a<e.length;a++){const r=e[a];if(r.locked===void 0){const n=t[r.index];n&&(r.locked=n.locked)}}}const u=(e,t)=>typeof e.colSpan=="function"?e.colSpan({dataItem:t,column:e}):e.colSpan||1;function B(e,t,a){const r=[[]];let n=0;for(let i=e.length-1;i>=0;i--)n=Math.max(n,e[i].depth),e[i].headerColSpan=e[i].headerColSpan||1,e[i].children.length>0&&(e[i].headerColSpan=e[i].children.reduce((s,f)=>f.hidden?s:s+f.headerColSpan,0));const d=[];let h=1;return e.forEach((i,s)=>{r[i.depth]=r[i.depth]||[];let f=!1;r[i.depth].length===0&&(h<=1?h=1+(i.children.length>0?0:n-i.depth):(h--,f=!0)),i.rowSpan=1+(i.children.length>0?0:n-i.depth),i.kFirst=f,i.index=r[i.depth].length,r[i.depth].push(s),i.ariaColumnIndex=d[i.depth]?d[i.depth]+1:1;for(let o=i.depth;o<i.depth+i.rowSpan;o++)d[o]=(d[o]||0)+i.headerColSpan}),R(e,t),y.updateLeft(r,e,a),y.updateRight(r,e,a),r}function p(e,t,a,r=0,n=!1){const d=[];if(!e)return[];e&&e.length===void 0&&(e=[e]),e.forEach((i,s)=>{i=i.props?i.props:i;const f=i.id?i.id:y.tableKeyboardNavigationTools.generateNavigatableId(`${a.prevId++}`,a.idPrefix,"column"),o=H.canUseDOM&&i.media&&window.matchMedia?!window.matchMedia(i.media).matches:!1,x=n||o||i.hidden,c=t==null?void 0:t.find(C=>C.id===f),g=p(i.children,(c==null?void 0:c.children)||[],a,r+1,x);d.push(Object.assign({depth:r},v.gridDefaultProps,g.length?{cell:()=>null,filterCell:()=>null}:{},i,{id:f,declarationIndex:d.length,children:g,headerColSpan:0,rowSpan:0,columnType:i.columnType||"data",colSpan:i.colSpan||1,isAccessible:!0,hidden:x,left:null,right:null,rowSpannable:i.rowSpannable},c?{width:c.width,orderIndex:c.orderIndex}:{}))});const h=(i,s)=>i.orderIndex===s.orderIndex?i.declarationIndex-s.declarationIndex:(i.orderIndex||0)-(s.orderIndex||0);if(d.sort(h),r===0){const i=[],s=(f,o)=>f.forEach(x=>{x.parentIndex=o,s(x.children,i.push(x)-1)});return s(d,-1),i}return d}const D=e=>Array.isArray(e)?e:e?e.data:[];function z(e,t,a,r){const n=D(e),d=[];if(n.length>0){let h=n[0];if(t)for(let s=0;s<t.length;s++)h=h.items&&h.items[0];Object.getOwnPropertyNames(h).forEach(s=>{s!==a.column&&d.push(Object.assign({id:y.tableKeyboardNavigationTools.generateNavigatableId(`${r.prevId++}`,r.idPrefix,"column"),declarationIndex:-1,parentIndex:-1,depth:0,colSpan:0,headerColSpan:0,rowSpan:0,index:0,columnType:"data",left:0,right:0,rightBorder:!1,children:[],ariaColumnIndex:0,isAccessible:!0},v.gridDefaultProps,{field:s}))})}return d}const _=(e,t)=>{var r;let a=e[t.parentIndex];for(;a;){if((r=a.cells)!=null&&r.footerCell)return!0;a=e[a.parentIndex]}return!1},L=e=>e.filter(t=>{var a;return _(e,t)?!1:!!((a=t.cells)!=null&&a.footerCell)||!(t.children&&t.children.length>0)}),$=e=>{let t=e.width;return typeof(e==null?void 0:e.width)=="number"&&(e!=null&&e.minResizableWidth)&&(e==null?void 0:e.width)<(e==null?void 0:e.minResizableWidth)&&(t=e==null?void 0:e.minResizableWidth),typeof(e==null?void 0:e.width)=="number"&&(e!=null&&e.minWidth)&&(e==null?void 0:e.width)<(e==null?void 0:e.minWidth)?t=e==null?void 0:e.minWidth:typeof(e==null?void 0:e.width)=="number"&&(e!=null&&e.maxWidth)&&(e==null?void 0:e.width)>(e==null?void 0:e.maxWidth)&&(t=e==null?void 0:e.maxWidth),t!==void 0?Math.floor(parseFloat(t.toString()))+"px":void 0},V=(e,t)=>t&&t.filter(a=>a.field===e).length>0,E=e=>(e.sort((t,a)=>t.declarationIndex-a.declarationIndex),e.map(t=>{const{declarationIndex:a,parentIndex:r,depth:n,headerColSpan:d,rowSpan:h,index:i,kFirst:s,children:f,...o}=t;return f.length?{children:E(f),...o}:o})),W=e=>{const{cells:t,rowSpannable:a,defaultCell:r,...n}=e;return e.children.length?{...n,children:e.children.map(W)}:n},F=e=>({id:e.id,field:e.field,title:e.title,width:e.width,orderIndex:e.orderIndex,hidden:!1,minWidth:e.minWidth,maxWidth:e.maxWidth,children:e.children?k(e.children):null}),k=e=>e.map(F),P=e=>{const t=[],a=r=>r==null?void 0:r.forEach(n=>{t.push(n),a(n.children)});return a(e),t},K=typeof window!="undefined"&&/Firefox/.test(window.navigator.userAgent),Q=17895697,U=e=>{let t=[];return e.sortable&&(t=t.concat([l.GridContextMenuItemNames.sortAsc,l.GridContextMenuItemNames.sortDesc])),e.pdf&&(t.length&&(t=t.concat([l.GridContextMenuItemNames.separator])),t=t.concat([l.GridContextMenuItemNames.exportPDF])),t},J=e=>{let t=[];return e.clipboard&&(t=t.concat([l.GridContextMenuItemNames.copySelection,l.GridContextMenuItemNames.copySelectionNoHeaders,l.GridContextMenuItemNames.paste])),e.editable&&(t.length&&(t=t.concat([l.GridContextMenuItemNames.separator])),t=t.concat([l.GridContextMenuItemNames.create,l.GridContextMenuItemNames.edit,l.GridContextMenuItemNames.delete])),e.selectable&&(t.length&&(t=t.concat([l.GridContextMenuItemNames.separator])),t=t.concat([l.GridContextMenuItemNames.select])),e.rowReorderable&&(t.length&&(t=t.concat([l.GridContextMenuItemNames.separator])),t=t.concat([l.GridContextMenuItemNames.reorderRow])),e.pdf&&(t.length&&(t=t.concat([l.GridContextMenuItemNames.separator])),t=t.concat([l.GridContextMenuItemNames.exportPDF])),t},X=(e,t)=>{if(!(!e&&!t))return t?e?{...e,...t,select:{...e.select||{},...t.select||{}},hierarchy:{...e.hierarchy||{},...t.hierarchy||{}},group:{...e.group||{},...t.group||{}},edit:{...e.edit||{},...t.edit||{}}}:t:e},Y=e=>{var a;return typeof e=="object"?(a=e.enabled)!=null?a:!0:e!=null?e:!1},Z=()=>O.ServerFragment===T.ClientFragment,m=e=>!!(e&&e.$$typeof===Symbol.for("react.client.reference")),ee=e=>({id:e.id,ariaColumnIndex:e.ariaColumnIndex,isSelected:e.isSelected,isHighlighted:e.isHighlighted,isInEdit:e.isInEdit,isSorted:e.isSorted,isAlt:e.isAlt,expanded:e.expanded,className:e.className,style:e.style,field:e.field,dataItem:e.dataItem,format:e.format,colSpan:e.colSpan,dataIndex:e.dataIndex,columnIndex:e.columnIndex,columnsCount:e.columnsCount,rowType:e.rowType,level:e.level,editor:e.editor,locked:e.locked,isRtl:e.isRtl,rowDataIndex:e.rowDataIndex,columnPosition:e.columnPosition,group:e.group}),te=e=>{var r,n;const t=typeof e=="object"?(r=e.enabled)!=null?r:!0:e!=null?e:!1,a=typeof e=="object"?(n=e.valueGetter)!=null?n:((d,h)=>w.getter(h)(d)):(d,h)=>w.getter(h)(d);return{enabled:t,valueGetter:a}},A=e=>{var t;return M.isValidElement(e)?e:(t=M.Children.toArray(e))==null?void 0:t[0]},ie=(e,t)=>{const a=A(e);return a?M.cloneElement(a,t):null},ae=e=>{let t=0;if(e){const a=e.insertRow(0),r=a.insertCell(0);r.textContent=" ",t=a.getBoundingClientRect().height,e.deleteRow(0)}return t};exports.autoGenerateColumns=z;exports.calcRowHeight=ae;exports.clientColumn=W;exports.cloneReactElement=ie;exports.firefox=K;exports.firefoxMaxHeight=Q;exports.flatData=N;exports.footerColumns=L;exports.getClientCellProps=ee;exports.getColSpan=u;exports.getColumnState=F;exports.getColumnWidth=$;exports.getColumnsState=k;exports.getDataAsArray=D;exports.getDefaultBodyContextMenuItems=J;exports.getDefaultHeadContextMenuItems=U;exports.getFlatColumnsState=P;exports.getNestedValue=q;exports.getReactElement=A;exports.getRowSpanOptions=te;exports.isClient=Z;exports.isClientReference=m;exports.isRowReorderEnabled=Y;exports.isSorted=V;exports.mapColumns=B;exports.readColumns=p;exports.resolveCells=X;exports.sanitizeColumns=E;exports.syncLockedColumns=R;
|
package/utils/index.mjs
CHANGED