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