@progress/kendo-react-grid 12.1.1-develop.9 → 12.2.0-develop.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/GridClientWrapper.js +1 -1
- package/GridClientWrapper.mjs +39 -31
- package/GridComponent.js +1 -1
- package/GridComponent.mjs +172 -167
- package/GridState.js +1 -1
- package/GridState.mjs +13 -13
- package/cells/groupcell/GridGroupCell.js +1 -1
- package/cells/groupcell/GridGroupCell.mjs +1 -1
- package/columnMenu/GridColumnMenuFilterUI.js +1 -1
- package/columnMenu/GridColumnMenuFilterUI.mjs +18 -18
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/drag/CommonDragLogic.js +1 -1
- package/drag/CommonDragLogic.mjs +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +17 -17
- package/utils/index.js +1 -1
- package/utils/index.mjs +37 -36
package/drag/CommonDragLogic.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 g=require("react"),h=require("@progress/kendo-react-data-tools");function p(o){const r=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(r,e,i.get?i:{enumerable:!0,get:()=>o[e]})}}return r.default=o,Object.freeze(r)}const c=p(g);class d{constructor(r,e,i){this.refDragElementClue=c.createRef(),this.refDropElementClue=c.createRef(),this.columns=[],this.reorderable=!1,this.groupable=!1,this.startColumn=-1,this.startGroup=-1,this.currentColumn=-1,this.currentGroup=-1,this.groupPanelDivElement=null,this.refGroupPanelDiv=t=>{this.groupPanelDivElement=t&&t.children?t.children[0]:t},this.pressHandler=(t,n)=>{const u=this.getColumnIndex(t,n);if(this.startGroup=this.getGroupIndex(t),u>=0){const s=this.columns[u];(s.reorderable&&this.reorderable||s.groupable&&this.groupable)&&(this.startColumn=u)}},this.dragHandler=(t,n)=>{var l,a;if(t.isTouch||t.originalEvent.preventDefault(),t.originalEvent.stopPropagation(),this.startColumn===-1&&this.startGroup===-1)return;this.currentColumn=this.getColumnIndex(t,n),this.currentGroup=this.isTargetGroupingContainer(t)?this.getCurrentGroupsLength:this.getGroupIndex(t);const u=!this.isValid();u&&(this.currentColumn=-1,this.currentGroup=-1);let s=null;this.currentColumn>=0?s=n.children[this.columns[this.currentColumn].index]:this.isTargetGroupingContainer(t)?s=this.getEventTarget(t):s=(a=(l=this.groupPanelDivElement)==null?void 0:l.children[this.currentGroup])!=null?a:null,this.updateDragElementClue(t,n,s,u),this.updateDropElementClue(t,n,s,u)},this.releaseHandler=t=>{const n=this.startColumn,u=this.currentColumn,s=this.startGroup,l=this.currentGroup;t.originalEvent.preventDefault(),this.dropElementClue&&this.dropElementClue.setState({visible:!1}),this.dragElementClue&&this.dragElementClue.setState({visible:!1});const a=this.isValid();this.startColumn=this.startGroup=this.currentColumn=this.currentGroup=-1,a&&(n>=0&&u>=0?this.columnReorder(n,u,t.originalEvent):s>=0&&l>=0?this.groupReorder(s,l,t.originalEvent):n>=0&&l>=0&&this.columnToGroup(n,l,t.originalEvent))},this.columnReorder=r,this.groupReorder=e,this.columnToGroup=i}get dragClueRef(){return this.refDragElementClue}get dropClueRef(){return this.refDropElementClue}get getCurrentGroupsLength(){const r=this.groupPanelDivElement&&this.groupPanelDivElement.children;return r&&r.length||0}get dragElementClue(){return this.refDragElementClue.current}get dropElementClue(){return this.refDropElementClue.current}getColumnIndex(r,e){if(!e||e.parentElement===this.groupPanelDivElement)return-1;const i=h.getIndex(r,e);if(i===-1)return-1;for(let t=0;t<e.parentNode.children.length;t++)if(e.parentNode.children[t]===e)return this.columns.findIndex(n=>n.index===i&&n.depth===t);return-1}getEventTarget(r){var t,n;const e=r.originalEvent,i=(t=e.target)==null?void 0:t.ownerDocument;return(n=i==null?void 0:i.elementFromPoint(e.clientX,e.clientY))!=null?n:null}isTargetGroupingContainer(r){var i,t;const e=this.getEventTarget(r);return(t=(i=e==null?void 0:e.classList)==null?void 0:i.contains("k-grouping-drop-container"))!=null?t:!1}getGroupIndex(r){return h.getIndex(r,this.groupPanelDivElement)}isValid(){return this.startGroup>=0?this.currentGroup>=0&&this.currentGroup!==this.startGroup:this.startColumn===-1?!1:this.currentGroup>=0?this.columns[this.startColumn].groupable===!0&&this.groupable===!0:this.reorderable===!0&&this.currentColumn>=0&&this.currentColumn!==this.startColumn&&this.columns[this.startColumn].reorderable===!0&&this.columns[this.currentColumn].parentIndex===this.columns[this.startColumn].parentIndex}updateDragElementClue(r,e,i,t){if(!this.dragElementClue)return;const n=this.startColumn>=0?e.children[this.columns[this.startColumn].index].innerText:e.innerText;this.dragElementClue.setState({visible:!0,top:r.pageY+10,left:r.pageX,innerText:n,status:t||!i?"k-i-cancel":"k-i-plus"})}updateDropElementClue(r,e,i,t){if(!this.dropElementClue)return;if(t||!i){this.dropElementClue.setState({visible:!1});return}const n=i.getBoundingClientRect(),s=(i.closest(".k-grouping-header")||i).getBoundingClientRect();let l=n.left+r.pageX-r.clientX-6;!this.isTargetGroupingContainer(r)&&(this.currentColumn>this.startColumn||this.currentGroup>this.startGroup&&this.startGroup!==-1)&&this.dir!=="rtl"&&(l+=n.width);const a=s.top+r.pageY-r.clientY;this.dropElementClue.setState({visible:!0,top:a,left:l,height:this.currentColumn>=0?e.clientHeight:s.height})}}exports.CommonDragLogic=d;
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react"),h=require("@progress/kendo-react-data-tools");function p(o){const r=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(r,e,i.get?i:{enumerable:!0,get:()=>o[e]})}}return r.default=o,Object.freeze(r)}const c=p(g);class d{constructor(r,e,i){this.refDragElementClue=c.createRef(),this.refDropElementClue=c.createRef(),this.columns=[],this.reorderable=!1,this.groupable=!1,this.startColumn=-1,this.startGroup=-1,this.currentColumn=-1,this.currentGroup=-1,this.groupPanelDivElement=null,this.refGroupPanelDiv=t=>{this.groupPanelDivElement=t&&t.children?t.children[0]:t},this.pressHandler=(t,n)=>{const u=this.getColumnIndex(t,n);if(this.startGroup=this.getGroupIndex(t),u>=0){const s=this.columns[u];(s.reorderable&&this.reorderable||s.groupable&&this.groupable)&&(this.startColumn=u)}},this.dragHandler=(t,n)=>{var l,a;if(t.isTouch||t.originalEvent.preventDefault(),t.originalEvent.stopPropagation(),this.startColumn===-1&&this.startGroup===-1)return;this.currentColumn=this.getColumnIndex(t,n),this.currentGroup=this.isTargetGroupingContainer(t)?this.getCurrentGroupsLength:this.getGroupIndex(t);const u=!this.isValid();u&&(this.currentColumn=-1,this.currentGroup=-1);let s=null;this.currentColumn>=0?s=n.children[this.columns[this.currentColumn].index]:this.isTargetGroupingContainer(t)?s=this.getEventTarget(t):s=(a=(l=this.groupPanelDivElement)==null?void 0:l.children[this.currentGroup])!=null?a:null,this.updateDragElementClue(t,n,s,u),this.updateDropElementClue(t,n,s,u)},this.releaseHandler=t=>{const n=this.startColumn,u=this.currentColumn,s=this.startGroup,l=this.currentGroup;t.originalEvent.preventDefault(),this.dropElementClue&&this.dropElementClue.setState({visible:!1}),this.dragElementClue&&this.dragElementClue.setState({visible:!1});const a=this.isValid();this.startColumn=this.startGroup=this.currentColumn=this.currentGroup=-1,a&&(n>=0&&u>=0?this.columnReorder(n,u,t.originalEvent):s>=0&&l>=0?this.groupReorder(s,l,t.originalEvent):n>=0&&l>=0&&this.columnToGroup(n,l,t.originalEvent))},this.columnReorder=r,this.groupReorder=e,this.columnToGroup=i}get dragClueRef(){return this.refDragElementClue}get dropClueRef(){return this.refDropElementClue}get getCurrentGroupsLength(){const r=this.groupPanelDivElement&&this.groupPanelDivElement.children;return r&&r.length||0}get dragElementClue(){return this.refDragElementClue.current}get dropElementClue(){return this.refDropElementClue.current}getColumnIndex(r,e){if(!e||e.parentElement===this.groupPanelDivElement)return-1;const i=h.getIndex(r,e);if(i===-1)return-1;for(let t=0;t<e.parentNode.children.length;t++)if(e.parentNode.children[t]===e)return this.columns.findIndex(n=>n.index===i&&n.depth===t);return-1}getEventTarget(r){var t,n;const e=r.originalEvent,i=(t=e.target)==null?void 0:t.ownerDocument;return(n=i==null?void 0:i.elementFromPoint(e.clientX,e.clientY))!=null?n:null}isTargetGroupingContainer(r){var i,t;const e=this.getEventTarget(r);return(t=(i=e==null?void 0:e.classList)==null?void 0:i.contains("k-grouping-drop-container"))!=null?t:!1}getGroupIndex(r){return h.getIndex(r,this.groupPanelDivElement)}isValid(){return this.startGroup>=0?this.currentGroup>=0&&this.currentGroup!==this.startGroup:this.startColumn===-1?!1:this.currentGroup>=0?this.columns[this.startColumn].groupable===!0&&this.groupable===!0:this.reorderable===!0&&this.currentColumn>=0&&this.currentColumn!==this.startColumn&&this.columns[this.startColumn].reorderable===!0&&this.columns[this.currentColumn].disableReorder!==!0&&this.columns[this.currentColumn].parentIndex===this.columns[this.startColumn].parentIndex}updateDragElementClue(r,e,i,t){if(!this.dragElementClue)return;const n=this.startColumn>=0?e.children[this.columns[this.startColumn].index].innerText:e.innerText;this.dragElementClue.setState({visible:!0,top:r.pageY+10,left:r.pageX,innerText:n,status:t||!i?"k-i-cancel":"k-i-plus"})}updateDropElementClue(r,e,i,t){if(!this.dropElementClue)return;if(t||!i){this.dropElementClue.setState({visible:!1});return}const n=i.getBoundingClientRect(),s=(i.closest(".k-grouping-header")||i).getBoundingClientRect();let l=n.left+r.pageX-r.clientX-6;!this.isTargetGroupingContainer(r)&&(this.currentColumn>this.startColumn||this.currentGroup>this.startGroup&&this.startGroup!==-1)&&this.dir!=="rtl"&&(l+=n.width);const a=s.top+r.pageY-r.clientY;this.dropElementClue.setState({visible:!0,top:a,left:l,height:this.currentColumn>=0?e.clientHeight:s.height})}}exports.CommonDragLogic=d;
|
package/drag/CommonDragLogic.mjs
CHANGED
|
@@ -74,7 +74,7 @@ class g {
|
|
|
74
74
|
return a(r, this.groupPanelDivElement);
|
|
75
75
|
}
|
|
76
76
|
isValid() {
|
|
77
|
-
return this.startGroup >= 0 ? this.currentGroup >= 0 && this.currentGroup !== this.startGroup : this.startColumn === -1 ? !1 : this.currentGroup >= 0 ? this.columns[this.startColumn].groupable === !0 && this.groupable === !0 : this.reorderable === !0 && this.currentColumn >= 0 && this.currentColumn !== this.startColumn && this.columns[this.startColumn].reorderable === !0 && this.columns[this.currentColumn].parentIndex === this.columns[this.startColumn].parentIndex;
|
|
77
|
+
return this.startGroup >= 0 ? this.currentGroup >= 0 && this.currentGroup !== this.startGroup : this.startColumn === -1 ? !1 : this.currentGroup >= 0 ? this.columns[this.startColumn].groupable === !0 && this.groupable === !0 : this.reorderable === !0 && this.currentColumn >= 0 && this.currentColumn !== this.startColumn && this.columns[this.startColumn].reorderable === !0 && this.columns[this.currentColumn].disableReorder !== !0 && this.columns[this.currentColumn].parentIndex === this.columns[this.startColumn].parentIndex;
|
|
78
78
|
}
|
|
79
79
|
updateDragElementClue(r, n, i, t) {
|
|
80
80
|
if (!this.dragElementClue)
|
package/package-metadata.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 e=Object.freeze({name:"@progress/kendo-react-grid",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Object.freeze({name:"@progress/kendo-react-grid",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1761653912,version:"12.2.0-develop.10",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"});exports.packageMetadata=e;
|
package/package-metadata.mjs
CHANGED
|
@@ -10,8 +10,8 @@ const e = Object.freeze({
|
|
|
10
10
|
productName: "KendoReact",
|
|
11
11
|
productCode: "KENDOUIREACT",
|
|
12
12
|
productCodes: ["KENDOUIREACT"],
|
|
13
|
-
publishDate:
|
|
14
|
-
version: "12.
|
|
13
|
+
publishDate: 1761653912,
|
|
14
|
+
version: "12.2.0-develop.10",
|
|
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": "12.
|
|
3
|
+
"version": "12.2.0-develop.10",
|
|
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",
|
|
@@ -28,21 +28,21 @@
|
|
|
28
28
|
"@progress/kendo-data-query": "^1.0.0",
|
|
29
29
|
"@progress/kendo-drawing": "^1.21.2",
|
|
30
30
|
"@progress/kendo-licensing": "^1.7.0",
|
|
31
|
-
"@progress/kendo-react-animation": "12.
|
|
32
|
-
"@progress/kendo-react-buttons": "12.
|
|
33
|
-
"@progress/kendo-react-common": "12.
|
|
34
|
-
"@progress/kendo-react-data-tools": "12.
|
|
35
|
-
"@progress/kendo-react-dateinputs": "12.
|
|
36
|
-
"@progress/kendo-react-indicators": "12.
|
|
37
|
-
"@progress/kendo-react-form": "12.
|
|
38
|
-
"@progress/kendo-react-labels": "12.
|
|
39
|
-
"@progress/kendo-react-dialogs": "12.
|
|
40
|
-
"@progress/kendo-react-dropdowns": "12.
|
|
41
|
-
"@progress/kendo-react-inputs": "12.
|
|
42
|
-
"@progress/kendo-react-intl": "12.
|
|
43
|
-
"@progress/kendo-react-popup": "12.
|
|
44
|
-
"@progress/kendo-react-layout": "12.
|
|
45
|
-
"@progress/kendo-react-conversational-ui": "12.
|
|
31
|
+
"@progress/kendo-react-animation": "12.2.0-develop.10",
|
|
32
|
+
"@progress/kendo-react-buttons": "12.2.0-develop.10",
|
|
33
|
+
"@progress/kendo-react-common": "12.2.0-develop.10",
|
|
34
|
+
"@progress/kendo-react-data-tools": "12.2.0-develop.10",
|
|
35
|
+
"@progress/kendo-react-dateinputs": "12.2.0-develop.10",
|
|
36
|
+
"@progress/kendo-react-indicators": "12.2.0-develop.10",
|
|
37
|
+
"@progress/kendo-react-form": "12.2.0-develop.10",
|
|
38
|
+
"@progress/kendo-react-labels": "12.2.0-develop.10",
|
|
39
|
+
"@progress/kendo-react-dialogs": "12.2.0-develop.10",
|
|
40
|
+
"@progress/kendo-react-dropdowns": "12.2.0-develop.10",
|
|
41
|
+
"@progress/kendo-react-inputs": "12.2.0-develop.10",
|
|
42
|
+
"@progress/kendo-react-intl": "12.2.0-develop.10",
|
|
43
|
+
"@progress/kendo-react-popup": "12.2.0-develop.10",
|
|
44
|
+
"@progress/kendo-react-layout": "12.2.0-develop.10",
|
|
45
|
+
"@progress/kendo-react-conversational-ui": "12.2.0-develop.10",
|
|
46
46
|
"@progress/kendo-svg-icons": "^4.0.0",
|
|
47
47
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
|
48
48
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
"package": {
|
|
148
148
|
"productName": "KendoReact",
|
|
149
149
|
"productCode": "KENDOUIREACT",
|
|
150
|
-
"publishDate":
|
|
150
|
+
"publishDate": 1761653912,
|
|
151
151
|
"licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
152
152
|
}
|
|
153
153
|
},
|
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 A=require("react"),w=require("../GridColumn.js"),S=require("@progress/kendo-data-query"),I=require("@progress/kendo-react-data-tools"),G=require("./_serverModule.js"),O=require("./_clientModule.js"),c=require("../contextMenu/enums.js"),T=require("@progress/kendo-react-common");function H(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const y=H(A);function j(e,t){const n=(e!=null?e:"").split(".");let r=t;return n.forEach(d=>{r=r?r[d]:void 0}),r}function v(e,t,n,r,d,l,a,i,o,s=0,f){var u;let g=s;for(let h=0;h<t.length;h++){let x;if(!d||t[h].value===void 0||t[h].items===void 0){e[e.length]={dataIndex:r.index,dataItem:t[h],rowType:"data",level:s,group:f,expanded:(u=o?!!(l!=null&&l[S.getter(o)(t[h])]):!1)!=null?u:!1},r.index++;continue}else{let m;f!=null&&f.parents?m=[{field:f.field,value:f.value},...f.parents]:f?m=[f]:m=[],x={field:t[h].field,value:t[h].value,parents:m}}g=Math.max(g,s+1);let C=!1;const M=I.findGroupExpand(a||[],x);M?C=M.expanded!==!1:C=i!==!1,e[e.length]={dataIndex:-1,dataItem:t[h],level:s,group:x,rowType:"groupHeader",expanded:C},C&&(x.expanded=C,g=Math.max(v(e,t[h].items,n,r,d,l,a,i,o,s+1,x),g)),(n==="always"||C&&n==="visible")&&(e[e.length]={dataIndex:-1,dataItem:t[h],rowType:"groupFooter",level:s,expanded:C})}return g}const q=(e,t)=>typeof e.colSpan=="function"?e.colSpan({dataItem:t,column:e}):e.colSpan||1;function k(e,t){const n=[[]];let r=0;for(let a=e.length-1;a>=0;a--)r=Math.max(r,e[a].depth),e[a].headerColSpan=e[a].headerColSpan||1,e[a].children.length>0&&(e[a].headerColSpan=e[a].children.reduce((i,o)=>o.hidden?i:i+o.headerColSpan,0));const d=[];let l=1;return e.forEach((a,i)=>{n[a.depth]=n[a.depth]||[];let o=!1;n[a.depth].length===0&&(l<=1?l=1+(a.children.length>0?0:r-a.depth):(l--,o=!0)),a.rowSpan=1+(a.children.length>0?0:r-a.depth),a.kFirst=o,a.index=n[a.depth].length,n[a.depth].push(i),a.ariaColumnIndex=d[a.depth]?d[a.depth]+1:1;for(let s=a.depth;s<a.depth+a.rowSpan;s++)d[s]=(d[s]||0)+a.headerColSpan}),I.updateLeft(n,e,t),I.updateRight(n,e,t),n}function N(e,t,n,r=0,d=!1){const l=[];if(!e)return[];e&&e.length===void 0&&(e=[e]),e.forEach((i,o)=>{i=i.props?i.props:i;const s=i.id?i.id:I.tableKeyboardNavigationTools.generateNavigatableId(`${n.prevId++}`,n.idPrefix,"column"),f=T.canUseDOM&&i.media&&window.matchMedia?!window.matchMedia(i.media).matches:!1,g=d||f||i.hidden,u=t==null?void 0:t.find(x=>x.id===s),h=N(i.children,(u==null?void 0:u.children)||[],n,r+1,g);l.push(Object.assign({depth:r},w.gridDefaultProps,h.length?{cell:()=>null,filterCell:()=>null}:{},i,{id:s,declarationIndex:l.length,children:h,headerColSpan:0,rowSpan:0,columnType:i.columnType||"data",colSpan:i.colSpan||1,isAccessible:!0,hidden:g,left:null,right:null,rowSpannable:i.rowSpannable},u?{width:u.width,orderIndex:u.orderIndex}:{}))});const a=(i,o)=>i.orderIndex===o.orderIndex?i.declarationIndex-o.declarationIndex:(i.orderIndex||0)-(o.orderIndex||0);if(l.sort(a),r===0){const i=[],o=(s,f)=>s.forEach(g=>{g.parentIndex=f,o(g.children,i.push(g)-1)});return o(l,-1),i}return l}const b=e=>Array.isArray(e)?e:e?e.data:[];function B(e,t,n,r){const d=b(e),l=[];if(d.length>0){let a=d[0];if(t)for(let o=0;o<t.length;o++)a=a.items&&a.items[0];Object.getOwnPropertyNames(a).forEach(o=>{o!==n.column&&l.push(Object.assign({id:I.tableKeyboardNavigationTools.generateNavigatableId(`${r.prevId++}`,r.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},w.gridDefaultProps,{field:o}))})}return l}const _=(e,t)=>{var r;let n=e[t.parentIndex];for(;n;){if((r=n.cells)!=null&&r.footerCell)return!0;n=e[n.parentIndex]}return!1},$=e=>e.filter(t=>{var n;return _(e,t)?!1:!!((n=t.cells)!=null&&n.footerCell)||!(t.children&&t.children.length>0)}),z=e=>e.width!==void 0?Math.floor(parseFloat(e.width.toString()))+"px":void 0,V=(e,t)=>t&&t.filter(n=>n.field===e).length>0,D=e=>(e.sort((t,n)=>t.declarationIndex-n.declarationIndex),e.map(t=>{const{declarationIndex:n,parentIndex:r,depth:d,headerColSpan:l,rowSpan:a,index:i,kFirst:o,children:s,...f}=t;return s.length?{children:D(s),...f}:f})),R=e=>{const{cells:t,rowSpannable:n,defaultCell:r,...d}=e;return e.children.length?{...d,children:e.children.map(R)}:d},p=e=>({id:e.id,field:e.field,title:e.title,width:e.width,hidden:!1,children:e.children?E(e.children):null}),E=e=>e.map(p),L=e=>{const t=[],n=r=>r==null?void 0:r.forEach(d=>{t.push(d),n(d.children)});return n(e),t},P=typeof window!="undefined"&&/Firefox/.test(window.navigator.userAgent),W=17895697,K=e=>{let t=[];return e.sortable&&(t=t.concat([c.GridContextMenuItemNames.sortAsc,c.GridContextMenuItemNames.sortDesc])),e.pdf&&(t.length&&(t=t.concat([c.GridContextMenuItemNames.separator])),t=t.concat([c.GridContextMenuItemNames.exportPDF])),t},Q=e=>{let t=[];return e.clipboard&&(t=t.concat([c.GridContextMenuItemNames.copySelection,c.GridContextMenuItemNames.copySelectionNoHeaders,c.GridContextMenuItemNames.paste])),e.editable&&(t.length&&(t=t.concat([c.GridContextMenuItemNames.separator])),t=t.concat([c.GridContextMenuItemNames.create,c.GridContextMenuItemNames.edit,c.GridContextMenuItemNames.delete])),e.selectable&&(t.length&&(t=t.concat([c.GridContextMenuItemNames.separator])),t=t.concat([c.GridContextMenuItemNames.select])),e.rowReorderable&&(t.length&&(t=t.concat([c.GridContextMenuItemNames.separator])),t=t.concat([c.GridContextMenuItemNames.reorderRow])),e.pdf&&(t.length&&(t=t.concat([c.GridContextMenuItemNames.separator])),t=t.concat([c.GridContextMenuItemNames.exportPDF])),t},U=(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},J=e=>{var n;return typeof e=="object"?(n=e.enabled)!=null?n:!0:e!=null?e:!1},X=()=>G.ServerFragment===O.ClientFragment,Y=e=>!!(e&&e.$$typeof===Symbol.for("react.client.reference")),Z=e=>({id:e.id,ariaColumnIndex:e.ariaColumnIndex,isSelected:e.isSelected,isHighlighted:e.isHighlighted,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,locked:e.locked,isRtl:e.isRtl,rowDataIndex:e.rowDataIndex,columnPosition:e.columnPosition,group:e.group}),ee=e=>{var r,d;const t=typeof e=="object"?(r=e.enabled)!=null?r:!0:e!=null?e:!1,n=typeof e=="object"?(d=e.valueGetter)!=null?d:(l,a)=>S.getter(a)(l):(l,a)=>S.getter(a)(l);return{enabled:t,valueGetter:n}},F=e=>{var t;return y.isValidElement(e)?e:(t=y.Children.toArray(e))==null?void 0:t[0]},te=(e,t)=>{const n=F(e);return n?y.cloneElement(n,t):null},ne=e=>{let t=0;if(e){const n=e.insertRow(0),r=n.insertCell(0);r.textContent=" ",t=n.getBoundingClientRect().height,e.deleteRow(0)}return t};exports.autoGenerateColumns=B;exports.calcRowHeight=ne;exports.clientColumn=R;exports.cloneReactElement=te;exports.firefox=P;exports.firefoxMaxHeight=W;exports.flatData=v;exports.footerColumns=$;exports.getClientCellProps=Z;exports.getColSpan=q;exports.getColumnState=p;exports.getColumnWidth=z;exports.getColumnsState=E;exports.getDataAsArray=b;exports.getDefaultBodyContextMenuItems=Q;exports.getDefaultHeadContextMenuItems=K;exports.getFlatColumnsState=L;exports.getNestedValue=j;exports.getReactElement=F;exports.getRowSpanOptions=ee;exports.isClient=X;exports.isClientReference=Y;exports.isRowReorderEnabled=J;exports.isSorted=V;exports.mapColumns=k;exports.readColumns=N;exports.resolveCells=U;exports.sanitizeColumns=D;
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("react"),w=require("../GridColumn.js"),S=require("@progress/kendo-data-query"),I=require("@progress/kendo-react-data-tools"),G=require("./_serverModule.js"),O=require("./_clientModule.js"),c=require("../contextMenu/enums.js"),T=require("@progress/kendo-react-common");function H(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const y=H(A);function j(e,t){const n=(e!=null?e:"").split(".");let r=t;return n.forEach(d=>{r=r?r[d]:void 0}),r}function v(e,t,n,r,d,l,a,i,o,s=0,f){var u;let g=s;for(let h=0;h<t.length;h++){let x;if(!d||t[h].value===void 0||t[h].items===void 0){e[e.length]={dataIndex:r.index,dataItem:t[h],rowType:"data",level:s,group:f,expanded:(u=o?!!(l!=null&&l[S.getter(o)(t[h])]):!1)!=null?u:!1},r.index++;continue}else{let m;f!=null&&f.parents?m=[{field:f.field,value:f.value},...f.parents]:f?m=[f]:m=[],x={field:t[h].field,value:t[h].value,parents:m}}g=Math.max(g,s+1);let C=!1;const M=I.findGroupExpand(a||[],x);M?C=M.expanded!==!1:C=i!==!1,e[e.length]={dataIndex:-1,dataItem:t[h],level:s,group:x,rowType:"groupHeader",expanded:C},C&&(x.expanded=C,g=Math.max(v(e,t[h].items,n,r,d,l,a,i,o,s+1,x),g)),(n==="always"||C&&n==="visible")&&(e[e.length]={dataIndex:-1,dataItem:t[h],rowType:"groupFooter",level:s,expanded:C})}return g}const q=(e,t)=>typeof e.colSpan=="function"?e.colSpan({dataItem:t,column:e}):e.colSpan||1;function k(e,t){const n=[[]];let r=0;for(let a=e.length-1;a>=0;a--)r=Math.max(r,e[a].depth),e[a].headerColSpan=e[a].headerColSpan||1,e[a].children.length>0&&(e[a].headerColSpan=e[a].children.reduce((i,o)=>o.hidden?i:i+o.headerColSpan,0));const d=[];let l=1;return e.forEach((a,i)=>{n[a.depth]=n[a.depth]||[];let o=!1;n[a.depth].length===0&&(l<=1?l=1+(a.children.length>0?0:r-a.depth):(l--,o=!0)),a.rowSpan=1+(a.children.length>0?0:r-a.depth),a.kFirst=o,a.index=n[a.depth].length,n[a.depth].push(i),a.ariaColumnIndex=d[a.depth]?d[a.depth]+1:1;for(let s=a.depth;s<a.depth+a.rowSpan;s++)d[s]=(d[s]||0)+a.headerColSpan}),I.updateLeft(n,e,t),I.updateRight(n,e,t),n}function N(e,t,n,r=0,d=!1){const l=[];if(!e)return[];e&&e.length===void 0&&(e=[e]),e.forEach((i,o)=>{i=i.props?i.props:i;const s=i.id?i.id:I.tableKeyboardNavigationTools.generateNavigatableId(`${n.prevId++}`,n.idPrefix,"column"),f=T.canUseDOM&&i.media&&window.matchMedia?!window.matchMedia(i.media).matches:!1,g=d||f||i.hidden,u=t==null?void 0:t.find(x=>x.id===s),h=N(i.children,(u==null?void 0:u.children)||[],n,r+1,g);l.push(Object.assign({depth:r},w.gridDefaultProps,h.length?{cell:()=>null,filterCell:()=>null}:{},i,{id:s,declarationIndex:l.length,children:h,headerColSpan:0,rowSpan:0,columnType:i.columnType||"data",colSpan:i.colSpan||1,isAccessible:!0,hidden:g,left:null,right:null,rowSpannable:i.rowSpannable},u?{width:u.width,orderIndex:u.orderIndex}:{}))});const a=(i,o)=>i.orderIndex===o.orderIndex?i.declarationIndex-o.declarationIndex:(i.orderIndex||0)-(o.orderIndex||0);if(l.sort(a),r===0){const i=[],o=(s,f)=>s.forEach(g=>{g.parentIndex=f,o(g.children,i.push(g)-1)});return o(l,-1),i}return l}const b=e=>Array.isArray(e)?e:e?e.data:[];function B(e,t,n,r){const d=b(e),l=[];if(d.length>0){let a=d[0];if(t)for(let o=0;o<t.length;o++)a=a.items&&a.items[0];Object.getOwnPropertyNames(a).forEach(o=>{o!==n.column&&l.push(Object.assign({id:I.tableKeyboardNavigationTools.generateNavigatableId(`${r.prevId++}`,r.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},w.gridDefaultProps,{field:o}))})}return l}const _=(e,t)=>{var r;let n=e[t.parentIndex];for(;n;){if((r=n.cells)!=null&&r.footerCell)return!0;n=e[n.parentIndex]}return!1},$=e=>e.filter(t=>{var n;return _(e,t)?!1:!!((n=t.cells)!=null&&n.footerCell)||!(t.children&&t.children.length>0)}),z=e=>e.width!==void 0?Math.floor(parseFloat(e.width.toString()))+"px":void 0,V=(e,t)=>t&&t.filter(n=>n.field===e).length>0,D=e=>(e.sort((t,n)=>t.declarationIndex-n.declarationIndex),e.map(t=>{const{declarationIndex:n,parentIndex:r,depth:d,headerColSpan:l,rowSpan:a,index:i,kFirst:o,children:s,...f}=t;return s.length?{children:D(s),...f}:f})),R=e=>{const{cells:t,rowSpannable:n,defaultCell:r,...d}=e;return e.children.length?{...d,children:e.children.map(R)}:d},p=e=>({id:e.id,field:e.field,title:e.title,width:e.width,orderIndex:e.orderIndex,hidden:!1,children:e.children?E(e.children):null}),E=e=>e.map(p),L=e=>{const t=[],n=r=>r==null?void 0:r.forEach(d=>{t.push(d),n(d.children)});return n(e),t},P=typeof window!="undefined"&&/Firefox/.test(window.navigator.userAgent),W=17895697,K=e=>{let t=[];return e.sortable&&(t=t.concat([c.GridContextMenuItemNames.sortAsc,c.GridContextMenuItemNames.sortDesc])),e.pdf&&(t.length&&(t=t.concat([c.GridContextMenuItemNames.separator])),t=t.concat([c.GridContextMenuItemNames.exportPDF])),t},Q=e=>{let t=[];return e.clipboard&&(t=t.concat([c.GridContextMenuItemNames.copySelection,c.GridContextMenuItemNames.copySelectionNoHeaders,c.GridContextMenuItemNames.paste])),e.editable&&(t.length&&(t=t.concat([c.GridContextMenuItemNames.separator])),t=t.concat([c.GridContextMenuItemNames.create,c.GridContextMenuItemNames.edit,c.GridContextMenuItemNames.delete])),e.selectable&&(t.length&&(t=t.concat([c.GridContextMenuItemNames.separator])),t=t.concat([c.GridContextMenuItemNames.select])),e.rowReorderable&&(t.length&&(t=t.concat([c.GridContextMenuItemNames.separator])),t=t.concat([c.GridContextMenuItemNames.reorderRow])),e.pdf&&(t.length&&(t=t.concat([c.GridContextMenuItemNames.separator])),t=t.concat([c.GridContextMenuItemNames.exportPDF])),t},U=(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},J=e=>{var n;return typeof e=="object"?(n=e.enabled)!=null?n:!0:e!=null?e:!1},X=()=>G.ServerFragment===O.ClientFragment,Y=e=>!!(e&&e.$$typeof===Symbol.for("react.client.reference")),Z=e=>({id:e.id,ariaColumnIndex:e.ariaColumnIndex,isSelected:e.isSelected,isHighlighted:e.isHighlighted,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,locked:e.locked,isRtl:e.isRtl,rowDataIndex:e.rowDataIndex,columnPosition:e.columnPosition,group:e.group}),ee=e=>{var r,d;const t=typeof e=="object"?(r=e.enabled)!=null?r:!0:e!=null?e:!1,n=typeof e=="object"?(d=e.valueGetter)!=null?d:(l,a)=>S.getter(a)(l):(l,a)=>S.getter(a)(l);return{enabled:t,valueGetter:n}},F=e=>{var t;return y.isValidElement(e)?e:(t=y.Children.toArray(e))==null?void 0:t[0]},te=(e,t)=>{const n=F(e);return n?y.cloneElement(n,t):null},ne=e=>{let t=0;if(e){const n=e.insertRow(0),r=n.insertCell(0);r.textContent=" ",t=n.getBoundingClientRect().height,e.deleteRow(0)}return t};exports.autoGenerateColumns=B;exports.calcRowHeight=ne;exports.clientColumn=R;exports.cloneReactElement=te;exports.firefox=P;exports.firefoxMaxHeight=W;exports.flatData=v;exports.footerColumns=$;exports.getClientCellProps=Z;exports.getColSpan=q;exports.getColumnState=p;exports.getColumnWidth=z;exports.getColumnsState=E;exports.getDataAsArray=b;exports.getDefaultBodyContextMenuItems=Q;exports.getDefaultHeadContextMenuItems=K;exports.getFlatColumnsState=L;exports.getNestedValue=j;exports.getReactElement=F;exports.getRowSpanOptions=ee;exports.isClient=X;exports.isClientReference=Y;exports.isRowReorderEnabled=J;exports.isSorted=V;exports.mapColumns=k;exports.readColumns=N;exports.resolveCells=U;exports.sanitizeColumns=D;
|
package/utils/index.mjs
CHANGED
|
@@ -11,7 +11,7 @@ import { getter as y } from "@progress/kendo-data-query";
|
|
|
11
11
|
import { findGroupExpand as F, updateLeft as D, updateRight as E, tableKeyboardNavigationTools as p } from "@progress/kendo-react-data-tools";
|
|
12
12
|
import { ServerFragment as M } from "./_serverModule.mjs";
|
|
13
13
|
import { ClientFragment as b } from "./_clientModule.mjs";
|
|
14
|
-
import { GridContextMenuItemNames as
|
|
14
|
+
import { GridContextMenuItemNames as c } from "../contextMenu/enums.mjs";
|
|
15
15
|
import { canUseDOM as A } from "@progress/kendo-react-common";
|
|
16
16
|
function J(e, t) {
|
|
17
17
|
const n = (e != null ? e : "").split(".");
|
|
@@ -20,9 +20,9 @@ function J(e, t) {
|
|
|
20
20
|
i = i ? i[d] : void 0;
|
|
21
21
|
}), i;
|
|
22
22
|
}
|
|
23
|
-
function R(e, t, n, i, d, o, r, a, l,
|
|
23
|
+
function R(e, t, n, i, d, o, r, a, l, f = 0, h) {
|
|
24
24
|
var x;
|
|
25
|
-
let g =
|
|
25
|
+
let g = f;
|
|
26
26
|
for (let s = 0; s < t.length; s++) {
|
|
27
27
|
let I;
|
|
28
28
|
if (!d || t[s].value === void 0 || t[s].items === void 0) {
|
|
@@ -30,7 +30,7 @@ function R(e, t, n, i, d, o, r, a, l, c = 0, h) {
|
|
|
30
30
|
dataIndex: i.index,
|
|
31
31
|
dataItem: t[s],
|
|
32
32
|
rowType: "data",
|
|
33
|
-
level:
|
|
33
|
+
level: f,
|
|
34
34
|
group: h,
|
|
35
35
|
// This is related to detail-row expansion
|
|
36
36
|
expanded: (x = l ? !!(o != null && o[y(l)(t[s])]) : !1) != null ? x : !1
|
|
@@ -44,13 +44,13 @@ function R(e, t, n, i, d, o, r, a, l, c = 0, h) {
|
|
|
44
44
|
parents: S
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
g = Math.max(g,
|
|
47
|
+
g = Math.max(g, f + 1);
|
|
48
48
|
let C = !1;
|
|
49
49
|
const u = F(r || [], I);
|
|
50
50
|
u ? C = u.expanded !== !1 : C = a !== !1, e[e.length] = {
|
|
51
51
|
dataIndex: -1,
|
|
52
52
|
dataItem: t[s],
|
|
53
|
-
level:
|
|
53
|
+
level: f,
|
|
54
54
|
group: I,
|
|
55
55
|
rowType: "groupHeader",
|
|
56
56
|
expanded: C
|
|
@@ -65,7 +65,7 @@ function R(e, t, n, i, d, o, r, a, l, c = 0, h) {
|
|
|
65
65
|
r,
|
|
66
66
|
a,
|
|
67
67
|
l,
|
|
68
|
-
|
|
68
|
+
f + 1,
|
|
69
69
|
I
|
|
70
70
|
),
|
|
71
71
|
g
|
|
@@ -73,7 +73,7 @@ function R(e, t, n, i, d, o, r, a, l, c = 0, h) {
|
|
|
73
73
|
dataIndex: -1,
|
|
74
74
|
dataItem: t[s],
|
|
75
75
|
rowType: "groupFooter",
|
|
76
|
-
level:
|
|
76
|
+
level: f,
|
|
77
77
|
expanded: C
|
|
78
78
|
});
|
|
79
79
|
}
|
|
@@ -94,17 +94,17 @@ function Q(e, t) {
|
|
|
94
94
|
n[r.depth] = n[r.depth] || [];
|
|
95
95
|
let l = !1;
|
|
96
96
|
n[r.depth].length === 0 && (o <= 1 ? o = 1 + (r.children.length > 0 ? 0 : i - r.depth) : (o--, l = !0)), r.rowSpan = 1 + (r.children.length > 0 ? 0 : i - r.depth), r.kFirst = l, r.index = n[r.depth].length, n[r.depth].push(a), r.ariaColumnIndex = d[r.depth] ? d[r.depth] + 1 : 1;
|
|
97
|
-
for (let
|
|
98
|
-
d[
|
|
97
|
+
for (let f = r.depth; f < r.depth + r.rowSpan; f++)
|
|
98
|
+
d[f] = (d[f] || 0) + r.headerColSpan;
|
|
99
99
|
}), D(n, e, t), E(n, e, t), n;
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function H(e, t, n, i = 0, d = !1) {
|
|
102
102
|
const o = [];
|
|
103
103
|
if (!e)
|
|
104
104
|
return [];
|
|
105
105
|
e && e.length === void 0 && (e = [e]), e.forEach((a, l) => {
|
|
106
106
|
a = a.props ? a.props : a;
|
|
107
|
-
const
|
|
107
|
+
const f = a.id ? a.id : p.generateNavigatableId(`${n.prevId++}`, n.idPrefix, "column"), h = A && a.media && window.matchMedia ? !window.matchMedia(a.media).matches : !1, g = d || h || a.hidden, x = t == null ? void 0 : t.find((I) => I.id === f), s = H(a.children, (x == null ? void 0 : x.children) || [], n, i + 1, g);
|
|
108
108
|
o.push(
|
|
109
109
|
Object.assign(
|
|
110
110
|
{ depth: i },
|
|
@@ -112,7 +112,7 @@ function m(e, t, n, i = 0, d = !1) {
|
|
|
112
112
|
s.length ? { cell: () => null, filterCell: () => null } : {},
|
|
113
113
|
a,
|
|
114
114
|
{
|
|
115
|
-
id:
|
|
115
|
+
id: f,
|
|
116
116
|
declarationIndex: o.length,
|
|
117
117
|
children: s,
|
|
118
118
|
headerColSpan: 0,
|
|
@@ -131,16 +131,16 @@ function m(e, t, n, i = 0, d = !1) {
|
|
|
131
131
|
});
|
|
132
132
|
const r = (a, l) => a.orderIndex === l.orderIndex ? a.declarationIndex - l.declarationIndex : (a.orderIndex || 0) - (l.orderIndex || 0);
|
|
133
133
|
if (o.sort(r), i === 0) {
|
|
134
|
-
const a = [], l = (
|
|
134
|
+
const a = [], l = (f, h) => f.forEach((g) => {
|
|
135
135
|
g.parentIndex = h, l(g.children, a.push(g) - 1);
|
|
136
136
|
});
|
|
137
137
|
return l(o, -1), a;
|
|
138
138
|
}
|
|
139
139
|
return o;
|
|
140
140
|
}
|
|
141
|
-
const
|
|
141
|
+
const T = (e) => Array.isArray(e) ? e : e ? e.data : [];
|
|
142
142
|
function X(e, t, n, i) {
|
|
143
|
-
const d =
|
|
143
|
+
const d = T(e), o = [];
|
|
144
144
|
if (d.length > 0) {
|
|
145
145
|
let r = d[0];
|
|
146
146
|
if (t)
|
|
@@ -174,7 +174,7 @@ function X(e, t, n, i) {
|
|
|
174
174
|
}
|
|
175
175
|
return o;
|
|
176
176
|
}
|
|
177
|
-
const
|
|
177
|
+
const m = (e, t) => {
|
|
178
178
|
var i;
|
|
179
179
|
let n = e[t.parentIndex];
|
|
180
180
|
for (; n; ) {
|
|
@@ -185,11 +185,11 @@ const T = (e, t) => {
|
|
|
185
185
|
return !1;
|
|
186
186
|
}, Y = (e) => e.filter((t) => {
|
|
187
187
|
var n;
|
|
188
|
-
return
|
|
188
|
+
return m(e, t) ? !1 : !!((n = t.cells) != null && n.footerCell) || !(t.children && t.children.length > 0);
|
|
189
189
|
}), Z = (e) => e.width !== void 0 ? Math.floor(parseFloat(e.width.toString())) + "px" : void 0, _ = (e, t) => t && t.filter((n) => n.field === e).length > 0, j = (e) => (e.sort((t, n) => t.declarationIndex - n.declarationIndex), e.map((t) => {
|
|
190
|
-
const { declarationIndex: n, parentIndex: i, depth: d, headerColSpan: o, rowSpan: r, index: a, kFirst: l, children:
|
|
191
|
-
return
|
|
192
|
-
children: j(
|
|
190
|
+
const { declarationIndex: n, parentIndex: i, depth: d, headerColSpan: o, rowSpan: r, index: a, kFirst: l, children: f, ...h } = t;
|
|
191
|
+
return f.length ? {
|
|
192
|
+
children: j(f),
|
|
193
193
|
...h
|
|
194
194
|
} : h;
|
|
195
195
|
})), B = (e) => {
|
|
@@ -203,6 +203,7 @@ const T = (e, t) => {
|
|
|
203
203
|
field: e.field,
|
|
204
204
|
title: e.title,
|
|
205
205
|
width: e.width,
|
|
206
|
+
orderIndex: e.orderIndex,
|
|
206
207
|
hidden: !1,
|
|
207
208
|
children: e.children ? N(e.children) : null
|
|
208
209
|
}), N = (e) => e.map(O), P = (e) => {
|
|
@@ -212,18 +213,18 @@ const T = (e, t) => {
|
|
|
212
213
|
return n(e), t;
|
|
213
214
|
}, G = typeof window != "undefined" && /Firefox/.test(window.navigator.userAgent), ee = 17895697, te = (e) => {
|
|
214
215
|
let t = [];
|
|
215
|
-
return e.sortable && (t = t.concat([
|
|
216
|
+
return e.sortable && (t = t.concat([c.sortAsc, c.sortDesc])), e.pdf && (t.length && (t = t.concat([c.separator])), t = t.concat([c.exportPDF])), t;
|
|
216
217
|
}, ne = (e) => {
|
|
217
218
|
let t = [];
|
|
218
219
|
return e.clipboard && (t = t.concat([
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
])), e.editable && (t.length && (t = t.concat([
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
])), e.selectable && (t.length && (t = t.concat([
|
|
220
|
+
c.copySelection,
|
|
221
|
+
c.copySelectionNoHeaders,
|
|
222
|
+
c.paste
|
|
223
|
+
])), e.editable && (t.length && (t = t.concat([c.separator])), t = t.concat([
|
|
224
|
+
c.create,
|
|
225
|
+
c.edit,
|
|
226
|
+
c.delete
|
|
227
|
+
])), e.selectable && (t.length && (t = t.concat([c.separator])), t = t.concat([c.select])), e.rowReorderable && (t.length && (t = t.concat([c.separator])), t = t.concat([c.reorderRow])), e.pdf && (t.length && (t = t.concat([c.separator])), t = t.concat([c.exportPDF])), t;
|
|
227
228
|
}, re = (e, t) => {
|
|
228
229
|
if (!(!e && !t))
|
|
229
230
|
return t ? e ? {
|
|
@@ -282,10 +283,10 @@ const T = (e, t) => {
|
|
|
282
283
|
}, k = (e) => {
|
|
283
284
|
var t;
|
|
284
285
|
return w.isValidElement(e) ? e : (t = w.Children.toArray(e)) == null ? void 0 : t[0];
|
|
285
|
-
},
|
|
286
|
+
}, fe = (e, t) => {
|
|
286
287
|
const n = k(e);
|
|
287
288
|
return n ? w.cloneElement(n, t) : null;
|
|
288
|
-
},
|
|
289
|
+
}, ce = (e) => {
|
|
289
290
|
let t = 0;
|
|
290
291
|
if (e) {
|
|
291
292
|
const n = e.insertRow(0), i = n.insertCell(0);
|
|
@@ -295,9 +296,9 @@ const T = (e, t) => {
|
|
|
295
296
|
};
|
|
296
297
|
export {
|
|
297
298
|
X as autoGenerateColumns,
|
|
298
|
-
|
|
299
|
+
ce as calcRowHeight,
|
|
299
300
|
B as clientColumn,
|
|
300
|
-
|
|
301
|
+
fe as cloneReactElement,
|
|
301
302
|
G as firefox,
|
|
302
303
|
ee as firefoxMaxHeight,
|
|
303
304
|
R as flatData,
|
|
@@ -307,7 +308,7 @@ export {
|
|
|
307
308
|
O as getColumnState,
|
|
308
309
|
Z as getColumnWidth,
|
|
309
310
|
N as getColumnsState,
|
|
310
|
-
|
|
311
|
+
T as getDataAsArray,
|
|
311
312
|
ne as getDefaultBodyContextMenuItems,
|
|
312
313
|
te as getDefaultHeadContextMenuItems,
|
|
313
314
|
P as getFlatColumnsState,
|
|
@@ -319,7 +320,7 @@ export {
|
|
|
319
320
|
ie as isRowReorderEnabled,
|
|
320
321
|
_ as isSorted,
|
|
321
322
|
Q as mapColumns,
|
|
322
|
-
|
|
323
|
+
H as readColumns,
|
|
323
324
|
re as resolveCells,
|
|
324
325
|
j as sanitizeColumns
|
|
325
326
|
};
|