@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.
@@ -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 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";
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 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";
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((pe, me) => {
30
- var oe;
29
+ const vt = e.forwardRef((me, de) => {
30
+ var ie;
31
31
  const {
32
- searchConfig: de,
33
- semanticSearchConfig: fe,
34
- aiAssistantConfig: he,
35
- activeMode: ge,
36
- dir: Se = "ltr",
32
+ searchConfig: fe,
33
+ semanticSearchConfig: he,
34
+ aiAssistantConfig: ge,
35
+ activeMode: Se,
36
+ dir: ke = "ltr",
37
37
  size: $ = "medium",
38
- placeholder: ke,
39
- history: Ce,
40
- loading: be = !1,
38
+ placeholder: Ce,
39
+ history: be,
40
+ loading: xe = !1,
41
41
  promptSuggestionRender: K,
42
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), {
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: a,
56
+ aiAssistantMode: s,
57
57
  selectedView: n,
58
58
  setSelectedViewState: z,
59
59
  lastSearchMode: Pe,
60
- searchHistorySettings: X,
61
- semanticSearchHistorySettings: Y,
62
- aiAssistantHistorySettings: T,
63
- speechToTextButtonSettings: Z,
60
+ searchHistorySettings: Y,
61
+ semanticSearchHistorySettings: Z,
62
+ aiAssistantHistorySettings: N,
63
+ speechToTextButtonSettings: _,
64
64
  currentSearchDelay: Le
65
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({
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: 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]
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: a,
84
- sharedPlaceholder: ke
85
- }), { searchListData: f, aiAssistantListData: E, searchHistoryListData: w } = bt({
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: V,
90
- currentHistory: v,
89
+ promptSuggestions: O,
90
+ currentHistory: I,
91
91
  currentHistorySettings: Fe
92
- }), A = xt({
92
+ }), M = xt({
93
93
  searchMode: i,
94
94
  semanticSearchMode: c,
95
- aiAssistantMode: a,
95
+ aiAssistantMode: s,
96
96
  selectedView: n,
97
97
  lastSearchMode: Pe,
98
98
  setSelectedViewState: z,
99
- setInputValue: m
99
+ setInputValue: p
100
100
  });
101
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({
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: 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
+ 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: Ne,
128
+ gridRef: ze,
120
129
  onPromptRequest: (t) => {
121
- F == null || F({ requestData: t });
130
+ L == null || L({ requestData: t });
122
131
  },
123
132
  onResponseSuccess: (t) => {
124
- I(!1), H == null || H({ response: t });
133
+ R(!1), F == null || F({ response: t });
125
134
  },
126
135
  onResponseError: (t) => {
127
- I(!1), N == null || N({ error: t });
136
+ R(!1), H == null || H({ error: t });
128
137
  },
129
- onStateChange: ze,
138
+ onStateChange: Ne,
130
139
  onExportPdf: () => g == null ? void 0 : g.exportAsPdf()
131
140
  });
132
141
  e.useImperativeHandle(
133
- me,
142
+ de,
134
143
  () => ({
135
- show: () => s(!0),
136
- hide: () => s(!1)
144
+ show: () => a(!0),
145
+ hide: () => a(!1)
137
146
  }),
138
- [s]
147
+ [a]
139
148
  );
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(
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
- m(r), s(!r), (n === "search" || n === "semanticSearch") && Q(r);
156
+ p(r), a(!r), (n === "search" || n === "semanticSearch") && X(r);
148
157
  },
149
- [s, n]
150
- ), We = e.useCallback(() => {
151
- b == null || b(), o || s(!0);
152
- }, [b, s, o]), Ue = e.useCallback(
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 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));
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
- [x, s]
167
+ [b, a]
159
168
  ), $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);
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() && (ne && I(!0), q("aiAssistant", o, T), s(!1), M(o.trim()), m(""));
175
+ o.trim() && (re && R(!0), T("aiAssistant", o, N), a(!1), ee(o.trim()), p(""));
167
176
  }, [
168
- d,
177
+ m,
169
178
  o,
179
+ N,
180
+ a,
170
181
  T,
171
- s,
172
- q,
173
- M,
174
182
  ee,
175
- ne,
176
- R
183
+ te,
184
+ re,
185
+ x
177
186
  ]), Ke = e.useCallback(
178
187
  (t) => {
179
- t.key === "Enter" && (n === "aiAssistant" ? W() : n === "semanticSearch" && u(o));
188
+ t.key === "Enter" && (n === "aiAssistant" ? G() : n === "semanticSearch" && u(o));
180
189
  },
181
- [n, o, u, W]
190
+ [n, o, u, G]
182
191
  ), je = e.useCallback(() => {
183
192
  var t;
184
- s(!k), (t = S.current) == null || t.focus();
185
- }, [k, s]), Je = e.useCallback(
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(), m(""), (r = S.current) == null || r.focus(), s(!0), u("");
197
+ t.stopPropagation(), t.preventDefault(), p(""), (r = S.current) == null || r.focus(), a(!0), u("");
189
198
  },
190
- [s, u]
191
- ), re = e.useCallback(
199
+ [a, u]
200
+ ), se = e.useCallback(
192
201
  (t) => {
193
202
  var r;
194
- z(t), m(""), Q(null), (r = S.current) == null || r.focus();
203
+ z(t), p(""), X(null), (r = S.current) == null || r.focus();
195
204
  },
196
205
  [z]
197
- ), D = e.useCallback(
206
+ ), E = e.useCallback(
198
207
  (t) => {
199
208
  var r;
200
- m(t), s(!1), (r = S.current) == null || r.focus(), n !== "aiAssistant" && u(t);
209
+ p(t), a(!1), (r = S.current) == null || r.focus(), n !== "aiAssistant" && u(t);
201
210
  },
202
- [n, s, u]
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
- m((l) => l ? `${l} ${r}` : r);
215
+ p((l) => l ? `${l} ${r}` : r);
207
216
  }
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(
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" ? E : w)[t];
211
- l && D(l.text);
219
+ const l = (n === "aiAssistant" ? v : w)[t];
220
+ l && E(l.text);
212
221
  },
213
- [n, E, w, D]
222
+ [n, v, w, E]
214
223
  ), Ye = e.useCallback(
215
224
  (t) => {
216
225
  const r = f[t];
217
- r && re(r.mode);
226
+ r && se(r.mode);
218
227
  },
219
- [f, re]
220
- ), se = e.useMemo(
228
+ [f, se]
229
+ ), oe = e.useMemo(
221
230
  () => mt({
222
231
  historyItemRender: j,
223
232
  promptSuggestionRender: K,
224
- handleListItemClick: D
233
+ handleListItemClick: E
225
234
  }),
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(
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" && E.length > 0 && /* @__PURE__ */ e.createElement(
247
+ ), n === "aiAssistant" && v.length > 0 && /* @__PURE__ */ e.createElement(
239
248
  U,
240
249
  {
241
- data: E,
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: se,
248
- groupHeaderItemRender: ce,
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: se,
263
- groupHeaderItemRender: ce,
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: p, className: "k-smart-box-wrapper", dir: Se, onBlur: Ue }, /* @__PURE__ */ e.createElement(
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: y("k-smart-box", "k-input", `k-input-${Oe}`, {
273
- "k-loading": d
281
+ className: B("k-smart-box", "k-input", `k-input-${Ve}`, {
282
+ "k-loading": m
274
283
  })
275
284
  },
276
- !O && /* @__PURE__ */ e.createElement("span", { className: "k-input-prefix k-input-prefix-horizontal" }, /* @__PURE__ */ e.createElement(
277
- le,
285
+ !V && /* @__PURE__ */ e.createElement("span", { className: "k-input-prefix k-input-prefix-horizontal" }, /* @__PURE__ */ e.createElement(
286
+ ce,
278
287
  {
279
- className: y("k-icon", {
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: y("k-input-inner", { "k-disabled": O }),
303
+ className: B("k-input-inner", { "k-disabled": V }),
295
304
  id: Ee.current,
296
305
  placeholder: Te,
297
306
  value: o,
298
- disabled: O,
299
- onChange: Ge,
300
- onFocus: We,
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
- ue,
311
- C[ue]
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(le, { className: "k-icon", icon: rt })
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" }, Z && /* @__PURE__ */ e.createElement(
329
+ n === "aiAssistant" && /* @__PURE__ */ e.createElement("span", { className: "k-input-suffix k-input-suffix-horizontal" }, _ && /* @__PURE__ */ e.createElement(
321
330
  tt,
322
331
  {
323
- ...Z,
332
+ ..._,
324
333
  "aria-label": h.toLanguageString(
325
- P,
326
- C[P]
334
+ y,
335
+ k[y]
327
336
  ),
328
337
  title: h.toLanguageString(
329
- P,
330
- C[P]
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: y("k-smart-box-send", {
338
- "k-processing": d,
339
- "k-active": d
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
- L,
346
- C[L]
354
+ P,
355
+ k[P]
347
356
  ),
348
357
  "aria-label": h.toLanguageString(
349
- L,
350
- C[L]
358
+ P,
359
+ k[P]
351
360
  ),
352
361
  "aria-disabled": o.length === 0,
353
- svgIcon: d ? at : st,
354
- disabled: o.length === 0 && !d,
355
- onClick: W
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: p.current,
371
+ anchor: d.current,
363
372
  show: Ze,
364
373
  popupClass: "k-smart-box-popup",
365
- style: { width: De },
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
- p.current && !p.current.contains(r) && s(!1);
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(!r.locked){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="&nbsp;",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;
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="&nbsp;",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
@@ -82,7 +82,7 @@ function A(e, t, r, a, d, n, l, i, h, s = 0, f) {
82
82
  function H(e, t) {
83
83
  for (let r = 0; r < e.length; r++) {
84
84
  const a = e[r];
85
- if (!a.locked) {
85
+ if (a.locked === void 0) {
86
86
  const d = t[a.index];
87
87
  d && (a.locked = d.locked);
88
88
  }