@progress/kendo-vue-grid 8.0.3-develop.3 → 8.1.0-develop.1

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 (60) hide show
  1. package/Grid.d.ts +18 -2
  2. package/Grid.js +1 -1
  3. package/Grid.mjs +655 -511
  4. package/GridNav.d.ts +12 -2
  5. package/GridNav.js +1 -1
  6. package/GridNav.mjs +52 -24
  7. package/GridState.d.ts +12 -5
  8. package/GridState.js +1 -1
  9. package/GridState.mjs +84 -77
  10. package/RootGrid.d.ts +6 -0
  11. package/RootGrid.js +1 -1
  12. package/RootGrid.mjs +25 -25
  13. package/StatusBar.d.ts +55 -5
  14. package/StatusBar.js +8 -0
  15. package/StatusBar.mjs +81 -0
  16. package/cells/GridCell.d.ts +3 -0
  17. package/cells/GridCell.js +1 -1
  18. package/cells/GridCell.mjs +32 -29
  19. package/cells/GridEditCell.d.ts +2 -0
  20. package/cells/GridEditCell.js +1 -1
  21. package/cells/GridEditCell.mjs +1 -0
  22. package/cells/GridSelectionCell.js +1 -1
  23. package/cells/GridSelectionCell.mjs +16 -16
  24. package/common.d.ts +3 -0
  25. package/common.js +1 -1
  26. package/common.mjs +3 -0
  27. package/components/table/GridTable.d.ts +18 -0
  28. package/components/table/GridTable.js +8 -0
  29. package/components/table/GridTable.mjs +41 -0
  30. package/components/table/GridTableScrollable.d.ts +20 -0
  31. package/components/table/GridTableScrollable.js +8 -0
  32. package/components/table/GridTableScrollable.mjs +45 -0
  33. package/dist/cdn/js/kendo-vue-grid.js +1 -1
  34. package/drag/ColumnDraggable.js +1 -1
  35. package/drag/ColumnDraggable.mjs +5 -4
  36. package/header/FilterRow.d.ts +3 -0
  37. package/header/FilterRow.js +1 -1
  38. package/header/FilterRow.mjs +46 -44
  39. package/header/Header.d.ts +5 -2
  40. package/header/Header.js +1 -1
  41. package/header/Header.mjs +10 -5
  42. package/header/HeaderRow.d.ts +3 -0
  43. package/header/HeaderRow.js +1 -1
  44. package/header/HeaderRow.mjs +148 -139
  45. package/index.d.mts +1 -0
  46. package/index.d.ts +1 -0
  47. package/index.js +1 -1
  48. package/index.mjs +20 -16
  49. package/interfaces/GridCellProps.d.ts +11 -0
  50. package/interfaces/GridColumnProps.d.ts +10 -6
  51. package/interfaces/GridProps.d.ts +31 -3
  52. package/interfaces/events.d.ts +26 -3
  53. package/package-metadata.js +1 -1
  54. package/package-metadata.mjs +2 -2
  55. package/package.json +12 -12
  56. package/utils/main.js +1 -1
  57. package/utils/main.mjs +68 -67
  58. package/utils/virtualColumns.d.ts +17 -0
  59. package/utils/virtualColumns.js +1 -1
  60. package/utils/virtualColumns.mjs +132 -39
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import { SortDescriptor, CompositeFilterDescriptor, GroupDescriptor, State } from '@progress/kendo-data-query';
9
9
  import { GridColumnProps } from './GridColumnProps';
10
- import { DetailExpandDescriptor, GroupExpandDescriptor } from '@progress/kendo-vue-data-tools';
10
+ import { DetailExpandDescriptor, GroupExpandDescriptor, SelectDescriptor, TableDragSelectionReleaseEvent, TableSelectionChangeEvent } from '@progress/kendo-vue-data-tools';
11
11
  import { GridColumnState } from './GridColumnState';
12
12
  import { GridHandle } from '../RootGrid';
13
13
  import { GridState } from '../GridState';
@@ -25,7 +25,7 @@ export interface GridEvent {
25
25
  /**
26
26
  * A specific native DOM event which is fetched by Vue.
27
27
  */
28
- event?: any;
28
+ event: any;
29
29
  }
30
30
  /**
31
31
  * Represents the object of the `onSearchChange` Grid event.
@@ -46,6 +46,9 @@ export interface GridPageChangeEvent extends GridEvent {
46
46
  */
47
47
  event: any;
48
48
  }
49
+ /** @hidden */
50
+ export interface GridDragSelectionReleaseEvent extends TableDragSelectionReleaseEvent {
51
+ }
49
52
  /**
50
53
  * The returned type of the `onDataStateChange` event.
51
54
  */
@@ -126,11 +129,23 @@ export interface GridExpandChangeEvent extends GridEvent {
126
129
  /**
127
130
  * Represents the object of the `onSelectionChange` event.
128
131
  */
129
- export interface GridSelectionChangeEvent extends GridEvent {
132
+ export interface GridSelectionChangeEvent extends GridEvent, TableSelectionChangeEvent {
130
133
  /**
131
134
  * The data item which was selected or deselected by the user.
132
135
  */
133
136
  dataItem: any;
137
+ /**
138
+ * The new [SelectDescriptor](https://www.telerik.com/kendo-react-ui/components/datatools/api/selectdescriptor) based on the user action.
139
+ */
140
+ select: SelectDescriptor;
141
+ /**
142
+ * The dataItem from which the selection starts(Valid for scenarios without checkbox selection).
143
+ */
144
+ startDataItem?: any;
145
+ /**
146
+ * The dataItem to which the selection ends(Valid for scenarios without checkbox selection)
147
+ */
148
+ endDataItem?: any;
134
149
  }
135
150
  /**
136
151
  * Represents the object of the `onItemChange` event.
@@ -153,10 +168,18 @@ export interface GridItemChangeEvent extends GridEvent {
153
168
  * Represents the object of the `onHeaderSelectionChange` event.
154
169
  */
155
170
  export interface GridHeaderSelectionChangeEvent extends GridEvent {
171
+ /**
172
+ * The new [SelectDescriptor](https://www.telerik.com/kendo-react-ui/components/datatools/api/selectdescriptor) based on the user action.
173
+ */
174
+ select: SelectDescriptor;
156
175
  /**
157
176
  * The field of the column in which the cell is located.
158
177
  */
159
178
  field?: string;
179
+ /**
180
+ * The current Grid leaf data items.
181
+ */
182
+ dataItems: any[];
160
183
  }
161
184
  /**
162
185
  * Represents the object of the `GridKeyDownEvent` Grid event.
@@ -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-vue-grid",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate: 1773401782,version:"8.0.3-develop.3",licensingDocsUrl:"https://www.telerik.com/kendo-vue-ui/my-license/"};exports.packageMetadata=e;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-vue-grid",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate: 1773767206,version:"8.1.0-develop.1",licensingDocsUrl:"https://www.telerik.com/kendo-vue-ui/my-license/"};exports.packageMetadata=e;
@@ -10,8 +10,8 @@ const e = {
10
10
  productName: "Kendo UI for Vue",
11
11
  productCode: "KENDOUIVUE",
12
12
  productCodes: ["KENDOUIVUE"],
13
- publishDate: 1773401782,
14
- version: "8.0.3-develop.3",
13
+ publishDate: 1773767206,
14
+ version: "8.1.0-develop.1",
15
15
  licensingDocsUrl: "https://www.telerik.com/kendo-vue-ui/my-license/"
16
16
  };
17
17
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-vue-grid",
3
- "version": "8.0.3-develop.3",
3
+ "version": "8.1.0-develop.1",
4
4
  "description": "TODO",
5
5
  "author": "Progress",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -27,16 +27,16 @@
27
27
  "@progress/kendo-data-query": "^1.7.0",
28
28
  "@progress/kendo-drawing": "^1.21.1",
29
29
  "@progress/kendo-licensing": "^1.7.2",
30
- "@progress/kendo-vue-animation": "8.0.3-develop.3",
31
- "@progress/kendo-vue-buttons": "8.0.3-develop.3",
32
- "@progress/kendo-vue-common": "8.0.3-develop.3",
33
- "@progress/kendo-vue-data-tools": "8.0.3-develop.3",
34
- "@progress/kendo-vue-dateinputs": "8.0.3-develop.3",
35
- "@progress/kendo-vue-indicators": "8.0.3-develop.3",
36
- "@progress/kendo-vue-dropdowns": "8.0.3-develop.3",
37
- "@progress/kendo-vue-inputs": "8.0.3-develop.3",
38
- "@progress/kendo-vue-intl": "8.0.3-develop.3",
39
- "@progress/kendo-vue-popup": "8.0.3-develop.3",
30
+ "@progress/kendo-vue-animation": "8.1.0-develop.1",
31
+ "@progress/kendo-vue-buttons": "8.1.0-develop.1",
32
+ "@progress/kendo-vue-common": "8.1.0-develop.1",
33
+ "@progress/kendo-vue-data-tools": "8.1.0-develop.1",
34
+ "@progress/kendo-vue-dateinputs": "8.1.0-develop.1",
35
+ "@progress/kendo-vue-indicators": "8.1.0-develop.1",
36
+ "@progress/kendo-vue-dropdowns": "8.1.0-develop.1",
37
+ "@progress/kendo-vue-inputs": "8.1.0-develop.1",
38
+ "@progress/kendo-vue-intl": "8.1.0-develop.1",
39
+ "@progress/kendo-vue-popup": "8.1.0-develop.1",
40
40
  "@progress/kendo-svg-icons": "^4.4.0",
41
41
  "vue": "^3.0.2"
42
42
  },
@@ -57,7 +57,7 @@
57
57
  "package": {
58
58
  "productName": "Kendo UI for Vue",
59
59
  "productCode": "KENDOUIVUE",
60
- "publishDate": 1773401782,
60
+ "publishDate": 1773767206,
61
61
  "licensingDocsUrl": "https://www.telerik.com/kendo-vue-ui/my-license/"
62
62
  }
63
63
  },
package/utils/main.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 w=require("@progress/kendo-vue-data-tools"),I=require("@progress/kendo-vue-common"),D=require("../GridColumn.js"),y="string";function v(e,t){const n=e.split(".");let i=t;return n.forEach(a=>{i=i?i[a]:void 0}),i}function R(e,t,n,i,a,s,r,o,d,h,p=0,f){let c=p;for(let g=0;g<t.length;g++){let l;if(!a||t[g].value===void 0||t[g].items===void 0){const C=d?!!(s!=null&&s[I.getter(d)(t[g])]):!1;e[e.length]={dataIndex:i.index,dataItem:t[g],rowType:"data",level:p,group:f,expanded:h!==void 0?v(h,t[g]):C!=null?C:!1},i.index++;continue}else{let C;f!=null&&f.parents?C=[{field:f.field,value:f.value},...f.parents]:f?C=[f]:C=[],l={field:t[g].field,value:t[g].value,parents:C}}c=Math.max(c,p+1);let x=!1;const u=w.findGroupExpand(r||[],l);h?x=h===void 0||v(h,t[g])===void 0||v(h,t[g]):x=u?u.expanded!==!1:o!==!1,e[e.length]={dataIndex:-1,dataItem:t[g],level:p,group:l,rowType:"groupHeader",expanded:x},x&&(l.expanded=x,c=Math.max(R(e,t[g].items,n,i,a,s,r,o,d,h,p+1,l),c)),(n==="always"||x&&n==="visible")&&(e[e.length]={dataIndex:-1,dataItem:t[g],rowType:"groupFooter",level:p,expanded:x})}return c}function O(e){return e&&getComputedStyle(e).direction==="rtl"||!1}function N(e,t){if(!t||!e||!e.originalEvent||!I.canUseDOM)return-1;let n=document.elementFromPoint(e.clientX,e.originalEvent.clientY);for(;n&&n.parentElement!==t;)n=n.parentElement;const i=t.children;for(let a=0;a<i.length;a++)if(i[a]===n)return a;return-1}const A=["sortChange","filterChange","groupChange","pageChange","expandChange","selectionChange","headerSelectionChange","rowClick","itemChange","dataStateChange","columnResize","columnReorder"],H=(e,t)=>`The ${e} event handler property is deprecated, use https://www.telerik.com/kendo-vue-ui/components/grid/api/GridProps/#toc-${t} instead`;function L(e){for(let t=0;t<A.length;t++){const n=A[t];if(e[n]!==void 0){const i="on"+n.charAt(0).toUpperCase()+n.slice(1);console.warn(H(n,i))}}}function V(e,t){const n=[[]];let i=0;for(let r=e.length-1;r>=0;r--)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((o,d)=>d.hidden?o:o+d.headerColSpan,0));const a=[];let s=1;return e.forEach((r,o)=>{n[r.depth]=n[r.depth]||[];let d=!1;n[r.depth].length===0&&(s<=1?s=1+(r.children.length>0?0:i-r.depth):(s--,d=!0)),r.rowSpan=1+(r.children.length>0?0:i-r.depth),r.kFirst=d,r.index=n[r.depth].length,r.ariaColumnIndex=a[r.depth]?a[r.depth]+1:1;let h=0;const p=[],f=new Set;let c=r.parentIndex;for(;c>=0&&!f.has(c);)f.add(c),p.unshift(c),c=e[c].parentIndex;for(let l=0;l<p.length;l++){const x=p[l],u=e[x],C=n[u.depth],E=C.indexOf(x);for(let S=0;S<E;S++){const m=C[S];h+=e[m].headerColSpan}}for(let l=0;l<r.depth;l++){const x=n[l]||[];for(const u of x){const C=e[u];C.depth+C.rowSpan-1>=r.depth&&(p.includes(u)||(h+=C.headerColSpan))}}const g=n[r.depth];for(const l of g){const x=e[l];x.parentIndex===r.parentIndex&&(h+=x.headerColSpan)}r.virtualColumnOffset=h,n[r.depth].push(o);for(let l=r.depth;l<r.depth+r.rowSpan;l++)a[l]=(a[l]||0)+r.headerColSpan}),w.updateLeft(n,e,t),w.updateRight(n,e,t),n}function M(e,t,n,i=0,a=!1){const s=[];if(!e)return[];e&&e.length===void 0&&(e=[e]),e.forEach((o,d)=>{o=o;const h=o.id?o.id:w.tableKeyboardNavigationTools.generateNavigatableId(`${n.prevId++}`,n.idPrefix,"column"),p=I.canUseDOM&&o.media&&window.matchMedia?!window.matchMedia(o.media).matches:!1,f=a||p||o.hidden,c=t==null?void 0:t.find(l=>l.id===h),g=M(o.children,(c==null?void 0:c.children)||[],n,i+1,f);s.push({depth:i,...D.gridDefaultProps,...g.length?{cell:()=>null,filterCell:()=>null}:{},...o,id:h,declarationIndex:s.length,children:g,headerColSpan:0,rowSpan:0,columnType:o.columnType||"data",colSpan:o.colSpan||1,isAccessible:!0,hidden:f,left:null,right:null,rowSpannable:o.rowSpannable,...c?{width:c.width,orderIndex:c.orderIndex}:{}})});const r=(o,d)=>o.orderIndex===d.orderIndex?o.declarationIndex-d.declarationIndex:(o.orderIndex||0)-(d.orderIndex||0);if(s.sort(r),i===0){const o=[],d=(h,p)=>h.forEach(f=>{f.parentIndex=p,d(f.children,o.push(f)-1)});return d(s,-1),o}return s}const T=e=>Array.isArray(e)?e:e?e.data:[];function j(e,t,n,i){const a=T(e),s=[];if(a.length>0){let r=a[0];if(t)for(let d=0;d<t.length;d++)r=r.items&&r.items[0];Object.getOwnPropertyNames(r).forEach(d=>{d!==n.column&&s.push({id:w.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,...D.gridDefaultProps,field:d})})}return s}const K=(e,t)=>{let n=e[t.parentIndex];for(;n;){if(n.footerCell)return!0;n=e[n.parentIndex]}return!1},P=e=>e.filter(t=>K(e,t)?!1:!!t.footerCell||!(t.children&&t.children.length>0)),$={number:function(e,t,n){return typeof e===y&&e.toLowerCase()==="null"?null:t.parseNumber(e,n)},date:function(e,t,n){return typeof e===y&&e.toLowerCase()==="null"?null:t.parseDate(e,n)},boolean:function(e){return typeof e===y?e.toLowerCase()==="null"?null:e.toLowerCase()==="true":e!=null?!!e:e},string:function(e){return typeof e===y&&e.toLowerCase()==="null"?null:e!=null?e+"":e},default:function(e){return e}};function F(e,t,n,i){return e.forEach(a=>{a.expanded=t[i]&&!t[i].includes(b(a,n)),a.items&&a.items.length&&(a.items=F(a.items,t,n,i+1))}),e}function z(e,t,n){return t&&t.length&&e.data.forEach(i=>{i.expanded=i.expanded!==void 0?i.expanded:t[0]&&!t[0].includes(b(i,n)),i.items&&i.items.length&&(i.items=F(i.items,t,n,1))}),e}function b(e,t){let n=e;for(;n.items&&n.items.length;)n=n.items[0];return t?n[t]:e.value}const B=e=>{const t=[],n=i=>i==null?void 0:i.forEach(a=>{t.push(a),n(a.children)});return n(e),t},U=typeof window!="undefined"&&/Firefox/.test(window.navigator.userAgent),q=17895697,W=e=>e.width!==void 0?Math.floor(parseFloat(e.width.toString()))+"px":void 0,X=(e,t)=>t&&t.filter(n=>n.field===e).length>0,k=e=>(e.sort((t,n)=>t.declarationIndex-n.declarationIndex),e.map(t=>{const{declarationIndex:n,parentIndex:i,depth:a,headerColSpan:s,rowSpan:r,index:o,kFirst:d,children:h,...p}=t;return h.length?{children:k(h),...p}:p})),Y=(e,t)=>typeof e.colSpan=="function"?e.colSpan({dataItem:t,column:e}):e.colSpan||1,J=e=>{var i,a;const t=typeof e=="object"?(i=e.enabled)!=null?i:!0:e!=null?e:!1,n=typeof e=="object"?(a=e.valueGetter)!=null?a:((s,r)=>I.getter(r)(s)):(s,r)=>I.getter(r)(s);return{enabled:t,valueGetter:n}},Q=e=>{let t=0;if(e){const n=e.insertRow(0),i=n.insertCell(0);i.textContent="&nbsp;",t=n.getBoundingClientRect().height,e.deleteRow(0)}return t};exports.applyExpandedState=z;exports.autoGenerateColumns=j;exports.calcRowHeight=Q;exports.checkPropCompatibility=L;exports.firefox=U;exports.firefoxMaxHeight=q;exports.flatData=R;exports.footerColumns=P;exports.getColSpan=Y;exports.getColumnWidth=W;exports.getDataAsArray=T;exports.getFlatColumnsState=B;exports.getIndex=N;exports.getNestedValue=v;exports.getRowSpanOptions=J;exports.groupedFirstItemValue=b;exports.isRtl=O;exports.isSorted=X;exports.mapColumns=V;exports.parsers=$;exports.readColumns=M;exports.sanitizeColumns=k;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("@progress/kendo-vue-data-tools"),y=require("@progress/kendo-vue-common"),D=require("../GridColumn.js"),b="string";function E(e,t){const n=e.split(".");let i=t;return n.forEach(a=>{i=i?i[a]:void 0}),i}function M(e,t,n,i,a,s,r,o,d,h,p=0,f){let c=p;for(let g=0;g<t.length;g++){let l;if(!a||t[g].value===void 0||t[g].items===void 0){const C=d?!!(s!=null&&s[y.getter(d)(t[g])]):!1;e[e.length]={dataIndex:i.index,dataItem:t[g],rowType:"data",level:p,group:f,expanded:h!==void 0?E(h,t[g]):C!=null?C:!1},i.index++;continue}else{let C;f!=null&&f.parents?C=[{field:f.field,value:f.value},...f.parents]:f?C=[f]:C=[],l={field:t[g].field,value:t[g].value,parents:C}}c=Math.max(c,p+1);let x=!1;const I=S.findGroupExpand(r||[],l);h?x=h===void 0||E(h,t[g])===void 0||E(h,t[g]):x=I?I.expanded!==!1:o!==!1,e[e.length]={dataIndex:-1,dataItem:t[g],level:p,group:l,rowType:"groupHeader",expanded:x},x&&(l.expanded=x,c=Math.max(M(e,t[g].items,n,i,a,s,r,o,d,h,p+1,l),c)),(n==="always"||x&&n==="visible")&&(e[e.length]={dataIndex:-1,dataItem:t[g],rowType:"groupFooter",level:p,expanded:x})}return c}function m(e){return e&&getComputedStyle(e).direction==="rtl"||!1}function N(e,t){if(!t||!e||!e.originalEvent||!y.canUseDOM)return-1;let n=document.elementFromPoint(e.clientX,e.originalEvent.clientY);for(;n&&n.parentElement!==t;)n=n.parentElement;const i=t.children;for(let a=0;a<i.length;a++)if(i[a]===n)return a;return-1}const A=["sortChange","filterChange","groupChange","pageChange","expandChange","selectionChange","headerSelectionChange","rowClick","itemChange","dataStateChange","columnResize","columnReorder"],H=(e,t)=>`The ${e} event handler property is deprecated, use https://www.telerik.com/kendo-vue-ui/components/grid/api/GridProps/#toc-${t} instead`;function L(e){for(let t=0;t<A.length;t++){const n=A[t];if(e[n]!==void 0){const i="on"+n.charAt(0).toUpperCase()+n.slice(1);console.warn(H(n,i))}}}function P(e,t){const n=[[]];let i=0;for(let r=e.length-1;r>=0;r--)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((o,d)=>d.hidden?o:o+d.headerColSpan,0));const a=[];let s=1;return e.forEach((r,o)=>{n[r.depth]=n[r.depth]||[];let d=!1;n[r.depth].length===0&&(s<=1?s=1+(r.children.length>0?0:i-r.depth):(s--,d=!0)),r.rowSpan=1+(r.children.length>0?0:i-r.depth),r.kFirst=d,r.index=n[r.depth].length,r.ariaColumnIndex=a[r.depth]?a[r.depth]+1:1;let h=0;const p=[],f=new Set;let c=r.parentIndex;for(;c>=0&&!f.has(c);)f.add(c),p.unshift(c),c=e[c].parentIndex;for(let l=0;l<p.length;l++){const x=p[l],I=e[x],C=n[I.depth],v=C.indexOf(x);for(let u=0;u<v;u++){const w=C[u];h+=e[w].headerColSpan}}for(let l=0;l<r.depth;l++){const x=n[l]||[],C=(n[r.depth]||[]).indexOf(o);let v=0;for(const u of x){const w=e[u];v<C&&w.depth+w.rowSpan-1>=r.depth&&(p.includes(u)||(h+=w.headerColSpan)),v+=w.headerColSpan}}const g=n[r.depth];for(const l of g){const x=e[l];x.parentIndex===r.parentIndex&&(h+=x.headerColSpan)}r.virtualColumnOffset=h,n[r.depth].push(o);for(let l=r.depth;l<r.depth+r.rowSpan;l++)a[l]=(a[l]||0)+r.headerColSpan}),S.updateLeft(n,e,t),S.updateRight(n,e,t),n}function T(e,t,n,i=0,a=!1){const s=[];if(!e)return[];e&&e.length===void 0&&(e=[e]),e.forEach((o,d)=>{o=o;const h=o.id?o.id:S.tableKeyboardNavigationTools.generateNavigatableId(`${n.prevId++}`,n.idPrefix,"column"),p=y.canUseDOM&&o.media&&window.matchMedia?!window.matchMedia(o.media).matches:!1,f=a||p||o.hidden,c=t==null?void 0:t.find(l=>l.id===h),g=T(o.children,(c==null?void 0:c.children)||[],n,i+1,f);s.push({depth:i,...D.gridDefaultProps,...g.length?{cell:()=>null,filterCell:()=>null}:{},...o,id:h,declarationIndex:s.length,children:g,headerColSpan:0,rowSpan:0,columnType:o.columnType||"data",colSpan:o.colSpan||1,isAccessible:!0,hidden:f,left:null,right:null,rowSpannable:o.rowSpannable,...c?{width:c.width,orderIndex:c.orderIndex}:{}})});const r=(o,d)=>o.orderIndex===d.orderIndex?o.declarationIndex-d.declarationIndex:(o.orderIndex||0)-(d.orderIndex||0);if(s.sort(r),i===0){const o=[],d=(h,p)=>h.forEach(f=>{f.parentIndex=p,d(f.children,o.push(f)-1)});return d(s,-1),o}return s}const F=e=>Array.isArray(e)?e:e?e.data:[];function V(e,t,n,i){const a=F(e),s=[];if(a.length>0){let r=a[0];if(t)for(let d=0;d<t.length;d++)r=r.items&&r.items[0];Object.getOwnPropertyNames(r).forEach(d=>{d!==n.column&&s.push({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,...D.gridDefaultProps,field:d})})}return s}const j=(e,t)=>{let n=e[t.parentIndex];for(;n;){if(n.footerCell)return!0;n=e[n.parentIndex]}return!1},K=e=>e.filter(t=>j(e,t)?!1:!!t.footerCell||!(t.children&&t.children.length>0)),$={number:function(e,t,n){return typeof e===b&&e.toLowerCase()==="null"?null:t.parseNumber(e,n)},date:function(e,t,n){return typeof e===b&&e.toLowerCase()==="null"?null:t.parseDate(e,n)},boolean:function(e){return typeof e===b?e.toLowerCase()==="null"?null:e.toLowerCase()==="true":e!=null?!!e:e},string:function(e){return typeof e===b&&e.toLowerCase()==="null"?null:e!=null?e+"":e},default:function(e){return e}};function O(e,t,n,i){return e.forEach(a=>{a.expanded=t[i]&&!t[i].includes(R(a,n)),a.items&&a.items.length&&(a.items=O(a.items,t,n,i+1))}),e}function z(e,t,n){return t&&t.length&&e.data.forEach(i=>{i.expanded=i.expanded!==void 0?i.expanded:t[0]&&!t[0].includes(R(i,n)),i.items&&i.items.length&&(i.items=O(i.items,t,n,1))}),e}function R(e,t){let n=e;for(;n.items&&n.items.length;)n=n.items[0];return t?n[t]:e.value}const B=e=>{const t=[],n=i=>i==null?void 0:i.forEach(a=>{t.push(a),n(a.children)});return n(e),t},U=typeof window!="undefined"&&/Firefox/.test(window.navigator.userAgent),q=17895697,W=e=>e.width!==void 0?Math.floor(parseFloat(e.width.toString()))+"px":void 0,X=(e,t)=>t&&t.filter(n=>n.field===e).length>0,k=e=>(e.sort((t,n)=>t.declarationIndex-n.declarationIndex),e.map(t=>{const{declarationIndex:n,parentIndex:i,depth:a,headerColSpan:s,rowSpan:r,index:o,kFirst:d,children:h,...p}=t;return h.length?{children:k(h),...p}:p})),Y=(e,t)=>typeof e.colSpan=="function"?e.colSpan({dataItem:t,column:e}):e.colSpan||1,J=e=>{var i,a;const t=typeof e=="object"?(i=e.enabled)!=null?i:!0:e!=null?e:!1,n=typeof e=="object"?(a=e.valueGetter)!=null?a:((s,r)=>y.getter(r)(s)):(s,r)=>y.getter(r)(s);return{enabled:t,valueGetter:n}},Q=e=>{let t=0;if(e){const n=e.insertRow(0),i=n.insertCell(0);i.textContent="&nbsp;",t=n.getBoundingClientRect().height,e.deleteRow(0)}return t};exports.applyExpandedState=z;exports.autoGenerateColumns=V;exports.calcRowHeight=Q;exports.checkPropCompatibility=L;exports.firefox=U;exports.firefoxMaxHeight=q;exports.flatData=M;exports.footerColumns=K;exports.getColSpan=Y;exports.getColumnWidth=W;exports.getDataAsArray=F;exports.getFlatColumnsState=B;exports.getIndex=N;exports.getNestedValue=E;exports.getRowSpanOptions=J;exports.groupedFirstItemValue=R;exports.isRtl=m;exports.isSorted=X;exports.mapColumns=P;exports.parsers=$;exports.readColumns=T;exports.sanitizeColumns=k;
package/utils/main.mjs CHANGED
@@ -5,23 +5,23 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { findGroupExpand as T, updateLeft as k, updateRight as L, tableKeyboardNavigationTools as A } from "@progress/kendo-vue-data-tools";
9
- import { getter as S, canUseDOM as b } from "@progress/kendo-vue-common";
10
- import { gridDefaultProps as R } from "../GridColumn.mjs";
11
- const u = "string";
12
- function y(e, t) {
8
+ import { findGroupExpand as T, updateLeft as O, updateRight as k, tableKeyboardNavigationTools as R } from "@progress/kendo-vue-data-tools";
9
+ import { getter as E, canUseDOM as b } from "@progress/kendo-vue-common";
10
+ import { gridDefaultProps as M } from "../GridColumn.mjs";
11
+ const y = "string";
12
+ function v(e, t) {
13
13
  const n = e.split(".");
14
14
  let i = t;
15
15
  return n.forEach((a) => {
16
16
  i = i ? i[a] : void 0;
17
17
  }), i;
18
18
  }
19
- function N(e, t, n, i, a, s, r, d, o, h, p = 0, f) {
19
+ function L(e, t, n, i, a, s, r, d, o, h, p = 0, f) {
20
20
  let c = p;
21
21
  for (let g = 0; g < t.length; g++) {
22
22
  let l;
23
23
  if (!a || t[g].value === void 0 || t[g].items === void 0) {
24
- const C = o ? !!(s != null && s[S(o)(t[g])]) : !1;
24
+ const C = o ? !!(s != null && s[E(o)(t[g])]) : !1;
25
25
  e[e.length] = {
26
26
  dataIndex: i.index,
27
27
  dataItem: t[g],
@@ -29,7 +29,7 @@ function N(e, t, n, i, a, s, r, d, o, h, p = 0, f) {
29
29
  level: p,
30
30
  group: f,
31
31
  // This is related to detail-row expansion
32
- expanded: h !== void 0 ? y(h, t[g]) : C != null ? C : !1
32
+ expanded: h !== void 0 ? v(h, t[g]) : C != null ? C : !1
33
33
  }, i.index++;
34
34
  continue;
35
35
  } else {
@@ -42,8 +42,8 @@ function N(e, t, n, i, a, s, r, d, o, h, p = 0, f) {
42
42
  }
43
43
  c = Math.max(c, p + 1);
44
44
  let x = !1;
45
- const w = T(r || [], l);
46
- h ? x = h === void 0 || y(h, t[g]) === void 0 || y(h, t[g]) : x = w ? w.expanded !== !1 : d !== !1, e[e.length] = {
45
+ const u = T(r || [], l);
46
+ h ? x = h === void 0 || v(h, t[g]) === void 0 || v(h, t[g]) : x = u ? u.expanded !== !1 : d !== !1, e[e.length] = {
47
47
  dataIndex: -1,
48
48
  dataItem: t[g],
49
49
  level: p,
@@ -51,7 +51,7 @@ function N(e, t, n, i, a, s, r, d, o, h, p = 0, f) {
51
51
  rowType: "groupHeader",
52
52
  expanded: x
53
53
  }, x && (l.expanded = x, c = Math.max(
54
- N(
54
+ L(
55
55
  e,
56
56
  t[g].items,
57
57
  n,
@@ -76,10 +76,10 @@ function N(e, t, n, i, a, s, r, d, o, h, p = 0, f) {
76
76
  }
77
77
  return c;
78
78
  }
79
- function U(e) {
79
+ function m(e) {
80
80
  return e && getComputedStyle(e).direction === "rtl" || !1;
81
81
  }
82
- function V(e, t) {
82
+ function W(e, t) {
83
83
  if (!t || !e || !e.originalEvent || !b)
84
84
  return -1;
85
85
  let n = document.elementFromPoint(e.clientX, e.originalEvent.clientY);
@@ -91,7 +91,7 @@ function V(e, t) {
91
91
  return a;
92
92
  return -1;
93
93
  }
94
- const E = [
94
+ const A = [
95
95
  "sortChange",
96
96
  "filterChange",
97
97
  "groupChange",
@@ -104,17 +104,17 @@ const E = [
104
104
  "dataStateChange",
105
105
  "columnResize",
106
106
  "columnReorder"
107
- ], O = (e, t) => `The ${e} event handler property is deprecated, use https://www.telerik.com/kendo-vue-ui/components/grid/api/GridProps/#toc-${t} instead`;
108
- function P(e) {
109
- for (let t = 0; t < E.length; t++) {
110
- const n = E[t];
107
+ ], N = (e, t) => `The ${e} event handler property is deprecated, use https://www.telerik.com/kendo-vue-ui/components/grid/api/GridProps/#toc-${t} instead`;
108
+ function X(e) {
109
+ for (let t = 0; t < A.length; t++) {
110
+ const n = A[t];
111
111
  if (e[n] !== void 0) {
112
112
  const i = "on" + n.charAt(0).toUpperCase() + n.slice(1);
113
- console.warn(O(n, i));
113
+ console.warn(N(n, i));
114
114
  }
115
115
  }
116
116
  }
117
- function W(e, t) {
117
+ function Y(e, t) {
118
118
  const n = [[]];
119
119
  let i = 0;
120
120
  for (let r = e.length - 1; r >= 0; r--)
@@ -134,17 +134,18 @@ function W(e, t) {
134
134
  for (; c >= 0 && !f.has(c); )
135
135
  f.add(c), p.unshift(c), c = e[c].parentIndex;
136
136
  for (let l = 0; l < p.length; l++) {
137
- const x = p[l], w = e[x], C = n[w.depth], v = C.indexOf(x);
138
- for (let I = 0; I < v; I++) {
139
- const F = C[I];
140
- h += e[F].headerColSpan;
137
+ const x = p[l], u = e[x], C = n[u.depth], S = C.indexOf(x);
138
+ for (let w = 0; w < S; w++) {
139
+ const I = C[w];
140
+ h += e[I].headerColSpan;
141
141
  }
142
142
  }
143
143
  for (let l = 0; l < r.depth; l++) {
144
- const x = n[l] || [];
144
+ const x = n[l] || [], C = (n[r.depth] || []).indexOf(d);
145
+ let S = 0;
145
146
  for (const w of x) {
146
- const C = e[w];
147
- C.depth + C.rowSpan - 1 >= r.depth && (p.includes(w) || (h += C.headerColSpan));
147
+ const I = e[w];
148
+ S < C && I.depth + I.rowSpan - 1 >= r.depth && (p.includes(w) || (h += I.headerColSpan)), S += I.headerColSpan;
148
149
  }
149
150
  }
150
151
  const g = n[r.depth];
@@ -155,7 +156,7 @@ function W(e, t) {
155
156
  r.virtualColumnOffset = h, n[r.depth].push(d);
156
157
  for (let l = r.depth; l < r.depth + r.rowSpan; l++)
157
158
  a[l] = (a[l] || 0) + r.headerColSpan;
158
- }), k(n, e, t), L(n, e, t), n;
159
+ }), O(n, e, t), k(n, e, t), n;
159
160
  }
160
161
  function H(e, t, n, i = 0, a = !1) {
161
162
  const s = [];
@@ -163,11 +164,11 @@ function H(e, t, n, i = 0, a = !1) {
163
164
  return [];
164
165
  e && e.length === void 0 && (e = [e]), e.forEach((d, o) => {
165
166
  d = d;
166
- const h = d.id ? d.id : A.generateNavigatableId(`${n.prevId++}`, n.idPrefix, "column"), p = b && d.media && window.matchMedia ? !window.matchMedia(d.media).matches : !1, f = a || p || d.hidden, c = t == null ? void 0 : t.find((l) => l.id === h), g = H(d.children, (c == null ? void 0 : c.children) || [], n, i + 1, f);
167
+ const h = d.id ? d.id : R.generateNavigatableId(`${n.prevId++}`, n.idPrefix, "column"), p = b && d.media && window.matchMedia ? !window.matchMedia(d.media).matches : !1, f = a || p || d.hidden, c = t == null ? void 0 : t.find((l) => l.id === h), g = H(d.children, (c == null ? void 0 : c.children) || [], n, i + 1, f);
167
168
  s.push(
168
169
  {
169
170
  depth: i,
170
- ...R,
171
+ ...M,
171
172
  ...g.length ? { cell: () => null, filterCell: () => null } : {},
172
173
  ...d,
173
174
  id: h,
@@ -196,7 +197,7 @@ function H(e, t, n, i = 0, a = !1) {
196
197
  return s;
197
198
  }
198
199
  const j = (e) => Array.isArray(e) ? e : e ? e.data : [];
199
- function X(e, t, n, i) {
200
+ function J(e, t, n, i) {
200
201
  const a = j(e), s = [];
201
202
  if (a.length > 0) {
202
203
  let r = a[0];
@@ -206,7 +207,7 @@ function X(e, t, n, i) {
206
207
  Object.getOwnPropertyNames(r).forEach((o) => {
207
208
  o !== n.column && s.push(
208
209
  {
209
- id: A.generateNavigatableId(`${i.prevId++}`, i.idPrefix, "column"),
210
+ id: R.generateNavigatableId(`${i.prevId++}`, i.idPrefix, "column"),
210
211
  declarationIndex: -1,
211
212
  parentIndex: -1,
212
213
  depth: 0,
@@ -221,7 +222,7 @@ function X(e, t, n, i) {
221
222
  children: [],
222
223
  ariaColumnIndex: 0,
223
224
  isAccessible: !0,
224
- ...R,
225
+ ...M,
225
226
  field: o
226
227
  }
227
228
  );
@@ -237,55 +238,55 @@ const $ = (e, t) => {
237
238
  n = e[n.parentIndex];
238
239
  }
239
240
  return !1;
240
- }, Y = (e) => e.filter((t) => $(e, t) ? !1 : !!t.footerCell || !(t.children && t.children.length > 0)), J = {
241
+ }, Q = (e) => e.filter((t) => $(e, t) ? !1 : !!t.footerCell || !(t.children && t.children.length > 0)), Z = {
241
242
  number: function(e, t, n) {
242
- return typeof e === u && e.toLowerCase() === "null" ? null : t.parseNumber(e, n);
243
+ return typeof e === y && e.toLowerCase() === "null" ? null : t.parseNumber(e, n);
243
244
  },
244
245
  date: function(e, t, n) {
245
- return typeof e === u && e.toLowerCase() === "null" ? null : t.parseDate(e, n);
246
+ return typeof e === y && e.toLowerCase() === "null" ? null : t.parseDate(e, n);
246
247
  },
247
248
  boolean: function(e) {
248
- return typeof e === u ? e.toLowerCase() === "null" ? null : e.toLowerCase() === "true" : e != null ? !!e : e;
249
+ return typeof e === y ? e.toLowerCase() === "null" ? null : e.toLowerCase() === "true" : e != null ? !!e : e;
249
250
  },
250
251
  string: function(e) {
251
- return typeof e === u && e.toLowerCase() === "null" ? null : e != null ? e + "" : e;
252
+ return typeof e === y && e.toLowerCase() === "null" ? null : e != null ? e + "" : e;
252
253
  },
253
254
  default: function(e) {
254
255
  return e;
255
256
  }
256
257
  };
257
- function M(e, t, n, i) {
258
+ function D(e, t, n, i) {
258
259
  return e.forEach((a) => {
259
- a.expanded = t[i] && !t[i].includes(D(a, n)), a.items && a.items.length && (a.items = M(a.items, t, n, i + 1));
260
+ a.expanded = t[i] && !t[i].includes(F(a, n)), a.items && a.items.length && (a.items = D(a.items, t, n, i + 1));
260
261
  }), e;
261
262
  }
262
- function Q(e, t, n) {
263
+ function _(e, t, n) {
263
264
  return t && t.length && e.data.forEach((i) => {
264
- i.expanded = i.expanded !== void 0 ? i.expanded : t[0] && !t[0].includes(D(i, n)), i.items && i.items.length && (i.items = M(i.items, t, n, 1));
265
+ i.expanded = i.expanded !== void 0 ? i.expanded : t[0] && !t[0].includes(F(i, n)), i.items && i.items.length && (i.items = D(i.items, t, n, 1));
265
266
  }), e;
266
267
  }
267
- function D(e, t) {
268
+ function F(e, t) {
268
269
  let n = e;
269
270
  for (; n.items && n.items.length; )
270
271
  n = n.items[0];
271
272
  return t ? n[t] : e.value;
272
273
  }
273
- const Z = (e) => {
274
+ const q = (e) => {
274
275
  const t = [], n = (i) => i == null ? void 0 : i.forEach((a) => {
275
276
  t.push(a), n(a.children);
276
277
  });
277
278
  return n(e), t;
278
- }, _ = typeof window != "undefined" && /Firefox/.test(window.navigator.userAgent), q = 17895697, G = (e) => e.width !== void 0 ? Math.floor(parseFloat(e.width.toString())) + "px" : void 0, ee = (e, t) => t && t.filter((n) => n.field === e).length > 0, B = (e) => (e.sort((t, n) => t.declarationIndex - n.declarationIndex), e.map((t) => {
279
+ }, G = typeof window != "undefined" && /Firefox/.test(window.navigator.userAgent), ee = 17895697, te = (e) => e.width !== void 0 ? Math.floor(parseFloat(e.width.toString())) + "px" : void 0, ne = (e, t) => t && t.filter((n) => n.field === e).length > 0, B = (e) => (e.sort((t, n) => t.declarationIndex - n.declarationIndex), e.map((t) => {
279
280
  const { declarationIndex: n, parentIndex: i, depth: a, headerColSpan: s, rowSpan: r, index: d, kFirst: o, children: h, ...p } = t;
280
281
  return h.length ? {
281
282
  children: B(h),
282
283
  ...p
283
284
  } : p;
284
- })), te = (e, t) => typeof e.colSpan == "function" ? e.colSpan({ dataItem: t, column: e }) : e.colSpan || 1, ne = (e) => {
285
+ })), re = (e, t) => typeof e.colSpan == "function" ? e.colSpan({ dataItem: t, column: e }) : e.colSpan || 1, ie = (e) => {
285
286
  var i, a;
286
- const t = typeof e == "object" ? (i = e.enabled) != null ? i : !0 : e != null ? e : !1, n = typeof e == "object" ? (a = e.valueGetter) != null ? a : ((s, r) => S(r)(s)) : (s, r) => S(r)(s);
287
+ const t = typeof e == "object" ? (i = e.enabled) != null ? i : !0 : e != null ? e : !1, n = typeof e == "object" ? (a = e.valueGetter) != null ? a : ((s, r) => E(r)(s)) : (s, r) => E(r)(s);
287
288
  return { enabled: t, valueGetter: n };
288
- }, re = (e) => {
289
+ }, ae = (e) => {
289
290
  let t = 0;
290
291
  if (e) {
291
292
  const n = e.insertRow(0), i = n.insertCell(0);
@@ -294,26 +295,26 @@ const Z = (e) => {
294
295
  return t;
295
296
  };
296
297
  export {
297
- Q as applyExpandedState,
298
- X as autoGenerateColumns,
299
- re as calcRowHeight,
300
- P as checkPropCompatibility,
301
- _ as firefox,
302
- q as firefoxMaxHeight,
303
- N as flatData,
304
- Y as footerColumns,
305
- te as getColSpan,
306
- G as getColumnWidth,
298
+ _ as applyExpandedState,
299
+ J as autoGenerateColumns,
300
+ ae as calcRowHeight,
301
+ X as checkPropCompatibility,
302
+ G as firefox,
303
+ ee as firefoxMaxHeight,
304
+ L as flatData,
305
+ Q as footerColumns,
306
+ re as getColSpan,
307
+ te as getColumnWidth,
307
308
  j as getDataAsArray,
308
- Z as getFlatColumnsState,
309
- V as getIndex,
310
- y as getNestedValue,
311
- ne as getRowSpanOptions,
312
- D as groupedFirstItemValue,
313
- U as isRtl,
314
- ee as isSorted,
315
- W as mapColumns,
316
- J as parsers,
309
+ q as getFlatColumnsState,
310
+ W as getIndex,
311
+ v as getNestedValue,
312
+ ie as getRowSpanOptions,
313
+ F as groupedFirstItemValue,
314
+ m as isRtl,
315
+ ne as isSorted,
316
+ Y as mapColumns,
317
+ Z as parsers,
317
318
  H as readColumns,
318
319
  B as sanitizeColumns
319
320
  };
@@ -7,6 +7,21 @@
7
7
  */
8
8
  import { ExtendedColumnProps } from '../interfaces/ExtendedColumnProps';
9
9
  import { GridCellRenderModel } from '../interfaces/GridCellRenderModel';
10
+ /**
11
+ * @hidden
12
+ * Pure function to get all parent column indices up to the root
13
+ */
14
+ export declare function getParentIndices(columns: ExtendedColumnProps[], columnIndex: number): number[];
15
+ /**
16
+ * @hidden
17
+ * Pure function to add all ancestors of given parent indices
18
+ */
19
+ export declare function addAllAncestors(columns: ExtendedColumnProps[], parentIndices: number[], allVisibleIndices: Set<number>): void;
20
+ /**
21
+ * @hidden
22
+ * Pure function to add all children and descendants of a column
23
+ */
24
+ export declare function addDescendants(columns: ExtendedColumnProps[], colIdx: number, allVisibleIndices: Set<number>): void;
10
25
  /**
11
26
  * @hidden
12
27
  * Calculate which columns to render and their colSpans for virtualized header/filter rows
@@ -16,9 +31,11 @@ export declare function getVirtualHeaderCellsToRender(args: {
16
31
  columns: ExtendedColumnProps[];
17
32
  rowIndex: number;
18
33
  enableVirtualization?: boolean;
34
+ columnsMap?: number[][];
19
35
  }): {
20
36
  columnsToRender: number[];
21
37
  colSpans: number[];
38
+ skipOffset?: boolean;
22
39
  };
23
40
  /**
24
41
  * @hidden
@@ -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"});function m(u){const{cellsToRender:n,columns:i,rowIndex:a,enableVirtualization:s}=u;if(!s||a!==0||!n||n.length===0)return{columnsToRender:[],colSpans:[]};const t=[],o=[];let c=-1,d=-1;for(let l=0;l<n.length;l++)i[n[l].columnIndex].locked||(c===-1&&(c=l),d=l);return n.forEach((l,r)=>{if(t.push(l.columnIndex),r===c)o.push(l.colSpan);else if(r===d)o.push(l.colSpan);else{const f=i[l.columnIndex];o.push(f.headerColSpan||1)}}),{columnsToRender:t,colSpans:o}}function p(u){const{cellModels:n,columns:i=[],tableViewPortWidth:a,scrollLeft:s}=u;let t=0,o=n.length-1,c=0,d=0;for(let e=0;e<n.length;e++)if(!i[n[e].columnIndex].locked&&(c=d,d+=n[e].width||10,d>=s)){t=e;break}for(let e=t;e<n.length;e++)if(!i[n[e].columnIndex].locked)if(c<a+s)c+=n[e].width||10,o=e;else break;t>0&&t--,o<n.length-1&&o++;let l=0,r=0;for(let e=0;e<t;e++)i[n[e].columnIndex].locked||(l+=n[e].colSpan);for(let e=o+1;e<n.length;e++)i[n[e].columnIndex].locked||(r+=n[e].colSpan);n[t].colSpan+=l,n[o].colSpan+=r;const f=n.slice(0,t).filter(e=>i[e.columnIndex].locked),h=n.slice(o+1).filter(e=>i[e.columnIndex].locked);return[...f,...n.slice(t,o+1),...h]}exports.getVirtualCellsToRender=p;exports.getVirtualHeaderCellsToRender=m;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function L(a,e,n){let s=0,p=!1;if(n>0&&e)for(let l=0;l<n;l++){const r=e[l]||[];for(let u=0;u<r.length;u++){const h=r[u],S=a[h];(S.rowSpan||1)>n-l&&(s+=S.headerColSpan||1,u===0&&(p=!0))}}return{emptyColSpan:s,skipOffset:p}}function E(a,e){const n=a[e];return!n||n.parentIndex<0?[]:[n.parentIndex,...E(a,n.parentIndex)]}function M(a,e,n){e.forEach(s=>{E(a,s).forEach(l=>n.add(l))})}function w(a,e,n){var p;const s=a[e];((p=s==null?void 0:s.children)==null?void 0:p.length)>0&&s.children.forEach(l=>{let r=typeof l=="number"?l:a.indexOf(l);r>=0&&!n.has(r)&&(n.add(r),w(a,r,n))})}function P(a){const{cellsToRender:e,columns:n,rowIndex:s,enableVirtualization:p,columnsMap:l}=a;if(!p||!e||e.length===0)return{columnsToRender:[],colSpans:[]};const r=[],u=[];let h=-1,S=-1;function I(o,c){let d=-1,i=-1;for(let f=0;f<c.length;f++)o[c[f]].locked||(d===-1&&(d=f),i=f);return{first:d,last:i}}const R=e.reduce((o,c)=>o+c.colSpan,0);let x=[],t=[];const U=n.filter(o=>o.children.length===0),b=new Map;n.forEach((o,c)=>{if(o.children.length===0){const d=U.findIndex(i=>i===o);d>=0&&b.set(d,c)}});const g=new Set;if(e.forEach(o=>{const c=b.get(o.columnIndex);if(c!==void 0){g.add(c);const d=E(n,c);d.forEach(i=>g.add(i)),M(n,d,g),w(n,c,g),d.forEach(i=>{w(n,i,g)})}}),l&&Array.isArray(l)){for(let o=0;o<l.length;o++)x[o]=l[o].filter(c=>g.has(c));t=x[s]||[]}const y=I(n,t);h=y.first,S=y.last;let V=0,O=0,v=!1;return t.forEach((o,c)=>{r.push(o);const d=n[o],i=d.headerColSpan||1;let f;if(h===S)f=R;else if(c===h){const k=d.virtualColumnOffset?d.virtualColumnOffset:0,{emptyColSpan:C,skipOffset:m}=L(n,x,s);O+=C,m&&(O+=k,v=!0),k>0&&!m?f=i+k:f=i}else if(c===S){let k=c===t.length-1;if(l!=null&&l[s]){const C=l[s],m=o;let A=-1;for(let T=C.length-1;T>=0;T--)if(!n[C[T]].locked){A=C[T];break}k=m===A}if(k)f=i;else{const C=R-V-O;if(f=Math.max(C,i),i>C&&u.length>0){const m=i-C;u[0]-=m}}}else f=i;u.push(f),V+=f}),{columnsToRender:r,colSpans:u,skipOffset:v}}function F(a){const{cellModels:e,columns:n=[],tableViewPortWidth:s,scrollLeft:p}=a;let l=0,r=e.length-1,u=0,h=0;for(let t=0;t<e.length;t++)if(!n[e[t].columnIndex].locked&&(u=h,h+=e[t].width||10,h>=p)){l=t;break}for(let t=l;t<e.length;t++)if(!n[e[t].columnIndex].locked)if(u<s+p)u+=e[t].width||10,r=t;else break;l>0&&l--,r<e.length-1&&r++;let S=0,I=0;for(let t=0;t<l;t++)n[e[t].columnIndex].locked||(S+=e[t].colSpan);for(let t=r+1;t<e.length;t++)n[e[t].columnIndex].locked||(I+=e[t].colSpan);e[l].colSpan+=S,e[r].colSpan+=I;const R=e.slice(0,l).filter(t=>n[t.columnIndex].locked),x=e.slice(r+1).filter(t=>n[t.columnIndex].locked);return[...R,...e.slice(l,r+1),...x]}exports.addAllAncestors=M;exports.addDescendants=w;exports.getParentIndices=E;exports.getVirtualCellsToRender=F;exports.getVirtualHeaderCellsToRender=P;