@progress/kendo-react-grid 9.3.1 → 9.4.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/Grid.js +1 -1
- package/Grid.mjs +80 -1043
- package/GridClientContextReader.js +9 -0
- package/GridClientContextReader.mjs +31 -0
- package/GridClientWrapper.js +9 -0
- package/GridClientWrapper.mjs +793 -0
- package/GridColumn.js +1 -1
- package/GridColumn.mjs +4 -5
- package/GridComponent.js +8 -0
- package/GridComponent.mjs +594 -0
- package/GridSearchBox.js +8 -0
- package/GridSearchBox.mjs +35 -0
- package/GridState.js +9 -0
- package/GridState.mjs +99 -0
- package/GridToolbar.js +1 -1
- package/GridToolbar.mjs +5 -6
- package/GridWatermarkOverlay.js +9 -0
- package/{GridNoRecords.js → GridWatermarkOverlay.mjs} +8 -1
- package/StatusBar.js +1 -1
- package/StatusBar.mjs +24 -25
- package/VirtualScroll.js +1 -1
- package/VirtualScroll.mjs +0 -1
- package/VirtualScrollFixed.js +1 -1
- package/VirtualScrollFixed.mjs +9 -10
- package/cells/GridCell.js +1 -1
- package/cells/GridCell.mjs +22 -34
- package/cells/GridDetailCell.js +1 -1
- package/cells/GridDetailCell.mjs +12 -20
- package/cells/GridDetailHierarchyCell.js +1 -1
- package/cells/GridDetailHierarchyCell.mjs +6 -7
- package/cells/GridEditCell.js +1 -1
- package/cells/GridEditCell.mjs +22 -131
- package/cells/GridFilterCell.js +2 -1
- package/cells/GridGroupCell.js +1 -1
- package/cells/GridGroupCell.mjs +60 -96
- package/cells/GridHierarchyCell.js +1 -1
- package/cells/GridHierarchyCell.mjs +22 -62
- package/cells/GridRowReorderCell.js +8 -0
- package/cells/GridRowReorderCell.mjs +41 -0
- package/cells/GridSelectionCell.js +1 -1
- package/cells/GridSelectionCell.mjs +18 -37
- package/cells/client/DetailCellContainer.js +9 -0
- package/cells/client/DetailCellContainer.mjs +26 -0
- package/cells/client/GridCellContainer.js +9 -0
- package/cells/client/GridCellContainer.mjs +68 -0
- package/cells/client/GridEditCellContainer.js +9 -0
- package/cells/client/GridEditCellContainer.mjs +60 -0
- package/cells/client/GridEditCellEditor.js +9 -0
- package/cells/client/GridEditCellEditor.mjs +81 -0
- package/cells/client/GridGroupCellContainer.js +9 -0
- package/cells/client/GridGroupCellContainer.mjs +87 -0
- package/cells/client/GridGroupCellToggle.js +9 -0
- package/cells/client/GridGroupCellToggle.mjs +52 -0
- package/cells/client/GridHierarchyCellContainer.js +9 -0
- package/cells/client/GridHierarchyCellContainer.mjs +63 -0
- package/cells/client/GridHierarchyCellToggle.js +9 -0
- package/cells/client/GridHierarchyCellToggle.mjs +43 -0
- package/cells/client/GridRowReorderContainer.js +9 -0
- package/cells/client/GridRowReorderContainer.mjs +24 -0
- package/cells/client/GridSelectionCellContainer.js +9 -0
- package/cells/client/GridSelectionCellContainer.mjs +60 -0
- package/cells/client/GridSelectionCellInput.js +9 -0
- package/cells/client/GridSelectionCellInput.mjs +43 -0
- package/codemods/index.js +8 -0
- package/columnMenu/GridColumnMenuCheckboxFilter.js +2 -1
- package/columnMenu/GridColumnMenuColumnsList.js +2 -1
- package/columnMenu/GridColumnMenuColumnsList.mjs +16 -16
- package/columnMenu/GridColumnMenuFilter.js +2 -1
- package/columnMenu/GridColumnMenuFilterCell.js +2 -1
- package/columnMenu/GridColumnMenuFilterCell.mjs +3 -3
- package/columnMenu/GridColumnMenuFilterUI.js +2 -1
- package/columnMenu/GridColumnMenuGroup.js +2 -1
- package/columnMenu/GridColumnMenuGroup.mjs +5 -5
- package/columnMenu/GridColumnMenuItem.js +2 -1
- package/columnMenu/GridColumnMenuItem.mjs +2 -2
- package/columnMenu/GridColumnMenuItemContent.js +2 -1
- package/columnMenu/GridColumnMenuItemContent.mjs +4 -4
- package/columnMenu/GridColumnMenuItemGroup.js +2 -1
- package/columnMenu/GridColumnMenuItemGroup.mjs +4 -4
- package/columnMenu/GridColumnMenuSort.js +2 -1
- package/columnMenu/GridColumnMenuSort.mjs +26 -37
- package/columnMenu/GridColumnMenuWrapper.js +2 -1
- package/components/GridContainerElementContainer.js +9 -0
- package/components/GridContainerElementContainer.mjs +21 -0
- package/components/GridCustomCellClientContainer.js +9 -0
- package/components/GridCustomCellClientContainer.mjs +28 -0
- package/components/GridDragClue.js +9 -0
- package/components/GridDragClue.mjs +18 -0
- package/components/GridDraggableRowsContainer.js +9 -0
- package/components/GridDraggableRowsContainer.mjs +127 -0
- package/components/GridDropClue.js +9 -0
- package/components/GridDropClue.mjs +18 -0
- package/components/GridElementContainer.js +9 -0
- package/components/GridElementContainer.mjs +22 -0
- package/components/GridLoader.js +9 -0
- package/components/GridLoader.mjs +22 -0
- package/components/PagerContainer.js +9 -0
- package/components/PagerContainer.mjs +23 -0
- package/components/VirtualScrollHeightContainer.js +9 -0
- package/components/VirtualScrollHeightContainer.mjs +17 -0
- package/components/colGroup/GridColGroup.js +9 -0
- package/components/colGroup/GridColGroup.mjs +25 -0
- package/components/icons/reorder-row-svg.js +9 -0
- package/components/icons/reorder-row-svg.mjs +14 -0
- package/components/noRecords/GridNoRecords.js +9 -0
- package/{GridNoRecords.mjs → components/noRecords/GridNoRecords.mjs} +6 -6
- package/components/noRecords/GridNoRecordsContainer.js +9 -0
- package/components/noRecords/GridNoRecordsContainer.mjs +30 -0
- package/components/table/GridTable.js +9 -0
- package/components/table/GridTable.mjs +28 -0
- package/components/table/GridTableBody.js +9 -0
- package/components/table/GridTableBody.mjs +21 -0
- package/components/table/GridTableScrollable.js +9 -0
- package/components/table/GridTableScrollable.mjs +37 -0
- package/components/utils.js +8 -0
- package/components/utils.mjs +25 -0
- package/constants/index.js +1 -1
- package/constants/index.mjs +0 -1
- package/contextMenu/GridContextMenu.js +9 -0
- package/contextMenu/GridContextMenu.mjs +191 -0
- package/contextMenu/enums.js +8 -0
- package/contextMenu/enums.mjs +12 -0
- package/dist/cdn/js/kendo-react-grid.js +8 -1
- package/drag/ColumnDraggable.js +2 -1
- package/drag/ColumnDraggable.mjs +7 -7
- package/drag/ColumnResize.js +1 -1
- package/drag/ColumnResize.mjs +0 -1
- package/drag/CommonDragLogic.js +1 -1
- package/drag/CommonDragLogic.mjs +0 -1
- package/drag/GroupingIndicator.js +2 -1
- package/drag/GroupingIndicator.mjs +11 -11
- package/filterCommon.js +1 -1
- package/filterCommon.mjs +4 -5
- package/footer/Footer.js +2 -1
- package/footer/Footer.mjs +22 -21
- package/footer/FooterCell.js +8 -0
- package/footer/FooterCell.mjs +42 -0
- package/footer/FooterRow.js +1 -1
- package/footer/FooterRow.mjs +10 -40
- package/footer/client/FooterCellContainer.js +9 -0
- package/footer/client/FooterCellContainer.mjs +26 -0
- package/header/FilterRow.js +1 -1
- package/header/FilterRow.mjs +57 -55
- package/header/GridHeaderCell.js +2 -1
- package/header/GridHeaderCell.mjs +11 -11
- package/header/GridHeaderSelectionCell.js +2 -1
- package/header/GridHeaderSelectionCell.mjs +10 -9
- package/header/GroupPanel.js +2 -1
- package/header/GroupPanel.mjs +36 -32
- package/header/Header.js +2 -1
- package/header/Header.mjs +35 -33
- package/header/HeaderRow.js +1 -1
- package/header/HeaderRow.mjs +96 -126
- package/header/client/GridFilterCellContainer.js +9 -0
- package/header/client/GridFilterCellContainer.mjs +38 -0
- package/header/client/GridFilterCellElementContainer.js +9 -0
- package/header/client/GridFilterCellElementContainer.mjs +21 -0
- package/header/client/GridHeaderCellContainer.js +9 -0
- package/header/client/GridHeaderCellContainer.mjs +54 -0
- package/header/client/GridHeaderCellElementContainer.js +9 -0
- package/header/client/GridHeaderCellElementContainer.mjs +28 -0
- package/header/client/GridHeaderRowContainer.js +9 -0
- package/header/client/GridHeaderRowContainer.mjs +35 -0
- package/header/client/GridHeaderRowReorderCell.js +9 -0
- package/header/client/GridHeaderRowReorderCell.mjs +13 -0
- package/header/client/HeaderCellResizer.js +9 -0
- package/header/client/HeaderCellResizer.mjs +25 -0
- package/header/client/HeaderRowDraggable.js +9 -0
- package/header/client/HeaderRowDraggable.mjs +30 -0
- package/index.d.mts +601 -25
- package/index.d.ts +601 -25
- package/index.js +1 -1
- package/index.mjs +46 -39
- package/messages/index.js +1 -1
- package/messages/index.mjs +76 -81
- package/messages/messagesMap.js +8 -0
- package/messages/messagesMap.mjs +18 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -3
- package/package.json +27 -11
- package/paging/GridPagerSettings.js +1 -1
- package/paging/GridPagerSettings.mjs +6 -7
- package/rows/GridDetailRow.js +1 -1
- package/rows/GridDetailRow.mjs +2 -3
- package/rows/GridRow.js +2 -1
- package/rows/GridRow.mjs +42 -20
- package/sortCommon.js +8 -0
- package/sortCommon.mjs +27 -0
- package/{interfaces/GridSortSettings.js → utils/_clientModule.js} +2 -1
- package/{interfaces/GridSortSettings.mjs → utils/_clientModule.mjs} +3 -2
- package/utils/_serverModule.js +8 -0
- package/utils/_serverModule.mjs +12 -0
- package/utils/index.js +1 -1
- package/utils/index.mjs +213 -102
package/GridColumn.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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("prop-types"),r=o=>null;r.displayName="KendoReactGridColumn";const l={filterable:!0,editable:!0,sortable:!0,resizable:!0,reorderable:!0,groupable:!0};r.propTypes={field:e.string,title:e.string,editable:e.bool,sortable:e.oneOfType([e.bool,e.shape({allowUnsort:e.bool.isRequired})]),cell:e.any,filterCell:e.any,filterTitle:e.string,filterable:e.bool,filter:e.oneOf(["text","numeric","boolean","date"]),editor:e.oneOf(["text","numeric","boolean","date"]),width:e.oneOfType([e.string,e.number]),minResizableWidth:e.number,headerCell:e.any,footerCell:e.any,headerSelectionValue:e.bool,format:e.string,headerClassName:e.string,className:e.string,reorderable:e.bool,resizable:e.bool,orderIndex:e.number,groupable:e.bool,columnMenu:e.any,menuIcon:e.any,locked:e.bool,hidden:e.bool,media:e.string};exports.GridColumn=r;exports.gridDefaultProps=l;
|
package/GridColumn.mjs
CHANGED
|
@@ -5,10 +5,9 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
import e from "prop-types";
|
|
10
|
-
const
|
|
11
|
-
|
|
9
|
+
const o = (l) => null;
|
|
10
|
+
o.displayName = "KendoReactGridColumn";
|
|
12
11
|
const t = {
|
|
13
12
|
filterable: !0,
|
|
14
13
|
editable: !0,
|
|
@@ -17,7 +16,7 @@ const t = {
|
|
|
17
16
|
reorderable: !0,
|
|
18
17
|
groupable: !0
|
|
19
18
|
};
|
|
20
|
-
|
|
19
|
+
o.propTypes = {
|
|
21
20
|
field: e.string,
|
|
22
21
|
title: e.string,
|
|
23
22
|
editable: e.bool,
|
|
@@ -52,6 +51,6 @@ l.propTypes = {
|
|
|
52
51
|
media: e.string
|
|
53
52
|
};
|
|
54
53
|
export {
|
|
55
|
-
|
|
54
|
+
o as GridColumn,
|
|
56
55
|
t as gridDefaultProps
|
|
57
56
|
};
|
package/GridComponent.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const it=require("react"),d=require("@progress/kendo-react-common"),ot=require("@progress/kendo-data-query"),C=require("@progress/kendo-react-data-tools"),dt=require("./cells/GridSelectionCell.js"),ct=require("./cells/GridHierarchyCell.js"),st=require("./cells/GridEditCell.js"),ut=require("./header/Header.js"),gt=require("./header/HeaderRow.js"),mt=require("./header/FilterRow.js"),ft=require("./header/GroupPanel.js"),bt=require("./footer/Footer.js"),u=require("./utils/index.js"),Ct=require("./cells/GridCell.js"),Ne=require("./cells/GridGroupCell.js"),yt=require("./rows/GridRow.js"),ht=require("./header/GridHeaderSelectionCell.js"),ke=require("./components/noRecords/GridNoRecords.js"),qe=require("./filterCommon.js"),wt=require("./footer/FooterRow.js"),Gt=require("./paging/GridPagerSettings.js"),Rt=require("./package-metadata.js"),Et=require("./cells/GridDetailCell.js"),It=require("./cells/GridDetailHierarchyCell.js"),Fe=require("./components/noRecords/GridNoRecordsContainer.js"),St=require("./GridWatermarkOverlay.js"),De=require("./GridClientWrapper.js"),vt=require("./components/colGroup/GridColGroup.js"),xt=require("./components/table/GridTable.js"),Te=require("./components/GridDropClue.js"),He=require("./components/GridDragClue.js"),Pe=require("./components/table/GridTableBody.js"),Nt=require("./components/PagerContainer.js"),kt=require("./components/table/GridTableScrollable.js"),Ke=require("./components/GridElementContainer.js"),qt=require("./components/GridContainerElementContainer.js"),Ft=require("./components/VirtualScrollHeightContainer.js"),Ve=require("@progress/kendo-react-intl"),ee=require("./messages/index.js"),$=require("./VirtualScrollFixed.js"),Dt=require("./VirtualScroll.js"),Tt=require("./components/GridCustomCellClientContainer.js"),Ht=require("./components/GridDraggableRowsContainer.js"),Pt=require("./cells/GridRowReorderCell.js"),Kt=require("./header/client/GridHeaderRowReorderCell.js"),Ae=require("./components/GridLoader.js");function Vt(e){const x=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const y in e)if(y!=="default"){const R=Object.getOwnPropertyDescriptor(e,y);Object.defineProperty(x,y,R.get?R:{enumerable:!0,get:()=>e[y]})}}return x.default=e,Object.freeze(x)}const l=Vt(it),Be=l.forwardRef((e,x)=>{var we,Ge,Re,Ee,Ie,Se,ve;const y=e.id+"-role-element-id",R=e.navigatable?y:"";d.validatePackage(Rt.packageMetadata);const Oe=(t,r,o,c,i,a,s)=>{const f=[],b=u.flatData(f,E,t,{index:r},o!==void 0,c,i,a,Je.defaultExpand,s);return{flattedData:f,resolvedGroupsCount:b}},Le=t=>{const r=t.filter(i=>i&&i.type&&i.type.displayName==="KendoReactGridColumn"),o=m.current.filter(i=>i.declarationIndex>=0&&i.parentIndex===-1),c=u.sanitizeColumns(o);return u.readColumns(r,c,{prevId:0,idPrefix:R})},_e=t=>t.filter(r=>d.canUseDOM&&r&&r.media?window.matchMedia(r.media).matches:r),ze=(t,r)=>{var i;const o=Le(t),c=_e(o);m.current=c,m.current.length===0&&(m.current=u.autoGenerateColumns(E,e.group,{column:(i=H.column)!=null?i:e.expandField},{prevId:0,idPrefix:R})),Me(m.current,r),N=u.mapColumns(m.current,!0),le.current=m.current.map(u.clientColumn)},Me=(t,r)=>{var i;t.filter(a=>e.selectedField&&a.field===e.selectedField||a.columnType==="checkbox").forEach(a=>{a.width=a.width||"50px",a.cell=a.cell||dt.GridSelectionCell,a._type="edit",a.headerCell=a.headerCell||ht.GridHeaderSelectionCell}),q!==void 0&&t.filter(a=>a.columnType==="reorder").forEach(a=>{a.width=a.width||"50px",a.cell=a.cell||Pt.GridRowReorderCell,a.headerCell=a.headerCell||Kt.GridHeaderRowReorderCell,a.sortable=!1,a.filterable=!1,a.editable=!1});const o={id:"",resizable:!0,width:"32px",title:" ",declarationIndex:-1,orderIndex:-1,children:[],parentIndex:-1,depth:0,colSpan:0,headerColSpan:0,rowSpan:0,left:0,right:0,index:0,rightBorder:!1,ariaColumnIndex:0,isAccessible:!0};let c=0;(e.expandField||H.enabled)&&e.detail&&(t.unshift({...o,_type:"expand",cell:ct.GridHierarchyCell,field:(i=H.column)!=null?i:e.expandField,headerClassName:d.classNames(g.hierarchyCell({}))}),c++);for(let a=0;a<r;a++)t.unshift({...o,isAccessible:!1,cell:Ne.GridGroupCell,field:"value",locked:e.lockGroups}),c++;t.slice(c).forEach(a=>a.parentIndex>=0&&(a.parentIndex+=c))},te=()=>E.length===e.total,We=()=>{const{rowHeight:t,detailRowHeight:r,detail:o,expandField:c}=e,i=te(),a=t!==void 0&&t>0,s=r!==void 0&&r>0;return!a||T&&!i||!!(o&&c)&&(!s||!i)?Dt.VirtualScroll:$.VirtualScrollFixed},U=()=>e.isClient?m:le,je=(t,r,o,c,i,a)=>{let s=u.getColSpan(t,r);if(e.columnVirtualization&&t.colSpan===1)return{colSpan:a,colsToSkip:i};let f=o.length-1===c,b=o.length-c;return e.columnVirtualization&&(f=w.length-1===c,b=w.length-c),s>1&&!f?i=s-1:s=1,b<=s&&!f&&(s=b),{colSpan:s,colsToSkip:i}};let Q,h=[],O;const m=e.columnsRef||{current:[]},le={current:[]};let N=[[]];const $e=e.scrollLeftRef||{current:0},L=e.localization||new Ve.LocalizationService,Ue=e.intl||new Ve.IntlService("en"),k=e.unstyled,g=k&&k.uGrid?k.uGrid:d.uGrid,q=typeof e.rowReorderable=="object"?e.rowReorderable.enabled:e.rowReorderable,F=e.autoProcessData===!0?{group:!0,sort:!0,filter:!0,search:!0,page:!0}:e.autoProcessData;let E,v;if(Array.isArray(e.data)?(E=e.data,v=(we=e.total)!=null?we:E.length):(E=((Ge=e.data)==null?void 0:Ge.data)||[],v=(Ie=(Ee=e.total)!=null?Ee:(Re=e.data)==null?void 0:Re.total)!=null?Ie:E.length),F){const{data:t,total:r}=ot.process(E,{group:F.group?e.group:void 0,sort:F.sort?e.sort:void 0,filter:C.combineFilters(F.filter?e.filter:void 0,F.search?e.search:void 0),...F.page?{take:e.take,skip:e.skip}:{}});E=t,v=(Se=e.total)!=null?Se:r}const{size:I="medium"}=e,Qe=typeof e.groupable=="object"&&e.groupable.footer||"none",D=e.scrollable==="virtual",T=e.groupable===!0||typeof e.groupable=="object"&&e.groupable.enabled!==!1,H=C.getDetailExpandableOptions(!!e.detail),Je=C.getGroupExpandableOptions(typeof e.groupable=="object"&&e.groupable.enabled!==!1?e.groupable.expandable:e.groupable),{resolvedGroupsCount:Xe,flattedData:Ye}=Oe(Qe,e.skip||0,e.group,e.expandField,e.detailExpand,e.groupExpand,e.dataItemKey);h=Ye;const J=We();J===$.VirtualScrollFixed&&te()&&(O=h.slice(e.skip||0,(e.skip||0)+((e.take!==void 0?e.take:e.pageSize)||0)));const ae=C.getSelectionOptions(e.selectable||!!e.selectedField),Ze=ae&&ae.drag?"none":void 0,_=l.Children.toArray(e.children);ze(_,Xe);const re=_.map(t=>t&&t.type&&t.type.displayName==="KendoReactGridToolbar"?l.cloneElement(t,{...t.props,ariaControls:y}):null),z=_.filter(t=>t&&t.type&&t.type.displayName==="KendoReactGridNoRecords"),ne=_.filter(t=>t&&t.type&&t.type.displayName==="KendoReactGridStatusBar"),w=m.current.filter(t=>t.children.length===0),ie=T&&l.createElement(ft.GroupPanel,{columns:U().current,group:e.group||[],ariaControls:y}),oe=l.createElement(ut.Header,{size:I,staticHeaders:e.scrollable!=="none",draggable:e.reorderable||T,headerRow:l.createElement(gt.HeaderRow,{cells:e.cells,sort:e.sort,sortable:e.sortable,group:e.group||[],groupable:T,filter:e.filter,filterable:e.filterable,filterOperators:e.filterOperators||qe.operators,columnMenu:e.columnMenu,columnMenuIcon:e.columnMenuIcon,columns:m.current,columnsMap:N,cellRender:e.headerCellRender,navigatable:!!e.navigatable,localization:L,unstyled:k,headerSelectionValue:!!(e.select&&h.filter(t=>t.rowType==="data").every(t=>e.select&&e.dataItemKey&&d.getter(e.dataItemKey)(t.dataItem)!==void 0?e.select[d.getter(e.dataItemKey)(t.dataItem)]:void 0))}),filterRow:e.filterable&&l.createElement(mt.FilterRow,{cells:e.cells,size:I,columns:m.current,filter:e.filter,filterOperators:e.filterOperators||qe.operators,sort:e.sort,cellRender:e.filterCellRender,navigatable:!!e.navigatable,ariaRowIndex:N.length+1,localization:L})||void 0,cols:w.map((t,r)=>l.createElement("col",{key:r.toString(),width:u.getColumnWidth(t)}))}),pe=$e.current||0,et=parseFloat(((e.style||{}).width||"").toString()),tt=(t,r,o,c)=>{let i=!1;const a=e.selectedField?u.getNestedValue(e.selectedField,t.dataItem):e.select&&e.dataItemKey&&d.getter(e.dataItemKey)(t.dataItem)!==void 0?e.select[d.getter(e.dataItemKey)(t.dataItem)]:void 0;let s=0;const{colSpans:f,hiddenColumns:b}=C.tableColumnsVirtualization({enabled:e.columnVirtualization,columns:w,tableViewPortWidth:et,scrollLeft:pe,getColSpan:u.getColSpan,dataItem:t.dataItem}),S=w.filter((n,G)=>!b[G]);return{row:w.map((n,G)=>{if(b[G])return null;if(s>0)return s--,null;const{colSpan:K,colsToSkip:V}=je(n,t.dataItem,S,G,s,f[G]);s=V;const W=n.id?n.id:G,j=d.classNames(g.contentSticky({locked:n.locked}),n.className),rt=n.left!==void 0?{left:n.left,right:n.right}:{};let xe=!1;if(n.editable&&(e.editable||e.editField)){const B=e.editField?u.getNestedValue(e.editField,t.dataItem):e.edit&&e.dataItemKey?e.edit[d.getter(e.dataItemKey)(t.dataItem)]:void 0,p=typeof B=="boolean"?B:Array.isArray(B)?B.indexOf(n.field)>-1:n.field!==void 0&&B===n.field;p&&n.columnType==="data"&&(p===!0||p===n.field)&&(i=!0,xe=!0)}const Z=n.cell||xe&&st.GridEditCell||Ct.GridCell,nt=e.expandField&&e.detail&&n.field===e.expandField||n._type==="expand",A={locked:e.lockGroups,id:C.tableKeyboardNavigationTools.generateNavigatableId(`${r}-${String(G)}`,R,nt||t.rowType==="groupHeader"||t.rowType==="groupFooter"||n.field==="value"?"nodata":"cell"),colSpan:K,dataItem:t.dataItem,field:n.field,editor:n.editor,format:n.format,columnType:n.columnType,rowReorderable:q,className:j,render:e.cellRender,cells:u.resolveCells(e.cells,n.cells),columnIndex:G,columnsCount:w.length,rowType:t.rowType,level:t.level,expanded:t.expanded,dataIndex:t.dataIndex,rowDataIndex:o,columnPosition:rt,style:{},ariaColumnIndex:n.ariaColumnIndex,isSelected:(n==null?void 0:n._type)==="edit"?a:Array.isArray(a)&&a.indexOf(G)>-1,isSorted:!!u.isSorted(n.field,e.sort),isInEdit:i,isAlt:c,unstyled:k,group:t.group,localization:L,intl:Ue};return n.cell?l.createElement(Tt.GridCustomCellClientContainer,{key:W,isClient:u.isClientReference(Z),dataItem:A.dataItem,rowDataIndex:A.rowDataIndex,columnIndex:A.columnIndex},l.createElement(Z,{...A})):l.createElement(Z,{key:W,...A})}),isInEdit:i,isSelected:typeof a=="boolean"&&a}};let de=0;if(D&&Q)for(let t=0;t<Q.topCacheCount+Q.attendedSkip-(e.skip||0);t++){const r=h.shift();if(r)h.push(r),de++,r.rowType==="groupHeader"&&t--;else break}const ce=t=>t>=h.length-de;let se=e.skip||0;const X=[],ue=!h.length,ge=N.length+(e.filterable?1:0)+1;let P=0;if(h.length){let t=-1,r=0;(O||h).forEach((o,c)=>{o.rowType==="data"&&(se++,t++);const i=se%2===0,a=e.dataItemKey&&d.getter(e.dataItemKey)(o.dataItem),s=c+(e.skip||0),f=a||"ai"+s,b=f+"_1",S=tt(o,f,t,i);if(P=s+ge+r,X.push(l.createElement(yt.GridRow,{key:f,dataItem:o.dataItem,isAltRow:i,isInEdit:S.isInEdit,rowType:o.rowType,isRowReorderable:q,isHidden:ce(c),onClick:null,onDoubleClick:null,selectedField:e.selectedField,rowHeight:e.rowHeight,render:e.rowRender,ariaRowIndex:P,absoluteRowIndex:s,dataIndex:D&&!e.groupable?s:t,isSelected:S.isSelected},S.row)),e.detail&&o.rowType==="data"&&o.expanded){const n=w.length-(e.expandField||H.enabled?1:0)-(e.group?e.group.length:0)||1;r++,P=s+ge+r,X.push(l.createElement("tr",{key:b,className:d.classNames(g.detailTr({isAlt:i})),style:{visibility:ce(c)?"hidden":"",height:e.detailRowHeight},role:"row","aria-rowindex":P},e.group&&e.group.map((G,K)=>{var j;const V=(j=S==null?void 0:S.row[K])==null?void 0:j.props.style,W=V?{left:V.left,right:V.right}:{};return l.createElement(Ne.GridGroupCell,{id:"",dataIndex:o.dataIndex,field:G.field,dataItem:o.dataItem,key:K,columnPosition:W,style:{},ariaColumnIndex:1+K,isSelected:!1,locked:e.lockGroups,cells:e.cells,group:o.group})}),(e.expandField||H.enabled)&&l.createElement(It.GridDetailHierarchyCell,{unstyled:k,id:C.tableKeyboardNavigationTools.generateNavigatableId(`${b}-dhcell`,R)}),l.createElement(Et.GridDetailCell,{dataItem:o.dataItem,dataIndex:o.dataIndex,colSpan:n,ariaColIndex:2+(e.group?e.group.length:0),detail:e.detail,id:C.tableKeyboardNavigationTools.generateNavigatableId(`${b}-dcell`,R)})))}})}const me={size:I,total:v,skip:e.skip||0,take:(e.take!==void 0?e.take:e.pageSize)||10,...Gt.normalize(e.pageable||{})},fe=l.createElement(Nt.PagerContainer,null,e.pager?l.createElement(e.pager,{...me}):l.createElement(C.Pager,{className:d.classNames(g.pager({})),...me})),lt=(t,r)=>l.createElement("col",{key:r.toString(),width:u.getColumnWidth(t)}),at=(ve=e.cells)!=null&&ve.footerCell||m.current.some(t=>{var r;return!!(t.footerCell||(r=t.cells)!=null&&r.footerCell)})?l.createElement(bt.Footer,{size:I,staticHeaders:e.scrollable!=="none",row:l.createElement(wt.FooterRow,{cells:e.cells,idPrefix:R,columns:m.current,ariaRowIndex:P+1}),cols:w.map(lt)}):null,be=l.createElement(vt.GridColGroup,null,w.map((t,r)=>l.createElement("col",{key:r.toString(),className:u.isSorted(t.field,e.sort)?d.classNames(g.sorted({})):void 0,width:u.getColumnWidth(t)}))),Ce=e.reorderable||T,{detail:At,cells:Bt,...ye}=e,he=l.createElement("tbody",{role:"rowgroup",className:d.classNames(g.tbody({})),...C.tableKeyboardNavigationBodyAttributes},X);let Y=he;if(q&&(Y=l.createElement(Ht.GridReorderableRowsContainer,{unstyled:g,columns:m.current,rowReorderSettings:e.rowReorderable},he)),e.scrollable==="none")return l.createElement(De.GridClientWrapper,{gridRef:x,gridProps:ye,columnsRef:U(),columnsMapRef:N,dataRef:h,slicedData:O,isFixedVirtualScroll:J===$.VirtualScrollFixed,id:y,total:v,detailExpandable:!!e.detail},l.createElement(Ke.GridElementContainer,null,l.createElement("div",{id:e.id,style:e.style,className:d.classNames(g.wrapper({size:I}),e.className),"aria-label":e.ariaLabel,...C.tableKeyboardNavigationScopeAttributes},re,ie,l.createElement(xt.GridTable,{selectable:e.selectable,className:d.classNames(g.table({size:I}))},be,oe,l.createElement(Pe.GridTableBody,{rowReorderable:q},Y)),ue&&l.createElement(Fe.GridNoRecordsContainer,null,z.length?z:l.createElement(ke.GridNoRecords,null)),Ce&&l.createElement(l.Fragment,null,l.createElement(Te.GridDropClue,null),l.createElement(He.GridDragClue,null)))),ne,e.pageable&&fe,l.createElement(Ae.GridLoader,{loader:e.loader,showLoader:e.showLoader}));let M=e.style||{};return D&&(M.height||(M=Object.assign({},M,{height:"450px"}))),l.createElement(De.GridClientWrapper,{gridRef:x,gridProps:ye,columnsRef:U(),columnsMapRef:N,dataRef:h,slicedData:O,isFixedVirtualScroll:J===$.VirtualScrollFixed,id:y,total:v,detailExpandable:!!e.detail},l.createElement(Ke.GridElementContainer,null,l.createElement("div",{id:e.id,style:M,className:d.classNames(g.wrapper({size:I,virtual:D}),e.className),"aria-label":e.ariaLabel,...C.tableKeyboardNavigationScopeAttributes},re,ie,l.createElement("div",{className:d.classNames(g.ariaRoot({})),role:"grid","aria-colcount":w.length,"aria-rowcount":v,id:y,"aria-label":L.toLanguageString(ee.gridAriaLabel,ee.messages[ee.gridAriaLabel])},oe,l.createElement("div",{className:d.classNames(g.container({})),role:"presentation"},l.createElement(qt.GridContainerElementContainer,null,l.createElement("div",{className:d.classNames(g.content({})),role:"presentation"},l.createElement("div",{className:d.classNames(g.tableWrap({})),role:"presentation"},l.createElement(kt.GridTableScrollable,{selectable:e.selectable,tableClassName:d.classNames(g.table({size:I})),tableStyle:{userSelect:Ze}},be,l.createElement(Pe.GridTableBody,{rowReorderable:q},Y)),ue&&l.createElement(Fe.GridNoRecordsContainer,null,z.length?z:l.createElement(ke.GridNoRecords,null))),D&&l.createElement("div",{className:d.classNames(g.heightContainer({})),role:"presentation"},l.createElement(Ft.VirtualScrollHeightContainer,{isVirtualScroll:D}))))),at,Ce&&l.createElement(l.Fragment,null,l.createElement(Te.GridDropClue,null),l.createElement(He.GridDragClue,null)),l.createElement(St.GridWatermarkOverlay,null)),ne,e.pageable&&fe,l.createElement(Ae.GridLoader,{loader:e.loader,showLoader:e.showLoader}))))});Be.displayName="KendoReactGridComponent";exports.GridComponent=Be;
|
|
@@ -0,0 +1,594 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import * as l from "react";
|
|
9
|
+
import { validatePackage as ct, uGrid as st, getter as F, classNames as m, canUseDOM as mt } from "@progress/kendo-react-common";
|
|
10
|
+
import { process as ut } from "@progress/kendo-data-query";
|
|
11
|
+
import { combineFilters as ft, getDetailExpandableOptions as gt, getGroupExpandableOptions as bt, getSelectionOptions as yt, tableKeyboardNavigationTools as q, Pager as ht, tableKeyboardNavigationBodyAttributes as Ct, tableKeyboardNavigationScopeAttributes as ke, tableColumnsVirtualization as wt } from "@progress/kendo-react-data-tools";
|
|
12
|
+
import { GridSelectionCell as Et } from "./cells/GridSelectionCell.mjs";
|
|
13
|
+
import { GridHierarchyCell as It } from "./cells/GridHierarchyCell.mjs";
|
|
14
|
+
import { GridEditCell as Rt } from "./cells/GridEditCell.mjs";
|
|
15
|
+
import { Header as vt } from "./header/Header.mjs";
|
|
16
|
+
import { HeaderRow as xt } from "./header/HeaderRow.mjs";
|
|
17
|
+
import { FilterRow as St } from "./header/FilterRow.mjs";
|
|
18
|
+
import { GroupPanel as Gt } from "./header/GroupPanel.mjs";
|
|
19
|
+
import { Footer as kt } from "./footer/Footer.mjs";
|
|
20
|
+
import { getColumnWidth as p, isSorted as Ne, flatData as Nt, autoGenerateColumns as Ft, mapColumns as Dt, clientColumn as Tt, getNestedValue as Fe, getColSpan as De, resolveCells as Kt, isClientReference as Ht, sanitizeColumns as At, readColumns as Pt } from "./utils/index.mjs";
|
|
21
|
+
import { GridCell as Bt } from "./cells/GridCell.mjs";
|
|
22
|
+
import { GridGroupCell as Te } from "./cells/GridGroupCell.mjs";
|
|
23
|
+
import { GridRow as Vt } from "./rows/GridRow.mjs";
|
|
24
|
+
import { GridHeaderSelectionCell as Lt } from "./header/GridHeaderSelectionCell.mjs";
|
|
25
|
+
import { GridNoRecords as Ke } from "./components/noRecords/GridNoRecords.mjs";
|
|
26
|
+
import { operators as He } from "./filterCommon.mjs";
|
|
27
|
+
import { FooterRow as zt } from "./footer/FooterRow.mjs";
|
|
28
|
+
import { normalize as Ot } from "./paging/GridPagerSettings.mjs";
|
|
29
|
+
import { packageMetadata as _t } from "./package-metadata.mjs";
|
|
30
|
+
import { GridDetailCell as Mt } from "./cells/GridDetailCell.mjs";
|
|
31
|
+
import { GridDetailHierarchyCell as Wt } from "./cells/GridDetailHierarchyCell.mjs";
|
|
32
|
+
import { GridNoRecordsContainer as Ae } from "./components/noRecords/GridNoRecordsContainer.mjs";
|
|
33
|
+
import { GridWatermarkOverlay as jt } from "./GridWatermarkOverlay.mjs";
|
|
34
|
+
import { GridClientWrapper as Pe } from "./GridClientWrapper.mjs";
|
|
35
|
+
import { GridColGroup as $t } from "./components/colGroup/GridColGroup.mjs";
|
|
36
|
+
import { GridTable as Ut } from "./components/table/GridTable.mjs";
|
|
37
|
+
import { GridDropClue as Be } from "./components/GridDropClue.mjs";
|
|
38
|
+
import { GridDragClue as Ve } from "./components/GridDragClue.mjs";
|
|
39
|
+
import { GridTableBody as Le } from "./components/table/GridTableBody.mjs";
|
|
40
|
+
import { PagerContainer as Jt } from "./components/PagerContainer.mjs";
|
|
41
|
+
import { GridTableScrollable as Qt } from "./components/table/GridTableScrollable.mjs";
|
|
42
|
+
import { GridElementContainer as ze } from "./components/GridElementContainer.mjs";
|
|
43
|
+
import { GridContainerElementContainer as Xt } from "./components/GridContainerElementContainer.mjs";
|
|
44
|
+
import { VirtualScrollHeightContainer as Yt } from "./components/VirtualScrollHeightContainer.mjs";
|
|
45
|
+
import { LocalizationService as Zt, IntlService as qt } from "@progress/kendo-react-intl";
|
|
46
|
+
import { gridAriaLabel as Oe, messages as pt } from "./messages/index.mjs";
|
|
47
|
+
import { VirtualScrollFixed as j } from "./VirtualScrollFixed.mjs";
|
|
48
|
+
import { VirtualScroll as el } from "./VirtualScroll.mjs";
|
|
49
|
+
import { GridCustomCellClientContainer as tl } from "./components/GridCustomCellClientContainer.mjs";
|
|
50
|
+
import { GridReorderableRowsContainer as ll } from "./components/GridDraggableRowsContainer.mjs";
|
|
51
|
+
import { GridRowReorderCell as al } from "./cells/GridRowReorderCell.mjs";
|
|
52
|
+
import { GridHeaderRowReorderCell as rl } from "./header/client/GridHeaderRowReorderCell.mjs";
|
|
53
|
+
import { GridLoader as _e } from "./components/GridLoader.mjs";
|
|
54
|
+
const nl = l.forwardRef((e, ee) => {
|
|
55
|
+
var we, Ee, Ie, Re, ve, xe, Se;
|
|
56
|
+
const R = e.id + "-role-element-id", v = e.navigatable ? R : "";
|
|
57
|
+
ct(_t);
|
|
58
|
+
const Me = (t, r, o, d, i, a, c) => {
|
|
59
|
+
const f = [], g = Nt(
|
|
60
|
+
f,
|
|
61
|
+
C,
|
|
62
|
+
t,
|
|
63
|
+
{ index: r },
|
|
64
|
+
o !== void 0,
|
|
65
|
+
d,
|
|
66
|
+
i,
|
|
67
|
+
a,
|
|
68
|
+
qe.defaultExpand,
|
|
69
|
+
c
|
|
70
|
+
);
|
|
71
|
+
return { flattedData: f, resolvedGroupsCount: g };
|
|
72
|
+
}, We = (t) => {
|
|
73
|
+
const r = t.filter(
|
|
74
|
+
(i) => i && i.type && i.type.displayName === "KendoReactGridColumn"
|
|
75
|
+
), o = u.current.filter((i) => i.declarationIndex >= 0 && i.parentIndex === -1), d = At(o);
|
|
76
|
+
return Pt(r, d, { prevId: 0, idPrefix: v });
|
|
77
|
+
}, je = (t) => t.filter((r) => mt && r && r.media ? window.matchMedia(r.media).matches : r), $e = (t, r) => {
|
|
78
|
+
var i;
|
|
79
|
+
const o = We(t), d = je(o);
|
|
80
|
+
u.current = d, u.current.length === 0 && (u.current = Ft(
|
|
81
|
+
C,
|
|
82
|
+
e.group,
|
|
83
|
+
{
|
|
84
|
+
column: (i = T.column) != null ? i : e.expandField
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
prevId: 0,
|
|
88
|
+
idPrefix: v
|
|
89
|
+
}
|
|
90
|
+
)), Ue(u.current, r), x = Dt(u.current, !0), le.current = u.current.map(Tt);
|
|
91
|
+
}, Ue = (t, r) => {
|
|
92
|
+
var i;
|
|
93
|
+
t.filter((a) => e.selectedField && a.field === e.selectedField || a.columnType === "checkbox").forEach((a) => {
|
|
94
|
+
a.width = a.width || "50px", a.cell = a.cell || Et, a._type = "edit", a.headerCell = a.headerCell || Lt;
|
|
95
|
+
}), G !== void 0 && t.filter((a) => a.columnType === "reorder").forEach((a) => {
|
|
96
|
+
a.width = a.width || "50px", a.cell = a.cell || al, a.headerCell = a.headerCell || rl, a.sortable = !1, a.filterable = !1, a.editable = !1;
|
|
97
|
+
});
|
|
98
|
+
const o = {
|
|
99
|
+
id: "",
|
|
100
|
+
resizable: !0,
|
|
101
|
+
width: "32px",
|
|
102
|
+
title: " ",
|
|
103
|
+
declarationIndex: -1,
|
|
104
|
+
orderIndex: -1,
|
|
105
|
+
children: [],
|
|
106
|
+
parentIndex: -1,
|
|
107
|
+
depth: 0,
|
|
108
|
+
colSpan: 0,
|
|
109
|
+
headerColSpan: 0,
|
|
110
|
+
rowSpan: 0,
|
|
111
|
+
left: 0,
|
|
112
|
+
right: 0,
|
|
113
|
+
index: 0,
|
|
114
|
+
rightBorder: !1,
|
|
115
|
+
ariaColumnIndex: 0,
|
|
116
|
+
isAccessible: !0
|
|
117
|
+
};
|
|
118
|
+
let d = 0;
|
|
119
|
+
(e.expandField || T.enabled) && e.detail && (t.unshift({
|
|
120
|
+
...o,
|
|
121
|
+
_type: "expand",
|
|
122
|
+
cell: It,
|
|
123
|
+
field: (i = T.column) != null ? i : e.expandField,
|
|
124
|
+
headerClassName: m(s.hierarchyCell({}))
|
|
125
|
+
}), d++);
|
|
126
|
+
for (let a = 0; a < r; a++)
|
|
127
|
+
t.unshift({
|
|
128
|
+
...o,
|
|
129
|
+
isAccessible: !1,
|
|
130
|
+
cell: Te,
|
|
131
|
+
field: "value",
|
|
132
|
+
locked: e.lockGroups
|
|
133
|
+
}), d++;
|
|
134
|
+
t.slice(d).forEach((a) => a.parentIndex >= 0 && (a.parentIndex += d));
|
|
135
|
+
}, te = () => C.length === e.total, Je = () => {
|
|
136
|
+
const { rowHeight: t, detailRowHeight: r, detail: o, expandField: d } = e, i = te(), a = t !== void 0 && t > 0, c = r !== void 0 && r > 0;
|
|
137
|
+
return !a || D && !i || !!(o && d) && (!c || !i) ? el : j;
|
|
138
|
+
}, $ = () => e.isClient ? u : le, Qe = (t, r, o, d, i, a) => {
|
|
139
|
+
let c = De(t, r);
|
|
140
|
+
if (e.columnVirtualization && t.colSpan === 1)
|
|
141
|
+
return { colSpan: a, colsToSkip: i };
|
|
142
|
+
let f = o.length - 1 === d, g = o.length - d;
|
|
143
|
+
return e.columnVirtualization && (f = y.length - 1 === d, g = y.length - d), c > 1 && !f ? i = c - 1 : c = 1, g <= c && !f && (c = g), { colSpan: c, colsToSkip: i };
|
|
144
|
+
};
|
|
145
|
+
let U, b = [], V;
|
|
146
|
+
const u = e.columnsRef || { current: [] }, le = { current: [] };
|
|
147
|
+
let x = [[]];
|
|
148
|
+
const Xe = e.scrollLeftRef || { current: 0 }, L = e.localization || new Zt(), Ye = e.intl || new qt("en"), S = e.unstyled, s = S && S.uGrid ? S.uGrid : st, G = typeof e.rowReorderable == "object" ? e.rowReorderable.enabled : e.rowReorderable, k = e.autoProcessData === !0 ? {
|
|
149
|
+
group: !0,
|
|
150
|
+
sort: !0,
|
|
151
|
+
filter: !0,
|
|
152
|
+
search: !0,
|
|
153
|
+
page: !0
|
|
154
|
+
} : e.autoProcessData;
|
|
155
|
+
let C, I;
|
|
156
|
+
if (Array.isArray(e.data) ? (C = e.data, I = (we = e.total) != null ? we : C.length) : (C = ((Ee = e.data) == null ? void 0 : Ee.data) || [], I = (ve = (Re = e.total) != null ? Re : (Ie = e.data) == null ? void 0 : Ie.total) != null ? ve : C.length), k) {
|
|
157
|
+
const { data: t, total: r } = ut(C, {
|
|
158
|
+
group: k.group ? e.group : void 0,
|
|
159
|
+
sort: k.sort ? e.sort : void 0,
|
|
160
|
+
filter: ft(
|
|
161
|
+
k.filter ? e.filter : void 0,
|
|
162
|
+
k.search ? e.search : void 0
|
|
163
|
+
),
|
|
164
|
+
...k.page ? {
|
|
165
|
+
take: e.take,
|
|
166
|
+
skip: e.skip
|
|
167
|
+
} : {}
|
|
168
|
+
});
|
|
169
|
+
C = t, I = (xe = e.total) != null ? xe : r;
|
|
170
|
+
}
|
|
171
|
+
const { size: w = "medium" } = e, Ze = typeof e.groupable == "object" && e.groupable.footer || "none", N = e.scrollable === "virtual", D = e.groupable === !0 || typeof e.groupable == "object" && e.groupable.enabled !== !1, T = gt(!!e.detail), qe = bt(
|
|
172
|
+
typeof e.groupable == "object" && e.groupable.enabled !== !1 ? e.groupable.expandable : e.groupable
|
|
173
|
+
), { resolvedGroupsCount: pe, flattedData: et } = Me(
|
|
174
|
+
Ze,
|
|
175
|
+
e.skip || 0,
|
|
176
|
+
e.group,
|
|
177
|
+
e.expandField,
|
|
178
|
+
e.detailExpand,
|
|
179
|
+
e.groupExpand,
|
|
180
|
+
e.dataItemKey
|
|
181
|
+
);
|
|
182
|
+
b = et;
|
|
183
|
+
const J = Je();
|
|
184
|
+
J === j && te() && (V = b.slice(
|
|
185
|
+
e.skip || 0,
|
|
186
|
+
(e.skip || 0) + ((e.take !== void 0 ? e.take : e.pageSize) || 0)
|
|
187
|
+
));
|
|
188
|
+
const ae = yt(e.selectable || !!e.selectedField), tt = ae && ae.drag ? "none" : void 0, z = l.Children.toArray(e.children);
|
|
189
|
+
$e(z, pe);
|
|
190
|
+
const re = z.map((t) => t && t.type && t.type.displayName === "KendoReactGridToolbar" ? l.cloneElement(t, { ...t.props, ariaControls: R }) : null), O = z.filter((t) => t && t.type && t.type.displayName === "KendoReactGridNoRecords"), ne = z.filter(
|
|
191
|
+
(t) => t && t.type && t.type.displayName === "KendoReactGridStatusBar"
|
|
192
|
+
), y = u.current.filter((t) => t.children.length === 0), ie = D && /* @__PURE__ */ l.createElement(Gt, { columns: $().current, group: e.group || [], ariaControls: R }), oe = /* @__PURE__ */ l.createElement(
|
|
193
|
+
vt,
|
|
194
|
+
{
|
|
195
|
+
size: w,
|
|
196
|
+
staticHeaders: e.scrollable !== "none",
|
|
197
|
+
draggable: e.reorderable || D,
|
|
198
|
+
headerRow: /* @__PURE__ */ l.createElement(
|
|
199
|
+
xt,
|
|
200
|
+
{
|
|
201
|
+
cells: e.cells,
|
|
202
|
+
sort: e.sort,
|
|
203
|
+
sortable: e.sortable,
|
|
204
|
+
group: e.group || [],
|
|
205
|
+
groupable: D,
|
|
206
|
+
filter: e.filter,
|
|
207
|
+
filterable: e.filterable,
|
|
208
|
+
filterOperators: e.filterOperators || He,
|
|
209
|
+
columnMenu: e.columnMenu,
|
|
210
|
+
columnMenuIcon: e.columnMenuIcon,
|
|
211
|
+
columns: u.current,
|
|
212
|
+
columnsMap: x,
|
|
213
|
+
cellRender: e.headerCellRender,
|
|
214
|
+
navigatable: !!e.navigatable,
|
|
215
|
+
localization: L,
|
|
216
|
+
unstyled: S,
|
|
217
|
+
headerSelectionValue: !!(e.select && b.filter((t) => t.rowType === "data").every(
|
|
218
|
+
(t) => e.select && e.dataItemKey && F(e.dataItemKey)(t.dataItem) !== void 0 ? e.select[F(e.dataItemKey)(t.dataItem)] : void 0
|
|
219
|
+
))
|
|
220
|
+
}
|
|
221
|
+
),
|
|
222
|
+
filterRow: e.filterable && /* @__PURE__ */ l.createElement(
|
|
223
|
+
St,
|
|
224
|
+
{
|
|
225
|
+
cells: e.cells,
|
|
226
|
+
size: w,
|
|
227
|
+
columns: u.current,
|
|
228
|
+
filter: e.filter,
|
|
229
|
+
filterOperators: e.filterOperators || He,
|
|
230
|
+
sort: e.sort,
|
|
231
|
+
cellRender: e.filterCellRender,
|
|
232
|
+
navigatable: !!e.navigatable,
|
|
233
|
+
ariaRowIndex: x.length + 1,
|
|
234
|
+
localization: L
|
|
235
|
+
}
|
|
236
|
+
) || void 0,
|
|
237
|
+
cols: y.map((t, r) => /* @__PURE__ */ l.createElement("col", { key: r.toString(), width: p(t) }))
|
|
238
|
+
}
|
|
239
|
+
), lt = Xe.current || 0, at = parseFloat(((e.style || {}).width || "").toString()), rt = (t, r, o, d) => {
|
|
240
|
+
let i = !1;
|
|
241
|
+
const a = e.selectedField ? Fe(e.selectedField, t.dataItem) : e.select && e.dataItemKey && F(e.dataItemKey)(t.dataItem) !== void 0 ? e.select[F(e.dataItemKey)(t.dataItem)] : void 0;
|
|
242
|
+
let c = 0;
|
|
243
|
+
const { colSpans: f, hiddenColumns: g } = wt({
|
|
244
|
+
enabled: e.columnVirtualization,
|
|
245
|
+
columns: y,
|
|
246
|
+
tableViewPortWidth: at,
|
|
247
|
+
scrollLeft: lt,
|
|
248
|
+
getColSpan: De,
|
|
249
|
+
dataItem: t.dataItem
|
|
250
|
+
}), E = y.filter((n, h) => !g[h]);
|
|
251
|
+
return {
|
|
252
|
+
row: y.map((n, h) => {
|
|
253
|
+
if (g[h])
|
|
254
|
+
return null;
|
|
255
|
+
if (c > 0)
|
|
256
|
+
return c--, null;
|
|
257
|
+
const { colSpan: H, colsToSkip: A } = Qe(
|
|
258
|
+
n,
|
|
259
|
+
t.dataItem,
|
|
260
|
+
E,
|
|
261
|
+
h,
|
|
262
|
+
c,
|
|
263
|
+
f[h]
|
|
264
|
+
);
|
|
265
|
+
c = A;
|
|
266
|
+
const M = n.id ? n.id : h, W = m(s.contentSticky({ locked: n.locked }), n.className), ot = n.left !== void 0 ? { left: n.left, right: n.right } : {};
|
|
267
|
+
let Ge = !1;
|
|
268
|
+
if (n.editable && (e.editable || e.editField)) {
|
|
269
|
+
const B = e.editField ? Fe(e.editField, t.dataItem) : e.edit && e.dataItemKey ? e.edit[F(e.dataItemKey)(t.dataItem)] : void 0, Z = typeof B == "boolean" ? B : Array.isArray(B) ? B.indexOf(n.field) > -1 : n.field !== void 0 && B === n.field;
|
|
270
|
+
Z && n.columnType === "data" && (Z === !0 || Z === n.field) && (i = !0, Ge = !0);
|
|
271
|
+
}
|
|
272
|
+
const Y = n.cell || Ge && Rt || Bt, dt = e.expandField && e.detail && n.field === e.expandField || n._type === "expand", P = {
|
|
273
|
+
locked: e.lockGroups,
|
|
274
|
+
id: q.generateNavigatableId(
|
|
275
|
+
`${r}-${String(h)}`,
|
|
276
|
+
v,
|
|
277
|
+
dt || t.rowType === "groupHeader" || t.rowType === "groupFooter" || n.field === "value" ? "nodata" : "cell"
|
|
278
|
+
),
|
|
279
|
+
colSpan: H,
|
|
280
|
+
dataItem: t.dataItem,
|
|
281
|
+
field: n.field,
|
|
282
|
+
editor: n.editor,
|
|
283
|
+
format: n.format,
|
|
284
|
+
columnType: n.columnType,
|
|
285
|
+
rowReorderable: G,
|
|
286
|
+
className: W,
|
|
287
|
+
render: e.cellRender,
|
|
288
|
+
cells: Kt(e.cells, n.cells),
|
|
289
|
+
columnIndex: h,
|
|
290
|
+
columnsCount: y.length,
|
|
291
|
+
rowType: t.rowType,
|
|
292
|
+
level: t.level,
|
|
293
|
+
expanded: t.expanded,
|
|
294
|
+
dataIndex: t.dataIndex,
|
|
295
|
+
rowDataIndex: o,
|
|
296
|
+
columnPosition: ot,
|
|
297
|
+
style: {},
|
|
298
|
+
ariaColumnIndex: n.ariaColumnIndex,
|
|
299
|
+
isSelected: (n == null ? void 0 : n._type) === "edit" ? a : Array.isArray(a) && a.indexOf(h) > -1,
|
|
300
|
+
isSorted: !!Ne(n.field, e.sort),
|
|
301
|
+
isInEdit: i,
|
|
302
|
+
isAlt: d,
|
|
303
|
+
unstyled: S,
|
|
304
|
+
group: t.group,
|
|
305
|
+
localization: L,
|
|
306
|
+
intl: Ye
|
|
307
|
+
};
|
|
308
|
+
return n.cell ? /* @__PURE__ */ l.createElement(
|
|
309
|
+
tl,
|
|
310
|
+
{
|
|
311
|
+
key: M,
|
|
312
|
+
isClient: Ht(Y),
|
|
313
|
+
dataItem: P.dataItem,
|
|
314
|
+
rowDataIndex: P.rowDataIndex,
|
|
315
|
+
columnIndex: P.columnIndex
|
|
316
|
+
},
|
|
317
|
+
/* @__PURE__ */ l.createElement(Y, { ...P })
|
|
318
|
+
) : /* @__PURE__ */ l.createElement(Y, { key: M, ...P });
|
|
319
|
+
}),
|
|
320
|
+
isInEdit: i,
|
|
321
|
+
isSelected: typeof a == "boolean" && a
|
|
322
|
+
};
|
|
323
|
+
};
|
|
324
|
+
let de = 0;
|
|
325
|
+
if (N && U)
|
|
326
|
+
for (let t = 0; t < U.topCacheCount + U.attendedSkip - (e.skip || 0); t++) {
|
|
327
|
+
const r = b.shift();
|
|
328
|
+
if (r)
|
|
329
|
+
b.push(r), de++, r.rowType === "groupHeader" && t--;
|
|
330
|
+
else
|
|
331
|
+
break;
|
|
332
|
+
}
|
|
333
|
+
const ce = (t) => t >= b.length - de;
|
|
334
|
+
let se = e.skip || 0;
|
|
335
|
+
const Q = [], me = !b.length, ue = x.length + (e.filterable ? 1 : 0) + 1;
|
|
336
|
+
let K = 0;
|
|
337
|
+
if (b.length) {
|
|
338
|
+
let t = -1, r = 0;
|
|
339
|
+
(V || b).forEach((o, d) => {
|
|
340
|
+
o.rowType === "data" && (se++, t++);
|
|
341
|
+
const i = se % 2 === 0, a = e.dataItemKey && F(e.dataItemKey)(o.dataItem), c = d + (e.skip || 0), f = a || "ai" + c, g = f + "_1", E = rt(o, f, t, i);
|
|
342
|
+
if (K = c + ue + r, Q.push(
|
|
343
|
+
/* @__PURE__ */ l.createElement(
|
|
344
|
+
Vt,
|
|
345
|
+
{
|
|
346
|
+
key: f,
|
|
347
|
+
dataItem: o.dataItem,
|
|
348
|
+
isAltRow: i,
|
|
349
|
+
isInEdit: E.isInEdit,
|
|
350
|
+
rowType: o.rowType,
|
|
351
|
+
isRowReorderable: G,
|
|
352
|
+
isHidden: ce(d),
|
|
353
|
+
onClick: null,
|
|
354
|
+
onDoubleClick: null,
|
|
355
|
+
selectedField: e.selectedField,
|
|
356
|
+
rowHeight: e.rowHeight,
|
|
357
|
+
render: e.rowRender,
|
|
358
|
+
ariaRowIndex: K,
|
|
359
|
+
absoluteRowIndex: c,
|
|
360
|
+
dataIndex: N && !e.groupable ? c : t,
|
|
361
|
+
isSelected: E.isSelected
|
|
362
|
+
},
|
|
363
|
+
E.row
|
|
364
|
+
)
|
|
365
|
+
), e.detail && o.rowType === "data" && o.expanded) {
|
|
366
|
+
const n = y.length - (e.expandField || T.enabled ? 1 : 0) - (e.group ? e.group.length : 0) || 1;
|
|
367
|
+
r++, K = c + ue + r, Q.push(
|
|
368
|
+
/* @__PURE__ */ l.createElement(
|
|
369
|
+
"tr",
|
|
370
|
+
{
|
|
371
|
+
key: g,
|
|
372
|
+
className: m(s.detailTr({ isAlt: i })),
|
|
373
|
+
style: {
|
|
374
|
+
visibility: ce(d) ? "hidden" : "",
|
|
375
|
+
height: e.detailRowHeight
|
|
376
|
+
},
|
|
377
|
+
role: "row",
|
|
378
|
+
"aria-rowindex": K
|
|
379
|
+
},
|
|
380
|
+
e.group && e.group.map((h, H) => {
|
|
381
|
+
var W;
|
|
382
|
+
const A = (W = E == null ? void 0 : E.row[H]) == null ? void 0 : W.props.style, M = A ? { left: A.left, right: A.right } : {};
|
|
383
|
+
return /* @__PURE__ */ l.createElement(
|
|
384
|
+
Te,
|
|
385
|
+
{
|
|
386
|
+
id: "",
|
|
387
|
+
dataIndex: o.dataIndex,
|
|
388
|
+
field: h.field,
|
|
389
|
+
dataItem: o.dataItem,
|
|
390
|
+
key: H,
|
|
391
|
+
columnPosition: M,
|
|
392
|
+
style: {},
|
|
393
|
+
ariaColumnIndex: 1 + H,
|
|
394
|
+
isSelected: !1,
|
|
395
|
+
locked: e.lockGroups,
|
|
396
|
+
cells: e.cells,
|
|
397
|
+
group: o.group
|
|
398
|
+
}
|
|
399
|
+
);
|
|
400
|
+
}),
|
|
401
|
+
(e.expandField || T.enabled) && /* @__PURE__ */ l.createElement(
|
|
402
|
+
Wt,
|
|
403
|
+
{
|
|
404
|
+
unstyled: S,
|
|
405
|
+
id: q.generateNavigatableId(`${g}-dhcell`, v)
|
|
406
|
+
}
|
|
407
|
+
),
|
|
408
|
+
/* @__PURE__ */ l.createElement(
|
|
409
|
+
Mt,
|
|
410
|
+
{
|
|
411
|
+
dataItem: o.dataItem,
|
|
412
|
+
dataIndex: o.dataIndex,
|
|
413
|
+
colSpan: n,
|
|
414
|
+
ariaColIndex: 2 + (e.group ? e.group.length : 0),
|
|
415
|
+
detail: e.detail,
|
|
416
|
+
id: q.generateNavigatableId(`${g}-dcell`, v)
|
|
417
|
+
}
|
|
418
|
+
)
|
|
419
|
+
)
|
|
420
|
+
);
|
|
421
|
+
}
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
const fe = {
|
|
425
|
+
size: w,
|
|
426
|
+
total: I,
|
|
427
|
+
skip: e.skip || 0,
|
|
428
|
+
take: (e.take !== void 0 ? e.take : e.pageSize) || 10,
|
|
429
|
+
...Ot(e.pageable || {})
|
|
430
|
+
}, ge = /* @__PURE__ */ l.createElement(Jt, null, e.pager ? /* @__PURE__ */ l.createElement(e.pager, { ...fe }) : /* @__PURE__ */ l.createElement(ht, { className: m(s.pager({})), ...fe })), nt = (t, r) => /* @__PURE__ */ l.createElement("col", { key: r.toString(), width: p(t) }), it = (Se = e.cells) != null && Se.footerCell || u.current.some((t) => {
|
|
431
|
+
var r;
|
|
432
|
+
return !!(t.footerCell || (r = t.cells) != null && r.footerCell);
|
|
433
|
+
}) ? /* @__PURE__ */ l.createElement(
|
|
434
|
+
kt,
|
|
435
|
+
{
|
|
436
|
+
size: w,
|
|
437
|
+
staticHeaders: e.scrollable !== "none",
|
|
438
|
+
row: /* @__PURE__ */ l.createElement(
|
|
439
|
+
zt,
|
|
440
|
+
{
|
|
441
|
+
cells: e.cells,
|
|
442
|
+
idPrefix: v,
|
|
443
|
+
columns: u.current,
|
|
444
|
+
ariaRowIndex: K + 1
|
|
445
|
+
}
|
|
446
|
+
),
|
|
447
|
+
cols: y.map(nt)
|
|
448
|
+
}
|
|
449
|
+
) : null, be = /* @__PURE__ */ l.createElement($t, null, y.map((t, r) => /* @__PURE__ */ l.createElement(
|
|
450
|
+
"col",
|
|
451
|
+
{
|
|
452
|
+
key: r.toString(),
|
|
453
|
+
className: Ne(t.field, e.sort) ? m(s.sorted({})) : void 0,
|
|
454
|
+
width: p(t)
|
|
455
|
+
}
|
|
456
|
+
))), ye = e.reorderable || D, { detail: il, cells: ol, ...he } = e, Ce = /* @__PURE__ */ l.createElement(
|
|
457
|
+
"tbody",
|
|
458
|
+
{
|
|
459
|
+
role: "rowgroup",
|
|
460
|
+
className: m(s.tbody({})),
|
|
461
|
+
...Ct
|
|
462
|
+
},
|
|
463
|
+
Q
|
|
464
|
+
);
|
|
465
|
+
let X = Ce;
|
|
466
|
+
if (G && (X = /* @__PURE__ */ l.createElement(
|
|
467
|
+
ll,
|
|
468
|
+
{
|
|
469
|
+
unstyled: s,
|
|
470
|
+
columns: u.current,
|
|
471
|
+
rowReorderSettings: e.rowReorderable
|
|
472
|
+
},
|
|
473
|
+
Ce
|
|
474
|
+
)), e.scrollable === "none")
|
|
475
|
+
return /* @__PURE__ */ l.createElement(
|
|
476
|
+
Pe,
|
|
477
|
+
{
|
|
478
|
+
gridRef: ee,
|
|
479
|
+
gridProps: he,
|
|
480
|
+
columnsRef: $(),
|
|
481
|
+
columnsMapRef: x,
|
|
482
|
+
dataRef: b,
|
|
483
|
+
slicedData: V,
|
|
484
|
+
isFixedVirtualScroll: J === j,
|
|
485
|
+
id: R,
|
|
486
|
+
total: I,
|
|
487
|
+
detailExpandable: !!e.detail
|
|
488
|
+
},
|
|
489
|
+
/* @__PURE__ */ l.createElement(ze, null, /* @__PURE__ */ l.createElement(
|
|
490
|
+
"div",
|
|
491
|
+
{
|
|
492
|
+
id: e.id,
|
|
493
|
+
style: e.style,
|
|
494
|
+
className: m(s.wrapper({ size: w }), e.className),
|
|
495
|
+
"aria-label": e.ariaLabel,
|
|
496
|
+
...ke
|
|
497
|
+
},
|
|
498
|
+
re,
|
|
499
|
+
ie,
|
|
500
|
+
/* @__PURE__ */ l.createElement(
|
|
501
|
+
Ut,
|
|
502
|
+
{
|
|
503
|
+
selectable: e.selectable,
|
|
504
|
+
className: m(s.table({ size: w }))
|
|
505
|
+
},
|
|
506
|
+
be,
|
|
507
|
+
oe,
|
|
508
|
+
/* @__PURE__ */ l.createElement(Le, { rowReorderable: G }, X)
|
|
509
|
+
),
|
|
510
|
+
me && /* @__PURE__ */ l.createElement(Ae, null, O.length ? O : /* @__PURE__ */ l.createElement(Ke, null)),
|
|
511
|
+
ye && /* @__PURE__ */ l.createElement(l.Fragment, null, /* @__PURE__ */ l.createElement(Be, null), /* @__PURE__ */ l.createElement(Ve, null))
|
|
512
|
+
)),
|
|
513
|
+
ne,
|
|
514
|
+
e.pageable && ge,
|
|
515
|
+
/* @__PURE__ */ l.createElement(_e, { loader: e.loader, showLoader: e.showLoader })
|
|
516
|
+
);
|
|
517
|
+
let _ = e.style || {};
|
|
518
|
+
return N && (_.height || (_ = Object.assign({}, _, { height: "450px" }))), /* @__PURE__ */ l.createElement(
|
|
519
|
+
Pe,
|
|
520
|
+
{
|
|
521
|
+
gridRef: ee,
|
|
522
|
+
gridProps: he,
|
|
523
|
+
columnsRef: $(),
|
|
524
|
+
columnsMapRef: x,
|
|
525
|
+
dataRef: b,
|
|
526
|
+
slicedData: V,
|
|
527
|
+
isFixedVirtualScroll: J === j,
|
|
528
|
+
id: R,
|
|
529
|
+
total: I,
|
|
530
|
+
detailExpandable: !!e.detail
|
|
531
|
+
},
|
|
532
|
+
/* @__PURE__ */ l.createElement(ze, null, /* @__PURE__ */ l.createElement(
|
|
533
|
+
"div",
|
|
534
|
+
{
|
|
535
|
+
id: e.id,
|
|
536
|
+
style: _,
|
|
537
|
+
className: m(
|
|
538
|
+
s.wrapper({
|
|
539
|
+
size: w,
|
|
540
|
+
virtual: N
|
|
541
|
+
}),
|
|
542
|
+
e.className
|
|
543
|
+
),
|
|
544
|
+
"aria-label": e.ariaLabel,
|
|
545
|
+
...ke
|
|
546
|
+
},
|
|
547
|
+
re,
|
|
548
|
+
ie,
|
|
549
|
+
/* @__PURE__ */ l.createElement(
|
|
550
|
+
"div",
|
|
551
|
+
{
|
|
552
|
+
className: m(s.ariaRoot({})),
|
|
553
|
+
role: "grid",
|
|
554
|
+
"aria-colcount": y.length,
|
|
555
|
+
"aria-rowcount": I,
|
|
556
|
+
id: R,
|
|
557
|
+
"aria-label": L.toLanguageString(Oe, pt[Oe])
|
|
558
|
+
},
|
|
559
|
+
oe,
|
|
560
|
+
/* @__PURE__ */ l.createElement("div", { className: m(s.container({})), role: "presentation" }, /* @__PURE__ */ l.createElement(Xt, null, /* @__PURE__ */ l.createElement("div", { className: m(s.content({})), role: "presentation" }, /* @__PURE__ */ l.createElement("div", { className: m(s.tableWrap({})), role: "presentation" }, /* @__PURE__ */ l.createElement(
|
|
561
|
+
Qt,
|
|
562
|
+
{
|
|
563
|
+
selectable: e.selectable,
|
|
564
|
+
tableClassName: m(
|
|
565
|
+
s.table({
|
|
566
|
+
size: w
|
|
567
|
+
})
|
|
568
|
+
),
|
|
569
|
+
tableStyle: { userSelect: tt }
|
|
570
|
+
},
|
|
571
|
+
be,
|
|
572
|
+
/* @__PURE__ */ l.createElement(Le, { rowReorderable: G }, X)
|
|
573
|
+
), me && /* @__PURE__ */ l.createElement(Ae, null, O.length ? O : /* @__PURE__ */ l.createElement(Ke, null))), N && /* @__PURE__ */ l.createElement(
|
|
574
|
+
"div",
|
|
575
|
+
{
|
|
576
|
+
className: m(s.heightContainer({})),
|
|
577
|
+
role: "presentation"
|
|
578
|
+
},
|
|
579
|
+
/* @__PURE__ */ l.createElement(Yt, { isVirtualScroll: N })
|
|
580
|
+
)))),
|
|
581
|
+
it,
|
|
582
|
+
ye && /* @__PURE__ */ l.createElement(l.Fragment, null, /* @__PURE__ */ l.createElement(Be, null), /* @__PURE__ */ l.createElement(Ve, null)),
|
|
583
|
+
/* @__PURE__ */ l.createElement(jt, null)
|
|
584
|
+
),
|
|
585
|
+
ne,
|
|
586
|
+
e.pageable && ge,
|
|
587
|
+
/* @__PURE__ */ l.createElement(_e, { loader: e.loader, showLoader: e.showLoader })
|
|
588
|
+
))
|
|
589
|
+
);
|
|
590
|
+
});
|
|
591
|
+
nl.displayName = "KendoReactGridComponent";
|
|
592
|
+
export {
|
|
593
|
+
nl as GridComponent
|
|
594
|
+
};
|