@progress/kendo-react-grid 13.2.0-develop.5 → 13.2.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/GridColumn.js +1 -1
- package/GridColumn.mjs +6 -4
- package/GridComponent.js +1 -1
- package/GridComponent.mjs +248 -248
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/drag/ColumnResize.js +1 -1
- package/drag/ColumnResize.mjs +114 -105
- package/index.d.mts +23 -1
- package/index.d.ts +23 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +17 -17
- package/utils/index.js +1 -1
- package/utils/index.mjs +169 -164
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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../utils/index.js"),m=1,w=20;class W{constructor(a){this.columns=[],this.columnsState=[],this.resizable=!1,this.isRtl=!1,this.setIsRtl=n=>{this.isRtl=n},this.initWidths=()=>{var c;const n=((c=this.colGroupMain)==null?void 0:c.children)||[],l=u.getFlatColumnsState(this.columnsState),r=this.columns.filter(e=>{var s;return!((s=e.children)!=null&&s.length)});for(let e=0;e<n.length;e++){const s=n[e],t=r[e];let i="";const h=l.find(o=>o.id===r[e].id);h&&(i=this.applyWidthConstraints(h,t)),s.width=i,this.colGroupHeader&&(this.colGroupHeader.children[e].width=i),this.colGroupFooter&&(this.colGroupFooter.children[e].width=i)}},this.dragHandler=(n,l,r,c)=>{const e=n.originalEvent;c||(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation());const s=r.closest("th");if(!s||!s)return;const t=s.clientWidth;let i=t;if(this.isRtl?i+=r.getBoundingClientRect().right-r.offsetWidth/2-n.clientX:i+=n.clientX-r.getBoundingClientRect().left-r.offsetWidth/2,!c&&Math.abs(i-t)<1)return;this.fixateInitialWidths(s.parentElement.clientWidth),this.setWidths(l,Math.floor(i)/t);const h=this.columns.filter(o=>!o.children.length).findIndex(o=>o.id===l.id);this.onResize(h,t,i,e,c,this.columnsState,l.id)},this.dblClickHandler=(n,l)=>{const r=this.columns.filter(d=>l.indexOf(d.id)>-1),c=u.getFlatColumnsState(this.columnsState);if(!this.colGroupMain||!r.length)return;const e={},s=r;for(;s.length>0;){const d=s.pop();if(!d)break;d.children.length?s.push(...d.children):e[d.id]=d}const t=this.columns.filter(d=>!d.children.length),i=[];t.forEach((d,p)=>{e[d.id]&&i.push(p)});const h=[this.colGroupMain.parentElement],o=[this.colGroupMain];this.colGroupHeader&&(h.push(this.colGroupHeader.parentElement),o.push(this.colGroupHeader)),this.colGroupFooter&&(h.push(this.colGroupFooter.parentElement),o.push(this.colGroupFooter)),h.forEach(d=>d.classList.add("k-autofitting"));const f=[];o.forEach(d=>{i.forEach(p=>{d.children[p]&&(d.children[p].width="",f[p]=Math.max(f[p]||0,d.children[p].offsetWidth+m))})}),o.forEach(d=>{i.forEach(p=>{if(d.children[p]){d.children[p].width=f[p]+"px";const g=c.find(G=>G.id===t[p].id);g&&(g.width=f[p])}})}),h.forEach(d=>d.classList.remove("k-autofitting")),this.onResize(i[0],0,0,n,!0,this.columnsState,l[0])},this.updateColElements=n=>{const l=this.columns.filter(c=>!c.hidden&&!c.children.length);let r=1e-10;for(let c=0;c<n.length;c++){const e=n[c],s=l.findIndex(f=>f.id===e.id),t=parseFloat((e.width||0).toString()),i=Math.floor(t);r+=t-i;const h=i+Math.floor(r);r-=Math.floor(r);const o=l.find(f=>f.id===e.id);if(!o)return;if(this.colGroupMain&&this.colGroupMain.children[s]){const f=parseInt(this.colGroupMain.children[s].width,10);this.colGroupMain.children[s].width=h+"px",this.updateNextLockedCol(this.colGroupMain.parentElement,o,f-h)}if(this.colGroupHeader&&this.colGroupHeader.children[s]){const f=parseInt(this.colGroupHeader.children[s].width,10);this.colGroupHeader.children[s].width=h+"px",this.updateNextLockedCol(this.colGroupHeader.parentElement,o,f-h)}if(this.colGroupFooter&&this.colGroupFooter.children[s]){const f=parseInt(this.colGroupFooter.children[s].width,10);this.colGroupFooter.children[s].width=h+"px",this.updateNextLockedCol(this.colGroupFooter.parentElement,o,f-h)}}},this.onResize=a}applyWidthConstraints(a,n,l=1){if(!a.width)return a.width||"";const r=a.width.toString();if(r.includes("%")){const s=parseFloat(r)*l,t=Math.max(0,Math.min(100,s));return a.width=t+"%",a.width}else{let e=parseFloat(r)*l;const s=n.minResizableWidth===void 0?10:n.minResizableWidth,t=n==null?void 0:n.minWidth,i=t!==void 0?Math.max(s,t):s,h=n==null?void 0:n.maxWidth;return e<i&&(e=i),h!==void 0&&e>h&&(e=h),a.width=e,e}}fixateInitialWidths(a){var s;let n=0;const l=((s=this.colGroupMain)==null?void 0:s.children)||[];for(let t=0;t<l.length;t++)l[t].width?a-=l[t].clientWidth:n++;if(n===0)return;const r=Math.floor(a/n),c=u.getFlatColumnsState(this.columnsState),e=this.columns.filter(t=>!t.children.length);for(let t=0;t<l.length;t++){const i=l[t],h=i.width?i.clientWidth:r;i.width=h;const o=c.find(f=>f.id===e[t].id);o&&(o.width=h.toString()),this.colGroupHeader&&(this.colGroupHeader.children[t].width=h),this.colGroupFooter&&(this.colGroupFooter.children[t].width=h)}}setWidths(a,n){const l=u.getFlatColumnsState(this.columnsState),r=this.columns.findIndex(t=>t.id===a.id),c=[];let e=a.children.filter(t=>!t.hidden).length;for(let t=r+1;t<this.columns.length&&!(e<=0);t++){const i=this.columns[t];i.children.length?e+=i.children.filter(h=>!h.hidden).length:c.push(i),e--}c.length===0&&c.push(a);const s=[];c.forEach(t=>{const i=l.find(h=>h.id===t.id);i&&(this.applyWidthConstraints(i,t,n),s.push(i))}),this.updateColElements(s)}updateNextLockedCol(a,n,l){const r=n.index,c=this.colGroupMain.parentElement.closest(".k-grid"),e=c==null?void 0:c.clientWidth,s=this.columns.filter(t=>t.locked).map(t=>parseInt(t.width+"",10)).reduce((t,i)=>t+i,0);!n.locked||e<=s+w||this.columns.forEach(t=>{if(t!=null&&t.locked&&l){const i=a==null?void 0:a.querySelectorAll('[aria-colindex="'+t.ariaColumnIndex+'"]');i==null||i.forEach(h=>{const o=h.style;this.isRtl?(t.index>r&&o&&o.right&&(o.right=parseInt(o.right,10)-l+"px"),t.index<r&&o&&o.left&&(o.left=parseInt(o.left,10)-l+"px")):(t.index>r&&o&&o.left&&(o.left=parseInt(o.left,10)-l+"px"),t.index<r&&o&&o.right&&(o.right=parseInt(o.right,10)-l+"px"))})}})}}exports.ColumnResize=W;
|
package/drag/ColumnResize.mjs
CHANGED
|
@@ -6,143 +6,152 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import { getFlatColumnsState as u } from "../utils/index.mjs";
|
|
9
|
-
const
|
|
10
|
-
class
|
|
11
|
-
constructor(
|
|
12
|
-
this.columns = [], this.columnsState = [], this.resizable = !1, this.isRtl = !1, this.setIsRtl = (
|
|
13
|
-
this.isRtl =
|
|
9
|
+
const w = 1, W = 20;
|
|
10
|
+
class F {
|
|
11
|
+
constructor(a) {
|
|
12
|
+
this.columns = [], this.columnsState = [], this.resizable = !1, this.isRtl = !1, this.setIsRtl = (h) => {
|
|
13
|
+
this.isRtl = h;
|
|
14
14
|
}, this.initWidths = () => {
|
|
15
|
-
var
|
|
16
|
-
const
|
|
17
|
-
var
|
|
18
|
-
return !((
|
|
15
|
+
var c;
|
|
16
|
+
const h = ((c = this.colGroupMain) == null ? void 0 : c.children) || [], l = u(this.columnsState), r = this.columns.filter((e) => {
|
|
17
|
+
var s;
|
|
18
|
+
return !((s = e.children) != null && s.length);
|
|
19
19
|
});
|
|
20
|
-
for (let
|
|
21
|
-
const
|
|
22
|
-
let
|
|
23
|
-
const
|
|
24
|
-
|
|
20
|
+
for (let e = 0; e < h.length; e++) {
|
|
21
|
+
const s = h[e], t = r[e];
|
|
22
|
+
let i = "";
|
|
23
|
+
const n = l.find((o) => o.id === r[e].id);
|
|
24
|
+
n && (i = this.applyWidthConstraints(n, t)), s.width = i, this.colGroupHeader && (this.colGroupHeader.children[e].width = i), this.colGroupFooter && (this.colGroupFooter.children[e].width = i);
|
|
25
25
|
}
|
|
26
|
-
}, this.dragHandler = (
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
if (!
|
|
26
|
+
}, this.dragHandler = (h, l, r, c) => {
|
|
27
|
+
const e = h.originalEvent;
|
|
28
|
+
c || (e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation());
|
|
29
|
+
const s = r.closest("th");
|
|
30
|
+
if (!s || !s)
|
|
31
31
|
return;
|
|
32
|
-
const t =
|
|
32
|
+
const t = s.clientWidth;
|
|
33
33
|
let i = t;
|
|
34
|
-
if (this.isRtl ? i +=
|
|
34
|
+
if (this.isRtl ? i += r.getBoundingClientRect().right - r.offsetWidth / 2 - h.clientX : i += h.clientX - r.getBoundingClientRect().left - r.offsetWidth / 2, !c && Math.abs(i - t) < 1)
|
|
35
35
|
return;
|
|
36
|
-
this.fixateInitialWidths(
|
|
37
|
-
const
|
|
38
|
-
this.onResize(
|
|
39
|
-
}, this.dblClickHandler = (
|
|
40
|
-
const
|
|
41
|
-
if (!this.colGroupMain || !
|
|
36
|
+
this.fixateInitialWidths(s.parentElement.clientWidth), this.setWidths(l, Math.floor(i) / t);
|
|
37
|
+
const n = this.columns.filter((o) => !o.children.length).findIndex((o) => o.id === l.id);
|
|
38
|
+
this.onResize(n, t, i, e, c, this.columnsState, l.id);
|
|
39
|
+
}, this.dblClickHandler = (h, l) => {
|
|
40
|
+
const r = this.columns.filter((d) => l.indexOf(d.id) > -1), c = u(this.columnsState);
|
|
41
|
+
if (!this.colGroupMain || !r.length)
|
|
42
42
|
return;
|
|
43
|
-
const
|
|
44
|
-
for (;
|
|
45
|
-
const d =
|
|
43
|
+
const e = {}, s = r;
|
|
44
|
+
for (; s.length > 0; ) {
|
|
45
|
+
const d = s.pop();
|
|
46
46
|
if (!d)
|
|
47
47
|
break;
|
|
48
|
-
d.children.length ?
|
|
48
|
+
d.children.length ? s.push(...d.children) : e[d.id] = d;
|
|
49
49
|
}
|
|
50
50
|
const t = this.columns.filter((d) => !d.children.length), i = [];
|
|
51
|
-
t.forEach((d,
|
|
52
|
-
|
|
51
|
+
t.forEach((d, p) => {
|
|
52
|
+
e[d.id] && i.push(p);
|
|
53
53
|
});
|
|
54
|
-
const
|
|
55
|
-
this.colGroupHeader && (
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
i.forEach((
|
|
59
|
-
d.children[
|
|
60
|
-
|
|
61
|
-
d.children[
|
|
54
|
+
const n = [this.colGroupMain.parentElement], o = [this.colGroupMain];
|
|
55
|
+
this.colGroupHeader && (n.push(this.colGroupHeader.parentElement), o.push(this.colGroupHeader)), this.colGroupFooter && (n.push(this.colGroupFooter.parentElement), o.push(this.colGroupFooter)), n.forEach((d) => d.classList.add("k-autofitting"));
|
|
56
|
+
const f = [];
|
|
57
|
+
o.forEach((d) => {
|
|
58
|
+
i.forEach((p) => {
|
|
59
|
+
d.children[p] && (d.children[p].width = "", f[p] = Math.max(
|
|
60
|
+
f[p] || 0,
|
|
61
|
+
d.children[p].offsetWidth + w
|
|
62
62
|
));
|
|
63
63
|
});
|
|
64
|
-
}),
|
|
65
|
-
i.forEach((
|
|
66
|
-
if (d.children[
|
|
67
|
-
d.children[
|
|
68
|
-
const g =
|
|
69
|
-
g && (g.width =
|
|
64
|
+
}), o.forEach((d) => {
|
|
65
|
+
i.forEach((p) => {
|
|
66
|
+
if (d.children[p]) {
|
|
67
|
+
d.children[p].width = f[p] + "px";
|
|
68
|
+
const g = c.find((G) => G.id === t[p].id);
|
|
69
|
+
g && (g.width = f[p]);
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
|
-
}),
|
|
73
|
-
}, this.updateColElements = (
|
|
74
|
-
const
|
|
75
|
-
let
|
|
76
|
-
for (let
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
const
|
|
82
|
-
if (!
|
|
72
|
+
}), n.forEach((d) => d.classList.remove("k-autofitting")), this.onResize(i[0], 0, 0, h, !0, this.columnsState, l[0]);
|
|
73
|
+
}, this.updateColElements = (h) => {
|
|
74
|
+
const l = this.columns.filter((c) => !c.hidden && !c.children.length);
|
|
75
|
+
let r = 1e-10;
|
|
76
|
+
for (let c = 0; c < h.length; c++) {
|
|
77
|
+
const e = h[c], s = l.findIndex((f) => f.id === e.id), t = parseFloat((e.width || 0).toString()), i = Math.floor(t);
|
|
78
|
+
r += t - i;
|
|
79
|
+
const n = i + Math.floor(r);
|
|
80
|
+
r -= Math.floor(r);
|
|
81
|
+
const o = l.find((f) => f.id === e.id);
|
|
82
|
+
if (!o)
|
|
83
83
|
return;
|
|
84
|
-
if (this.colGroupMain && this.colGroupMain.children[
|
|
85
|
-
const
|
|
86
|
-
this.colGroupMain.children[
|
|
84
|
+
if (this.colGroupMain && this.colGroupMain.children[s]) {
|
|
85
|
+
const f = parseInt(this.colGroupMain.children[s].width, 10);
|
|
86
|
+
this.colGroupMain.children[s].width = n + "px", this.updateNextLockedCol(this.colGroupMain.parentElement, o, f - n);
|
|
87
87
|
}
|
|
88
|
-
if (this.colGroupHeader && this.colGroupHeader.children[
|
|
89
|
-
const
|
|
90
|
-
this.colGroupHeader.children[
|
|
88
|
+
if (this.colGroupHeader && this.colGroupHeader.children[s]) {
|
|
89
|
+
const f = parseInt(this.colGroupHeader.children[s].width, 10);
|
|
90
|
+
this.colGroupHeader.children[s].width = n + "px", this.updateNextLockedCol(this.colGroupHeader.parentElement, o, f - n);
|
|
91
91
|
}
|
|
92
|
-
if (this.colGroupFooter && this.colGroupFooter.children[
|
|
93
|
-
const
|
|
94
|
-
this.colGroupFooter.children[
|
|
92
|
+
if (this.colGroupFooter && this.colGroupFooter.children[s]) {
|
|
93
|
+
const f = parseInt(this.colGroupFooter.children[s].width, 10);
|
|
94
|
+
this.colGroupFooter.children[s].width = n + "px", this.updateNextLockedCol(this.colGroupFooter.parentElement, o, f - n);
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
}, this.onResize =
|
|
97
|
+
}, this.onResize = a;
|
|
98
98
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
const r =
|
|
103
|
-
|
|
104
|
-
r
|
|
105
|
-
|
|
99
|
+
applyWidthConstraints(a, h, l = 1) {
|
|
100
|
+
if (!a.width)
|
|
101
|
+
return a.width || "";
|
|
102
|
+
const r = a.width.toString();
|
|
103
|
+
if (r.includes("%")) {
|
|
104
|
+
const s = parseFloat(r) * l, t = Math.max(0, Math.min(100, s));
|
|
105
|
+
return a.width = t + "%", a.width;
|
|
106
|
+
} else {
|
|
107
|
+
let e = parseFloat(r) * l;
|
|
108
|
+
const s = h.minResizableWidth === void 0 ? 10 : h.minResizableWidth, t = h == null ? void 0 : h.minWidth, i = t !== void 0 ? Math.max(s, t) : s, n = h == null ? void 0 : h.maxWidth;
|
|
109
|
+
return e < i && (e = i), n !== void 0 && e > n && (e = n), a.width = e, e;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
fixateInitialWidths(a) {
|
|
113
|
+
var s;
|
|
114
|
+
let h = 0;
|
|
115
|
+
const l = ((s = this.colGroupMain) == null ? void 0 : s.children) || [];
|
|
116
|
+
for (let t = 0; t < l.length; t++)
|
|
117
|
+
l[t].width ? a -= l[t].clientWidth : h++;
|
|
118
|
+
if (h === 0)
|
|
106
119
|
return;
|
|
107
|
-
const
|
|
108
|
-
for (let t = 0; t <
|
|
109
|
-
const i =
|
|
110
|
-
i.width =
|
|
111
|
-
const
|
|
112
|
-
|
|
120
|
+
const r = Math.floor(a / h), c = u(this.columnsState), e = this.columns.filter((t) => !t.children.length);
|
|
121
|
+
for (let t = 0; t < l.length; t++) {
|
|
122
|
+
const i = l[t], n = i.width ? i.clientWidth : r;
|
|
123
|
+
i.width = n;
|
|
124
|
+
const o = c.find((f) => f.id === e[t].id);
|
|
125
|
+
o && (o.width = n.toString()), this.colGroupHeader && (this.colGroupHeader.children[t].width = n), this.colGroupFooter && (this.colGroupFooter.children[t].width = n);
|
|
113
126
|
}
|
|
114
127
|
}
|
|
115
|
-
setWidths(
|
|
116
|
-
const
|
|
117
|
-
let
|
|
118
|
-
for (let t =
|
|
128
|
+
setWidths(a, h) {
|
|
129
|
+
const l = u(this.columnsState), r = this.columns.findIndex((t) => t.id === a.id), c = [];
|
|
130
|
+
let e = a.children.filter((t) => !t.hidden).length;
|
|
131
|
+
for (let t = r + 1; t < this.columns.length && !(e <= 0); t++) {
|
|
119
132
|
const i = this.columns[t];
|
|
120
|
-
i.children.length ?
|
|
133
|
+
i.children.length ? e += i.children.filter((n) => !n.hidden).length : c.push(i), e--;
|
|
121
134
|
}
|
|
122
|
-
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
const i =
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
const e = t.minResizableWidth === void 0 ? 10 : t.minResizableWidth;
|
|
129
|
-
s < e && (s = e), i.width = s, o.push(i);
|
|
130
|
-
}
|
|
131
|
-
}), this.updateColElements(o);
|
|
135
|
+
c.length === 0 && c.push(a);
|
|
136
|
+
const s = [];
|
|
137
|
+
c.forEach((t) => {
|
|
138
|
+
const i = l.find((n) => n.id === t.id);
|
|
139
|
+
i && (this.applyWidthConstraints(i, t, h), s.push(i));
|
|
140
|
+
}), this.updateColElements(s);
|
|
132
141
|
}
|
|
133
|
-
updateNextLockedCol(
|
|
134
|
-
const
|
|
135
|
-
!
|
|
136
|
-
if (t != null && t.locked &&
|
|
137
|
-
const i =
|
|
138
|
-
i == null || i.forEach((
|
|
139
|
-
const
|
|
140
|
-
this.isRtl ? (t.index >
|
|
142
|
+
updateNextLockedCol(a, h, l) {
|
|
143
|
+
const r = h.index, c = this.colGroupMain.parentElement.closest(".k-grid"), e = c == null ? void 0 : c.clientWidth, s = this.columns.filter((t) => t.locked).map((t) => parseInt(t.width + "", 10)).reduce((t, i) => t + i, 0);
|
|
144
|
+
!h.locked || e <= s + W || this.columns.forEach((t) => {
|
|
145
|
+
if (t != null && t.locked && l) {
|
|
146
|
+
const i = a == null ? void 0 : a.querySelectorAll('[aria-colindex="' + t.ariaColumnIndex + '"]');
|
|
147
|
+
i == null || i.forEach((n) => {
|
|
148
|
+
const o = n.style;
|
|
149
|
+
this.isRtl ? (t.index > r && o && o.right && (o.right = parseInt(o.right, 10) - l + "px"), t.index < r && o && o.left && (o.left = parseInt(o.left, 10) - l + "px")) : (t.index > r && o && o.left && (o.left = parseInt(o.left, 10) - l + "px"), t.index < r && o && o.right && (o.right = parseInt(o.right, 10) - l + "px"));
|
|
141
150
|
});
|
|
142
151
|
}
|
|
143
152
|
});
|
|
144
153
|
}
|
|
145
154
|
}
|
|
146
155
|
export {
|
|
147
|
-
|
|
156
|
+
F as ColumnResize
|
|
148
157
|
};
|
package/index.d.mts
CHANGED
|
@@ -1603,7 +1603,7 @@ export declare interface GridColumnMenuWrapperProps extends GridColumnMenuProps
|
|
|
1603
1603
|
/**
|
|
1604
1604
|
* The props of the GridColumn component.
|
|
1605
1605
|
*/
|
|
1606
|
-
export declare interface GridColumnProps extends Omit<ColumnBaseProps, 'cell'> {
|
|
1606
|
+
export declare interface GridColumnProps extends Omit<ColumnBaseProps, 'cell' | 'minResizableWidth'> {
|
|
1607
1607
|
/**
|
|
1608
1608
|
* Allows the column headers to be clicked and the `sortChange` event emitted.
|
|
1609
1609
|
* You have to handle the `sortChange` event yourself and sort the data.
|
|
@@ -1786,6 +1786,20 @@ export declare interface GridColumnProps extends Omit<ColumnBaseProps, 'cell'> {
|
|
|
1786
1786
|
* @default "data"
|
|
1787
1787
|
*/
|
|
1788
1788
|
columnType?: GridColumnType;
|
|
1789
|
+
/**
|
|
1790
|
+
* **Deprecated**: Use the `minWidth` property instead. The `minResizableWidth` property will be removed in a future version.
|
|
1791
|
+
*
|
|
1792
|
+
* @deprecated Use `minWidth` instead.
|
|
1793
|
+
*/
|
|
1794
|
+
minResizableWidth?: number;
|
|
1795
|
+
/**
|
|
1796
|
+
* Sets the minimum width of the column (in pixels).
|
|
1797
|
+
*/
|
|
1798
|
+
minWidth?: number;
|
|
1799
|
+
/**
|
|
1800
|
+
* Sets the maximum width of the column (in pixels).
|
|
1801
|
+
*/
|
|
1802
|
+
maxWidth?: number;
|
|
1789
1803
|
/**
|
|
1790
1804
|
* Defines if the cells of the column should be spanned when their values are the same.
|
|
1791
1805
|
*
|
|
@@ -1918,6 +1932,14 @@ export declare interface GridColumnState {
|
|
|
1918
1932
|
* Determines if the column is locked to the left or right side of the grid.
|
|
1919
1933
|
*/
|
|
1920
1934
|
locked?: boolean;
|
|
1935
|
+
/**
|
|
1936
|
+
* Sets the minimum width of the column (in pixels).
|
|
1937
|
+
*/
|
|
1938
|
+
minWidth?: number;
|
|
1939
|
+
/**
|
|
1940
|
+
* Sets the maximum width of the column (in pixels).
|
|
1941
|
+
*/
|
|
1942
|
+
maxWidth?: number;
|
|
1921
1943
|
}
|
|
1922
1944
|
|
|
1923
1945
|
/**
|
package/index.d.ts
CHANGED
|
@@ -1603,7 +1603,7 @@ export declare interface GridColumnMenuWrapperProps extends GridColumnMenuProps
|
|
|
1603
1603
|
/**
|
|
1604
1604
|
* The props of the GridColumn component.
|
|
1605
1605
|
*/
|
|
1606
|
-
export declare interface GridColumnProps extends Omit<ColumnBaseProps, 'cell'> {
|
|
1606
|
+
export declare interface GridColumnProps extends Omit<ColumnBaseProps, 'cell' | 'minResizableWidth'> {
|
|
1607
1607
|
/**
|
|
1608
1608
|
* Allows the column headers to be clicked and the `sortChange` event emitted.
|
|
1609
1609
|
* You have to handle the `sortChange` event yourself and sort the data.
|
|
@@ -1786,6 +1786,20 @@ export declare interface GridColumnProps extends Omit<ColumnBaseProps, 'cell'> {
|
|
|
1786
1786
|
* @default "data"
|
|
1787
1787
|
*/
|
|
1788
1788
|
columnType?: GridColumnType;
|
|
1789
|
+
/**
|
|
1790
|
+
* **Deprecated**: Use the `minWidth` property instead. The `minResizableWidth` property will be removed in a future version.
|
|
1791
|
+
*
|
|
1792
|
+
* @deprecated Use `minWidth` instead.
|
|
1793
|
+
*/
|
|
1794
|
+
minResizableWidth?: number;
|
|
1795
|
+
/**
|
|
1796
|
+
* Sets the minimum width of the column (in pixels).
|
|
1797
|
+
*/
|
|
1798
|
+
minWidth?: number;
|
|
1799
|
+
/**
|
|
1800
|
+
* Sets the maximum width of the column (in pixels).
|
|
1801
|
+
*/
|
|
1802
|
+
maxWidth?: number;
|
|
1789
1803
|
/**
|
|
1790
1804
|
* Defines if the cells of the column should be spanned when their values are the same.
|
|
1791
1805
|
*
|
|
@@ -1918,6 +1932,14 @@ export declare interface GridColumnState {
|
|
|
1918
1932
|
* Determines if the column is locked to the left or right side of the grid.
|
|
1919
1933
|
*/
|
|
1920
1934
|
locked?: boolean;
|
|
1935
|
+
/**
|
|
1936
|
+
* Sets the minimum width of the column (in pixels).
|
|
1937
|
+
*/
|
|
1938
|
+
minWidth?: number;
|
|
1939
|
+
/**
|
|
1940
|
+
* Sets the maximum width of the column (in pixels).
|
|
1941
|
+
*/
|
|
1942
|
+
maxWidth?: number;
|
|
1921
1943
|
}
|
|
1922
1944
|
|
|
1923
1945
|
/**
|
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=Object.freeze({name:"@progress/kendo-react-grid",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Object.freeze({name:"@progress/kendo-react-grid",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1765282627,version:"13.2.0-develop.6",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 = Object.freeze({
|
|
|
10
10
|
productName: "KendoReact",
|
|
11
11
|
productCode: "KENDOUIREACT",
|
|
12
12
|
productCodes: ["KENDOUIREACT"],
|
|
13
|
-
publishDate:
|
|
14
|
-
version: "13.2.0-develop.
|
|
13
|
+
publishDate: 1765282627,
|
|
14
|
+
version: "13.2.0-develop.6",
|
|
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": "13.2.0-develop.
|
|
3
|
+
"version": "13.2.0-develop.6",
|
|
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,21 +28,21 @@
|
|
|
28
28
|
"@progress/kendo-data-query": "^1.7.2",
|
|
29
29
|
"@progress/kendo-drawing": "^1.21.2",
|
|
30
30
|
"@progress/kendo-licensing": "^1.7.2",
|
|
31
|
-
"@progress/kendo-react-animation": "13.2.0-develop.
|
|
32
|
-
"@progress/kendo-react-buttons": "13.2.0-develop.
|
|
33
|
-
"@progress/kendo-react-common": "13.2.0-develop.
|
|
34
|
-
"@progress/kendo-react-data-tools": "13.2.0-develop.
|
|
35
|
-
"@progress/kendo-react-dateinputs": "13.2.0-develop.
|
|
36
|
-
"@progress/kendo-react-indicators": "13.2.0-develop.
|
|
37
|
-
"@progress/kendo-react-form": "13.2.0-develop.
|
|
38
|
-
"@progress/kendo-react-labels": "13.2.0-develop.
|
|
39
|
-
"@progress/kendo-react-dialogs": "13.2.0-develop.
|
|
40
|
-
"@progress/kendo-react-dropdowns": "13.2.0-develop.
|
|
41
|
-
"@progress/kendo-react-inputs": "13.2.0-develop.
|
|
42
|
-
"@progress/kendo-react-intl": "13.2.0-develop.
|
|
43
|
-
"@progress/kendo-react-popup": "13.2.0-develop.
|
|
44
|
-
"@progress/kendo-react-layout": "13.2.0-develop.
|
|
45
|
-
"@progress/kendo-react-conversational-ui": "13.2.0-develop.
|
|
31
|
+
"@progress/kendo-react-animation": "13.2.0-develop.6",
|
|
32
|
+
"@progress/kendo-react-buttons": "13.2.0-develop.6",
|
|
33
|
+
"@progress/kendo-react-common": "13.2.0-develop.6",
|
|
34
|
+
"@progress/kendo-react-data-tools": "13.2.0-develop.6",
|
|
35
|
+
"@progress/kendo-react-dateinputs": "13.2.0-develop.6",
|
|
36
|
+
"@progress/kendo-react-indicators": "13.2.0-develop.6",
|
|
37
|
+
"@progress/kendo-react-form": "13.2.0-develop.6",
|
|
38
|
+
"@progress/kendo-react-labels": "13.2.0-develop.6",
|
|
39
|
+
"@progress/kendo-react-dialogs": "13.2.0-develop.6",
|
|
40
|
+
"@progress/kendo-react-dropdowns": "13.2.0-develop.6",
|
|
41
|
+
"@progress/kendo-react-inputs": "13.2.0-develop.6",
|
|
42
|
+
"@progress/kendo-react-intl": "13.2.0-develop.6",
|
|
43
|
+
"@progress/kendo-react-popup": "13.2.0-develop.6",
|
|
44
|
+
"@progress/kendo-react-layout": "13.2.0-develop.6",
|
|
45
|
+
"@progress/kendo-react-conversational-ui": "13.2.0-develop.6",
|
|
46
46
|
"@progress/kendo-svg-icons": "^4.0.0",
|
|
47
47
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
|
48
48
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
"package": {
|
|
148
148
|
"productName": "KendoReact",
|
|
149
149
|
"productCode": "KENDOUIREACT",
|
|
150
|
-
"publishDate":
|
|
150
|
+
"publishDate": 1765282627,
|
|
151
151
|
"licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
152
152
|
}
|
|
153
153
|
},
|
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 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=" ",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;
|