@progress/kendo-react-grid 11.4.0-develop.5 → 11.4.0-develop.7

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.
@@ -5,97 +5,89 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import * as s from "react";
9
- import { GridContext as st } from "../utils/GridContext.mjs";
8
+ import * as o from "react";
9
+ import { GridContext as ot } from "../utils/GridContext.mjs";
10
10
  import { Button as nt } from "@progress/kendo-react-buttons";
11
- import { sparklesIcon as rt } from "@progress/kendo-svg-icons";
11
+ import { sparklesIcon as st } from "@progress/kendo-svg-icons";
12
12
  import E from "axios";
13
- import { useInternationalization as at, useLocalization as it } from "@progress/kendo-react-intl";
14
- import { toolbarAI as m, messages as g, aIResponseData as L, generatedWithAI as j } from "../messages/index.mjs";
15
- import { useCustomComponent as lt, classNames as ut } from "@progress/kendo-react-common";
16
- import { Window as ct } from "@progress/kendo-react-dialogs";
17
- import { GridAIPrompt as pt } from "./ai-tool/GridAIPrompt.mjs";
18
- const ft = (l, n) => l.map((u) => {
19
- let c = u;
20
- return n.forEach((a) => {
21
- a.field && c.includes(a.field) && (c = c.replace(new RegExp(a.field, "g"), a.title || a.field));
22
- }), c;
23
- }), dt = (l) => {
24
- const n = s.useContext(st), R = at(), u = it(), {
25
- requestUrl: c,
26
- requestOptions: a,
27
- onPromptRequest: w,
28
- onResponseSuccess: y,
29
- onResponseError: b,
30
- role: v = "user",
31
- gridAIPrompt: D = pt,
32
- icon: W,
33
- svgIcon: h,
34
- onCloseWindow: T,
35
- promptPlaceHolder: z,
13
+ import { useLocalization as rt } from "@progress/kendo-react-intl";
14
+ import { toolbarAI as h, messages as C, aIResponseData as L, generatedWithAI as F } from "../messages/index.mjs";
15
+ import { useCustomComponent as at, classNames as it } from "@progress/kendo-react-common";
16
+ import { Window as lt } from "@progress/kendo-react-dialogs";
17
+ import { GridAIPrompt as ut } from "./ai-tool/GridAIPrompt.mjs";
18
+ import { combineSmartFilters as ct, parseFilterDates as pt } from "../filterCommon.mjs";
19
+ const dt = (l, e) => l.map((S) => {
20
+ let u = S;
21
+ return e.forEach((a) => {
22
+ a.field && u.includes(a.field) && (u = u.replace(new RegExp(a.field, "g"), a.title || a.field));
23
+ }), u;
24
+ }), mt = (l) => {
25
+ const e = o.useContext(ot), c = rt(), {
26
+ requestUrl: S,
27
+ requestOptions: u,
28
+ onPromptRequest: a,
29
+ onResponseSuccess: T,
30
+ onResponseError: y,
31
+ role: G = "user",
32
+ gridAIPrompt: W = ut,
33
+ icon: j,
34
+ svgIcon: w,
35
+ onCloseWindow: k,
36
+ promptPlaceHolder: v,
36
37
  suggestionsList: B,
37
- streaming: F,
38
- outputs: G
39
- } = l, [C, k] = s.useState([]), M = s.useMemo(() => n && Array.isArray(n.columnsRef) ? n.columnsRef.map((t) => ({ field: t.field })) : [], [n]), [H, f] = s.useState(!1), [d, I] = s.useState(!1), [N, $] = s.useState(), [K, U] = s.useState(), p = s.useRef(null), A = s.useRef(null), V = (t) => {
40
- t.preventDefault(), I(!d);
41
- }, S = s.useMemo(() => {
38
+ streaming: D,
39
+ loading: z,
40
+ outputs: H
41
+ } = l, [A, P] = o.useState([]), M = o.useMemo(() => e && Array.isArray(e.columnsRef) ? e.columnsRef.map((t) => ({ field: t.field })) : [], [e]), [N, m] = o.useState(!1), [f, I] = o.useState(!1), [$, K] = o.useState(), [U, X] = o.useState(), p = o.useRef(null), b = o.useRef(null), Y = (t) => {
42
+ t.preventDefault(), I(!f);
43
+ }, R = o.useMemo(() => {
42
44
  var t;
43
- return (t = l.show) != null ? t : d;
44
- }, [l.show, d]), O = () => {
45
+ return (t = l.show) != null ? t : f;
46
+ }, [l.show, f]), O = () => {
45
47
  var t;
46
- T && T(), k([]), I(!1), p.current && ((t = p.current.element) == null || t.focus());
47
- }, P = (t) => {
48
- t.filters = t.filters.map((o) => {
49
- if (o.value) {
50
- const i = R.parseDate(o.value);
51
- i && (o.value = i);
48
+ k && k(), P([]), I(!1), p.current && ((t = p.current.element) == null || t.focus());
49
+ }, J = (t, n, d) => {
50
+ var r, g;
51
+ if (m(!1), t != null && t.data) {
52
+ if (e.sortable && t.data.sort) {
53
+ const s = (r = e.sort) != null ? r : [];
54
+ e.sortChange([...s, ...t.data.sort], t);
52
55
  }
53
- return o;
54
- });
55
- }, X = (t, o, i) => {
56
- if (f(!1), t != null && t.data) {
57
- if (t.data.sort && n.sortChange(t.data.sort, t), t.data.filter) {
58
- let e = t.data.filter;
59
- if (e && Object.keys(e).length === 0 && (e = null), e != null && e.filters && Array.isArray(e.filters)) {
60
- P(e);
61
- const r = n.filter || { filters: [], logic: "or" }, et = e.filters.map((ot) => ({
62
- logic: "and",
63
- filters: [ot]
64
- }));
65
- e = {
66
- ...r,
67
- filters: [...r.filters, ...et]
68
- };
69
- }
70
- n.filterChange(e, t);
56
+ if (t.data.filter) {
57
+ const s = ct(t.data.filter, e.filter);
58
+ e.filterChange(s, t);
71
59
  }
72
60
  if (t.data.highlight) {
73
- let e = t.data.highlight;
74
- Array.isArray(e) && (e = e.map((r) => (r != null && r.filters && Array.isArray(r.filters) && P(r), r))), n.applyHighlightDescriptor(e);
61
+ let s = t.data.highlight;
62
+ Array.isArray(s) && (s = s.map((i) => (i != null && i.filters && Array.isArray(i.filters) && pt(i), i))), e.applyHighlightDescriptor(s);
75
63
  }
76
- if (t.data.group && n.groupChange(t.data.group, t), t.data.messages) {
77
- const e = [u.toLanguageString(L, g[L])], r = ft(t.data.messages, n.columnsRef).join(
64
+ if (e && t.data.group) {
65
+ const s = (g = e.group) != null ? g : [];
66
+ e.groupChange([...s, ...t.data.group], t);
67
+ }
68
+ if (t.data.messages) {
69
+ const s = [c.toLanguageString(L, C[L])], i = dt(t.data.messages, e.columnsRef).join(
78
70
  `
79
71
  `
80
72
  );
81
- k([
82
- ...C,
73
+ P([
83
74
  {
84
- id: C.length + 1,
85
- title: u.toLanguageString(j, g[j]),
86
- subTitle: o,
87
- prompt: o,
88
- responseContent: e.concat(r).join(""),
89
- isRetry: i
90
- }
75
+ id: A.length + 1,
76
+ title: c.toLanguageString(F, C[F]),
77
+ subTitle: n,
78
+ prompt: n,
79
+ responseContent: s.concat(i).join(""),
80
+ isRetry: d
81
+ },
82
+ ...A
91
83
  ]);
92
84
  }
93
85
  }
94
- y && y(t);
95
- }, Y = (t) => {
96
- b && b(t), f(!1);
97
- }, J = (t, o) => {
98
- const i = E.CancelToken.source(), e = {
86
+ T && T(t, n, d);
87
+ }, Q = (t) => {
88
+ y && y(t), m(!1);
89
+ }, V = (t, n) => {
90
+ const d = E.CancelToken.source(), r = {
99
91
  role: "user",
100
92
  columns: M || [],
101
93
  headers: {
@@ -104,85 +96,86 @@ const ft = (l, n) => l.map((u) => {
104
96
  },
105
97
  promptMessage: t,
106
98
  requestOptions: {
107
- url: c,
99
+ url: S,
108
100
  method: "POST",
109
101
  withCredentials: !1,
110
102
  responseType: "json",
111
- cancelToken: i.token,
112
- ...a
103
+ cancelToken: d.token,
104
+ ...u
113
105
  }
114
106
  };
115
- w && w(e, o), e.requestOptions.url !== void 0 && (f(!0), E({
116
- ...e.requestOptions,
117
- headers: e.headers,
107
+ a && a(r, n), r.requestOptions.url !== void 0 && (m(!0), E({
108
+ ...r.requestOptions,
109
+ headers: r.headers,
118
110
  data: {
119
- role: v || e.role,
111
+ role: G || r.role,
120
112
  contents: [
121
113
  {
122
114
  $type: "text",
123
- text: e.promptMessage
115
+ text: r.promptMessage
124
116
  }
125
117
  ],
126
- columns: e.columns || []
118
+ columns: r.columns || []
127
119
  },
128
120
  ...l.requestOptions
129
- }).then((r) => X(r, e.promptMessage, o)).catch(Y), A.current = i);
130
- }, Q = () => {
131
- A.current && A.current.cancel("Request cancelled by user."), f(!1);
132
- }, [Z, x] = lt(
133
- D
134
- ), _ = Object.keys(x).length > 0 ? x : {}, q = /* @__PURE__ */ s.createElement(
135
- Z,
121
+ }).then((g) => J(g, r.promptMessage, n)).catch(Q), b.current = d);
122
+ }, Z = () => {
123
+ b.current && b.current.cancel("Request cancelled by user."), m(!1);
124
+ }, [_, x] = at(
125
+ W
126
+ ), q = Object.keys(x).length > 0 ? x : {}, tt = /* @__PURE__ */ o.createElement(
127
+ _,
136
128
  {
137
- onPromptRequest: J,
138
- onCancel: Q,
129
+ onPromptRequest: V,
130
+ onCancel: Z,
139
131
  onClose: O,
140
- streaming: F || H,
141
- outputs: G || C,
142
- promptPlaceHolder: z,
132
+ streaming: D || N,
133
+ loading: z,
134
+ outputs: H || A,
135
+ promptPlaceHolder: v,
143
136
  suggestionsList: B,
144
- ..._
137
+ ...q
145
138
  }
146
- ), tt = /* @__PURE__ */ s.createElement(
139
+ ), et = /* @__PURE__ */ o.createElement(
147
140
  nt,
148
141
  {
149
142
  ref: p,
150
143
  togglable: !0,
151
144
  themeColor: "primary",
152
145
  rounded: "full",
153
- selected: S,
154
- svgIcon: h != null ? h : rt,
155
- icon: W,
156
- size: n.mobileMode ? "large" : "medium",
157
- className: ut("k-toolbar-button", { "k-icon-button": n.mobileMode }),
158
- title: u.toLanguageString(m, g[m]),
159
- onClick: V
146
+ selected: R,
147
+ svgIcon: w != null ? w : st,
148
+ icon: j,
149
+ size: e.mobileMode ? "large" : "medium",
150
+ className: it("k-toolbar-button", { "k-icon-button": e.mobileMode }),
151
+ title: c.toLanguageString(h, C[h]),
152
+ onClick: Y
160
153
  }
161
154
  );
162
- return s.useEffect(() => {
155
+ return o.useEffect(() => {
163
156
  var t;
164
- if (p.current && S) {
165
- const o = (t = p.current.element) == null ? void 0 : t.getBoundingClientRect();
166
- o && ($(o.top + window.scrollY + o.height), U(o.left + window.scrollX + o.width));
157
+ if (p.current && R) {
158
+ const n = (t = p.current.element) == null ? void 0 : t.getBoundingClientRect();
159
+ n && (K(n.top + window.scrollY + n.height), X(n.left + window.scrollX + n.width));
167
160
  }
168
- }, [S]), /* @__PURE__ */ s.createElement(s.Fragment, null, tt, d && /* @__PURE__ */ s.createElement(
169
- ct,
161
+ }, [R]), /* @__PURE__ */ o.createElement(o.Fragment, null, et, f && /* @__PURE__ */ o.createElement(
162
+ lt,
170
163
  {
171
164
  autoFocus: !1,
172
- title: u.toLanguageString(m, g[m]),
173
- initialTop: N,
174
- initialLeft: K,
165
+ title: c.toLanguageString(h, C[h]),
166
+ initialTop: $,
167
+ initialLeft: U,
175
168
  onClose: O,
176
169
  resizable: !0,
177
170
  draggable: !0,
178
171
  initialWidth: 437,
179
- initialHeight: 460,
172
+ initialHeight: null,
180
173
  className: "k-grid-assistant-window"
181
174
  },
182
- q
175
+ tt
183
176
  ));
184
177
  };
185
- dt.displayName = "KendoReactGridToolbarAIAssistant";
178
+ mt.displayName = "KendoReactGridToolbarAIAssistant";
186
179
  export {
187
- dt as GridToolbarAIAssistant
180
+ mt as GridToolbarAIAssistant
188
181
  };
@@ -5,5 +5,5 @@
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 R=require("react"),u=require("@progress/kendo-react-conversational-ui"),O=require("@progress/kendo-react-buttons"),S=require("@progress/kendo-react-inputs"),D=require("@progress/kendo-svg-icons"),s=require("../../messages/index.js"),E=require("@progress/kendo-react-intl");function h(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const a=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(o,n,a.get?a:{enumerable:!0,get:()=>t[n]})}}return o.default=t,Object.freeze(o)}const r=h(R),x=t=>{const{responseContent:o}=t,n=o.split(`
9
- `);return r.createElement("div",{className:"k-card-body"},n.map((a,c)=>r.createElement("div",{key:a.trim()+c,className:"k-card-text"},a)))},j=t=>{const{activeView:o,onActiveViewChange:n,toolbarItems:a,outputs:c,promptValue:d,promptInput:g,generateButton:f,onCopy:b,onOutputRating:A,onPromptRequest:i,suggestionsList:y,outputCard:I,promptPlaceHolder:w,streaming:k,onCancel:v,onClose:p}=t,l=E.useLocalization(),[C,m]=r.useState(u.promptViewDefaults.name),V=(e,z)=>{e&&(i&&i(e),m(u.outputViewDefaults.name))},q=e=>{n&&n(e),m(e)},P=e=>{e.key==="Escape"&&p&&p()};return r.useEffect(()=>{const e=document.querySelector(".k-prompt-view .k-textarea textarea");e&&e.focus()},[]),r.createElement(u.AIPrompt,{activeView:o!=null?o:C,onActiveViewChange:q,onPromptRequest:V,toolbarItems:a||[u.promptViewDefaults,u.outputViewDefaults],streaming:k,onCancel:v,onKeyDown:P},r.createElement(u.AIPromptView,{promptSuggestions:y,promptValue:d,promptInput:g||r.createElement(S.TextArea,{placeholder:w,rows:2}),generateButton:f||r.createElement(O.Button,{svgIcon:D.tableWizardIcon,icon:"table-wizard",type:"button",title:l.toLanguageString(s.toolbarAIApply,s.messages[s.toolbarAIApply])},l.toLanguageString(s.toolbarAIApply,s.messages[s.toolbarAIApply]))}),r.createElement(u.AIPromptOutputView,{outputs:c,showOutputRating:!0,onCopy:b,onOutputRating:A,outputCard:I||{body:x}}))};exports.GridAIPrompt=j;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react"),s=require("@progress/kendo-react-conversational-ui"),S=require("@progress/kendo-react-buttons"),h=require("@progress/kendo-react-inputs"),D=require("@progress/kendo-svg-icons"),u=require("../../messages/index.js"),E=require("@progress/kendo-react-intl");function x(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const a=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(o,n,a.get?a:{enumerable:!0,get:()=>t[n]})}}return o.default=t,Object.freeze(o)}const r=x(O),j=t=>{const{responseContent:o}=t,n=o.split(`
9
+ `);return r.createElement("div",{className:"k-card-body"},n.map((a,c)=>r.createElement("div",{key:a.trim()+c,className:"k-card-text"},a)))},z=t=>{const{activeView:o,onActiveViewChange:n,toolbarItems:a,outputs:c,promptValue:d,promptInput:g,generateButton:f,onCopy:b,onOutputRating:y,onPromptRequest:i,suggestionsList:A,outputCard:I,promptPlaceHolder:w,streaming:k,loading:v,onCancel:C,onClose:p}=t,l=E.useLocalization(),[V,m]=r.useState(s.promptViewDefaults.name),q=(e,B)=>{e&&(i&&i(e),m(s.outputViewDefaults.name))},P=e=>{n&&n(e),m(e)},R=e=>{e.key==="Escape"&&p&&p()};return r.useEffect(()=>{const e=document.querySelector(".k-prompt-view .k-textarea textarea");e&&e.focus()},[]),r.createElement(s.AIPrompt,{style:{maxHeight:"500px"},activeView:o!=null?o:V,onActiveViewChange:P,onPromptRequest:q,toolbarItems:a||[s.promptViewDefaults,s.outputViewDefaults],streaming:k,loading:v,onCancel:C,onKeyDown:R},r.createElement(s.AIPromptView,{promptSuggestions:A,promptValue:d,promptInput:g||r.createElement(h.TextArea,{placeholder:w,rows:2}),generateButton:f||r.createElement(S.Button,{svgIcon:D.tableWizardIcon,icon:"table-wizard",type:"button",title:l.toLanguageString(u.toolbarAIApply,u.messages[u.toolbarAIApply])},l.toLanguageString(u.toolbarAIApply,u.messages[u.toolbarAIApply]))}),r.createElement(s.AIPromptOutputView,{outputs:c,showOutputRating:!0,onCopy:b,onOutputRating:y,outputCard:I||{body:j}}))};exports.GridAIPrompt=z;
@@ -6,85 +6,88 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  import * as e from "react";
9
- import { promptViewDefaults as l, AIPrompt as R, outputViewDefaults as g, AIPromptView as D, AIPromptOutputView as S } from "@progress/kendo-react-conversational-ui";
10
- import { Button as q } from "@progress/kendo-react-buttons";
11
- import { TextArea as z } from "@progress/kendo-react-inputs";
12
- import { tableWizardIcon as L } from "@progress/kendo-svg-icons";
13
- import { toolbarAIApply as a, messages as f } from "../../messages/index.mjs";
14
- import { useLocalization as O } from "@progress/kendo-react-intl";
15
- const B = (s) => {
9
+ import { promptViewDefaults as l, AIPrompt as D, outputViewDefaults as g, AIPromptView as S, AIPromptOutputView as q } from "@progress/kendo-react-conversational-ui";
10
+ import { Button as z } from "@progress/kendo-react-buttons";
11
+ import { TextArea as L } from "@progress/kendo-react-inputs";
12
+ import { tableWizardIcon as O } from "@progress/kendo-svg-icons";
13
+ import { toolbarAIApply as a, messages as d } from "../../messages/index.mjs";
14
+ import { useLocalization as B } from "@progress/kendo-react-intl";
15
+ const H = (s) => {
16
16
  const { responseContent: o } = s, r = o.split(`
17
17
  `);
18
- return /* @__PURE__ */ e.createElement("div", { className: "k-card-body" }, r.map((n, u) => /* @__PURE__ */ e.createElement("div", { key: n.trim() + u, className: "k-card-text" }, n)));
19
- }, j = (s) => {
18
+ return /* @__PURE__ */ e.createElement("div", { className: "k-card-body" }, r.map((n, i) => /* @__PURE__ */ e.createElement("div", { key: n.trim() + i, className: "k-card-text" }, n)));
19
+ }, F = (s) => {
20
20
  const {
21
21
  activeView: o,
22
22
  onActiveViewChange: r,
23
23
  toolbarItems: n,
24
- outputs: u,
25
- promptValue: d,
24
+ outputs: i,
25
+ promptValue: f,
26
26
  promptInput: w,
27
27
  generateButton: A,
28
- onCopy: C,
29
- onOutputRating: I,
30
- onPromptRequest: i,
31
- suggestionsList: y,
28
+ onCopy: y,
29
+ onOutputRating: C,
30
+ onPromptRequest: p,
31
+ suggestionsList: I,
32
32
  outputCard: V,
33
- promptPlaceHolder: E,
34
- streaming: b,
35
- onCancel: h,
36
- onClose: p
37
- } = s, m = O(), [v, c] = e.useState(l.name), P = (t, K) => {
38
- t && (i && i(t), c(g.name));
33
+ promptPlaceHolder: h,
34
+ streaming: E,
35
+ loading: b,
36
+ onCancel: v,
37
+ onClose: u
38
+ } = s, m = B(), [x, c] = e.useState(l.name), P = (t, K) => {
39
+ t && (p && p(t), c(g.name));
39
40
  }, k = (t) => {
40
41
  r && r(t), c(t);
41
- }, x = (t) => {
42
- t.key === "Escape" && p && p();
42
+ }, R = (t) => {
43
+ t.key === "Escape" && u && u();
43
44
  };
44
45
  return e.useEffect(() => {
45
46
  const t = document.querySelector(".k-prompt-view .k-textarea textarea");
46
47
  t && t.focus();
47
48
  }, []), /* @__PURE__ */ e.createElement(
48
- R,
49
+ D,
49
50
  {
50
- activeView: o != null ? o : v,
51
+ style: { maxHeight: "500px" },
52
+ activeView: o != null ? o : x,
51
53
  onActiveViewChange: k,
52
54
  onPromptRequest: P,
53
55
  toolbarItems: n || [l, g],
54
- streaming: b,
55
- onCancel: h,
56
- onKeyDown: x
56
+ streaming: E,
57
+ loading: b,
58
+ onCancel: v,
59
+ onKeyDown: R
57
60
  },
58
61
  /* @__PURE__ */ e.createElement(
59
- D,
62
+ S,
60
63
  {
61
- promptSuggestions: y,
62
- promptValue: d,
63
- promptInput: w || /* @__PURE__ */ e.createElement(z, { placeholder: E, rows: 2 }),
64
+ promptSuggestions: I,
65
+ promptValue: f,
66
+ promptInput: w || /* @__PURE__ */ e.createElement(L, { placeholder: h, rows: 2 }),
64
67
  generateButton: A || /* @__PURE__ */ e.createElement(
65
- q,
68
+ z,
66
69
  {
67
- svgIcon: L,
70
+ svgIcon: O,
68
71
  icon: "table-wizard",
69
72
  type: "button",
70
- title: m.toLanguageString(a, f[a])
73
+ title: m.toLanguageString(a, d[a])
71
74
  },
72
- m.toLanguageString(a, f[a])
75
+ m.toLanguageString(a, d[a])
73
76
  )
74
77
  }
75
78
  ),
76
79
  /* @__PURE__ */ e.createElement(
77
- S,
80
+ q,
78
81
  {
79
- outputs: u,
82
+ outputs: i,
80
83
  showOutputRating: !0,
81
- onCopy: C,
82
- onOutputRating: I,
83
- outputCard: V || { body: B }
84
+ onCopy: y,
85
+ onOutputRating: C,
86
+ outputCard: V || { body: H }
84
87
  }
85
88
  )
86
89
  );
87
90
  };
88
91
  export {
89
- j as GridAIPrompt
92
+ F as GridAIPrompt
90
93
  };
package/utils/premium.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 d=require("react"),a=require("@progress/kendo-react-data-tools"),c=require("../sortCommon.js"),m=require("../paging/GridPagerSettings.js");function b(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const l=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,l.get?l:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const o=b(d),y=e=>({lockedColumn:e.some(r=>r.locked)}),g=e=>({multiColumn:e.some(r=>r.children&&r.children.length>0)}),C=e=>({columnCellTemplate:e.some(r=>r.columnType!=="data"?!1:r.cells)}),h=e=>({columnMenu:e.some(r=>r.columnMenu)}),p=e=>o.Children.toArray(e.children).some(t=>t&&t.type&&t.type.displayName==="KendoReactGridColumn"?t.props.hidden:!1),f=e=>o.Children.toArray(e.children).some(t=>t&&t.type&&t.type.displayName==="KendoReactGridToolbar"&&t.props&&t.props.children?o.Children.toArray(t.props.children).some(n=>n.type&&(n.type.displayName==="KendoReactGridToolbarSort"||n.type.displayName==="KendoReactGridToolbarFilter"||n.type.displayName==="KendoReactGridToolbarCheckboxFilter"||n.type.displayName==="KendoReactGridToolbarColumnsChooser"||n.type.displayName==="KendoReactGridToolbarGroup")):!1),i=e=>{const r=a.getSelectionOptions(e.selectable),t=a.getEditableOptions(e.editable),l=e.sortable&&c.normalizeSortable(e.sortable),n=e.pageable&&m.normalize(e.pageable);return{cells:!!e.cells,pdf:!!e.pdf,detail:!!e.detail,rows:!!e.rows,highlight:!!e.highlight,editableInline:t.mode==="inline",selectionMultiple:r.enabled&&r.mode==="multiple",selectionDrag:r.enabled&&r.drag,columnMenu:!!e.columnMenu,filterOperators:!!e.filterOperators,groupable:!!e.groupable,group:!!e.group,groupExpand:!!e.groupExpand,customPager:!!e.pager,clipboard:!!e.clipboard,contextMenu:!!e.contextMenu,serverGrid:!e.isClient,scrollableVirtual:e.scrollable==="virtual",pageableInput:!!(e.pageable&&n.type==="input"),sortableMultiple:!!(e.sortable&&l.mode==="multiple"),hiddenColumns:p(e)}},s=e=>({...y(e),...g(e),...C(e),...h(e)}),u=e=>({toolbarTools:f(e)}),G=(e,r)=>{const t={...i(e),...s(r),...u(e)};return Object.keys(t).filter(l=>t[l]===!0)};exports.gridPremiumFeatures=G;exports.isPremiumGridByColumns=s;exports.isPremiumGridByComponents=u;exports.isPremiumGridByProps=i;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react"),o=require("@progress/kendo-react-data-tools"),c=require("../sortCommon.js"),m=require("../paging/GridPagerSettings.js");function b(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const l=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,l.get?l:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const a=b(d),y=e=>({lockedColumn:e.some(r=>r.locked)}),g=e=>({multiColumn:e.some(r=>r.children&&r.children.length>0)}),C=e=>({columnCellTemplate:e.some(r=>r.columnType!=="data"?!1:r.cells)}),h=e=>({columnMenu:e.some(r=>r.columnMenu)}),p=e=>a.Children.toArray(e.children).some(t=>t&&t.type&&t.type.displayName==="KendoReactGridColumn"?t.props.hidden:!1),f=e=>a.Children.toArray(e.children).some(t=>t&&t.type&&t.type.displayName==="KendoReactGridToolbar"&&t.props&&t.props.children?a.Children.toArray(t.props.children).some(n=>n.type&&(n.type.displayName==="KendoReactGridToolbarSort"||n.type.displayName==="KendoReactGridToolbarFilter"||n.type.displayName==="KendoReactGridToolbarCheckboxFilter"||n.type.displayName==="KendoReactGridToolbarColumnsChooser"||n.type.displayName==="KendoReactGridToolbarGroup"||n.type.displayName==="KendoReactGridToolbarAIAssistant")):!1),i=e=>{const r=o.getSelectionOptions(e.selectable),t=o.getEditableOptions(e.editable),l=e.sortable&&c.normalizeSortable(e.sortable),n=e.pageable&&m.normalize(e.pageable);return{cells:!!e.cells,pdf:!!e.pdf,detail:!!e.detail,rows:!!e.rows,highlight:!!e.highlight,editableInline:t.mode==="inline",selectionMultiple:r.enabled&&r.mode==="multiple",selectionDrag:r.enabled&&r.drag,columnMenu:!!e.columnMenu,filterOperators:!!e.filterOperators,groupable:!!e.groupable,group:!!e.group,groupExpand:!!e.groupExpand,customPager:!!e.pager,clipboard:!!e.clipboard,contextMenu:!!e.contextMenu,serverGrid:!e.isClient,scrollableVirtual:e.scrollable==="virtual",pageableInput:!!(e.pageable&&n.type==="input"),sortableMultiple:!!(e.sortable&&l.mode==="multiple"),hiddenColumns:p(e)}},s=e=>({...y(e),...g(e),...C(e),...h(e)}),u=e=>({toolbarTools:f(e)}),G=(e,r)=>{const t={...i(e),...s(r),...u(e)};return Object.keys(t).filter(l=>t[l]===!0)};exports.gridPremiumFeatures=G;exports.isPremiumGridByColumns=s;exports.isPremiumGridByComponents=u;exports.isPremiumGridByProps=i;
package/utils/premium.mjs CHANGED
@@ -17,7 +17,7 @@ const u = (e) => ({
17
17
  columnCellTemplate: e.some((r) => r.columnType !== "data" ? !1 : r.cells)
18
18
  }), b = (e) => ({
19
19
  columnMenu: e.some((r) => r.columnMenu)
20
- }), y = (e) => a.Children.toArray(e.children).some((t) => t && t.type && t.type.displayName === "KendoReactGridColumn" ? t.props.hidden : !1), h = (e) => a.Children.toArray(e.children).some((t) => t && t.type && t.type.displayName === "KendoReactGridToolbar" && t.props && t.props.children ? a.Children.toArray(t.props.children).some((l) => l.type && (l.type.displayName === "KendoReactGridToolbarSort" || l.type.displayName === "KendoReactGridToolbarFilter" || l.type.displayName === "KendoReactGridToolbarCheckboxFilter" || l.type.displayName === "KendoReactGridToolbarColumnsChooser" || l.type.displayName === "KendoReactGridToolbarGroup")) : !1), g = (e) => {
20
+ }), y = (e) => a.Children.toArray(e.children).some((t) => t && t.type && t.type.displayName === "KendoReactGridColumn" ? t.props.hidden : !1), h = (e) => a.Children.toArray(e.children).some((t) => t && t.type && t.type.displayName === "KendoReactGridToolbar" && t.props && t.props.children ? a.Children.toArray(t.props.children).some((l) => l.type && (l.type.displayName === "KendoReactGridToolbarSort" || l.type.displayName === "KendoReactGridToolbarFilter" || l.type.displayName === "KendoReactGridToolbarCheckboxFilter" || l.type.displayName === "KendoReactGridToolbarColumnsChooser" || l.type.displayName === "KendoReactGridToolbarGroup" || l.type.displayName === "KendoReactGridToolbarAIAssistant")) : !1), g = (e) => {
21
21
  const r = o(e.selectable), t = i(e.editable), n = e.sortable && s(e.sortable), l = e.pageable && d(e.pageable);
22
22
  return {
23
23
  cells: !!e.cells,
@@ -49,7 +49,7 @@ const u = (e) => ({
49
49
  ...b(e)
50
50
  }), p = (e) => ({
51
51
  toolbarTools: h(e)
52
- }), A = (e, r) => {
52
+ }), T = (e, r) => {
53
53
  const t = {
54
54
  ...g(e),
55
55
  ...C(r),
@@ -58,7 +58,7 @@ const u = (e) => ({
58
58
  return Object.keys(t).filter((n) => t[n] === !0);
59
59
  };
60
60
  export {
61
- A as gridPremiumFeatures,
61
+ T as gridPremiumFeatures,
62
62
  C as isPremiumGridByColumns,
63
63
  p as isPremiumGridByComponents,
64
64
  g as isPremiumGridByProps