@progress/kendo-react-grid 10.0.0-develop.2 → 10.0.0-develop.4
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/GridClientContextReader.js +1 -1
- package/GridClientContextReader.mjs +14 -15
- package/GridClientWrapper.js +1 -1
- package/GridClientWrapper.mjs +428 -433
- package/GridComponent.js +1 -1
- package/GridComponent.mjs +374 -356
- package/README.md +61 -15
- package/components/colGroup/GridColGroup.js +1 -1
- package/components/colGroup/GridColGroup.mjs +6 -6
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/drag/ColumnResize.js +1 -1
- package/drag/ColumnResize.mjs +111 -80
- package/index.d.mts +8 -0
- package/index.d.ts +8 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +13 -13
- package/utils/index.js +1 -1
- package/utils/index.mjs +163 -151
- package/utils/premium.js +1 -1
- package/utils/premium.mjs +6 -6
package/drag/ColumnResize.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 p=1,
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("../utils/index.js"),G=1,w=20;class F{constructor(u){this.columns=[],this.columnsState=[],this.resizable=!1,this.isRtl=!1,this.setIsRtl=c=>{this.isRtl=c},this.initWidths=()=>{var r;const c=((r=this.colGroupMain)==null?void 0:r.children)||[],l=p.getFlatColumnsState(this.columnsState),h=this.columns.filter(s=>{var o;return!((o=s.children)!=null&&o.length)});for(let s=0;s<c.length;s++){const o=c[s];let t="";const i=l.find(n=>n.id===h[s].id);i&&(t=i.width||""),o.width=t,this.colGroupHeader&&(this.colGroupHeader.children[s].width=t),this.colGroupFooter&&(this.colGroupFooter.children[s].width=t)}},this.dragHandler=(c,l,h,r)=>{const s=c.originalEvent;r||(s.preventDefault(),s.stopPropagation(),s.stopImmediatePropagation());const o=h.closest("th");if(!o||!o)return;const t=o.clientWidth;let i=t;if(this.isRtl?i+=h.getBoundingClientRect().right-h.offsetWidth/2-c.clientX:i+=c.clientX-h.getBoundingClientRect().left-h.offsetWidth/2,!r&&Math.abs(i-t)<1)return;this.fixateInitialWidths(o.parentElement.clientWidth),this.setWidths(l,Math.floor(i)/t);const n=this.columns.filter(e=>!e.children.length).findIndex(e=>e.id===l.id);this.onResize(n,t,i,s,r,this.columnsState,l.id)},this.dblClickHandler=(c,l)=>{const h=this.columns.filter(d=>l.indexOf(d.id)>-1),r=p.getFlatColumnsState(this.columnsState);if(!this.colGroupMain||!h.length)return;const s={},o=h;for(;o.length>0;){const d=o.pop();if(!d)break;d.children.length?o.push(...d.children):s[d.id]=d}const t=this.columns.filter(d=>!d.children.length),i=[];t.forEach((d,f)=>{s[d.id]&&i.push(f)});const n=[this.colGroupMain.parentElement],e=[this.colGroupMain];this.colGroupHeader&&(n.push(this.colGroupHeader.parentElement),e.push(this.colGroupHeader)),this.colGroupFooter&&(n.push(this.colGroupFooter.parentElement),e.push(this.colGroupFooter)),n.forEach(d=>d.classList.add("k-autofitting"));const a=[];e.forEach(d=>{i.forEach(f=>{d.children[f]&&(d.children[f].width="",a[f]=Math.max(a[f]||0,d.children[f].offsetWidth+G))})}),e.forEach(d=>{i.forEach(f=>{if(d.children[f]){d.children[f].width=a[f]+"px";const g=r.find(m=>m.id===t[f].id);g&&(g.width=a[f])}})}),n.forEach(d=>d.classList.remove("k-autofitting")),this.onResize(i[0],0,0,c,!0,this.columnsState,l[0])},this.updateColElements=c=>{const l=this.columns.filter(r=>!r.hidden&&!r.children.length);let h=1e-10;for(let r=0;r<c.length;r++){const s=c[r],o=l.findIndex(a=>a.id===s.id),t=parseFloat((s.width||0).toString()),i=Math.floor(t);h+=t-i;const n=i+Math.floor(h);h-=Math.floor(h);const e=l.find(a=>a.id===s.id);if(!e)return;if(this.colGroupMain&&this.colGroupMain.children[o]){const a=parseInt(this.colGroupMain.children[o].width,10);this.colGroupMain.children[o].width=n+"px",this.updateNextLockedCol(this.colGroupMain.parentElement,e,a-n)}if(this.colGroupHeader&&this.colGroupHeader.children[o]){const a=parseInt(this.colGroupHeader.children[o].width,10);this.colGroupHeader.children[o].width=n+"px",this.updateNextLockedCol(this.colGroupHeader.parentElement,e,a-n)}if(this.colGroupFooter&&this.colGroupFooter.children[o]){const a=parseInt(this.colGroupFooter.children[o].width,10);this.colGroupFooter.children[o].width=n+"px",this.updateNextLockedCol(this.colGroupFooter.parentElement,e,a-n)}}},this.onResize=u}fixateInitialWidths(u){var o;let c=0;const l=((o=this.colGroupMain)==null?void 0:o.children)||[];for(let t=0;t<l.length;t++)l[t].width?u-=parseFloat(l[t].width):c++;if(c===0)return;const h=Math.floor(u/c),r=p.getFlatColumnsState(this.columnsState),s=this.columns.filter(t=>!t.children.length);for(let t=0;t<l.length;t++){const i=l[t];if(!i.width){i.width=h;const n=r.find(e=>e.id===s[t].id);n&&(n.width=h.toString()),this.colGroupHeader&&(this.colGroupHeader.children[t].width=h),this.colGroupFooter&&(this.colGroupFooter.children[t].width=h)}}}setWidths(u,c){const l=p.getFlatColumnsState(this.columnsState),h=this.columns.findIndex(t=>t.id===u.id),r=[];let s=u.children.filter(t=>!t.hidden).length;for(let t=h+1;t<this.columns.length&&!(s<=0);t++){const i=this.columns[t];i.children.length?s+=i.children.filter(n=>!n.hidden).length:r.push(i),s--}r.length===0&&r.push(u);const o=[];r.forEach(t=>{const i=l.find(n=>n.id===t.id);if(i){let n=i.width?parseFloat(i.width.toString())*c:0;const e=t.minResizableWidth===void 0?10:t.minResizableWidth;n<e&&(n=e),i.width=n,o.push(i)}}),this.updateColElements(o)}updateNextLockedCol(u,c,l){const h=c.index,r=this.colGroupMain.parentElement.closest(".k-grid"),s=r==null?void 0:r.clientWidth,o=this.columns.filter(t=>t.locked).map(t=>parseInt(t.width+"",10)).reduce((t,i)=>t+i,0);!c.locked||s<=o+w||this.columns.forEach(t=>{if(t!=null&&t.locked&&l){const i=u==null?void 0:u.querySelectorAll('[aria-colindex="'+t.ariaColumnIndex+'"]');i==null||i.forEach(n=>{const e=n.style;this.isRtl?(t.index>h&&e&&e.right&&(e.right=parseInt(e.right,10)-l+"px"),t.index<h&&e&&e.left&&(e.left=parseInt(e.left,10)-l+"px")):(t.index>h&&e&&e.left&&(e.left=parseInt(e.left,10)-l+"px"),t.index<h&&e&&e.right&&(e.right=parseInt(e.right,10)-l+"px"))})}})}}exports.ColumnResize=F;
|
package/drag/ColumnResize.mjs
CHANGED
|
@@ -5,115 +5,146 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
import { getFlatColumnsState as u } from "../utils/index.mjs";
|
|
9
|
+
const m = 1, w = 20;
|
|
10
|
+
class E {
|
|
11
|
+
constructor(p) {
|
|
12
|
+
this.columns = [], this.columnsState = [], this.resizable = !1, this.isRtl = !1, this.setIsRtl = (c) => {
|
|
11
13
|
this.isRtl = c;
|
|
12
|
-
}, this.
|
|
13
|
-
|
|
14
|
-
r
|
|
15
|
-
|
|
14
|
+
}, this.initWidths = () => {
|
|
15
|
+
var r;
|
|
16
|
+
const c = ((r = this.colGroupMain) == null ? void 0 : r.children) || [], l = u(this.columnsState), n = this.columns.filter((s) => {
|
|
17
|
+
var o;
|
|
18
|
+
return !((o = s.children) != null && o.length);
|
|
19
|
+
});
|
|
20
|
+
for (let s = 0; s < c.length; s++) {
|
|
21
|
+
const o = c[s];
|
|
22
|
+
let t = "";
|
|
23
|
+
const i = l.find((h) => h.id === n[s].id);
|
|
24
|
+
i && (t = i.width || ""), o.width = t, this.colGroupHeader && (this.colGroupHeader.children[s].width = t), this.colGroupFooter && (this.colGroupFooter.children[s].width = t);
|
|
25
|
+
}
|
|
26
|
+
}, this.dragHandler = (c, l, n, r) => {
|
|
27
|
+
const s = c.originalEvent;
|
|
28
|
+
r || (s.preventDefault(), s.stopPropagation(), s.stopImmediatePropagation());
|
|
29
|
+
const o = n.closest("th");
|
|
16
30
|
if (!o || !o)
|
|
17
31
|
return;
|
|
18
|
-
const
|
|
19
|
-
let
|
|
20
|
-
if (this.isRtl ?
|
|
32
|
+
const t = o.clientWidth;
|
|
33
|
+
let i = t;
|
|
34
|
+
if (this.isRtl ? i += n.getBoundingClientRect().right - n.offsetWidth / 2 - c.clientX : i += c.clientX - n.getBoundingClientRect().left - n.offsetWidth / 2, !r && Math.abs(i - t) < 1)
|
|
21
35
|
return;
|
|
22
|
-
this.fixateInitialWidths(o.parentElement.clientWidth), this.setWidths(
|
|
23
|
-
const
|
|
24
|
-
this.onResize(
|
|
25
|
-
}, this.dblClickHandler = (c,
|
|
26
|
-
const
|
|
27
|
-
if (!this.colGroupMain || !
|
|
36
|
+
this.fixateInitialWidths(o.parentElement.clientWidth), this.setWidths(l, Math.floor(i) / t);
|
|
37
|
+
const h = this.columns.filter((e) => !e.children.length).findIndex((e) => e.id === l.id);
|
|
38
|
+
this.onResize(h, t, i, s, r, this.columnsState, l.id);
|
|
39
|
+
}, this.dblClickHandler = (c, l) => {
|
|
40
|
+
const n = this.columns.filter((d) => l.indexOf(d.id) > -1), r = u(this.columnsState);
|
|
41
|
+
if (!this.colGroupMain || !n.length)
|
|
28
42
|
return;
|
|
29
|
-
const
|
|
30
|
-
for (;
|
|
31
|
-
const
|
|
32
|
-
if (!
|
|
43
|
+
const s = {}, o = n;
|
|
44
|
+
for (; o.length > 0; ) {
|
|
45
|
+
const d = o.pop();
|
|
46
|
+
if (!d)
|
|
33
47
|
break;
|
|
34
|
-
|
|
48
|
+
d.children.length ? o.push(...d.children) : s[d.id] = d;
|
|
35
49
|
}
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
50
|
+
const t = this.columns.filter((d) => !d.children.length), i = [];
|
|
51
|
+
t.forEach((d, f) => {
|
|
52
|
+
s[d.id] && i.push(f);
|
|
39
53
|
});
|
|
40
|
-
const
|
|
41
|
-
this.colGroupHeader && (
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
54
|
+
const h = [this.colGroupMain.parentElement], e = [this.colGroupMain];
|
|
55
|
+
this.colGroupHeader && (h.push(this.colGroupHeader.parentElement), e.push(this.colGroupHeader)), this.colGroupFooter && (h.push(this.colGroupFooter.parentElement), e.push(this.colGroupFooter)), h.forEach((d) => d.classList.add("k-autofitting"));
|
|
56
|
+
const a = [];
|
|
57
|
+
e.forEach((d) => {
|
|
58
|
+
i.forEach((f) => {
|
|
59
|
+
d.children[f] && (d.children[f].width = "", a[f] = Math.max(
|
|
60
|
+
a[f] || 0,
|
|
61
|
+
d.children[f].offsetWidth + m
|
|
48
62
|
));
|
|
49
63
|
});
|
|
50
|
-
}),
|
|
51
|
-
|
|
52
|
-
|
|
64
|
+
}), e.forEach((d) => {
|
|
65
|
+
i.forEach((f) => {
|
|
66
|
+
if (d.children[f]) {
|
|
67
|
+
d.children[f].width = a[f] + "px";
|
|
68
|
+
const g = r.find((G) => G.id === t[f].id);
|
|
69
|
+
g && (g.width = a[f]);
|
|
70
|
+
}
|
|
53
71
|
});
|
|
54
|
-
}),
|
|
72
|
+
}), h.forEach((d) => d.classList.remove("k-autofitting")), this.onResize(i[0], 0, 0, c, !0, this.columnsState, l[0]);
|
|
55
73
|
}, this.updateColElements = (c) => {
|
|
56
|
-
const
|
|
57
|
-
let
|
|
74
|
+
const l = this.columns.filter((r) => !r.hidden && !r.children.length);
|
|
75
|
+
let n = 1e-10;
|
|
58
76
|
for (let r = 0; r < c.length; r++) {
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
77
|
+
const s = c[r], o = l.findIndex((a) => a.id === s.id), t = parseFloat((s.width || 0).toString()), i = Math.floor(t);
|
|
78
|
+
n += t - i;
|
|
79
|
+
const h = i + Math.floor(n);
|
|
80
|
+
n -= Math.floor(n);
|
|
81
|
+
const e = l.find((a) => a.id === s.id);
|
|
82
|
+
if (!e)
|
|
83
|
+
return;
|
|
84
|
+
if (this.colGroupMain && this.colGroupMain.children[o]) {
|
|
85
|
+
const a = parseInt(this.colGroupMain.children[o].width, 10);
|
|
86
|
+
this.colGroupMain.children[o].width = h + "px", this.updateNextLockedCol(this.colGroupMain.parentElement, e, a - h);
|
|
65
87
|
}
|
|
66
88
|
if (this.colGroupHeader && this.colGroupHeader.children[o]) {
|
|
67
|
-
const
|
|
68
|
-
this.colGroupHeader.children[o].width =
|
|
89
|
+
const a = parseInt(this.colGroupHeader.children[o].width, 10);
|
|
90
|
+
this.colGroupHeader.children[o].width = h + "px", this.updateNextLockedCol(this.colGroupHeader.parentElement, e, a - h);
|
|
69
91
|
}
|
|
70
92
|
if (this.colGroupFooter && this.colGroupFooter.children[o]) {
|
|
71
|
-
const
|
|
72
|
-
this.colGroupFooter.children[o].width =
|
|
93
|
+
const a = parseInt(this.colGroupFooter.children[o].width, 10);
|
|
94
|
+
this.colGroupFooter.children[o].width = h + "px", this.updateNextLockedCol(this.colGroupFooter.parentElement, e, a - h);
|
|
73
95
|
}
|
|
74
96
|
}
|
|
75
|
-
}, this.onResize =
|
|
97
|
+
}, this.onResize = p;
|
|
76
98
|
}
|
|
77
|
-
fixateInitialWidths(
|
|
78
|
-
|
|
79
|
-
let
|
|
80
|
-
const
|
|
81
|
-
for (let t = 0; t <
|
|
82
|
-
|
|
83
|
-
if (
|
|
99
|
+
fixateInitialWidths(p) {
|
|
100
|
+
var o;
|
|
101
|
+
let c = 0;
|
|
102
|
+
const l = ((o = this.colGroupMain) == null ? void 0 : o.children) || [];
|
|
103
|
+
for (let t = 0; t < l.length; t++)
|
|
104
|
+
l[t].width ? p -= parseFloat(l[t].width) : c++;
|
|
105
|
+
if (c === 0)
|
|
84
106
|
return;
|
|
85
|
-
const
|
|
86
|
-
for (let t = 0; t <
|
|
87
|
-
const
|
|
88
|
-
|
|
107
|
+
const n = Math.floor(p / c), r = u(this.columnsState), s = this.columns.filter((t) => !t.children.length);
|
|
108
|
+
for (let t = 0; t < l.length; t++) {
|
|
109
|
+
const i = l[t];
|
|
110
|
+
if (!i.width) {
|
|
111
|
+
i.width = n;
|
|
112
|
+
const h = r.find((e) => e.id === s[t].id);
|
|
113
|
+
h && (h.width = n.toString()), this.colGroupHeader && (this.colGroupHeader.children[t].width = n), this.colGroupFooter && (this.colGroupFooter.children[t].width = n);
|
|
114
|
+
}
|
|
89
115
|
}
|
|
90
116
|
}
|
|
91
|
-
setWidths(
|
|
92
|
-
const n = this.columns.findIndex((t) => t.id ===
|
|
93
|
-
let
|
|
94
|
-
for (let t = n + 1; t < this.columns.length && !(
|
|
95
|
-
const
|
|
96
|
-
|
|
117
|
+
setWidths(p, c) {
|
|
118
|
+
const l = u(this.columnsState), n = this.columns.findIndex((t) => t.id === p.id), r = [];
|
|
119
|
+
let s = p.children.filter((t) => !t.hidden).length;
|
|
120
|
+
for (let t = n + 1; t < this.columns.length && !(s <= 0); t++) {
|
|
121
|
+
const i = this.columns[t];
|
|
122
|
+
i.children.length ? s += i.children.filter((h) => !h.hidden).length : r.push(i), s--;
|
|
97
123
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
124
|
+
r.length === 0 && r.push(p);
|
|
125
|
+
const o = [];
|
|
126
|
+
r.forEach((t) => {
|
|
127
|
+
const i = l.find((h) => h.id === t.id);
|
|
128
|
+
if (i) {
|
|
129
|
+
let h = i.width ? parseFloat(i.width.toString()) * c : 0;
|
|
130
|
+
const e = t.minResizableWidth === void 0 ? 10 : t.minResizableWidth;
|
|
131
|
+
h < e && (h = e), i.width = h, o.push(i);
|
|
132
|
+
}
|
|
133
|
+
}), this.updateColElements(o);
|
|
103
134
|
}
|
|
104
|
-
updateNextLockedCol(
|
|
105
|
-
const
|
|
106
|
-
!c.locked ||
|
|
107
|
-
if (
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
const
|
|
111
|
-
this.isRtl ? (
|
|
135
|
+
updateNextLockedCol(p, c, l) {
|
|
136
|
+
const n = c.index, r = this.colGroupMain.parentElement.closest(".k-grid"), s = r == null ? void 0 : r.clientWidth, o = this.columns.filter((t) => t.locked).map((t) => parseInt(t.width + "", 10)).reduce((t, i) => t + i, 0);
|
|
137
|
+
!c.locked || s <= o + w || this.columns.forEach((t) => {
|
|
138
|
+
if (t != null && t.locked && l) {
|
|
139
|
+
const i = p == null ? void 0 : p.querySelectorAll('[aria-colindex="' + t.ariaColumnIndex + '"]');
|
|
140
|
+
i == null || i.forEach((h) => {
|
|
141
|
+
const e = h.style;
|
|
142
|
+
this.isRtl ? (t.index > n && e && e.right && (e.right = parseInt(e.right, 10) - l + "px"), t.index < n && e && e.left && (e.left = parseInt(e.left, 10) - l + "px")) : (t.index > n && e && e.left && (e.left = parseInt(e.left, 10) - l + "px"), t.index < n && e && e.right && (e.right = parseInt(e.right, 10) - l + "px"));
|
|
112
143
|
});
|
|
113
144
|
}
|
|
114
145
|
});
|
|
115
146
|
}
|
|
116
147
|
}
|
|
117
148
|
export {
|
|
118
|
-
|
|
149
|
+
E as ColumnResize
|
|
119
150
|
};
|
package/index.d.mts
CHANGED
|
@@ -1242,6 +1242,14 @@ export declare interface GridColumnState {
|
|
|
1242
1242
|
* The value indicating whether a column is visible or not.
|
|
1243
1243
|
*/
|
|
1244
1244
|
hidden?: boolean;
|
|
1245
|
+
/**
|
|
1246
|
+
* The width of the column (in pixels).
|
|
1247
|
+
*/
|
|
1248
|
+
width?: string | number;
|
|
1249
|
+
/**
|
|
1250
|
+
* The position of the column.
|
|
1251
|
+
*/
|
|
1252
|
+
orderIndex?: number;
|
|
1245
1253
|
/**
|
|
1246
1254
|
* A collection of child states.
|
|
1247
1255
|
*/
|
package/index.d.ts
CHANGED
|
@@ -1242,6 +1242,14 @@ export declare interface GridColumnState {
|
|
|
1242
1242
|
* The value indicating whether a column is visible or not.
|
|
1243
1243
|
*/
|
|
1244
1244
|
hidden?: boolean;
|
|
1245
|
+
/**
|
|
1246
|
+
* The width of the column (in pixels).
|
|
1247
|
+
*/
|
|
1248
|
+
width?: string | number;
|
|
1249
|
+
/**
|
|
1250
|
+
* The position of the column.
|
|
1251
|
+
*/
|
|
1252
|
+
orderIndex?: number;
|
|
1245
1253
|
/**
|
|
1246
1254
|
* A collection of child states.
|
|
1247
1255
|
*/
|
package/package-metadata.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 e={name:"@progress/kendo-react-grid",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-react-grid",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1741335179,version:"10.0.0-develop.4",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};exports.packageMetadata=e;
|
package/package-metadata.mjs
CHANGED
|
@@ -10,8 +10,8 @@ const e = {
|
|
|
10
10
|
productName: "KendoReact",
|
|
11
11
|
productCode: "KENDOUIREACT",
|
|
12
12
|
productCodes: ["KENDOUIREACT"],
|
|
13
|
-
publishDate:
|
|
14
|
-
version: "10.0.0-develop.
|
|
13
|
+
publishDate: 1741335179,
|
|
14
|
+
version: "10.0.0-develop.4",
|
|
15
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
16
16
|
};
|
|
17
17
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-grid",
|
|
3
|
-
"version": "10.0.0-develop.
|
|
3
|
+
"version": "10.0.0-develop.4",
|
|
4
4
|
"description": "React Data Grid (Table) provides 100+ ready-to-use data grid features. KendoReact Grid package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -28,17 +28,17 @@
|
|
|
28
28
|
"@progress/kendo-data-query": "^1.0.0",
|
|
29
29
|
"@progress/kendo-drawing": "^1.21.2",
|
|
30
30
|
"@progress/kendo-licensing": "^1.5.0",
|
|
31
|
-
"@progress/kendo-react-animation": "10.0.0-develop.
|
|
32
|
-
"@progress/kendo-react-buttons": "10.0.0-develop.
|
|
33
|
-
"@progress/kendo-react-common": "10.0.0-develop.
|
|
34
|
-
"@progress/kendo-react-data-tools": "10.0.0-develop.
|
|
35
|
-
"@progress/kendo-react-dateinputs": "10.0.0-develop.
|
|
36
|
-
"@progress/kendo-react-indicators": "10.0.0-develop.
|
|
37
|
-
"@progress/kendo-react-dropdowns": "10.0.0-develop.
|
|
38
|
-
"@progress/kendo-react-inputs": "10.0.0-develop.
|
|
39
|
-
"@progress/kendo-react-intl": "10.0.0-develop.
|
|
40
|
-
"@progress/kendo-react-popup": "10.0.0-develop.
|
|
41
|
-
"@progress/kendo-react-layout": "10.0.0-develop.
|
|
31
|
+
"@progress/kendo-react-animation": "10.0.0-develop.4",
|
|
32
|
+
"@progress/kendo-react-buttons": "10.0.0-develop.4",
|
|
33
|
+
"@progress/kendo-react-common": "10.0.0-develop.4",
|
|
34
|
+
"@progress/kendo-react-data-tools": "10.0.0-develop.4",
|
|
35
|
+
"@progress/kendo-react-dateinputs": "10.0.0-develop.4",
|
|
36
|
+
"@progress/kendo-react-indicators": "10.0.0-develop.4",
|
|
37
|
+
"@progress/kendo-react-dropdowns": "10.0.0-develop.4",
|
|
38
|
+
"@progress/kendo-react-inputs": "10.0.0-develop.4",
|
|
39
|
+
"@progress/kendo-react-intl": "10.0.0-develop.4",
|
|
40
|
+
"@progress/kendo-react-popup": "10.0.0-develop.4",
|
|
41
|
+
"@progress/kendo-react-layout": "10.0.0-develop.4",
|
|
42
42
|
"@progress/kendo-svg-icons": "^4.0.0",
|
|
43
43
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
|
44
44
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"package": {
|
|
85
85
|
"productName": "KendoReact",
|
|
86
86
|
"productCode": "KENDOUIREACT",
|
|
87
|
-
"publishDate":
|
|
87
|
+
"publishDate": 1741335179,
|
|
88
88
|
"licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
89
89
|
}
|
|
90
90
|
},
|
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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("react"),w=require("../GridColumn.js"),S=require("@progress/kendo-data-query"),y=require("@progress/kendo-react-data-tools"),q=require("./_serverModule.js"),G=require("./_clientModule.js"),g=require("../contextMenu/enums.js"),k=require("@progress/kendo-react-common");function p(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const M=p(j);function v(e,t){const n=(e!=null?e:"").split(".");let i=t;return n.forEach(l=>{i=i?i[l]:void 0}),i}function b(e,t,n,i,l,d,r,a,o,s,h=0,c){var I;let u=h;for(let f=0;f<t.length;f++){let m;if(!l||t[f].value===void 0||t[f].items===void 0){e[e.length]={dataIndex:i.index,dataItem:t[f],rowType:"data",level:h,group:c,expanded:(I=d?v(d,t[f]):s&&!!(r!=null&&r[S.getter(s)(t[f])]))!=null?I:!1},i.index++;continue}else{let C;c!=null&&c.parents?C=[{field:c.field,value:c.value},...c.parents]:c?C=[c]:C=[],m={field:t[f].field,value:t[f].value,parents:C}}u=Math.max(u,h+1);let x=!1;if(d)x=v(d,t[f])!==!1;else{const C=y.findGroupExpand(a||[],m);C?x=C.expanded!==!1:x=o!==!1}e[e.length]={dataIndex:-1,dataItem:t[f],level:h,group:m,rowType:"groupHeader",expanded:x},x&&(m.expanded=x,u=Math.max(b(e,t[f].items,n,i,l,d,r,a,o,s,h+1,m),u)),(n==="always"||x&&n==="visible")&&(e[e.length]={dataIndex:-1,dataItem:t[f],rowType:"groupFooter",level:h,expanded:x})}return u}const B=(e,t)=>typeof e.colSpan=="function"?e.colSpan({dataItem:t,column:e}):e.colSpan||1;function F(e,t){const n=[[]];let i=0;for(let r=e.length-1;r>=0;r--)i=Math.max(i,e[r].depth),e[r].headerColSpan=e[r].headerColSpan||1,e[r].children.length>0&&(e[r].headerColSpan=e[r].children.reduce((a,o)=>o.hidden?a:a+o.headerColSpan,0));const l=[];let d=1;return e.forEach((r,a)=>{n[r.depth]=n[r.depth]||[];let o=!1;n[r.depth].length===0&&(d<=1?d=1+(r.children.length>0?0:i-r.depth):(d--,o=!0)),r.rowSpan=1+(r.children.length>0?0:i-r.depth),r.kFirst=o,r.index=n[r.depth].length,n[r.depth].push(a),r.ariaColumnIndex=l[r.depth]?l[r.depth]+1:1;for(let s=r.depth;s<r.depth+r.rowSpan;s++)l[s]=(l[s]||0)+r.headerColSpan}),y.updateLeft(n,e,t),y.updateRight(n,e,t),n}function N(e,t,n,i=0,l=!1){const d=[];if(!e)return[];e&&e.length===void 0&&(e=[e]),e.forEach((a,o)=>{a=a.props?a.props:a;const s=a.id?a.id:y.tableKeyboardNavigationTools.generateNavigatableId(`${n.prevId++}`,n.idPrefix,"column"),h=k.canUseDOM&&a.media&&window.matchMedia?!window.matchMedia(a.media).matches:!1,c=l||h||a.hidden,u=t==null?void 0:t.find(f=>f.id===s),I=N(a.children,(u==null?void 0:u.children)||[],n,i+1,c);d.push(Object.assign({depth:i},w.gridDefaultProps,I.length?{cell:()=>null,filterCell:()=>null}:{},a,{id:s,declarationIndex:d.length,children:I,headerColSpan:0,rowSpan:0,columnType:a.columnType||"data",colSpan:a.colSpan||1,isAccessible:!0,hidden:c,left:null,right:null,rowSpannable:a.rowSpannable},u?{width:u.width,orderIndex:u.orderIndex}:{}))});const r=(a,o)=>a.orderIndex===o.orderIndex?a.declarationIndex-o.declarationIndex:(a.orderIndex||0)-(o.orderIndex||0);if(d.sort(r),i===0){const a=[],o=(s,h)=>s.forEach(c=>{c.parentIndex=h,o(c.children,a.push(c)-1)});return o(d,-1),a}return d}const D=e=>Array.isArray(e)?e:e?e.data:[];function H(e,t,n,i){const l=D(e),d=[];if(l.length>0){let r=l[0];if(t)for(let o=0;o<t.length;o++)r=r.items&&r.items[0];Object.getOwnPropertyNames(r).forEach(o=>{o!==n.column&&d.push(Object.assign({id:y.tableKeyboardNavigationTools.generateNavigatableId(`${i.prevId++}`,i.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},w.gridDefaultProps,{field:o}))})}return d}const _=(e,t)=>{let n=e[t.parentIndex];for(;n;){if(n.footerCell)return!0;n=e[n.parentIndex]}return!1},$=e=>e.filter(t=>_(e,t)?!1:!!t.footerCell||!(t.children&&t.children.length>0)),z=e=>e.width!==void 0?Math.floor(parseFloat(e.width.toString()))+"px":void 0,V=(e,t)=>t&&t.filter(n=>n.field===e).length>0,E=e=>(e.sort((t,n)=>t.declarationIndex-n.declarationIndex),e.map(t=>{const{declarationIndex:n,parentIndex:i,depth:l,headerColSpan:d,rowSpan:r,index:a,kFirst:o,children:s,...h}=t;return s.length?{children:E(s),...h}:h})),R=e=>{const{filterCell:t,headerCell:n,footerCell:i,cells:l,cell:d,rowSpannable:r,...a}=e;return e.children.length?{...a,children:e.children.map(R)}:a},A=e=>({id:e.id,field:e.field,title:e.title,width:e.width,hidden:!1,children:e.children?O(e.children):null}),O=e=>e.map(A),L=e=>{const t=[],n=i=>i==null?void 0:i.forEach(l=>{t.push(l),n(l.children)});return n(e),t},W=typeof window!="undefined"&&/Firefox/.test(window.navigator.userAgent),K=17895697,Q=e=>{let t=[];return e.sortable&&(t=t.concat([g.GridContextMenuItemNames.sortAsc,g.GridContextMenuItemNames.sortDesc])),t},U=e=>{let t=[];return e.clipboard&&(t=t.concat([g.GridContextMenuItemNames.copySelection,g.GridContextMenuItemNames.copySelectionNoHeaders,g.GridContextMenuItemNames.paste])),e.editable&&(t.length&&(t=t.concat([g.GridContextMenuItemNames.separator])),t=t.concat([g.GridContextMenuItemNames.create,g.GridContextMenuItemNames.edit,g.GridContextMenuItemNames.delete])),e.selectable&&(t.length&&(t=t.concat([g.GridContextMenuItemNames.separator])),t=t.concat([g.GridContextMenuItemNames.select])),e.rowReorderable&&(t.length&&(t=t.concat([g.GridContextMenuItemNames.separator])),t=t.concat([g.GridContextMenuItemNames.reorderRow])),t},J=(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},P=e=>{var n;return typeof e=="object"?(n=e.enabled)!=null?n:!0:e!=null?e:!1},X=()=>q.ServerFragment===G.ClientFragment,Y=e=>!!(e&&e.$$typeof===Symbol.for("react.client.reference")),Z=e=>({id:e.id,ariaColumnIndex:e.ariaColumnIndex,isSelected:e.isSelected,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,render:e.render,locked:e.locked,isRtl:e.isRtl,rowDataIndex:e.rowDataIndex,columnPosition:e.columnPosition,group:e.group}),ee=e=>{var i,l;const t=typeof e=="object"?(i=e.enabled)!=null?i:!0:e!=null?e:!1,n=typeof e=="object"?(l=e.valueGetter)!=null?l:(d,r)=>S.getter(r)(d):(d,r)=>S.getter(r)(d);return{enabled:t,valueGetter:n}},T=e=>{var t;return M.isValidElement(e)?e:(t=M.Children.toArray(e))==null?void 0:t[0]},te=(e,t)=>{const n=T(e);return n?M.cloneElement(n,t):null};exports.autoGenerateColumns=H;exports.clientColumn=R;exports.cloneReactElement=te;exports.firefox=W;exports.firefoxMaxHeight=K;exports.flatData=b;exports.footerColumns=$;exports.getClientCellProps=Z;exports.getColSpan=B;exports.getColumnState=A;exports.getColumnWidth=z;exports.getColumnsState=O;exports.getDataAsArray=D;exports.getDefaultBodyContextMenuItems=U;exports.getDefaultHeadContextMenuItems=Q;exports.getFlatColumnsState=L;exports.getNestedValue=v;exports.getReactElement=T;exports.getRowSpanOptions=ee;exports.isClient=X;exports.isClientReference=Y;exports.isRowReorderEnabled=P;exports.isSorted=V;exports.mapColumns=F;exports.readColumns=N;exports.resolveCells=J;exports.sanitizeColumns=E;
|