@progress/kendo-react-grid 15.0.1-develop.9 → 15.1.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/GridClientWrapper.js +1 -1
- package/GridClientWrapper.mjs +411 -407
- package/GridComponent.js +1 -1
- package/GridComponent.mjs +305 -290
- package/VirtualScroll.d.ts +4 -0
- package/VirtualScroll.js +1 -1
- package/VirtualScroll.mjs +32 -27
- package/cells/groupcell/useGroupCellClientTdProps.js +1 -1
- package/cells/groupcell/useGroupCellClientTdProps.mjs +7 -7
- package/cells/hierarchycell/GridHierarchyCellToggle.js +1 -1
- package/cells/hierarchycell/GridHierarchyCellToggle.mjs +15 -15
- package/cells/selectioncell/GridSelectionCell.js +1 -1
- package/cells/selectioncell/GridSelectionCell.mjs +29 -8
- package/cells/selectioncell/GridSelectionCellInput.d.ts +6 -2
- package/cells/selectioncell/GridSelectionCellInput.js +1 -1
- package/cells/selectioncell/GridSelectionCellInput.mjs +16 -25
- package/cells/selectioncell/GridSelectionCellServer.js +1 -1
- package/cells/selectioncell/GridSelectionCellServer.mjs +18 -16
- package/columnMenu/GridColumnMenuWrapper.js +1 -1
- package/columnMenu/GridColumnMenuWrapper.mjs +118 -82
- package/components/GridEditDialog.js +1 -1
- package/components/GridEditDialog.mjs +19 -19
- package/components/VirtualScrollOverlay.d.ts +12 -0
- package/components/VirtualScrollOverlay.js +16 -0
- package/components/VirtualScrollOverlay.mjs +65 -0
- package/components/noRecords/GridNoRecordsContainer.js +1 -1
- package/components/noRecords/GridNoRecordsContainer.mjs +10 -9
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/drag/ColumnResize.js +1 -1
- package/drag/ColumnResize.mjs +84 -84
- package/getRowContents.js +1 -1
- package/getRowContents.mjs +12 -12
- package/index.d.mts +2 -1
- package/index.d.ts +2 -1
- package/interfaces/GridProps.d.ts +2 -1
- package/interfaces/GridScrollableSettings.d.ts +33 -0
- package/interfaces/VirtualScrollInterface.d.ts +2 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +17 -17
- package/toolbar-tools/GridToolbarColumnsChooser.js +1 -1
- package/toolbar-tools/GridToolbarColumnsChooser.mjs +33 -33
- package/toolbar-tools/GridToolbarFilter.js +1 -1
- package/toolbar-tools/GridToolbarFilter.mjs +207 -194
- package/toolbar-tools/GridToolbarSort.js +1 -1
- package/toolbar-tools/GridToolbarSort.mjs +84 -101
- package/toolbar-tools/adaptiveContent/GridAdaptiveToolbarFilter.js +1 -1
- package/toolbar-tools/adaptiveContent/GridAdaptiveToolbarFilter.mjs +50 -46
- package/toolbar-tools/adaptiveContent/GridAdaptiveToolbarSort.d.ts +0 -1
- package/toolbar-tools/adaptiveContent/GridAdaptiveToolbarSort.js +1 -1
- package/toolbar-tools/adaptiveContent/GridAdaptiveToolbarSort.mjs +10 -19
- package/utils/index.js +1 -1
- package/utils/index.mjs +161 -161
package/VirtualScroll.d.ts
CHANGED
|
@@ -24,14 +24,18 @@ export declare class VirtualScroll implements VirtualScrollInterface {
|
|
|
24
24
|
fixedScroll: boolean;
|
|
25
25
|
tableTransform: string;
|
|
26
26
|
rowHeightService?: RowHeightService;
|
|
27
|
+
scrollbarOverlaySpacerElement: HTMLDivElement | null;
|
|
27
28
|
private reactVersion;
|
|
28
29
|
private scrollSyncing;
|
|
30
|
+
private pendingTranslate;
|
|
31
|
+
private deferredScrollTop;
|
|
29
32
|
private firstToLoad;
|
|
30
33
|
private lastScrollTop;
|
|
31
34
|
private firstLoaded;
|
|
32
35
|
private lastLoaded;
|
|
33
36
|
constructor();
|
|
34
37
|
reset(): void;
|
|
38
|
+
scrollToPosition(scrollTop: number, e: React.SyntheticEvent<HTMLDivElement>, deferTranslate?: boolean): void;
|
|
35
39
|
scrollHandler(e: React.SyntheticEvent<HTMLDivElement>): void;
|
|
36
40
|
update(): void;
|
|
37
41
|
private loadPage;
|
package/VirtualScroll.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 d=require("react"),f=require("./utils/index.js");function g(o){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const e in o)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(o,e);Object.defineProperty(t,e,i.get?i:{enumerable:!0,get:()=>o[e]})}}return t.default=o,Object.freeze(t)}const u=g(d),S=.3;class p{constructor(){this.table=null,this.tableBody=null,this.container=null,this.scrollHeightContainer=null,this.total=0,this.scrollableVirtual=!1,this.pageSize=0,this.PageChange=null,this.fixedScroll=!1,this.tableTransform="",this.scrollbarOverlaySpacerElement=null,this.reactVersion=Number.parseFloat(u.version),this.scrollSyncing=!1,this.pendingTranslate=!1,this.deferredScrollTop=0,this.firstToLoad=0,this.lastScrollTop=0,this.firstLoaded=0,this.lastLoaded=0,this.scrollHandler=this.scrollHandler.bind(this)}reset(){if(this.firstToLoad=0,this.firstLoaded=0,this.lastLoaded=0,this.rowHeightService=void 0,this.fixedScroll){this.lastScrollTop=this.container?this.container.scrollTop:0;return}this.container&&this.container.scrollTop!==0&&(this.scrollSyncing=!0,this.container.scrollTop=0,this.lastScrollTop=0,this.translate(0,!0))}scrollToPosition(t,e,i=!1){var c;if(!this.scrollableVirtual||!this.rowHeightService)return;i&&(this.pendingTranslate=!0,this.deferredScrollTop=t);const s=this.lastScrollTop>=t,a=!s;this.lastScrollTop=t;const l=((c=this.container)==null?void 0:c.offsetHeight)||0;let r=this.rowHeightService.index(t);const h=this.rowHeightService.index(t+l),n=Math.max(r+this.pageSize-this.total,0);r=Math.max(r-n,0),a&&h>=this.lastLoaded&&this.lastLoaded<this.total-1?(this.firstToLoad=r,this.loadPage(e)):(s&&r<this.firstToLoad||r>this.lastLoaded||h<this.firstLoaded)&&this.loadPageWithBuffer(r,n,s,e)}scrollHandler(t){if(this.scrollSyncing){this.scrollSyncing=!1;return}!this.scrollableVirtual||!this.container||!this.table||!this.rowHeightService||this.scrollToPosition(this.container.scrollTop,t)}update(){var e;const t=this.getItemHeights();if(this.firstLoaded>this.firstToLoad){const i=Math.min(this.firstLoaded-this.firstToLoad,this.pageSize),s=this.getTotalHeight(i,t),a=this.getExpectedTotalHeight(i),l=s-a;l!==0&&this.adjustScroll(l)}(e=this.rowHeightService)==null||e.update(this.firstToLoad,t),this.setScrollHeightContainerHeight(),this.firstLoaded=this.firstToLoad,this.lastLoaded=this.firstLoaded+t.length-1,this.pendingTranslate&&this.rowHeightService&&(this.translate(this.rowHeightService.offset(this.firstLoaded),!0),this.container&&(this.scrollSyncing=!0,this.container.scrollTop=this.deferredScrollTop),this.pendingTranslate=!1)}loadPage(t){this.rowHeightService&&(this.pendingTranslate||this.translate(this.rowHeightService.offset(this.firstToLoad)),this.changePage(this.firstToLoad,t))}loadPageWithBuffer(t,e,i,s){const a=i?Math.max(Math.floor(this.pageSize*S)-e,0):0;this.firstToLoad=Math.max(t-a,0),this.loadPage(s)}translate(t,e){this.scrollableVirtual&&this.table&&((this.reactVersion<=17||e)&&(this.table.style.transform="translateY("+t+"px)"),this.reactVersion>17&&(this.tableTransform="translateY("+t+"px)"))}changePage(t,e){this.PageChange&&this.PageChange({skip:Math.max(0,t),take:this.pageSize},e)}adjustScroll(t){this.scrollSyncing=!0,this.container&&(this.container.scrollTop+=t)}setScrollHeightContainerHeight(){var t;if(this.scrollableVirtual&&this.scrollHeightContainer){let e=((t=this.rowHeightService)==null?void 0:t.totalHeight())||0;e=f.firefox?Math.min(f.firefoxMaxHeight,e):e,this.scrollHeightContainer.style.height=e+"px",this.scrollbarOverlaySpacerElement&&(this.scrollbarOverlaySpacerElement.style.height=e+"px")}}getItemHeights(){const t=[];return this.tableBody&&Array.from(this.tableBody.children).forEach(e=>{const i=e.offsetHeight;e.classList.contains("k-detail-row")?t[t.length-1]+=i:t.push(i)}),t}getTotalHeight(t,e){return e.slice(0,t).reduce((i,s)=>i+s,0)}getExpectedTotalHeight(t){const e=this.rowHeightService;if(!e)return 0;const i=this.firstToLoad+(t-1);return e.offset(i)+e.height(i)-e.offset(this.firstToLoad)}}exports.VirtualScroll=p;
|
package/VirtualScroll.mjs
CHANGED
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
9
|
-
import { firefox as
|
|
10
|
-
const
|
|
11
|
-
class
|
|
8
|
+
import * as c from "react";
|
|
9
|
+
import { firefox as f, firefoxMaxHeight as d } from "./utils/index.mjs";
|
|
10
|
+
const g = 0.3;
|
|
11
|
+
class p {
|
|
12
12
|
constructor() {
|
|
13
|
-
this.table = null, this.tableBody = null, this.container = null, this.scrollHeightContainer = null, this.total = 0, this.scrollableVirtual = !1, this.pageSize = 0, this.PageChange = null, this.fixedScroll = !1, this.tableTransform = "", this.reactVersion = Number.parseFloat(
|
|
13
|
+
this.table = null, this.tableBody = null, this.container = null, this.scrollHeightContainer = null, this.total = 0, this.scrollableVirtual = !1, this.pageSize = 0, this.PageChange = null, this.fixedScroll = !1, this.tableTransform = "", this.scrollbarOverlaySpacerElement = null, this.reactVersion = Number.parseFloat(c.version), this.scrollSyncing = !1, this.pendingTranslate = !1, this.deferredScrollTop = 0, this.firstToLoad = 0, this.lastScrollTop = 0, this.firstLoaded = 0, this.lastLoaded = 0, this.scrollHandler = this.scrollHandler.bind(this);
|
|
14
14
|
}
|
|
15
15
|
reset() {
|
|
16
16
|
if (this.firstToLoad = 0, this.firstLoaded = 0, this.lastLoaded = 0, this.rowHeightService = void 0, this.fixedScroll) {
|
|
@@ -19,35 +19,40 @@ class u {
|
|
|
19
19
|
}
|
|
20
20
|
this.container && this.container.scrollTop !== 0 && (this.scrollSyncing = !0, this.container.scrollTop = 0, this.lastScrollTop = 0, this.translate(0, !0));
|
|
21
21
|
}
|
|
22
|
+
scrollToPosition(t, i, e = !1) {
|
|
23
|
+
var n;
|
|
24
|
+
if (!this.scrollableVirtual || !this.rowHeightService)
|
|
25
|
+
return;
|
|
26
|
+
e && (this.pendingTranslate = !0, this.deferredScrollTop = t);
|
|
27
|
+
const s = this.lastScrollTop >= t, o = !s;
|
|
28
|
+
this.lastScrollTop = t;
|
|
29
|
+
const a = ((n = this.container) == null ? void 0 : n.offsetHeight) || 0;
|
|
30
|
+
let r = this.rowHeightService.index(t);
|
|
31
|
+
const h = this.rowHeightService.index(t + a), l = Math.max(r + this.pageSize - this.total, 0);
|
|
32
|
+
r = Math.max(r - l, 0), o && h >= this.lastLoaded && this.lastLoaded < this.total - 1 ? (this.firstToLoad = r, this.loadPage(i)) : (s && r < this.firstToLoad || r > this.lastLoaded || h < this.firstLoaded) && this.loadPageWithBuffer(r, l, s, i);
|
|
33
|
+
}
|
|
22
34
|
scrollHandler(t) {
|
|
23
35
|
if (this.scrollSyncing) {
|
|
24
36
|
this.scrollSyncing = !1;
|
|
25
37
|
return;
|
|
26
38
|
}
|
|
27
|
-
|
|
28
|
-
return;
|
|
29
|
-
const i = this.container.scrollTop, s = this.lastScrollTop >= i, o = !s;
|
|
30
|
-
this.lastScrollTop = i;
|
|
31
|
-
const r = this.container.offsetHeight;
|
|
32
|
-
let e = this.rowHeightService.index(i);
|
|
33
|
-
const a = this.rowHeightService.index(i + r), h = Math.max(e + this.pageSize - this.total, 0);
|
|
34
|
-
e = Math.max(e - h, 0), o && a >= this.lastLoaded && this.lastLoaded < this.total - 1 ? (this.firstToLoad = e, this.loadPage(t)) : (s && e < this.firstToLoad || e > this.lastLoaded || a < this.firstLoaded) && this.loadPageWithBuffer(e, h, s, t);
|
|
39
|
+
!this.scrollableVirtual || !this.container || !this.table || !this.rowHeightService || this.scrollToPosition(this.container.scrollTop, t);
|
|
35
40
|
}
|
|
36
41
|
update() {
|
|
37
42
|
var i;
|
|
38
43
|
const t = this.getItemHeights();
|
|
39
44
|
if (this.firstLoaded > this.firstToLoad) {
|
|
40
|
-
const
|
|
41
|
-
|
|
45
|
+
const e = Math.min(this.firstLoaded - this.firstToLoad, this.pageSize), s = this.getTotalHeight(e, t), o = this.getExpectedTotalHeight(e), a = s - o;
|
|
46
|
+
a !== 0 && this.adjustScroll(a);
|
|
42
47
|
}
|
|
43
|
-
(i = this.rowHeightService) == null || i.update(this.firstToLoad, t), this.setScrollHeightContainerHeight(), this.firstLoaded = this.firstToLoad, this.lastLoaded = this.firstLoaded + t.length - 1;
|
|
48
|
+
(i = this.rowHeightService) == null || i.update(this.firstToLoad, t), this.setScrollHeightContainerHeight(), this.firstLoaded = this.firstToLoad, this.lastLoaded = this.firstLoaded + t.length - 1, this.pendingTranslate && this.rowHeightService && (this.translate(this.rowHeightService.offset(this.firstLoaded), !0), this.container && (this.scrollSyncing = !0, this.container.scrollTop = this.deferredScrollTop), this.pendingTranslate = !1);
|
|
44
49
|
}
|
|
45
50
|
loadPage(t) {
|
|
46
|
-
this.rowHeightService && (this.translate(this.rowHeightService.offset(this.firstToLoad)), this.changePage(this.firstToLoad, t));
|
|
51
|
+
this.rowHeightService && (this.pendingTranslate || this.translate(this.rowHeightService.offset(this.firstToLoad)), this.changePage(this.firstToLoad, t));
|
|
47
52
|
}
|
|
48
|
-
loadPageWithBuffer(t, i,
|
|
49
|
-
const
|
|
50
|
-
this.firstToLoad = Math.max(t -
|
|
53
|
+
loadPageWithBuffer(t, i, e, s) {
|
|
54
|
+
const o = e ? Math.max(Math.floor(this.pageSize * g) - i, 0) : 0;
|
|
55
|
+
this.firstToLoad = Math.max(t - o, 0), this.loadPage(s);
|
|
51
56
|
}
|
|
52
57
|
translate(t, i) {
|
|
53
58
|
this.scrollableVirtual && this.table && ((this.reactVersion <= 17 || i) && (this.table.style.transform = "translateY(" + t + "px)"), this.reactVersion > 17 && (this.tableTransform = "translateY(" + t + "px)"));
|
|
@@ -68,27 +73,27 @@ class u {
|
|
|
68
73
|
var t;
|
|
69
74
|
if (this.scrollableVirtual && this.scrollHeightContainer) {
|
|
70
75
|
let i = ((t = this.rowHeightService) == null ? void 0 : t.totalHeight()) || 0;
|
|
71
|
-
i =
|
|
76
|
+
i = f ? Math.min(d, i) : i, this.scrollHeightContainer.style.height = i + "px", this.scrollbarOverlaySpacerElement && (this.scrollbarOverlaySpacerElement.style.height = i + "px");
|
|
72
77
|
}
|
|
73
78
|
}
|
|
74
79
|
getItemHeights() {
|
|
75
80
|
const t = [];
|
|
76
81
|
return this.tableBody && Array.from(this.tableBody.children).forEach((i) => {
|
|
77
|
-
const
|
|
78
|
-
i.classList.contains("k-detail-row") ? t[t.length - 1] +=
|
|
82
|
+
const e = i.offsetHeight;
|
|
83
|
+
i.classList.contains("k-detail-row") ? t[t.length - 1] += e : t.push(e);
|
|
79
84
|
}), t;
|
|
80
85
|
}
|
|
81
86
|
getTotalHeight(t, i) {
|
|
82
|
-
return i.slice(0, t).reduce((
|
|
87
|
+
return i.slice(0, t).reduce((e, s) => e + s, 0);
|
|
83
88
|
}
|
|
84
89
|
getExpectedTotalHeight(t) {
|
|
85
90
|
const i = this.rowHeightService;
|
|
86
91
|
if (!i)
|
|
87
92
|
return 0;
|
|
88
|
-
const
|
|
89
|
-
return i.offset(
|
|
93
|
+
const e = this.firstToLoad + (t - 1);
|
|
94
|
+
return i.offset(e) + i.height(e) - i.offset(this.firstToLoad);
|
|
90
95
|
}
|
|
91
96
|
}
|
|
92
97
|
export {
|
|
93
|
-
|
|
98
|
+
p as VirtualScroll
|
|
94
99
|
};
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),y=require("../../utils/GridContext.js"),
|
|
9
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),y=require("../../utils/GridContext.js"),r=require("@progress/kendo-react-data-tools"),C=require("@progress/kendo-react-common"),u=require("../hooks.js");function g(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const d=g(f),m=(e,n)=>{const t=d.useContext(y.GridContext),a=r.useTableKeyboardNavigation(e.id),i=u.useContextMenuHandler(e.dataItem,e.field),s=u.usePositionStyle(e),c=d.useCallback(o=>{o.isDefaultPrevented()||o.keyCode===C.Keys.enter&&(t!=null&&t.itemChange)&&(o.preventDefault(),t.itemChange({dataItem:e.dataItem,dataIndex:e.dataIndex,syntheticEvent:o,field:void 0,value:!e.expanded}),t.dispatchGroupExpand({type:r.GROUP_EXPAND_ACTION.TOGGLE,group:e.group},o))},[t,e.dataItem,e.dataIndex,e.expanded,e.group]);return{...a,...n?{onKeyDown:c}:{},onContextMenu:i,style:s}};exports.useGroupCellClientTdProps=m;
|
|
@@ -10,9 +10,9 @@ import * as a from "react";
|
|
|
10
10
|
import { GridContext as m } from "../../utils/GridContext.mjs";
|
|
11
11
|
import { useTableKeyboardNavigation as s, GROUP_EXPAND_ACTION as f } from "@progress/kendo-react-data-tools";
|
|
12
12
|
import { Keys as y } from "@progress/kendo-react-common";
|
|
13
|
-
import { useContextMenuHandler as
|
|
14
|
-
const
|
|
15
|
-
const e = a.useContext(m), d = s(t.id), i =
|
|
13
|
+
import { useContextMenuHandler as x, usePositionStyle as C } from "../hooks.mjs";
|
|
14
|
+
const K = (t, o) => {
|
|
15
|
+
const e = a.useContext(m), d = s(t.id), i = x(t.dataItem, t.field), r = C(t), u = a.useCallback(
|
|
16
16
|
(n) => {
|
|
17
17
|
n.isDefaultPrevented() || n.keyCode === y.enter && (e != null && e.itemChange) && (n.preventDefault(), e.itemChange({
|
|
18
18
|
dataItem: t.dataItem,
|
|
@@ -20,7 +20,7 @@ const b = (t, o) => {
|
|
|
20
20
|
syntheticEvent: n,
|
|
21
21
|
field: void 0,
|
|
22
22
|
value: !t.expanded
|
|
23
|
-
}), e
|
|
23
|
+
}), e.dispatchGroupExpand(
|
|
24
24
|
{
|
|
25
25
|
type: f.TOGGLE,
|
|
26
26
|
group: t.group
|
|
@@ -33,12 +33,12 @@ const b = (t, o) => {
|
|
|
33
33
|
return {
|
|
34
34
|
...d,
|
|
35
35
|
...o ? {
|
|
36
|
-
onKeyDown:
|
|
36
|
+
onKeyDown: u
|
|
37
37
|
} : {},
|
|
38
38
|
onContextMenu: i,
|
|
39
|
-
style:
|
|
39
|
+
style: r
|
|
40
40
|
};
|
|
41
41
|
};
|
|
42
42
|
export {
|
|
43
|
-
|
|
43
|
+
K as useGroupCellClientTdProps
|
|
44
44
|
};
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),u=require("../../utils/GridContext.js"),m=require("@progress/kendo-react-common"),
|
|
9
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),u=require("../../utils/GridContext.js"),m=require("@progress/kendo-react-common"),d=require("@progress/kendo-svg-icons"),g=require("@progress/kendo-react-intl"),o=require("../../messages/index.js"),f=require("@progress/kendo-react-data-tools");function I(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const c=I(s),b=e=>{const t=c.useContext(u.GridContext),n=g.useLocalization(),a=e.expanded,i=a?o.detailCollapse:o.detailExpand,l=n.toLanguageString(i,o.messages[i]);return c.createElement("a",{onClick:r=>{r.preventDefault(),t!=null&&t.itemChange&&t.itemChange({dataItem:e.dataItem,dataIndex:e.dataIndex,syntheticEvent:r,field:e.field,value:!a,_expand:!0}),t&&e.dataItem[t.dataItemKey]!==void 0&&t.dispatchDetailExpand({type:f.DETAIL_EXPAND_ACTION.TOGGLE,id:e.dataItem[t.dataItemKey]})},"aria-label":l,href:"#",tabIndex:-1},c.createElement(m.IconWrap,{name:a?"minus":"plus",icon:a?d.minusIcon:d.plusIcon}))};exports.GridHierarchyCellToggle=b;
|
|
@@ -7,35 +7,35 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as n from "react";
|
|
10
|
-
import { GridContext as
|
|
11
|
-
import { IconWrap as
|
|
10
|
+
import { GridContext as r } from "../../utils/GridContext.mjs";
|
|
11
|
+
import { IconWrap as l } from "@progress/kendo-react-common";
|
|
12
12
|
import { minusIcon as c, plusIcon as s } from "@progress/kendo-svg-icons";
|
|
13
13
|
import { useLocalization as I } from "@progress/kendo-react-intl";
|
|
14
14
|
import { detailCollapse as f, detailExpand as u, messages as p } from "../../messages/index.mjs";
|
|
15
15
|
import { DETAIL_EXPAND_ACTION as x } from "@progress/kendo-react-data-tools";
|
|
16
|
-
const D = (
|
|
17
|
-
const e = n.useContext(
|
|
16
|
+
const D = (t) => {
|
|
17
|
+
const e = n.useContext(r), m = I(), a = t.expanded, i = a ? f : u, d = m.toLanguageString(i, p[i]);
|
|
18
18
|
return /* @__PURE__ */ n.createElement(
|
|
19
19
|
"a",
|
|
20
20
|
{
|
|
21
|
-
onClick: (
|
|
22
|
-
|
|
23
|
-
dataItem:
|
|
24
|
-
dataIndex:
|
|
25
|
-
syntheticEvent:
|
|
26
|
-
field:
|
|
27
|
-
value: !
|
|
21
|
+
onClick: (o) => {
|
|
22
|
+
o.preventDefault(), e != null && e.itemChange && e.itemChange({
|
|
23
|
+
dataItem: t.dataItem,
|
|
24
|
+
dataIndex: t.dataIndex,
|
|
25
|
+
syntheticEvent: o,
|
|
26
|
+
field: t.field,
|
|
27
|
+
value: !a,
|
|
28
28
|
_expand: !0
|
|
29
|
-
}),
|
|
29
|
+
}), e && t.dataItem[e.dataItemKey] !== void 0 && e.dispatchDetailExpand({
|
|
30
30
|
type: x.TOGGLE,
|
|
31
|
-
id:
|
|
32
|
-
})
|
|
31
|
+
id: t.dataItem[e.dataItemKey]
|
|
32
|
+
});
|
|
33
33
|
},
|
|
34
34
|
"aria-label": d,
|
|
35
35
|
href: "#",
|
|
36
36
|
tabIndex: -1
|
|
37
37
|
},
|
|
38
|
-
/* @__PURE__ */ n.createElement(
|
|
38
|
+
/* @__PURE__ */ n.createElement(l, { name: a ? "minus" : "plus", icon: a ? c : s })
|
|
39
39
|
);
|
|
40
40
|
};
|
|
41
41
|
export {
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
9
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),P=require("@progress/kendo-react-common"),S=require("../../utils/GridContext.js"),y=require("./GridSelectionCellInput.js"),m=require("./utils.js"),b=require("../hooks.js"),I=require("./useSelectionCellClientTdProps.js");function T(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const l=T(f),k=t=>{var p;const{cellProps:e}=t,{tdProps:n}=m.getSelectionCellTdProps(e),o=I.useSelectionCellClientTdProps(e),g=b.useLegacyCellProps(e),c=l.useContext(S.GridContext),s=(p=e.isSelected)!=null?p:P.getNestedValue(e.field,e.dataItem),i=typeof s=="boolean"&&s,a=r=>{c==null||c.selectionChange({event:r,dataItem:e.dataItem,dataIndex:e.rowDataIndex,columnIndex:e.columnIndex})},u=r=>{i||a(r)},d=l.createElement(y.GridSelectionCellInput,{key:1,selected:i,onToggle:a}),C=m.getCustomCell(e);return C?l.createElement(C,{onClick:u,...e,...g,tdProps:{...n,...o}},d):e.rowType!=="groupHeader"?l.createElement("td",{onClick:u,...n,...o},d):null};exports.GridSelectionCell=k;
|
|
@@ -7,14 +7,35 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as t from "react";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
import { getNestedValue as f } from "@progress/kendo-react-common";
|
|
11
|
+
import { GridContext as g } from "../../utils/GridContext.mjs";
|
|
12
|
+
import { GridSelectionCellInput as I } from "./GridSelectionCellInput.mjs";
|
|
13
|
+
import { getSelectionCellTdProps as P, getCustomCell as x } from "./utils.mjs";
|
|
14
|
+
import { useLegacyCellProps as y } from "../hooks.mjs";
|
|
15
|
+
import { useSelectionCellClientTdProps as S } from "./useSelectionCellClientTdProps.mjs";
|
|
16
|
+
const V = (C) => {
|
|
17
|
+
var p;
|
|
18
|
+
const { cellProps: e } = C, { tdProps: n } = P(e), r = S(e), u = y(e), o = t.useContext(g), c = (p = e.isSelected) != null ? p : f(e.field, e.dataItem), s = typeof c == "boolean" && c, a = (l) => {
|
|
19
|
+
o == null || o.selectionChange({
|
|
20
|
+
event: l,
|
|
21
|
+
dataItem: e.dataItem,
|
|
22
|
+
dataIndex: e.rowDataIndex,
|
|
23
|
+
columnIndex: e.columnIndex
|
|
24
|
+
});
|
|
25
|
+
}, d = (l) => {
|
|
26
|
+
s || a(l);
|
|
27
|
+
}, m = /* @__PURE__ */ t.createElement(I, { key: 1, selected: s, onToggle: a }), i = x(e);
|
|
28
|
+
return i ? /* @__PURE__ */ t.createElement(
|
|
29
|
+
i,
|
|
30
|
+
{
|
|
31
|
+
onClick: d,
|
|
32
|
+
...e,
|
|
33
|
+
...u,
|
|
34
|
+
tdProps: { ...n, ...r }
|
|
35
|
+
},
|
|
36
|
+
m
|
|
37
|
+
) : e.rowType !== "groupHeader" ? /* @__PURE__ */ t.createElement("td", { onClick: d, ...n, ...r }, m) : null;
|
|
17
38
|
};
|
|
18
39
|
export {
|
|
19
|
-
|
|
40
|
+
V as GridSelectionCell
|
|
20
41
|
};
|
|
@@ -5,9 +5,13 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { GridCellProps } from '../../interfaces/GridCellProps';
|
|
9
8
|
import * as React from 'react';
|
|
9
|
+
interface GridSelectionCellInputProps {
|
|
10
|
+
selected: boolean;
|
|
11
|
+
onToggle?: (e: React.SyntheticEvent<HTMLElement>) => void;
|
|
12
|
+
}
|
|
10
13
|
/**
|
|
11
14
|
* @hidden
|
|
12
15
|
*/
|
|
13
|
-
export declare const GridSelectionCellInput: (props:
|
|
16
|
+
export declare const GridSelectionCellInput: (props: GridSelectionCellInputProps) => React.JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
9
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),u=require("@progress/kendo-react-common"),d=require("@progress/kendo-react-intl"),o=require("../../messages/index.js");function p(t){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(c,e,n.get?n:{enumerable:!0,get:()=>t[e]})}}return c.default=t,Object.freeze(c)}const r=p(s),k=t=>{const{selected:c,onToggle:e}=t,n=u.useId(),l=d.useLocalization(),i=a=>{a.stopPropagation(),e==null||e(a)};return r.createElement("span",{className:"k-checkbox-wrap"},r.createElement("input",{id:n,tabIndex:-1,type:"checkbox",className:"k-checkbox k-checkbox-md k-rounded-md","aria-label":l.toLanguageString(o.selectRow,o.messages[o.selectRow]),"aria-checked":c,checked:c,readOnly:!0,onClick:i}))};exports.GridSelectionCellInput=k;
|
|
@@ -6,38 +6,29 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
t == null || t.selectionChange({
|
|
19
|
-
event: s,
|
|
20
|
-
dataItem: e.dataItem,
|
|
21
|
-
dataIndex: e.rowDataIndex,
|
|
22
|
-
columnIndex: e.columnIndex
|
|
23
|
-
});
|
|
24
|
-
},
|
|
25
|
-
[t, e.columnIndex, e.rowDataIndex, e.dataItem]
|
|
26
|
-
);
|
|
27
|
-
return /* @__PURE__ */ a.createElement("span", { className: "k-checkbox-wrap" }, /* @__PURE__ */ a.createElement(
|
|
9
|
+
import * as o from "react";
|
|
10
|
+
import { useId as l } from "@progress/kendo-react-common";
|
|
11
|
+
import { useLocalization as m } from "@progress/kendo-react-intl";
|
|
12
|
+
import { selectRow as a, messages as d } from "../../messages/index.mjs";
|
|
13
|
+
const h = (n) => {
|
|
14
|
+
const { selected: t, onToggle: e } = n, r = l(), i = m(), s = (c) => {
|
|
15
|
+
c.stopPropagation(), e == null || e(c);
|
|
16
|
+
};
|
|
17
|
+
return /* @__PURE__ */ o.createElement("span", { className: "k-checkbox-wrap" }, /* @__PURE__ */ o.createElement(
|
|
28
18
|
"input",
|
|
29
19
|
{
|
|
30
|
-
id:
|
|
20
|
+
id: r,
|
|
31
21
|
tabIndex: -1,
|
|
32
22
|
type: "checkbox",
|
|
33
23
|
className: "k-checkbox k-checkbox-md k-rounded-md",
|
|
34
|
-
"aria-label":
|
|
35
|
-
"aria-checked":
|
|
36
|
-
checked:
|
|
37
|
-
|
|
24
|
+
"aria-label": i.toLanguageString(a, d[a]),
|
|
25
|
+
"aria-checked": t,
|
|
26
|
+
checked: t,
|
|
27
|
+
readOnly: !0,
|
|
28
|
+
onClick: s
|
|
38
29
|
}
|
|
39
30
|
));
|
|
40
31
|
};
|
|
41
32
|
export {
|
|
42
|
-
|
|
33
|
+
h as GridSelectionCellInput
|
|
43
34
|
};
|
|
@@ -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 m=require("react"),f=require("@progress/kendo-react-common"),g=require("./GridSelectionCellInput.js"),u=require("./GridSelectionCellServerContainer.js"),a=require("../../utils/index.js"),d=require("./utils.js");function P(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const l=P(m),b=r=>{var s;const{cellProps:e}=r,{tdProps:t}=d.getSelectionCellTdProps(e),n=(s=e.isSelected)!=null?s:f.getNestedValue(e.field,e.dataItem),C=typeof n=="boolean"&&n,i=l.createElement(g.GridSelectionCellInput,{key:1,selected:C}),o=a.getClientCellProps(e),c=d.getCustomCell(e);if(c){const S=a.isClientReference(c);return l.createElement(u.GridSelectionCellServerContainer,{cellProps:o,tdProps:t,isCustom:!0,isClient:S},l.createElement(c,{...o,tdProps:t},i))}const p=e.rowType!=="groupHeader"?l.createElement("td",{...t},i):null;return l.createElement(u.GridSelectionCellServerContainer,{cellProps:o,tdProps:t},p)};exports.GridSelectionCellServer=b;
|
|
@@ -6,28 +6,30 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as t from "react";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
import { getNestedValue as C } from "@progress/kendo-react-common";
|
|
10
|
+
import { GridSelectionCellInput as u } from "./GridSelectionCellInput.mjs";
|
|
11
|
+
import { GridSelectionCellServerContainer as i } from "./GridSelectionCellServerContainer.mjs";
|
|
12
|
+
import { getClientCellProps as f, isClientReference as P } from "../../utils/index.mjs";
|
|
13
|
+
import { getSelectionCellTdProps as S, getCustomCell as g } from "./utils.mjs";
|
|
14
|
+
const I = (m) => {
|
|
15
|
+
var s;
|
|
16
|
+
const { cellProps: e } = m, { tdProps: l } = S(e), n = (s = e.isSelected) != null ? s : C(e.field, e.dataItem), p = typeof n == "boolean" && n, c = /* @__PURE__ */ t.createElement(u, { key: 1, selected: p }), o = f(e), r = g(e);
|
|
17
|
+
if (r) {
|
|
18
|
+
const d = P(r);
|
|
17
19
|
return /* @__PURE__ */ t.createElement(
|
|
18
|
-
|
|
20
|
+
i,
|
|
19
21
|
{
|
|
20
|
-
cellProps:
|
|
21
|
-
tdProps:
|
|
22
|
+
cellProps: o,
|
|
23
|
+
tdProps: l,
|
|
22
24
|
isCustom: !0,
|
|
23
|
-
isClient:
|
|
25
|
+
isClient: d
|
|
24
26
|
},
|
|
25
|
-
/* @__PURE__ */ t.createElement(
|
|
27
|
+
/* @__PURE__ */ t.createElement(r, { ...o, tdProps: l }, c)
|
|
26
28
|
);
|
|
27
29
|
}
|
|
28
|
-
const
|
|
29
|
-
return /* @__PURE__ */ t.createElement(
|
|
30
|
+
const a = e.rowType !== "groupHeader" ? /* @__PURE__ */ t.createElement("td", { ...l }, c) : null;
|
|
31
|
+
return /* @__PURE__ */ t.createElement(i, { cellProps: o, tdProps: l }, a);
|
|
30
32
|
};
|
|
31
33
|
export {
|
|
32
|
-
|
|
34
|
+
I as GridSelectionCellServer
|
|
33
35
|
};
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
9
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const J=require("react"),Q=require("@progress/kendo-react-popup"),d=require("@progress/kendo-react-common"),X=require("@progress/kendo-svg-icons"),w=require("../messages/index.js"),Y=require("@progress/kendo-react-intl"),Z=require("../utils/GridContext.js"),ee=require("./adaptiveContext/GridColumnMenuAdaptiveContext.js"),ne=require("./adaptiveContent/GridAdaptiveColumnMenu.js"),te=require("react-dom");function oe(r){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const l in r)if(l!=="default"){const a=Object.getOwnPropertyDescriptor(r,l);Object.defineProperty(c,l,a.get?a:{enumerable:!0,get:()=>r[l]})}}return c.default=r,Object.freeze(c)}const t=oe(J),re=[".k-columnmenu-item-content",".k-filter-menu-container"].map(r=>d.FOCUSABLE_ELEMENTS.map(c=>`${r} ${c}`)),ce=[[".k-columnmenu-item"],...re],se=r=>{var A;const c=t.useContext(Z.GridContext),[l,a]=t.useState(!1),i=t.useRef(null),E=t.useRef(null),m=t.useRef(null),M=t.useRef(0),x=d.useDocument(i),{columnMenu:v,...b}=r,{column:f,columnMenuIcon:h,navigatable:y}=r,I=Y.useLocalization(),D=f.title||f.field,P=D?`${D} `:"",L="#",N=n=>{const e=d.getActiveElement(document);clearTimeout(M.current),M.current=window.setTimeout(()=>{!c.mobileMode&&e&&n.relatedTarget!==i.current&&E.current&&!E.current.contains(e)&&C()})},W=()=>{clearTimeout(M.current)},z=n=>{n.preventDefault(),l&&r.onCloseMenu&&r.onCloseMenu(),a(!l)},C=()=>{r.onCloseMenu&&r.onCloseMenu(),a(!1),!r.navigatable&&i.current&&i.current.focus()},B=n=>{var e;if(n.key==="Tab"){const o=n.target,u=o&&((e=o.closest(".k-grid"))==null?void 0:e.getElementsByClassName("k-grid-content")[0]);u&&u.scrollWidth>u.clientWidth&&o.scrollIntoView({inline:"center"})}},g=t.useMemo(()=>r.show!==void 0?r.show:l,[r.show,l]);t.useEffect(()=>{var G;if(!g||!i.current)return;const n=i.current,e=n.closest(".k-grid-header-wrap"),o=[];let u=n.closest(".k-grid");for(;u;){const s=(G=u.parentElement)==null?void 0:G.closest(".k-grid-content, .k-virtual-content");if(s)o.push(s),u=s.closest(".k-grid");else break}const p=()=>{a(!1),r.onCloseMenu&&r.onCloseMenu()},R=()=>{p()},T=()=>{const s=n.getBoundingClientRect();for(const j of o){const q=j.getBoundingClientRect();if(s.bottom<q.top||s.top>q.bottom){p();return}}};return e&&e.addEventListener("scroll",R),o.forEach(s=>{s.addEventListener("scroll",T)}),()=>{e&&e.removeEventListener("scroll",R),o.forEach(s=>{s.removeEventListener("scroll",T)})}},[g]);const F=n=>{var e;(e=m.current)==null||e.triggerKeyboardEvent(n)},K=n=>{var e;(e=m.current)==null||e.triggerMouseEvent(n)},_=(n,e,o)=>{o.preventDefault(),o.shiftKey?e.focusPrevious(n):e.focusNext(n)},$=(n,e,o)=>{n&&(o.preventDefault(),n.click())},O=(n,e,o)=>{o.preventDefault(),C()},V=(n,e,o)=>{e.focusElement(n)},H=n=>{!n.isAnchorClicked&&a(!1)},k=t.useCallback((n,e)=>{const o=[];if(!e||typeof e!="object")return!1;if(Array.isArray(e.filters)){for(const u of e.filters)if(k(n,u))return!0}return"field"in e&&typeof e.field=="string"&&o.push(e.field),o.includes(n)},[]),S=t.useCallback((n,e)=>!e||!Array.isArray(e)?!1:e.some(o=>o.field===n),[]),U=t.useMemo(()=>f.field&&(k(f.field,c.filter)||S(f.field,c.group)),[f.field,c.filter,c.group,k,S]);return t.useEffect(()=>(g&&E.current&&(m.current=new d.Navigation({tabIndex:0,root:E,selectors:ce,keyboardEvents:{keydown:{Tab:_,Enter:$,Escape:O}},mouseEvents:{mousedown:V}}),m.current.focusElement(m.current.first,null)),()=>{m.current&&(m.current=null)}),[g]),t.createElement(t.Fragment,null,t.createElement("a",{className:d.classNames("k-grid-header-menu k-grid-column-menu",{"k-active":U}),ref:i,onClick:z,onKeyDown:B,href:L,tabIndex:y?-1:void 0,"aria-label":`${y?"":P}${I.toLanguageString(w.columnMenu,w.messages[w.columnMenu])}`},h?t.createElement(d.IconWrap,{name:h.name,icon:h}):t.createElement(d.IconWrap,{name:"more-vertical",icon:X.moreVerticalIcon})),t.createElement(ee.GridColumnMenuAdaptiveProvider,null,c.mobileMode?t.createElement(t.Fragment,null,te.createPortal(t.createElement(ne.GridAdaptiveColumnMenu,{computedShow:g,ColumnMenu:v,closeMenu:C},v&&t.createElement(v,{...b,onCloseMenu:C})),(A=x())==null?void 0:A.body)):t.createElement(Q.Popup,{anchor:i.current,show:g,popupClass:"k-grid-columnmenu-popup",onMouseDownOutside:H},t.createElement("div",{ref:E,onBlur:N,onFocus:W,onMouseDown:K,onKeyDown:F,className:"k-column-menu k-column-menu-md"},v&&t.createElement(v,{...b,onCloseMenu:C})))))};exports.GridColumnMenuWrapper=se;
|