@progress/kendo-react-grid 8.6.0-develop.1 → 9.0.0-develop.10
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/README.md +34 -33
- package/VirtualScroll.mjs +14 -11
- package/cells/GridCell.mjs +6 -3
- package/cells/GridDetailCell.mjs +6 -3
- package/cells/GridEditCell.mjs +10 -38
- package/cells/GridGroupCell.mjs +24 -30
- package/cells/GridHierarchyCell.mjs +2 -13
- package/cells/GridSelectionCell.mjs +3 -24
- package/columnMenu/GridColumnMenuCheckboxFilter.mjs +36 -42
- package/columnMenu/GridColumnMenuFilter.mjs +18 -28
- package/columnMenu/GridColumnMenuFilterCell.mjs +1 -9
- package/columnMenu/GridColumnMenuFilterUI.mjs +1 -8
- package/columnMenu/GridColumnMenuWrapper.mjs +6 -18
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/drag/ColumnDraggable.mjs +14 -2
- package/drag/ColumnResize.js +1 -1
- package/drag/ColumnResize.mjs +36 -44
- package/drag/GroupingIndicator.mjs +1 -15
- package/filterCommon.mjs +1 -3
- package/footer/Footer.mjs +22 -22
- package/footer/FooterRow.mjs +6 -5
- package/header/FilterRow.mjs +38 -42
- package/header/GridHeaderSelectionCell.mjs +3 -1
- package/header/Header.mjs +19 -4
- package/header/HeaderRow.mjs +24 -27
- package/messages/index.mjs +4 -1
- package/package-metadata.mjs +1 -1
- package/package.json +11 -11
- package/rows/GridRow.mjs +10 -8
- package/utils/index.js +1 -1
- package/utils/index.mjs +35 -39
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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=1,u=20;class g{constructor(f){this.columns=[],this.resizable=!1,this.isRtl=!1,this.setIsRtl=c=>{this.isRtl=c},this.dragHandler=(c,
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=1,u=20;class g{constructor(f){this.columns=[],this.resizable=!1,this.isRtl=!1,this.setIsRtl=c=>{this.isRtl=c},this.dragHandler=(c,n,e,r)=>{const t=c.originalEvent;r||(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation());const o=e.closest("th");if(!o||!o)return;const s=o.clientWidth;let l=s;if(this.isRtl?l+=e.getBoundingClientRect().right-e.offsetWidth/2-c.clientX:l+=c.clientX-e.getBoundingClientRect().left-e.offsetWidth/2,!r&&Math.abs(l-s)<1)return;this.fixateInitialWidths(o.parentElement.clientWidth),this.setWidths(n,Math.floor(l)/s);const d=this.columns.filter(i=>!i.children.length).findIndex(i=>i.id===n.id);this.onResize(d,s,l,t,r,n.id)},this.dblClickHandler=(c,n)=>{const e=this.columns.filter(h=>n.indexOf(h.id)>-1);if(!this.colGroupMain||!e.length)return;const r={},t=e;for(;t.length>0;){const h=t.pop();if(!h)break;h.children.length?t.push(...h.children):r[h.id]=h}const o=this.columns.filter(h=>!h.children.length),s=[];o.forEach((h,a)=>{r[h.id]&&s.push(a)});const l=[this.colGroupMain.parentElement],d=[this.colGroupMain];this.colGroupHeader&&(l.push(this.colGroupHeader.parentElement),d.push(this.colGroupHeader)),this.colGroupFooter&&(l.push(this.colGroupFooter.parentElement),d.push(this.colGroupFooter)),l.forEach(h=>h.classList.add("k-autofitting"));const i=[];d.forEach(h=>{s.forEach(a=>{h.children[a]&&(h.children[a].width="",i[a]=Math.max(i[a]||0,h.children[a].offsetWidth+p))})}),d.forEach(h=>{s.forEach(a=>{h.children[a]&&(h.children[a].width=i[a]+"px",o[a].width=i[a])})}),l.forEach(h=>h.classList.remove("k-autofitting")),this.onResize(s[0],0,0,c,!0,n[0])},this.updateColElements=c=>{const n=this.columns.filter(r=>!r.children.length);let e=1e-10;for(let r=0;r<c.length;r++){const t=c[r],o=n.findIndex(i=>i.id===t.id),s=parseFloat((t.width||0).toString()),l=Math.floor(s);e+=s-l;const d=l+Math.floor(e);if(e-=Math.floor(e),this.colGroupMain&&this.colGroupMain.children[o]){const i=parseInt(this.colGroupMain.children[o].width,10);this.colGroupMain.children[o].width=d+"px",this.updateNextLockedCol(this.colGroupMain.parentElement,t,i-d)}if(this.colGroupHeader&&this.colGroupHeader.children[o]){const i=parseInt(this.colGroupHeader.children[o].width,10);this.colGroupHeader.children[o].width=d+"px",this.updateNextLockedCol(this.colGroupHeader.parentElement,t,i-d)}if(this.colGroupFooter&&this.colGroupFooter.children[o]){const i=parseInt(this.colGroupFooter.children[o].width,10);this.colGroupFooter.children[o].width=d+"px",this.updateNextLockedCol(this.colGroupFooter.parentElement,t,i-d)}}},this.onResize=f}fixateInitialWidths(f){const c=this.columns.filter(t=>!t.children.length);let n=0;const e=this.colGroupMain?this.colGroupMain.children:[];for(let t=0;t<e.length;t++)e[t].width?f-=parseFloat(e[t].width):n++;if(n===0)return;const r=Math.floor(f/n);for(let t=0;t<e.length;t++){const o=e[t];o.width||(o.width=r,c[t].width=r.toString(),this.colGroupHeader&&(this.colGroupHeader.children[t].width=r),this.colGroupFooter&&(this.colGroupFooter.children[t].width=r))}}setWidths(f,c){const n=this.columns.findIndex(t=>t.id===f.id),e=[];let r=f.children.length;for(let t=n+1;r>0&&t<this.columns.length;t++,r--){const o=this.columns[t];o.children.length?r+=o.children.length:e.push(o)}return e.length===0&&e.push(f),e.forEach(t=>{let o=t.width?parseFloat(t.width.toString())*c:0;const s=t.minResizableWidth===void 0?10:t.minResizableWidth;o<s&&(o=s),t.width=o}),this.updateColElements(e),e}updateNextLockedCol(f,c,n){const e=c.index,r=this.colGroupMain.parentElement.closest(".k-grid"),t=r==null?void 0:r.clientWidth,o=this.columns.filter(s=>s.locked).map(s=>parseInt(s.width+"",10)).reduce((s,l)=>s+l,0);!c.locked||t<=o+u||this.columns.forEach(s=>{if(s!=null&&s.locked&&n){const l=f==null?void 0:f.querySelectorAll('[aria-colindex="'+s.ariaColumnIndex+'"]');l==null||l.forEach(d=>{const i=d.style;this.isRtl?(s.index>e&&i&&i.right&&(i.right=parseInt(i.right,10)-n+"px"),s.index<e&&i&&i.left&&(i.left=parseInt(i.left,10)-n+"px")):(s.index>e&&i&&i.left&&(i.left=parseInt(i.left,10)-n+"px"),s.index<e&&i&&i.right&&(i.right=parseInt(i.right,10)-n+"px"))})}})}}exports.ColumnResize=g;
|
package/drag/ColumnResize.mjs
CHANGED
|
@@ -10,21 +10,21 @@ class u {
|
|
|
10
10
|
constructor(f) {
|
|
11
11
|
this.columns = [], this.resizable = !1, this.isRtl = !1, this.setIsRtl = (c) => {
|
|
12
12
|
this.isRtl = c;
|
|
13
|
-
}, this.dragHandler = (c,
|
|
13
|
+
}, this.dragHandler = (c, n, e, h) => {
|
|
14
14
|
const t = c.originalEvent;
|
|
15
15
|
h || (t.preventDefault(), t.stopPropagation(), t.stopImmediatePropagation());
|
|
16
16
|
const o = e.closest("th");
|
|
17
17
|
if (!o || !o)
|
|
18
18
|
return;
|
|
19
19
|
const s = o.clientWidth;
|
|
20
|
-
let
|
|
21
|
-
if (this.isRtl ?
|
|
20
|
+
let l = s;
|
|
21
|
+
if (this.isRtl ? l += e.getBoundingClientRect().right - e.offsetWidth / 2 - c.clientX : l += c.clientX - e.getBoundingClientRect().left - e.offsetWidth / 2, !h && Math.abs(l - s) < 1)
|
|
22
22
|
return;
|
|
23
|
-
this.fixateInitialWidths(o.parentElement.clientWidth), this.setWidths(
|
|
24
|
-
const d = this.columns.filter((i) => !i.children.length).findIndex((i) => i.id ===
|
|
25
|
-
this.onResize(d, s,
|
|
26
|
-
}, this.dblClickHandler = (c,
|
|
27
|
-
const e = this.columns.filter((r) =>
|
|
23
|
+
this.fixateInitialWidths(o.parentElement.clientWidth), this.setWidths(n, Math.floor(l) / s);
|
|
24
|
+
const d = this.columns.filter((i) => !i.children.length).findIndex((i) => i.id === n.id);
|
|
25
|
+
this.onResize(d, s, l, t, h, n.id);
|
|
26
|
+
}, this.dblClickHandler = (c, n) => {
|
|
27
|
+
const e = this.columns.filter((r) => n.indexOf(r.id) > -1);
|
|
28
28
|
if (!this.colGroupMain || !e.length)
|
|
29
29
|
return;
|
|
30
30
|
const h = {}, t = e;
|
|
@@ -38,69 +38,61 @@ class u {
|
|
|
38
38
|
o.forEach((r, a) => {
|
|
39
39
|
h[r.id] && s.push(a);
|
|
40
40
|
});
|
|
41
|
-
const
|
|
42
|
-
this.colGroupHeader && (
|
|
43
|
-
|
|
41
|
+
const l = [this.colGroupMain.parentElement], d = [this.colGroupMain];
|
|
42
|
+
this.colGroupHeader && (l.push(this.colGroupHeader.parentElement), d.push(this.colGroupHeader)), this.colGroupFooter && (l.push(this.colGroupFooter.parentElement), d.push(this.colGroupFooter)), l.forEach((r) => r.classList.add("k-autofitting"));
|
|
43
|
+
const i = [];
|
|
44
44
|
d.forEach((r) => {
|
|
45
45
|
s.forEach((a) => {
|
|
46
|
-
r.children[a] && (r.children[a].width = "", i[a] = Math.max(
|
|
46
|
+
r.children[a] && (r.children[a].width = "", i[a] = Math.max(
|
|
47
|
+
i[a] || 0,
|
|
48
|
+
r.children[a].offsetWidth + 1
|
|
49
|
+
));
|
|
47
50
|
});
|
|
48
51
|
}), d.forEach((r) => {
|
|
49
52
|
s.forEach((a) => {
|
|
50
53
|
r.children[a] && (r.children[a].width = i[a] + "px", o[a].width = i[a]);
|
|
51
54
|
});
|
|
52
|
-
}),
|
|
55
|
+
}), l.forEach((r) => r.classList.remove("k-autofitting")), this.onResize(s[0], 0, 0, c, !0, n[0]);
|
|
53
56
|
}, this.updateColElements = (c) => {
|
|
54
|
-
const
|
|
57
|
+
const n = this.columns.filter((h) => !h.children.length);
|
|
55
58
|
let e = 1e-10;
|
|
56
59
|
for (let h = 0; h < c.length; h++) {
|
|
57
|
-
const t = c[h], o =
|
|
58
|
-
e += s -
|
|
59
|
-
const d =
|
|
60
|
+
const t = c[h], o = n.findIndex((i) => i.id === t.id), s = parseFloat((t.width || 0).toString()), l = Math.floor(s);
|
|
61
|
+
e += s - l;
|
|
62
|
+
const d = l + Math.floor(e);
|
|
60
63
|
if (e -= Math.floor(e), this.colGroupMain && this.colGroupMain.children[o]) {
|
|
61
64
|
const i = parseInt(this.colGroupMain.children[o].width, 10);
|
|
62
|
-
this.colGroupMain.children[o].width = d + "px", this.updateNextLockedCol(
|
|
63
|
-
this.colGroupMain.parentElement,
|
|
64
|
-
t,
|
|
65
|
-
i - d
|
|
66
|
-
);
|
|
65
|
+
this.colGroupMain.children[o].width = d + "px", this.updateNextLockedCol(this.colGroupMain.parentElement, t, i - d);
|
|
67
66
|
}
|
|
68
67
|
if (this.colGroupHeader && this.colGroupHeader.children[o]) {
|
|
69
68
|
const i = parseInt(this.colGroupHeader.children[o].width, 10);
|
|
70
|
-
this.colGroupHeader.children[o].width = d + "px", this.updateNextLockedCol(
|
|
71
|
-
this.colGroupHeader.parentElement,
|
|
72
|
-
t,
|
|
73
|
-
i - d
|
|
74
|
-
);
|
|
69
|
+
this.colGroupHeader.children[o].width = d + "px", this.updateNextLockedCol(this.colGroupHeader.parentElement, t, i - d);
|
|
75
70
|
}
|
|
76
71
|
if (this.colGroupFooter && this.colGroupFooter.children[o]) {
|
|
77
72
|
const i = parseInt(this.colGroupFooter.children[o].width, 10);
|
|
78
|
-
this.colGroupFooter.children[o].width = d + "px", this.updateNextLockedCol(
|
|
79
|
-
this.colGroupFooter.parentElement,
|
|
80
|
-
t,
|
|
81
|
-
i - d
|
|
82
|
-
);
|
|
73
|
+
this.colGroupFooter.children[o].width = d + "px", this.updateNextLockedCol(this.colGroupFooter.parentElement, t, i - d);
|
|
83
74
|
}
|
|
84
75
|
}
|
|
85
76
|
}, this.onResize = f;
|
|
86
77
|
}
|
|
87
78
|
fixateInitialWidths(f) {
|
|
88
79
|
const c = this.columns.filter((t) => !t.children.length);
|
|
89
|
-
let
|
|
80
|
+
let n = 0;
|
|
81
|
+
const e = this.colGroupMain ? this.colGroupMain.children : [];
|
|
90
82
|
for (let t = 0; t < e.length; t++)
|
|
91
|
-
e[t].width ? f -= parseFloat(e[t].width) :
|
|
92
|
-
if (
|
|
83
|
+
e[t].width ? f -= parseFloat(e[t].width) : n++;
|
|
84
|
+
if (n === 0)
|
|
93
85
|
return;
|
|
94
|
-
const h = Math.floor(f /
|
|
86
|
+
const h = Math.floor(f / n);
|
|
95
87
|
for (let t = 0; t < e.length; t++) {
|
|
96
88
|
const o = e[t];
|
|
97
89
|
o.width || (o.width = h, c[t].width = h.toString(), this.colGroupHeader && (this.colGroupHeader.children[t].width = h), this.colGroupFooter && (this.colGroupFooter.children[t].width = h));
|
|
98
90
|
}
|
|
99
91
|
}
|
|
100
92
|
setWidths(f, c) {
|
|
101
|
-
const
|
|
93
|
+
const n = this.columns.findIndex((t) => t.id === f.id), e = [];
|
|
102
94
|
let h = f.children.length;
|
|
103
|
-
for (let t =
|
|
95
|
+
for (let t = n + 1; h > 0 && t < this.columns.length; t++, h--) {
|
|
104
96
|
const o = this.columns[t];
|
|
105
97
|
o.children.length ? h += o.children.length : e.push(o);
|
|
106
98
|
}
|
|
@@ -110,14 +102,14 @@ class u {
|
|
|
110
102
|
o < s && (o = s), t.width = o;
|
|
111
103
|
}), this.updateColElements(e), e;
|
|
112
104
|
}
|
|
113
|
-
updateNextLockedCol(f, c,
|
|
114
|
-
const e = c.index, h = this.colGroupMain.parentElement.closest(".k-grid"), t = h == null ? void 0 : h.clientWidth, o = this.columns.filter((s) => s.locked).map((s) => parseInt(s.width + "", 10)).reduce((s,
|
|
105
|
+
updateNextLockedCol(f, c, n) {
|
|
106
|
+
const e = c.index, h = this.colGroupMain.parentElement.closest(".k-grid"), t = h == null ? void 0 : h.clientWidth, o = this.columns.filter((s) => s.locked).map((s) => parseInt(s.width + "", 10)).reduce((s, l) => s + l, 0);
|
|
115
107
|
!c.locked || t <= o + 20 || this.columns.forEach((s) => {
|
|
116
|
-
if (s != null && s.locked &&
|
|
117
|
-
const
|
|
118
|
-
|
|
108
|
+
if (s != null && s.locked && n) {
|
|
109
|
+
const l = f == null ? void 0 : f.querySelectorAll('[aria-colindex="' + s.ariaColumnIndex + '"]');
|
|
110
|
+
l == null || l.forEach((d) => {
|
|
119
111
|
const i = d.style;
|
|
120
|
-
this.isRtl ? (s.index > e && i && i.right && (i.right = parseInt(i.right, 10) -
|
|
112
|
+
this.isRtl ? (s.index > e && i && i.right && (i.right = parseInt(i.right, 10) - n + "px"), s.index < e && i && i.left && (i.left = parseInt(i.left, 10) - n + "px")) : (s.index > e && i && i.left && (i.left = parseInt(i.left, 10) - n + "px"), s.index < e && i && i.right && (i.right = parseInt(i.right, 10) - n + "px"));
|
|
121
113
|
});
|
|
122
114
|
}
|
|
123
115
|
});
|
|
@@ -70,21 +70,7 @@ class c extends s.Component {
|
|
|
70
70
|
}
|
|
71
71
|
)),
|
|
72
72
|
/* @__PURE__ */ s.createElement("span", { className: "k-chip-content" }, this.props.title),
|
|
73
|
-
/* @__PURE__ */ s.createElement("span", { className: "k-chip-actions" }, /* @__PURE__ */ s.createElement(
|
|
74
|
-
"span",
|
|
75
|
-
{
|
|
76
|
-
className: "k-chip-action k-chip-remove-action",
|
|
77
|
-
onClick: this.groupRemove
|
|
78
|
-
},
|
|
79
|
-
/* @__PURE__ */ s.createElement(
|
|
80
|
-
n,
|
|
81
|
-
{
|
|
82
|
-
name: "x-circle",
|
|
83
|
-
icon: l,
|
|
84
|
-
size: "small"
|
|
85
|
-
}
|
|
86
|
-
)
|
|
87
|
-
))
|
|
73
|
+
/* @__PURE__ */ s.createElement("span", { className: "k-chip-actions" }, /* @__PURE__ */ s.createElement("span", { className: "k-chip-action k-chip-remove-action", onClick: this.groupRemove }, /* @__PURE__ */ s.createElement(n, { name: "x-circle", icon: l, size: "small" })))
|
|
88
74
|
)
|
|
89
75
|
);
|
|
90
76
|
}
|
package/filterCommon.mjs
CHANGED
|
@@ -43,9 +43,7 @@ const f = [
|
|
|
43
43
|
{ text: "grid.filterIsNullOperator", operator: "isnull" },
|
|
44
44
|
{ text: "grid.filterIsNotNullOperator", operator: "isnotnull" }
|
|
45
45
|
],
|
|
46
|
-
boolean: [
|
|
47
|
-
{ text: "grid.filterEqOperator", operator: "eq" }
|
|
48
|
-
]
|
|
46
|
+
boolean: [{ text: "grid.filterEqOperator", operator: "eq" }]
|
|
49
47
|
}, i = (t) => t === "isnull" || t === "isnotnull" || t === "isempty" || t === "isnotempty", d = (t, o) => t.map((e) => ({
|
|
50
48
|
text: o.toLanguageString(e.text, l[e.text]),
|
|
51
49
|
operator: e.operator
|
package/footer/Footer.mjs
CHANGED
|
@@ -30,45 +30,45 @@ class i extends t.Component {
|
|
|
30
30
|
this.table && (this.table.style.width = e + "px");
|
|
31
31
|
}
|
|
32
32
|
render() {
|
|
33
|
-
return this.props.staticHeaders ? /* @__PURE__ */ t.createElement(
|
|
33
|
+
return this.props.staticHeaders ? /* @__PURE__ */ t.createElement("div", { className: "k-grid-footer", role: "presentation" }, /* @__PURE__ */ t.createElement(
|
|
34
34
|
"div",
|
|
35
35
|
{
|
|
36
|
-
|
|
36
|
+
ref: (e) => {
|
|
37
|
+
this.footerWrap = e;
|
|
38
|
+
},
|
|
39
|
+
className: "k-grid-footer-wrap",
|
|
40
|
+
style: this.props.hasScrollbarWidth ? {} : { borderWidth: 0 },
|
|
37
41
|
role: "presentation"
|
|
38
42
|
},
|
|
39
43
|
/* @__PURE__ */ t.createElement(
|
|
40
|
-
"
|
|
44
|
+
"table",
|
|
41
45
|
{
|
|
42
46
|
ref: (e) => {
|
|
43
|
-
this.
|
|
47
|
+
this.table = e;
|
|
44
48
|
},
|
|
45
|
-
className:
|
|
46
|
-
|
|
49
|
+
className: s(
|
|
50
|
+
"k-table k-grid-footer-table",
|
|
51
|
+
{
|
|
52
|
+
"k-table-md": !this.props.size,
|
|
53
|
+
[`k-table-${r.sizeMap[this.props.size] || this.props.size}`]: this.props.size
|
|
54
|
+
},
|
|
55
|
+
this.props.className
|
|
56
|
+
),
|
|
47
57
|
role: "presentation"
|
|
48
58
|
},
|
|
49
59
|
/* @__PURE__ */ t.createElement(
|
|
50
|
-
"
|
|
60
|
+
"colgroup",
|
|
51
61
|
{
|
|
52
62
|
ref: (e) => {
|
|
53
|
-
this.
|
|
63
|
+
this.props.columnResize.colGroupFooter = e;
|
|
54
64
|
},
|
|
55
|
-
className: s(
|
|
56
|
-
"k-table k-grid-footer-table",
|
|
57
|
-
{
|
|
58
|
-
"k-table-md": !this.props.size,
|
|
59
|
-
[`k-table-${r.sizeMap[this.props.size] || this.props.size}`]: this.props.size
|
|
60
|
-
},
|
|
61
|
-
this.props.className
|
|
62
|
-
),
|
|
63
65
|
role: "presentation"
|
|
64
66
|
},
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
/* @__PURE__ */ t.createElement("tfoot", { className: "k-table-tfoot", role: "presentation" }, this.props.row)
|
|
69
|
-
)
|
|
67
|
+
this.props.cols
|
|
68
|
+
),
|
|
69
|
+
/* @__PURE__ */ t.createElement("tfoot", { className: "k-table-tfoot", role: "presentation" }, this.props.row)
|
|
70
70
|
)
|
|
71
|
-
) : /* @__PURE__ */ t.createElement("tfoot", { className: "k-table-tfoot" }, this.props.row);
|
|
71
|
+
)) : /* @__PURE__ */ t.createElement("tfoot", { className: "k-table-tfoot" }, this.props.row);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
export {
|
package/footer/FooterRow.mjs
CHANGED
|
@@ -14,10 +14,7 @@ const k = (t) => {
|
|
|
14
14
|
const { column: e, index: l, isRtl: r, id: c, cells: s } = t, d = b(c), a = {
|
|
15
15
|
colSpan: e.colSpan !== 1 ? e.colSpan : void 0,
|
|
16
16
|
style: e.left !== void 0 ? r ? { left: e.right, right: e.left } : { left: e.left, right: e.right } : {},
|
|
17
|
-
className: C(
|
|
18
|
-
"k-table-td",
|
|
19
|
-
e.locked && e.left !== void 0 ? "k-grid-footer-sticky" : ""
|
|
20
|
-
),
|
|
17
|
+
className: C("k-table-td", e.locked && e.left !== void 0 ? "k-grid-footer-sticky" : ""),
|
|
21
18
|
key: l,
|
|
22
19
|
role: "gridcell",
|
|
23
20
|
"aria-colindex": e.ariaColumnIndex,
|
|
@@ -33,7 +30,11 @@ const k = (t) => {
|
|
|
33
30
|
}
|
|
34
31
|
return e.footerCell && /* @__PURE__ */ o.createElement(e.footerCell, { ...n, key: l }) || /* @__PURE__ */ o.createElement("td", { ...a });
|
|
35
32
|
}, I = (t) => /* @__PURE__ */ o.createElement("tr", { className: "k-table-row", role: "row", "aria-rowindex": t.ariaRowIndex }, f(t.columns).map((e, l) => {
|
|
36
|
-
const r = g.generateNavigatableId(
|
|
33
|
+
const r = g.generateNavigatableId(
|
|
34
|
+
`${l}-footercell`,
|
|
35
|
+
t.idPrefix,
|
|
36
|
+
"nodata"
|
|
37
|
+
);
|
|
37
38
|
return /* @__PURE__ */ o.createElement(
|
|
38
39
|
k,
|
|
39
40
|
{
|
package/header/FilterRow.mjs
CHANGED
|
@@ -39,53 +39,49 @@ class S extends a.Component {
|
|
|
39
39
|
const r = k(this), o = this.props.filter && this.props.filter.filters || [], l = (e) => {
|
|
40
40
|
if (e === void 0)
|
|
41
41
|
return;
|
|
42
|
-
const i = o.filter(
|
|
42
|
+
const i = o.filter(
|
|
43
|
+
(t) => t.field === e
|
|
44
|
+
);
|
|
43
45
|
return i.length ? i[0] : void 0;
|
|
44
46
|
};
|
|
45
47
|
let n = 0, s = -1;
|
|
46
|
-
const h = this.props.columns.filter((e) => e.children.length === 0).map(
|
|
47
|
-
(e)
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
this.setFilter(p.value, p.operator, e.field, p.syntheticEvent);
|
|
63
|
-
}
|
|
64
|
-
}, C = e.declarationIndex >= 0 ? ++s : --n, x = {
|
|
65
|
-
ariaLabel: g,
|
|
66
|
-
ariaColumnIndex: e.ariaColumnIndex
|
|
67
|
-
}, E = e.left !== void 0 ? this.props.isRtl ? { left: e.right, right: e.left } : { left: e.left, right: e.right } : {}, m = {
|
|
68
|
-
columnId: R.getFilterColumnId(e.id),
|
|
69
|
-
navigatable: e.navigatable || this.props.navigatable,
|
|
70
|
-
style: E,
|
|
71
|
-
className: T("k-table-th", this.headerCellClassName(e.field, e.locked) || void 0),
|
|
72
|
-
role: "columnheader",
|
|
73
|
-
...x
|
|
74
|
-
}, v = f && (e.filterCell ? /* @__PURE__ */ a.createElement(e.filterCell, { ...f }) : /* @__PURE__ */ a.createElement(I, { size: this.props.size, ...f })), c = z(this.props.cells, e.cells);
|
|
75
|
-
if (c && c.filterCell) {
|
|
76
|
-
const p = c.filterCell;
|
|
77
|
-
return /* @__PURE__ */ a.createElement(p, { key: C, ...f, thProps: m, index: s }, v);
|
|
48
|
+
const h = this.props.columns.filter((e) => e.children.length === 0).map((e) => {
|
|
49
|
+
const i = y(e.filter), t = l(e.field), g = e.filterable ? r.toLanguageString(b, N[b]) : void 0;
|
|
50
|
+
let d = t && t.value;
|
|
51
|
+
d === void 0 && (d = i === "text" ? "" : null);
|
|
52
|
+
const f = e.filterable && {
|
|
53
|
+
render: this.props.cellRender,
|
|
54
|
+
field: e.field,
|
|
55
|
+
title: e.filterTitle,
|
|
56
|
+
value: d,
|
|
57
|
+
operator: t && t.operator,
|
|
58
|
+
operators: F(this.props.filterOperators[i] || [], r),
|
|
59
|
+
booleanValues: F(L, r),
|
|
60
|
+
filterType: i,
|
|
61
|
+
ariaLabel: g,
|
|
62
|
+
onChange: (p) => {
|
|
63
|
+
this.setFilter(p.value, p.operator, e.field, p.syntheticEvent);
|
|
78
64
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
65
|
+
}, C = e.declarationIndex >= 0 ? ++s : --n, x = {
|
|
66
|
+
ariaLabel: g,
|
|
67
|
+
ariaColumnIndex: e.ariaColumnIndex
|
|
68
|
+
}, E = e.left !== void 0 ? this.props.isRtl ? { left: e.right, right: e.left } : { left: e.left, right: e.right } : {}, m = {
|
|
69
|
+
columnId: R.getFilterColumnId(e.id),
|
|
70
|
+
navigatable: e.navigatable || this.props.navigatable,
|
|
71
|
+
style: E,
|
|
72
|
+
className: T(
|
|
73
|
+
"k-table-th",
|
|
74
|
+
this.headerCellClassName(e.field, e.locked) || void 0
|
|
75
|
+
),
|
|
76
|
+
role: "columnheader",
|
|
77
|
+
...x
|
|
78
|
+
}, v = f && (e.filterCell ? /* @__PURE__ */ a.createElement(e.filterCell, { ...f }) : /* @__PURE__ */ a.createElement(I, { size: this.props.size, ...f })), c = z(this.props.cells, e.cells);
|
|
79
|
+
if (c && c.filterCell) {
|
|
80
|
+
const p = c.filterCell;
|
|
81
|
+
return /* @__PURE__ */ a.createElement(p, { key: C, ...f, thProps: m, index: s }, v);
|
|
87
82
|
}
|
|
88
|
-
|
|
83
|
+
return /* @__PURE__ */ a.createElement(w, { key: C, ...m }, v);
|
|
84
|
+
});
|
|
89
85
|
return /* @__PURE__ */ a.createElement("tr", { className: A, "aria-rowindex": this.props.ariaRowIndex, role: "row" }, h);
|
|
90
86
|
}
|
|
91
87
|
}
|
package/header/Header.mjs
CHANGED
|
@@ -72,10 +72,25 @@ class d extends s.Component {
|
|
|
72
72
|
className: r(e.headerTable({ size: l }), this.props.className),
|
|
73
73
|
role: "presentation"
|
|
74
74
|
},
|
|
75
|
-
/* @__PURE__ */ s.createElement(
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
/* @__PURE__ */ s.createElement(
|
|
76
|
+
"colgroup",
|
|
77
|
+
{
|
|
78
|
+
ref: (t) => {
|
|
79
|
+
this.props.columnResize.colGroupHeader = t;
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
this.props.cols
|
|
83
|
+
),
|
|
84
|
+
/* @__PURE__ */ s.createElement(
|
|
85
|
+
"thead",
|
|
86
|
+
{
|
|
87
|
+
className: r(e.tableThead({})),
|
|
88
|
+
role: "rowgroup",
|
|
89
|
+
...a
|
|
90
|
+
},
|
|
91
|
+
this.props.headerRow,
|
|
92
|
+
this.props.filterRow
|
|
93
|
+
)
|
|
79
94
|
)
|
|
80
95
|
)
|
|
81
96
|
) : /* @__PURE__ */ s.createElement(
|
package/header/HeaderRow.mjs
CHANGED
|
@@ -61,12 +61,14 @@ const $ = {
|
|
|
61
61
|
];
|
|
62
62
|
}, I = (t) => t.map((n) => {
|
|
63
63
|
const l = e.columns[n], s = e.sortable && l.sortable, o = e.sort ? e.sort.findIndex((a) => a.field === l.field) : -1, d = o >= 0 && e.sort[o].dir || "none", c = l.columnMenu === null ? null : l.columnMenu || e.columnMenu, i = l.menuIcon || e.columnMenuIcon, h = u(
|
|
64
|
-
u(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
64
|
+
u(
|
|
65
|
+
f.headerTh({
|
|
66
|
+
first: l.kFirst,
|
|
67
|
+
filterable: !!c,
|
|
68
|
+
locked: l.locked,
|
|
69
|
+
sorted: e.sort && e.sort.some((a) => a.field === l.field)
|
|
70
|
+
})
|
|
71
|
+
),
|
|
70
72
|
l.headerClassName
|
|
71
73
|
);
|
|
72
74
|
l.locked === !1 && (l.left = 0);
|
|
@@ -140,29 +142,24 @@ const $ = {
|
|
|
140
142
|
const a = y.headerCell;
|
|
141
143
|
return /* @__PURE__ */ r.createElement(a, { ...M.props, key: k, thProps: w, index: n }, z);
|
|
142
144
|
}
|
|
143
|
-
return /* @__PURE__ */ r.createElement(
|
|
144
|
-
|
|
145
|
+
return /* @__PURE__ */ r.createElement(J, { ...w, key: k }, z);
|
|
146
|
+
});
|
|
147
|
+
return e.columnsMap.map(
|
|
148
|
+
(t, n) => e.pressHandler && /* @__PURE__ */ r.createElement(
|
|
149
|
+
U,
|
|
145
150
|
{
|
|
146
|
-
|
|
147
|
-
|
|
151
|
+
key: n,
|
|
152
|
+
pressHandler: e.pressHandler,
|
|
153
|
+
dragHandler: e.dragHandler,
|
|
154
|
+
releaseHandler: e.releaseHandler,
|
|
155
|
+
ariaRowIndex: n + 1,
|
|
156
|
+
dragClue: e.dragClue,
|
|
157
|
+
headerRef: e.headerRef,
|
|
158
|
+
containerRef: e.containerRef
|
|
148
159
|
},
|
|
149
|
-
|
|
150
|
-
)
|
|
151
|
-
|
|
152
|
-
return e.columnsMap.map((t, n) => e.pressHandler && /* @__PURE__ */ r.createElement(
|
|
153
|
-
U,
|
|
154
|
-
{
|
|
155
|
-
key: n,
|
|
156
|
-
pressHandler: e.pressHandler,
|
|
157
|
-
dragHandler: e.dragHandler,
|
|
158
|
-
releaseHandler: e.releaseHandler,
|
|
159
|
-
ariaRowIndex: n + 1,
|
|
160
|
-
dragClue: e.dragClue,
|
|
161
|
-
headerRef: e.headerRef,
|
|
162
|
-
containerRef: e.containerRef
|
|
163
|
-
},
|
|
164
|
-
I(t)
|
|
165
|
-
) || /* @__PURE__ */ r.createElement("tr", { key: n, className: u(f.simpletr({})), role: "row", "aria-rowindex": n + 1 }, I(t)));
|
|
160
|
+
I(t)
|
|
161
|
+
) || /* @__PURE__ */ r.createElement("tr", { key: n, className: u(f.simpletr({})), role: "row", "aria-rowindex": n + 1 }, I(t))
|
|
162
|
+
);
|
|
166
163
|
};
|
|
167
164
|
export {
|
|
168
165
|
ce as HeaderRow
|
package/messages/index.mjs
CHANGED
|
@@ -68,7 +68,10 @@ const o = "grid.noRecords", a = "grid.pagerInfo", i = "grid.pagerFirstPage", l =
|
|
|
68
68
|
"grid.filterOrLogic": "Or"
|
|
69
69
|
};
|
|
70
70
|
function U(r) {
|
|
71
|
-
const e = r.replace(
|
|
71
|
+
const e = r.replace(
|
|
72
|
+
/^pager\.([a-z])/,
|
|
73
|
+
(k, t) => "grid.pager" + t.toUpperCase()
|
|
74
|
+
);
|
|
72
75
|
return { messageKey: e, defaultMessage: z[e] };
|
|
73
76
|
}
|
|
74
77
|
export {
|
package/package-metadata.mjs
CHANGED
|
@@ -10,7 +10,7 @@ const e = {
|
|
|
10
10
|
name: "@progress/kendo-react-grid",
|
|
11
11
|
productName: "KendoReact",
|
|
12
12
|
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
13
|
-
publishDate:
|
|
13
|
+
publishDate: 1730217157,
|
|
14
14
|
version: "",
|
|
15
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
16
16
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-grid",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0-develop.10",
|
|
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",
|
|
@@ -23,17 +23,17 @@
|
|
|
23
23
|
"sideEffects": false,
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@progress/kendo-data-query": "^1.0.0",
|
|
26
|
-
"@progress/kendo-drawing": "^1.
|
|
26
|
+
"@progress/kendo-drawing": "^1.21.1",
|
|
27
27
|
"@progress/kendo-licensing": "^1.3.4",
|
|
28
|
-
"@progress/kendo-react-animation": "
|
|
29
|
-
"@progress/kendo-react-buttons": "
|
|
30
|
-
"@progress/kendo-react-common": "
|
|
31
|
-
"@progress/kendo-react-data-tools": "
|
|
32
|
-
"@progress/kendo-react-dateinputs": "
|
|
33
|
-
"@progress/kendo-react-dropdowns": "
|
|
34
|
-
"@progress/kendo-react-inputs": "
|
|
35
|
-
"@progress/kendo-react-intl": "
|
|
36
|
-
"@progress/kendo-react-popup": "
|
|
28
|
+
"@progress/kendo-react-animation": "9.0.0-develop.10",
|
|
29
|
+
"@progress/kendo-react-buttons": "9.0.0-develop.10",
|
|
30
|
+
"@progress/kendo-react-common": "9.0.0-develop.10",
|
|
31
|
+
"@progress/kendo-react-data-tools": "9.0.0-develop.10",
|
|
32
|
+
"@progress/kendo-react-dateinputs": "9.0.0-develop.10",
|
|
33
|
+
"@progress/kendo-react-dropdowns": "9.0.0-develop.10",
|
|
34
|
+
"@progress/kendo-react-inputs": "9.0.0-develop.10",
|
|
35
|
+
"@progress/kendo-react-intl": "9.0.0-develop.10",
|
|
36
|
+
"@progress/kendo-react-popup": "9.0.0-develop.10",
|
|
37
37
|
"@progress/kendo-svg-icons": "^3.0.0",
|
|
38
38
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0",
|
|
39
39
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
|
package/rows/GridRow.mjs
CHANGED
|
@@ -10,14 +10,16 @@ import * as c from "react";
|
|
|
10
10
|
import { useUnstyled as s, uGrid as u, classNames as w } from "@progress/kendo-react-common";
|
|
11
11
|
import { GRID_ROW_INDEX_ATTRIBUTE as R } from "../constants/index.mjs";
|
|
12
12
|
const x = (e) => {
|
|
13
|
-
const { rowType: i, isAltRow: o, isInEdit: n, isSelected: r } = e, t = s(), l = t && t.uGrid ? t.uGrid : u, a = w(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
const { rowType: i, isAltRow: o, isInEdit: n, isSelected: r } = e, t = s(), l = t && t.uGrid ? t.uGrid : u, a = w(
|
|
14
|
+
l.tr({
|
|
15
|
+
selected: r,
|
|
16
|
+
isHeader: i === "groupHeader",
|
|
17
|
+
isFooter: i === "groupFooter",
|
|
18
|
+
isMaster: i !== "groupHeader" && i !== "groupFooter",
|
|
19
|
+
isAltRow: o,
|
|
20
|
+
isInEdit: n
|
|
21
|
+
})
|
|
22
|
+
), d = /* @__PURE__ */ c.createElement(
|
|
21
23
|
"tr",
|
|
22
24
|
{
|
|
23
25
|
id: e.id,
|
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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("../GridColumn.js"),g=require("@progress/kendo-react-data-tools");function f(e,t){const a=(e||"").split(".");let o=t;return a.forEach(d=>{o=o?o[d]:void 0}),o}function u(e,t,a,o,d,l,s=0){let r=s;for(let n=0;n<t.length;n++){if(!d||t[n].value===void 0||t[n].items===void 0){e[e.length]={dataIndex:o.index,dataItem:t[n],rowType:"data",level:s,expanded:l===void 0||f(l,t[n])},o.index++;continue}r=Math.max(r,s+1);const i=l===void 0||f(l,t[n])===void 0||f(l,t[n]);e[e.length]={dataIndex:-1,dataItem:t[n],level:s,rowType:"groupHeader",expanded:i},i&&(r=Math.max(u(e,t[n].items,a,o,d,l,s+1),r)),(a==="always"||i&&a==="visible")&&(e[e.length]={dataIndex:-1,dataItem:t[n],rowType:"groupFooter",level:s,expanded:i})}return r}function p(e,t,a,o=0){
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("../GridColumn.js"),g=require("@progress/kendo-react-data-tools");function f(e,t){const a=(e||"").split(".");let o=t;return a.forEach(d=>{o=o?o[d]:void 0}),o}function u(e,t,a,o,d,l,s=0){let r=s;for(let n=0;n<t.length;n++){if(!d||t[n].value===void 0||t[n].items===void 0){e[e.length]={dataIndex:o.index,dataItem:t[n],rowType:"data",level:s,expanded:l===void 0||f(l,t[n])},o.index++;continue}r=Math.max(r,s+1);const i=l===void 0||f(l,t[n])===void 0||f(l,t[n]);e[e.length]={dataIndex:-1,dataItem:t[n],level:s,rowType:"groupHeader",expanded:i},i&&(r=Math.max(u(e,t[n].items,a,o,d,l,s+1),r)),(a==="always"||i&&a==="visible")&&(e[e.length]={dataIndex:-1,dataItem:t[n],rowType:"groupFooter",level:s,expanded:i})}return r}function p(e,t,a,o=0){const d=[];if(!e)return[];e&&e.length===void 0&&(e=[e]),e.filter(r=>r&&r.props?!r.props.hidden:!r.hidden).forEach((r,n)=>{r=r.props?r.props:r;const i=t[n]||null,h=p(r.children,i&&i.children||[],a,o+1);d.push(Object.assign({depth:o},x.gridDefaultProps,h.length?{cell:()=>null,filterCell:()=>null}:{},i?{width:i.width,orderIndex:i.orderIndex}:{},r,{id:r.id?r.id:g.tableKeyboardNavigationTools.generateNavigatableId(`${a.prevId++}`,a.idPrefix,"column"),declarationIndex:d.length,children:h,rowSpan:0,colSpan:0,isAccessible:!0,left:i&&Math.floor(i.left),right:i&&Math.floor(i.right)}))});const s=(r,n)=>r.orderIndex===n.orderIndex?r.declarationIndex-n.declarationIndex:(r.orderIndex||0)-(n.orderIndex||0);if(d.sort(s),o===0){const r=[],n=(i,h)=>i.forEach(c=>{c.parentIndex=h,n(c.children,r.push(c)-1)});return n(d,-1),r}return d}function v(e,t,a,o){let d=[];Array.isArray(e)?d=e:e&&(d=e.data);const l=[];if(d.length>0){let s=d[0];if(t)for(let n=0;n<t.length;n++)s=s.items&&s.items[0];Object.getOwnPropertyNames(s).forEach(n=>{n!==a&&l.push(Object.assign({id:g.tableKeyboardNavigationTools.generateNavigatableId(`${o.prevId++}`,o.idPrefix,"column"),declarationIndex:-1,parentIndex:-1,depth:0,colSpan:0,rowSpan:0,index:0,left:0,right:0,rightBorder:!1,children:[],ariaColumnIndex:0,isAccessible:!0},x.gridDefaultProps,{field:n}))})}return l}const w=(e,t)=>{let a=e[t.parentIndex];for(;a;){if(a.footerCell)return!0;a=e[a.parentIndex]}return!1},y=e=>e.filter(t=>w(e,t)?!1:!!t.footerCell||!(t.children&&t.children.length>0)),b=e=>e.width!==void 0?Math.floor(parseFloat(e.width.toString()))+"px":void 0,S=(e,t)=>t&&t.filter(a=>a.field===e).length>0,I=e=>(e.sort((t,a)=>t.declarationIndex-a.declarationIndex),e.map(t=>{const{declarationIndex:a,parentIndex:o,depth:d,colSpan:l,rowSpan:s,index:r,kFirst:n,children:i,...h}=t;return i.length?{children:I(i),...h}:h})),m=typeof window!="undefined"&&/Firefox/.test(window.navigator.userAgent),C=17895697,M=(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};exports.autoGenerateColumns=v;exports.firefox=m;exports.firefoxMaxHeight=C;exports.flatData=u;exports.footerColumns=y;exports.getColumnWidth=b;exports.getNestedValue=f;exports.isSorted=S;exports.readColumns=p;exports.resolveCells=M;exports.sanitizeColumns=I;
|