@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.
- package/GridClientWrapper.js +1 -1
- package/GridClientWrapper.mjs +137 -133
- package/GridComponent.js +1 -1
- package/GridComponent.mjs +185 -185
- package/StatusBar.js +1 -1
- package/StatusBar.mjs +24 -24
- 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 +18 -18
- package/toolbar-tools/GridToolbarAIAssistant.js +2 -2
- package/toolbar-tools/GridToolbarAIAssistant.mjs +111 -118
- 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
package/StatusBar.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"),i=require("@progress/kendo-react-common"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("react"),i=require("@progress/kendo-react-common"),y=require("./package-metadata.js");function E(s){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const o in s)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(s,o);Object.defineProperty(a,o,r.get?r:{enumerable:!0,get:()=>s[o]})}}return a.default=s,Object.freeze(a)}const l=E(D),S=s=>{const{data:a=[]}=s,o=!i.validatePackage(y.packageMetadata,{component:"StatusBar"}),r=i.getLicenseMessage(y.packageMetadata);return l.createElement("div",{className:"k-selection-aggregates k-grid-selection-aggregates"},a.map((g,m)=>l.createElement("div",{key:m},l.createElement("span",{className:"k-selection-aggregates-item-text"},g.type,": "),l.createElement("span",{className:"k-selection-aggregates-item-value"},g.formattedValue))),o&&l.createElement(i.WatermarkOverlay,{message:r}))};S.displayName="KendoReactGridStatusBar";const k=s=>{var o;const a=s.slice();for(let r=0;r<a.length;r++)for(;a[r]&&((o=a[r].children)!=null&&o.length);)a.splice(r,1,...a[r].children);return a},O=s=>{const{dataItems:a,target:o}=s,g=k(o.columns).map(e=>e.field).filter(e=>e&&typeof e=="string").map(e=>i.getter(e)),m=e=>s.select[i.getter(s.dataItemKey)(e)],t={dates:[],numbers:[],booleans:[],others:[]},M=e=>{typeof e=="number"?t.numbers.push(e):typeof e=="boolean"?t.booleans.push(e):e instanceof Date?t.dates.push(e):t.others.push(e)};a.forEach(e=>{const n=m(e);Array.isArray(n)&&n.forEach(c=>{M(g[c](e))})});const d=t.dates.map(e=>e.getTime()),f=t.booleans.filter(e=>e).length,h=t.booleans.filter(e=>!e).length,u=t.numbers.length?t.numbers.reduce((e,n)=>e+n,0):void 0,p={sum:u,average:typeof u=="number"?u/t.numbers.length:void 0,min:t.numbers.length?Math.min(...t.numbers):void 0,max:t.numbers.length?Math.max(...t.numbers):void 0,count:t.numbers.length+t.booleans.length+t.dates.length+t.others.length,isTrue:f>0?f:void 0,isFalse:h>0?h:void 0,earliest:t.dates.length?new Date(Math.min(...d)):void 0,latest:t.dates.length?new Date(Math.max(...d)):void 0},v=(e,n)=>(n==="sum"||n==="average")&&typeof e=="number"?e.toFixed(2):(n==="earliest"||n==="latest")&&e instanceof Date?e.toLocaleDateString():String(e),b=[];return Object.keys(p).forEach(e=>{const n=e,c=p[n];c!==void 0&&b.push({type:n,value:c,formattedValue:v(c,n)})}),b};exports.StatusBar=S;exports.getStatusData=O;exports.leafColumns=k;
|
package/StatusBar.mjs
CHANGED
|
@@ -5,12 +5,12 @@
|
|
|
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 { validatePackage as
|
|
10
|
-
import { packageMetadata as
|
|
8
|
+
import * as l from "react";
|
|
9
|
+
import { validatePackage as v, getLicenseMessage as M, WatermarkOverlay as S, getter as b } from "@progress/kendo-react-common";
|
|
10
|
+
import { packageMetadata as y } from "./package-metadata.mjs";
|
|
11
11
|
const x = (o) => {
|
|
12
|
-
const { data: a = [] } = o, r = !
|
|
13
|
-
return /* @__PURE__ */
|
|
12
|
+
const { data: a = [] } = o, r = !v(y, { component: "StatusBar" }), n = M(y);
|
|
13
|
+
return /* @__PURE__ */ l.createElement("div", { className: "k-selection-aggregates k-grid-selection-aggregates" }, a.map((i, m) => /* @__PURE__ */ l.createElement("div", { key: m }, /* @__PURE__ */ l.createElement("span", { className: "k-selection-aggregates-item-text" }, i.type, ": "), /* @__PURE__ */ l.createElement("span", { className: "k-selection-aggregates-item-value" }, i.formattedValue))), r && /* @__PURE__ */ l.createElement(S, { message: n }));
|
|
14
14
|
};
|
|
15
15
|
x.displayName = "KendoReactGridStatusBar";
|
|
16
16
|
const D = (o) => {
|
|
@@ -20,36 +20,36 @@ const D = (o) => {
|
|
|
20
20
|
for (; a[n] && ((r = a[n].children) != null && r.length); )
|
|
21
21
|
a.splice(n, 1, ...a[n].children);
|
|
22
22
|
return a;
|
|
23
|
-
},
|
|
23
|
+
}, A = (o) => {
|
|
24
24
|
const { dataItems: a, target: r } = o, i = D(r.columns).map((e) => e.field).filter((e) => e && typeof e == "string").map(
|
|
25
|
-
(e) =>
|
|
26
|
-
),
|
|
25
|
+
(e) => b(e)
|
|
26
|
+
), m = (e) => o.select[b(o.dataItemKey)(e)], t = { dates: [], numbers: [], booleans: [], others: [] }, E = (e) => {
|
|
27
27
|
typeof e == "number" ? t.numbers.push(e) : typeof e == "boolean" ? t.booleans.push(e) : e instanceof Date ? t.dates.push(e) : t.others.push(e);
|
|
28
28
|
};
|
|
29
29
|
a.forEach((e) => {
|
|
30
|
-
const s =
|
|
31
|
-
Array.isArray(s) && s.forEach((
|
|
32
|
-
|
|
30
|
+
const s = m(e);
|
|
31
|
+
Array.isArray(s) && s.forEach((c) => {
|
|
32
|
+
E(i[c](e));
|
|
33
33
|
});
|
|
34
34
|
});
|
|
35
|
-
const
|
|
36
|
-
sum:
|
|
37
|
-
average: typeof
|
|
35
|
+
const d = t.dates.map((e) => e.getTime()), u = t.booleans.filter((e) => e).length, h = t.booleans.filter((e) => !e).length, g = t.numbers.length ? t.numbers.reduce((e, s) => e + s, 0) : void 0, f = {
|
|
36
|
+
sum: g,
|
|
37
|
+
average: typeof g == "number" ? g / t.numbers.length : void 0,
|
|
38
38
|
min: t.numbers.length ? Math.min(...t.numbers) : void 0,
|
|
39
39
|
max: t.numbers.length ? Math.max(...t.numbers) : void 0,
|
|
40
40
|
count: t.numbers.length + t.booleans.length + t.dates.length + t.others.length,
|
|
41
|
-
isTrue:
|
|
42
|
-
isFalse:
|
|
43
|
-
earliest: t.dates.length ? new Date(Math.min(...
|
|
44
|
-
latest: t.dates.length ? new Date(Math.max(...
|
|
45
|
-
},
|
|
46
|
-
return Object.keys(
|
|
47
|
-
const s = e,
|
|
48
|
-
|
|
49
|
-
}),
|
|
41
|
+
isTrue: u > 0 ? u : void 0,
|
|
42
|
+
isFalse: h > 0 ? h : void 0,
|
|
43
|
+
earliest: t.dates.length ? new Date(Math.min(...d)) : void 0,
|
|
44
|
+
latest: t.dates.length ? new Date(Math.max(...d)) : void 0
|
|
45
|
+
}, k = (e, s) => (s === "sum" || s === "average") && typeof e == "number" ? e.toFixed(2) : (s === "earliest" || s === "latest") && e instanceof Date ? e.toLocaleDateString() : String(e), p = [];
|
|
46
|
+
return Object.keys(f).forEach((e) => {
|
|
47
|
+
const s = e, c = f[s];
|
|
48
|
+
c !== void 0 && p.push({ type: s, value: c, formattedValue: k(c, s) });
|
|
49
|
+
}), p;
|
|
50
50
|
};
|
|
51
51
|
export {
|
|
52
52
|
x as StatusBar,
|
|
53
|
-
|
|
53
|
+
A as getStatusData,
|
|
54
54
|
D as leafColumns
|
|
55
55
|
};
|