@progress/kendo-react-grid 7.5.0-develop.2 → 7.5.0-develop.21
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 +412 -376
- package/GridColumn.js +1 -1
- package/GridColumn.mjs +2 -1
- package/VirtualScrollFixed.js +1 -1
- package/VirtualScrollFixed.mjs +18 -53
- 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/columnMenu/GridColumnMenuWrapper.js +1 -1
- package/columnMenu/GridColumnMenuWrapper.mjs +53 -53
- package/constants/index.js +1 -1
- package/constants/index.mjs +4 -3
- 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/header/HeaderRow.js +1 -1
- package/header/HeaderRow.mjs +57 -56
- package/index.d.mts +45 -59
- package/index.d.ts +45 -59
- package/package-metadata.mjs +1 -1
- package/package.json +12 -12
- package/paging/GridPagerSettings.js +1 -1
- package/paging/GridPagerSettings.mjs +14 -12
package/GridColumn.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 e=require("prop-types"),l=r=>null;l.displayName="KendoReactGridColumn";l.defaultProps={filterable:!0,editable:!0,sortable:!0,resizable:!0,reorderable:!0,groupable:!0};l.propTypes={field:e.string,title:e.string,editable:e.bool,sortable:e.oneOfType([e.bool,e.shape({allowUnsort:e.bool.isRequired})]),cell:e.any,filterCell:e.any,filterTitle:e.string,filterable:e.bool,filter:e.oneOf(["text","numeric","boolean","date"]),editor:e.oneOf(["text","numeric","boolean","date"]),width:e.oneOfType([e.string,e.number]),minResizableWidth:e.number,headerCell:e.any,footerCell:e.any,headerSelectionValue:e.bool,format:e.string,headerClassName:e.string,className:e.string,reorderable:e.bool,resizable:e.bool,orderIndex:e.number,groupable:e.bool,columnMenu:e.any,locked:e.bool};exports.GridColumn=l;
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("prop-types"),l=r=>null;l.displayName="KendoReactGridColumn";l.defaultProps={filterable:!0,editable:!0,sortable:!0,resizable:!0,reorderable:!0,groupable:!0};l.propTypes={field:e.string,title:e.string,editable:e.bool,sortable:e.oneOfType([e.bool,e.shape({allowUnsort:e.bool.isRequired})]),cell:e.any,filterCell:e.any,filterTitle:e.string,filterable:e.bool,filter:e.oneOf(["text","numeric","boolean","date"]),editor:e.oneOf(["text","numeric","boolean","date"]),width:e.oneOfType([e.string,e.number]),minResizableWidth:e.number,headerCell:e.any,footerCell:e.any,headerSelectionValue:e.bool,format:e.string,headerClassName:e.string,className:e.string,reorderable:e.bool,resizable:e.bool,orderIndex:e.number,groupable:e.bool,columnMenu:e.any,menuIcon:e.any,locked:e.bool};exports.GridColumn=l;
|
package/GridColumn.mjs
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import e from "prop-types";
|
|
10
|
-
const l = (
|
|
10
|
+
const l = (o) => null;
|
|
11
11
|
l.displayName = "KendoReactGridColumn";
|
|
12
12
|
l.defaultProps = {
|
|
13
13
|
filterable: !0,
|
|
@@ -46,6 +46,7 @@ l.propTypes = {
|
|
|
46
46
|
orderIndex: e.number,
|
|
47
47
|
groupable: e.bool,
|
|
48
48
|
columnMenu: e.any,
|
|
49
|
+
menuIcon: e.any,
|
|
49
50
|
locked: e.bool
|
|
50
51
|
};
|
|
51
52
|
export {
|
package/VirtualScrollFixed.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 d=require("react"),g=require("./utils/index.js");function u(
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react"),g=require("./utils/index.js");function u(s){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const t in s)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(s,t);Object.defineProperty(e,t,a.get?a:{enumerable:!0,get:()=>s[t]})}}return e.default=s,Object.freeze(e)}const o=u(d);class p{constructor(e){this.table=null,this.containerHeight=0,this.topCacheCount=0,this.attendedSkip=0,this.propsSkip=0,this.total=0,this.scrollableVirtual=!1,this.realSkip=0,this.pageSize=0,this.PageChange=null,this.tableBodyRef=o.createRef(),this.fixedScroll=!1,this.askedSkip=void 0,this.containerRef=o.createRef(),this.tableTransform="",this.scrollSyncing=!1,this.lastLoaded=0,this.firstLoaded=0,this.lastScrollTop=0,this.reactVersion=Number.parseFloat(o.version),this.firstLoaded=this.pageSize,this.lastLoaded=this.realSkip+this.pageSize,this.scrollHandler=this.scrollHandler.bind(this)}get container(){return this.containerRef.current}translate(e,t){this.scrollableVirtual&&this.table&&(g.firefox||this.reactVersion<=17||t?this.table.style.transform="translateY("+e+"px)":this.tableTransform="translateY("+e+"px)")}changePage(e,t){this.PageChange&&this.PageChange({skip:Math.max(0,e),take:this.pageSize},t)}reset(){this.scrollSyncing=!0,!this.fixedScroll&&(this.container&&(this.container.scrollTop=0),this.translate(0,!0))}scrollHandler(e){if(!this.scrollableVirtual||!this.container||!this.table||!this.rowHeightService||!this.containerRef.current)return;if(this.scrollSyncing){this.scrollSyncing=!1;return}const t=this.container.scrollTop,a=this.lastScrollTop>=t,h=!a;this.lastScrollTop=t;let i=this.rowHeightService.index(t),l=this.rowHeightService.offset(i);const{offsetHeight:n}=this.containerRef.current,c=this.rowHeightService.index(t+n);if(h&&c>=this.lastLoaded&&this.lastLoaded<this.total){const r=i+this.pageSize-this.total;r>0&&(i=i-r,l=this.rowHeightService.offset(i)),this.firstLoaded=i,this.translate(l);const f=this.firstLoaded+this.pageSize;this.lastLoaded=Math.min(f,this.total),this.changePage(this.firstLoaded,e)}else if(a&&i<this.firstLoaded){const r=Math.floor(this.pageSize*.3);this.firstLoaded=Math.max(i-r,0),this.translate(this.rowHeightService.offset(this.firstLoaded)),this.lastLoaded=Math.min(this.firstLoaded+this.pageSize,this.total),this.changePage(this.firstLoaded,e)}}}exports.VirtualScrollFixed=p;
|
package/VirtualScrollFixed.mjs
CHANGED
|
@@ -6,54 +6,20 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
10
|
-
import { firefox as
|
|
11
|
-
class u {
|
|
12
|
-
constructor(t = 0, e, h, i) {
|
|
13
|
-
this.total = t, this.offsets = [], this.heights = [];
|
|
14
|
-
let s = 0;
|
|
15
|
-
for (let r = 0; r < t; r++) {
|
|
16
|
-
this.offsets.push(s);
|
|
17
|
-
const a = i && i[r].expanded && i[r].rowType === "data" ? h : e;
|
|
18
|
-
s += a, this.heights.push(a);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
height(t) {
|
|
22
|
-
return this.heights[t];
|
|
23
|
-
}
|
|
24
|
-
index(t) {
|
|
25
|
-
if (t < 0)
|
|
26
|
-
return;
|
|
27
|
-
const e = this.offsets.reduce((h, i, s) => {
|
|
28
|
-
if (h !== void 0)
|
|
29
|
-
return h;
|
|
30
|
-
if (i === t)
|
|
31
|
-
return s;
|
|
32
|
-
if (i > t)
|
|
33
|
-
return s - 1;
|
|
34
|
-
}, void 0);
|
|
35
|
-
return e === void 0 ? this.total - 1 : e;
|
|
36
|
-
}
|
|
37
|
-
offset(t) {
|
|
38
|
-
return this.offsets[t];
|
|
39
|
-
}
|
|
40
|
-
totalHeight() {
|
|
41
|
-
const t = this.offsets[this.offsets.length - 1], e = this.heights[this.heights.length - 1];
|
|
42
|
-
return t + e;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
9
|
+
import * as a from "react";
|
|
10
|
+
import { firefox as f } from "./utils/index.mjs";
|
|
45
11
|
class p {
|
|
46
12
|
constructor(t) {
|
|
47
|
-
this.table = null, this.containerHeight = 0, this.topCacheCount = 0, this.attendedSkip = 0, this.propsSkip = 0, this.total = 0, this.scrollableVirtual = !1, this.realSkip = 0, this.pageSize = 0, this.PageChange = null, this.tableBodyRef =
|
|
13
|
+
this.table = null, this.containerHeight = 0, this.topCacheCount = 0, this.attendedSkip = 0, this.propsSkip = 0, this.total = 0, this.scrollableVirtual = !1, this.realSkip = 0, this.pageSize = 0, this.PageChange = null, this.tableBodyRef = a.createRef(), this.fixedScroll = !1, this.askedSkip = void 0, this.containerRef = a.createRef(), this.tableTransform = "", this.scrollSyncing = !1, this.lastLoaded = 0, this.firstLoaded = 0, this.lastScrollTop = 0, this.reactVersion = Number.parseFloat(a.version), this.firstLoaded = this.pageSize, this.lastLoaded = this.realSkip + this.pageSize, this.scrollHandler = this.scrollHandler.bind(this);
|
|
48
14
|
}
|
|
49
15
|
get container() {
|
|
50
16
|
return this.containerRef.current;
|
|
51
17
|
}
|
|
52
|
-
translate(t,
|
|
53
|
-
this.scrollableVirtual && this.table && (
|
|
18
|
+
translate(t, i) {
|
|
19
|
+
this.scrollableVirtual && this.table && (f || this.reactVersion <= 17 || i ? this.table.style.transform = "translateY(" + t + "px)" : this.tableTransform = "translateY(" + t + "px)");
|
|
54
20
|
}
|
|
55
|
-
changePage(t,
|
|
56
|
-
this.PageChange && this.PageChange({ skip: Math.max(0, t), take: this.pageSize },
|
|
21
|
+
changePage(t, i) {
|
|
22
|
+
this.PageChange && this.PageChange({ skip: Math.max(0, t), take: this.pageSize }, i);
|
|
57
23
|
}
|
|
58
24
|
reset() {
|
|
59
25
|
this.scrollSyncing = !0, !this.fixedScroll && (this.container && (this.container.scrollTop = 0), this.translate(0, !0));
|
|
@@ -65,22 +31,21 @@ class p {
|
|
|
65
31
|
this.scrollSyncing = !1;
|
|
66
32
|
return;
|
|
67
33
|
}
|
|
68
|
-
const
|
|
69
|
-
this.lastScrollTop =
|
|
70
|
-
let
|
|
71
|
-
const { offsetHeight:
|
|
72
|
-
if (
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
34
|
+
const i = this.container.scrollTop, r = this.lastScrollTop >= i, o = !r;
|
|
35
|
+
this.lastScrollTop = i;
|
|
36
|
+
let e = this.rowHeightService.index(i), h = this.rowHeightService.offset(e);
|
|
37
|
+
const { offsetHeight: l } = this.containerRef.current, n = this.rowHeightService.index(i + l);
|
|
38
|
+
if (o && n >= this.lastLoaded && this.lastLoaded < this.total) {
|
|
39
|
+
const s = e + this.pageSize - this.total;
|
|
40
|
+
s > 0 && (e = e - s, h = this.rowHeightService.offset(e)), this.firstLoaded = e, this.translate(h);
|
|
41
|
+
const c = this.firstLoaded + this.pageSize;
|
|
76
42
|
this.lastLoaded = Math.min(c, this.total), this.changePage(this.firstLoaded, t);
|
|
77
|
-
} else if (
|
|
78
|
-
const
|
|
79
|
-
this.firstLoaded = Math.max(
|
|
43
|
+
} else if (r && e < this.firstLoaded) {
|
|
44
|
+
const s = Math.floor(this.pageSize * 0.3);
|
|
45
|
+
this.firstLoaded = Math.max(e - s, 0), this.translate(this.rowHeightService.offset(this.firstLoaded)), this.lastLoaded = Math.min(this.firstLoaded + this.pageSize, this.total), this.changePage(this.firstLoaded, t);
|
|
80
46
|
}
|
|
81
47
|
}
|
|
82
48
|
}
|
|
83
49
|
export {
|
|
84
|
-
u as RowHeightService,
|
|
85
50
|
p as VirtualScrollFixed
|
|
86
51
|
};
|
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;
|
|
@@ -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
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react"),P=require("@progress/kendo-react-popup"),a=require("@progress/kendo-react-common"),W=require("@progress/kendo-svg-icons"),h=require("../messages/index.js"),_=require("@progress/kendo-react-intl");function j(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const l in e)if(l!=="default"){const u=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(r,l,u.get?u:{enumerable:!0,get:()=>e[l]})}}return r.default=e,Object.freeze(r)}const o=j(O),z=[".k-columnmenu-item-content",".k-filter-menu-container"].map(e=>a.TABBABLE_ELEMENTS.map(r=>`${e} ${r}`)),$=[[".k-tabstrip-items"],[".k-columnmenu-item"],...z],x=e=>{const[r,l]=o.useState(!1),u=o.useRef(null),i=o.useRef(null),s=o.useRef(null),m=o.useRef(0),{columnMenu:b,...M}=e,{column:k,columnMenuIcon:f}=e,w=_.useLocalization(),v=k.title||k.field,p=v?`${v} `:"",y="#",C=n=>{const t=a.getActiveElement(document);clearTimeout(m.current),m.current=window.setTimeout(()=>{t&&n.relatedTarget!==u.current&&i.current&&!i.current.contains(t)&&d()})},D=()=>{clearTimeout(m.current)},S=n=>{n.preventDefault(),r&&e.onCloseMenu&&e.onCloseMenu(),l(!r)},d=()=>{e.onCloseMenu&&e.onCloseMenu(),l(!1),!e.navigatable&&u.current&&u.current.focus()},T=n=>{var t;if(n.keyCode===a.Keys.tab){const c=n.target,E=c&&((t=c.closest(".k-grid"))==null?void 0:t.getElementsByClassName("k-grid-content")[0]);E&&E.scrollWidth>E.clientWidth&&c.scrollIntoView({inline:"center"})}},g=o.useMemo(()=>e.show!==void 0?e.show:r,[e.show,r]),I=n=>{var t;(t=s.current)==null||t.triggerKeyboardEvent(n)},R=n=>{var t;(t=s.current)==null||t.triggerMouseEvent(n)},K=(n,t,c)=>{c.preventDefault(),c.shiftKey?t.focusPrevious(n):t.focusNext(n)},q=(n,t,c)=>{n&&n.click()},B=(n,t,c)=>{c.preventDefault(),d()},N=(n,t,c)=>{c.preventDefault(),t.focusElement(n)};return o.useEffect(()=>(g&&i.current&&(s.current=new a.Navigation({tabIndex:0,root:i,selectors:$,keyboardEvents:{keydown:{Tab:K,Enter:q,Escape:B}},mouseEvents:{mousedown:N}}),s.current.focusElement(s.current.first,null)),()=>{s.current&&(s.current=null)}),[g]),o.createElement(o.Fragment,null,o.createElement("a",{className:"k-grid-header-menu k-grid-column-menu",ref:u,onClick:S,onKeyDown:T,href:y,tabIndex:e.navigatable?-1:void 0,"aria-label":`${p}${w.toLanguageString(h.columnMenu,h.messages[h.columnMenu])}`},f?o.createElement(a.IconWrap,{name:f.name,icon:f}):o.createElement(a.IconWrap,{name:"more-vertical",icon:W.moreVerticalIcon})),o.createElement(P.Popup,{anchor:u.current,show:g,popupClass:"k-column-menu k-column-menu-popup k-grid-columnmenu-popup"},o.createElement("div",{ref:i,onBlur:C,onFocus:D,onMouseDown:R,onKeyDown:I,style:{outline:"none"}},b&&o.createElement(b,{...M,onCloseMenu:d}))))};exports.GridColumnMenuWrapper=x;
|
|
@@ -7,108 +7,108 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as t from "react";
|
|
10
|
-
import { Popup as
|
|
11
|
-
import { TABBABLE_ELEMENTS as
|
|
12
|
-
import {
|
|
13
|
-
import { columnMenu as
|
|
10
|
+
import { Popup as x } from "@progress/kendo-react-popup";
|
|
11
|
+
import { TABBABLE_ELEMENTS as z, Navigation as A, IconWrap as v, getActiveElement as F, Keys as L } from "@progress/kendo-react-common";
|
|
12
|
+
import { moreVerticalIcon as W } from "@progress/kendo-svg-icons";
|
|
13
|
+
import { columnMenu as M, messages as V } from "../messages/index.mjs";
|
|
14
14
|
import { useLocalization as _ } from "@progress/kendo-react-intl";
|
|
15
15
|
const H = [
|
|
16
16
|
".k-columnmenu-item-content",
|
|
17
17
|
".k-filter-menu-container"
|
|
18
|
-
].map((o) =>
|
|
18
|
+
].map((o) => z.map(
|
|
19
19
|
(u) => `${o} ${u}`
|
|
20
20
|
)), P = [
|
|
21
21
|
[".k-tabstrip-items"],
|
|
22
22
|
[".k-columnmenu-item"],
|
|
23
23
|
...H
|
|
24
|
-
],
|
|
25
|
-
const [u,
|
|
26
|
-
const n =
|
|
24
|
+
], U = (o) => {
|
|
25
|
+
const [u, E] = t.useState(!1), l = t.useRef(null), s = t.useRef(null), r = t.useRef(null), a = t.useRef(0), { columnMenu: h, ...k } = o, { column: g, columnMenuIcon: i } = o, b = _(), w = g.title || g.field, p = w ? `${w} ` : "", y = "#", C = (e) => {
|
|
26
|
+
const n = F(document);
|
|
27
27
|
clearTimeout(a.current), a.current = window.setTimeout(() => {
|
|
28
|
-
n && e.relatedTarget !== l.current && s.current && !s.current.contains(n) &&
|
|
28
|
+
n && e.relatedTarget !== l.current && s.current && !s.current.contains(n) && m();
|
|
29
29
|
});
|
|
30
|
-
},
|
|
30
|
+
}, D = () => {
|
|
31
31
|
clearTimeout(a.current);
|
|
32
|
-
},
|
|
33
|
-
e.preventDefault(), u && o.onCloseMenu && o.onCloseMenu(),
|
|
34
|
-
},
|
|
35
|
-
o.onCloseMenu && o.onCloseMenu(),
|
|
36
|
-
},
|
|
32
|
+
}, T = (e) => {
|
|
33
|
+
e.preventDefault(), u && o.onCloseMenu && o.onCloseMenu(), E(!u);
|
|
34
|
+
}, m = () => {
|
|
35
|
+
o.onCloseMenu && o.onCloseMenu(), E(!1), !o.navigatable && l.current && l.current.focus();
|
|
36
|
+
}, S = (e) => {
|
|
37
37
|
var n;
|
|
38
|
-
if (e.keyCode ===
|
|
39
|
-
const
|
|
40
|
-
|
|
38
|
+
if (e.keyCode === L.tab) {
|
|
39
|
+
const c = e.target, d = c && ((n = c.closest(".k-grid")) == null ? void 0 : n.getElementsByClassName("k-grid-content")[0]);
|
|
40
|
+
d && d.scrollWidth > d.clientWidth && c.scrollIntoView({ inline: "center" });
|
|
41
41
|
}
|
|
42
|
-
},
|
|
42
|
+
}, f = t.useMemo(() => o.show !== void 0 ? o.show : u, [o.show, u]), K = (e) => {
|
|
43
43
|
var n;
|
|
44
|
-
(n =
|
|
45
|
-
},
|
|
44
|
+
(n = r.current) == null || n.triggerKeyboardEvent(e);
|
|
45
|
+
}, B = (e) => {
|
|
46
46
|
var n;
|
|
47
|
-
(n =
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
},
|
|
47
|
+
(n = r.current) == null || n.triggerMouseEvent(e);
|
|
48
|
+
}, I = (e, n, c) => {
|
|
49
|
+
c.preventDefault(), c.shiftKey ? n.focusPrevious(e) : n.focusNext(e);
|
|
50
|
+
}, N = (e, n, c) => {
|
|
51
51
|
e && e.click();
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
|
|
52
|
+
}, R = (e, n, c) => {
|
|
53
|
+
c.preventDefault(), m();
|
|
54
|
+
}, $ = (e, n, c) => {
|
|
55
|
+
c.preventDefault(), n.focusElement(e);
|
|
56
56
|
};
|
|
57
|
-
return t.useEffect(() => (
|
|
57
|
+
return t.useEffect(() => (f && s.current && (r.current = new A({
|
|
58
58
|
tabIndex: 0,
|
|
59
59
|
root: s,
|
|
60
60
|
selectors: P,
|
|
61
61
|
keyboardEvents: {
|
|
62
62
|
keydown: {
|
|
63
|
-
Tab:
|
|
64
|
-
Enter:
|
|
65
|
-
Escape:
|
|
63
|
+
Tab: I,
|
|
64
|
+
Enter: N,
|
|
65
|
+
Escape: R
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
68
|
mouseEvents: {
|
|
69
|
-
mousedown:
|
|
69
|
+
mousedown: $
|
|
70
70
|
}
|
|
71
|
-
}),
|
|
72
|
-
|
|
73
|
-
}), [
|
|
71
|
+
}), r.current.focusElement(r.current.first, null)), () => {
|
|
72
|
+
r.current && (r.current = null);
|
|
73
|
+
}), [f]), /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(
|
|
74
74
|
"a",
|
|
75
75
|
{
|
|
76
76
|
className: "k-grid-header-menu k-grid-column-menu",
|
|
77
77
|
ref: l,
|
|
78
|
-
onClick:
|
|
79
|
-
onKeyDown:
|
|
80
|
-
href:
|
|
78
|
+
onClick: T,
|
|
79
|
+
onKeyDown: S,
|
|
80
|
+
href: y,
|
|
81
81
|
tabIndex: o.navigatable ? -1 : void 0,
|
|
82
|
-
"aria-label": `${
|
|
82
|
+
"aria-label": `${p}${b.toLanguageString(M, V[M])}`
|
|
83
83
|
},
|
|
84
|
-
/* @__PURE__ */ t.createElement(
|
|
84
|
+
i ? /* @__PURE__ */ t.createElement(v, { name: i.name, icon: i }) : /* @__PURE__ */ t.createElement(v, { name: "more-vertical", icon: W })
|
|
85
85
|
), /* @__PURE__ */ t.createElement(
|
|
86
|
-
|
|
86
|
+
x,
|
|
87
87
|
{
|
|
88
88
|
anchor: l.current,
|
|
89
|
-
show:
|
|
89
|
+
show: f,
|
|
90
90
|
popupClass: "k-column-menu k-column-menu-popup k-grid-columnmenu-popup"
|
|
91
91
|
},
|
|
92
92
|
/* @__PURE__ */ t.createElement(
|
|
93
93
|
"div",
|
|
94
94
|
{
|
|
95
95
|
ref: s,
|
|
96
|
-
onBlur:
|
|
97
|
-
onFocus:
|
|
98
|
-
onMouseDown:
|
|
99
|
-
onKeyDown:
|
|
96
|
+
onBlur: C,
|
|
97
|
+
onFocus: D,
|
|
98
|
+
onMouseDown: B,
|
|
99
|
+
onKeyDown: K,
|
|
100
100
|
style: { outline: "none" }
|
|
101
101
|
},
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
h && /* @__PURE__ */ t.createElement(
|
|
103
|
+
h,
|
|
104
104
|
{
|
|
105
|
-
...
|
|
106
|
-
onCloseMenu:
|
|
105
|
+
...k,
|
|
106
|
+
onCloseMenu: m
|
|
107
107
|
}
|
|
108
108
|
)
|
|
109
109
|
)
|
|
110
110
|
));
|
|
111
111
|
};
|
|
112
112
|
export {
|
|
113
|
-
|
|
113
|
+
U as GridColumnMenuWrapper
|
|
114
114
|
};
|
package/constants/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 E=require("@progress/kendo-react-data-tools"),T=E.TABLE_ROW_INDEX_ATTRIBUTE,_=E.TABLE_COL_INDEX_ATTRIBUTE,I=E.TABLE_PREVENT_SELECTION_ELEMENT;exports.GRID_COL_INDEX_ATTRIBUTE=_;exports.GRID_PREVENT_SELECTION_ELEMENT=I;exports.GRID_ROW_INDEX_ATTRIBUTE=T;
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("@progress/kendo-react-data-tools"),T=E.TABLE_ROW_INDEX_ATTRIBUTE,_=E.TABLE_COL_INDEX_ATTRIBUTE,I=E.TABLE_PREVENT_SELECTION_ELEMENT,R=/^(?!.*\bChrome).*\bSafari/i;exports.GRID_COL_INDEX_ATTRIBUTE=_;exports.GRID_PREVENT_SELECTION_ELEMENT=I;exports.GRID_ROW_INDEX_ATTRIBUTE=T;exports.SAFARI_REGEX=R;
|
package/constants/index.mjs
CHANGED
|
@@ -7,9 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import { TABLE_ROW_INDEX_ATTRIBUTE as E, TABLE_COL_INDEX_ATTRIBUTE as T, TABLE_PREVENT_SELECTION_ELEMENT as _ } from "@progress/kendo-react-data-tools";
|
|
10
|
-
const R = E, N = T, L =
|
|
10
|
+
const R = E, N = T, A = _, L = /^(?!.*\bChrome).*\bSafari/i;
|
|
11
11
|
export {
|
|
12
12
|
N as GRID_COL_INDEX_ATTRIBUTE,
|
|
13
|
-
|
|
14
|
-
R as GRID_ROW_INDEX_ATTRIBUTE
|
|
13
|
+
A as GRID_PREVENT_SELECTION_ELEMENT,
|
|
14
|
+
R as GRID_ROW_INDEX_ATTRIBUTE,
|
|
15
|
+
L as SAFARI_REGEX
|
|
15
16
|
};
|