@progress/kendo-react-grid 7.5.0-develop.16 → 7.5.0-develop.18
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/Grid.js +1 -1
- package/Grid.mjs +298 -270
- package/cells/GridCell.js +1 -1
- package/cells/GridCell.mjs +10 -9
- package/cells/GridGroupCell.js +1 -1
- package/cells/GridGroupCell.mjs +16 -15
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/drag/GroupingIndicator.js +1 -1
- package/drag/GroupingIndicator.mjs +13 -9
- package/footer/FooterRow.js +1 -1
- package/footer/FooterRow.mjs +40 -35
- package/index.d.mts +4 -0
- package/index.d.ts +4 -0
- package/package-metadata.mjs +1 -1
- package/package.json +10 -10
package/cells/GridCell.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 m=require("react"),f=require("../utils/index.js"),g=require("@progress/kendo-react-intl"),b=require("@progress/kendo-react-data-tools"),C=require("../constants/index.js"),y=require("@progress/kendo-react-common");function T(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("react"),f=require("../utils/index.js"),g=require("@progress/kendo-react-intl"),b=require("@progress/kendo-react-data-tools"),C=require("../constants/index.js"),y=require("@progress/kendo-react-common");function T(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const l=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,l.get?l:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const o=T(m),I=e=>{let t=null;const n=g.useInternationalization(),l=b.useTableKeyboardNavigation(e.id),r=o.useCallback(c=>{e.onContextMenu&&e.onContextMenu.call(void 0,c,e.dataItem,e.field)},[e.onContextMenu,e.dataItem,e.field]);let a=null,d=null;if(e.rowType==="groupFooter")a={onContextMenu:r,className:e.className,...l},t=o.createElement("td",{...a});else if(e.rowType!=="groupHeader"){if(e.field!==void 0){const i=f.getNestedValue(e.field,e.dataItem);i!=null&&(d=e.format?n.format(e.format,i):i.toString())}const c=y.classNames("k-table-td",e.className,{"k-selected":e.isSelected});a={onContextMenu:r,colSpan:e.colSpan,style:e.style,className:c,role:"gridcell","aria-colindex":e.ariaColumnIndex,"aria-selected":e.isSelected,[C.GRID_COL_INDEX_ATTRIBUTE]:e.columnIndex,...l},t=o.createElement("td",{...a},d)}const s=e.rowType||"data",u=e.cells;if(u&&u[s]){const c=u[s];return o.createElement(c,{...e,tdProps:a},d)}return e.render?e.render.call(void 0,t,e):t};exports.GridCell=I;
|
package/cells/GridCell.mjs
CHANGED
|
@@ -14,19 +14,20 @@ import { GRID_COL_INDEX_ATTRIBUTE as g } from "../constants/index.mjs";
|
|
|
14
14
|
import { classNames as I } from "@progress/kendo-react-common";
|
|
15
15
|
const S = (e) => {
|
|
16
16
|
let n = null;
|
|
17
|
-
const
|
|
17
|
+
const f = s(), o = C(e.id), m = i.useCallback((l) => {
|
|
18
18
|
e.onContextMenu && e.onContextMenu.call(void 0, l, e.dataItem, e.field);
|
|
19
19
|
}, [e.onContextMenu, e.dataItem, e.field]);
|
|
20
20
|
let t = null, c = null;
|
|
21
21
|
if (e.rowType === "groupFooter")
|
|
22
22
|
t = {
|
|
23
|
-
onContextMenu:
|
|
24
|
-
className: e.className
|
|
23
|
+
onContextMenu: m,
|
|
24
|
+
className: e.className,
|
|
25
|
+
...o
|
|
25
26
|
}, n = /* @__PURE__ */ i.createElement("td", { ...t });
|
|
26
27
|
else if (e.rowType !== "groupHeader") {
|
|
27
28
|
if (e.field !== void 0) {
|
|
28
29
|
const a = r(e.field, e.dataItem);
|
|
29
|
-
a != null && (c = e.format ?
|
|
30
|
+
a != null && (c = e.format ? f.format(e.format, a) : a.toString());
|
|
30
31
|
}
|
|
31
32
|
const l = I(
|
|
32
33
|
"k-table-td",
|
|
@@ -34,7 +35,7 @@ const S = (e) => {
|
|
|
34
35
|
{ "k-selected": e.isSelected }
|
|
35
36
|
);
|
|
36
37
|
t = {
|
|
37
|
-
onContextMenu:
|
|
38
|
+
onContextMenu: m,
|
|
38
39
|
colSpan: e.colSpan,
|
|
39
40
|
style: e.style,
|
|
40
41
|
className: l,
|
|
@@ -42,12 +43,12 @@ const S = (e) => {
|
|
|
42
43
|
"aria-colindex": e.ariaColumnIndex,
|
|
43
44
|
"aria-selected": e.isSelected,
|
|
44
45
|
[g]: e.columnIndex,
|
|
45
|
-
...
|
|
46
|
+
...o
|
|
46
47
|
}, n = /* @__PURE__ */ i.createElement("td", { ...t }, c);
|
|
47
48
|
}
|
|
48
|
-
const
|
|
49
|
-
if (d && d[
|
|
50
|
-
const l = d[
|
|
49
|
+
const u = e.rowType || "data", d = e.cells;
|
|
50
|
+
if (d && d[u]) {
|
|
51
|
+
const l = d[u];
|
|
51
52
|
return /* @__PURE__ */ i.createElement(l, { ...e, tdProps: t }, c);
|
|
52
53
|
}
|
|
53
54
|
return e.render ? e.render.call(void 0, n, e) : n;
|
package/cells/GridGroupCell.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 b=require("@progress/kendo-react-common"),j=require("@progress/kendo-react-data-tools"),z=require("@progress/kendo-react-intl"),C=require("@progress/kendo-svg-icons"),A=require("react"),v=require("../messages/index.js");function G(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const c=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,c.get?c:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const n=G(A),K=e=>{let a=null;const{columnIndex:t,level:c,columnsCount:g,rowType:
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("@progress/kendo-react-common"),j=require("@progress/kendo-react-data-tools"),z=require("@progress/kendo-react-intl"),C=require("@progress/kendo-svg-icons"),A=require("react"),v=require("../messages/index.js");function G(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const c=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,c.get?c:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const n=G(A),K=e=>{let a=null;const{columnIndex:t,level:c,columnsCount:g,rowType:w,dataItem:o,field:M,onChange:d,expanded:r,render:x,dataIndex:f,ariaColumnIndex:N,isRtl:I}=e,s=M||"",E=j.useTableKeyboardNavigation(e.id),T=z.useLocalization();let i=null,m=null,y=null;const q=n.useCallback(l=>{l.isDefaultPrevented()||l.keyCode===b.Keys.enter&&d&&(l.preventDefault(),d({dataItem:o,dataIndex:f,syntheticEvent:l,field:void 0,value:!r}))},[r,d,o,f]),k=n.useCallback(l=>{e.onContextMenu&&e.onContextMenu.call(void 0,l,e.dataItem,e.field)},[e.onContextMenu,e.dataItem,e.field]),S=(l,O)=>{const h=r?v.groupCollapse:v.groupExpand,P=T.toLanguageString(h,v.messages[h]);return i={className:"k-table-td",style:{...e.style,...O},colSpan:l,key:"g-colspan",role:"gridcell","aria-selected":!1,"aria-expanded":r,"aria-colindex":N,onKeyDown:q,onContextMenu:k,...E},y=n.createElement("p",{className:"k-reset"},n.createElement("a",{onClick:R=>{R.preventDefault(),d&&d({dataItem:o,dataIndex:f,syntheticEvent:R,field:void 0,value:!r})},href:"#",tabIndex:-1,"aria-label":P},n.createElement(b.IconWrap,{name:r?"caret-alt-down":I?"caret-alt-left":"caret-alt-right",icon:r?C.caretAltDownIcon:I?C.caretAltLeftIcon:C.caretAltRightIcon})),o[s]instanceof Date&&o[s].toString?o[s].toString():o[s]),n.createElement("td",{...i,key:i.key},y)};t===void 0||c===void 0||t<c||g===void 0||w!=="groupHeader"||o[s]===void 0?(i={style:e.style,key:"g"+t,className:b.classNames("k-table-td","k-group-cell",{"k-grid-content-sticky":e.locked}),role:"gridcell",onContextMenu:k,...E},a=n.createElement("td",{...i,key:i.key})):t<=c&&!e.locked?a=S(g-t,{}):t<=c&&e.locked&&(m={className:"k-table-td",role:"gridcell",colSpan:g-t,style:{borderLeftWidth:0,borderRightWidth:0},onContextMenu:k},a=n.createElement(n.Fragment,null,S(0,{position:"sticky",zIndex:2}),n.createElement("td",{...m})));const D=e.rowType||"data",u=e.cells;if(u&&u.group&&u.group[D]){const l=u.group[D];return n.createElement(l,{...e,tdProps:i,td2Props:m},y)}return x?x.call(void 0,a,e):a};exports.GridGroupCell=K;
|
package/cells/GridGroupCell.mjs
CHANGED
|
@@ -14,7 +14,7 @@ import * as t from "react";
|
|
|
14
14
|
import { messages as H, groupCollapse as j, groupExpand as q } from "../messages/index.mjs";
|
|
15
15
|
const V = (e) => {
|
|
16
16
|
let c = null;
|
|
17
|
-
const { columnIndex: a, level: s, columnsCount: m, rowType:
|
|
17
|
+
const { columnIndex: a, level: s, columnsCount: m, rowType: w, dataItem: n, field: D, onChange: r, expanded: o, render: C, dataIndex: f, ariaColumnIndex: N, isRtl: v } = e, d = D || "", x = z(e.id), S = P();
|
|
18
18
|
let i = null, g = null, y = null;
|
|
19
19
|
const M = t.useCallback(
|
|
20
20
|
(l) => {
|
|
@@ -29,8 +29,8 @@ const V = (e) => {
|
|
|
29
29
|
[o, r, n, f]
|
|
30
30
|
), k = t.useCallback((l) => {
|
|
31
31
|
e.onContextMenu && e.onContextMenu.call(void 0, l, e.dataItem, e.field);
|
|
32
|
-
}, [e.onContextMenu, e.dataItem, e.field]),
|
|
33
|
-
const
|
|
32
|
+
}, [e.onContextMenu, e.dataItem, e.field]), b = (l, R) => {
|
|
33
|
+
const E = o ? j : q, A = S.toLanguageString(E, H[E]);
|
|
34
34
|
return i = {
|
|
35
35
|
className: "k-table-td",
|
|
36
36
|
style: { ...e.style, ...R },
|
|
@@ -39,18 +39,18 @@ const V = (e) => {
|
|
|
39
39
|
role: "gridcell",
|
|
40
40
|
"aria-selected": !1,
|
|
41
41
|
"aria-expanded": o,
|
|
42
|
-
"aria-colindex":
|
|
42
|
+
"aria-colindex": N,
|
|
43
43
|
onKeyDown: M,
|
|
44
44
|
onContextMenu: k,
|
|
45
|
-
...
|
|
45
|
+
...x
|
|
46
46
|
}, y = /* @__PURE__ */ t.createElement("p", { className: "k-reset" }, /* @__PURE__ */ t.createElement(
|
|
47
47
|
"a",
|
|
48
48
|
{
|
|
49
|
-
onClick: (
|
|
50
|
-
|
|
49
|
+
onClick: (h) => {
|
|
50
|
+
h.preventDefault(), r && r({
|
|
51
51
|
dataItem: n,
|
|
52
52
|
dataIndex: f,
|
|
53
|
-
syntheticEvent:
|
|
53
|
+
syntheticEvent: h,
|
|
54
54
|
field: void 0,
|
|
55
55
|
value: !o
|
|
56
56
|
});
|
|
@@ -75,7 +75,7 @@ const V = (e) => {
|
|
|
75
75
|
y
|
|
76
76
|
);
|
|
77
77
|
};
|
|
78
|
-
a === void 0 || s === void 0 || a < s || m === void 0 ||
|
|
78
|
+
a === void 0 || s === void 0 || a < s || m === void 0 || w !== "groupHeader" || n[d] === void 0 ? (i = {
|
|
79
79
|
style: e.style,
|
|
80
80
|
key: "g" + a,
|
|
81
81
|
className: L(
|
|
@@ -84,28 +84,29 @@ const V = (e) => {
|
|
|
84
84
|
{ "k-grid-content-sticky": e.locked }
|
|
85
85
|
),
|
|
86
86
|
role: "gridcell",
|
|
87
|
-
onContextMenu: k
|
|
87
|
+
onContextMenu: k,
|
|
88
|
+
...x
|
|
88
89
|
}, c = /* @__PURE__ */ t.createElement(
|
|
89
90
|
"td",
|
|
90
91
|
{
|
|
91
92
|
...i,
|
|
92
93
|
key: i.key
|
|
93
94
|
}
|
|
94
|
-
)) : a <= s && !e.locked ? c =
|
|
95
|
+
)) : a <= s && !e.locked ? c = b(m - a, {}) : a <= s && e.locked && (g = {
|
|
95
96
|
className: "k-table-td",
|
|
96
97
|
role: "gridcell",
|
|
97
98
|
colSpan: m - a,
|
|
98
99
|
style: { borderLeftWidth: 0, borderRightWidth: 0 },
|
|
99
100
|
onContextMenu: k
|
|
100
|
-
}, c = /* @__PURE__ */ t.createElement(t.Fragment, null,
|
|
101
|
+
}, c = /* @__PURE__ */ t.createElement(t.Fragment, null, b(0, { position: "sticky", zIndex: 2 }), /* @__PURE__ */ t.createElement(
|
|
101
102
|
"td",
|
|
102
103
|
{
|
|
103
104
|
...g
|
|
104
105
|
}
|
|
105
106
|
)));
|
|
106
|
-
const
|
|
107
|
-
if (u && u.group && u.group[
|
|
108
|
-
const l = u.group[
|
|
107
|
+
const I = e.rowType || "data", u = e.cells;
|
|
108
|
+
if (u && u.group && u.group[I]) {
|
|
109
|
+
const l = u.group[I];
|
|
109
110
|
return /* @__PURE__ */ t.createElement(l, { ...e, tdProps: i, td2Props: g }, y);
|
|
110
111
|
}
|
|
111
112
|
return C ? C.call(void 0, c, e) : c;
|