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