@progress/kendo-react-grid 14.2.2-develop.1 → 14.3.0-develop.1
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 +625 -555
- package/GridComponent.js +1 -1
- package/GridComponent.mjs +419 -433
- package/components/StickyGroupTable.d.ts +42 -0
- package/components/StickyGroupTable.js +9 -0
- package/components/StickyGroupTable.mjs +82 -0
- package/components/colGroup/GridColGroup.js +1 -1
- package/components/colGroup/GridColGroup.mjs +9 -9
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/drag/ColumnResize.d.ts +8 -0
- package/drag/ColumnResize.js +1 -1
- package/drag/ColumnResize.mjs +125 -108
- package/getRowContents.d.ts +58 -0
- package/getRowContents.js +8 -0
- package/getRowContents.mjs +100 -0
- package/header/GridHeaderGroupSpacerCell.d.ts +13 -0
- package/header/GridHeaderGroupSpacerCell.js +9 -0
- package/header/GridHeaderGroupSpacerCell.mjs +23 -0
- package/hooks/useStickyGroups.d.ts +71 -0
- package/hooks/useStickyGroups.js +9 -0
- package/hooks/useStickyGroups.mjs +350 -0
- package/interfaces/GridGroupableSettings.d.ts +23 -0
- package/messages/index.d.ts +5 -0
- package/messages/index.js +2 -2
- package/messages/index.mjs +28 -26
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +1 -1
- package/package.json +17 -17
- package/stacked/StackedModeComponents.d.ts +1 -0
- package/stacked/StackedModeComponents.js +1 -1
- package/stacked/StackedModeComponents.mjs +14 -14
package/drag/ColumnResize.d.ts
CHANGED
|
@@ -23,6 +23,14 @@ export declare class ColumnResize {
|
|
|
23
23
|
* The footer `colgroup` of the Grid (if any).
|
|
24
24
|
*/
|
|
25
25
|
colGroupFooter: any | null;
|
|
26
|
+
/**
|
|
27
|
+
* The sticky header `colgroup` of the Grid (if any).
|
|
28
|
+
*/
|
|
29
|
+
colGroupStickyHeader: any;
|
|
30
|
+
/**
|
|
31
|
+
* The sticky footer `colgroup` of the Grid (if any).
|
|
32
|
+
*/
|
|
33
|
+
colGroupStickyFooter: any;
|
|
26
34
|
columns: ExtendedColumnProps[];
|
|
27
35
|
/**
|
|
28
36
|
* The `columnsState` of the Grid (if any).
|
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 f=require("../utils/index.js"),g=1,k=20;class w{constructor(p){this.columns=[],this.columnsState=[],this.resizable=!1,this.isRtl=!1,this.setIsRtl=s=>{this.isRtl=s},this.initWidths=()=>{var a;const s=((a=this.colGroupMain)==null?void 0:a.children)||[],l=f.getFlatColumnsState(this.columnsState),c=this.columns.filter(e=>{var r;return!((r=e.children)!=null&&r.length)});for(let e=0;e<s.length;e++){const r=s[e],t=c[e];let i="";const h=l.find(o=>o.id===c[e].id);h&&(i=this.applyWidthConstraints(h,t)),r.width=i,this.colGroupHeader&&(this.colGroupHeader.children[e].width=i),this.colGroupFooter&&(this.colGroupFooter.children[e].width=i),this.colGroupStickyHeader&&(this.colGroupStickyHeader.children[e].width=i),this.colGroupStickyFooter&&(this.colGroupStickyFooter.children[e].width=i)}},this.dragHandler=(s,l,c,a)=>{const e=s.originalEvent;a||(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation());const r=c.closest("th");if(!r||!r)return;const t=r.clientWidth;let i=t;if(this.isRtl?i+=c.getBoundingClientRect().right-c.offsetWidth/2-s.clientX:i+=s.clientX-c.getBoundingClientRect().left-c.offsetWidth/2,!a&&Math.abs(i-t)<1)return;this.fixateInitialWidths(r.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,a,this.columnsState,l.id)},this.dblClickHandler=(s,l)=>{const c=this.columns.filter(n=>l.indexOf(n.id)>-1),a=f.getFlatColumnsState(this.columnsState);if(!this.colGroupMain||!c.length)return;const e={},r=c;for(;r.length>0;){const n=r.pop();if(!n)break;n.children.length?r.push(...n.children):e[n.id]=n}const t=this.columns.filter(n=>!n.children.length),i=[];t.forEach((n,d)=>{e[n.id]&&i.push(d)});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)),this.colGroupStickyHeader&&(h.push(this.colGroupStickyHeader.parentElement),o.push(this.colGroupStickyHeader)),this.colGroupStickyFooter&&(h.push(this.colGroupStickyFooter.parentElement),o.push(this.colGroupStickyFooter)),h.forEach(n=>n.classList.add("k-autofitting"));const u=[];o.forEach(n=>{i.forEach(d=>{n.children[d]&&(n.children[d].width="",u[d]=Math.max(u[d]||0,n.children[d].offsetWidth+g))})}),o.forEach(n=>{i.forEach(d=>{if(n.children[d]){n.children[d].width=u[d]+"px";const G=a.find(S=>S.id===t[d].id);G&&(G.width=u[d])}})}),h.forEach(n=>n.classList.remove("k-autofitting")),this.onResize(i[0],0,0,s,!0,this.columnsState,l[0])},this.updateColElements=s=>{var a,e;const l=this.columns.filter(r=>!r.hidden&&!r.children.length);let c=1e-10;for(let r=0;r<s.length;r++){const t=s[r],i=l.findIndex(d=>d.id===t.id),h=parseFloat((t.width||0).toString()),o=Math.floor(h);c+=h-o;const u=o+Math.floor(c);c-=Math.floor(c);const n=l.find(d=>d.id===t.id);if(!n)return;if(this.colGroupMain&&this.colGroupMain.children[i]){const d=parseInt(this.colGroupMain.children[i].width,10);this.colGroupMain.children[i].width=u+"px",this.updateNextLockedCol(this.colGroupMain.parentElement,n,d-u)}if(this.colGroupHeader&&this.colGroupHeader.children[i]){const d=parseInt(this.colGroupHeader.children[i].width,10);this.colGroupHeader.children[i].width=u+"px",this.updateNextLockedCol(this.colGroupHeader.parentElement,n,d-u)}if(this.colGroupFooter&&this.colGroupFooter.children[i]){const d=parseInt(this.colGroupFooter.children[i].width,10);this.colGroupFooter.children[i].width=u+"px",this.updateNextLockedCol(this.colGroupFooter.parentElement,n,d-u)}if((a=this.colGroupStickyHeader)!=null&&a.children[i]){const d=parseInt(this.colGroupStickyHeader.children[i].width,10);this.colGroupStickyHeader.children[i].width=u+"px",this.updateNextLockedCol(this.colGroupStickyHeader.parentElement,n,d-u)}if((e=this.colGroupStickyFooter)!=null&&e.children[i]){const d=parseInt(this.colGroupStickyFooter.children[i].width,10);this.colGroupStickyFooter.children[i].width=u+"px",this.updateNextLockedCol(this.colGroupStickyFooter.parentElement,n,d-u)}}},this.onResize=p}applyWidthConstraints(p,s,l=1){if(!p.width)return p.width||"";const c=p.width.toString();if(c.includes("%")){const u=parseFloat(c)*l,n=Math.max(0,Math.min(100,u));return p.width=n+"%",p.width}let e=parseFloat(c)*l;const r=s.minResizableWidth===void 0?10:s.minResizableWidth,t=s==null?void 0:s.minWidth,i=t!==void 0?Math.max(r,t):r,h=s==null?void 0:s.maxWidth;return e<i&&(e=i),h!==void 0&&e>h&&(e=h),p.width=e,e}fixateInitialWidths(p){var r;let s=0;const l=((r=this.colGroupMain)==null?void 0:r.children)||[];for(let t=0;t<l.length;t++)l[t].width?p-=l[t].clientWidth:s++;if(s===0)return;const c=Math.floor(p/s),a=f.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:c;i.width=h;const o=a.find(u=>u.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),this.colGroupStickyHeader&&(this.colGroupStickyHeader.children[t].width=h),this.colGroupStickyFooter&&(this.colGroupStickyFooter.children[t].width=h)}}setWidths(p,s){const l=f.getFlatColumnsState(this.columnsState),c=this.columns.findIndex(t=>t.id===p.id),a=[];let e=p.children.filter(t=>!t.hidden).length;for(let t=c+1;t<this.columns.length&&!(e<=0);t++){const i=this.columns[t];i.children.length?e+=i.children.filter(h=>!h.hidden).length:a.push(i),e--}a.length===0&&a.push(p);const r=[];a.forEach(t=>{const i=l.find(h=>h.id===t.id);i&&(this.applyWidthConstraints(i,t,s),r.push(i))}),this.updateColElements(r)}updateNextLockedCol(p,s,l){const c=s.index,a=this.colGroupMain.parentElement.closest(".k-grid"),e=a==null?void 0:a.clientWidth,r=this.columns.filter(t=>t.locked).map(t=>parseInt(t.width+"",10)).reduce((t,i)=>t+i,0);!s.locked||e<=r+k||this.columns.forEach(t=>{if(t!=null&&t.locked&&l){const i=p==null?void 0:p.querySelectorAll('[aria-colindex="'+t.ariaColumnIndex+'"]');i==null||i.forEach(h=>{const o=h.style;this.isRtl?(t.index>c&&o&&o.right&&(o.right=parseInt(o.right,10)-l+"px"),t.index<c&&o&&o.left&&(o.left=parseInt(o.left,10)-l+"px")):(t.index>c&&o&&o.left&&(o.left=parseInt(o.left,10)-l+"px"),t.index<c&&o&&o.right&&(o.right=parseInt(o.right,10)-l+"px"))})}})}}exports.ColumnResize=w;
|
package/drag/ColumnResize.mjs
CHANGED
|
@@ -6,151 +6,168 @@
|
|
|
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 S = 1, w = 20;
|
|
10
|
+
class x {
|
|
11
|
+
constructor(p) {
|
|
12
|
+
this.columns = [], this.columnsState = [], this.resizable = !1, this.isRtl = !1, this.setIsRtl = (s) => {
|
|
13
|
+
this.isRtl = s;
|
|
14
14
|
}, this.initWidths = () => {
|
|
15
|
-
var
|
|
16
|
-
const
|
|
17
|
-
var
|
|
18
|
-
return !((
|
|
15
|
+
var a;
|
|
16
|
+
const s = ((a = this.colGroupMain) == null ? void 0 : a.children) || [], l = u(this.columnsState), c = this.columns.filter((e) => {
|
|
17
|
+
var r;
|
|
18
|
+
return !((r = e.children) != null && r.length);
|
|
19
19
|
});
|
|
20
|
-
for (let e = 0; e <
|
|
21
|
-
const
|
|
20
|
+
for (let e = 0; e < s.length; e++) {
|
|
21
|
+
const r = s[e], t = c[e];
|
|
22
22
|
let i = "";
|
|
23
|
-
const
|
|
24
|
-
|
|
23
|
+
const h = l.find((o) => o.id === c[e].id);
|
|
24
|
+
h && (i = this.applyWidthConstraints(h, t)), r.width = i, this.colGroupHeader && (this.colGroupHeader.children[e].width = i), this.colGroupFooter && (this.colGroupFooter.children[e].width = i), this.colGroupStickyHeader && (this.colGroupStickyHeader.children[e].width = i), this.colGroupStickyFooter && (this.colGroupStickyFooter.children[e].width = i);
|
|
25
25
|
}
|
|
26
|
-
}, this.dragHandler = (
|
|
27
|
-
const e =
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
if (!
|
|
26
|
+
}, this.dragHandler = (s, l, c, a) => {
|
|
27
|
+
const e = s.originalEvent;
|
|
28
|
+
a || (e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation());
|
|
29
|
+
const r = c.closest("th");
|
|
30
|
+
if (!r || !r)
|
|
31
31
|
return;
|
|
32
|
-
const t =
|
|
32
|
+
const t = r.clientWidth;
|
|
33
33
|
let i = t;
|
|
34
|
-
if (this.isRtl ? i +=
|
|
34
|
+
if (this.isRtl ? i += c.getBoundingClientRect().right - c.offsetWidth / 2 - s.clientX : i += s.clientX - c.getBoundingClientRect().left - c.offsetWidth / 2, !a && 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(r.parentElement.clientWidth), this.setWidths(l, Math.floor(i) / t);
|
|
37
|
+
const h = this.columns.filter((o) => !o.children.length).findIndex((o) => o.id === l.id);
|
|
38
|
+
this.onResize(h, t, i, e, a, this.columnsState, l.id);
|
|
39
|
+
}, this.dblClickHandler = (s, l) => {
|
|
40
|
+
const c = this.columns.filter((n) => l.indexOf(n.id) > -1), a = u(this.columnsState);
|
|
41
|
+
if (!this.colGroupMain || !c.length)
|
|
42
42
|
return;
|
|
43
|
-
const e = {},
|
|
44
|
-
for (;
|
|
45
|
-
const
|
|
46
|
-
if (!
|
|
43
|
+
const e = {}, r = c;
|
|
44
|
+
for (; r.length > 0; ) {
|
|
45
|
+
const n = r.pop();
|
|
46
|
+
if (!n)
|
|
47
47
|
break;
|
|
48
|
-
|
|
48
|
+
n.children.length ? r.push(...n.children) : e[n.id] = n;
|
|
49
49
|
}
|
|
50
|
-
const t = this.columns.filter((
|
|
51
|
-
t.forEach((
|
|
52
|
-
e[
|
|
50
|
+
const t = this.columns.filter((n) => !n.children.length), i = [];
|
|
51
|
+
t.forEach((n, d) => {
|
|
52
|
+
e[n.id] && i.push(d);
|
|
53
53
|
});
|
|
54
|
-
const
|
|
55
|
-
this.colGroupHeader && (
|
|
54
|
+
const h = [this.colGroupMain.parentElement], o = [this.colGroupMain];
|
|
55
|
+
this.colGroupHeader && (h.push(this.colGroupHeader.parentElement), o.push(this.colGroupHeader)), this.colGroupFooter && (h.push(this.colGroupFooter.parentElement), o.push(this.colGroupFooter)), this.colGroupStickyHeader && (h.push(this.colGroupStickyHeader.parentElement), o.push(this.colGroupStickyHeader)), this.colGroupStickyFooter && (h.push(this.colGroupStickyFooter.parentElement), o.push(this.colGroupStickyFooter)), h.forEach((n) => n.classList.add("k-autofitting"));
|
|
56
56
|
const f = [];
|
|
57
|
-
|
|
58
|
-
i.forEach((
|
|
59
|
-
|
|
60
|
-
f[
|
|
61
|
-
|
|
57
|
+
o.forEach((n) => {
|
|
58
|
+
i.forEach((d) => {
|
|
59
|
+
n.children[d] && (n.children[d].width = "", f[d] = Math.max(
|
|
60
|
+
f[d] || 0,
|
|
61
|
+
n.children[d].offsetWidth + S
|
|
62
62
|
));
|
|
63
63
|
});
|
|
64
|
-
}),
|
|
65
|
-
i.forEach((
|
|
66
|
-
if (
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
|
|
64
|
+
}), o.forEach((n) => {
|
|
65
|
+
i.forEach((d) => {
|
|
66
|
+
if (n.children[d]) {
|
|
67
|
+
n.children[d].width = f[d] + "px";
|
|
68
|
+
const G = a.find((k) => k.id === t[d].id);
|
|
69
|
+
G && (G.width = f[d]);
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
|
-
}),
|
|
73
|
-
}, this.updateColElements = (
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
r
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
72
|
+
}), h.forEach((n) => n.classList.remove("k-autofitting")), this.onResize(i[0], 0, 0, s, !0, this.columnsState, l[0]);
|
|
73
|
+
}, this.updateColElements = (s) => {
|
|
74
|
+
var a, e;
|
|
75
|
+
const l = this.columns.filter((r) => !r.hidden && !r.children.length);
|
|
76
|
+
let c = 1e-10;
|
|
77
|
+
for (let r = 0; r < s.length; r++) {
|
|
78
|
+
const t = s[r], i = l.findIndex((d) => d.id === t.id), h = parseFloat((t.width || 0).toString()), o = Math.floor(h);
|
|
79
|
+
c += h - o;
|
|
80
|
+
const f = o + Math.floor(c);
|
|
81
|
+
c -= Math.floor(c);
|
|
82
|
+
const n = l.find((d) => d.id === t.id);
|
|
83
|
+
if (!n)
|
|
83
84
|
return;
|
|
84
|
-
if (this.colGroupMain && this.colGroupMain.children[
|
|
85
|
-
const
|
|
86
|
-
this.colGroupMain.children[
|
|
85
|
+
if (this.colGroupMain && this.colGroupMain.children[i]) {
|
|
86
|
+
const d = parseInt(this.colGroupMain.children[i].width, 10);
|
|
87
|
+
this.colGroupMain.children[i].width = f + "px", this.updateNextLockedCol(this.colGroupMain.parentElement, n, d - f);
|
|
87
88
|
}
|
|
88
|
-
if (this.colGroupHeader && this.colGroupHeader.children[
|
|
89
|
-
const
|
|
90
|
-
this.colGroupHeader.children[
|
|
89
|
+
if (this.colGroupHeader && this.colGroupHeader.children[i]) {
|
|
90
|
+
const d = parseInt(this.colGroupHeader.children[i].width, 10);
|
|
91
|
+
this.colGroupHeader.children[i].width = f + "px", this.updateNextLockedCol(this.colGroupHeader.parentElement, n, d - f);
|
|
91
92
|
}
|
|
92
|
-
if (this.colGroupFooter && this.colGroupFooter.children[
|
|
93
|
-
const
|
|
94
|
-
this.colGroupFooter.children[
|
|
93
|
+
if (this.colGroupFooter && this.colGroupFooter.children[i]) {
|
|
94
|
+
const d = parseInt(this.colGroupFooter.children[i].width, 10);
|
|
95
|
+
this.colGroupFooter.children[i].width = f + "px", this.updateNextLockedCol(this.colGroupFooter.parentElement, n, d - f);
|
|
96
|
+
}
|
|
97
|
+
if ((a = this.colGroupStickyHeader) != null && a.children[i]) {
|
|
98
|
+
const d = parseInt(this.colGroupStickyHeader.children[i].width, 10);
|
|
99
|
+
this.colGroupStickyHeader.children[i].width = f + "px", this.updateNextLockedCol(
|
|
100
|
+
this.colGroupStickyHeader.parentElement,
|
|
101
|
+
n,
|
|
102
|
+
d - f
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
if ((e = this.colGroupStickyFooter) != null && e.children[i]) {
|
|
106
|
+
const d = parseInt(this.colGroupStickyFooter.children[i].width, 10);
|
|
107
|
+
this.colGroupStickyFooter.children[i].width = f + "px", this.updateNextLockedCol(
|
|
108
|
+
this.colGroupStickyFooter.parentElement,
|
|
109
|
+
n,
|
|
110
|
+
d - f
|
|
111
|
+
);
|
|
95
112
|
}
|
|
96
113
|
}
|
|
97
|
-
}, this.onResize =
|
|
114
|
+
}, this.onResize = p;
|
|
98
115
|
}
|
|
99
|
-
applyWidthConstraints(
|
|
100
|
-
if (!
|
|
101
|
-
return
|
|
102
|
-
const
|
|
103
|
-
if (
|
|
104
|
-
const f = parseFloat(
|
|
105
|
-
return
|
|
116
|
+
applyWidthConstraints(p, s, l = 1) {
|
|
117
|
+
if (!p.width)
|
|
118
|
+
return p.width || "";
|
|
119
|
+
const c = p.width.toString();
|
|
120
|
+
if (c.includes("%")) {
|
|
121
|
+
const f = parseFloat(c) * l, n = Math.max(0, Math.min(100, f));
|
|
122
|
+
return p.width = n + "%", p.width;
|
|
106
123
|
}
|
|
107
|
-
let e = parseFloat(
|
|
108
|
-
const
|
|
109
|
-
return e < i && (e = i),
|
|
124
|
+
let e = parseFloat(c) * l;
|
|
125
|
+
const r = s.minResizableWidth === void 0 ? 10 : s.minResizableWidth, t = s == null ? void 0 : s.minWidth, i = t !== void 0 ? Math.max(r, t) : r, h = s == null ? void 0 : s.maxWidth;
|
|
126
|
+
return e < i && (e = i), h !== void 0 && e > h && (e = h), p.width = e, e;
|
|
110
127
|
}
|
|
111
|
-
fixateInitialWidths(
|
|
112
|
-
var
|
|
113
|
-
let
|
|
114
|
-
const l = ((
|
|
128
|
+
fixateInitialWidths(p) {
|
|
129
|
+
var r;
|
|
130
|
+
let s = 0;
|
|
131
|
+
const l = ((r = this.colGroupMain) == null ? void 0 : r.children) || [];
|
|
115
132
|
for (let t = 0; t < l.length; t++)
|
|
116
|
-
l[t].width ?
|
|
117
|
-
if (
|
|
133
|
+
l[t].width ? p -= l[t].clientWidth : s++;
|
|
134
|
+
if (s === 0)
|
|
118
135
|
return;
|
|
119
|
-
const
|
|
136
|
+
const c = Math.floor(p / s), a = u(this.columnsState), e = this.columns.filter((t) => !t.children.length);
|
|
120
137
|
for (let t = 0; t < l.length; t++) {
|
|
121
|
-
const i = l[t],
|
|
122
|
-
i.width =
|
|
123
|
-
const
|
|
124
|
-
|
|
138
|
+
const i = l[t], h = i.width ? i.clientWidth : c;
|
|
139
|
+
i.width = h;
|
|
140
|
+
const o = a.find((f) => f.id === e[t].id);
|
|
141
|
+
o && (o.width = h.toString()), this.colGroupHeader && (this.colGroupHeader.children[t].width = h), this.colGroupFooter && (this.colGroupFooter.children[t].width = h), this.colGroupStickyHeader && (this.colGroupStickyHeader.children[t].width = h), this.colGroupStickyFooter && (this.colGroupStickyFooter.children[t].width = h);
|
|
125
142
|
}
|
|
126
143
|
}
|
|
127
|
-
setWidths(
|
|
128
|
-
const l = u(this.columnsState),
|
|
129
|
-
let e =
|
|
130
|
-
for (let t =
|
|
144
|
+
setWidths(p, s) {
|
|
145
|
+
const l = u(this.columnsState), c = this.columns.findIndex((t) => t.id === p.id), a = [];
|
|
146
|
+
let e = p.children.filter((t) => !t.hidden).length;
|
|
147
|
+
for (let t = c + 1; t < this.columns.length && !(e <= 0); t++) {
|
|
131
148
|
const i = this.columns[t];
|
|
132
|
-
i.children.length ? e += i.children.filter((
|
|
149
|
+
i.children.length ? e += i.children.filter((h) => !h.hidden).length : a.push(i), e--;
|
|
133
150
|
}
|
|
134
|
-
|
|
135
|
-
const
|
|
136
|
-
|
|
137
|
-
const i = l.find((
|
|
138
|
-
i && (this.applyWidthConstraints(i, t,
|
|
139
|
-
}), this.updateColElements(
|
|
151
|
+
a.length === 0 && a.push(p);
|
|
152
|
+
const r = [];
|
|
153
|
+
a.forEach((t) => {
|
|
154
|
+
const i = l.find((h) => h.id === t.id);
|
|
155
|
+
i && (this.applyWidthConstraints(i, t, s), r.push(i));
|
|
156
|
+
}), this.updateColElements(r);
|
|
140
157
|
}
|
|
141
|
-
updateNextLockedCol(
|
|
142
|
-
const
|
|
143
|
-
!
|
|
158
|
+
updateNextLockedCol(p, s, l) {
|
|
159
|
+
const c = s.index, a = this.colGroupMain.parentElement.closest(".k-grid"), e = a == null ? void 0 : a.clientWidth, r = this.columns.filter((t) => t.locked).map((t) => parseInt(t.width + "", 10)).reduce((t, i) => t + i, 0);
|
|
160
|
+
!s.locked || e <= r + w || this.columns.forEach((t) => {
|
|
144
161
|
if (t != null && t.locked && l) {
|
|
145
|
-
const i =
|
|
146
|
-
i == null || i.forEach((
|
|
147
|
-
const
|
|
148
|
-
this.isRtl ? (t.index >
|
|
162
|
+
const i = p == null ? void 0 : p.querySelectorAll('[aria-colindex="' + t.ariaColumnIndex + '"]');
|
|
163
|
+
i == null || i.forEach((h) => {
|
|
164
|
+
const o = h.style;
|
|
165
|
+
this.isRtl ? (t.index > c && o && o.right && (o.right = parseInt(o.right, 10) - l + "px"), t.index < c && o && o.left && (o.left = parseInt(o.left, 10) - l + "px")) : (t.index > c && o && o.left && (o.left = parseInt(o.left, 10) - l + "px"), t.index < c && o && o.right && (o.right = parseInt(o.right, 10) - l + "px"));
|
|
149
166
|
});
|
|
150
167
|
}
|
|
151
168
|
});
|
|
152
169
|
}
|
|
153
170
|
}
|
|
154
171
|
export {
|
|
155
|
-
|
|
172
|
+
x as ColumnResize
|
|
156
173
|
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { ExtendedColumnProps } from './GridColumn.js';
|
|
9
|
+
import { DataItemWrapper } from './utils/index.js';
|
|
10
|
+
import { GridCellProps } from './interfaces/GridCellProps.js';
|
|
11
|
+
import { GridCellRenderModel } from './interfaces/GridCellRenderModel.js';
|
|
12
|
+
import { GridColumnState } from './interfaces/GridColumnState.js';
|
|
13
|
+
import { GridCellsSettings } from './interfaces/GridCellsSettings.js';
|
|
14
|
+
import { IntlService, LocalizationService } from '@progress/kendo-react-intl';
|
|
15
|
+
import { SortDescriptor } from '@progress/kendo-data-query';
|
|
16
|
+
import * as React from 'react';
|
|
17
|
+
/**
|
|
18
|
+
* @hidden
|
|
19
|
+
*/
|
|
20
|
+
export interface DataRowContext {
|
|
21
|
+
leafColumns: ExtendedColumnProps[];
|
|
22
|
+
columnsState: GridColumnState[];
|
|
23
|
+
cellsToRender: GridCellRenderModel[];
|
|
24
|
+
hasDynamicColSpan?: boolean;
|
|
25
|
+
getCellsToRender?: (dataItem: any) => GridCellRenderModel[];
|
|
26
|
+
idPrefix: string;
|
|
27
|
+
gridClasses: any;
|
|
28
|
+
unstyled?: any;
|
|
29
|
+
localization?: LocalizationService;
|
|
30
|
+
intl?: IntlService;
|
|
31
|
+
cells?: GridCellsSettings;
|
|
32
|
+
isRowReorderable?: boolean;
|
|
33
|
+
sort?: SortDescriptor[];
|
|
34
|
+
editable?: any;
|
|
35
|
+
edit?: Record<string, any>;
|
|
36
|
+
isClient?: boolean;
|
|
37
|
+
isEditDialog?: boolean;
|
|
38
|
+
dataItemKey?: string;
|
|
39
|
+
select?: Record<string, any>;
|
|
40
|
+
highlight?: Record<string, any>;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* @hidden
|
|
44
|
+
*/
|
|
45
|
+
export interface DataRowResult {
|
|
46
|
+
/** Array of rendered cell elements for the row. */
|
|
47
|
+
row: React.ReactElement[];
|
|
48
|
+
/** Whether any cell in the row is in edit mode. */
|
|
49
|
+
isInEdit: boolean;
|
|
50
|
+
/** Whether the entire row is selected. */
|
|
51
|
+
isSelected: boolean;
|
|
52
|
+
/** Whether the entire row is highlighted. */
|
|
53
|
+
isHighlighted: boolean;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* @hidden
|
|
57
|
+
*/
|
|
58
|
+
export declare function getRowContents(ctx: DataRowContext, item: DataItemWrapper, rowId: string, rowDataIndex: number, isAlt: boolean, spannedRows?: Record<string, Required<GridCellProps['_rowSpan']>>): DataRowResult;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const U=require("react"),s=require("@progress/kendo-react-common"),W=require("@progress/kendo-react-data-tools"),O=require("./utils/index.js"),X=require("./cells/datacell/GridCell.js"),Y=require("./cells/datacell/GridCellServer.js"),Z=require("./cells/editcell/GridEditCell.js"),ee=require("./cells/editcell/GridEditCellServer.js");function te(l){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const d in l)if(d!=="default"){const g=Object.getOwnPropertyDescriptor(l,d);Object.defineProperty(t,d,g.get?g:{enumerable:!0,get:()=>l[d]})}}return t.default=l,Object.freeze(t)}const le=te(U);function oe(l,t,d,g,q,i){const{leafColumns:C,columnsState:R,idPrefix:_,gridClasses:A,unstyled:D,localization:N,intl:P,cells:j,isRowReorderable:x,sort:H,editable:K,edit:v,isClient:b,isEditDialog:V,dataItemKey:o,select:S,highlight:T}=l;let h=!1;const c=S&&o&&s.getter(o)(t.dataItem)!==void 0?S[s.getter(o)(t.dataItem)]:void 0,f=T&&o&&s.getter(o)(t.dataItem)!==void 0?T[s.getter(o)(t.dataItem)]:void 0;return{row:(l.hasDynamicColSpan?l.getCellsToRender(t.dataItem):l.cellsToRender).map(({columnIndex:a,colSpan:z})=>{var I,k,m,E,w,G;const e=C[a],y=R[a],B=(k=(I=e.locked)!=null?I:y==null?void 0:y.locked)!=null?k:!1;let u;if((m=e.rowSpannable)!=null&&m.enabled&&t.rowType==="data"&&e.field&&i){const r=e.field?(w=(E=e.rowSpannable).valueGetter)==null?void 0:w.call(E,t.dataItem,e.field):null;u={value:r,count:1},i[e.field]&&((G=i[e.field])==null?void 0:G.value)===r&&i[e.field]!==null?(i[e.field].count++,u.count=null):i[e.field]=u}const M=e.id?e.id:a,$=s.classNames(A.contentSticky({locked:B}),e.className),F=e.left!==void 0?{left:e.left,right:e.right}:{};let p=!1;if(e.editable&&K){const r=v&&o?v[s.getter(o)(t.dataItem)]:void 0;let n;typeof r=="boolean"?n=r:Array.isArray(r)?n=e.field?r.indexOf(e.field)>-1:!1:n=e.field!==void 0&&r===e.field,n&&e.columnType==="data"&&(n===!0||n===e.field)&&(h=!0,V||(p=!0))}const L=e._type==="expand",J={locked:e.locked,id:W.tableKeyboardNavigationTools.generateNavigatableId(`${d}-${String(a)}`,_,L||t.rowType==="groupHeader"||t.rowType==="groupFooter"||e.field==="value"?"nodata":"cell"),colSpan:z,dataItem:t.dataItem,field:e.field,editor:e.editor,format:e.format,columnType:e.columnType,rowReorderable:x,className:$,cells:O.resolveCells(j,e.cells),columnIndex:a,columnsCount:C.length,rowType:t.rowType,level:t.level,expanded:t.expanded,dataIndex:t.dataIndex,rowDataIndex:g,columnPosition:F,style:{},ariaColumnIndex:e.ariaColumnIndex,isSelected:!!((e==null?void 0:e._type)==="edit"?c:Array.isArray(c)&&c.indexOf(a)>-1),isHighlighted:!!((e==null?void 0:e._type)==="edit"?f:Array.isArray(f)&&f.indexOf(a)>-1),isSorted:!!O.isSorted(e.field,H),isInEdit:p,isAlt:q,unstyled:D,group:t.group,localization:N,intl:P,_rowSpan:u},Q=e.defaultCell||p&&(b?Z.GridEditCell:ee.GridEditCellServer)||(b?X.GridCell:Y.GridCellServer);return le.createElement(Q,{key:M,cellProps:J})}),isInEdit:h,isSelected:typeof c=="boolean"&&c,isHighlighted:typeof f=="boolean"&&f}}exports.getRowContents=oe;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import * as Q from "react";
|
|
9
|
+
import { getter as f, classNames as U } from "@progress/kendo-react-common";
|
|
10
|
+
import { tableKeyboardNavigationTools as W } from "@progress/kendo-react-data-tools";
|
|
11
|
+
import { isSorted as X, resolveCells as Y } from "./utils/index.mjs";
|
|
12
|
+
import { GridCell as Z } from "./cells/datacell/GridCell.mjs";
|
|
13
|
+
import { GridCellServer as ee } from "./cells/datacell/GridCellServer.mjs";
|
|
14
|
+
import { GridEditCell as le } from "./cells/editcell/GridEditCell.mjs";
|
|
15
|
+
import { GridEditCellServer as te } from "./cells/editcell/GridEditCellServer.mjs";
|
|
16
|
+
function ce(c, l, w, A, G, i) {
|
|
17
|
+
const {
|
|
18
|
+
leafColumns: y,
|
|
19
|
+
columnsState: N,
|
|
20
|
+
idPrefix: x,
|
|
21
|
+
gridClasses: _,
|
|
22
|
+
unstyled: D,
|
|
23
|
+
localization: H,
|
|
24
|
+
intl: K,
|
|
25
|
+
cells: O,
|
|
26
|
+
isRowReorderable: P,
|
|
27
|
+
sort: R,
|
|
28
|
+
editable: V,
|
|
29
|
+
edit: g,
|
|
30
|
+
isClient: m,
|
|
31
|
+
isEditDialog: B,
|
|
32
|
+
dataItemKey: t,
|
|
33
|
+
select: v,
|
|
34
|
+
highlight: C
|
|
35
|
+
} = c;
|
|
36
|
+
let h = !1;
|
|
37
|
+
const d = v && t && f(t)(l.dataItem) !== void 0 ? v[f(t)(l.dataItem)] : void 0, s = C && t && f(t)(l.dataItem) !== void 0 ? C[f(t)(l.dataItem)] : void 0;
|
|
38
|
+
return {
|
|
39
|
+
row: (c.hasDynamicColSpan ? c.getCellsToRender(l.dataItem) : c.cellsToRender).map(({ columnIndex: a, colSpan: $ }) => {
|
|
40
|
+
var b, I, S, T, k, E;
|
|
41
|
+
const e = y[a], p = N[a], z = (I = (b = e.locked) != null ? b : p == null ? void 0 : p.locked) != null ? I : !1;
|
|
42
|
+
let n;
|
|
43
|
+
if ((S = e.rowSpannable) != null && S.enabled && l.rowType === "data" && e.field && i) {
|
|
44
|
+
const o = e.field ? (k = (T = e.rowSpannable).valueGetter) == null ? void 0 : k.call(T, l.dataItem, e.field) : null;
|
|
45
|
+
n = { value: o, count: 1 }, i[e.field] && ((E = i[e.field]) == null ? void 0 : E.value) === o && i[e.field] !== null ? (i[e.field].count++, n.count = null) : i[e.field] = n;
|
|
46
|
+
}
|
|
47
|
+
const F = e.id ? e.id : a, L = U(_.contentSticky({ locked: z }), e.className), j = e.left !== void 0 ? { left: e.left, right: e.right } : {};
|
|
48
|
+
let u = !1;
|
|
49
|
+
if (e.editable && V) {
|
|
50
|
+
const o = g && t ? g[f(t)(l.dataItem)] : void 0;
|
|
51
|
+
let r;
|
|
52
|
+
typeof o == "boolean" ? r = o : Array.isArray(o) ? r = e.field ? o.indexOf(e.field) > -1 : !1 : r = e.field !== void 0 && o === e.field, r && e.columnType === "data" && (r === !0 || r === e.field) && (h = !0, B || (u = !0));
|
|
53
|
+
}
|
|
54
|
+
const q = e._type === "expand", J = {
|
|
55
|
+
locked: e.locked,
|
|
56
|
+
id: W.generateNavigatableId(
|
|
57
|
+
`${w}-${String(a)}`,
|
|
58
|
+
x,
|
|
59
|
+
q || l.rowType === "groupHeader" || l.rowType === "groupFooter" || e.field === "value" ? "nodata" : "cell"
|
|
60
|
+
),
|
|
61
|
+
colSpan: $,
|
|
62
|
+
dataItem: l.dataItem,
|
|
63
|
+
field: e.field,
|
|
64
|
+
editor: e.editor,
|
|
65
|
+
format: e.format,
|
|
66
|
+
columnType: e.columnType,
|
|
67
|
+
rowReorderable: P,
|
|
68
|
+
className: L,
|
|
69
|
+
cells: Y(O, e.cells),
|
|
70
|
+
columnIndex: a,
|
|
71
|
+
columnsCount: y.length,
|
|
72
|
+
rowType: l.rowType,
|
|
73
|
+
level: l.level,
|
|
74
|
+
expanded: l.expanded,
|
|
75
|
+
dataIndex: l.dataIndex,
|
|
76
|
+
rowDataIndex: A,
|
|
77
|
+
columnPosition: j,
|
|
78
|
+
style: {},
|
|
79
|
+
ariaColumnIndex: e.ariaColumnIndex,
|
|
80
|
+
isSelected: !!((e == null ? void 0 : e._type) === "edit" ? d : Array.isArray(d) && d.indexOf(a) > -1),
|
|
81
|
+
isHighlighted: !!((e == null ? void 0 : e._type) === "edit" ? s : Array.isArray(s) && s.indexOf(a) > -1),
|
|
82
|
+
isSorted: !!X(e.field, R),
|
|
83
|
+
isInEdit: u,
|
|
84
|
+
isAlt: G,
|
|
85
|
+
unstyled: D,
|
|
86
|
+
group: l.group,
|
|
87
|
+
localization: H,
|
|
88
|
+
intl: K,
|
|
89
|
+
_rowSpan: n
|
|
90
|
+
}, M = e.defaultCell || u && (m ? le : te) || (m ? Z : ee);
|
|
91
|
+
return /* @__PURE__ */ Q.createElement(M, { key: F, cellProps: J });
|
|
92
|
+
}),
|
|
93
|
+
isInEdit: h,
|
|
94
|
+
isSelected: typeof d == "boolean" && d,
|
|
95
|
+
isHighlighted: typeof s == "boolean" && s
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
export {
|
|
99
|
+
ce as getRowContents
|
|
100
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { GridHeaderCellProps } from '../interfaces/GridHeaderCellProps.js';
|
|
9
|
+
import * as React from 'react';
|
|
10
|
+
/**
|
|
11
|
+
* @hidden
|
|
12
|
+
*/
|
|
13
|
+
export declare const GridHeaderGroupSpacerCell: (_props: GridHeaderCellProps) => React.JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),c=require("@progress/kendo-react-common"),i=require("@progress/kendo-react-intl"),o=require("../messages/index.js");function u(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,a.get?a:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const d=u(l),p=t=>{var n;const e=c.useUnstyled(),r=(n=e==null?void 0:e.uGrid)!=null?n:c.uGrid,s=i.useLocalization().toLanguageString(o.headerGroupSpacerAccessibleLabel,o.messages[o.headerGroupSpacerAccessibleLabel]);return d.createElement("span",{className:c.classNames(r.srOnly({}))},s)};exports.GridHeaderGroupSpacerCell=p;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as t from "react";
|
|
10
|
+
import { useUnstyled as c, uGrid as i, classNames as l } from "@progress/kendo-react-common";
|
|
11
|
+
import { useLocalization as n } from "@progress/kendo-react-intl";
|
|
12
|
+
import { headerGroupSpacerAccessibleLabel as a, messages as m } from "../messages/index.mjs";
|
|
13
|
+
const f = (p) => {
|
|
14
|
+
var r;
|
|
15
|
+
const e = c(), o = (r = e == null ? void 0 : e.uGrid) != null ? r : i, s = n().toLanguageString(
|
|
16
|
+
a,
|
|
17
|
+
m[a]
|
|
18
|
+
);
|
|
19
|
+
return /* @__PURE__ */ t.createElement("span", { className: l(o.srOnly({})) }, s);
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
f as GridHeaderGroupSpacerCell
|
|
23
|
+
};
|