@progress/kendo-react-grid 9.4.0-develop.20 → 9.4.0-develop.22

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/index.d.mts CHANGED
@@ -7,7 +7,6 @@
7
7
  */
8
8
  import { BaseEvent } from '@progress/kendo-react-common';
9
9
  import { CellProps } from '@progress/kendo-react-data-tools';
10
- import { ClipboardDataEvent } from '@progress/kendo-react-data-tools';
11
10
  import { ClipboardSettings } from '@progress/kendo-react-data-tools';
12
11
  import { ColumnBaseProps } from '@progress/kendo-react-data-tools';
13
12
  import { ColumnSortSettings } from '@progress/kendo-react-data-tools';
@@ -22,6 +21,7 @@ import { FilterOperator } from '@progress/kendo-react-data-tools';
22
21
  import { getSelectedState } from '@progress/kendo-react-data-tools';
23
22
  import { getSelectedStateFromKeyDown } from '@progress/kendo-react-data-tools';
24
23
  import { GridClassStructure } from '@progress/kendo-react-common';
24
+ import { GridClipboardEvent } from '@progress/kendo-react-data-tools';
25
25
  import { GroupDescriptor } from '@progress/kendo-data-query';
26
26
  import { GroupExpandDescriptor } from '@progress/kendo-react-data-tools';
27
27
  import { GroupState } from '@progress/kendo-react-data-tools';
@@ -2199,9 +2199,9 @@ export declare interface GridProps extends KendoReactComponentBaseProps {
2199
2199
  */
2200
2200
  clipboard?: ClipboardSettings | boolean;
2201
2201
  /**
2202
- * Fires when clipboard support is enabled and the one of the actions 'copy'. The event accepts type [ClipboardDataEvent]({% slug api_data-tools_clipboarddataevent %}). Only fired when the Grid is run as a client component.
2202
+ * Fires when clipboard support is enabled and the one of the actions 'copy'. The event accepts type [GridClipboardEvent]({% slug api_data-tools_gridclipboardevent %}). Only fired when the Grid is run as a client component.
2203
2203
  */
2204
- onClipboard?: (event: ClipboardDataEvent) => void;
2204
+ onClipboard?: (event: GridClipboardEvent) => void;
2205
2205
  /**
2206
2206
  * Fires when the sorting of the Grid is changed ([see example]({% slug sorting_grid %})). You have to handle the event yourself and sort the data.
2207
2207
  */
package/index.d.ts CHANGED
@@ -7,7 +7,6 @@
7
7
  */
8
8
  import { BaseEvent } from '@progress/kendo-react-common';
9
9
  import { CellProps } from '@progress/kendo-react-data-tools';
10
- import { ClipboardDataEvent } from '@progress/kendo-react-data-tools';
11
10
  import { ClipboardSettings } from '@progress/kendo-react-data-tools';
12
11
  import { ColumnBaseProps } from '@progress/kendo-react-data-tools';
13
12
  import { ColumnSortSettings } from '@progress/kendo-react-data-tools';
@@ -22,6 +21,7 @@ import { FilterOperator } from '@progress/kendo-react-data-tools';
22
21
  import { getSelectedState } from '@progress/kendo-react-data-tools';
23
22
  import { getSelectedStateFromKeyDown } from '@progress/kendo-react-data-tools';
24
23
  import { GridClassStructure } from '@progress/kendo-react-common';
24
+ import { GridClipboardEvent } from '@progress/kendo-react-data-tools';
25
25
  import { GroupDescriptor } from '@progress/kendo-data-query';
26
26
  import { GroupExpandDescriptor } from '@progress/kendo-react-data-tools';
27
27
  import { GroupState } from '@progress/kendo-react-data-tools';
@@ -2199,9 +2199,9 @@ export declare interface GridProps extends KendoReactComponentBaseProps {
2199
2199
  */
2200
2200
  clipboard?: ClipboardSettings | boolean;
2201
2201
  /**
2202
- * Fires when clipboard support is enabled and the one of the actions 'copy'. The event accepts type [ClipboardDataEvent]({% slug api_data-tools_clipboarddataevent %}). Only fired when the Grid is run as a client component.
2202
+ * Fires when clipboard support is enabled and the one of the actions 'copy'. The event accepts type [GridClipboardEvent]({% slug api_data-tools_gridclipboardevent %}). Only fired when the Grid is run as a client component.
2203
2203
  */
2204
- onClipboard?: (event: ClipboardDataEvent) => void;
2204
+ onClipboard?: (event: GridClipboardEvent) => void;
2205
2205
  /**
2206
2206
  * Fires when the sorting of the Grid is changed ([see example]({% slug sorting_grid %})). You have to handle the event yourself and sort the data.
2207
2207
  */
@@ -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 e={name:"@progress/kendo-react-grid",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1738846940,version:"9.4.0-develop.20",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};exports.packageMetadata=e;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-react-grid",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1738932375,version:"9.4.0-develop.22",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};exports.packageMetadata=e;
@@ -10,8 +10,8 @@ const e = {
10
10
  productName: "KendoReact",
11
11
  productCode: "KENDOUIREACT",
12
12
  productCodes: ["KENDOUIREACT"],
13
- publishDate: 1738846940,
14
- version: "9.4.0-develop.20",
13
+ publishDate: 1738932375,
14
+ version: "9.4.0-develop.22",
15
15
  licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
16
16
  };
17
17
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-grid",
3
- "version": "9.4.0-develop.20",
3
+ "version": "9.4.0-develop.22",
4
4
  "description": "React Data Grid (Table) provides 100+ ready-to-use data grid features. KendoReact Grid package",
5
5
  "author": "Progress",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -27,18 +27,18 @@
27
27
  "peerDependencies": {
28
28
  "@progress/kendo-data-query": "^1.0.0",
29
29
  "@progress/kendo-drawing": "^1.21.2",
30
- "@progress/kendo-licensing": "^1.3.4",
31
- "@progress/kendo-react-animation": "9.4.0-develop.20",
32
- "@progress/kendo-react-buttons": "9.4.0-develop.20",
33
- "@progress/kendo-react-common": "9.4.0-develop.20",
34
- "@progress/kendo-react-data-tools": "9.4.0-develop.20",
35
- "@progress/kendo-react-dateinputs": "9.4.0-develop.20",
36
- "@progress/kendo-react-indicators": "9.4.0-develop.20",
37
- "@progress/kendo-react-dropdowns": "9.4.0-develop.20",
38
- "@progress/kendo-react-inputs": "9.4.0-develop.20",
39
- "@progress/kendo-react-intl": "9.4.0-develop.20",
40
- "@progress/kendo-react-popup": "9.4.0-develop.20",
41
- "@progress/kendo-react-layout": "9.4.0-develop.20",
30
+ "@progress/kendo-licensing": "^1.4.0",
31
+ "@progress/kendo-react-animation": "9.4.0-develop.22",
32
+ "@progress/kendo-react-buttons": "9.4.0-develop.22",
33
+ "@progress/kendo-react-common": "9.4.0-develop.22",
34
+ "@progress/kendo-react-data-tools": "9.4.0-develop.22",
35
+ "@progress/kendo-react-dateinputs": "9.4.0-develop.22",
36
+ "@progress/kendo-react-indicators": "9.4.0-develop.22",
37
+ "@progress/kendo-react-dropdowns": "9.4.0-develop.22",
38
+ "@progress/kendo-react-inputs": "9.4.0-develop.22",
39
+ "@progress/kendo-react-intl": "9.4.0-develop.22",
40
+ "@progress/kendo-react-popup": "9.4.0-develop.22",
41
+ "@progress/kendo-react-layout": "9.4.0-develop.22",
42
42
  "@progress/kendo-svg-icons": "^4.0.0",
43
43
  "react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
44
44
  "react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
@@ -84,7 +84,7 @@
84
84
  "package": {
85
85
  "productName": "KendoReact",
86
86
  "productCode": "KENDOUIREACT",
87
- "publishDate": 1738846940,
87
+ "publishDate": 1738932375,
88
88
  "licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
89
89
  }
90
90
  },
package/utils/index.js CHANGED
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("../GridColumn.js"),y=require("@progress/kendo-data-query"),S=require("@progress/kendo-react-data-tools"),T=require("./_serverModule.js"),G=require("./_clientModule.js"),x=require("../contextMenu/enums.js");function m(e,t){const a=(e!=null?e:"").split(".");let i=t;return a.forEach(d=>{i=i?i[d]:void 0}),i}function w(e,t,a,i,d,s,n,r,o,l,f=0,h){var M;let u=f;for(let c=0;c<t.length;c++){let I;if(!d||t[c].value===void 0||t[c].items===void 0){e[e.length]={dataIndex:i.index,dataItem:t[c],rowType:"data",level:f,group:h,expanded:(M=s?m(s,t[c]):l&&!!(n!=null&&n[y.getter(l)(t[c])]))!=null?M:!1},i.index++;continue}else{let C;h!=null&&h.parents?C=[{field:h.field,value:h.value},...h.parents]:h?C=[h]:C=[],I={field:t[c].field,value:t[c].value,parents:C}}u=Math.max(u,f+1);let g=!1;if(s)g=m(s,t[c])!==!1;else{const C=S.findGroupExpand(r||[],I);C?g=C.expanded!==!1:g=o!==!1}e[e.length]={dataIndex:-1,dataItem:t[c],level:f,group:I,rowType:"groupHeader",expanded:g},g&&(I.expanded=g,u=Math.max(w(e,t[c].items,a,i,d,s,n,r,o,l,f+1,I),u)),(a==="always"||g&&a==="visible")&&(e[e.length]={dataIndex:-1,dataItem:t[c],rowType:"groupFooter",level:f,expanded:g})}return u}const R=(e,t)=>typeof e.colSpan=="function"?e.colSpan({dataItem:t,column:e}):e.colSpan||1;function k(e,t){const a=[[]];let i=0;for(let n=e.length-1;n>=0;n--)i=Math.max(i,e[n].depth),e[n].headerColSpan=e[n].headerColSpan||1,e[n].children.length>0&&(e[n].headerColSpan=e[n].children.reduce((r,o)=>o.hidden?r:r+o.headerColSpan,0));const d=[];let s=1;return e.forEach((n,r)=>{a[n.depth]=a[n.depth]||[];let o=!1;a[n.depth].length===0&&(s<=1?s=1+(n.children.length>0?0:i-n.depth):(s--,o=!0)),n.rowSpan=1+(n.children.length>0?0:i-n.depth),n.kFirst=o,n.index=a[n.depth].length,a[n.depth].push(r),n.ariaColumnIndex=d[n.depth]?d[n.depth]+1:1;for(let l=n.depth;l<n.depth+n.rowSpan;l++)d[l]=(d[l]||0)+n.headerColSpan}),S.updateLeft(a,e,t),S.updateRight(a,e,t),a}function b(e,t,a,i=0){const d=[];if(!e)return[];e&&e.length===void 0&&(e=[e]),e.filter(r=>r&&r.props?!r.props.hidden:!r.hidden).forEach((r,o)=>{r=r.props?r.props:r;const l=t[o]||null,f=b(r.children,l&&l.children||[],a,i+1);d.push(Object.assign({depth:i},v.gridDefaultProps,f.length?{cell:()=>null,filterCell:()=>null}:{},l?{width:l.width,orderIndex:l.orderIndex}:{},r,{id:r.id?r.id:S.tableKeyboardNavigationTools.generateNavigatableId(`${a.prevId++}`,a.idPrefix,"column"),declarationIndex:d.length,children:f,headerColSpan:r.headerColSpan,rowSpan:0,columnType:r.columnType||"data",colSpan:r.colSpan||1,isAccessible:!0,left:r.lockedColumn?l&&Math.floor(l.left):null,right:r.lockedColumn?l&&Math.floor(l.right):null,rowSpannable:r.rowSpannable}))});const n=(r,o)=>r.orderIndex===o.orderIndex?r.declarationIndex-o.declarationIndex:(r.orderIndex||0)-(o.orderIndex||0);if(d.sort(n),i===0){const r=[],o=(l,f)=>l.forEach(h=>{h.parentIndex=f,o(h.children,r.push(h)-1)});return o(d,-1),r}return d}function A(e,t,a,i){let d=[];Array.isArray(e)?d=e:e&&(d=e.data);const s=[];if(d.length>0){let n=d[0];if(t)for(let o=0;o<t.length;o++)n=n.items&&n.items[0];Object.getOwnPropertyNames(n).forEach(o=>{o!==a.column&&s.push(Object.assign({id:S.tableKeyboardNavigationTools.generateNavigatableId(`${i.prevId++}`,i.idPrefix,"column"),declarationIndex:-1,parentIndex:-1,depth:0,colSpan:0,headerColSpan:0,rowSpan:0,index:0,columnType:"data",left:0,right:0,rightBorder:!1,children:[],ariaColumnIndex:0,isAccessible:!0},v.gridDefaultProps,{field:o}))})}return s}const B=(e,t)=>{let a=e[t.parentIndex];for(;a;){if(a.footerCell)return!0;a=e[a.parentIndex]}return!1},q=e=>e.filter(t=>B(e,t)?!1:!!t.footerCell||!(t.children&&t.children.length>0)),O=e=>e.width!==void 0?Math.floor(parseFloat(e.width.toString()))+"px":void 0,j=(e,t)=>t&&t.filter(a=>a.field===e).length>0,N=e=>(e.sort((t,a)=>t.declarationIndex-a.declarationIndex),e.map(t=>{const{declarationIndex:a,parentIndex:i,depth:d,headerColSpan:s,rowSpan:n,index:r,kFirst:o,children:l,...f}=t;return l.length?{children:N(l),...f}:f})),D=e=>{const{filterCell:t,headerCell:a,footerCell:i,cells:d,cell:s,rowSpannable:n,...r}=e;return e.children.length?{...r,children:e.children.map(D)}:r},E=typeof window!="undefined"&&/Firefox/.test(window.navigator.userAgent),F=17895697,H=e=>{let t=[];return e.sortable&&(t=t.concat([x.GridContextMenuItemNames.sortAsc,x.GridContextMenuItemNames.sortDesc])),t},p=e=>{let t=[];return e.clipboard&&(t=t.concat([x.GridContextMenuItemNames.copySelection,x.GridContextMenuItemNames.copySelectionNoHeaders,x.GridContextMenuItemNames.paste])),e.editable&&(t.length&&(t=t.concat([x.GridContextMenuItemNames.separator])),t=t.concat([x.GridContextMenuItemNames.create,x.GridContextMenuItemNames.edit,x.GridContextMenuItemNames.delete])),e.selectable&&(t.length&&(t=t.concat([x.GridContextMenuItemNames.separator])),t=t.concat([x.GridContextMenuItemNames.select])),e.reorderable&&(t.length&&(t=t.concat([x.GridContextMenuItemNames.separator])),t=t.concat([x.GridContextMenuItemNames.reorderRow])),t},$=(e,t)=>{if(!(!e&&!t))return t?e?{...e,...t,select:{...e.select||{},...t.select||{}},hierarchy:{...e.hierarchy||{},...t.hierarchy||{}},group:{...e.group||{},...t.group||{}},edit:{...e.edit||{},...t.edit||{}}}:t:e},z=()=>T.ServerFragment===G.ClientFragment,L=e=>!!(e&&e.$$typeof===Symbol.for("react.client.reference")),V=e=>({id:e.id,ariaColumnIndex:e.ariaColumnIndex,isSelected:e.isSelected,isInEdit:e.isInEdit,isSorted:e.isSorted,isAlt:e.isAlt,expanded:e.expanded,className:e.className,style:e.style,field:e.field,dataItem:e.dataItem,format:e.format,colSpan:e.colSpan,dataIndex:e.dataIndex,columnIndex:e.columnIndex,columnsCount:e.columnsCount,rowType:e.rowType,level:e.level,editor:e.editor,render:e.render,locked:e.locked,isRtl:e.isRtl,rowDataIndex:e.rowDataIndex,columnPosition:e.columnPosition,group:e.group}),W=e=>{var i,d;const t=typeof e=="object"?(i=e.enabled)!=null?i:!0:e!=null?e:!1,a=typeof e=="object"?(d=e.valueGetter)!=null?d:(s,n)=>y.getter(n)(s):(s,n)=>y.getter(n)(s);return{enabled:t,valueGetter:a}};exports.autoGenerateColumns=A;exports.clientColumn=D;exports.firefox=E;exports.firefoxMaxHeight=F;exports.flatData=w;exports.footerColumns=q;exports.getClientCellProps=V;exports.getColSpan=R;exports.getColumnWidth=O;exports.getDefaultBodyContextMenuItems=p;exports.getDefaultHeadContextMenuItems=H;exports.getNestedValue=m;exports.getRowSpanOptions=W;exports.isClient=z;exports.isClientReference=L;exports.isSorted=j;exports.mapColumns=k;exports.readColumns=b;exports.resolveCells=$;exports.sanitizeColumns=N;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("../GridColumn.js"),y=require("@progress/kendo-data-query"),S=require("@progress/kendo-react-data-tools"),T=require("./_serverModule.js"),G=require("./_clientModule.js"),g=require("../contextMenu/enums.js");function m(e,t){const a=(e!=null?e:"").split(".");let i=t;return a.forEach(o=>{i=i?i[o]:void 0}),i}function b(e,t,a,i,o,s,n,r,d,l,f=0,c){var M;let C=f;for(let h=0;h<t.length;h++){let I;if(!o||t[h].value===void 0||t[h].items===void 0){e[e.length]={dataIndex:i.index,dataItem:t[h],rowType:"data",level:f,group:c,expanded:(M=s?m(s,t[h]):l&&!!(n!=null&&n[y.getter(l)(t[h])]))!=null?M:!1},i.index++;continue}else{let u;c!=null&&c.parents?u=[{field:c.field,value:c.value},...c.parents]:c?u=[c]:u=[],I={field:t[h].field,value:t[h].value,parents:u}}C=Math.max(C,f+1);let x=!1;if(s)x=m(s,t[h])!==!1;else{const u=S.findGroupExpand(r||[],I);u?x=u.expanded!==!1:x=d!==!1}e[e.length]={dataIndex:-1,dataItem:t[h],level:f,group:I,rowType:"groupHeader",expanded:x},x&&(I.expanded=x,C=Math.max(b(e,t[h].items,a,i,o,s,n,r,d,l,f+1,I),C)),(a==="always"||x&&a==="visible")&&(e[e.length]={dataIndex:-1,dataItem:t[h],rowType:"groupFooter",level:f,expanded:x})}return C}const k=(e,t)=>typeof e.colSpan=="function"?e.colSpan({dataItem:t,column:e}):e.colSpan||1;function B(e,t){const a=[[]];let i=0;for(let n=e.length-1;n>=0;n--)i=Math.max(i,e[n].depth),e[n].headerColSpan=e[n].headerColSpan||1,e[n].children.length>0&&(e[n].headerColSpan=e[n].children.reduce((r,d)=>d.hidden?r:r+d.headerColSpan,0));const o=[];let s=1;return e.forEach((n,r)=>{a[n.depth]=a[n.depth]||[];let d=!1;a[n.depth].length===0&&(s<=1?s=1+(n.children.length>0?0:i-n.depth):(s--,d=!0)),n.rowSpan=1+(n.children.length>0?0:i-n.depth),n.kFirst=d,n.index=a[n.depth].length,a[n.depth].push(r),n.ariaColumnIndex=o[n.depth]?o[n.depth]+1:1;for(let l=n.depth;l<n.depth+n.rowSpan;l++)o[l]=(o[l]||0)+n.headerColSpan}),S.updateLeft(a,e,t),S.updateRight(a,e,t),a}function w(e,t,a,i=0){const o=[];if(!e)return[];e&&e.length===void 0&&(e=[e]),e.filter(r=>r&&r.props?!r.props.hidden:!r.hidden).forEach((r,d)=>{r=r.props?r.props:r;const l=t[d]||null,f=w(r.children,l&&l.children||[],a,i+1);o.push(Object.assign({depth:i},v.gridDefaultProps,f.length?{cell:()=>null,filterCell:()=>null}:{},l?{width:l.width,orderIndex:l.orderIndex}:{},r,{id:r.id?r.id:S.tableKeyboardNavigationTools.generateNavigatableId(`${a.prevId++}`,a.idPrefix,"column"),declarationIndex:o.length,children:f,headerColSpan:r.headerColSpan,rowSpan:0,columnType:r.columnType||"data",colSpan:r.colSpan||1,isAccessible:!0,left:r.lockedColumn?l&&Math.floor(l.left):null,right:r.lockedColumn?l&&Math.floor(l.right):null,rowSpannable:r.rowSpannable}))});const n=(r,d)=>r.orderIndex===d.orderIndex?r.declarationIndex-d.declarationIndex:(r.orderIndex||0)-(d.orderIndex||0);if(o.sort(n),i===0){const r=[],d=(l,f)=>l.forEach(c=>{c.parentIndex=f,d(c.children,r.push(c)-1)});return d(o,-1),r}return o}const N=e=>Array.isArray(e)?e:e?e.data:[];function E(e,t,a,i){const o=N(e),s=[];if(o.length>0){let n=o[0];if(t)for(let d=0;d<t.length;d++)n=n.items&&n.items[0];Object.getOwnPropertyNames(n).forEach(d=>{d!==a.column&&s.push(Object.assign({id:S.tableKeyboardNavigationTools.generateNavigatableId(`${i.prevId++}`,i.idPrefix,"column"),declarationIndex:-1,parentIndex:-1,depth:0,colSpan:0,headerColSpan:0,rowSpan:0,index:0,columnType:"data",left:0,right:0,rightBorder:!1,children:[],ariaColumnIndex:0,isAccessible:!0},v.gridDefaultProps,{field:d}))})}return s}const R=(e,t)=>{let a=e[t.parentIndex];for(;a;){if(a.footerCell)return!0;a=e[a.parentIndex]}return!1},j=e=>e.filter(t=>R(e,t)?!1:!!t.footerCell||!(t.children&&t.children.length>0)),q=e=>e.width!==void 0?Math.floor(parseFloat(e.width.toString()))+"px":void 0,O=(e,t)=>t&&t.filter(a=>a.field===e).length>0,D=e=>(e.sort((t,a)=>t.declarationIndex-a.declarationIndex),e.map(t=>{const{declarationIndex:a,parentIndex:i,depth:o,headerColSpan:s,rowSpan:n,index:r,kFirst:d,children:l,...f}=t;return l.length?{children:D(l),...f}:f})),A=e=>{const{filterCell:t,headerCell:a,footerCell:i,cells:o,cell:s,rowSpannable:n,...r}=e;return e.children.length?{...r,children:e.children.map(A)}:r},F=typeof window!="undefined"&&/Firefox/.test(window.navigator.userAgent),H=17895697,p=e=>{let t=[];return e.sortable&&(t=t.concat([g.GridContextMenuItemNames.sortAsc,g.GridContextMenuItemNames.sortDesc])),t},$=e=>{let t=[];return e.clipboard&&(t=t.concat([g.GridContextMenuItemNames.copySelection,g.GridContextMenuItemNames.copySelectionNoHeaders,g.GridContextMenuItemNames.paste])),e.editable&&(t.length&&(t=t.concat([g.GridContextMenuItemNames.separator])),t=t.concat([g.GridContextMenuItemNames.create,g.GridContextMenuItemNames.edit,g.GridContextMenuItemNames.delete])),e.selectable&&(t.length&&(t=t.concat([g.GridContextMenuItemNames.separator])),t=t.concat([g.GridContextMenuItemNames.select])),e.rowReorderable&&(t.length&&(t=t.concat([g.GridContextMenuItemNames.separator])),t=t.concat([g.GridContextMenuItemNames.reorderRow])),t},z=(e,t)=>{if(!(!e&&!t))return t?e?{...e,...t,select:{...e.select||{},...t.select||{}},hierarchy:{...e.hierarchy||{},...t.hierarchy||{}},group:{...e.group||{},...t.group||{}},edit:{...e.edit||{},...t.edit||{}}}:t:e},L=e=>{var a;return typeof e=="object"?(a=e.enabled)!=null?a:!0:e!=null?e:!1},V=()=>T.ServerFragment===G.ClientFragment,W=e=>!!(e&&e.$$typeof===Symbol.for("react.client.reference")),_=e=>({id:e.id,ariaColumnIndex:e.ariaColumnIndex,isSelected:e.isSelected,isInEdit:e.isInEdit,isSorted:e.isSorted,isAlt:e.isAlt,expanded:e.expanded,className:e.className,style:e.style,field:e.field,dataItem:e.dataItem,format:e.format,colSpan:e.colSpan,dataIndex:e.dataIndex,columnIndex:e.columnIndex,columnsCount:e.columnsCount,rowType:e.rowType,level:e.level,editor:e.editor,render:e.render,locked:e.locked,isRtl:e.isRtl,rowDataIndex:e.rowDataIndex,columnPosition:e.columnPosition,group:e.group}),K=e=>{var i,o;const t=typeof e=="object"?(i=e.enabled)!=null?i:!0:e!=null?e:!1,a=typeof e=="object"?(o=e.valueGetter)!=null?o:(s,n)=>y.getter(n)(s):(s,n)=>y.getter(n)(s);return{enabled:t,valueGetter:a}};exports.autoGenerateColumns=E;exports.clientColumn=A;exports.firefox=F;exports.firefoxMaxHeight=H;exports.flatData=b;exports.footerColumns=j;exports.getClientCellProps=_;exports.getColSpan=k;exports.getColumnWidth=q;exports.getDataAsArray=N;exports.getDefaultBodyContextMenuItems=$;exports.getDefaultHeadContextMenuItems=p;exports.getNestedValue=m;exports.getRowSpanOptions=K;exports.isClient=V;exports.isClientReference=W;exports.isRowReorderEnabled=L;exports.isSorted=O;exports.mapColumns=B;exports.readColumns=w;exports.resolveCells=z;exports.sanitizeColumns=D;
package/utils/index.mjs CHANGED
@@ -5,69 +5,69 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { gridDefaultProps as u } from "../GridColumn.mjs";
8
+ import { gridDefaultProps as w } from "../GridColumn.mjs";
9
9
  import { getter as y } from "@progress/kendo-data-query";
10
- import { findGroupExpand as M, updateLeft as T, updateRight as A, tableKeyboardNavigationTools as b } from "@progress/kendo-react-data-tools";
11
- import { ServerFragment as D } from "./_serverModule.mjs";
10
+ import { findGroupExpand as M, updateLeft as A, updateRight as D, tableKeyboardNavigationTools as b } from "@progress/kendo-react-data-tools";
11
+ import { ServerFragment as T } from "./_serverModule.mjs";
12
12
  import { ClientFragment as B } from "./_clientModule.mjs";
13
13
  import { GridContextMenuItemNames as g } from "../contextMenu/enums.mjs";
14
- function w(e, t) {
14
+ function u(e, t) {
15
15
  const a = (e != null ? e : "").split(".");
16
16
  let i = t;
17
- return a.forEach((d) => {
18
- i = i ? i[d] : void 0;
17
+ return a.forEach((l) => {
18
+ i = i ? i[l] : void 0;
19
19
  }), i;
20
20
  }
21
- function k(e, t, a, i, d, f, r, n, l, o, h = 0, c) {
21
+ function E(e, t, a, i, l, f, r, n, d, o, h = 0, s) {
22
22
  var v;
23
23
  let C = h;
24
- for (let s = 0; s < t.length; s++) {
24
+ for (let c = 0; c < t.length; c++) {
25
25
  let S;
26
- if (!d || t[s].value === void 0 || t[s].items === void 0) {
26
+ if (!l || t[c].value === void 0 || t[c].items === void 0) {
27
27
  e[e.length] = {
28
28
  dataIndex: i.index,
29
- dataItem: t[s],
29
+ dataItem: t[c],
30
30
  rowType: "data",
31
31
  level: h,
32
- group: c,
32
+ group: s,
33
33
  // This is related to detail-row expansion
34
- expanded: (v = f ? w(f, t[s]) : o && !!(r != null && r[y(o)(t[s])])) != null ? v : !1
34
+ expanded: (v = f ? u(f, t[c]) : o && !!(r != null && r[y(o)(t[c])])) != null ? v : !1
35
35
  }, i.index++;
36
36
  continue;
37
37
  } else {
38
38
  let I;
39
- c != null && c.parents ? I = [{ field: c.field, value: c.value }, ...c.parents] : c ? I = [c] : I = [], S = {
40
- field: t[s].field,
41
- value: t[s].value,
39
+ s != null && s.parents ? I = [{ field: s.field, value: s.value }, ...s.parents] : s ? I = [s] : I = [], S = {
40
+ field: t[c].field,
41
+ value: t[c].value,
42
42
  parents: I
43
43
  };
44
44
  }
45
45
  C = Math.max(C, h + 1);
46
46
  let x = !1;
47
47
  if (f)
48
- x = w(f, t[s]) !== !1;
48
+ x = u(f, t[c]) !== !1;
49
49
  else {
50
50
  const I = M(n || [], S);
51
- I ? x = I.expanded !== !1 : x = l !== !1;
51
+ I ? x = I.expanded !== !1 : x = d !== !1;
52
52
  }
53
53
  e[e.length] = {
54
54
  dataIndex: -1,
55
- dataItem: t[s],
55
+ dataItem: t[c],
56
56
  level: h,
57
57
  group: S,
58
58
  rowType: "groupHeader",
59
59
  expanded: x
60
60
  }, x && (S.expanded = x, C = Math.max(
61
- k(
61
+ E(
62
62
  e,
63
- t[s].items,
63
+ t[c].items,
64
64
  a,
65
65
  i,
66
- d,
66
+ l,
67
67
  f,
68
68
  r,
69
69
  n,
70
- l,
70
+ d,
71
71
  o,
72
72
  h + 1,
73
73
  S
@@ -75,7 +75,7 @@ function k(e, t, a, i, d, f, r, n, l, o, h = 0, c) {
75
75
  C
76
76
  )), (a === "always" || x && a === "visible") && (e[e.length] = {
77
77
  dataIndex: -1,
78
- dataItem: t[s],
78
+ dataItem: t[c],
79
79
  rowType: "groupFooter",
80
80
  level: h,
81
81
  expanded: x
@@ -83,47 +83,47 @@ function k(e, t, a, i, d, f, r, n, l, o, h = 0, c) {
83
83
  }
84
84
  return C;
85
85
  }
86
- const L = (e, t) => typeof e.colSpan == "function" ? e.colSpan({ dataItem: t, column: e }) : e.colSpan || 1;
87
- function q(e, t) {
86
+ const q = (e, t) => typeof e.colSpan == "function" ? e.colSpan({ dataItem: t, column: e }) : e.colSpan || 1;
87
+ function z(e, t) {
88
88
  const a = [[]];
89
89
  let i = 0;
90
90
  for (let r = e.length - 1; r >= 0; r--)
91
91
  i = Math.max(i, e[r].depth), e[r].headerColSpan = e[r].headerColSpan || 1, e[r].children.length > 0 && (e[r].headerColSpan = e[r].children.reduce(
92
- (n, l) => l.hidden ? n : n + l.headerColSpan,
92
+ (n, d) => d.hidden ? n : n + d.headerColSpan,
93
93
  0
94
94
  ));
95
- const d = [];
95
+ const l = [];
96
96
  let f = 1;
97
97
  return e.forEach((r, n) => {
98
98
  a[r.depth] = a[r.depth] || [];
99
- let l = !1;
100
- a[r.depth].length === 0 && (f <= 1 ? f = 1 + (r.children.length > 0 ? 0 : i - r.depth) : (f--, l = !0)), r.rowSpan = 1 + (r.children.length > 0 ? 0 : i - r.depth), r.kFirst = l, r.index = a[r.depth].length, a[r.depth].push(n), r.ariaColumnIndex = d[r.depth] ? d[r.depth] + 1 : 1;
99
+ let d = !1;
100
+ a[r.depth].length === 0 && (f <= 1 ? f = 1 + (r.children.length > 0 ? 0 : i - r.depth) : (f--, d = !0)), r.rowSpan = 1 + (r.children.length > 0 ? 0 : i - r.depth), r.kFirst = d, r.index = a[r.depth].length, a[r.depth].push(n), r.ariaColumnIndex = l[r.depth] ? l[r.depth] + 1 : 1;
101
101
  for (let o = r.depth; o < r.depth + r.rowSpan; o++)
102
- d[o] = (d[o] || 0) + r.headerColSpan;
103
- }), T(a, e, t), A(a, e, t), a;
102
+ l[o] = (l[o] || 0) + r.headerColSpan;
103
+ }), A(a, e, t), D(a, e, t), a;
104
104
  }
105
- function E(e, t, a, i = 0) {
106
- const d = [];
105
+ function j(e, t, a, i = 0) {
106
+ const l = [];
107
107
  if (!e)
108
108
  return [];
109
- e && e.length === void 0 && (e = [e]), e.filter((n) => n && n.props ? !n.props.hidden : !n.hidden).forEach((n, l) => {
109
+ e && e.length === void 0 && (e = [e]), e.filter((n) => n && n.props ? !n.props.hidden : !n.hidden).forEach((n, d) => {
110
110
  n = n.props ? n.props : n;
111
- const o = t[l] || null, h = E(
111
+ const o = t[d] || null, h = j(
112
112
  n.children,
113
113
  o && o.children || [],
114
114
  a,
115
115
  i + 1
116
116
  );
117
- d.push(
117
+ l.push(
118
118
  Object.assign(
119
119
  { depth: i },
120
- u,
120
+ w,
121
121
  h.length ? { cell: () => null, filterCell: () => null } : {},
122
122
  o ? { width: o.width, orderIndex: o.orderIndex } : {},
123
123
  n,
124
124
  {
125
125
  id: n.id ? n.id : b.generateNavigatableId(`${a.prevId++}`, a.idPrefix, "column"),
126
- declarationIndex: d.length,
126
+ declarationIndex: l.length,
127
127
  children: h,
128
128
  headerColSpan: n.headerColSpan,
129
129
  rowSpan: 0,
@@ -137,26 +137,25 @@ function E(e, t, a, i = 0) {
137
137
  )
138
138
  );
139
139
  });
140
- const r = (n, l) => n.orderIndex === l.orderIndex ? n.declarationIndex - l.declarationIndex : (n.orderIndex || 0) - (l.orderIndex || 0);
141
- if (d.sort(r), i === 0) {
142
- const n = [], l = (o, h) => o.forEach((c) => {
143
- c.parentIndex = h, l(c.children, n.push(c) - 1);
140
+ const r = (n, d) => n.orderIndex === d.orderIndex ? n.declarationIndex - d.declarationIndex : (n.orderIndex || 0) - (d.orderIndex || 0);
141
+ if (l.sort(r), i === 0) {
142
+ const n = [], d = (o, h) => o.forEach((s) => {
143
+ s.parentIndex = h, d(s.children, n.push(s) - 1);
144
144
  });
145
- return l(d, -1), n;
145
+ return d(l, -1), n;
146
146
  }
147
- return d;
147
+ return l;
148
148
  }
149
- function z(e, t, a, i) {
150
- let d = [];
151
- Array.isArray(e) ? d = e : e && (d = e.data);
152
- const f = [];
153
- if (d.length > 0) {
154
- let r = d[0];
149
+ const k = (e) => Array.isArray(e) ? e : e ? e.data : [];
150
+ function V(e, t, a, i) {
151
+ const l = k(e), f = [];
152
+ if (l.length > 0) {
153
+ let r = l[0];
155
154
  if (t)
156
- for (let l = 0; l < t.length; l++)
155
+ for (let d = 0; d < t.length; d++)
157
156
  r = r.items && r.items[0];
158
- Object.getOwnPropertyNames(r).forEach((l) => {
159
- l !== a.column && f.push(
157
+ Object.getOwnPropertyNames(r).forEach((d) => {
158
+ d !== a.column && f.push(
160
159
  Object.assign(
161
160
  {
162
161
  id: b.generateNavigatableId(`${i.prevId++}`, i.idPrefix, "column"),
@@ -175,8 +174,8 @@ function z(e, t, a, i) {
175
174
  ariaColumnIndex: 0,
176
175
  isAccessible: !0
177
176
  },
178
- u,
179
- { field: l }
177
+ w,
178
+ { field: d }
180
179
  )
181
180
  );
182
181
  });
@@ -191,22 +190,22 @@ const F = (e, t) => {
191
190
  a = e[a.parentIndex];
192
191
  }
193
192
  return !1;
194
- }, V = (e) => e.filter((t) => F(e, t) ? !1 : !!t.footerCell || !(t.children && t.children.length > 0)), W = (e) => e.width !== void 0 ? Math.floor(parseFloat(e.width.toString())) + "px" : void 0, J = (e, t) => t && t.filter((a) => a.field === e).length > 0, R = (e) => (e.sort((t, a) => t.declarationIndex - a.declarationIndex), e.map((t) => {
195
- const { declarationIndex: a, parentIndex: i, depth: d, headerColSpan: f, rowSpan: r, index: n, kFirst: l, children: o, ...h } = t;
193
+ }, W = (e) => e.filter((t) => F(e, t) ? !1 : !!t.footerCell || !(t.children && t.children.length > 0)), J = (e) => e.width !== void 0 ? Math.floor(parseFloat(e.width.toString())) + "px" : void 0, K = (e, t) => t && t.filter((a) => a.field === e).length > 0, p = (e) => (e.sort((t, a) => t.declarationIndex - a.declarationIndex), e.map((t) => {
194
+ const { declarationIndex: a, parentIndex: i, depth: l, headerColSpan: f, rowSpan: r, index: n, kFirst: d, children: o, ...h } = t;
196
195
  return o.length ? {
197
- children: R(o),
196
+ children: p(o),
198
197
  ...h
199
198
  } : h;
200
- })), j = (e) => {
201
- const { filterCell: t, headerCell: a, footerCell: i, cells: d, cell: f, rowSpannable: r, ...n } = e;
199
+ })), N = (e) => {
200
+ const { filterCell: t, headerCell: a, footerCell: i, cells: l, cell: f, rowSpannable: r, ...n } = e;
202
201
  return e.children.length ? {
203
202
  ...n,
204
- children: e.children.map(j)
203
+ children: e.children.map(N)
205
204
  } : n;
206
- }, K = typeof window != "undefined" && /Firefox/.test(window.navigator.userAgent), Q = 17895697, U = (e) => {
205
+ }, Q = typeof window != "undefined" && /Firefox/.test(window.navigator.userAgent), U = 17895697, X = (e) => {
207
206
  let t = [];
208
207
  return e.sortable && (t = t.concat([g.sortAsc, g.sortDesc])), t;
209
- }, X = (e) => {
208
+ }, Y = (e) => {
210
209
  let t = [];
211
210
  return e.clipboard && (t = t.concat([
212
211
  g.copySelection,
@@ -216,8 +215,8 @@ const F = (e, t) => {
216
215
  g.create,
217
216
  g.edit,
218
217
  g.delete
219
- ])), e.selectable && (t.length && (t = t.concat([g.separator])), t = t.concat([g.select])), e.reorderable && (t.length && (t = t.concat([g.separator])), t = t.concat([g.reorderRow])), t;
220
- }, Y = (e, t) => {
218
+ ])), e.selectable && (t.length && (t = t.concat([g.separator])), t = t.concat([g.select])), e.rowReorderable && (t.length && (t = t.concat([g.separator])), t = t.concat([g.reorderRow])), t;
219
+ }, Z = (e, t) => {
221
220
  if (!(!e && !t))
222
221
  return t ? e ? {
223
222
  ...e,
@@ -239,7 +238,10 @@ const F = (e, t) => {
239
238
  ...t.edit || {}
240
239
  }
241
240
  } : t : e;
242
- }, Z = () => D === B, _ = (e) => !!(e && e.$$typeof === Symbol.for("react.client.reference")), G = (e) => ({
241
+ }, _ = (e) => {
242
+ var a;
243
+ return typeof e == "object" ? (a = e.enabled) != null ? a : !0 : e != null ? e : !1;
244
+ }, G = () => T === B, P = (e) => !!(e && e.$$typeof === Symbol.for("react.client.reference")), ee = (e) => ({
243
245
  id: e.id,
244
246
  ariaColumnIndex: e.ariaColumnIndex,
245
247
  isSelected: e.isSelected,
@@ -265,30 +267,32 @@ const F = (e, t) => {
265
267
  rowDataIndex: e.rowDataIndex,
266
268
  columnPosition: e.columnPosition,
267
269
  group: e.group
268
- }), P = (e) => {
269
- var i, d;
270
- const t = typeof e == "object" ? (i = e.enabled) != null ? i : !0 : e != null ? e : !1, a = typeof e == "object" ? (d = e.valueGetter) != null ? d : (f, r) => y(r)(f) : (f, r) => y(r)(f);
270
+ }), te = (e) => {
271
+ var i, l;
272
+ const t = typeof e == "object" ? (i = e.enabled) != null ? i : !0 : e != null ? e : !1, a = typeof e == "object" ? (l = e.valueGetter) != null ? l : (f, r) => y(r)(f) : (f, r) => y(r)(f);
271
273
  return { enabled: t, valueGetter: a };
272
274
  };
273
275
  export {
274
- z as autoGenerateColumns,
275
- j as clientColumn,
276
- K as firefox,
277
- Q as firefoxMaxHeight,
278
- k as flatData,
279
- V as footerColumns,
280
- G as getClientCellProps,
281
- L as getColSpan,
282
- W as getColumnWidth,
283
- X as getDefaultBodyContextMenuItems,
284
- U as getDefaultHeadContextMenuItems,
285
- w as getNestedValue,
286
- P as getRowSpanOptions,
287
- Z as isClient,
288
- _ as isClientReference,
289
- J as isSorted,
290
- q as mapColumns,
291
- E as readColumns,
292
- Y as resolveCells,
293
- R as sanitizeColumns
276
+ V as autoGenerateColumns,
277
+ N as clientColumn,
278
+ Q as firefox,
279
+ U as firefoxMaxHeight,
280
+ E as flatData,
281
+ W as footerColumns,
282
+ ee as getClientCellProps,
283
+ q as getColSpan,
284
+ J as getColumnWidth,
285
+ k as getDataAsArray,
286
+ Y as getDefaultBodyContextMenuItems,
287
+ X as getDefaultHeadContextMenuItems,
288
+ u as getNestedValue,
289
+ te as getRowSpanOptions,
290
+ G as isClient,
291
+ P as isClientReference,
292
+ _ as isRowReorderEnabled,
293
+ K as isSorted,
294
+ z as mapColumns,
295
+ j as readColumns,
296
+ Z as resolveCells,
297
+ p as sanitizeColumns
294
298
  };