@progress/kendo-react-grid 11.4.0-develop.4 → 11.4.0-develop.6
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/GridClientWrapper.js +1 -1
- package/GridClientWrapper.mjs +116 -112
- package/README.md +16 -0
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/filterCommon.js +1 -1
- package/filterCommon.mjs +75 -31
- package/index.d.mts +28 -1
- package/index.d.ts +28 -1
- package/index.js +1 -1
- package/index.mjs +38 -36
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +17 -17
- package/toolbar-tools/GridToolbarAIAssistant.js +2 -2
- package/toolbar-tools/GridToolbarAIAssistant.mjs +110 -117
- package/toolbar-tools/ai-tool/GridAIPrompt.js +2 -2
- package/toolbar-tools/ai-tool/GridAIPrompt.mjs +45 -42
- package/utils/premium.js +1 -1
- package/utils/premium.mjs +3 -3
|
@@ -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
|
|
9
|
-
import { GridContext as
|
|
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
|
|
11
|
+
import { sparklesIcon as st } from "@progress/kendo-svg-icons";
|
|
12
12
|
import E from "axios";
|
|
13
|
-
import {
|
|
14
|
-
import { toolbarAI as
|
|
15
|
-
import { useCustomComponent as
|
|
16
|
-
import { Window as
|
|
17
|
-
import { GridAIPrompt as
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}),
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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 :
|
|
44
|
-
}, [l.show,
|
|
45
|
+
return (t = l.show) != null ? t : f;
|
|
46
|
+
}, [l.show, f]), O = () => {
|
|
45
47
|
var t;
|
|
46
|
-
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
|
|
74
|
-
Array.isArray(
|
|
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 (
|
|
77
|
-
const
|
|
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
|
-
|
|
82
|
-
...
|
|
73
|
+
P([
|
|
74
|
+
...A,
|
|
83
75
|
{
|
|
84
|
-
id:
|
|
85
|
-
title:
|
|
86
|
-
subTitle:
|
|
87
|
-
prompt:
|
|
88
|
-
responseContent:
|
|
89
|
-
isRetry:
|
|
76
|
+
id: A.length + 1,
|
|
77
|
+
title: c.toLanguageString(F, C[F]),
|
|
78
|
+
subTitle: n,
|
|
79
|
+
prompt: n,
|
|
80
|
+
responseContent: s.concat(i).join(""),
|
|
81
|
+
isRetry: d
|
|
90
82
|
}
|
|
91
83
|
]);
|
|
92
84
|
}
|
|
93
85
|
}
|
|
94
|
-
|
|
95
|
-
},
|
|
96
|
-
|
|
97
|
-
},
|
|
98
|
-
const
|
|
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:
|
|
99
|
+
url: S,
|
|
108
100
|
method: "POST",
|
|
109
101
|
withCredentials: !1,
|
|
110
102
|
responseType: "json",
|
|
111
|
-
cancelToken:
|
|
112
|
-
...
|
|
103
|
+
cancelToken: d.token,
|
|
104
|
+
...u
|
|
113
105
|
}
|
|
114
106
|
};
|
|
115
|
-
|
|
116
|
-
...
|
|
117
|
-
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:
|
|
111
|
+
role: G || r.role,
|
|
120
112
|
contents: [
|
|
121
113
|
{
|
|
122
114
|
$type: "text",
|
|
123
|
-
text:
|
|
115
|
+
text: r.promptMessage
|
|
124
116
|
}
|
|
125
117
|
],
|
|
126
|
-
columns:
|
|
118
|
+
columns: r.columns || []
|
|
127
119
|
},
|
|
128
120
|
...l.requestOptions
|
|
129
|
-
}).then((
|
|
130
|
-
},
|
|
131
|
-
|
|
132
|
-
}, [
|
|
133
|
-
|
|
134
|
-
),
|
|
135
|
-
|
|
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:
|
|
138
|
-
onCancel:
|
|
129
|
+
onPromptRequest: V,
|
|
130
|
+
onCancel: Z,
|
|
139
131
|
onClose: O,
|
|
140
|
-
streaming:
|
|
141
|
-
|
|
142
|
-
|
|
132
|
+
streaming: D || N,
|
|
133
|
+
loading: z,
|
|
134
|
+
outputs: H || A,
|
|
135
|
+
promptPlaceHolder: v,
|
|
143
136
|
suggestionsList: B,
|
|
144
|
-
...
|
|
137
|
+
...q
|
|
145
138
|
}
|
|
146
|
-
),
|
|
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:
|
|
154
|
-
svgIcon:
|
|
155
|
-
icon:
|
|
156
|
-
size:
|
|
157
|
-
className:
|
|
158
|
-
title:
|
|
159
|
-
onClick:
|
|
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
|
|
155
|
+
return o.useEffect(() => {
|
|
163
156
|
var t;
|
|
164
|
-
if (p.current &&
|
|
165
|
-
const
|
|
166
|
-
|
|
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
|
-
}, [
|
|
169
|
-
|
|
161
|
+
}, [R]), /* @__PURE__ */ o.createElement(o.Fragment, null, et, f && /* @__PURE__ */ o.createElement(
|
|
162
|
+
lt,
|
|
170
163
|
{
|
|
171
164
|
autoFocus: !1,
|
|
172
|
-
title:
|
|
173
|
-
initialTop:
|
|
174
|
-
initialLeft:
|
|
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:
|
|
172
|
+
initialHeight: null,
|
|
180
173
|
className: "k-grid-assistant-window"
|
|
181
174
|
},
|
|
182
|
-
|
|
175
|
+
tt
|
|
183
176
|
));
|
|
184
177
|
};
|
|
185
|
-
|
|
178
|
+
mt.displayName = "KendoReactGridToolbarAIAssistant";
|
|
186
179
|
export {
|
|
187
|
-
|
|
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
|
|
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)))},
|
|
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
|
|
10
|
-
import { Button as
|
|
11
|
-
import { TextArea as
|
|
12
|
-
import { tableWizardIcon as
|
|
13
|
-
import { toolbarAIApply as a, messages as
|
|
14
|
-
import { useLocalization as
|
|
15
|
-
const
|
|
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,
|
|
19
|
-
},
|
|
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:
|
|
25
|
-
promptValue:
|
|
24
|
+
outputs: i,
|
|
25
|
+
promptValue: f,
|
|
26
26
|
promptInput: w,
|
|
27
27
|
generateButton: A,
|
|
28
|
-
onCopy:
|
|
29
|
-
onOutputRating:
|
|
30
|
-
onPromptRequest:
|
|
31
|
-
suggestionsList:
|
|
28
|
+
onCopy: y,
|
|
29
|
+
onOutputRating: C,
|
|
30
|
+
onPromptRequest: p,
|
|
31
|
+
suggestionsList: I,
|
|
32
32
|
outputCard: V,
|
|
33
|
-
promptPlaceHolder:
|
|
34
|
-
streaming:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
},
|
|
42
|
-
t.key === "Escape" &&
|
|
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
|
-
|
|
49
|
+
D,
|
|
49
50
|
{
|
|
50
|
-
|
|
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:
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
streaming: E,
|
|
57
|
+
loading: b,
|
|
58
|
+
onCancel: v,
|
|
59
|
+
onKeyDown: R
|
|
57
60
|
},
|
|
58
61
|
/* @__PURE__ */ e.createElement(
|
|
59
|
-
|
|
62
|
+
S,
|
|
60
63
|
{
|
|
61
|
-
promptSuggestions:
|
|
62
|
-
promptValue:
|
|
63
|
-
promptInput: w || /* @__PURE__ */ e.createElement(
|
|
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
|
-
|
|
68
|
+
z,
|
|
66
69
|
{
|
|
67
|
-
svgIcon:
|
|
70
|
+
svgIcon: O,
|
|
68
71
|
icon: "table-wizard",
|
|
69
72
|
type: "button",
|
|
70
|
-
title: m.toLanguageString(a,
|
|
73
|
+
title: m.toLanguageString(a, d[a])
|
|
71
74
|
},
|
|
72
|
-
m.toLanguageString(a,
|
|
75
|
+
m.toLanguageString(a, d[a])
|
|
73
76
|
)
|
|
74
77
|
}
|
|
75
78
|
),
|
|
76
79
|
/* @__PURE__ */ e.createElement(
|
|
77
|
-
|
|
80
|
+
q,
|
|
78
81
|
{
|
|
79
|
-
outputs:
|
|
82
|
+
outputs: i,
|
|
80
83
|
showOutputRating: !0,
|
|
81
|
-
onCopy:
|
|
82
|
-
onOutputRating:
|
|
83
|
-
outputCard: V || { body:
|
|
84
|
+
onCopy: y,
|
|
85
|
+
onOutputRating: C,
|
|
86
|
+
outputCard: V || { body: H }
|
|
84
87
|
}
|
|
85
88
|
)
|
|
86
89
|
);
|
|
87
90
|
};
|
|
88
91
|
export {
|
|
89
|
-
|
|
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"),
|
|
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
|
-
}),
|
|
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
|
-
|
|
61
|
+
T as gridPremiumFeatures,
|
|
62
62
|
C as isPremiumGridByColumns,
|
|
63
63
|
p as isPremiumGridByComponents,
|
|
64
64
|
g as isPremiumGridByProps
|